@adhdev/mesh-shared 1.0.82-rc.22 → 1.0.82-rc.24

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.
@@ -11,15 +11,16 @@
11
11
  * - the daemon-only verbs (launch / MCP-only pull / owner actions) that have
12
12
  * no tool.
13
13
  *
14
- * Assistant tools are a separate set from the mesh tools: none of these names
15
- * belongs in `CANONICAL_MESH_TOOL_NAMES`, and the coordinator/worker MCP modes
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", "environment", "assistant_action", "project_watch", "project_status", "project_send", "project_read", "project_add", "project_attach_remote", "discover_repos", "memory", "skill_view", "skill_manage", "project_note", "launch_defaults", "launch_defaults_set"];
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", "skill_view", "skill_manage", "project_note", "launch_defaults", "launch_defaults_set", "driver_list", "driver_describe"];
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";
24
25
  readonly environment: "assistant_environment";
25
26
  readonly action: "assistant_action";
@@ -61,11 +62,128 @@ export declare const ASSISTANT_WRITE_TOOLS: readonly AssistantTool[];
61
62
  export declare const ASSISTANT_OWNER_VERBS: readonly AssistantVerb[];
62
63
  /** The only assistant verbs accepted while an idle review turn is open (§4.10.7). */
63
64
  export declare const ASSISTANT_REVIEW_TURN_VERBS: readonly AssistantVerb[];
64
- /**
65
- * Env var the daemon sets on the assistant CLI's process (§4.5), read by the
65
+ /** Env var the daemon sets on the assistant CLI's process (§4.5), read by the
66
66
  * assistant MCP server and forwarded on every verb as
67
67
  * `ASSISTANT_SESSION_ID_ARG`. Routing / ownership only — never an auth gate.
68
68
  */
69
69
  export declare const ASSISTANT_SESSION_ID_ENV = "ADHDEV_ASSISTANT_SESSION_ID";
70
70
  /** Request arg carrying the calling assistant session id. */
71
71
  export declare const ASSISTANT_SESSION_ID_ARG = "assistantSessionId";
