@chibitek/chibi 0.1.205 → 0.1.207

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 (103) hide show
  1. package/dist/assets/{TerminalPanel-D1wGUjRa.js → TerminalPanel-Cqjxle8G.js} +1 -1
  2. package/dist/assets/{abnfDiagram-O67JEVCF-DbeVBipN.js → abnfDiagram-O67JEVCF-XB80WX43.js} +1 -1
  3. package/dist/assets/{arc-D1akvHh4.js → arc-BERcgYDi.js} +1 -1
  4. package/dist/assets/{architectureDiagram-NJMV4G6O-DMqZ2Zb2.js → architectureDiagram-NJMV4G6O-Dnc9s6SQ.js} +1 -1
  5. package/dist/assets/{blockDiagram-BEXU5L5S-C2zhO-SN.js → blockDiagram-BEXU5L5S-Cxc21eYL.js} +1 -1
  6. package/dist/assets/{c4Diagram-YGBWAQC7-BvoSvm-3.js → c4Diagram-YGBWAQC7-CW-3gUcf.js} +1 -1
  7. package/dist/assets/channel-DaeKCO76.js +1 -0
  8. package/dist/assets/{chunk-2Q5K7J3B-CnbuWhvy.js → chunk-2Q5K7J3B-Bs484eiW.js} +1 -1
  9. package/dist/assets/{chunk-3FUC2YCW-DahSA7ym.js → chunk-3FUC2YCW-qhnBgRDy.js} +2 -2
  10. package/dist/assets/{chunk-5VM5RSS4-4DVZPQ68.js → chunk-5VM5RSS4-CsCqAEkH.js} +1 -1
  11. package/dist/assets/{chunk-GTNCS2PH-F_r0v8yd.js → chunk-GTNCS2PH-ChBgFjPw.js} +1 -1
  12. package/dist/assets/{chunk-GWA4HPMP-DRP-mB8u.js → chunk-GWA4HPMP-Df5-WClq.js} +1 -1
  13. package/dist/assets/{chunk-JWPE2WC7-CudGEr4i.js → chunk-JWPE2WC7-BdMXRJhO.js} +1 -1
  14. package/dist/assets/{chunk-NETBCI7D-54zUjRUj.js → chunk-NETBCI7D-rmAqJ9nY.js} +1 -1
  15. package/dist/assets/{chunk-WEXAMYUT-Cf3WOSP2.js → chunk-WEXAMYUT-DYmTw4lw.js} +1 -1
  16. package/dist/assets/{chunk-XXDRQBXY-Cx685pqX.js → chunk-XXDRQBXY-C4o5SHm0.js} +1 -1
  17. package/dist/assets/{classDiagram-v2-NBCMYWYE-CJzSmUjW.js → classDiagram-v2-NBCMYWYE-Bm-ZzDk5.js} +1 -1
  18. package/dist/assets/{cose-bilkent-JH36ORCC-B7BGVTVs.js → cose-bilkent-JH36ORCC-CFMRSfMu.js} +1 -1
  19. package/dist/assets/{cynefin-OW5HDTMX-BWmECHiA.js → cynefin-OW5HDTMX-BDedZ5yW.js} +1 -1
  20. package/dist/assets/{cynefinDiagram-VND7K2PF-DHXO0SU2.js → cynefinDiagram-VND7K2PF-i7KARSqF.js} +1 -1
  21. package/dist/assets/{dagre-6A5THRUB-C3D5zoFM.js → dagre-6A5THRUB-CwWpV0i_.js} +1 -1
  22. package/dist/assets/{diagram-22UHCM2B-BGORY_N5.js → diagram-22UHCM2B-CWIMT3-K.js} +1 -1
  23. package/dist/assets/{diagram-3UASUU5V-Cwn-Zojz.js → diagram-3UASUU5V-C7HGc_ap.js} +1 -1
  24. package/dist/assets/{diagram-ATOU4E4O-BbzoyPGD.js → diagram-ATOU4E4O-BeLM7ihN.js} +1 -1
  25. package/dist/assets/{diagram-CDSNMT55-DNWK_SlS.js → diagram-CDSNMT55-CN1rVM-W.js} +1 -1
  26. package/dist/assets/{diagram-MLGK6HIB-BmmP-hmh.js → diagram-MLGK6HIB-CuLcsx4e.js} +1 -1
  27. package/dist/assets/{diagram-MPIPVDR6-xqxM2yWT.js → diagram-MPIPVDR6-Bie61r-h.js} +1 -1
  28. package/dist/assets/{ebnfDiagram-ZINNZB2B-B0GaVIQn.js → ebnfDiagram-ZINNZB2B-ChMg86y3.js} +1 -1
  29. package/dist/assets/{elk-276RUBZZ-BTkrwlOJ.js → elk-276RUBZZ-DG9xXwoW.js} +1 -1
  30. package/dist/assets/{erDiagram-OPXOYQCR-Dw8FpKKd.js → erDiagram-OPXOYQCR-C9bl-nWK.js} +1 -1
  31. package/dist/assets/{flowDiagram-KWPJA3E3-DcWQfIK9.js → flowDiagram-KWPJA3E3-DvdWxFI8.js} +1 -1
  32. package/dist/assets/{ganttDiagram-FUAMR5RP-CIAZE9bZ.js → ganttDiagram-FUAMR5RP-DDCNSEYc.js} +1 -1
  33. package/dist/assets/{gitGraphDiagram-X574FWY7-D1aB6PDc.js → gitGraphDiagram-X574FWY7-PFvmOSMd.js} +1 -1
  34. package/dist/assets/{index-DfkFSy12.js → index-Ci2mINhA.js} +160 -160
  35. package/dist/assets/{index-C8GkjyYq.js → index-DnniNB7N.js} +1 -1
  36. package/dist/assets/{infoDiagram-VRGFBTTK-CUPJD6fR.js → infoDiagram-VRGFBTTK-HEZh-PnK.js} +1 -1
  37. package/dist/assets/{ishikawaDiagram-OU5B5YK6-Qt4T-A1k.js → ishikawaDiagram-OU5B5YK6-P3mmCGAU.js} +1 -1
  38. package/dist/assets/{journeyDiagram-ZHPQQLJL-Br8kwdWE.js → journeyDiagram-ZHPQQLJL-dKG4AQu2.js} +1 -1
  39. package/dist/assets/{kanban-definition-PNTS6WVX-B7BRfQOT.js → kanban-definition-PNTS6WVX-BeIHeQTt.js} +1 -1
  40. package/dist/assets/{linear-snu1EH2X.js → linear-DnEqDr6r.js} +1 -1
  41. package/dist/assets/{mermaid.core-ImU9bwtO.js → mermaid.core-D7hz6n4u.js} +5 -5
  42. package/dist/assets/{mindmap-definition-NLK3R4M7-xKUVLPlR.js → mindmap-definition-NLK3R4M7-BxJ8p-DN.js} +1 -1
  43. package/dist/assets/{pegDiagram-GJSIUBJH-B9BidmhC.js → pegDiagram-GJSIUBJH-CkQT2dHJ.js} +1 -1
  44. package/dist/assets/{pieDiagram-5QR66LMP-Ch8Kv8t8.js → pieDiagram-5QR66LMP-DmVVhYaY.js} +1 -1
  45. package/dist/assets/{quadrantDiagram-O4NWA36T-Dunnqt7g.js → quadrantDiagram-O4NWA36T-DsOz-qCY.js} +1 -1
  46. package/dist/assets/{railroadDiagram-XR7U4H2S-DnOaSZzz.js → railroadDiagram-XR7U4H2S-CeYfvaki.js} +1 -1
  47. package/dist/assets/{requirementDiagram-PLB6GJNP-D0BmDdKg.js → requirementDiagram-PLB6GJNP-BCtM-2uN.js} +1 -1
  48. package/dist/assets/{sankeyDiagram-IPEJSGJF-CWtfZ9Pz.js → sankeyDiagram-IPEJSGJF-Cu8ki35x.js} +1 -1
  49. package/dist/assets/{sequenceDiagram-PO4LG4MO-DlMxxz_s.js → sequenceDiagram-PO4LG4MO-DKbS5Gcs.js} +1 -1
  50. package/dist/assets/{sizeCapture-INFHLROL-CBK9A--M.js → sizeCapture-INFHLROL-Ceut6PrE.js} +1 -1
  51. package/dist/assets/{stateDiagram-v2-GCMORJYK-C7yP85Rg.js → stateDiagram-v2-GCMORJYK-Bl5uMY2f.js} +1 -1
  52. package/dist/assets/{swimlanes-2SLR337P-CPWaiwCv.js → swimlanes-2SLR337P-CoMPbJ2k.js} +1 -1
  53. package/dist/assets/swimlanesDiagram-TC7HE7FX-DLJq0mAR.js +8 -0
  54. package/dist/assets/{timeline-definition-EJHVYXUP-C1i2k1l3.js → timeline-definition-EJHVYXUP-D0xkKp46.js} +1 -1
  55. package/dist/assets/{usecaseDiagram-POWQR4AR-DZMn9spA.js → usecaseDiagram-POWQR4AR-BCCL6QIf.js} +1 -1
  56. package/dist/assets/{vennDiagram-UO4OBE2U-CQTd7MTx.js → vennDiagram-UO4OBE2U-B7g3jK72.js} +1 -1
  57. package/dist/assets/{wardleyDiagram-VNRHLVJA-zuVyHyHg.js → wardleyDiagram-VNRHLVJA-DFhnqQKP.js} +1 -1
  58. package/dist/assets/{xychartDiagram-PMCCYNJV-D6HRPUA0.js → xychartDiagram-PMCCYNJV-mIXMscRS.js} +1 -1
  59. package/dist/index.html +1 -1
  60. package/dist-server/accounts-proxy.js +12 -2
  61. package/dist-server/browser-proxy.js +15 -2
  62. package/dist-server/companion/src/routes.js +10 -0
  63. package/dist-server/container-mcp.js +81 -81
  64. package/dist-server/drivers/agents-proxy.js +81 -81
  65. package/dist-server/drivers/phone-proxy.js +13 -4
  66. package/dist-server/index.js +1031 -890
  67. package/dist-server/openmausbot.js +581 -569
  68. package/dist-server/pair-cli.js +581 -569
  69. package/dist-server/server/accounts-proxy.js +17 -2
  70. package/dist-server/server/agents-token-file.js +10 -7
  71. package/dist-server/server/bot-package.js +3 -2
  72. package/dist-server/server/browser-proxy.js +18 -2
  73. package/dist-server/server/connection-cap-failover.js +3 -1
  74. package/dist-server/server/drivers/phone-proxy.js +18 -4
  75. package/dist-server/server/engine-failover.js +5 -0
  76. package/dist-server/server/engine-failure.js +3 -3
  77. package/dist-server/server/engine-rest.js +1 -0
  78. package/dist-server/server/harness/bus.js +7 -2
  79. package/dist-server/server/harness-import/adapters.js +13 -1
  80. package/dist-server/server/harness-import/apply.js +21 -41
  81. package/dist-server/server/harness-import/cli-skills.js +124 -0
  82. package/dist-server/server/harness-import/convert.js +2 -2
  83. package/dist-server/server/harness-import/grokbot.js +36 -0
  84. package/dist-server/server/harness-import/hermes.js +3 -2
  85. package/dist-server/server/index.js +13 -13
  86. package/dist-server/server/model-evidence-context.js +7 -0
  87. package/dist-server/server/model-evidence.js +6 -1
  88. package/dist-server/server/system-prompt.js +1 -1
  89. package/dist-server/shared/model-evidence.js +13 -0
  90. package/dist-server/vps-container-mcp.js +81 -81
  91. package/package.json +1 -1
  92. package/skills/reverse-engineer-anything/LICENSE-rea-agents.txt +21 -0
  93. package/skills/reverse-engineer-anything/SKILL.md +356 -0
  94. package/skills/reverse-engineer-anything/VENDORED.md +46 -0
  95. package/skills/reverse-engineer-anything/manifest.json +21 -0
  96. package/skills/reverse-engineer-anything/references/android-applications.md +36 -0
  97. package/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
  98. package/skills/reverse-engineer-anything/references/evidence-workflows.md +71 -0
  99. package/skills/reverse-engineer-anything/references/javascript-applications.md +218 -0
  100. package/skills/reverse-engineer-anything/references/native-and-artifacts.md +297 -0
  101. package/skills/reverse-engineer-anything/references/runtime-observation.md +78 -0
  102. package/dist/assets/channel-Ber8y2Xi.js +0 -1
  103. package/dist/assets/swimlanesDiagram-TC7HE7FX-BxCTRDZa.js +0 -8
