shadok-ai 0.17.50 → 0.17.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -570,12 +570,16 @@ in to Claude, which happens after boot; the banner stays up until then and the
570
570
  migration **finishes on its own the moment you sign in** (no restart needed).
571
571
  **One-time provisioning:** isolated-group agents authenticate with a
572
572
  subscription token injected into their environment, not a shared credential
573
- file. Until it is set, group spawns are refused with a message naming this step,
574
- and the cockpit shows a red "no subscription token" banner. Provide it from the
575
- cockpit itself — **no shell needed**: as an admin, click **Provide token** on
576
- that banner (or **Replace subscription token…** in the version menu to rotate
577
- it), authorise on your Claude subscription in the browser, and paste the code
578
- back; the server mints and stores it. From Telegram, `/mttoken` then
573
+ file. A fresh instance asks for it through the **Connect Claude** card that opens
574
+ after the welcome tour — **no shell needed**: as an admin, pick **1 month** (an
575
+ interactive login, the agents get your claude.ai connectors, one connection per
576
+ isolated space) or **1 year** (this long-lived token, model access only), click
577
+ **Open claude.ai**, authorise, and paste the code back; the server mints and
578
+ stores it. **I already have a token** takes one minted elsewhere with
579
+ `claude setup-token`. Rotate it later with **Replace subscription token…** in the
580
+ version menu. Until a space is connected, its spawns are refused (`code:
581
+ "space-not-connected"`): an admin gets the card for that space, a member is told
582
+ to ask an admin. From Telegram, `/mttoken` then
579
583
  `/mtcode <code>` do the same. The token is captured and vaulted server-side and
580
584
  is never shown. It is valid for about a year; re-run the card (or `/mttoken`)
581
585
  before it expires. The shell path still works as a fallback: `claude setup-token`
@@ -595,6 +599,24 @@ across OS users (Claude rewrites the credential single-owner on refresh), which
595
599
  is why each user logs in separately. Design:
596
600
  `docs/superpowers/specs/2026-11-04-connectors-via-global-login-design.md`.
597
601
 
602
+ **Git over SSH, per group.** Each group has its own SSH identity: the shared
603
+ *commons* (every public group) reuses the cockpit's historical container key —
604
+ the one already registered on your forge — and every **walled** group (restricted
605
+ or private) gets a key of its own. The keypairs live on the `shadok-data` volume,
606
+ so they survive a recreate even though the agent homes do not, and the private
607
+ half never leaves the server's own 0700 home: a copy is written into each
608
+ agent's `~/.ssh` as that OS user.
609
+
610
+ A key is only an identity once a remote accepts it, so **read a group's public
611
+ key and register it** where its agents must clone or push: `GET /groups/ssh`
612
+ returns one row per group you can see — `{group, name, osUser, publicKey,
613
+ shared}` — and `shared: true` marks the historical key, which you register once
614
+ for every public group. The rows go through the same visibility filter as
615
+ `GET /groups` (a private group stays invisible even to an admin), and only the
616
+ `.pub` half is ever read. A `publicKey: null` means no keypair has been minted
617
+ yet, not an error. Until a group's key is registered, its agents simply cannot
618
+ reach that remote over SSH.
619
+
598
620
  **Persist the group homes (recommended in Docker).** Each dropped agent runs as
599
621
  its own OS user with HOME under `SHADOK_HOME_BASE` (default `/home`), which is
600
622
  **not** on the `shadok-data` volume by default — so a `docker rm` + recreate