72
+ /**
73
+ * Conceptual single-assistant slot in the verified account namespace.
74
+ * Fixed to `'personal'` — one logical assistant per account with one
75
+ * owner-selected active execution daemon binding per project ACL.
76
+ */
77
+ export declare const ASSISTANT_ACCOUNT_SLOT: "personal";
78
+ export type AssistantAccountSlot = typeof ASSISTANT_ACCOUNT_SLOT;
79
+ /**
80
+ * Daemon commands for remote project discovery, host ACL grant/revoke, and
81
+ * assistant-side follow/unfollow. Registered outside `ASSISTANT_VERB` so the
82
+ * assistant MCP server tool/verb parity table remains untouched.
83
+ */
84
+ export declare const ASSISTANT_REMOTE_PROJECT_COMMAND: "assistant_remote_project";
85
+ export declare const ASSISTANT_REMOTE_PROJECT_CATALOG_COMMAND: "assistant_remote_project_catalog";
86
+ export declare const ASSISTANT_REMOTE_PROJECT_ACCESS_COMMAND: "assistant_remote_project_access";
87
+ export declare const ASSISTANT_REMOTE_FOLLOW_COMMAND: "assistant_remote_follow";
88
+ /**
89
+ * Narrow operations a non-roster follower deputy is permitted to invoke on
90
+ * `assistant_remote_project` when the host's `assistantRemoteAccess` ACL is active.
91
+ * `note`, `terminal`, and `inventory` remain strictly roster-member-only.
92
+ */
93
+ export declare const ASSISTANT_FOLLOWER_ALLOWED_OPS: readonly ["status", "read", "poll", "report", "send"];
94
+ export type AssistantFollowerAllowedOp = typeof ASSISTANT_FOLLOWER_ALLOWED_OPS[number];
95
+ export declare function isAssistantFollowerAllowedOp(value: unknown): value is AssistantFollowerAllowedOp;
96
+ /**
97
+ * Host-authoritative narrow project ACL persisted on the hosting daemon's
98
+ * `LocalMeshEntry` in `meshes.json`. Revocation increments `grantRevision`
99
+ * and retains a `'revoked'` tombstone so stale follower caches cannot replay.
100
+ */
101
+ export interface AssistantRemoteAccessBinding {
102
+ hostDaemonId: string;
103
+ meshId: string;
104
+ accountSlot: AssistantAccountSlot;
105
+ activeDaemonId: string;
106
+ bindingRevision: number;
107
+ grantRevision: number;
108
+ status: 'active' | 'revoked';
109
+ allowedOps: readonly AssistantFollowerAllowedOp[];
110
+ grantedAt: number;
111
+ revokedAt?: number;
112
+ }
113
+ /**
114
+ * Durable owner-binding receipt persisted in the assistant daemon's
115
+ * `assistant.json`. Survives ordinary daemon restarts and session/provider
116
+ * replacements (`bindSession`), while missing/corrupt/mismatched receipts
117
+ * fail closed until owner reconciliation.
118
+ */
119
+ export interface AssistantOwnerBindingReceipt {
120
+ accountSlot: AssistantAccountSlot;
121
+ daemonId: string;
122
+ bindingRevision: number;
123
+ boundAt: number | string;
124
+ }
125
+ export type FollowedRemoteProjectState = 'followed' | 'unfollowed' | 'revoked';
126
+ export type RemoteAccessState = 'not_granted' | 'granted_unfollowed' | 'followed' | 'revoked' | 'host_unreachable' | 'binding_mismatch';
127
+ /**
128
+ * Assistant-local followed remote project reference persisted in `assistant.json`.
129
+ * Never injected into `meshes.json`, `mesh-host-records.json`, `mesh-node-state-push.json`,
130
+ * or `inlineMeshCache`.
131
+ */
132
+ export interface FollowedRemoteProjectEntry {
133
+ /** Canonical key: `${canonicalDaemonId(hostDaemonId)}::${meshId}` */
134
+ key: string;
135
+ hostDaemonId: string;
136
+ hostLabel?: string;
137
+ meshId: string;
138
+ name: string;
139
+ slug: string;
140
+ sanitizedRepoIdentity: string | null;
141
+ repoIdentity?: string;
142
+ accountSlot: AssistantAccountSlot;
143
+ bindingRevision: number;
144
+ grantRevision: number;
145
+ state: FollowedRemoteProjectState;
146
+ followedAt: number | string;
147
+ updatedAt: number | string;
148
+ unfollowedAt?: number | string;
149
+ revokedAt?: number | string;
150
+ lastCursor?: string | null;
151
+ coordinatorSessionId?: string | null;
152
+ lastErrorCode?: string;
153
+ lastObserved?: {
154
+ observedAt: number | string;
155
+ coordinatorState?: string;
156
+ coordinatorMissing?: boolean;
157
+ coordinatorPresent?: boolean;
158
+ lastHeadline?: string;
159
+ summary?: string;
160
+ };
161
+ }
162
+ /**
163
+ * Content-free canonical catalog metadata returned by `assistant_remote_project_catalog`
164
+ * for meshes actually hosted on the queried remote daemon.
165
+ */
166
+ export interface RemoteProjectCatalogItem {
167
+ hostDaemonId: string;
168
+ meshId: string;
169
+ name: string;
170
+ sanitizedRepoIdentity: string | null;
171
+ coordinatorState?: 'none' | 'idle' | 'working' | 'waiting' | string;
172
+ capabilities: {
173
+ status: true;
174
+ read: true;
175
+ poll: true;
176
+ report: true;
177
+ send: true;
178
+ coordinatorPresent?: boolean;
179
+ };
180
+ observedAt: number | string;
181
+ }
182
+ /** Build the canonical `(hostDaemonId, meshId)` key used across assistant follow state. */
183
+ export declare function followedRemoteProjectKey(hostDaemonId: string, meshId: string): string;
184
+ /**
185
+ * Sanitize a repository identity or remote URL into a content-free `host/path`
186
+ * identifier suitable for remote discovery catalogs. Strips credentials, query
187
+ * strings, fragments, and `.git` suffixes, and rejects local filesystem paths.
188
+ */
189
+ export declare function sanitizeRemoteRepoIdentity(raw: string | null | undefined): string | null;
package/dist/index.d.ts CHANGED
@@ -44,3 +44,4 @@ export * from './keyed-doc-delta';
44
44
  export * from './provider-approval';
45
45
  export * from './provider-question';
46
46
  export * from './launch-defaults';
47
+ export * from './role-launch';