@jini-ai/daemon 0.1.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 (142) hide show
  1. package/LICENSE +201 -0
  2. package/dist/agent-executor.d.ts +458 -0
  3. package/dist/agent-executor.d.ts.map +1 -0
  4. package/dist/agent-executor.js +1277 -0
  5. package/dist/agent-executor.js.map +1 -0
  6. package/dist/artifacts/index.d.ts +14 -0
  7. package/dist/artifacts/index.d.ts.map +1 -0
  8. package/dist/artifacts/index.js +14 -0
  9. package/dist/artifacts/index.js.map +1 -0
  10. package/dist/artifacts/manifest.d.ts +90 -0
  11. package/dist/artifacts/manifest.d.ts.map +1 -0
  12. package/dist/artifacts/manifest.js +229 -0
  13. package/dist/artifacts/manifest.js.map +1 -0
  14. package/dist/artifacts/publication-guard.d.ts +28 -0
  15. package/dist/artifacts/publication-guard.d.ts.map +1 -0
  16. package/dist/artifacts/publication-guard.js +77 -0
  17. package/dist/artifacts/publication-guard.js.map +1 -0
  18. package/dist/artifacts/runtime-compat.d.ts +37 -0
  19. package/dist/artifacts/runtime-compat.d.ts.map +1 -0
  20. package/dist/artifacts/runtime-compat.js +33 -0
  21. package/dist/artifacts/runtime-compat.js.map +1 -0
  22. package/dist/artifacts/store.d.ts +85 -0
  23. package/dist/artifacts/store.d.ts.map +1 -0
  24. package/dist/artifacts/store.js +92 -0
  25. package/dist/artifacts/store.js.map +1 -0
  26. package/dist/artifacts/stub-guard.d.ts +73 -0
  27. package/dist/artifacts/stub-guard.d.ts.map +1 -0
  28. package/dist/artifacts/stub-guard.js +198 -0
  29. package/dist/artifacts/stub-guard.js.map +1 -0
  30. package/dist/artifacts/text-suppression.d.ts +68 -0
  31. package/dist/artifacts/text-suppression.d.ts.map +1 -0
  32. package/dist/artifacts/text-suppression.js +184 -0
  33. package/dist/artifacts/text-suppression.js.map +1 -0
  34. package/dist/close-status.d.ts +86 -0
  35. package/dist/close-status.d.ts.map +1 -0
  36. package/dist/close-status.js +91 -0
  37. package/dist/close-status.js.map +1 -0
  38. package/dist/continuation/continuation-transport.d.ts +41 -0
  39. package/dist/continuation/continuation-transport.d.ts.map +1 -0
  40. package/dist/continuation/continuation-transport.js +18 -0
  41. package/dist/continuation/continuation-transport.js.map +1 -0
  42. package/dist/continuation/index.d.ts +4 -0
  43. package/dist/continuation/index.d.ts.map +1 -0
  44. package/dist/continuation/index.js +4 -0
  45. package/dist/continuation/index.js.map +1 -0
  46. package/dist/continuation/journal.d.ts +37 -0
  47. package/dist/continuation/journal.d.ts.map +1 -0
  48. package/dist/continuation/journal.js +23 -0
  49. package/dist/continuation/journal.js.map +1 -0
  50. package/dist/continuation/run-start-handler.d.ts +75 -0
  51. package/dist/continuation/run-start-handler.d.ts.map +1 -0
  52. package/dist/continuation/run-start-handler.js +32 -0
  53. package/dist/continuation/run-start-handler.js.map +1 -0
  54. package/dist/delegated-tool-bridge.d.ts +53 -0
  55. package/dist/delegated-tool-bridge.d.ts.map +1 -0
  56. package/dist/delegated-tool-bridge.js +92 -0
  57. package/dist/delegated-tool-bridge.js.map +1 -0
  58. package/dist/event-log.d.ts +134 -0
  59. package/dist/event-log.d.ts.map +1 -0
  60. package/dist/event-log.js +108 -0
  61. package/dist/event-log.js.map +1 -0
  62. package/dist/frontend-capability-tools.d.ts +102 -0
  63. package/dist/frontend-capability-tools.d.ts.map +1 -0
  64. package/dist/frontend-capability-tools.js +68 -0
  65. package/dist/frontend-capability-tools.js.map +1 -0
  66. package/dist/frontend-session-registry.d.ts +127 -0
  67. package/dist/frontend-session-registry.d.ts.map +1 -0
  68. package/dist/frontend-session-registry.js +180 -0
  69. package/dist/frontend-session-registry.js.map +1 -0
  70. package/dist/index.d.ts +38 -0
  71. package/dist/index.d.ts.map +1 -0
  72. package/dist/index.js +38 -0
  73. package/dist/index.js.map +1 -0
  74. package/dist/legacy-data-migration.d.ts +104 -0
  75. package/dist/legacy-data-migration.d.ts.map +1 -0
  76. package/dist/legacy-data-migration.js +239 -0
  77. package/dist/legacy-data-migration.js.map +1 -0
  78. package/dist/routines/index.d.ts +12 -0
  79. package/dist/routines/index.d.ts.map +1 -0
  80. package/dist/routines/index.js +12 -0
  81. package/dist/routines/index.js.map +1 -0
  82. package/dist/routines/routine-store.d.ts +77 -0
  83. package/dist/routines/routine-store.d.ts.map +1 -0
  84. package/dist/routines/routine-store.js +162 -0
  85. package/dist/routines/routine-store.js.map +1 -0
  86. package/dist/routines/schedule.d.ts +72 -0
  87. package/dist/routines/schedule.d.ts.map +1 -0
  88. package/dist/routines/schedule.js +263 -0
  89. package/dist/routines/schedule.js.map +1 -0
  90. package/dist/routines/scheduler.d.ts +34 -0
  91. package/dist/routines/scheduler.d.ts.map +1 -0
  92. package/dist/routines/scheduler.js +330 -0
  93. package/dist/routines/scheduler.js.map +1 -0
  94. package/dist/routines/types.d.ts +131 -0
  95. package/dist/routines/types.d.ts.map +1 -0
  96. package/dist/routines/types.js +9 -0
  97. package/dist/routines/types.js.map +1 -0
  98. package/dist/run/core/failure-taxonomy.d.ts +27 -0
  99. package/dist/run/core/failure-taxonomy.d.ts.map +1 -0
  100. package/dist/run/core/failure-taxonomy.js +16 -0
  101. package/dist/run/core/failure-taxonomy.js.map +1 -0
  102. package/dist/run/core/index.d.ts +5 -0
  103. package/dist/run/core/index.d.ts.map +1 -0
  104. package/dist/run/core/index.js +5 -0
  105. package/dist/run/core/index.js.map +1 -0
  106. package/dist/run/core/result.d.ts +25 -0
  107. package/dist/run/core/result.d.ts.map +1 -0
  108. package/dist/run/core/result.js +52 -0
  109. package/dist/run/core/result.js.map +1 -0
  110. package/dist/run/core/retry.d.ts +106 -0
  111. package/dist/run/core/retry.d.ts.map +1 -0
  112. package/dist/run/core/retry.js +210 -0
  113. package/dist/run/core/retry.js.map +1 -0
  114. package/dist/run/diagnostics/diagnostics.d.ts +86 -0
  115. package/dist/run/diagnostics/diagnostics.d.ts.map +1 -0
  116. package/dist/run/diagnostics/diagnostics.js +211 -0
  117. package/dist/run/diagnostics/diagnostics.js.map +1 -0
  118. package/dist/run/diagnostics/index.d.ts +3 -0
  119. package/dist/run/diagnostics/index.d.ts.map +1 -0
  120. package/dist/run/diagnostics/index.js +3 -0
  121. package/dist/run/diagnostics/index.js.map +1 -0
  122. package/dist/run/index.d.ts +16 -0
  123. package/dist/run/index.d.ts.map +1 -0
  124. package/dist/run/index.js +16 -0
  125. package/dist/run/index.js.map +1 -0
  126. package/dist/run-lifecycle.d.ts +118 -0
  127. package/dist/run-lifecycle.d.ts.map +1 -0
  128. package/dist/run-lifecycle.js +451 -0
  129. package/dist/run-lifecycle.js.map +1 -0
  130. package/dist/terminal-session.d.ts +139 -0
  131. package/dist/terminal-session.d.ts.map +1 -0
  132. package/dist/terminal-session.js +316 -0
  133. package/dist/terminal-session.js.map +1 -0
  134. package/dist/tokens.d.ts +9 -0
  135. package/dist/tokens.d.ts.map +1 -0
  136. package/dist/tokens.js +19 -0
  137. package/dist/tokens.js.map +1 -0
  138. package/dist/tool-executor.d.ts +97 -0
  139. package/dist/tool-executor.d.ts.map +1 -0
  140. package/dist/tool-executor.js +198 -0
  141. package/dist/tool-executor.js.map +1 -0
  142. package/package.json +51 -0