@@ -5,7 +5,7 @@ import { SharedDeliverables, createSharedDeliverablesRoutes, sharedDeliverableAc
5
5
  import { connectionCredentialServer } from "./connection-credential.js";
6
6
  import { requestCredentialCard } from "./credential-card-request.js";
7
7
  import { invalidateBrokenCheckpoint } from "./checkpoint-recovery.js";
8
- import { createModelExpectation, ModelEvidenceLedger } from "./model-evidence-context.js";
8
+ import { createModelExpectation, ModelEvidenceLedger, standInReason } from "./model-evidence-context.js";
9
9
  import { reactToMessage } from "./message-reactions.js";
10
10
  import { hasUnboundGoalGuard, goalGuardForEvent, addGoalGuard, removeGoalGuard, runPersonalGoalTurn, updatePersonalGoalReceipt } from "./personal-goal-turn.js";
11
11
  import { PersonalGoalRuntime, receiveGoalCommand } from "./personal-goal-runtime.js";
@@ -327,7 +327,7 @@ import { createNexusMemoryRoutes, NexusImportOffer } from "./routes/nexus-memory
327
327
  import { createBoardRoutes } from "./routes/board.js";
328
328
  import { readBoardFromNexus } from "./board/nexus-board.js";
329
329
  import { LocalModelInventory, localModePlacement, machineMemory } from "./local-models-mode.js";
330
- import { eventBase, restTime, FailoverGate, MAX_ENGINES_PER_TURN, triesSpent, continuationNote, restingLine, restingOnRoute, sameRoute } from "./engine-failover.js";
330
+ import { eventBase, restTime, FailoverGate, MAX_ENGINES_PER_TURN, triesSpent, uncountedTry, continuationNote, restingLine, restingOnRoute, sameRoute } from "./engine-failover.js";
331
331
  import { connectionRunOutPolicy, finalizeConnectionCapPick, finalizeNewTurnPlacement, pauseKeyBandForRunOut } from "./connection-cap-failover.js";
332
332
  import { TURN_ERROR_CATEGORIES } from "../shared/runtime-events.js";
333
333
  import { EngineProbes, PROBE_PROMPT, isProbeThread, probeThreadId } from "./engine-probe.js";
@@ -2094,7 +2094,7 @@ async function browserIntegration(botId, profile, turn) {
2094
2094
  kind: "browser", depth: 0, skillAuthoring: false, createdBots: 0, openedThreads: 0 });
