@jini-ai/daemon 0.6.15-rc.1 → 0.6.15-rc.2

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.
@@ -741,7 +741,7 @@ export function wireChildLifecycle(ctx) {
741
741
  * confirms the write; UUID-attributed CLI receipts separately confirm consumption. */
742
742
  async function sendUserMessage({ text, id = randomUUID(), attachmentIds }, { imageContents: images = [] } = {}) {
743
743
  if (!acceptsMidRunUserMessages({ def }))
744
- return relay?.enqueue({ id, text, hasAttachments: images.length > 0 || (attachmentIds?.length ?? 0) > 0 }) ?? 'unsupported';
744
+ return relayUserMessage({ id, text, images, attachmentIds });
745
745
  const stdin = child.stdin;
746
746
  if (stdinClosed || !stdin)
747
747
  return 'not-running';
@@ -749,6 +749,9 @@ export function wireChildLifecycle(ctx) {
749
749
  writeUserMessage(stdin, text, images, id);
750
750
  return 'delivered';
751
751
  }
752
+ function relayUserMessage({ id, text, images, attachmentIds }) {
753
+ return relay?.enqueue({ id, text, hasAttachments: images.length > 0 || (attachmentIds?.length ?? 0) > 0 }) ?? 'unsupported';
754
+ }
752
755
  /** Writes a complete mid-run turn using the idle image encoder; journals text without base64.
753
756
  * The same UUID identifies stdin, queue acceptance and subsequent consumption receipts. */
754
757
  function writeUserMessage(stdin, text, images, id) {
@@ -936,8 +936,7 @@ export function createAgentExecutor(requiredArgs, optionalArgs = {}) {
936
936
  const stdinHandle = isStdinDrivenFormat(formatForStdin)
937
937
  ? wireChildLifecycle({
938
938
  ...(canRegisterRunMessageRelay({ def, mcpBridge }) ? { registerMessageRelay: (relay) => liveRunRelays.set(input.runId, relay) } : {}),
939
- ...(input.model ? { startingModel: input.model } : {}),
940
- ...(modelCatalog ? { modelCatalog } : {}),
939
+ ...childLifecycleOptions({ input, modelCatalog }),
941
940
  runId: input.runId,
942
941
  def,
943
942
  streamFormat: formatForStdin.streamFormat,
@@ -949,8 +948,6 @@ export function createAgentExecutor(requiredArgs, optionalArgs = {}) {
949
948
  onCleanupFailure: onCleanupFailureFn,
950
949
  cleanupStagedFiles,
951
950
  journal,
952
- ...(options.delegatedResultCorrelation ? { delegatedResultCorrelation: options.delegatedResultCorrelation } : {}),
953
- ...(options.stdoutJournalBlobs ? { stdoutJournalBlobs: options.stdoutJournalBlobs } : {}),
954
951
  continuation,
955
952
  classifyFailure,
956
953
  bufferedStdoutMaxBytes,
@@ -968,6 +965,14 @@ export function createAgentExecutor(requiredArgs, optionalArgs = {}) {
968
965
  child.once('close', () => { liveRunInputs.delete(runId); liveRunRelays.delete(runId); });
969
966
  return stdinHandle;
970
967
  }
968
+ function childLifecycleOptions({ input, modelCatalog }) {
969
+ return {
970
+ ...(input.model ? { startingModel: input.model } : {}),
971
+ ...(modelCatalog ? { modelCatalog } : {}),
972
+ ...(options.delegatedResultCorrelation ? { delegatedResultCorrelation: options.delegatedResultCorrelation } : {}),
973
+ ...(options.stdoutJournalBlobs ? { stdoutJournalBlobs: options.stdoutJournalBlobs } : {}),
974
+ };
975
+ }
971
976
  async function dispatchAcpPrompt({ input, def, child, modelCatalog, cleanupStagedFiles, releaseStagedResources, mcpBridge, overlayDelivery }, _options = {}) {
972
977
  await runAcpDispatch({ input: {
973
978
  runId: input.runId,
@@ -46,9 +46,12 @@ export function createLiveSessionState({ emit }, _options = {}) {
46
46
  const patch = isRecord(frame.patch) ? frame.patch : frame;
47
47
  const description = typeof patch.description === 'string' ? patch.description : previous?.description;
48
48
  const detail = typeof frame.summary === 'string' ? frame.summary : previous?.detail;
49
- const local = frame.task_type === 'local_agent' || typeof frame.subagent_type === 'string' || previous?.local === true;
49
+ const local = isLocalTask({ frame, previous });
50
50
  return { local, ...(description === undefined ? {} : { description }), ...(detail === undefined ? {} : { detail }) };
51
51
  }
52
+ function isLocalTask({ frame, previous }) {
53
+ return frame.task_type === 'local_agent' || typeof frame.subagent_type === 'string' || previous?.local === true;
54
+ }
52
55
  function nextTaskStatus(frame, previous) {
53
56
  if (frame.subtype === 'task_started')
54
57
  return 'running';
@@ -260,13 +260,10 @@ export function mergeEnvContentInstructions({ existingRaw, instructionsFilePath
260
260
  * @overallScore 100/100
261
261
  */
262
262
  export function buildMcpBridgeDelivery(input) {
263
- const { cwd, runId, strategy, options, credential } = input;
263
+ const { cwd, runId, strategy, options } = input;
264
264
  if (options === undefined || strategy === undefined)
265
265
  return null;
266
- const serverEntry = buildMcpJsonServerEntry({ runId: runId, options: options }, {
267
- ...(credential === undefined ? {} : { credential }),
268
- ...(input.messageRelayNonce ? { messageRelayNonce: input.messageRelayNonce } : {}),
269
- });
266
+ const serverEntry = buildMcpJsonServerEntry({ runId: runId, options: options }, bridgeCredentialOptions(input));
270
267
  switch (strategy) {
271
268
  case 'claude-mcp-json':
272
269
  return { kind: 'claude-mcp-json', mcpJsonPath: mcpJsonPathForRun(cwd, runId), serverEntry };
@@ -281,6 +278,12 @@ export function buildMcpBridgeDelivery(input) {
281
278
  return { kind: 'env-passthrough', serverEntry };
282
279
  }
283
280
  }
281
+ function bridgeCredentialOptions(input) {
282
+ return {
283
+ ...(input.credential === undefined ? {} : { credential: input.credential }),
284
+ ...(input.messageRelayNonce ? { messageRelayNonce: input.messageRelayNonce } : {}),
285
+ };
286
+ }
284
287
  export function defaultReadMcpJsonFile({ path }) {
285
288
  return fsPromises.readFile(path, 'utf8');
286
289
  }
@@ -8,7 +8,7 @@ export function createMessageRelayClaimHandler({ agentExecutor, runScopedCallers
8
8
  return (req, res, next) => {
9
9
  try {
10
10
  const token = bearerTokenFromHeader({ header: req.get('authorization') });
11
- const caller = token ? runScopedCallers?.resolveCaller({ token }) : undefined;
11
+ const caller = resolveRelayCaller({ token, runScopedCallers });
12
12
  if (runScopedCallers && !caller) {
13
13
  res.status(401).json({ error: { code: 'UNAUTHENTICATED', message: 'a live run credential is required' } });
14
14
  return;
@@ -30,6 +30,9 @@ export function createMessageRelayClaimHandler({ agentExecutor, runScopedCallers
30
30
  }
31
31
  };
32
32
  }
33
+ function resolveRelayCaller({ token, runScopedCallers }) {
34
+ return token ? runScopedCallers?.resolveCaller({ token }) : undefined;
35
+ }
33
36
  /** Strict receipt-channel validation; no caller-selected run or principal is accepted. */
34
37
  function validClaim(body) {
35
38
  if (body === null || typeof body !== 'object' || Array.isArray(body))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/daemon",
3
- "version": "0.6.15-rc.1",
3
+ "version": "0.6.15-rc.2",
4
4
  "description": "The stateful agent daemon runtime: run lifecycle, durable event-log port, the tool-execution boundary, agent executor, terminal sessions, and routines.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -139,30 +139,30 @@
139
139
  "@types/pg": "8.23.1",
140
140
  "express": "^4.21.0",
141
141
  "@types/express": "^4.17.21",
142
- "@jini-ai/db": "0.6.15-rc.1",
143
- "@jini-ai/chat": "0.6.15-rc.1",
144
- "@jini-ai/http-kit": "0.6.15-rc.1",
145
- "@jini-ai/protocol": "^0.6.15-rc.1",
146
- "@jini-ai/agent-runtime": "^0.6.15-rc.1",
147
- "@jini-ai/platform": "^0.6.15-rc.1",
148
- "@jini-ai/core": "^0.6.15-rc.1"
142
+ "@jini-ai/db": "0.6.15-rc.2",
143
+ "@jini-ai/chat": "0.6.15-rc.2",
144
+ "@jini-ai/http-kit": "0.6.15-rc.2",
145
+ "@jini-ai/core": "^0.6.15-rc.2",
146
+ "@jini-ai/agent-runtime": "^0.6.15-rc.2",
147
+ "@jini-ai/platform": "^0.6.15-rc.2",
148
+ "@jini-ai/protocol": "^0.6.15-rc.2"
149
149
  },
150
150
  "dependencies": {
151
151
  "smol-toml": "1.9.1",
152
- "@jini-ai/core": "^0.6.15-rc.1",
153
- "@jini-ai/protocol": "^0.6.15-rc.1"
152
+ "@jini-ai/core": "^0.6.15-rc.2",
153
+ "@jini-ai/protocol": "^0.6.15-rc.2"
154
154
  },
155
155
  "peerDependencies": {
156
156
  "node-pty": "^1.1.0",
157
- "@jini-ai/db": "^0.6.15-rc.1",
157
+ "@jini-ai/db": "^0.6.15-rc.2",
158
158
  "kysely": "^0.29.6",
159
159
  "better-sqlite3": "^13.0.0",
160
160
  "@electric-sql/pglite": "0.5.8",
161
161
  "pg": "^8.23.0",
162
- "@jini-ai/http-kit": "^0.6.15-rc.1",
162
+ "@jini-ai/http-kit": "^0.6.15-rc.2",
163
163
  "express": "^4.21.0 || ^5.0.0",
164
- "@jini-ai/agent-runtime": "^0.6.15-rc.1",
165
- "@jini-ai/platform": "^0.6.15-rc.1"
164
+ "@jini-ai/agent-runtime": "^0.6.15-rc.2",
165
+ "@jini-ai/platform": "^0.6.15-rc.2"
166
166
  },
167
167
  "peerDependenciesMeta": {
168
168
  "node-pty": {