@chibitek/chibi 0.1.201 → 0.1.202

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 (72) hide show
  1. package/dist/assets/{TerminalPanel-CF3ynjQ5.js → TerminalPanel-BqQaJQrc.js} +1 -1
  2. package/dist/assets/{abnfDiagram-O67JEVCF-DsLr5Rkp.js → abnfDiagram-O67JEVCF-BCeO-FJ-.js} +1 -1
  3. package/dist/assets/{arc-BP9MW1JT.js → arc-DAcyEY9g.js} +1 -1
  4. package/dist/assets/{architectureDiagram-NJMV4G6O-DqqmVruY.js → architectureDiagram-NJMV4G6O-Dwzl21OF.js} +1 -1
  5. package/dist/assets/{blockDiagram-BEXU5L5S-DCZycPW_.js → blockDiagram-BEXU5L5S-CB9lZurW.js} +1 -1
  6. package/dist/assets/{c4Diagram-YGBWAQC7-DAt7A5JI.js → c4Diagram-YGBWAQC7-enWMxZTY.js} +1 -1
  7. package/dist/assets/channel-DfJpivlk.js +1 -0
  8. package/dist/assets/{chunk-2Q5K7J3B-D4XUKzBr.js → chunk-2Q5K7J3B-CiQIhCM0.js} +1 -1
  9. package/dist/assets/{chunk-3FUC2YCW-BvKRlW0a.js → chunk-3FUC2YCW-LA3V3P14.js} +2 -2
  10. package/dist/assets/{chunk-5VM5RSS4-CpaqfcXB.js → chunk-5VM5RSS4-C24r0tJ3.js} +1 -1
  11. package/dist/assets/{chunk-GTNCS2PH-bFX_YBLa.js → chunk-GTNCS2PH-_BXj6Flz.js} +1 -1
  12. package/dist/assets/{chunk-GWA4HPMP-D4ceVX3-.js → chunk-GWA4HPMP-CcOUNIER.js} +1 -1
  13. package/dist/assets/{chunk-JWPE2WC7-BrM5oyHo.js → chunk-JWPE2WC7-65CF3zSi.js} +1 -1
  14. package/dist/assets/{chunk-NETBCI7D-DJCITo_6.js → chunk-NETBCI7D-33XJs1ao.js} +1 -1
  15. package/dist/assets/{chunk-WEXAMYUT-DE5Rbq8q.js → chunk-WEXAMYUT-Bf108rcV.js} +1 -1
  16. package/dist/assets/{chunk-XXDRQBXY-C6QndzP7.js → chunk-XXDRQBXY-CPtVeZ9w.js} +1 -1
  17. package/dist/assets/{classDiagram-v2-NBCMYWYE-DupxtheF.js → classDiagram-v2-NBCMYWYE-9IR2tQzs.js} +1 -1
  18. package/dist/assets/{cose-bilkent-JH36ORCC-K2_JJ1Os.js → cose-bilkent-JH36ORCC-DCqYmLmJ.js} +1 -1
  19. package/dist/assets/{cynefin-OW5HDTMX-D1iCt_1r.js → cynefin-OW5HDTMX-D21Oj5DP.js} +1 -1
  20. package/dist/assets/{cynefinDiagram-VND7K2PF-BxIP-LPT.js → cynefinDiagram-VND7K2PF-DTbN6FwN.js} +1 -1
  21. package/dist/assets/{dagre-6A5THRUB-C9f6kI0w.js → dagre-6A5THRUB-CCmPZ43E.js} +1 -1
  22. package/dist/assets/{diagram-22UHCM2B-DX1Js_iQ.js → diagram-22UHCM2B-CJyMaY9z.js} +1 -1
  23. package/dist/assets/{diagram-3UASUU5V-Dok5oHqH.js → diagram-3UASUU5V-LKeJRoef.js} +1 -1
  24. package/dist/assets/{diagram-ATOU4E4O-CZjPw12I.js → diagram-ATOU4E4O-jjufFAkX.js} +1 -1
  25. package/dist/assets/{diagram-CDSNMT55-CcdGyWm0.js → diagram-CDSNMT55-Dq3h17-z.js} +1 -1
  26. package/dist/assets/{diagram-MLGK6HIB-BuyhR8Yt.js → diagram-MLGK6HIB-Ca97pK2N.js} +1 -1
  27. package/dist/assets/{diagram-MPIPVDR6-DyfzZWWJ.js → diagram-MPIPVDR6-jRckT1gO.js} +1 -1
  28. package/dist/assets/{ebnfDiagram-ZINNZB2B-DbX8lcW9.js → ebnfDiagram-ZINNZB2B-BPaoE5L2.js} +1 -1
  29. package/dist/assets/{elk-276RUBZZ-B_1y08rH.js → elk-276RUBZZ-C6Y5YZAN.js} +1 -1
  30. package/dist/assets/{erDiagram-OPXOYQCR-CMNLleGm.js → erDiagram-OPXOYQCR-k77jMxHA.js} +1 -1
  31. package/dist/assets/{flowDiagram-KWPJA3E3-BWNxAxrN.js → flowDiagram-KWPJA3E3-Co1J8TdL.js} +1 -1
  32. package/dist/assets/{ganttDiagram-FUAMR5RP-DIbuHGn_.js → ganttDiagram-FUAMR5RP-DZqEDtow.js} +1 -1
  33. package/dist/assets/{gitGraphDiagram-X574FWY7-DOQ7lEBd.js → gitGraphDiagram-X574FWY7-B-noo13S.js} +1 -1
  34. package/dist/assets/{index-DwCyxkQ-.js → index-BThKfVMa.js} +1 -1
  35. package/dist/assets/index-C36j3Mf7.css +1 -0
  36. package/dist/assets/{index-AVvV2BDP.js → index-D_v7jkw4.js} +137 -137
  37. package/dist/assets/{infoDiagram-VRGFBTTK-B6jXr3vk.js → infoDiagram-VRGFBTTK-BT5S_4rV.js} +1 -1
  38. package/dist/assets/{ishikawaDiagram-OU5B5YK6-BMzUYIuP.js → ishikawaDiagram-OU5B5YK6-CBIJFAO1.js} +1 -1
  39. package/dist/assets/{journeyDiagram-ZHPQQLJL-BSna9Sw4.js → journeyDiagram-ZHPQQLJL-DpfvTmha.js} +1 -1
  40. package/dist/assets/{kanban-definition-PNTS6WVX-nGY_xsmB.js → kanban-definition-PNTS6WVX-B_PzfC-4.js} +1 -1
  41. package/dist/assets/{linear-ClawroOG.js → linear-x7oeFpwu.js} +1 -1
  42. package/dist/assets/{mermaid.core-QWILSY7q.js → mermaid.core-CRUgO9rc.js} +5 -5
  43. package/dist/assets/{mindmap-definition-NLK3R4M7-BHBjOj_N.js → mindmap-definition-NLK3R4M7-BRyqRB1b.js} +1 -1
  44. package/dist/assets/{pegDiagram-GJSIUBJH-BEhI0umY.js → pegDiagram-GJSIUBJH-B40H6nbN.js} +1 -1
  45. package/dist/assets/{pieDiagram-5QR66LMP-BNrNnFcF.js → pieDiagram-5QR66LMP-I_zHV9hF.js} +1 -1
  46. package/dist/assets/{quadrantDiagram-O4NWA36T-DU8ZKo3R.js → quadrantDiagram-O4NWA36T-DuoQbk_z.js} +1 -1
  47. package/dist/assets/{railroadDiagram-XR7U4H2S-CXpikGSY.js → railroadDiagram-XR7U4H2S-DRgi73Cb.js} +1 -1
  48. package/dist/assets/{requirementDiagram-PLB6GJNP-T2kWY6dy.js → requirementDiagram-PLB6GJNP-B4uiAonn.js} +1 -1
  49. package/dist/assets/{sankeyDiagram-IPEJSGJF-DUVsoHCX.js → sankeyDiagram-IPEJSGJF-Dzirs5sT.js} +1 -1
  50. package/dist/assets/{sequenceDiagram-PO4LG4MO-BqI-CnQQ.js → sequenceDiagram-PO4LG4MO-D07Gg-lu.js} +1 -1
  51. package/dist/assets/{sizeCapture-INFHLROL-CHRKcWjb.js → sizeCapture-INFHLROL-D-jPw2ZR.js} +1 -1
  52. package/dist/assets/{stateDiagram-v2-GCMORJYK-Drb1kh-m.js → stateDiagram-v2-GCMORJYK-CrQbI0yG.js} +1 -1
  53. package/dist/assets/{swimlanes-2SLR337P-D6bNO7iC.js → swimlanes-2SLR337P-S3fTHH2F.js} +1 -1
  54. package/dist/assets/swimlanesDiagram-TC7HE7FX-D4aUOLcM.js +8 -0
  55. package/dist/assets/{timeline-definition-EJHVYXUP-30UJPQln.js → timeline-definition-EJHVYXUP-BcOKypXw.js} +1 -1
  56. package/dist/assets/{usecaseDiagram-POWQR4AR-CsfAqILe.js → usecaseDiagram-POWQR4AR-ekrATLwu.js} +1 -1
  57. package/dist/assets/{vennDiagram-UO4OBE2U-D63qiwyq.js → vennDiagram-UO4OBE2U-BN23smbd.js} +1 -1
  58. package/dist/assets/{wardleyDiagram-VNRHLVJA-CwMexqnm.js → wardleyDiagram-VNRHLVJA-ChulRrvn.js} +1 -1
  59. package/dist/assets/{xychartDiagram-PMCCYNJV-DFkAUNxr.js → xychartDiagram-PMCCYNJV-NFJS73i9.js} +1 -1
  60. package/dist/index.html +2 -2
  61. package/dist-server/companion/src/routes.js +5 -0
  62. package/dist-server/index.js +1566 -1423
  63. package/dist-server/openmausbot.js +5 -0
  64. package/dist-server/pair-cli.js +5 -0
  65. package/dist-server/server/index.js +2 -2
  66. package/dist-server/server/nexus-memory/import-offer-copy.js +9 -0
  67. package/dist-server/server/nexus-memory/import-offer.js +147 -0
  68. package/dist-server/server/routes/nexus-memory.js +15 -0
  69. package/package.json +1 -1
  70. package/dist/assets/channel-CfAu_VOE.js +0 -1
  71. package/dist/assets/index-DBOyvapT.css +0 -1
  72. package/dist/assets/swimlanesDiagram-TC7HE7FX-BBg0kB8F.js +0 -8