2095
2095
  return { profile: partitionId, session, spec, integration: {
2096
2096
  command: process.execPath, args: [SPAWNED_PROXIES.browser], env: {
2097
- ...AGENTS_NODE_FLAG, OMB_BROWSER_TOKEN: token, OMB_HARNESS_URL: `http://127.0.0.1:${PORT}`,
2097
+ ...AGENTS_NODE_FLAG, OMB_BROWSER_TOKEN: token, OMB_BROWSER_TOKEN_FILE: writeAgentsTokenFile(botId, turn.threadId, token, undefined, "browser"), OMB_HARNESS_URL: `http://127.0.0.1:${PORT}`,
2098
2098
  },
2099
2099
  } };
2100
2100
  }
@@ -2125,7 +2125,7 @@ function phoneIntegration(botId, threadId, generation) {
2125
2125
  });
2126
2126
  const env = {
2127
2127
  ...AGENTS_NODE_FLAG,
2128
- OMB_PHONE_TOKEN: token,
2128
+ OMB_PHONE_TOKEN: token, OMB_PHONE_TOKEN_FILE: writeAgentsTokenFile(botId, threadId, token, undefined, "phone"),
2129
2129
  OMB_HARNESS_URL: `http://127.0.0.1:${PORT}`,
2130
2130
  };
