@adhdev/mesh-shared 1.0.82-rc.4 → 1.0.82-rc.41
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/dist/assistant-protocol.d.ts +161 -6
- package/dist/decision-push-relay.d.ts +20 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1197 -118
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1107 -118
- package/dist/index.mjs.map +1 -1
- package/dist/launch-defaults.d.ts +196 -0
- package/dist/mesh-tool-names.d.ts +2 -2
- package/dist/mesh-vocabulary.d.ts +13 -4
- package/dist/mission-git-state.d.ts +83 -0
- package/dist/mission-items.d.ts +202 -0
- package/dist/node-facts.d.ts +75 -1
- package/dist/outbound-message.d.ts +9 -2
- package/dist/path-ownership.d.ts +1 -1
- package/dist/protocol/daemon-server.d.ts +42 -2
- package/dist/protocol/dashboard-daemon-p2p.d.ts +1 -1
- package/dist/protocol/dashboard-server.d.ts +20 -2
- package/dist/provider-approval.d.ts +36 -0
- package/dist/provider-question.d.ts +19 -0
- package/dist/quota-freshness.d.ts +65 -0
- package/dist/relay-reprobe.d.ts +52 -0
- package/dist/release.d.ts +90 -0
- package/dist/role-launch.d.ts +11 -0
- package/dist/session-launch.d.ts +10 -22
- package/dist/slot-proposal.d.ts +14 -0
- package/dist/task-source-phase.d.ts +75 -0
- package/dist/turn-evidence.d.ts +29 -13
- package/dist/turn-ipc-mission.d.ts +68 -1
- package/dist/turn-ipc-queue.d.ts +19 -0
- package/dist/turn-ipc.d.ts +2 -2
- package/dist/types.d.ts +1 -0
- package/dist/worker-protocol.d.ts +1 -1
- package/package.json +1 -1
- package/src/assistant-protocol.ts +302 -6
- package/src/daemon-normalize.ts +7 -5
- package/src/decision-push-relay.ts +23 -0
- package/src/index.ts +12 -0
- package/src/keyed-doc-delta.ts +9 -1
- package/src/launch-defaults.ts +170 -0
- package/src/mesh-tool-names.ts +16 -0
- package/src/mesh-vocabulary.ts +12 -2
- package/src/mission-git-state.ts +112 -0
- package/src/mission-items.ts +421 -0
- package/src/node-facts.ts +70 -1
- package/src/outbound-message.ts +19 -0
- package/src/path-ownership.ts +4 -6
- package/src/protocol/daemon-server.ts +37 -2
- package/src/protocol/dashboard-server.ts +13 -2
- package/src/provider-approval.ts +59 -0
- package/src/provider-question.ts +31 -0
- package/src/quota-freshness.ts +139 -0
- package/src/relay-reprobe.ts +117 -0
- package/src/release.ts +121 -0
- package/src/role-launch.ts +51 -0
- package/src/session-launch.ts +17 -1
- package/src/slot-proposal.ts +61 -2
- package/src/task-source-phase.ts +61 -0
- package/src/turn-evidence.ts +27 -20
- package/src/turn-ipc-mission.ts +121 -11
- package/src/turn-ipc-queue.ts +29 -1
- package/src/turn-ipc-turn.ts +1 -1
- package/src/turn-ipc.ts +1 -0
- package/src/types.ts +1 -0
- package/src/worker-protocol.ts +15 -0
|
@@ -11,30 +11,58 @@
|
|
|
11
11
|
* - the daemon-only verbs (launch / MCP-only pull / owner actions) that have
|
|
12
12
|
* no tool.
|
|
13
13
|
*
|
|
14
|
-
* Assistant tools
|
|
15
|
-
*
|
|
16
|
-
* never publish them.
|
|
14
|
+
* Assistant-specific tools remain separate from mesh tools. Driver discovery
|
|
15
|
+
* (list/describe) is shared across all three modes; invoke remains Worker-only.
|
|
17
16
|
*/
|
|
18
|
-
export declare const ASSISTANT_TOOLS: readonly ["projects", "project_status", "project_send", "project_read", "project_add", "discover_repos", "memory", "skill_view", "skill_manage", "project_note"];
|
|
17
|
+
export declare const ASSISTANT_TOOLS: readonly ["projects", "environment", "assistant_action", "project_watch", "project_status", "project_send", "project_read", "project_add", "project_attach_remote", "discover_repos", "memory", "memory_search", "skill_view", "skill_manage", "project_note", "launch_defaults", "launch_defaults_set", "driver_list", "driver_describe", "artifact_list", "artifact_read", "decision_answer", "decision_request", "session_control"];
|
|
19
18
|
export type AssistantTool = typeof ASSISTANT_TOOLS[number];
|
|
20
19
|
export declare function isAssistantTool(value: unknown): value is AssistantTool;
|
|
21
20
|
/** Daemon verb names (§4.4 table + the five verbs below it). */
|
|
22
21
|
export declare const ASSISTANT_VERB: {
|
|
22
|
+
readonly driverList: "driver_list";
|
|
23
|
+
readonly driverDescribe: "driver_describe";
|
|
23
24
|
readonly projects: "assistant_projects";
|
|
25
|
+
readonly environment: "assistant_environment";
|
|
26
|
+
readonly action: "assistant_action";
|
|
27
|
+
readonly watch: "assistant_project_watch";
|
|
28
|
+
readonly executionState: "assistant_execution_state";
|
|
29
|
+
readonly executionSettings: "assistant_execution_settings";
|
|
24
30
|
readonly projectStatus: "assistant_project_status";
|
|
25
31
|
readonly projectSend: "assistant_project_send";
|
|
26
32
|
readonly projectRead: "assistant_project_read";
|
|
27
33
|
readonly projectAdd: "assistant_project_add";
|
|
34
|
+
readonly projectAttachRemote: "assistant_project_attach_remote";
|
|
28
35
|
readonly discoverRepos: "assistant_discover_repos";
|
|
29
36
|
readonly memory: "assistant_memory";
|
|
37
|
+
/** Pull-only FTS search over the archive tier (memory design 2026-11-01 §3.4). */
|
|
38
|
+
readonly memorySearch: "assistant_memory_search";
|
|
30
39
|
readonly skillView: "assistant_skill_view";
|
|
31
40
|
readonly skillManage: "assistant_skill_manage";
|
|
32
41
|
readonly projectNote: "assistant_project_note";
|
|
42
|
+
readonly launchDefaults: "assistant_launch_defaults";
|
|
43
|
+
readonly launchDefaultsSet: "assistant_launch_defaults_set";
|
|
44
|
+
readonly artifactList: "assistant_artifact_list";
|
|
45
|
+
readonly artifactRead: "assistant_artifact_read";
|
|
46
|
+
/** Owner-decision inbox (structured-missions design 2026-10-28 §6.3): the owner's words recorded as answers. */
|
|
47
|
+
readonly decisionAnswer: "assistant_decision_answer";
|
|
48
|
+
/** Register a plain-text question a coordinator put to the owner as a decision item (§5.2). */
|
|
49
|
+
readonly decisionRequest: "assistant_decision_request";
|
|
50
|
+
/** Stop / restart / switch the provider of a coordinator, worker or the assistant session (handoff design 2026-11-01 §4). */
|
|
51
|
+
readonly sessionControl: "assistant_session_control";
|
|
33
52
|
readonly launch: "launch_assistant";
|
|
34
53
|
readonly pendingRelays: "assistant_pending_relays";
|
|
35
54
|
readonly stagedResolve: "assistant_staged_resolve";
|
|
36
55
|
readonly storeAdmin: "assistant_store_admin";
|
|
37
56
|
readonly importSkills: "assistant_import_skills";
|
|
57
|
+
/** Owner skill list (attach/view counts, save proposals, recent skill metrics); reads move no counter. */
|
|
58
|
+
readonly skillsList: "assistant_skills_list";
|
|
59
|
+
/** Owner: what the assistant remembered recently, with undo handles (memory design §3.2). */
|
|
60
|
+
readonly memoryDigest: "assistant_memory_digest";
|
|
61
|
+
/** Owner: reverse one remembered write or one batch (memory design §3.2). Never an assistant tool. */
|
|
62
|
+
readonly memoryUndo: "assistant_memory_undo";
|
|
63
|
+
/** Projects the assistant is following (open relay threads) — list / stop following. */
|
|
64
|
+
readonly threads: "assistant_threads";
|
|
65
|
+
readonly threadClose: "assistant_thread_close";
|
|
38
66
|
};
|
|
39
67
|
export type AssistantVerb = typeof ASSISTANT_VERB[keyof typeof ASSISTANT_VERB];
|
|
40
68
|
/** The daemon verb each assistant tool calls. */
|
|
@@ -50,11 +78,138 @@ export declare const ASSISTANT_WRITE_TOOLS: readonly AssistantTool[];
|
|
|
50
78
|
export declare const ASSISTANT_OWNER_VERBS: readonly AssistantVerb[];
|
|
51
79
|
/** The only assistant verbs accepted while an idle review turn is open (§4.10.7). */
|
|
52
80
|
export declare const ASSISTANT_REVIEW_TURN_VERBS: readonly AssistantVerb[];
|
|
53
|
-
/**
|
|
54
|
-
* Env var the daemon sets on the assistant CLI's process (§4.5), read by the
|
|
81
|
+
/** Env var the daemon sets on the assistant CLI's process (§4.5), read by the
|
|
55
82
|
* assistant MCP server and forwarded on every verb as
|
|
56
83
|
* `ASSISTANT_SESSION_ID_ARG`. Routing / ownership only — never an auth gate.
|
|
57
84
|
*/
|
|
58
85
|
export declare const ASSISTANT_SESSION_ID_ENV = "ADHDEV_ASSISTANT_SESSION_ID";
|
|
59
86
|
/** Request arg carrying the calling assistant session id. */
|
|
60
87
|
export declare const ASSISTANT_SESSION_ID_ARG = "assistantSessionId";
|
|
88
|
+
/**
|
|
89
|
+
* Conceptual single-assistant slot in the verified account namespace.
|
|
90
|
+
* Fixed to `'personal'` — one logical assistant per account with one
|
|
91
|
+
* owner-selected active execution daemon binding per project ACL.
|
|
92
|
+
*/
|
|
93
|
+
export declare const ASSISTANT_ACCOUNT_SLOT: "personal";
|
|
94
|
+
export type AssistantAccountSlot = typeof ASSISTANT_ACCOUNT_SLOT;
|
|
95
|
+
/**
|
|
96
|
+
* Daemon commands for remote project discovery, host ACL grant/revoke, and
|
|
97
|
+
* assistant-side follow/unfollow. Registered outside `ASSISTANT_VERB` so the
|
|
98
|
+
* assistant MCP server tool/verb parity table remains untouched.
|
|
99
|
+
*/
|
|
100
|
+
export declare const ASSISTANT_REMOTE_PROJECT_COMMAND: "assistant_remote_project";
|
|
101
|
+
export declare const ASSISTANT_REMOTE_PROJECT_CATALOG_COMMAND: "assistant_remote_project_catalog";
|
|
102
|
+
export declare const ASSISTANT_REMOTE_PROJECT_ACCESS_COMMAND: "assistant_remote_project_access";
|
|
103
|
+
export declare const ASSISTANT_REMOTE_FOLLOW_COMMAND: "assistant_remote_follow";
|
|
104
|
+
/**
|
|
105
|
+
* Narrow operations a non-roster follower deputy is permitted to invoke on
|
|
106
|
+
* `assistant_remote_project` when the host's `assistantRemoteAccess` ACL is active.
|
|
107
|
+
* `note`, `terminal`, and `inventory` remain strictly roster-member-only.
|
|
108
|
+
*/
|
|
109
|
+
export declare const ASSISTANT_FOLLOWER_ALLOWED_OPS: readonly ["status", "read", "poll", "report", "send", "artifact_list", "artifact_read", "decision_list", "decision_answer", "decision_request"];
|
|
110
|
+
export type AssistantFollowerAllowedOp = typeof ASSISTANT_FOLLOWER_ALLOWED_OPS[number];
|
|
111
|
+
export declare function isAssistantFollowerAllowedOp(value: unknown): value is AssistantFollowerAllowedOp;
|
|
112
|
+
export declare function followerOpPermitted(op: string, allowedOps: readonly AssistantFollowerAllowedOp[]): boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Host-authoritative narrow project ACL persisted on the hosting daemon's
|
|
115
|
+
* `LocalMeshEntry` in `meshes.json`. Revocation increments `grantRevision`
|
|
116
|
+
* and retains a `'revoked'` tombstone so stale follower caches cannot replay.
|
|
117
|
+
*/
|
|
118
|
+
export interface AssistantRemoteAccessBinding {
|
|
119
|
+
hostDaemonId: string;
|
|
120
|
+
meshId: string;
|
|
121
|
+
accountSlot: AssistantAccountSlot;
|
|
122
|
+
activeDaemonId: string;
|
|
123
|
+
bindingRevision: number;
|
|
124
|
+
grantRevision: number;
|
|
125
|
+
status: 'active' | 'revoked';
|
|
126
|
+
allowedOps: readonly AssistantFollowerAllowedOp[];
|
|
127
|
+
allowCoordinatorLaunch?: boolean;
|
|
128
|
+
allowArtifactRead?: boolean;
|
|
129
|
+
grantedAt: number;
|
|
130
|
+
revokedAt?: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Durable owner-binding receipt persisted in the assistant daemon's
|
|
134
|
+
* `assistant.json`. Survives ordinary daemon restarts and session/provider
|
|
135
|
+
* replacements (`bindSession`), while missing/corrupt/mismatched receipts
|
|
136
|
+
* fail closed until owner reconciliation.
|
|
137
|
+
*/
|
|
138
|
+
export interface AssistantOwnerBindingReceipt {
|
|
139
|
+
accountSlot: AssistantAccountSlot;
|
|
140
|
+
daemonId: string;
|
|
141
|
+
bindingRevision: number;
|
|
142
|
+
boundAt: number | string;
|
|
143
|
+
}
|
|
144
|
+
export type FollowedRemoteProjectState = 'followed' | 'unfollowed' | 'revoked';
|
|
145
|
+
export type RemoteAccessState = 'not_granted' | 'granted_unfollowed' | 'followed' | 'revoked' | 'host_unreachable' | 'binding_mismatch';
|
|
146
|
+
/**
|
|
147
|
+
* Assistant-local followed remote project reference persisted in `assistant.json`.
|
|
148
|
+
* Never injected into `meshes.json`, `mesh-host-records.json`, `mesh-node-state-push.json`,
|
|
149
|
+
* or `inlineMeshCache`.
|
|
150
|
+
*/
|
|
151
|
+
export interface FollowedRemoteProjectEntry {
|
|
152
|
+
/** Canonical key: `${canonicalDaemonId(hostDaemonId)}::${meshId}` */
|
|
153
|
+
key: string;
|
|
154
|
+
hostDaemonId: string;
|
|
155
|
+
hostLabel?: string;
|
|
156
|
+
meshId: string;
|
|
157
|
+
name: string;
|
|
158
|
+
slug: string;
|
|
159
|
+
sanitizedRepoIdentity: string | null;
|
|
160
|
+
repoIdentity?: string;
|
|
161
|
+
accountSlot: AssistantAccountSlot;
|
|
162
|
+
bindingRevision: number;
|
|
163
|
+
grantRevision: number;
|
|
164
|
+
allowCoordinatorLaunch?: boolean;
|
|
165
|
+
allowArtifactRead?: boolean;
|
|
166
|
+
state: FollowedRemoteProjectState;
|
|
167
|
+
followedAt: number | string;
|
|
168
|
+
updatedAt: number | string;
|
|
169
|
+
unfollowedAt?: number | string;
|
|
170
|
+
revokedAt?: number | string;
|
|
171
|
+
revokedReason?: string;
|
|
172
|
+
lastCursor?: string | null;
|
|
173
|
+
coordinatorSessionId?: string | null;
|
|
174
|
+
lastErrorCode?: string;
|
|
175
|
+
lastObserved?: {
|
|
176
|
+
observedAt: number | string;
|
|
177
|
+
coordinatorState?: string;
|
|
178
|
+
coordinatorMissing?: boolean;
|
|
179
|
+
coordinatorPresent?: boolean;
|
|
180
|
+
lastHeadline?: string;
|
|
181
|
+
summary?: string;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Content-free canonical catalog metadata returned by `assistant_remote_project_catalog`
|
|
186
|
+
* for meshes actually hosted on the queried remote daemon.
|
|
187
|
+
*/
|
|
188
|
+
export interface RemoteProjectCatalogItem {
|
|
189
|
+
hostDaemonId: string;
|
|
190
|
+
meshId: string;
|
|
191
|
+
name: string;
|
|
192
|
+
sanitizedRepoIdentity: string | null;
|
|
193
|
+
coordinatorState?: 'none' | 'idle' | 'working' | 'waiting' | string;
|
|
194
|
+
allowCoordinatorLaunch?: boolean;
|
|
195
|
+
allowArtifactRead?: boolean;
|
|
196
|
+
capabilities: {
|
|
197
|
+
status: true;
|
|
198
|
+
read: true;
|
|
199
|
+
poll: true;
|
|
200
|
+
report: true;
|
|
201
|
+
send: true;
|
|
202
|
+
coordinatorPresent?: boolean;
|
|
203
|
+
allowCoordinatorLaunch?: boolean;
|
|
204
|
+
allowArtifactRead?: boolean;
|
|
205
|
+
};
|
|
206
|
+
observedAt: number | string;
|
|
207
|
+
}
|
|
208
|
+
/** Build the canonical `(hostDaemonId, meshId)` key used across assistant follow state. */
|
|
209
|
+
export declare function followedRemoteProjectKey(hostDaemonId: string, meshId: string): string;
|
|
210
|
+
/**
|
|
211
|
+
* Sanitize a repository identity or remote URL into a content-free `host/path`
|
|
212
|
+
* identifier suitable for remote discovery catalogs. Strips credentials, query
|
|
213
|
+
* strings, fragments, and `.git` suffixes, and rejects local filesystem paths.
|
|
214
|
+
*/
|
|
215
|
+
export declare function sanitizeRemoteRepoIdentity(raw: string | null | undefined): string | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opt-in "answer a decision from the push notification" relay (mission 4ae3edf2, owner 2026-10-29).
|
|
3
|
+
*
|
|
4
|
+
* ★ A deliberate, narrow exception to "no dashboard command relay over server WS" (CLAUDE.md).
|
|
5
|
+
* With the user's opt-in setting ON and no dashboard window open, the notification's
|
|
6
|
+
* recommended-option action is POSTed by the service worker to the server, which forwards it to the
|
|
7
|
+
* owning daemon over the existing daemon WS as ONE fixed command. What crosses the server is exactly
|
|
8
|
+
* `{ meshId, itemId, optionId }` (+ the single-use answer token that authorizes it) — never the
|
|
9
|
+
* question, context or free text. Shared so the server's frame and the daemon's ingress cannot drift.
|
|
10
|
+
*/
|
|
11
|
+
/** Daemon command the server sends; its only accepted source is {@link DECISION_PUSH_RELAY_SOURCE}. */
|
|
12
|
+
export declare const DECISION_PUSH_RELAY_COMMAND = "mission_decision_push_relay_answer";
|
|
13
|
+
/** Command source the server stamps on the relayed frame (never settable by REST/API callers). */
|
|
14
|
+
export declare const DECISION_PUSH_RELAY_SOURCE = "push_relay";
|
|
15
|
+
/** The complete relayed payload — ids only. */
|
|
16
|
+
export type DecisionPushRelayPayload = {
|
|
17
|
+
meshId: string;
|
|
18
|
+
itemId: string;
|
|
19
|
+
optionId: string;
|
|
20
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './git-normalize';
|
|
|
15
15
|
export * from './session-normalize';
|
|
16
16
|
export * from './node-normalize';
|
|
17
17
|
export * from './node-facts';
|
|
18
|
+
export * from './quota-freshness';
|
|
18
19
|
export * from './workspace-normalize';
|
|
19
20
|
export * from './daemon-normalize';
|
|
20
21
|
export * from './git-summarize';
|
|
@@ -39,4 +40,14 @@ export * from './session-launch';
|
|
|
39
40
|
export * from './turn-ipc';
|
|
40
41
|
export * from './path-ownership';
|
|
41
42
|
export * from './mission-brief';
|
|
43
|
+
export * from './mission-items';
|
|
44
|
+
export * from './mission-git-state';
|
|
45
|
+
export * from './release';
|
|
46
|
+
export * from './decision-push-relay';
|
|
42
47
|
export * from './keyed-doc-delta';
|
|
48
|
+
export * from './provider-approval';
|
|
49
|
+
export * from './provider-question';
|
|
50
|
+
export * from './launch-defaults';
|
|
51
|
+
export * from './role-launch';
|
|
52
|
+
export * from './task-source-phase';
|
|
53
|
+
export * from './relay-reprobe';
|