Skip to content

feat: Sign in on first use from serve - #23

Merged
baalimago merged 2 commits into
masterfrom
feat/serve-sign-in-on-first-use
Oct 27, 2026
Merged

baalimago merged 2 commits into
masterfrom
feat/serve-sign-in-on-first-use

Conversation

@baalimago

@baalimago baalimago commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

What

slivingdoc serve without a hosted credential used to exit with bucket 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 separate slivingdoc login. The server stays local over stdio and reuses the existing device login; the cloud side is unchanged.

Behavior

  • The first call starts the device login in the background and waits up to 60 s for approval.
  • Until approved, calls answer STORAGE_FAILURE / SIGN_IN_REQUIRED (retryable) with the page and code to open.
  • Once approved, the key is stored like login stores it and the call serves the default space. An account with no space gets notes.
  • Several servers share one sign-in through signin.lock and signin.json (no secrets).
  • A login that still reaches no space answers SETUP_REQUIRED (not retryable).
  • --login never / SLIVINGDOC_LOGIN=never keeps the old refusal. pull and commit are 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 on master when run as root.

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.
@baalimago baalimago self-assigned this Oct 27, 2026
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.
@baalimago
baalimago merged commit a7a7c88 into master Oct 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant