@zelari/core 2.14.0 → 2.16.0

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.
Files changed (37) hide show
  1. package/dist/core/AgentHarness.d.ts +17 -3
  2. package/dist/core/AgentHarness.d.ts.map +1 -1
  3. package/dist/core/AgentHarness.js +9 -2
  4. package/dist/core/AgentHarness.js.map +1 -1
  5. package/dist/core/hooks/lifecycleHookRunner.d.ts +55 -9
  6. package/dist/core/hooks/lifecycleHookRunner.d.ts.map +1 -1
  7. package/dist/core/hooks/lifecycleHookRunner.js +114 -18
  8. package/dist/core/hooks/lifecycleHookRunner.js.map +1 -1
  9. package/dist/core/tools/builtin/shell.d.ts +45 -0
  10. package/dist/core/tools/builtin/shell.d.ts.map +1 -1
  11. package/dist/core/tools/builtin/shell.js +118 -92
  12. package/dist/core/tools/builtin/shell.js.map +1 -1
  13. package/dist/core/tools/registry.d.ts +5 -1
  14. package/dist/core/tools/registry.d.ts.map +1 -1
  15. package/dist/core/tools/registry.js +15 -3
  16. package/dist/core/tools/registry.js.map +1 -1
  17. package/dist/harness/appServer.d.ts +51 -0
  18. package/dist/harness/appServer.d.ts.map +1 -0
  19. package/dist/harness/appServer.js +128 -0
  20. package/dist/harness/appServer.js.map +1 -0
  21. package/dist/harness/appServerTypes.d.ts +61 -0
  22. package/dist/harness/appServerTypes.d.ts.map +1 -0
  23. package/dist/harness/appServerTypes.js +10 -0
  24. package/dist/harness/appServerTypes.js.map +1 -0
  25. package/dist/harness/extensionApi.d.ts +65 -0
  26. package/dist/harness/extensionApi.d.ts.map +1 -0
  27. package/dist/harness/extensionApi.js +125 -0
  28. package/dist/harness/extensionApi.js.map +1 -0
  29. package/dist/harness/extensionApiTypes.d.ts +115 -0
  30. package/dist/harness/extensionApiTypes.d.ts.map +1 -0
  31. package/dist/harness/extensionApiTypes.js +24 -0
  32. package/dist/harness/extensionApiTypes.js.map +1 -0
  33. package/dist/harness/index.d.ts +4 -0
  34. package/dist/harness/index.d.ts.map +1 -1
  35. package/dist/harness/index.js +8 -0
  36. package/dist/harness/index.js.map +1 -1
  37. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/core/tools/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAA2D,MAAM,gBAAgB,CAAC;AAGnG,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAoBjG;;;;;;;GAOG;AACH,MAAM,iBAAiB,GAA2B;IAChD,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,WAAW;IACrB,GAAG,EAAE,WAAW;IAChB,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,YAAY;IACvB,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,WAAW;IACrB,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,YAAY;IACrB,aAAa,EAAE,YAAY;IAC3B,EAAE,EAAE,YAAY;IAChB,GAAG,EAAE,YAAY;IACjB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,cAAc;IACpB,MAAM,EAAE,cAAc;IACtB,SAAS,EAAE,iBAAiB;IAC5B,GAAG,EAAE,iBAAiB;IACtB,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;IAChB,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,IAAI,EAAE,MAAM;CACb,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,oBAAoB,GAAW,CAAC,GAAG,EAAE;IACzC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC;IACjD,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,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1,51 @@
