instar 1.3.845 → 1.3.847

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 (36) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +13 -5
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/core/SessionManager.d.ts +4 -0
  5. package/dist/core/SessionManager.d.ts.map +1 -1
  6. package/dist/core/SessionManager.js +11 -5
  7. package/dist/core/SessionManager.js.map +1 -1
  8. package/dist/monitoring/ApprenticeshipCycleStore.d.ts +3 -1
  9. package/dist/monitoring/ApprenticeshipCycleStore.d.ts.map +1 -1
  10. package/dist/monitoring/ApprenticeshipCycleStore.js +29 -9
  11. package/dist/monitoring/ApprenticeshipCycleStore.js.map +1 -1
  12. package/dist/monitoring/ApprenticeshipPeerCycleReader.d.ts +35 -0
  13. package/dist/monitoring/ApprenticeshipPeerCycleReader.d.ts.map +1 -0
  14. package/dist/monitoring/ApprenticeshipPeerCycleReader.js +82 -0
  15. package/dist/monitoring/ApprenticeshipPeerCycleReader.js.map +1 -0
  16. package/dist/scaffold/templates.d.ts.map +1 -1
  17. package/dist/scaffold/templates.js +1 -0
  18. package/dist/scaffold/templates.js.map +1 -1
  19. package/dist/server/AgentServer.d.ts +2 -0
  20. package/dist/server/AgentServer.d.ts.map +1 -1
  21. package/dist/server/AgentServer.js +8 -0
  22. package/dist/server/AgentServer.js.map +1 -1
  23. package/dist/server/middleware.d.ts.map +1 -1
  24. package/dist/server/middleware.js +4 -1
  25. package/dist/server/middleware.js.map +1 -1
  26. package/dist/server/routes.d.ts +2 -0
  27. package/dist/server/routes.d.ts.map +1 -1
  28. package/dist/server/routes.js +58 -2
  29. package/dist/server/routes.js.map +1 -1
  30. package/package.json +1 -1
  31. package/src/data/builtin-manifest.json +48 -48
  32. package/src/scaffold/templates.ts +1 -0
  33. package/upgrades/1.3.846.md +20 -0
  34. package/upgrades/1.3.847.md +20 -0
  35. package/upgrades/side-effects/apprenticeship-cross-agent-role-coverage.md +82 -0
  36. package/upgrades/side-effects/codex-framework-continuation-history.md +26 -0
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA0DH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AA0BjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA6H7D,OAAO,KAAK,EAAW,oBAAoB,EAAe,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAgFtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,OAAO,CAUT;AAyID,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAqoDD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,oBAAoB,GAAG,IAAI,GACxC;IACD,YAAY,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;CA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3B,WAAW,CAAC,EAAE,WAAW,EACzB,WAAW,CAAC,EAAE,WAAW,EACzB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAGvE,UAAU,CAAC,EAAE,MAAM,OAAO,8BAA8B,EAAE,WAAW,GAAG,IAAI,EAK5E,qBAAqB,CAAC,EAAE,MAAM,OAAO,gCAAgC,EAAE,kBAAkB,GAAG,IAAI,EAKhG,mBAAmB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,EAQrD,oBAAoB,CAAC,EAAE,MAAM;IAC3B,YAAY,EAAE,OAAO,kBAAkB,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACrE,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,GACP,IAAI,CAssBN;AAgmBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAyioBtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -834,7 +834,8 @@ accountSwap,
834
834
  * resume-queue drainer passes a queue entry's recorded cwd so interrupted
835
835
  * worktree work resumes in ITS tree). Omitted = module project dir. */
836
836
  spawnOpts) {
837
- const msg = latestMessage || 'Session started send a message to continue.';
837
+ const hasLatestMessage = typeof latestMessage === 'string' && latestMessage.length > 0;
838
+ const msg = hasLatestMessage ? latestMessage : 'Session started — send a message to continue.';
838
839
  // If memory is elevated/critical and we have the reaper, try to free memory
839
840
  // by cleaning orphans before spawning. Interactive sessions are NEVER blocked
840
841
  // (the user must always be able to interact), but we clean up first.
@@ -976,7 +977,13 @@ spawnOpts) {
976
977
  parts.push(userContextBlock);
977
978
  parts.push(``);
978
979
  }