2131
2131
  if (process.env.OMB_ADB_PATH)
@@ -2153,7 +2153,7 @@ function accountsIntegration(botId, threadId, generation) {
2153
2153
  return {
2154
2154
  command: process.execPath,
2155
2155
  args: [SPAWNED_PROXIES.accounts],
2156
- env: { ...AGENTS_NODE_FLAG, OMB_ACCOUNTS_TOKEN: token, OMB_HARNESS_URL: `http://127.0.0.1:${PORT}` },
2156
+ env: { ...AGENTS_NODE_FLAG, OMB_ACCOUNTS_TOKEN: token, OMB_ACCOUNTS_TOKEN_FILE: writeAgentsTokenFile(botId, threadId, token, undefined, "accounts"), OMB_HARNESS_URL: `http://127.0.0.1:${PORT}` },
2157
2157
  readOnlyTools: ACCOUNT_TOOLS.filter((tool) => isReadOnlyAccountTool(tool.name)).map((tool) => tool.name),
2158
2158
  askTools: ACCOUNT_TOOLS.filter((tool) => !isReadOnlyAccountTool(tool.name)).map((tool) => tool.name),
2159
2159
  };
@@ -3652,7 +3652,7 @@ function engineFailover(turn, completion) {
3652
3652
  // the rest names no provider, so Atomic Engine skips the account too.
3653
3653
  const scope = failure.kind === "stalled" || failure.permanent || !failedCandidate ? undefined : restScope(failedCandidate, ran?.model) ?? refusedModelScope(failure.message, ran?.model);
3654
3654
  const restFailed = () => engineRests.rest(turn.instanceId, failedCandidate ? engineAccount(failedCandidate) : undefined, failure.kind, { resetAt: failure.resetAt, resetText: failure.resetText, windowMs: failure.windowMs, message: redactSecretsInText(failure.message),
3655
- ...(failure.permanent ? { permanent: true } : {}), ...(scope ? { scope } : {}), ...(ran?.model ? { model: ran.model } : {}),
3655
+ ...(failure.permanent ? { permanent: true } : {}), ...(scope ? { scope } : {}), ...(ran?.model ? { model: ran.model } : {}), ...(failure.setup ? { setup: true } : {}),
3656
3656
  ...(failure.kind === "auth_failed" && failedCandidate ? { reportedSignedIn: failedCandidate.snapshot.state === "available" && failedCandidate.snapshot.authenticated === true } : {}) });
3657
3657
  // Unknown failures rest only when the turn moves; otherwise preserve their report.
3658
3658
  const rest = failure.kind === "provider_error" || failure.kind === "rate_limited" ? undefined : restFailed();
@@ -3841,7 +3841,7 @@ function roomEngineFailover(turn, completion, room, profile, candidates, failedC
3841
3841
  * before a key), or the one line it stops with. Books pay-per-use for the
3842
3842
  * move. Shared by a bot's own turns and room member turns. */
3843
3843
  function failoverPick(turn, profile, projected, candidates, failedCandidate, restingNamed, attempt) {
3844
- const tried = new Set(attempt.tried);
3844
+ const tried = new Set(attempt.tried), uncounted = uncountedTry(turn, engineRests.active(), needsPerson); // a setup failure is not a try
3845
3845
  const tier = turnTier(profile, turn.threadId);
3846
3846
  const plan = enginePlan(profile, turn.threadId, tier);
3847
3847
  const required = plan.modelClass;
@@ -3851,7 +3851,7 @@ function failoverPick(turn, profile, projected, candidates, failedCandidate, res
3851
3851
  // provider on its side of the personal line; with none left it stops with
3852
3852
  // its one line.
3853
3853
  const subscriptionMove = isSubscriptionBot(profile)
3854
- ? triesSpent(tried, needsPerson) || !projected
3854
+ ? triesSpent(tried, uncounted) || !projected
3855
3855
  ? { line: subscriptionLine(profile, candidates) }
3856
3856
  : subscriptionPlacement({ profile, projected, candidates, tried: new Set([...tried, turn.instanceId]), auto: attempt.persist, modelClass: neededClass })
3857
3857
  : undefined;
@@ -3863,7 +3863,7 @@ function failoverPick(turn, profile, projected, candidates, failedCandidate, res
3863
3863
  const personalMove = subscriptionMove?.choice
3864
3864
  ? { choice: { selection: subscriptionMove.choice.selection, candidate: subscriptionMove.choice.candidate, step: 0, band: "subscription" }, line: "" }
3865
3865
  : personalTurn
3866
- ? triesSpent(tried, needsPerson) || !projected
3866
+ ? triesSpent(tried, uncounted) || !projected
3867
3867
  ? { line: personalLine(candidates, false) }
3868
3868
  : personalPlacement({ profile, projected, candidates, tried, needs: { tools: true, vision: attempt.vision }, modelClass: neededClass, computer })
3869
3869
  : undefined;
@@ -3872,7 +3872,7 @@ function failoverPick(turn, profile, projected, candidates, failedCandidate, res
3872
3872
  // Every bot, pinned or not and of any tier, falls to the next subscription
3873
3873
  // the person has, in any class, before a pay-per-use key (resolveFailover).
3874
3874
  const resting = (candidate, model) => engineResting(candidate, model) || (model === attempt.selection.model && !!failedCandidate && sameRoute(candidate, failedCandidate));
3875
- const resolution = personalMove || triesSpent(tried, needsPerson) || !projected ? { skipped: [] } : resolveFailover({
3875
+ const resolution = personalMove || triesSpent(tried, uncounted) || !projected ? { skipped: [] } : resolveFailover({
3876
3876
  ladder: plan.ladder,
3877
3877
  classLadder: (modelClass) => classLadder(classedModels(), modelClass),
3878
3878
  failed: attempt.selection,
@@ -3896,7 +3896,7 @@ function failoverPick(turn, profile, projected, candidates, failedCandidate, res
3896
3896
  return finalizeConnectionCapPick({
3897
3897
  choice, subscriptionLine: subscriptionMove?.line, failureKind: turn.failure?.kind,
3898
3898
  pausedUntil: payPerUse.pausedUntil(), skipped: resolution.skipped, payPerUsePausedLine, restingNamed,
3899
- failedInstanceId: turn.instanceId, alreadyTried: attempt.tried, triedCount: [...tried].filter((instanceId) => !needsPerson(instanceId)).length,
3899
+ failedInstanceId: turn.instanceId, alreadyTried: attempt.tried, triedCount: [...tried].filter((instanceId) => !uncounted(instanceId)).length,
3900
3900
  cannotDrive: cannotDriveNamed(candidates, resolution.skipped, computer),
3901
3901
  policy: connectionRunOutPolicy(cfg.engineTiers), paidApproved: Boolean(payPerUse.current()?.keptGoingAt),
3902
3902
  local: Boolean(placed.local), currentLabel: engineLabel(candidates, attempt.selection),
@@ -9861,8 +9861,8 @@ async function startTurn(botId, text, opts) {
9861
9861
  // busy flips immediately so the composer locks; the dispatch itself runs
9862
9862
  // in the background — box provisioning can take ~90s and must never
9863
9863
  // hang the HTTP request
9864
- const evidenceAttemptId = expectedModel ? modelEvidence.begin({ ...expectedModel, requestedModel: model,
9865
- instanceId: instance.instanceId, provider: instance.driverKind }, Boolean(failover)) : undefined;
9864
+ const evidenceAttemptId = expectedModel ? modelEvidence.begin({ ...expectedModel, requestedModel: model, instanceId: instance.instanceId,
9865
+ provider: instance.driverKind }, Boolean(failover), standInReason(failover, engineChoice, projectedBot?.modelSelection)) : undefined;
9866
9866
  const dispatchClaimId = randomUUID();
9867
9867
  const resourceOwner = { threadId, generation: dispatchClaimId };
9868
9868
  turnResourceOwners.set(threadId, resourceOwner);
@@ -1,6 +1,13 @@
1
1
  export { ModelEvidenceLedger } from "./model-evidence.js";
2
2
  // Snapshot the same class choices the model picker displays before routing mutates the task.
3
3
  import { threadEngineMode } from "../shared/engine-tiers.js";
4
+ /** A pinned or hand-picked engine passed over at start (resting, signed
5
+ * out, not installed) is a fallback hop like a mid-turn switch, so the
6
+ * evidence counts it and the stand-in is never read as the thread's own.
7
+ * A tier's ladder pick (persist) re-points the thread: its own choice. */
8
+ export function standInReason(failover, choice, own) {
9
+ return !failover && choice && !choice.persist && own && choice.selection.instanceId !== own.instanceId ? "own engine unavailable at start" : undefined;
10
+ }
4
11
  export function createModelExpectation(context) {
5
12
  return (threadId, instanceId, provider) => {
6
13
  const profile = context.store.botByThread(threadId) ?? context.store.bot(context.speakerBot(threadId) ?? "");
@@ -12,11 +12,16 @@ export class ModelEvidenceLedger {
12
12
  failures = 0;
13
13
  dataDir;
14
14
  constructor(dataDir) { this.dataDir = dataDir; }
15
- begin(expected, continuation = false) {
15
+ /** `standIn`: the turn starts on an engine other than the thread's own
16
+ * (its own was resting, signed out or not installed), so no mid-turn
17
+ * switch will record the hop: it is written as a fallback here. */
18
+ begin(expected, continuation = false, standIn) {
16
19
  const prior = this.active.get(expected.threadId);
17
20
  const attempt = { expected: { ...expected, ...(continuation && prior ? { label: prior.expected.label, modelClass: prior.expected.modelClass, model: prior.expected.model } : {}) }, logicalTurnId: continuation && prior ? prior.logicalTurnId : randomUUID(), attemptId: randomUUID() };
18
21
  this.active.set(expected.threadId, attempt);
19
22
  this.write(attempt, { kind: "dispatch", level: expected.requestedModel || expected.model ? "requested-only" : "unknown" });
23
+ if (standIn)
24
+ this.write(attempt, { kind: "fallback", level: "unknown", reason: standIn });
20
25
  return attempt.attemptId;
21
26
  }
22
27
  finishDispatch(threadId, attemptId) {
@@ -42,7 +42,7 @@ When the person asks to connect to, integrate with, sync with, or pull data from
42
42
  1. Search first. Call marketplace_search with the service name. It searches Atomic's Marketplace, which lists only what is really available: accounts built into Atomic (Google, Microsoft and, on a Mac, Apple: Calendar, Reminders, Contacts and iCloud Drive, in Settings > Accounts), official servers Atomic connects directly, and the vendor's official connector in the person's Claude account.
43
43
  2. If it finds a match, answer in one or two plain sentences and call open_marketplace with that service and its server_id. The person gets a button that opens Settings > Marketplace (or Settings > Accounts for a built-in account) with it selected and connects it there in a click or two. If the Marketplace needs a sign-in or a key, the Marketplace asks for it; never ask for it in chat.
44
44
  3. If nothing matches, say plainly that this connection isn't available in the Marketplace yet. If the company behind the service runs its own official MCP server, the person can add it in Settings > Marketplace > MCP servers. Call open_marketplace with the service name so the person can send it to Chibitek as an idea in one click, offer that, and stop.
45
- Never propose building the connection: no code, API layer, OAuth or developer app, scripts, scheduled jobs, webhooks, tokens, developer keys or API keys, for Chibitek or for the person, even if you know how. Never recommend a server made by a community member, an independent third party or an individual developer, from the MCP Registry, GitHub, npm or anywhere else: Atomic cannot tell where it sends the person's data. Use no developer jargon and never ask the person for keys or developer steps. A match that comes through the person's Claude account works for bots on the Claude engine; if you are on another engine, say a teammate on Claude can use it once it is on, or hand the request to one.
45
+ Never propose building the connection: no code, API layer, OAuth or developer app, scripts, scheduled jobs, webhooks, tokens, developer keys or API keys, for Chibitek or for the person, even if you know how. Never recommend a server made by a community member, an independent third party or an individual developer, from the MCP Registry, GitHub, npm or anywhere else: Atomic cannot tell where it sends the person's data. The servers Chibitek ships inside Atomic (Mochii, Nexus and REA, under Settings > Marketplace > MCP servers) are vetted by Chibitek, not community servers: if one is off or not allowed for you, ask the person to switch it on there. Use no developer jargon and never ask the person for keys or developer steps. A match that comes through the person's Claude account works for bots on the Claude engine; if you are on another engine, say a teammate on Claude can use it once it is on, or hand the request to one.
46
46
  Without a marketplace_search tool, give the person this link instead, with the service name in it: [Open the Marketplace](chibi://marketplace?q=QuickBooks). The same rules apply.
47
47
  This rule is about connecting the person's accounts and data. Coding work the person explicitly asks for in a repository or project (for example "add a Stripe webhook handler to our app") is ordinary work.
48
48
  Examples:
@@ -1,3 +1,16 @@
1
+ /** The engine that served a logical turn when it was not the one expected
2
+ * (the turn has a fallback row): the last attempt's provider and its
3
+ * best-evidenced model, so a summary never names only the model that was
4
+ * asked for. Null when the turn stayed where it was expected. */
5
+ export function servedBy(turnRows) {
6
+ const last = turnRows.at(-1);
7
+ if (!last || !turnRows.some(row => row.kind === "fallback"))
8
+ return null;
9
+ const attempt = turnRows.filter(row => row.attemptId === last.attemptId);
10
+ const latest = [...attempt].reverse();
11
+ const reported = latest.find(row => row.level === "response-reported" && row.reportedModel) ?? latest.find(row => row.reportedModel);
12
+ return { provider: last.provider, model: reported?.reportedModel ?? attempt[0].requestedModel ?? "Not reported" };
13
+ }
1
14
  export function modelEvidenceMetrics(rows) {
2
15
  const turns = new Set(rows.map(row => row.logicalTurnId));
3
16
  const fallbacks = new Set(rows.filter(row => row.kind === "fallback").map(row => row.logicalTurnId));