Repository navigation
feat: Sign in on first use from serve - #23
Merged
Merged
Conversation
A serve with no credential for hosted storage (no SLIVINGDOC_TOKEN, no usable stored login, no bucket) no longer refuses to start. It serves both tools and, on the first tool call, runs the same device login as 'slivingdoc login' in the background. While the person has not approved it, the call answers STORAGE_FAILURE/SIGN_IN_REQUIRED with the approval page and code, which the agent passes on; once approved, the key is stored and the call serves the login's default space. Several servers on one machine share one sign-in through signin.lock and signin.json beside the credentials file. A login that reaches no space creates "notes". A stored login that still cannot reach a space answers SETUP_REQUIRED with the startup refusal's text. --login never (SLIVINGDOC_LOGIN=never) keeps the old refusal; pull and commit are unchanged.
The first-use sign-in stored the login, then created "notes" and set it as the default. A server polling the credentials file in between read a login without a default space and answered SETUP_REQUIRED. Creating the space first lets the one store write list it as the only space and make it the default.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
slivingdoc servewithout a hosted credential used to exit withbucket is required. Now it starts, serves both tools, and signs in on the first tool call, so MCP hosts such as clai hub agents need no separateslivingdoc login. The server stays local over stdio and reuses the existing device login; the cloud side is unchanged.Behavior
STORAGE_FAILURE/SIGN_IN_REQUIRED(retryable) with the page and code to open.loginstores it and the call serves the default space. An account with no space getsnotes.signin.lockandsignin.json(no secrets).SETUP_REQUIRED(not retryable).--login never/SLIVINGDOC_LOGIN=neverkeeps the old refusal.pullandcommitare unchanged.Tests
New hosted scenarios cover first use, shared sign-in, first-space creation, denial and retry, and
--login never, plus unit tests. Lint is clean.go test ./...passes except three chmod tests that also fail onmasterwhen run as root.