979
- parts.push(inlineContext, ``, `IMPORTANT: Your response MUST acknowledge and continue the conversation above. Do NOT introduce yourself or ask "how can I help" — the user has been talking to you. Pick up where the conversation left off.`, ``, `The user's latest message:`, `[telegram:${topicId}] ${msg}`);
980
+ parts.push(inlineContext, ``);
981
+ if (hasLatestMessage) {
982
+ parts.push(`IMPORTANT: Your response MUST acknowledge and continue the conversation above. Do NOT introduce yourself or ask "how can I help" — the user has been talking to you. Pick up where the conversation left off.`, ``, `The user's latest message:`, `[telegram:${topicId}] ${msg}`);
983
+ }
984
+ else {
985
+ parts.push(`HANDOFF ONLY: No new user message accompanies this framework switch. Load the context above, do not narrate or re-scope it, and wait silently for the next user message.`);
986
+ }
980
987
  bootstrapMessage = parts.join('\n');
981
988
  }
982
989
  else {
@@ -1110,6 +1117,7 @@ spawnOpts) {
1110
1117
  ...(accountSwap?.accountId ? { subscriptionAccountId: accountSwap.accountId } : {}),
1111
1118
  // R2.8/L13: per-spawn cwd from the resume-queue entry. Unset = projectDir.
1112
1119
  ...(spawnOpts?.cwd ? { cwd: spawnOpts.cwd } : {}),
1120
+ ...(spawnOpts?.awaitInitialInjection ? { awaitInitialInjection: true } : {}),
1113
1121
  });
1114
1122
  // Clear the resume entry after successful spawn to prevent stale reuse
1115
1123
  if (resumeSessionId) {
@@ -1218,7 +1226,7 @@ async function respawnSessionForTopic(sessionManager, telegram, targetSession, t
1218
1226
  const effectiveMessage = recoveryPrompt
1219
1227
  ? `${recoveryPrompt}\n\n${latestMessage || 'Session recovered — continue where you left off.'}`
1220
1228
  : latestMessage;
1221
- const newSessionName = await spawnSessionForTopic(sessionManager, telegram, topicName, topicId, effectiveMessage, topicMemory, userProfile, undefined, (options?.configHome || options?.accountId) ? { configHome: options?.configHome, accountId: options?.accountId } : undefined);
1229
+ const newSessionName = await spawnSessionForTopic(sessionManager, telegram, topicName, topicId, effectiveMessage, topicMemory, userProfile, undefined, (options?.configHome || options?.accountId) ? { configHome: options?.configHome, accountId: options?.accountId } : undefined, options?.awaitInitialInjection ? { awaitInitialInjection: true } : undefined);
1222
1230
  telegram.registerTopicSession(topicId, newSessionName, topicName);
1223
1231
  if (!options?.silent) {
1224
1232
  await telegram.sendToTopic(topicId, `Session respawned.`);
@@ -1473,7 +1481,7 @@ function wireTelegramCallbacks(telegram, sessionManager, state, quotaTracker, ac
1473
1481
  if (!existingSession)
1474
1482
  return { respawned: false };
1475
1483
  try {
1476
- await respawnSessionForTopic(sessionManager, telegram, existingSession, topicId, undefined, topicMemory, undefined, undefined, { silent: true });
1484
+ await respawnSessionForTopic(sessionManager, telegram, existingSession, topicId, undefined, topicMemory, undefined, undefined, { silent: true, awaitInitialInjection: true });
1477
1485
  return { respawned: true };
1478
1486
  }
1479
1487
  catch (err) {
@@ -22479,7 +22487,7 @@ export async function startServer(options) {
22479
22487
  const topicName = telegram.getTopicName(n) || `topic-${n}`;
22480
22488
  _orchestratorSpawnInFlight.add(topicKey);
22481
22489
  try {
22482
- await spawnSessionForTopic(sessionManager, telegram, topicName, n, undefined, topicMemory);
22490
+ await spawnSessionForTopic(sessionManager, telegram, topicName, n, undefined, topicMemory, undefined, undefined, undefined, { awaitInitialInjection: true });
22483
22491
  return { ok: true };
22484
22492
  }
22485
22493
  catch (err) {