@@ -916,8 +938,8 @@ are **never held by the quota guard** (they don't spend your subscription).
916
938
 
917
939
  Three ways to do it:
918
940
 
919
- - **From the cockpit — the easy one.** The sign-in card a fresh instance opens
920
- has a second side, **Another model**: pick a provider (Ollama, a llama.cpp
941
+ - **From the cockpit — the easy one.** The Connect Claude card a fresh instance
942
+ opens has a **Use another model** link: pick a provider (Ollama, a llama.cpp
921
943
  server, DeepSeek, Z.ai/GLM, Moonshot/Kimi, or any Anthropic-compatible
922
944
  server), the address and model are pre-filled, the models a local server
923
945
  serves are listed for you, and **Test** sends one real request before
@@ -1203,7 +1225,8 @@ client, or immediately on an explicit `stop` (which ends it for everyone).
1203
1225
 
1204
1226
  HTTP endpoints (same auth): `/usage`, `/live`, `/sessions`, `/recover`,
1205
1227
  `/diff`, `/channels` (its GET adds a **derived** `crons` field — never stored),
1206
- `/channel` (DELETE), `/groups`, `/crons`, `/timezone`, `/title` (GET/PUT — the
1228
+ `/channel` (DELETE), `/groups`, `/groups/ssh` (GET — the SSH **public** key to
1229
+ register per group, filtered like `/groups`), `/crons`, `/timezone`, `/title` (GET/PUT — the
1207
1230
  cockpit's name, per launch directory: click the header brand to rename it, so
1208
1231
  several cockpits stay apart in the tab bar; an empty PUT reverts to the default),
1209
1232
  `/theme` (GET/PUT — the cockpit's colour palette, per launch directory: an accent
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Can THIS agent authenticate to Claude? — the one question every spawn gate
3
+ * asks, answered from facts the caller gathers (pure, tested).
4
+ *
5
+ * It used to be two unrelated gates: every spawn required the instance's own
6
+ * (root) `claude auth login`, and a privilege-dropped agent additionally
7
+ * required the long-lived token. On a multi-tenant instance the dropped agent
8
+ * uses neither the root login nor, in "login" auth mode, the token — so a fresh
9
+ * hosted instance demanded TWO OAuth round-trips before its first agent, and a
10
+ * login-mode agent was refused for a token it would never use. The gate now
11
+ * checks only the credential the agent will actually run on:
12
+ *
13
+ * - custom model backend → nothing to check;
14
+ * - the server's own user (mono-tenant, or a commons not yet migrated) → the
15
+ * root sign-in;
16
+ * - a dropped user in "token" mode → the token;
17
+ * - a dropped user in "login" mode → that user's own login.
18
+ *
19
+ * Only an OBSERVED absence refuses (invariant 27): an unknown root state or an
20
+ * unread login lets the spawn through. Messages never carry a credential.
21
+ */
22
+ export type Connected = "yes" | "no" | "unknown";
23
+ export interface ConnectFacts {
24
+ multiTenant: boolean;
25
+ customBackend: boolean;
26
+ /** The OS user the agent will run as; null = the server's own user. */
27
+ dropUser: string | null;
28
+ agentAuth: "token" | "login";
29
+ /** MT_CLAUDE_OAUTH_TOKEN present in Main. */
30
+ hasToken: boolean;
31
+ rootAuth: "signed-in" | "signed-out" | "unknown";
32
+ /** `agentLoginInfo(home).loggedIn` for `dropUser`; null = not looked up. */
33
+ userLoggedIn: boolean | null;
34
+ }
35
+ export type ConnectVerdict = {
36
+ ok: true;
37
+ } | {
38
+ ok: false;
39
+ code: "logged-out" | "space-not-connected";
40
+ user: string | null;
41
+ message: string;
42
+ };
43
+ export declare const LOGGED_OUT_MESSAGE = "this shadok-ai instance is not signed in to Claude \u2014 sign in from the cockpit";
44
+ export declare const SPACE_NOT_CONNECTED_MESSAGE = "This space isn't connected to Claude yet \u2014 an admin can connect it from the cockpit.";
45
+ export declare function connectVerdict(f: ConnectFacts): ConnectVerdict;
46
+ /** The verdict as a three-valued state: "unknown" when the deciding fact was not observed. */
47
+ export declare function connectedState(f: ConnectFacts): Connected;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Can THIS agent authenticate to Claude? — the one question every spawn gate
3
+ * asks, answered from facts the caller gathers (pure, tested).
4
+ *
5
+ * It used to be two unrelated gates: every spawn required the instance's own
6
+ * (root) `claude auth login`, and a privilege-dropped agent additionally
7
+ * required the long-lived token. On a multi-tenant instance the dropped agent
8
+ * uses neither the root login nor, in "login" auth mode, the token — so a fresh
9
+ * hosted instance demanded TWO OAuth round-trips before its first agent, and a
10
+ * login-mode agent was refused for a token it would never use. The gate now
11
+ * checks only the credential the agent will actually run on:
12
+ *
13
+ * - custom model backend → nothing to check;
14
+ * - the server's own user (mono-tenant, or a commons not yet migrated) → the
15
+ * root sign-in;
16
+ * - a dropped user in "token" mode → the token;
17
+ * - a dropped user in "login" mode → that user's own login.
18
+ *
19
+ * Only an OBSERVED absence refuses (invariant 27): an unknown root state or an
20
+ * unread login lets the spawn through. Messages never carry a credential.
21
+ */
22
+ export const LOGGED_OUT_MESSAGE = "this shadok-ai instance is not signed in to Claude — sign in from the cockpit";
23
+ export const SPACE_NOT_CONNECTED_MESSAGE = "This space isn't connected to Claude yet — an admin can connect it from the cockpit.";
24
+ export function connectVerdict(f) {
25
+ if (f.customBackend)
26
+ return { ok: true };
27
+ if (f.dropUser === null) {
28
+ return f.rootAuth === "signed-out"
29
+ ? { ok: false, code: "logged-out", user: null, message: LOGGED_OUT_MESSAGE }
30
+ : { ok: true };
31
+ }
32
+ const missing = f.agentAuth === "token" ? !f.hasToken : f.userLoggedIn === false;
33
+ return missing
34
+ ? { ok: false, code: "space-not-connected", user: f.dropUser, message: SPACE_NOT_CONNECTED_MESSAGE }
35
+ : { ok: true };
36
+ }
37
+ /** The verdict as a three-valued state: "unknown" when the deciding fact was not observed. */
38
+ export function connectedState(f) {
39
+ if (!connectVerdict(f).ok)
40
+ return "no";
41
+ if (f.customBackend)
42
+ return "yes";
43
+ if (f.dropUser === null)
44
+ return f.rootAuth === "unknown" ? "unknown" : "yes";
45
+ if (f.agentAuth === "login" && f.userLoggedIn === null)
46
+ return "unknown";
47
+ return "yes";
48
+ }
49
+ //# sourceMappingURL=connect-gate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connect-gate.js","sourceRoot":"","sources":["../src/connect-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAqBH,MAAM,CAAC,MAAM,kBAAkB,GAC7B,+EAA+E,CAAC;AAClF,MAAM,CAAC,MAAM,2BAA2B,GACtC,sFAAsF,CAAC;AAEzF,MAAM,UAAU,cAAc,CAAC,CAAe;IAC5C,IAAI,CAAC,CAAC,aAAa;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;IACzC,IAAI,CAAC,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;QACxB,OAAO,CAAC,CAAC,QAAQ,KAAK,YAAY;YAChC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE;YAC5E,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;IACnB,CAAC;IACD,MAAM,OAAO,GAAG,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,KAAK,KAAK,CAAC;IACjF,OAAO,OAAO;QACZ,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,2BAA2B,EAAE;QACpG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AACnB,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,cAAc,CAAC,CAAe;IAC5C,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,CAAC,CAAC,aAAa;QAAE,OAAO,KAAK,CAAC;IAClC,IAAI,CAAC,CAAC,QAAQ,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;IAC7E,IAAI,CAAC,CAAC,SAAS,KAAK,OAAO,IAAI,CAAC,CAAC,YAAY,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACzE,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type AuthState } from "./claude-auth.js";
1
+ import type { Connected } from "./connect-gate.js";
2
2
  /**
3
3
  * The lead agent an instance starts life with.
4
4
  *
@@ -18,6 +18,21 @@ export declare function countMainChannels(channels: ReadonlyArray<{
18
18
  group?: string | null;
19
19
  }>): number;
20
20
  export declare const FIRST_AGENT_NAME = "general";
21
+ /**
22
+ * Pure: the `start` the lead agent is spawned with. The launch directory and no
23
+ * worktree — this is the main channel, not one of the isolated agents it will go
24
+ * on to spawn. And an EXPLICIT `group: Main`: the spawn is made over the
25
+ * loopback as the bootstrap admin, and on a multi-tenant instance a spawn with no
26
+ * group lands in its creator's private group — the lead agent then lived in the
27
+ * admin's Personal, where nobody else could see it. Mono-tenant ignores the field.
28
+ */
29
+ export declare function firstAgentStartMessage(cwd: string, profile: string | undefined): {
30
+ type: "start";
31
+ cwd: string;
32
+ profile: string | undefined;
33
+ origin: string;
34
+ group: string;
35
+ };
21
36
  export interface FirstAgentPlan {
22
37
  spawn: boolean;
23
38
  reason: "first-boot" | "channels-exist" | "not-signed-in";
@@ -36,7 +51,8 @@ export declare function firstAgentPlan(input: {
36
51
  * the user launches its first agent on demand, so a brand-new private group
37
52
  * must never read as "no channel, spawn a lead". */
38
53
  mainChannelCount: number;
39
- authState: AuthState;
54
+ /** Can the agent this spawns authenticate (src/connect-gate.ts)? */
55
+ connected: Connected;
40
56
  /** The whole instance runs on a custom model backend (src/backend.ts): its
41
57
  * agents carry their own token, so the Claude sign-in is irrelevant. */
42
58
  customBackend?: boolean;
@@ -95,6 +111,9 @@ export declare function ensureFirstAgent(deps: {
95
111
  /** The instance runs on a custom model backend (src/backend.ts) — decided by
96
112
  * the server, which owns both the env and the saved choice. */
97
113
  customBackend?: boolean;
114
+ /** Whether the commons' first agent could authenticate (src/connect-gate.ts),
115
+ * computed by the server, which owns the facts (auth mode, token, logins). */
116
+ connected: () => Promise<Connected>;
98
117
  /** Called with the new session id once the server reports it ready. */
99
118
  onReady: (sessionId: string, name: string) => void;
100
119
  }): Promise<FirstAgentPlan["reason"]>;
@@ -1,7 +1,6 @@
1
1
  import { MAIN_GROUP_ID } from "./groups.js";
2
2
  import WebSocket from "ws";
3
3
  import { loadChannels } from "./channels.js";
4
- import { authStatus } from "./claude-auth.js";
5
4
  import { BOSS_PROFILE_NAME } from "./profiles.js";
6
5
  /**
7
6
  * The lead agent an instance starts life with.
@@ -22,6 +21,17 @@ export function countMainChannels(channels) {
22
21
  return channels.filter((c) => c.group == null || c.group === MAIN_GROUP_ID).length;
23
22
  }
24
23
  export const FIRST_AGENT_NAME = "general";
24
+ /**
25
+ * Pure: the `start` the lead agent is spawned with. The launch directory and no
26
+ * worktree — this is the main channel, not one of the isolated agents it will go
27
+ * on to spawn. And an EXPLICIT `group: Main`: the spawn is made over the
28
+ * loopback as the bootstrap admin, and on a multi-tenant instance a spawn with no
29
+ * group lands in its creator's private group — the lead agent then lived in the
30
+ * admin's Personal, where nobody else could see it. Mono-tenant ignores the field.
31
+ */
32
+ export function firstAgentStartMessage(cwd, profile) {
33
+ return { type: "start", cwd, profile, origin: "boot", group: MAIN_GROUP_ID };
34
+ }
25
35
  /**
26
36
  * Pure: should this instance start its lead agent?
27
37
  *
@@ -36,7 +46,7 @@ export function firstAgentPlan(input) {
36
46
  return { spawn: true, reason: "first-boot", name: FIRST_AGENT_NAME, profile: BOSS_PROFILE_NAME };
37
47
  // "unknown" is not "signed in": the probe failed. Waiting costs one boot,
38
48
  // guessing costs an agent with no credentials — the zombie shape (invariant 27).
39
- if (input.authState !== "signed-in")
49
+ if (input.connected !== "yes")
40
50
  return { spawn: false, reason: "not-signed-in" };
41
51
  return { spawn: true, reason: "first-boot", name: FIRST_AGENT_NAME, profile: BOSS_PROFILE_NAME };
42
52
  }
@@ -85,7 +95,7 @@ export async function ensureFirstAgent(deps) {
85
95
  const plan = firstAgentPlan({
86
96
  mainChannelCount: countMainChannels(loadChannels()),
87
97
  // No probe when it cannot change the answer (~850ms, and a process spawn).
88
- authState: customBackend ? "unknown" : (await authStatus()).state,
98
+ connected: customBackend ? "unknown" : await deps.connected(),
89
99
  customBackend,
90
100
  });
91
101
  if (!plan.spawn) {
@@ -117,14 +127,7 @@ export async function ensureFirstAgent(deps) {
117
127
  };
118
128
  const guard = setTimeout(finish, 60_000);
119
129
  guard.unref?.();
120
- ws.on("open", () => ws.send(JSON.stringify({
121
- type: "start",
122
- // The launch directory, and no worktree: this is the main channel,
123
- // not one of the isolated agents it will go on to spawn.
124
- cwd: deps.cwd,
125
- profile: plan.profile,
126
- origin: "boot",
127
- })));
130
+ ws.on("open", () => ws.send(JSON.stringify(firstAgentStartMessage(deps.cwd, plan.profile))));
128
131
  ws.on("message", (raw) => {
129
132
  let m;
130
133
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"first-agent.js","sourceRoot":"","sources":["../src/first-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,SAAS,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAkB,MAAM,kBAA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