1
+ import type { HarnessTurnResult, RunTurnFn, WorkspaceServices, WorkspaceServicesFactory } from './appServerTypes.js';
2
+ export type { CompletionProofWriteRequest, CompletionProofWriter, HarnessTurnDeps, HarnessTurnResult, LspManagerLike, PolicyCacheLike, RunTurnFn, WorkspaceServices, WorkspaceServicesFactory, } from './appServerTypes.js';
3
+ export interface HarnessSession {
4
+ readonly id: string;
5
+ readonly workspaceRoot: string;
6
+ /** Shared per-workspace services (same instance across sessions). */
7
+ readonly services: WorkspaceServices;
8
+ runTurn(input: Record<string, unknown>): Promise<HarnessTurnResult>;
9
+ /** Ends this session; shared services survive while other sessions use them. */
10
+ dispose(): Promise<void>;
11
+ }
12
+ export interface CreateSessionOptions {
13
+ workspaceRoot: string;
14
+ runTurn: RunTurnFn;
15
+ /** Overrides the server-level factory for this session's workspace. */
16
+ createWorkspaceServices?: WorkspaceServicesFactory | undefined;
17
+ sessionId?: string | undefined;
18
+ }
19
+ export declare class HarnessAppServer {
20
+ private readonly sessions;
21
+ private readonly workspaceServices;
22
+ private readonly sessionCounts;
23
+ private readonly defaultServicesFactory;
24
+ /**
25
+ * Server-owned proof-write tracking: every completionProofWriter call is
26
+ * recorded here as a SETTLED shadow promise, so dispose() can await
27
+ * durability without ever throwing, and a disconnecting client (which
28
+ * only awaits the turn result) cannot cancel the write.
29
+ */
30
+ private readonly pendingProofWrites;
31
+ constructor(options?: {
32
+ createWorkspaceServices?: WorkspaceServicesFactory;
33
+ });
34
+ createSession(options: CreateSessionOptions): HarnessSession;
35
+ getSession(id: string): HarnessSession | undefined;
36
+ listSessions(): string[];
37
+ /** How many proof writes are in flight (diagnostics + tests). */
38
+ pendingProofCount(): number;
39
+ /**
40
+ * Wrap a host writer so every call is tracked server-side. The caller
41
+ * (turn) still sees the real result/rejection; the tracked shadow only
42
+ * observes settlement so dispose() can await it.
43
+ */
44
+ private trackProofWriter;
45
+ /**
46
+ * Full teardown: awaits ALL pending proof writes (never cancels them),
47
+ * disposes every remaining session, then the orphaned workspace services.
48
+ */
49
+ dispose(): Promise<void>;
50
+ }
51
+ //# sourceMappingURL=appServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appServer.d.ts","sourceRoot":"","sources":["../../src/harness/appServer.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAIV,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,2BAA2B,EAC3B,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACpE,gFAAgF;IAChF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,SAAS,CAAC;IACnB,uEAAuE;IACvE,uBAAuB,CAAC,EAAE,wBAAwB,GAAG,SAAS,CAAC;IAC/D,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqC;IAC9D,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwC;IAC1E,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA6B;IAC3D,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAuC;IAC9E;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA4B;gBAEnD,OAAO,GAAE;QAAE,uBAAuB,CAAC,EAAE,wBAAwB,CAAA;KAAO;IAIhF,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,cAAc;IA2D5D,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAIlD,YAAY,IAAI,MAAM,EAAE;IAIxB,iEAAiE;IACjE,iBAAiB,IAAI,MAAM;IAI3B;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAcxB;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAO/B"}
@@ -0,0 +1,128 @@
1
+ /**
2
+ * HarnessAppServer (t29, Pilastro B) — a long-lived, transport-free kernel
3
+ * that owns harness sessions and their per-workspace services.
4
+ *
5
+ * Why: today every headless turn is a fresh process (policy load, LSP
6
+ * spawn, provider handshake from zero each time), and killing the client
7
+ * kills the run. This kernel inverts the ownership:
8
+ * - the SERVER owns per-workspace services: one LspManager / policy
9
+ * cache per RESOLVED workspace root, reused by later sessions on the
10
+ * same workspace (no respawn from zero);
11
+ * - the SERVER owns completion-proof persistence: a client disconnect
12
+ * never cancels an in-flight/queued proof write; dispose() awaits the
13
+ * pending writes before tearing services down;
14
+ * - the transport (stdio NDJSON in the CLI, HTTP later, in-memory
15
+ * PassThrough in tests) is a replaceable client. No React, no CLI
16
+ * imports — dependency injection only (see appServerTypes.ts).
17
+ */
18
+ import { randomUUID } from 'node:crypto';
19
+ import { resolve } from 'node:path';
20
+ export class HarnessAppServer {
21
+ sessions = new Map();
22
+ workspaceServices = new Map();
23
+ sessionCounts = new Map();
24
+ defaultServicesFactory;
25
+ /**
26
+ * Server-owned proof-write tracking: every completionProofWriter call is
27
+ * recorded here as a SETTLED shadow promise, so dispose() can await
28
+ * durability without ever throwing, and a disconnecting client (which
29
+ * only awaits the turn result) cannot cancel the write.
30
+ */
31
+ pendingProofWrites = new Set();
32
+ constructor(options = {}) {
33
+ this.defaultServicesFactory = options.createWorkspaceServices;
34
+ }
35
+ createSession(options) {
36
+ const root = resolve(options.workspaceRoot);
37
+ const factory = options.createWorkspaceServices ?? this.defaultServicesFactory;
38
+ if (!factory) {
39
+ throw new Error('HarnessAppServer: createWorkspaceServices factory is required');
40
+ }
41
+ const id = options.sessionId ?? randomUUID();
42
+ if (this.sessions.has(id)) {
43
+ throw new Error(`HarnessAppServer: session '${id}' already exists`);
44
+ }
45
+ let services = this.workspaceServices.get(root);
46
+ if (!services) {
47
+ services = factory(root);
48
+ this.workspaceServices.set(root, services);
49
+ }
50
+ const shared = services;
51
+ const server = this;
52
+ const count = this.sessionCounts.get(root) ?? 0;
53
+ this.sessionCounts.set(root, count + 1);
54
+ const runTurn = options.runTurn;
55
+ const session = {
56
+ id,
57
+ workspaceRoot: root,
58
+ services: shared,
59
+ runTurn(input) {
60
+ // Track proof writes server-side so they outlive the transport.
61
+ const deps = {
62
+ session: { id, workspaceRoot: root },
63
+ services: {
64
+ ...shared,
65
+ completionProofWriter: server.trackProofWriter(shared.completionProofWriter),
66
+ },
67
+ };
68
+ return runTurn(input, deps);
69
+ },
70
+ dispose() {
71
+ server.sessions.delete(id);
72
+ const remaining = (server.sessionCounts.get(root) ?? 1) - 1;
73
+ server.sessionCounts.set(root, remaining);
74
+ if (remaining <= 0) {
75
+ server.sessionCounts.delete(root);
76
+ const shared = server.workspaceServices.get(root);
77
+ server.workspaceServices.delete(root);
78
+ try {
79
+ shared?.lspManager?.dispose();
80
+ }
81
+ catch {
82
+ /* host disposal issues must not break teardown */
83
+ }
84
+ }
85
+ return Promise.resolve();
86
+ },
87
+ };
88
+ this.sessions.set(id, session);
89
+ return session;
90
+ }
91
+ getSession(id) {
92
+ return this.sessions.get(id);
93
+ }
94
+ listSessions() {
95
+ return [...this.sessions.keys()];
96
+ }
97
+ /** How many proof writes are in flight (diagnostics + tests). */
98
+ pendingProofCount() {
99
+ return this.pendingProofWrites.size;
100
+ }
101
+ /**
102
+ * Wrap a host writer so every call is tracked server-side. The caller
103
+ * (turn) still sees the real result/rejection; the tracked shadow only
104
+ * observes settlement so dispose() can await it.
105
+ */
106
+ trackProofWriter(raw) {
107
+ const server = this;
108
+ return (request) => {
109
+ const result = raw(request);
110
+ const shadow = result.then(() => undefined, () => undefined);
111
+ server.pendingProofWrites.add(shadow);
112
+ void shadow.then(() => server.pendingProofWrites.delete(shadow));
113
+ return result;
114
+ };
115
+ }
116
+ /**
117
+ * Full teardown: awaits ALL pending proof writes (never cancels them),
118
+ * disposes every remaining session, then the orphaned workspace services.
119
+ */
120
+ async dispose() {
121
+ await Promise.allSettled([...this.pendingProofWrites]);
122
+ this.pendingProofWrites.clear();
123
+ for (const id of [...this.sessions.keys()]) {
124
+ await this.sessions.get(id)?.dispose();
125
+ }
126
+ }
127
+ }
128
+ //# sourceMappingURL=appServer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appServer.js","sourceRoot":"","sources":["../../src/harness/appServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyCpC,MAAM,OAAO,gBAAgB;IACV,QAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;IAC7C,iBAAiB,GAAG,IAAI,GAAG,EAA6B,CAAC;IACzD,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC1C,sBAAsB,CAAuC;IAC9E;;;;;OAKG;IACc,kBAAkB,GAAG,IAAI,GAAG,EAAiB,CAAC;IAE/D,YAAY,UAAkE,EAAE;QAC9E,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAChE,CAAC;IAED,aAAa,CAAC,OAA6B;QACzC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,uBAAuB,IAAI,IAAI,CA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jD,MAAM,MAAM,GAAG,IAAI,CAAC;QACpB,OAAO,CAAC,OAAoC,EAAE,EAAE;YAC9C,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC;YAC5B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CACxB,GAAG,EAAE,CAAC,SAAS,EACf,GAAG,EAAE,CAAC,SAAS,CAChB,CAAC;YACF,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACtC,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YACjE,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO;QACX,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAChC,KAAK,MAAM,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;QACzC,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * HarnessAppServer types (t29, Pilastro B) — the long-lived kernel contract.
3
+ *
4
+ * Dependency direction: this module (and appServer.ts) live in @zelari/core
5
+ * and MUST NOT import CLI or React code. The host (zelari-code CLI) injects
6
+ * the real implementations — runOneTurn, LspManager, the completion-proof
7
+ * writer — the same DI pattern used by createBashTool(spawnSeam).
8
+ */
9
+ /** Minimal structural shape the kernel needs from a per-workspace LSP manager. */
10
+ export interface LspManagerLike {
11
+ dispose(): void;
12
+ }
13
+ /**
14
+ * Per-workspace policy cache, opaque to the kernel beyond its identity.
15
+ * The host decides what "policy loaded" means; the kernel only guarantees
16
+ * ONE instance per resolved workspace root is created and reused across
17
+ * sessions (no respawn from zero on the second run).
18
+ */
19
+ export interface PolicyCacheLike {
20
+ readonly workspaceRoot: string;
21
+ readonly loadedAt: number;
22
+ }
23
+ /** Request for a durable completion-proof write (gate payload stays opaque). */
24
+ export interface CompletionProofWriteRequest {
25
+ surface: string;
26
+ sessionId?: string | undefined;
27
+ baseDir: string;
28
+ payload: Record<string, unknown>;
29
+ }
30
+ export type CompletionProofWriter = (request: CompletionProofWriteRequest) => Promise<void>;
31
+ /** Services shared by every session on the same resolved workspace root. */
32
+ export interface WorkspaceServices {
33
+ lspManager?: LspManagerLike | undefined;
34
+ policyCache: PolicyCacheLike;
35
+ completionProofWriter: CompletionProofWriter;
36
+ }
37
+ /**
38
+ * Host factory for per-workspace services. Called AT MOST ONCE per resolved
39
+ * workspace root for the lifetime of the server (cache keyed by
40
+ * `path.resolve(workspaceRoot)`). Synchronous by design: construction is
41
+ * cheap and lazy (e.g. LspManager spawns servers on first use, not here).
42
+ */
43
+ export type WorkspaceServicesFactory = (workspaceRoot: string) => WorkspaceServices;
44
+ /** What an injected turn implementation receives from the kernel. */
45
+ export interface HarnessTurnDeps {
46
+ readonly session: {
47
+ readonly id: string;
48
+ readonly workspaceRoot: string;
49
+ };
50
+ readonly services: WorkspaceServices;
51
+ }
52
+ export interface HarnessTurnResult {
53
+ exitCode: number;
54
+ [key: string]: unknown;
55
+ }
56
+ /**
57
+ * The turn implementation, injected by the host. `input` stays opaque on
58
+ * purpose: the CLI passes its HeadlessOptions-shaped single-turn request.
59
+ */
60
+ export type RunTurnFn = (input: Record<string, unknown>, deps: HarnessTurnDeps) => Promise<HarnessTurnResult>;
61
+ //# sourceMappingURL=appServerTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appServerTypes.d.ts","sourceRoot":"","sources":["../../src/harness/appServerTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,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ClB,OAAO,CAAC,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * HarnessAppServer types (t29, Pilastro B) — the long-lived kernel contract.
3
+ *
4
+ * Dependency direction: this module (and appServer.ts) live in @zelari/core
5
+ * and MUST NOT import CLI or React code. The host (zelari-code CLI) injects
6
+ * the real implementations — runOneTurn, LspManager, the completion-proof
7
+ * writer — the same DI pattern used by createBashTool(spawnSeam).
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=appServerTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appServerTypes.js","sourceRoot":"","sources":["../../src/harness/appServerTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * ExtensionAPI seam runtime (t30, Pilastro C).
3
+ *
4
+ * `ExtensionRegistry` COLLECTS what extensions register — it never executes
5
+ * tools and never grants permissions. The host (zelari-code CLI) later:
6
+ * 1. turns every collected spec into a real ToolDefinition and pushes it
7
+ * through the SAME wrapWithPermissions path as builtin tools, so the
8
+ * declared permissions are intersected DOWN against the parent policy
9
+ * and the TaskContract capability layer still intersects LAST;
10
+ * 2. runs the collected onPreToolUse handlers through
11
+ * {@link runExtensionPreToolUse} with the t22 failure semantics:
12
+ * a crashing/hanging handler is fail-open (log + allow, interactive
13
+ * TUI) or fail-closed (deny with reason 'extension-hook-failed',
14
+ * strict headless/mission/CI surfaces).
15
+ *
16
+ * @since 2.22.0 (t30)
17
+ */
18
+ import type { HookFailureMode } from '../core/hooks/lifecycleHookRunner.js';
19
+ import type { ExtensionPreToolUseEvent, RegisteredExtensionTool, RegisteredPreToolUseHandler, SandboxedFs, ExtensionPreToolUseVerdict, ZelariExtension } from './extensionApiTypes.js';
20
+ /** True when a handler matcher applies to this tool name ('*' or exact, case-insensitive). */
21
+ export declare function extensionMatcherMatches(matcher: string, toolName: string): boolean;
22
+ /**
23
+ * Collection-only registry. One instance per host load; the loader feeds
24
+ * each on-disk extension through {@link registerExtension}, which builds
25
+ * the narrow {@link ExtensionHost} and awaits `register()`.
26
+ */
27
+ export declare class ExtensionRegistry {
28
+ private tools;
29
+ private handlers;
30
+ private readonly toolNames;
31
+ /**
32
+ * Run one extension's register() against a host bound to THIS registry.
33
+ * A duplicate tool name (vs builtins checked later by the host, or vs
34
+ * another extension checked here) throws — the loader catches and skips
35
+ * the offending extension loudly instead of letting it shadow a tool.
36
+ */
37
+ registerExtension(extension: ZelariExtension, options: {
38
+ fs: SandboxedFs;
39
+ }): Promise<void>;
40
+ /** Collected tool declarations (unwrapped — NOT yet policy-checked). */
41
+ listExtensionTools(): readonly RegisteredExtensionTool[];
42
+ /** Collected PreToolUse observers, in registration order. */
43
+ get preToolUseHandlers(): readonly RegisteredPreToolUseHandler[];
44
+ /**
45
+ * Drop everything one extension registered (loader cleanup when its
46
+ * register() throws halfway: a partial registration must not linger).
47
+ */
48
+ removeExtension(extensionId: string): void;
49
+ }
50
+ export interface RunExtensionPreToolUseOptions {
51
+ /** t22: 'fail-closed' denies on handler crash; 'fail-open' logs + allows. */
52
+ failureMode?: HookFailureMode;
53
+ /** Logger sink (default: console.error). */
54
+ logger?: (msg: string) => void;
55
+ }
56
+ /**
57
+ * Run the extension PreToolUse phase for one tool call. ONLY an explicit
58
+ * `{ deny: true }` decision blocks the call. An unreliable handler
59
+ * (crash / rejection / non-object return) is logged and — per failureMode —
60
+ * either allows the call (fail-open, default) or denies it with reason
61
+ * 'extension-hook-failed' (fail-closed, same shape as the JSON-hook runner
62
+ * of t22). Never throws.
63
+ */
64
+ export declare function runExtensionPreToolUse(handlers: readonly RegisteredPreToolUseHandler[], event: ExtensionPreToolUseEvent, options?: RunExtensionPreToolUseOptions): Promise<ExtensionPreToolUseVerdict>;
65
+ //# sourceMappingURL=extensionApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensionApi.d.ts","sourceRoot":"","sources":["../../src/harness/extensionApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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TS what extensions register — it never executes
5
+ * tools and never grants permissions. The host (zelari-code CLI) later:
6
+ * 1. turns every collected spec into a real ToolDefinition and pushes it
7
+ * through the SAME wrapWithPermissions path as builtin tools, so the
8
+ * declared permissions are intersected DOWN against the parent policy
9
+ * and the TaskContract capability layer still intersects LAST;
10
+ * 2. runs the collected onPreToolUse handlers through
11
+ * {@link runExtensionPreToolUse} with the t22 failure semantics:
12
+ * a crashing/hanging handler is fail-open (log + allow, interactive
13
+ * TUI) or fail-closed (deny with reason 'extension-hook-failed',
14
+ * strict headless/mission/CI surfaces).
15
+ *
16
+ * @since 2.22.0 (t30)
17
+ */
18
+ /** True when a handler matcher applies to this tool name ('*' or exact, case-insensitive). */
19
+ export function extensionMatcherMatches(matcher, toolName) {
20
+ const m = matcher.trim().toLowerCase();
21
+ if (m === '' || m === '*')
22
+ return true;
23
+ return m === toolName.trim().toLowerCase();
24
+ }
25
+ /**
26
+ * Collection-only registry. One instance per host load; the loader feeds
27
+ * each on-disk extension through {@link registerExtension}, which builds
28
+ * the narrow {@link ExtensionHost} and awaits `register()`.
29
+ */
30
+ export class ExtensionRegistry {
31
+ tools = [];
32
+ handlers = [];
33
+ toolNames = new Set();
34
+ /**
35
+ * Run one extension's register() against a host bound to THIS registry.
36
+ * A duplicate tool name (vs builtins checked later by the host, or vs
37
+ * another extension checked here) throws — the loader catches and skips
38
+ * the offending extension loudly instead of letting it shadow a tool.
39
+ */
40
+ async registerExtension(extension, options) {
41
+ const extensionId = extension.id;
42
+ const host = {
43
+ fs: options.fs,
44
+ registerTool: (spec) => {
45
+ const name = spec.name?.trim();
46
+ if (!name)
47
+ throw new Error(`extension "${extensionId}" registered a tool with an empty name`);
48
+ if (this.toolNames.has(name)) {
49
+ throw new Error(`extension "${extensionId}" tried to register duplicate tool "${name}"`);
50
+ }
51
+ this.toolNames.add(name);
52
+ this.tools.push({ extensionId, spec });
53
+ },
54
+ onPreToolUse: (matcher, handler) => {
55
+ this.handlers.push({ extensionId, matcher, handler });
56
+ },
57
+ };
58
+ await extension.register(host);
59
+ }
60
+ /** Collected tool declarations (unwrapped — NOT yet policy-checked). */
61
+ listExtensionTools() {
62
+ return [...this.tools];
63
+ }
64
+ /** Collected PreToolUse observers, in registration order. */
65
+ get preToolUseHandlers() {
66
+ return [...this.handlers];
67
+ }
68
+ /**
69
+ * Drop everything one extension registered (loader cleanup when its
70
+ * register() throws halfway: a partial registration must not linger).
71
+ */
72
+ removeExtension(extensionId) {
73
+ this.tools = this.tools.filter((t) => t.extensionId !== extensionId);
74
+ this.handlers = this.handlers.filter((h) => h.extensionId !== extensionId);
75
+ this.toolNames.clear();
76
+ for (const t of this.tools)
77
+ this.toolNames.add(t.spec.name);
78
+ }
79
+ }
80
+ /**
81
+ * Run the extension PreToolUse phase for one tool call. ONLY an explicit
82
+ * `{ deny: true }` decision blocks the call. An unreliable handler
83
+ * (crash / rejection / non-object return) is logged and — per failureMode —
84
+ * either allows the call (fail-open, default) or denies it with reason
85
+ * 'extension-hook-failed' (fail-closed, same shape as the JSON-hook runner
86
+ * of t22). Never throws.
87
+ */
88
+ export async function runExtensionPreToolUse(handlers, event, options = {}) {
89
+ const logger = options.logger ?? ((msg) => console.error(`[extensions] ${msg}`));
90
+ const failureMode = options.failureMode ?? 'fail-open';
91
+ for (const entry of handlers) {
92
+ if (!extensionMatcherMatches(entry.matcher, event.toolName))
93
+ continue;
94
+ let decision;
95
+ try {
96
+ decision = await entry.handler(event);
97
+ }
98
+ catch (err) {
99
+ if (failureMode === 'fail-closed') {
100
+ return {
101
+ ok: false,
102
+ extensionId: entry.extensionId,
103
+ reason: 'extension-hook-failed',
104
+ };
105
+ }
106
+ logger(`extension "${entry.extensionId}" PreToolUse handler failed (fail-open, allowing): ` +
107
+ `${err instanceof Error ? err.message : String(err)}`);
108
+ continue;
109
+ }
110
+ if (decision !== null &&
111
+ typeof decision === 'object' &&
112
+ decision.deny === true) {
113
+ const reason = decision.reason;
114
+ return {
115
+ ok: false,
116
+ extensionId: entry.extensionId,
117
+ reason: typeof reason === 'string' && reason.trim() !== ''
118
+ ? reason
119
+ : `denied by extension "${entry.extensionId}"`,
120
+ };
121
+ }
122
+ }
123
+ return { ok: true };
124
+ }
125
+ //# sourceMappingURL=extensionApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensionApi.js","sourceRoot":"","sources":["../../src/harness/extensionApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAcH,8FAA8F;AAC9F,MAAM,UAAU,uBAAuB,CAAC,OAAe,EAAE,QAAgB;IACvE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACvC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,CAAC,KAAK,QAAQ,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAC7C,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,iBAAiB;IACpB,KAAK,GAA8B,EAAE,CAAC;IACtC,QAAQ,GAAkC,EAAE,CAAC;IACpC,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/C;;;;;OAKG;IACH,KAAK,CAAC,iBAAiB,CACrB,SAA0B,EAC1B,OAA4B;QAE5B,MAAM,WAAW,GAAG,SAAS,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,GAAkB;YAC1B,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;gBACrB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;gBAC/B,IAAI,CAAC,IAAI;oBAAE,MAAM,IAAI,KAAK,CAAC,cAAc,WAAW,wCAAwC,CAAC,CAAC;gBAC9F,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC7B,MAAM,IAAI,KAAK,CAAC,cAAc,WAAW,uC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C,CAAC,MAAM;oBACR,CAAC,CAAC,wBAAwB,KAAK,CAAC,WAAW,GAAG;aACnD,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AACtB,CAAC"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * ExtensionAPI seam types (t30, Pilastro C).
3
+ *
4
+ * Dependency direction: this module (and extensionApi.ts) live in
5
+ * @zelari/core and MUST NOT import CLI code. The host (zelari-code CLI)
6
+ * injects the real sandboxed-fs implementation the same DI way it binds
7
+ * runOneTurn into the App Server kernel (t29).
8
+ *
9
+ * SEAM, not a framework (ADR-0022 rejected a generic plugin system):
10
+ * - `ZelariExtension.register(ExtensionHost)` is the ONLY entrypoint;
11
+ * - the host exposes registerTool + onPreToolUse + a sandboxed fs — and
12
+ * NOTHING else (no process / child_process / net surface);
13
+ * - code is loaded from disk by the host, never eval'd from a prompt;
14
+ * - MCP stays a remote tool; plugins/registry.ts (binary catalog) is a
15
+ * different subsystem and is not involved.
16
+ *
17
+ * Enforcement lives with the host that registers the collected tools: the
18
+ * CLI pushes every `registerTool` through the SAME wrapWithPermissions
19
+ * path as builtins (category policy → agent rules → resource claims →
20
+ * ContractCompiler intersect LAST), so an extension can declare whatever
21
+ * permissions it wants — it can never WIDEN the parent policy.
22
+ */
23
+ import type { ZodSchema } from 'zod';
24
+ import type { ToolPermission, TypedResult } from '../core/tools/toolTypes.js';
25
+ /**
26
+ * Sandboxed FS surface handed to extensions — the ONLY filesystem reach an
27
+ * extension gets. Core defines the shape; the CLI binds an implementation
28
+ * rooted at the workspace and backed by the symlink-safe sandbox resolver
29
+ * (src/cli/safety/sandboxPath.ts). All paths are ROOT-RELATIVE; anything
30
+ * resolving outside the root is a typed error, never a throw into the
31
+ * extension's caller.
32
+ */
33
+ export interface SandboxedFs {
34
+ /** Absolute root every path is resolved against (the workspace root). */
35
+ readonly root: string;
36
+ /** Read a UTF-8 text file inside the root. */
37
+ readFile(relativePath: string): Promise<TypedResult<string>>;
38
+ /** Write a UTF-8 text file inside the root (containment re-verified). */
39
+ writeFile(relativePath: string, data: string): Promise<TypedResult<{
40
+ path: string;
41
+ }>>;
42
+ /** List direct entries of a directory inside the root (names only). */
43
+ listFiles(relativePath?: string): Promise<TypedResult<string[]>>;
44
+ }
45
+ /**
46
+ * Declaration-only tool spec an extension may register. The PERMISSIONS
47
+ * here are a declaration the host feeds into its own policy intersection —
48
+ * never a grant. `execute` receives VALIDATED input only.
49
+ */
50
+ export interface ExtensionToolSpec<I = unknown, O = unknown> {
51
+ /** Stable tool name. Must not collide with an existing tool. */
52
+ name: string;
53
+ /** Human-readable description (shown to the model). */
54
+ description: string;
55
+ /** Zod schema — the SAME validation gate builtin tools go through. */
56
+ inputSchema: ZodSchema<I>;
57
+ /** Permission categories this tool needs (read|write|execute|network|ui). */
58
+ permissions: readonly ToolPermission[];
59
+ /** Async executor over validated input. */
60
+ execute: (input: I) => Promise<TypedResult<O>>;
61
+ }
62
+ /** A tool as collected by the registry, stamped with its extension id. */
63
+ export interface RegisteredExtensionTool {
64
+ readonly extensionId: string;
65
+ readonly spec: ExtensionToolSpec;
66
+ }
67
+ /** Pre-tool-use event passed to extension handlers (read-only view). */
68
+ export interface ExtensionPreToolUseEvent {
69
+ readonly toolName: string;
70
+ readonly toolInput: unknown;
71
+ }
72
+ /** What a handler may return to influence the call. Absent ⇒ no opinion. */
73
+ export interface ExtensionPreToolUseDecision {
74
+ /** True blocks the tool call. */
75
+ deny?: boolean | undefined;
76
+ /** Human reason attached to a deny. */
77
+ reason?: string | undefined;
78
+ }
79
+ export type ExtensionPreToolUseHandler = (event: ExtensionPreToolUseEvent) => Promise<ExtensionPreToolUseDecision | void> | ExtensionPreToolUseDecision | void;
80
+ /** A handler as collected, attributed to the extension that registered it. */
81
+ export interface RegisteredPreToolUseHandler {
82
+ readonly extensionId: string;
83
+ /** Exact tool name (case-insensitive) or '*' for every tool. */
84
+ readonly matcher: string;
85
+ readonly handler: ExtensionPreToolUseHandler;
86
+ }
87
+ /**
88
+ * The narrow host object an extension receives in register(). Deliberately
89
+ * minimal: two registration methods + the sandboxed fs. Nothing here can
90
+ * spawn processes, open sockets, or read the raw filesystem.
91
+ */
92
+ export interface ExtensionHost {
93
+ /** Register a tool (goes through the host's permission wrapper later). */
94
+ registerTool(spec: ExtensionToolSpec): void;
95
+ /** Observe tool calls before execution; may deny with a typed reason. */
96
+ onPreToolUse(matcher: string, handler: ExtensionPreToolUseHandler): void;
97
+ /** Root-constrained filesystem helpers (the ONLY fs reach). */
98
+ readonly fs: SandboxedFs;
99
+ }
100
+ /** The extension contract: an id + a register function. That is all. */
101
+ export interface ZelariExtension {
102
+ /** Stable identifier (used in denies, logs and lockfile diagnostics). */
103
+ readonly id: string;
104
+ register(host: ExtensionHost): void | Promise<void>;
105
+ }
106
+ /** Verdict of the extension PreToolUse phase (mirrors PreToolUseResult). */
107
+ export interface ExtensionPreToolUseVerdict {
108
+ /** false ⇒ the tool call must be denied. */
109
+ ok: boolean;
110
+ /** Extension that denied (or whose handler crashed) — for diagnostics. */
111
+ extensionId?: string;
112
+ /** Deny reason (explicit, or 'extension-hook-failed' in fail-closed). */
113
+ reason?: string;
114
+ }
115
+ //# sourceMappingURL=extensionApiTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensionApiTypes.d.ts","sourceRoot":"","sources":["../../src/harness/extensionApiTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,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