@@ -62357,6 +62357,11 @@ var ALLOWED = [
62357
62357
  // on/off only. The full server list stays on the computer, since a local
62358
62358
  // server's arguments can carry anything.
62359
62359
  { method: "GET", path: /^\/api\/mcp\/defaults$/ },
62360
+ // The Nexus memory-import offer the computer decides on (sign-in check
62361
+ // included): what to show, and the person's answer. Nothing else under
62362
+ // /api/nexus-memory is reachable from a phone.
62363
+ { method: "GET", path: /^\/api\/nexus-memory\/import-offer$/ },
62364
+ { method: "POST", path: /^\/api\/nexus-memory\/import-offer$/ },
62360
62365
  // A marketplace connect card. The harness adds only Atomic's featured,
62361
62366
  // vendor-run servers, threat-scans them and saves them switched off.
62362
62367
  { method: "POST", path: /^\/api\/mcp\/registry\/add$/ }
@@ -62357,6 +62357,11 @@ var ALLOWED = [
62357
62357
  // on/off only. The full server list stays on the computer, since a local
62358
62358
  // server's arguments can carry anything.
62359
62359
  { method: "GET", path: /^\/api\/mcp\/defaults$/ },
62360
+ // The Nexus memory-import offer the computer decides on (sign-in check
62361
+ // included): what to show, and the person's answer. Nothing else under
62362
+ // /api/nexus-memory is reachable from a phone.
62363
+ { method: "GET", path: /^\/api\/nexus-memory\/import-offer$/ },
62364
+ { method: "POST", path: /^\/api\/nexus-memory\/import-offer$/ },
62360
62365
  // A marketplace connect card. The harness adds only Atomic's featured,
62361
62366
  // vendor-run servers, threat-scans them and saves them switched off.
62362
62367
  { method: "POST", path: /^\/api\/mcp\/registry\/add$/ }
@@ -321,7 +321,7 @@ import { createSubscriptionBotRoutes } from "./routes/subscription-bots.js";
321
321
  import { createTeamRoomsRoutes } from "./routes/team-rooms.js";
322
322
  import { TeamRoomsHost } from "./team-rooms/host.js";
323
323
  import { engineCanHideFiles, restrictIntegrations, roomPromptSections, roomTurnInput } from "./team-rooms/turn.js";
324
- import { createNexusMemoryRoutes } from "./routes/nexus-memory.js";
324
+ import { createNexusMemoryRoutes, NexusImportOffer } from "./routes/nexus-memory.js";
325
325
  import { createBoardRoutes } from "./routes/board.js";
326
326
  import { readBoardFromNexus } from "./board/nexus-board.js";
327
327
  import { LocalModelInventory, localModePlacement, machineMemory } from "./local-models-mode.js";
@@ -15709,7 +15709,7 @@ ROUTES.push(createNexusMemoryRoutes({
15709
15709
  flush: () => nexusMemory.flush(),
15710
15710
  items: (scope) => nexusMemory.listItems(scope),
15711
15711
  forget: (kind, id) => nexusMemory.forget(kind, id),
15712
- fromBot: (req) => authorizedInternalCapability(req.headers.authorization) !== null,
15712
+ fromBot: (req) => authorizedInternalCapability(req.headers.authorization) !== null, importOffer: new NexusImportOffer({ dataDir: DATA_DIR, enabled: () => nexusMemory.settings().connected && !nexusMemory.settings().personalConnection, session: stikiSession, client: () => nexusMemory.getClient(), botId: () => (store.personalBot() ?? store.bots[0])?.id ?? null }), // the first-connect memory-import offer (server/nexus-memory/import-offer.ts)
15713
15713
  bots: {
15714
15714
  find: (botId) => {
15715
15715
  const bot = store.bot(botId);
@@ -0,0 +1,9 @@
1
+ // Nexus's consent copy, verbatim. Kept free of imports so the web app's
2
+ // tests can read it without pulling the server into the browser tsconfig.
3
+ export const CONSENT_COPY = `**Nexus is now connected.**
4
+
5
+ Nexus is your second brain in the cloud. It keeps what you've built up with your AI (who you are, how you work, your projects, people, preferences and decisions) in one place, so it follows you no matter which harness you use.
6
+
7
+ Do you want to copy all your memories from this harness into Nexus? **We recommend you do.** That's the whole point of Nexus: so you don't lose what you've already established here.
8
+
9
+ **[Yes, copy my memories to Nexus]** [Not now]`;
@@ -0,0 +1,147 @@
1
+ // The Nexus memory-import offer, for Atomic itself (Erick, 2026-11-20).
2
+ //
3
+ // Every other harness gets one offer the first time Nexus is turned on:
4
+ // "Nexus is now connected ... copy all your memories from this harness into
5
+ // Nexus?" Atomic gets the same offer, once per person, with one extra step in
6
+ // front: check the person is signed in to Chibitek first. Signed out or an
7
+ // expired sign-in shows a sign-in prompt, and the offer still follows once
8
+ // they have signed in. It never blocks their work: Not now just closes it.
9
+ //
10
+ // This module only decides what to show. It uses the sign-in the app already
11
+ // has (server/stiki-session.ts: accessToken(), then refresh() once) and the
12
+ // existing guarded Nexus client; it does not touch tokens, refresh timing or
13
+ // the MCP credential files. The offer text is Nexus's (nexus_first_connect,
14
+ // harness "atomic"), with the pinned copy below as the fallback. It is the
15
+ // text in nexus-memory-import-handoff.md, word for word.
16
+ import { existsSync, mkdirSync, readFileSync } from "node:fs";
17
+ import { dirname, join } from "node:path";
18
+ import { writeFileAtomic } from "../atomic.js";
19
+ import { NexusAuthError } from "./client.js";
20
+ import { CONSENT_COPY } from "./import-offer-copy.js";
21
+ export { CONSENT_COPY };
22
+ export const IMPORT_HARNESS = "atomic";
23
+ export const HANDOFF_PROMPT = `I'm moving my memory into Nexus, my second brain in the cloud, so I keep everything I've established with you no matter which AI I use. Give me everything you have in memory about me and everything I've already shared with you. I mean everything. Don't summarize it away, don't leave anything out, and don't ask me any questions first.
24
+
25
+ Include all of it:
26
+ - Every saved memory, custom instruction, profile detail and preference you hold about me, word for word where you can.
27
+ - Who I am: name, role, company, location, time zone, family, background.
28
+ - How I want you to work: tone, format, rules, corrections I've given you, things I've told you to always or never do.
29
+ - My work: companies, products, projects, goals, plans, decisions and the reasons for them, with dates where you know them.
30
+ - People and organizations I've mentioned: who they are, their roles, and how they relate to me.
31
+ - Tools, accounts, systems and workflows I use (no passwords, keys or codes).
32
+ - Ongoing tasks, open questions and anything I said I'd come back to.
33
+ - Anything else I've shared that you would want to know if you were starting fresh tomorrow.
34
+
35
+ Format: plain Markdown, grouped under headings, one fact per bullet, with the date learned when you know it. Put it in one code block so it can be copied in full. If it's long, keep going across as many messages as it takes until everything is out, then end with the line \`END OF NEXUS MEMORY EXPORT\`.`;
36
+ /** What the person's bot is sent when they say Yes: the handoff, word for
37
+ * word, then one separate line asking for the save. */
38
+ export function importMessage(handoff = HANDOFF_PROMPT) {
39
+ return `${handoff}\n\n---\nWhen the export is complete, save all of it unchanged to Nexus with the Nexus import_memories tool (harness "${IMPORT_HARNESS}"), then tell me: "Your memories from ${IMPORT_HARNESS} are now in Nexus."`;
40
+ }
41
+ /** A Yes whose export never reached Nexus is offered again after this long. */
42
+ export const IMPORTING_RETRY_MS = 24 * 60 * 60_000;
43
+ const text = (value) => (typeof value === "string" ? value : "");
44
+ export class NexusImportOffer {
45
+ deps;
46
+ path;
47
+ now;
48
+ log;
49
+ constructor(deps) {
50
+ this.deps = deps;
51
+ this.path = join(deps.dataDir, "nexus-outbox", "import-offer.json");
52
+ this.now = deps.now ?? Date.now;
53
+ this.log = deps.log ?? ((message) => console.warn(`[nexus-import-offer] ${message}`));
54
+ }
55
+ ledger() {
56
+ try {
57
+ const raw = JSON.parse(readFileSync(this.path, "utf8"));
58
+ return raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
59
+ }
60
+ catch {
61
+ return {};
62
+ }
63
+ }
64
+ record(userId, entry) {
65
+ const next = { ...this.ledger(), [userId]: entry };
66
+ if (!existsSync(dirname(this.path)))
67
+ mkdirSync(dirname(this.path), { recursive: true });
68
+ writeFileAtomic(this.path, JSON.stringify(next));
69
+ }
70
+ answered(entry) {
71
+ if (!entry)
72
+ return false;
73
+ return entry.state === "declined" || this.now() - entry.at < IMPORTING_RETRY_MS;
74
+ }
75
+ /** Signed in with a usable token? Renews once; never loops. */
76
+ async signInState() {
77
+ const session = this.deps.session();
78
+ const identity = session.identity();
79
+ if (!identity)
80
+ return { signIn: "signed_out" };
81
+ let token = null;
82
+ try {
83
+ token = await session.accessToken();
84
+ if (!token && session.refresh)
85
+ token = await session.refresh();
86
+ }
87
+ catch {
88
+ token = null;
89
+ }
90
+ return token ? { userId: identity.userId } : { signIn: "expired" };
91
+ }
92
+ /** What to show now. Safe to call on launch and after a sign-in change. */
93
+ async check() {
94
+ if (!this.deps.enabled())
95
+ return { status: "hidden", reason: "not_connected" };
96
+ const signedIn = await this.signInState();
97
+ if ("signIn" in signedIn) {
98
+ // A person who already answered on this computer is not asked to sign in for it.
99
+ const entries = Object.values(this.ledger());
100
+ if (entries.length > 0 && entries.every((entry) => this.answered(entry)))
101
+ return { status: "hidden", reason: "answered" };
102
+ return { status: "signIn", reason: signedIn.signIn };
103
+ }
104
+ if (this.answered(this.ledger()[signedIn.userId]))
105
+ return { status: "hidden", reason: "answered" };
106
+ const client = this.deps.client();
107
+ if (!client)
108
+ return { status: "hidden", reason: "not_connected" };
109
+ let result;
110
+ try {
111
+ result = await client.call("nexus_first_connect", { harness: IMPORT_HARNESS });
112
+ }
113
+ catch (error) {
114
+ // The guard already renewed the sign-in once. Still refused: one "Sign in again".
115
+ if (error instanceof NexusAuthError)
116
+ return { status: "signIn", reason: "expired" };
117
+ this.log(`first-connect check failed: ${error instanceof Error ? error.message : String(error)}`);
118
+ return { status: "hidden", reason: "unavailable" };
119
+ }
120
+ if (result.offer !== true) {
121
+ return { status: "hidden", reason: result.reason === "already_answered" || result.reason === "declined" ? "answered" : "no_offer" };
122
+ }
123
+ const handoff = text(result.handoff_prompt).trim() ? text(result.handoff_prompt) : HANDOFF_PROMPT;
124
+ return {
125
+ status: "offer",
126
+ harness: IMPORT_HARNESS,
127
+ consentCopy: text(result.consent_copy).trim() ? text(result.consent_copy) : CONSENT_COPY,
128
+ message: importMessage(handoff),
129
+ botId: this.deps.botId(),
130
+ };
131
+ }
132
+ /** Yes ("import") or Not now ("decline"). Never throws over Nexus being away. */
133
+ async answer(answer) {
134
+ const identity = this.deps.session().identity();
135
+ const userId = identity?.userId ?? "unknown";
136
+ this.record(userId, { state: answer === "decline" ? "declined" : "importing", at: this.now() });
137
+ if (answer === "decline") {
138
+ try {
139
+ await this.deps.client()?.call("nexus_first_connect", { harness: IMPORT_HARNESS, answer: "decline" });
140
+ }
141
+ catch (error) {
142
+ this.log(`could not tell Nexus about Not now: ${error instanceof Error ? error.message : String(error)}`);
143
+ }
144
+ }
145
+ return { ok: true };
146
+ }
147
+ }
@@ -1,3 +1,4 @@
1
+ export { NexusImportOffer } from "../nexus-memory/import-offer.js";
1
2
  import { PASS } from "./table.js";
2
3
  const BOT = /^\/api\/nexus-memory\/bots\/([\w-]{1,128})(\/memories(?:\/([0-9a-fA-F-]{36}))?)?$/;
3
4
  function errorText(error) {
@@ -58,6 +59,20 @@ export function createNexusMemoryRoutes(deps) {
58
59
  deps.save(parsed.patch);
59
60
  return json(res, 200, deps.status());
60
61
  }
62
+ if (path === "/api/nexus-memory/import-offer") {
63
+ const offer = deps.importOffer;
64
+ if (!offer)
65
+ return json(res, 404, { error: "not found" });
66
+ if (method === "GET")
67
+ return json(res, 200, await offer.check());
68
+ if (method !== "POST")
69
+ return json(res, 405, { error: "method not allowed" });
70
+ const body = await readBody(req, 1_024);
71
+ const answer = body && typeof body === "object" && !Array.isArray(body) ? body.answer : undefined;
72
+ if (answer !== "import" && answer !== "decline")
73
+ return json(res, 400, { error: 'answer must be "import" or "decline"' });
74
+ return json(res, 200, await offer.answer(answer));
75
+ }
61
76
  if (path === "/api/nexus-memory/flush") {
62
77
  if (method !== "POST")
63
78
  return json(res, 405, { error: "method not allowed" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chibitek/chibi",
3
- "version": "0.1.201",
3
+ "version": "0.1.202",
4
4
  "description": "Atomic by Chibitek: run your AI team's server anywhere and pair your devices to it",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- import{U as a,C as n}from"./mermaid.core-QWILSY7q.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};