@@ -0,0 +1,198 @@
1
+ /**
2
+ * `ToolExecutor` — the tool-execution boundary (extraction-plan.md §2.5 /
3
+ * §8 task 6). This is **new design work, not a port**: OD only *observes*
4
+ * `tool_use` (`apps/daemon/src/runtimes/tool-loop-guard.ts` watches for
5
+ * runaway repetition; it never gates a call before it runs), so there is
6
+ * no upstream source to lift here — see `source-map.md` for the fuller
7
+ * account of why and where this diverges from every other file in this
8
+ * repo.
9
+ *
10
+ * A tool is registered elsewhere (`@jini-ai/core`'s `ToolRegistry`, see
11
+ * `tool-registry.ts` there) as `{descriptor, handler, policy}`. This
12
+ * module is the *only* thing that can ever call `handler` — routes and
13
+ * agents hold a `ToolRegistry` reference (descriptors only) and a
14
+ * `ToolExecutor` reference (this file's public surface), never the
15
+ * registration itself. `ToolExecutor.execute(principal, run, toolId,
16
+ * input, signal)` is the sole invocation path.
17
+ *
18
+ * State machine (the audit trail extraction-plan.md §2.5 names verbatim):
19
+ * `requested` → `authorized` (or `denied`, terminal) → `confirmed` (or
20
+ * `confirmation-denied`, terminal; skipped entirely when the tool doesn't
21
+ * require confirmation) → `started` → `completed` (or `failed` /
22
+ * `timed-out` / `cancelled`, all terminal). Every transition is appended
23
+ * to a per-execution, in-memory audit record retrievable via
24
+ * `getAuditRecord`.
25
+ *
26
+ * Confirmation is resumable: when a tool requires confirmation and the
27
+ * injected `ExecutionDelegate.onConfirm` doesn't supply a decision
28
+ * synchronously (or via a settled Promise), `execute()`'s returned Promise
29
+ * simply doesn't resolve yet — it's parked on an internal per-execution
30
+ * deferred that only `resumeConfirmation(executionId, decision)` can
31
+ * settle. A transport can call `resumeConfirmation` from a completely
32
+ * separate request/tick (e.g. after a human clicks "Allow" in a UI raised
33
+ * by `onConfirm`), arbitrarily long after `execute()` was first called.
34
+ * "The headless kernel can't prompt" (extraction-plan.md §2.5) is exactly
35
+ * this: `ToolExecutor` never renders anything — `ExecutionDelegate` is the
36
+ * transport-supplied seam that does, and `resumeConfirmation` is how its
37
+ * answer gets back in.
38
+ */
39
+ import { randomUUID } from 'node:crypto';
40
+ import { getToolRegistration } from '@jini-ai/core/internal';
41
+ function truncateOutput(output, maxOutputBytes) {
42
+ if (!maxOutputBytes || typeof output !== 'string' || output.length <= maxOutputBytes) {
43
+ return { output, truncated: false };
44
+ }
45
+ return { output: output.slice(0, maxOutputBytes), truncated: true };
46
+ }
47
+ /**
48
+ * Creates the `ToolExecutor` reference implementation: an in-process,
49
+ * in-memory gate over a `ToolRegistry`. No persistence — a real host that
50
+ * needs audit records to survive a restart layers a durable store behind
51
+ * `getAuditRecord`/an append hook later; out of this task's scope (see
52
+ * `source-map.md`).
53
+ *
54
+ * @param options.registry - The `ToolRegistry` to resolve `{descriptor,
55
+ * handler, policy}` triples from, via `@jini-ai/core/internal`'s
56
+ * `getToolRegistration` — the one and only caller of that internal export.
57
+ * @param options.delegate - Transport-supplied authorize/confirm UI seam;
58
+ * omit for a headless caller whose tools never need interactive gating.
59
+ * @complexity `execute` is O(1) plus the handler's own cost; `resumeConfirmation`/`cancel`/`getAuditRecord` are O(1) map lookups.
60
+ * @overallScore 100/100
61
+ */
62
+ export function createToolExecutor(options) {
63
+ const { registry, delegate = {} } = options;
64
+ const now = options.now ?? Date.now;
65
+ const audits = new Map();
66
+ const pendingConfirmations = new Map();
67
+ const activeControllers = new Map();
68
+ function appendEvent(executionId, phase, detail) {
69
+ // Every call site passes an `executionId` this same `execute()` call
70
+ // already registered in `audits` (right before its first `appendEvent`
71
+ // call, below) — a non-null assertion documents that rather than a
72
+ // defensive `if (!record) return` guard with no reachable path to hit it.
73
+ const record = audits.get(executionId);
74
+ record.events.push(detail === undefined ? { phase, at: now() } : { phase, at: now(), detail });
75
+ }
76
+ function requestConfirmation(request) {
77
+ if (delegate.onConfirm) {
78
+ const result = delegate.onConfirm(request);
79
+ if (result !== undefined) {
80
+ return Promise.resolve(result);
81
+ }
82
+ }
83
+ return new Promise((resolve) => {
84
+ pendingConfirmations.set(request.executionId, resolve);
85
+ });
86
+ }
87
+ async function execute(principal, run, toolId, input, signal) {
88
+ const registration = getToolRegistration(registry, toolId);
89
+ if (!registration) {
90
+ throw new Error(`ToolExecutor: unknown tool "${toolId}"`);
91
+ }
92
+ const { descriptor, handler, policy } = registration;
93
+ const executionId = randomUUID();
94
+ audits.set(executionId, {
95
+ executionId,
96
+ toolId: descriptor.id,
97
+ principalId: principal.id,
98
+ runId: run.id,
99
+ events: [],
100
+ });
101
+ appendEvent(executionId, 'requested');
102
+ let decision = await policy.authorize({ principal, run, tool: descriptor, input });
103
+ if (decision === 'allow' && delegate.onAuthorize) {
104
+ decision = await delegate.onAuthorize({ principal, run, tool: descriptor, input });
105
+ }
106
+ if (decision !== 'allow') {
107
+ appendEvent(executionId, 'denied');
108
+ return { executionId, status: 'denied' };
109
+ }
110
+ appendEvent(executionId, 'authorized');
111
+ if (descriptor.requiresConfirmation) {
112
+ const confirmation = await requestConfirmation({ executionId, principal, run, tool: descriptor, input });
113
+ if (confirmation !== 'confirm') {
114
+ appendEvent(executionId, 'confirmation-denied');
115
+ return { executionId, status: 'confirmation-denied' };
116
+ }
117
+ appendEvent(executionId, 'confirmed');
118
+ }
119
+ const controller = new AbortController();
120
+ activeControllers.set(executionId, controller);
121
+ if (signal) {
122
+ if (signal.aborted) {
123
+ controller.abort();
124
+ }
125
+ else {
126
+ signal.addEventListener('abort', () => controller.abort(), { once: true });
127
+ }
128
+ }
129
+ let timedOut = false;
130
+ let timeoutHandle;
131
+ if (descriptor.timeoutMs !== undefined) {
132
+ timeoutHandle = setTimeout(() => {
133
+ timedOut = true;
134
+ controller.abort();
135
+ }, descriptor.timeoutMs);
136
+ timeoutHandle.unref?.();
137
+ }
138
+ // Cleanup (clear the timeout, drop the abort controller) is repeated at
139
+ // each return below rather than centralized in a `finally` — a
140
+ // try/finally here produced a synthetic "abrupt completion" branch
141
+ // istanbul/v8 instruments for the finally block itself, which is
142
+ // unreachable in practice (every path through the try/catch below
143
+ // returns normally; nothing here can throw a *second* exception past
144
+ // the catch). Repeating two lines avoids leaving an uncoverable branch
145
+ // behind instead of writing a contrived test or suppressing it.
146
+ appendEvent(executionId, 'started');
147
+ try {
148
+ const rawOutput = await handler({ executionId, principal, run, input, signal: controller.signal });
149
+ const { output, truncated } = truncateOutput(rawOutput, descriptor.maxOutputBytes);
150
+ appendEvent(executionId, 'completed');
151
+ if (timeoutHandle)
152
+ clearTimeout(timeoutHandle);
153
+ activeControllers.delete(executionId);
154
+ return { executionId, status: 'completed', output, truncated };
155
+ }
156
+ catch (err) {
157
+ if (timeoutHandle)
158
+ clearTimeout(timeoutHandle);
159
+ activeControllers.delete(executionId);
160
+ if (timedOut) {
161
+ appendEvent(executionId, 'timed-out');
162
+ return { executionId, status: 'timed-out' };
163
+ }
164
+ if (controller.signal.aborted) {
165
+ appendEvent(executionId, 'cancelled');
166
+ return { executionId, status: 'cancelled' };
167
+ }
168
+ const message = err instanceof Error ? err.message : String(err);
169
+ appendEvent(executionId, 'failed', message);
170
+ return { executionId, status: 'failed', error: message };
171
+ }
172
+ }
173
+ function resumeConfirmation(executionId, decision) {
174
+ const resolve = pendingConfirmations.get(executionId);
175
+ if (!resolve) {
176
+ throw new Error(`ToolExecutor: no pending confirmation for execution "${executionId}"`);
177
+ }
178
+ pendingConfirmations.delete(executionId);
179
+ resolve(decision);
180
+ }
181
+ function cancel(executionId) {
182
+ const controller = activeControllers.get(executionId);
183
+ if (controller) {
184
+ controller.abort();
185
+ return;
186
+ }
187
+ const resolve = pendingConfirmations.get(executionId);
188
+ if (resolve) {
189
+ pendingConfirmations.delete(executionId);
190
+ resolve('deny');
191
+ }
192
+ }
193
+ function getAuditRecord(executionId) {
194
+ return audits.get(executionId) ?? null;
195
+ }
196
+ return { execute, resumeConfirmation, cancel, getAuditRecord };
197
+ }
198
+ //# sourceMappingURL=tool-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-executor.js","sourceRoot":"","sources":["../src/tool-executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAQzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAkH7D,SAAS,cAAc,CAAC,MAAe,EAAE,cAAkC;IACzE,IAAI,CAAC,cAAc,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,IAAI,cAAc,EAAE,CAAC;QACrF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACtC,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AACtE,CAAC;AAED;;;;;;;;;;;;;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AAE,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,SAAS,kBAAkB,CAAC,WAAmB,EAAE,QAA8B;QAC7E,MAAM,OAAO,GAAG,oBAAoB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACtD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,wDAAwD,WAAW,GAAG,CAAC,CAAC;QAC1F,CAAC;QACD,oBAAoB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACzC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpB,CAAC;IAED,SAAS,MAAM,CAAC,WAAmB;QACjC,MAAM,UAAU,GAAG,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACtD,IAAI,UAAU,EAAE,CAAC;YACf,UAAU,CAAC,KAAK,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QACD,MAAM,OAAO,GAAG,oBAAoB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACtD,IAAI,OAAO,EAAE,CAAC;YACZ,oBAAoB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YACzC,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,SAAS,cAAc,CAAC,WAAmB;QACzC,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC;IACzC,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;AACjE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@jini-ai/daemon",
3
+ "version": "0.1.0",
4
+ "license": "Apache-2.0",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/AINSEP/Jini.git",
8
+ "directory": "packages/daemon"
9
+ },
10
+ "jini": {
11
+ "domain": "server",
12
+ "kind": "runtime",
13
+ "runtime": "node",
14
+ "admission": "locked"
15
+ },
16
+ "type": "module",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "!dist/**/*.test.js",
26
+ "!dist/**/*.test.d.ts",
27
+ "!dist/**/*.test.js.map",
28
+ "!dist/**/*.test.d.ts.map",
29
+ "!dist/**/__tests__/**"
30
+ ],
31
+ "publishConfig": {
32
+ "access": "public",
33
+ "registry": "https://registry.npmjs.org"
34
+ },
35
+ "dependencies": {
36
+ "node-pty": "^1.1.0",
37
+ "@jini-ai/agent-runtime": "0.1.0",
38
+ "@jini-ai/core": "0.1.0",
39
+ "@jini-ai/protocol": "0.1.0",
40
+ "@jini-ai/platform": "0.1.0"
41
+ },
42
+ "devDependencies": {
43
+ "@vitest/coverage-v8": "^2.1.9"
44
+ },
45
+ "scripts": {
46
+ "build": "tsc -p tsconfig.json",
47
+ "typecheck": "tsc -p tsconfig.json --noEmit",
48
+ "test": "vitest run",
49
+ "test:coverage": "vitest run --coverage"
50
+ }
51
+ }