shadok-ai 0.17.56 → 0.17.57
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 +6 -3
- package/dist/first-agent.d.ts +9 -0
- package/dist/first-agent.js +17 -5
- package/dist/first-agent.js.map +1 -1
- package/dist/server.js +12 -0
- package/dist/server.js.map +1 -1
- package/dist/spawn-steps.d.ts +9 -0
- package/dist/spawn-steps.js +11 -0
- package/dist/spawn-steps.js.map +1 -0
- package/package.json +1 -1
- package/public/index.html +94 -2
- package/public/spawn-steps.d.ts +4 -0
- package/public/spawn-steps.js +30 -0
package/README.md
CHANGED
|
@@ -82,7 +82,9 @@ Enter to skip; you can add it later from the web UI).
|
|
|
82
82
|
agent is a round avatar with a presence dot (green ready, red working, hollow
|
|
83
83
|
offline). A group's icon opens the icon picker: choose from the grid, type any
|
|
84
84
|
emoji, or **type a word** (`rocket`, `bug`, `money`…) to search for one; its
|
|
85
|
-
**+** creates the new agent straight into that group
|
|
85
|
+
**+** creates the new agent straight into that group — while it is being
|
|
86
|
+
born its pane shows the pumping Shadok and the real startup steps ticking off
|
|
87
|
+
(access to Claude, workspace, Claude Code) rather than a black screen. Dragging an agent onto a
|
|
86
88
|
group files it there, dragging groups reorders them, and double-clicking a name
|
|
87
89
|
renames it — a group can also be renamed by clicking its name at the top of the
|
|
88
90
|
agents column. A question the agent asks shows as an *Approval requested* card. The
|
|
@@ -418,8 +420,9 @@ Enter to skip; you can add it later from the web UI).
|
|
|
418
420
|
a brand-new instance (which is signed out at boot, so there is nothing to
|
|
419
421
|
spawn yet). The condition is "no channel", which makes it idempotent: it never
|
|
420
422
|
appears twice.
|
|
421
|
-
While it is being started the central panel says so — *
|
|
422
|
-
|
|
423
|
+
While it is being started the central panel says so — *your first agent is
|
|
424
|
+
waking up…*, with the real steps ticking off (access to Claude, workspace,
|
|
425
|
+
Claude Code) — instead of the *no agent open* invitation, which would ask you to
|
|
423
426
|
create a second one while the first is being born. It is a status, not a
|
|
424
427
|
screen: nothing to click, nothing to dismiss, and it ends on its own whichever
|
|
425
428
|
way the spawn goes (started, refused because the instance is signed out,
|
package/dist/first-agent.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Connected } from "./connect-gate.js";
|
|
2
|
+
import { type SpawnStep } from "./spawn-steps.js";
|
|
2
3
|
/**
|
|
3
4
|
* The lead agent an instance starts life with.
|
|
4
5
|
*
|
|
@@ -79,6 +80,10 @@ export interface FirstAgentStatus {
|
|
|
79
80
|
pending: boolean;
|
|
80
81
|
/** Why — the plan's reason once one has been computed, before that "starting". */
|
|
81
82
|
reason: FirstAgentPlan["reason"] | "starting" | "idle";
|
|
83
|
+
/** The spawn step the server last announced (src/spawn-steps.ts), so the
|
|
84
|
+
* page's "starting" panel shows the same real progress as a tab's loader.
|
|
85
|
+
* Null before the first one and whenever nothing is pending. */
|
|
86
|
+
step: SpawnStep | null;
|
|
82
87
|
}
|
|
83
88
|
/** A copy, so no caller can hold a handle on the state and edit it. */
|
|
84
89
|
export declare function firstAgentStatus(): FirstAgentStatus;
|
|
@@ -95,6 +100,10 @@ export declare function firstAgentStatus(): FirstAgentStatus;
|
|
|
95
100
|
* pending by definition.
|
|
96
101
|
*/
|
|
97
102
|
export declare function announceFirstAgent(channelCount: number): void;
|
|
103
|
+
/** Record the step the lead's spawn has reached. Ignored once the wait is over
|
|
104
|
+
* (a late message must not put a step back on a settled status) and for
|
|
105
|
+
* anything that is not a known step. */
|
|
106
|
+
export declare function noteFirstAgentStep(step: unknown): void;
|
|
98
107
|
/** The one way out of `pending`. Never conditional: every reason ends the wait. */
|
|
99
108
|
export declare function settleFirstAgent(reason: FirstAgentPlan["reason"]): void;
|
|
100
109
|
/**
|
package/dist/first-agent.js
CHANGED
|
@@ -2,6 +2,7 @@ import { MAIN_GROUP_ID } from "./groups.js";
|
|
|
2
2
|
import WebSocket from "ws";
|
|
3
3
|
import { loadChannels } from "./channels.js";
|
|
4
4
|
import { BOSS_PROFILE_NAME } from "./profiles.js";
|
|
5
|
+
import { isSpawnStep } from "./spawn-steps.js";
|
|
5
6
|
/**
|
|
6
7
|
* The lead agent an instance starts life with.
|
|
7
8
|
*
|
|
@@ -50,7 +51,7 @@ export function firstAgentPlan(input) {
|
|
|
50
51
|
return { spawn: false, reason: "not-signed-in" };
|
|
51
52
|
return { spawn: true, reason: "first-boot", name: FIRST_AGENT_NAME, profile: BOSS_PROFILE_NAME };
|
|
52
53
|
}
|
|
53
|
-
let status = { pending: false, reason: "idle" };
|
|
54
|
+
let status = { pending: false, reason: "idle", step: null };
|
|
54
55
|
/** A copy, so no caller can hold a handle on the state and edit it. */
|
|
55
56
|
export function firstAgentStatus() {
|
|
56
57
|
return { ...status };
|
|
@@ -70,12 +71,20 @@ export function firstAgentStatus() {
|
|
|
70
71
|
export function announceFirstAgent(channelCount) {
|
|
71
72
|
status =
|
|
72
73
|
channelCount > 0
|
|
73
|
-
? { pending: false, reason: "channels-exist" }
|
|
74
|
-
: { pending: true, reason: "starting" };
|
|
74
|
+
? { pending: false, reason: "channels-exist", step: null }
|
|
75
|
+
: { pending: true, reason: "starting", step: null };
|
|
76
|
+
}
|
|
77
|
+
/** Record the step the lead's spawn has reached. Ignored once the wait is over
|
|
78
|
+
* (a late message must not put a step back on a settled status) and for
|
|
79
|
+
* anything that is not a known step. */
|
|
80
|
+
export function noteFirstAgentStep(step) {
|
|
81
|
+
if (!status.pending || !isSpawnStep(step))
|
|
82
|
+
return;
|
|
83
|
+
status = { ...status, step };
|
|
75
84
|
}
|
|
76
85
|
/** The one way out of `pending`. Never conditional: every reason ends the wait. */
|
|
77
86
|
export function settleFirstAgent(reason) {
|
|
78
|
-
status = { pending: false, reason };
|
|
87
|
+
status = { pending: false, reason, step: null };
|
|
79
88
|
}
|
|
80
89
|
/** Guards the two callers (boot, sign-in) against firing at the same moment. */
|
|
81
90
|
let inFlight = false;
|
|
@@ -136,7 +145,10 @@ export async function ensureFirstAgent(deps) {
|
|
|
136
145
|
catch {
|
|
137
146
|
return;
|
|
138
147
|
}
|
|
139
|
-
if (m.type === "
|
|
148
|
+
if (m.type === "starting") {
|
|
149
|
+
noteFirstAgentStep(m.step);
|
|
150
|
+
}
|
|
151
|
+
else if (m.type === "ready" && m.sessionId) {
|
|
140
152
|
deps.onReady(m.sessionId, plan.name);
|
|
141
153
|
finish();
|
|
142
154
|
}
|
package/dist/first-agent.js.map
CHANGED
|
@@ -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;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;
|
|
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;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAE/D;;;;;;;;;;;GAWG;AAEH,uDAAuD;AACvD;oFACoF;AACpF,MAAM,UAAU,iBAAiB,CAAC,QAAkD;IAClF,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,aAAa,CAAC,CAAC,MAAM,CAAC;AACrF,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAA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,CAAC,IAAI,CAAC,CAAC;gBAC7B,CAAC;qBAAM,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;oBAC7C,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,IAAK,CAAC,CAAC;oBACtC,MAAM,EAAE,CAAC;gBACX,CAAC;qBAAM,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;oBACrD,MAAM,EAAE,CAAC;gBACX,CAAC;YACH,CAAC,CAAC,CAAC;YACH,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACvB,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,QAAQ,GAAG,KAAK,CAAC;QACjB,0EAA0E;QAC1E,0EAA0E;QAC1E,4EAA4E;QAC5E,4EAA4E;QAC5E,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -7936,6 +7936,16 @@ wss.on("connection", (ws, req) => {
|
|
|
7936
7936
|
// Install the `claude` CLI first if it's missing: otherwise the auth
|
|
7937
7937
|
// probe below (it runs `claude auth status`) can't run and reads as
|
|
7938
7938
|
// "unknown", and the spawn itself would throw "posix_spawnp failed".
|
|
7939
|
+
// A FRESH spawn tells its client where it is (public/spawn-steps.js
|
|
7940
|
+
// draws the loader from it), each step just BEFORE the work it names.
|
|
7941
|
+
// A resume shows its history instead, so it announces nothing.
|
|
7942
|
+
const freshSpawn = !msg.resume && !msg.continue;
|
|
7943
|
+
const announceStep = (step) => {
|
|
7944
|
+
if (!freshSpawn)
|
|
7945
|
+
return;
|
|
7946
|
+
send({ type: "starting", step });
|
|
7947
|
+
};
|
|
7948
|
+
announceStep("connect");
|
|
7939
7949
|
const claude = await ensureClaudeOnce();
|
|
7940
7950
|
if (!claude.ok)
|
|
7941
7951
|
return fail(claude.error);
|
|
@@ -8088,6 +8098,7 @@ wss.on("connection", (ws, req) => {
|
|
|
8088
8098
|
if (early)
|
|
8089
8099
|
return fail(early.message, early.code, early.user);
|
|
8090
8100
|
}
|
|
8101
|
+
announceStep("workspace");
|
|
8091
8102
|
if (msg.worktree && !resumed && isGitRepo(cwd)) {
|
|
8092
8103
|
try {
|
|
8093
8104
|
// Create the checkout under the DROP USER's own home (not the
|
|
@@ -8310,6 +8321,7 @@ wss.on("connection", (ws, req) => {
|
|
|
8310
8321
|
// assigned, else the one the client created it in.
|
|
8311
8322
|
pendingCtx.set(id, { group: agentGroupId ?? requestedGroupId, createdBy: initialCreatedBy ?? null });
|
|
8312
8323
|
}
|
|
8324
|
+
announceStep("claude");
|
|
8313
8325
|
session = await createSession(id, effectiveCwd, args, worktree, profile, model, effort, spawnActor({ account: me?.name, origin, peer: callerPeer, parent: parentAtStart, agent: callerAgent?.name }), dropUser, agentGroupId);
|
|
8314
8326
|
// One Live per agent (shared-ledger [5d8d]). We only reach here when
|
|
8315
8327
|
// there was no live session to attach to — but `existing` may be a
|