@chibitek/chibi 0.1.205 → 0.1.206
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.
- package/dist/assets/{TerminalPanel-D1wGUjRa.js → TerminalPanel-BBJ8EeT7.js} +1 -1
- package/dist/assets/{abnfDiagram-O67JEVCF-DbeVBipN.js → abnfDiagram-O67JEVCF-a06YszXx.js} +1 -1
- package/dist/assets/{arc-D1akvHh4.js → arc-Fe3WbFfc.js} +1 -1
- package/dist/assets/{architectureDiagram-NJMV4G6O-DMqZ2Zb2.js → architectureDiagram-NJMV4G6O-DYcb0ZrL.js} +1 -1
- package/dist/assets/{blockDiagram-BEXU5L5S-C2zhO-SN.js → blockDiagram-BEXU5L5S-xC5y8We2.js} +1 -1
- package/dist/assets/{c4Diagram-YGBWAQC7-BvoSvm-3.js → c4Diagram-YGBWAQC7-Dm81dUJa.js} +1 -1
- package/dist/assets/channel-D3ihDYTR.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-CnbuWhvy.js → chunk-2Q5K7J3B-CDVJUGUd.js} +1 -1
- package/dist/assets/{chunk-3FUC2YCW-DahSA7ym.js → chunk-3FUC2YCW-BvPx7oJb.js} +2 -2
- package/dist/assets/{chunk-5VM5RSS4-4DVZPQ68.js → chunk-5VM5RSS4-kUQxxDSH.js} +1 -1
- package/dist/assets/{chunk-GTNCS2PH-F_r0v8yd.js → chunk-GTNCS2PH-hmSLPBzT.js} +1 -1
- package/dist/assets/{chunk-GWA4HPMP-DRP-mB8u.js → chunk-GWA4HPMP-ivlnCC25.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-CudGEr4i.js → chunk-JWPE2WC7-hjxL5olg.js} +1 -1
- package/dist/assets/{chunk-NETBCI7D-54zUjRUj.js → chunk-NETBCI7D-ClgHcSe7.js} +1 -1
- package/dist/assets/{chunk-WEXAMYUT-Cf3WOSP2.js → chunk-WEXAMYUT-1i-fNDpg.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-Cx685pqX.js → chunk-XXDRQBXY-BhPdm5u4.js} +1 -1
- package/dist/assets/{classDiagram-v2-NBCMYWYE-CJzSmUjW.js → classDiagram-v2-NBCMYWYE-BsL-gKkF.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-B7BGVTVs.js → cose-bilkent-JH36ORCC-piSPlA0p.js} +1 -1
- package/dist/assets/{cynefin-OW5HDTMX-BWmECHiA.js → cynefin-OW5HDTMX-D2T5q7wD.js} +1 -1
- package/dist/assets/{cynefinDiagram-VND7K2PF-DHXO0SU2.js → cynefinDiagram-VND7K2PF-CWHt2804.js} +1 -1
- package/dist/assets/{dagre-6A5THRUB-C3D5zoFM.js → dagre-6A5THRUB-BNioVBDz.js} +1 -1
- package/dist/assets/{diagram-22UHCM2B-BGORY_N5.js → diagram-22UHCM2B-DULW9a3n.js} +1 -1
- package/dist/assets/{diagram-3UASUU5V-Cwn-Zojz.js → diagram-3UASUU5V-EYvilvye.js} +1 -1
- package/dist/assets/{diagram-ATOU4E4O-BbzoyPGD.js → diagram-ATOU4E4O-BRkFLoxi.js} +1 -1
- package/dist/assets/{diagram-CDSNMT55-DNWK_SlS.js → diagram-CDSNMT55-B0IbbTpB.js} +1 -1
- package/dist/assets/{diagram-MLGK6HIB-BmmP-hmh.js → diagram-MLGK6HIB-u7n_3e2v.js} +1 -1
- package/dist/assets/{diagram-MPIPVDR6-xqxM2yWT.js → diagram-MPIPVDR6-NegomnHr.js} +1 -1
- package/dist/assets/{ebnfDiagram-ZINNZB2B-B0GaVIQn.js → ebnfDiagram-ZINNZB2B-BPZmiseK.js} +1 -1
- package/dist/assets/{elk-276RUBZZ-BTkrwlOJ.js → elk-276RUBZZ-BcBEThvp.js} +1 -1
- package/dist/assets/{erDiagram-OPXOYQCR-Dw8FpKKd.js → erDiagram-OPXOYQCR-BVAGByE5.js} +1 -1
- package/dist/assets/{flowDiagram-KWPJA3E3-DcWQfIK9.js → flowDiagram-KWPJA3E3-ByZ1IyAE.js} +1 -1
- package/dist/assets/{ganttDiagram-FUAMR5RP-CIAZE9bZ.js → ganttDiagram-FUAMR5RP-CEa3O2pJ.js} +1 -1
- package/dist/assets/{gitGraphDiagram-X574FWY7-D1aB6PDc.js → gitGraphDiagram-X574FWY7-dul-ZoaX.js} +1 -1
- package/dist/assets/{index-C8GkjyYq.js → index-CFUbzTrj.js} +1 -1
- package/dist/assets/{index-DfkFSy12.js → index-Tw4-5a-J.js} +71 -71
- package/dist/assets/{infoDiagram-VRGFBTTK-CUPJD6fR.js → infoDiagram-VRGFBTTK-Bt9KS597.js} +1 -1
- package/dist/assets/{ishikawaDiagram-OU5B5YK6-Qt4T-A1k.js → ishikawaDiagram-OU5B5YK6-BjJTuEjh.js} +1 -1
- package/dist/assets/{journeyDiagram-ZHPQQLJL-Br8kwdWE.js → journeyDiagram-ZHPQQLJL-j07hDjg4.js} +1 -1
- package/dist/assets/{kanban-definition-PNTS6WVX-B7BRfQOT.js → kanban-definition-PNTS6WVX-DU8baSEs.js} +1 -1
- package/dist/assets/{linear-snu1EH2X.js → linear-Dj1tr9Bh.js} +1 -1
- package/dist/assets/{mermaid.core-ImU9bwtO.js → mermaid.core-BeSGZMCl.js} +5 -5
- package/dist/assets/{mindmap-definition-NLK3R4M7-xKUVLPlR.js → mindmap-definition-NLK3R4M7-LiRl-Bq2.js} +1 -1
- package/dist/assets/{pegDiagram-GJSIUBJH-B9BidmhC.js → pegDiagram-GJSIUBJH-COL7EWof.js} +1 -1
- package/dist/assets/{pieDiagram-5QR66LMP-Ch8Kv8t8.js → pieDiagram-5QR66LMP-BnMXaara.js} +1 -1
- package/dist/assets/{quadrantDiagram-O4NWA36T-Dunnqt7g.js → quadrantDiagram-O4NWA36T-BjLcZ6bG.js} +1 -1
- package/dist/assets/{railroadDiagram-XR7U4H2S-DnOaSZzz.js → railroadDiagram-XR7U4H2S-wKCzKLAA.js} +1 -1
- package/dist/assets/{requirementDiagram-PLB6GJNP-D0BmDdKg.js → requirementDiagram-PLB6GJNP-BjoTwmZ-.js} +1 -1
- package/dist/assets/{sankeyDiagram-IPEJSGJF-CWtfZ9Pz.js → sankeyDiagram-IPEJSGJF-CuGyR0Tn.js} +1 -1
- package/dist/assets/{sequenceDiagram-PO4LG4MO-DlMxxz_s.js → sequenceDiagram-PO4LG4MO-DxOzUuSx.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-CBK9A--M.js → sizeCapture-INFHLROL-B-bTrmx9.js} +1 -1
- package/dist/assets/{stateDiagram-v2-GCMORJYK-C7yP85Rg.js → stateDiagram-v2-GCMORJYK-D6ZflrZQ.js} +1 -1
- package/dist/assets/{swimlanes-2SLR337P-CPWaiwCv.js → swimlanes-2SLR337P-DKgdDJlH.js} +1 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-DSlLxTUH.js +8 -0
- package/dist/assets/{timeline-definition-EJHVYXUP-C1i2k1l3.js → timeline-definition-EJHVYXUP-Dli4hqxc.js} +1 -1
- package/dist/assets/{usecaseDiagram-POWQR4AR-DZMn9spA.js → usecaseDiagram-POWQR4AR-CQ8Cc1rN.js} +1 -1
- package/dist/assets/{vennDiagram-UO4OBE2U-CQTd7MTx.js → vennDiagram-UO4OBE2U-JEu7ZkzA.js} +1 -1
- package/dist/assets/{wardleyDiagram-VNRHLVJA-zuVyHyHg.js → wardleyDiagram-VNRHLVJA-DkFigbd0.js} +1 -1
- package/dist/assets/{xychartDiagram-PMCCYNJV-D6HRPUA0.js → xychartDiagram-PMCCYNJV-DwOctln8.js} +1 -1
- package/dist/index.html +1 -1
- package/dist-server/companion/src/routes.js +10 -0
- package/dist-server/container-mcp.js +81 -81
- package/dist-server/drivers/agents-proxy.js +81 -81
- package/dist-server/index.js +1004 -875
- package/dist-server/openmausbot.js +576 -566
- package/dist-server/pair-cli.js +576 -566
- package/dist-server/server/bot-package.js +3 -2
- package/dist-server/server/harness-import/adapters.js +13 -1
- package/dist-server/server/harness-import/apply.js +21 -41
- package/dist-server/server/harness-import/cli-skills.js +124 -0
- package/dist-server/server/harness-import/convert.js +2 -2
- package/dist-server/server/harness-import/grokbot.js +36 -0
- package/dist-server/server/harness-import/hermes.js +3 -2
- package/dist-server/server/index.js +3 -3
- package/dist-server/server/model-evidence-context.js +7 -0
- package/dist-server/server/model-evidence.js +6 -1
- package/dist-server/server/system-prompt.js +1 -1
- package/dist-server/shared/model-evidence.js +13 -0
- package/dist-server/vps-container-mcp.js +81 -81
- package/package.json +1 -1
- package/skills/reverse-engineer-anything/LICENSE-rea-agents.txt +21 -0
- package/skills/reverse-engineer-anything/SKILL.md +356 -0
- package/skills/reverse-engineer-anything/VENDORED.md +46 -0
- package/skills/reverse-engineer-anything/manifest.json +21 -0
- package/skills/reverse-engineer-anything/references/android-applications.md +36 -0
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +71 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +218 -0
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +297 -0
- package/skills/reverse-engineer-anything/references/runtime-observation.md +78 -0
- package/dist/assets/channel-Ber8y2Xi.js +0 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-BxCTRDZa.js +0 -8
|
@@ -148,7 +148,8 @@ const packageSchema = z.object({
|
|
|
148
148
|
}),
|
|
149
149
|
playbooks: z.array(key).max(40).optional(),
|
|
150
150
|
skills: z.array(skillName).max(BOT_PACKAGE_MAX_SKILLS).optional(),
|
|
151
|
-
|
|
151
|
+
// Empty for a harness import that brought skills alone (command-line tools).
|
|
152
|
+
})).max(200),
|
|
152
153
|
chiefOfStaff: key.optional(),
|
|
153
154
|
rooms: z.array(z.object({
|
|
154
155
|
key,
|
|
@@ -367,7 +368,7 @@ export function renderBotPackageMarkdown(document) {
|
|
|
367
368
|
const connections = pkg.requirements.apps.length
|
|
368
369
|
? pkg.requirements.apps.map((app) => `- **${app.label}${app.optional ? " (optional)" : ""}:** ${app.reason}`).join("\n")
|
|
369
370
|
: "- No connected apps are required.";
|
|
370
|
-
const markdown = `---\n${frontmatter}\n---\n\n# ${pkg.name}\n\n${pkg.tagline}\n\n> **Give this file to your Chief of Staff.** It is the complete team blueprint. Any agent system can run it; Atomic can also install it directly.\n\n## Activation\n\nYou are the Chief of Staff for this blueprint. Read the whole document before acting. Confirm the user's goal and any missing inputs, then create or delegate to the specialist roles below. Preserve their names, ownership, boundaries, shared-room rules, and playbooks. If your platform cannot literally spawn agents, perform the roles one at a time and keep their outputs clearly separated.\n\nNever request pasted passwords or secret keys. Use the platform's normal connection flow. Do not send messages, publish content, spend money, delete data, or enable a schedule without the user's explicit approval. All routines start paused.\n\n## Mission\n\n${pkg.summary}\n\n## Outcomes\n\n${list(pkg.outcomes)}\n\n## Connections\n\n${connections}\n\n## Team\n\n${agents}\n\n## Chief of Staff\n\nThe Chief of Staff role is \`${pkg.chiefOfStaff ?? pkg.agents[0]
|
|
371
|
+
const markdown = `---\n${frontmatter}\n---\n\n# ${pkg.name}\n\n${pkg.tagline}\n\n> **Give this file to your Chief of Staff.** It is the complete team blueprint. Any agent system can run it; Atomic can also install it directly.\n\n## Activation\n\nYou are the Chief of Staff for this blueprint. Read the whole document before acting. Confirm the user's goal and any missing inputs, then create or delegate to the specialist roles below. Preserve their names, ownership, boundaries, shared-room rules, and playbooks. If your platform cannot literally spawn agents, perform the roles one at a time and keep their outputs clearly separated.\n\nNever request pasted passwords or secret keys. Use the platform's normal connection flow. Do not send messages, publish content, spend money, delete data, or enable a schedule without the user's explicit approval. All routines start paused.\n\n## Mission\n\n${pkg.summary}\n\n## Outcomes\n\n${list(pkg.outcomes)}\n\n## Connections\n\n${connections}\n\n## Team\n\n${agents}\n\n## Chief of Staff\n\nThe Chief of Staff role is \`${pkg.chiefOfStaff ?? pkg.agents[0]?.key ?? "chibi"}\`. This role owns delegation, synthesis, conflict resolution, and the final answer to the user.\n${rooms ? `\n## Shared rooms\n\n${rooms}\n` : ""}${routines ? `\n## Suggested routines\n\n${routines}\n` : ""}${playbooks ? `\n## Playbooks\n\n${playbooks}\n` : ""}${examples ? `\n## Example job\n\n${examples}\n` : ""}\n## Completion rule\n\nReturn one clear result to the user, distinguish evidence from inference, cite source links when the work uses external material, and state what still needs human approval or a connected app.\n`;
|
|
371
372
|
if (Buffer.byteLength(markdown) > BOT_PACKAGE_MARKDOWN_MAX_BYTES)
|
|
372
373
|
throw new Error("The bot playbook is too large");
|
|
373
374
|
return markdown;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// (model.ts), and says where its conversations are. Conversion, preview and
|
|
4
4
|
// apply are shared.
|
|
5
5
|
import { appRules, checkBackupFolder } from "./apply.js";
|
|
6
|
+
import { checkCliSkillsFolder, CLI_SKILLS_HISTORY, CLI_SKILLS_KIND, CLI_SKILLS_LABEL, detectCliSkills, readCliSkills } from "./cli-skills.js";
|
|
6
7
|
import { convertHarness } from "./convert.js";
|
|
7
8
|
import { readGrokBackup } from "./grokbot.js";
|
|
8
9
|
import { checkHermesFolder, detectHermes, hermesRules, readHermesHome } from "./hermes.js";
|
|
@@ -26,7 +27,18 @@ export const HERMES_ADAPTER = {
|
|
|
26
27
|
rules: hermesRules,
|
|
27
28
|
history: HERMES_HISTORY,
|
|
28
29
|
};
|
|
29
|
-
|
|
30
|
+
/** Skills from Claude Code, Codex, Gemini CLI and Grok CLI on this computer.
|
|
31
|
+
* They land on Chibi, who routes work to the bot that holds a skill. */
|
|
32
|
+
export const CLI_SKILLS_ADAPTER = {
|
|
33
|
+
id: CLI_SKILLS_KIND,
|
|
34
|
+
label: CLI_SKILLS_LABEL,
|
|
35
|
+
detect: () => detectCliSkills().map((found) => ({ root: found.root, bots: 0, skills: found.skills })),
|
|
36
|
+
checkFolder: checkCliSkillsFolder,
|
|
37
|
+
read: (root) => readCliSkills(root),
|
|
38
|
+
rules: hermesRules,
|
|
39
|
+
history: CLI_SKILLS_HISTORY,
|
|
40
|
+
};
|
|
41
|
+
export const HARNESS_ADAPTERS = [HERMES_ADAPTER, GROKBOT_ADAPTER, CLI_SKILLS_ADAPTER];
|
|
30
42
|
export const harnessAdapter = (id) => HARNESS_ADAPTERS.find((adapter) => adapter.id === id);
|
|
31
43
|
/** The in-app conversion: credentials as references, disabled jobs and
|
|
32
44
|
* skipped items offered unticked. */
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
// rest of the app uses. The client only ever names package keys; the server
|
|
4
4
|
// re-reads the backup for both steps, so no persona text or credential
|
|
5
5
|
// crosses the wire, and every credential arrives as an `${ENV}` reference.
|
|
6
|
-
import { existsSync, statSync } from "node:fs";
|
|
7
|
-
import { homedir } from "node:os";
|
|
8
|
-
import { basename, dirname, isAbsolute, join, resolve } from "node:path";
|
|
9
6
|
import { packageAgentAsMember } from "../bot-package.js";
|
|
10
7
|
import { parseSkillMd, SKILL_FILE_MAX_BYTES } from "../skills.js";
|
|
11
8
|
import { maskedMcpTarget, mcpTargetKey } from "../mcp-import-detect.js";
|
|
@@ -28,41 +25,20 @@ export const importIdentity = (result) => ({
|
|
|
28
25
|
label: result.report.source.label ?? GROKBOT_IDENTITY.label,
|
|
29
26
|
packageId: result.pkg.package.id,
|
|
30
27
|
});
|
|
28
|
+
/** A source with no bots (skills from command-line tools) puts its skills on
|
|
29
|
+
* Chibi, the Primary Bot, who routes work to the bot that holds a skill. */
|
|
30
|
+
export function skillsOnlyHome(report, bots) {
|
|
31
|
+
return report.bots.length ? undefined : bots.find((bot) => bot.builtin === "chibi");
|
|
32
|
+
}
|
|
33
|
+
/** `grokbot:workflows/<slug>`, `hermes:skills/<slug>`, `cli-skills:.claude/skills/<slug>`:
|
|
34
|
+
* where an installed skill came from. */
|
|
35
|
+
export const skillProvenance = (identity, skill) => identity.kind === "grokbot" ? `grokbot:workflows/${skill.slug}`
|
|
36
|
+
: identity.kind === "cli-skills" ? `cli-skills:${skill.sourcePath}`
|
|
37
|
+
: `${identity.kind}:skills/${skill.slug}`;
|
|
31
38
|
/** `grokbot:<uuid>`, `hermes:<profile>`: the source bot an Atomic bot came from. */
|
|
32
39
|
export const sourceRefFor = (identity, sourceId) => `${identity.kind}:${sourceId}`;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
export function checkBackupFolder(input) {
|
|
36
|
-
if (typeof input !== "string" || !input.trim()) {
|
|
37
|
-
return { ok: false, code: "path_required", error: "Choose the folder that holds your Grok Bot backup." };
|
|
38
|
-
}
|
|
39
|
-
if (input.length > 4096 || input.includes("\0"))
|
|
40
|
-
return { ok: false, code: "not_found", error: "That folder does not exist." };
|
|
41
|
-
let path = input.trim();
|
|
42
|
-
if (path === "~" || path.startsWith("~/"))
|
|
43
|
-
path = join(homedir(), path.slice(1));
|
|
44
|
-
if (!isAbsolute(path)) {
|
|
45
|
-
return { ok: false, code: "not_absolute", error: "Enter the full path to the backup folder, for example /Users/you/Downloads/grokbot-backup." };
|
|
46
|
-
}
|
|
47
|
-
path = resolve(path);
|
|
48
|
-
if (!existsSync(path))
|
|
49
|
-
return { ok: false, code: "not_found", error: "That folder does not exist." };
|
|
50
|
-
if (!statSync(path).isDirectory())
|
|
51
|
-
return { ok: false, code: "not_folder", error: "That path is a file. Choose the backup folder instead." };
|
|
52
|
-
const isBackup = (root) => {
|
|
53
|
-
const agents = join(root, "agent-data", "agents");
|
|
54
|
-
return existsSync(agents) && statSync(agents).isDirectory();
|
|
55
|
-
};
|
|
56
|
-
if (isBackup(path))
|
|
57
|
-
return { ok: true, root: path };
|
|
58
|
-
if (basename(path) === "agent-data" && isBackup(dirname(path)))
|
|
59
|
-
return { ok: true, root: dirname(path) };
|
|
60
|
-
return {
|
|
61
|
-
ok: false,
|
|
62
|
-
code: "not_grokbot",
|
|
63
|
-
error: "This folder is not a Grok Bot backup. Choose the folder that contains agent-data.",
|
|
64
|
-
};
|
|
65
|
-
}
|
|
40
|
+
// ── the backup folder ──────────────────────────────────────────────────
|
|
41
|
+
export { checkBackupFolder } from "./grokbot.js";
|
|
66
42
|
/** The conversion the in-app import uses: credentials as references, disabled
|
|
67
43
|
* automations included (offered unticked), and plain schedules in the zone
|
|
68
44
|
* Grok Bot ran them in (Eastern), whatever this computer's zone is. */
|
|
@@ -257,14 +233,15 @@ export function buildPreview(result, root, deps, candidates = []) {
|
|
|
257
233
|
apps: (botApps.get(bot.key) ?? []).map((app) => ({ slug: app.slug, label: app.label, status: app.status })),
|
|
258
234
|
notes: (bot.notes ?? []).map(safe),
|
|
259
235
|
}));
|
|
236
|
+
const skillHome = skillsOnlyHome(report, botsNow);
|
|
260
237
|
const skills = report.skills.map((skill) => {
|
|
261
|
-
const targets = skill.ownerKeys.map((key) => botIdByKey.get(key)).filter((id) => Boolean(id));
|
|
238
|
+
const targets = skillHome ? [skillHome.id] : skill.ownerKeys.map((key) => botIdByKey.get(key)).filter((id) => Boolean(id));
|
|
262
239
|
return {
|
|
263
240
|
slug: skill.slug,
|
|
264
241
|
offered: skill.offered ?? null,
|
|
265
242
|
description: safe(descriptionOf(result, skill.slug)),
|
|
266
|
-
owners: skill.ownerKeys.map((key) => safe(botName.get(key) ?? key)),
|
|
267
|
-
alreadyImported:
|
|
243
|
+
owners: skillHome ? [safe(skillHome.name)] : skill.ownerKeys.map((key) => safe(botName.get(key) ?? key)),
|
|
244
|
+
alreadyImported: targets.length > 0 && (skillHome || targets.length === skill.ownerKeys.length) &&
|
|
268
245
|
targets.every((id) => deps.listSkills(id).some((installed) => installed.name === skill.slug)),
|
|
269
246
|
secrets: refCount(result, "skill", skill.slug),
|
|
270
247
|
};
|
|
@@ -720,9 +697,12 @@ export async function applyImport(result, selection, deps) {
|
|
|
720
697
|
out.needsAttention.playbookTriggers.push(safe(`${name} (${target.name}): ${trigger}`));
|
|
721
698
|
}
|
|
722
699
|
// Skills install switched off, the way every imported skill does.
|
|
700
|
+
const skillHome = skillsOnlyHome(report, botsNow);
|
|
723
701
|
for (const slug of selection.skills) {
|
|
724
702
|
const skill = reportSkill.get(slug);
|
|
725
|
-
const owners =
|
|
703
|
+
const owners = skillHome
|
|
704
|
+
? [{ id: skillHome.id, name: skillHome.name, created: false }]
|
|
705
|
+
: skill.ownerKeys.map((key) => targets.get(key)).filter((target) => Boolean(target));
|
|
726
706
|
if (!owners.length) {
|
|
727
707
|
out.skipped.push({ kind: "skill", name: slug, reason: "None of the bots that use it were selected" });
|
|
728
708
|
continue;
|
|
@@ -741,7 +721,7 @@ export async function applyImport(result, selection, deps) {
|
|
|
741
721
|
out.alreadyImported.skills++;
|
|
742
722
|
continue;
|
|
743
723
|
}
|
|
744
|
-
const installed = deps.installSkill(owner.id, identity
|
|
724
|
+
const installed = deps.installSkill(owner.id, skillProvenance(identity, skill), [{ path: "SKILL.md", content }]);
|
|
745
725
|
if ("error" in installed) {
|
|
746
726
|
out.skipped.push({ kind: "skill", name: slug, reason: `Could not be added to ${owner.name}: ${installed.error}` });
|
|
747
727
|
continue;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Skills from the command-line tools on this computer: Claude Code
|
|
2
|
+
// (~/.claude/skills), Codex (~/.codex/skills and the shared ~/.agents/skills),
|
|
3
|
+
// Gemini CLI (~/.gemini/skills) and Grok CLI (~/.grok/skills). Read-only: the
|
|
4
|
+
// source folders are never changed. Atomic keeps one copy of each skill, so
|
|
5
|
+
// the same skill found in several tools is offered once; the copies are
|
|
6
|
+
// listed unticked as exact copies.
|
|
7
|
+
import { existsSync, statSync } from "node:fs";
|
|
8
|
+
import { homedir } from "node:os";
|
|
9
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
10
|
+
import { fingerprint, readSkillFolder } from "./hermes.js";
|
|
11
|
+
import { createSourceReader } from "./source-reader.js";
|
|
12
|
+
export const CLI_SKILLS_KIND = "cli-skills";
|
|
13
|
+
export const CLI_SKILLS_LABEL = "Command-line tools";
|
|
14
|
+
/** Where each tool keeps its skills, relative to the home folder. Order is
|
|
15
|
+
* precedence: when the same skill name differs between tools, the first wins. */
|
|
16
|
+
export const CLI_SKILL_HOMES = [
|
|
17
|
+
{ tool: "Claude Code", dir: ".claude/skills" },
|
|
18
|
+
{ tool: "Codex", dir: ".codex/skills" },
|
|
19
|
+
{ tool: "Codex", dir: ".agents/skills" },
|
|
20
|
+
{ tool: "Gemini CLI", dir: ".gemini/skills" },
|
|
21
|
+
{ tool: "Grok CLI", dir: ".grok/skills" },
|
|
22
|
+
];
|
|
23
|
+
// ponytail: $CODEX_HOME / $GROK_HOME / $CLAUDE_CONFIG_DIR overrides are not followed; type the folder instead.
|
|
24
|
+
const SLUG = "[A-Za-z0-9][A-Za-z0-9._-]*";
|
|
25
|
+
const HOME_DIRS = CLI_SKILL_HOMES.map((home) => home.dir.replace(/\./g, "\\.")).join("|");
|
|
26
|
+
/** `<skills dir>/<slug>` in a home folder, or `<slug>` in a plain skills folder. */
|
|
27
|
+
const SKILL = `(?:(?:${HOME_DIRS})/)?${SLUG}`;
|
|
28
|
+
export const CLI_SKILLS_ALLOWLIST = {
|
|
29
|
+
files: [
|
|
30
|
+
new RegExp(`^${SKILL}/SKILL\\.md$`),
|
|
31
|
+
new RegExp(`^${SKILL}/(?:references|scripts)/${SLUG}$`),
|
|
32
|
+
],
|
|
33
|
+
dirs: [
|
|
34
|
+
/^$/,
|
|
35
|
+
new RegExp(`^(?:${HOME_DIRS})$`),
|
|
36
|
+
new RegExp(`^${SKILL}$`),
|
|
37
|
+
new RegExp(`^${SKILL}/(?:references|scripts)$`),
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
const isSlug = (name) => new RegExp(`^${SLUG}$`).test(name);
|
|
41
|
+
/** Skill folders under `base` ("" for the root itself). */
|
|
42
|
+
function skillDirs(reader, base) {
|
|
43
|
+
const out = [];
|
|
44
|
+
for (const entry of reader.list(base, "dir")) {
|
|
45
|
+
const dir = base ? `${base}/${entry}` : entry;
|
|
46
|
+
if (isSlug(entry) && reader.exists(`${dir}/SKILL.md`))
|
|
47
|
+
out.push(dir);
|
|
48
|
+
}
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
/** The tool skill folders present in `root`, or `[""]` when `root` is itself a folder of skills. */
|
|
52
|
+
function layout(reader) {
|
|
53
|
+
// The reader's exists() is for files; a tool folder counts when it lists.
|
|
54
|
+
const homes = CLI_SKILL_HOMES.map((home) => home.dir).filter((dir) => reader.list(dir, "dir").length);
|
|
55
|
+
if (homes.length)
|
|
56
|
+
return homes;
|
|
57
|
+
return skillDirs(reader, "").length ? [""] : [];
|
|
58
|
+
}
|
|
59
|
+
export function readCliSkills(root, fs) {
|
|
60
|
+
const reader = createSourceReader(root, CLI_SKILLS_ALLOWLIST, fs);
|
|
61
|
+
const found = new Map();
|
|
62
|
+
const skills = [];
|
|
63
|
+
for (const base of layout(reader)) {
|
|
64
|
+
for (const dir of skillDirs(reader, base)) {
|
|
65
|
+
const files = readSkillFolder(reader, dir);
|
|
66
|
+
if (!files)
|
|
67
|
+
continue;
|
|
68
|
+
const slug = dir.slice(dir.lastIndexOf("/") + 1);
|
|
69
|
+
const print = fingerprint(files);
|
|
70
|
+
const first = found.get(slug);
|
|
71
|
+
// Same name, same content elsewhere: offered as an exact copy by the
|
|
72
|
+
// shared dedupe. Same name, different content: the first tool wins.
|
|
73
|
+
const name = !first ? slug : first.print === print ? `${slug}-copy-${skills.length}` : "";
|
|
74
|
+
if (!name)
|
|
75
|
+
continue;
|
|
76
|
+
if (!first)
|
|
77
|
+
found.set(slug, { dir, print });
|
|
78
|
+
skills.push({ slug: name, sourcePath: dir, files });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return { kind: CLI_SKILLS_KIND, label: CLI_SKILLS_LABEL, root: reader.root, bots: [], routines: [], rooms: [], vendorSkills: [], skills };
|
|
82
|
+
}
|
|
83
|
+
export function checkCliSkillsFolder(input) {
|
|
84
|
+
if (typeof input !== "string" || !input.trim()) {
|
|
85
|
+
return { ok: false, code: "path_required", error: "Choose your home folder, or a folder of skills." };
|
|
86
|
+
}
|
|
87
|
+
if (input.length > 4096 || input.includes("\0"))
|
|
88
|
+
return { ok: false, code: "not_found", error: "That folder does not exist." };
|
|
89
|
+
let path = input.trim();
|
|
90
|
+
if (path === "~" || path.startsWith("~/"))
|
|
91
|
+
path = join(homedir(), path.slice(1));
|
|
92
|
+
if (!isAbsolute(path))
|
|
93
|
+
return { ok: false, code: "not_absolute", error: "Enter the full path, for example /Users/you." };
|
|
94
|
+
path = resolve(path);
|
|
95
|
+
if (!existsSync(path))
|
|
96
|
+
return { ok: false, code: "not_found", error: "That folder does not exist." };
|
|
97
|
+
if (!statSync(path).isDirectory())
|
|
98
|
+
return { ok: false, code: "not_folder", error: "That path is a file. Choose a folder instead." };
|
|
99
|
+
try {
|
|
100
|
+
if (layout(createSourceReader(path, CLI_SKILLS_ALLOWLIST)).length)
|
|
101
|
+
return { ok: true, root: path };
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
// Unreadable: reported below.
|
|
105
|
+
}
|
|
106
|
+
return { ok: false, code: "not_skills", error: "No skills here. Choose your home folder (it holds .claude/skills, .codex/skills, .agents/skills, .gemini/skills or .grok/skills) or a folder whose subfolders each have a SKILL.md." };
|
|
107
|
+
}
|
|
108
|
+
export function detectCliSkills(home = homedir(), fs) {
|
|
109
|
+
try {
|
|
110
|
+
const count = readCliSkills(home, fs).skills.length;
|
|
111
|
+
return count ? [{ root: home, skills: count }] : [];
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return [];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/** Skills have no conversations. */
|
|
118
|
+
export const CLI_SKILLS_HISTORY = {
|
|
119
|
+
project: "",
|
|
120
|
+
receiptPrefix: "cli-skills:",
|
|
121
|
+
available: () => false,
|
|
122
|
+
plan: () => ({ plan: null, unreadable: false }),
|
|
123
|
+
reader: (root, fs) => createSourceReader(root, { files: [], dirs: [] }, fs),
|
|
124
|
+
};
|
|
@@ -623,7 +623,7 @@ export function convertHarness(source, options = {}) {
|
|
|
623
623
|
...(offeredSkill.has(skill.slug) ? { offered: offeredSkill.get(skill.slug) } : {}),
|
|
624
624
|
});
|
|
625
625
|
}
|
|
626
|
-
if (converted.length > packageSkills.length) {
|
|
626
|
+
if (source.bots.length && converted.length > packageSkills.length) {
|
|
627
627
|
report.limits.push(`Team files carry at most ${rules.maxEmbeddedSkills} skills; ${converted.length - packageSkills.length} converted skill(s) are only in skills/ and must be installed per bot.`);
|
|
628
628
|
}
|
|
629
629
|
// ── rooms and vendor skills ─────────────────────────────────────────
|
|
@@ -704,7 +704,7 @@ export function convertHarness(source, options = {}) {
|
|
|
704
704
|
flags: spec.refs.length ? ["secrets-referenced"] : [],
|
|
705
705
|
});
|
|
706
706
|
}
|
|
707
|
-
if (!agents.length)
|
|
707
|
+
if (source.bots.length && !agents.length)
|
|
708
708
|
throw new Error("Nothing to convert: every bot was dropped or held back");
|
|
709
709
|
if (!orchestratorKey)
|
|
710
710
|
report.limits.push("No Chief of Staff could be set: the orchestrator bot was not converted.");
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
// neutral harness model. It never lists an agent folder, so it never learns
|
|
3
3
|
// the names of the stores that sit beside profile.json. It lists only the
|
|
4
4
|
// memory/ folder, whose markdown notes are the bot's own memory.
|
|
5
|
+
import { existsSync, statSync } from "node:fs";
|
|
6
|
+
import { homedir } from "node:os";
|
|
7
|
+
import { basename, dirname, isAbsolute, join, resolve } from "node:path";
|
|
5
8
|
import { parse as parseYaml } from "yaml";
|
|
6
9
|
import { DEFAULT_RULES } from "./rules.js";
|
|
7
10
|
import { createSourceReader, MAX_MEMORY_FILE_BYTES } from "./source-reader.js";
|
|
@@ -262,3 +265,36 @@ export function skillFrontmatter(content) {
|
|
|
262
265
|
body: match[2] ?? "",
|
|
263
266
|
};
|
|
264
267
|
}
|
|
268
|
+
/** Where a typed or picked path points, as a Grok Bot backup root. Choosing
|
|
269
|
+
* the `agent-data` folder itself is accepted and means its parent. */
|
|
270
|
+
export function checkBackupFolder(input) {
|
|
271
|
+
if (typeof input !== "string" || !input.trim()) {
|
|
272
|
+
return { ok: false, code: "path_required", error: "Choose the folder that holds your Grok Bot backup." };
|
|
273
|
+
}
|
|
274
|
+
if (input.length > 4096 || input.includes("\0"))
|
|
275
|
+
return { ok: false, code: "not_found", error: "That folder does not exist." };
|
|
276
|
+
let path = input.trim();
|
|
277
|
+
if (path === "~" || path.startsWith("~/"))
|
|
278
|
+
path = join(homedir(), path.slice(1));
|
|
279
|
+
if (!isAbsolute(path)) {
|
|
280
|
+
return { ok: false, code: "not_absolute", error: "Enter the full path to the backup folder, for example /Users/you/Downloads/grokbot-backup." };
|
|
281
|
+
}
|
|
282
|
+
path = resolve(path);
|
|
283
|
+
if (!existsSync(path))
|
|
284
|
+
return { ok: false, code: "not_found", error: "That folder does not exist." };
|
|
285
|
+
if (!statSync(path).isDirectory())
|
|
286
|
+
return { ok: false, code: "not_folder", error: "That path is a file. Choose the backup folder instead." };
|
|
287
|
+
const isBackup = (root) => {
|
|
288
|
+
const agents = join(root, "agent-data", "agents");
|
|
289
|
+
return existsSync(agents) && statSync(agents).isDirectory();
|
|
290
|
+
};
|
|
291
|
+
if (isBackup(path))
|
|
292
|
+
return { ok: true, root: path };
|
|
293
|
+
if (basename(path) === "agent-data" && isBackup(dirname(path)))
|
|
294
|
+
return { ok: true, root: dirname(path) };
|
|
295
|
+
return {
|
|
296
|
+
ok: false,
|
|
297
|
+
code: "not_grokbot",
|
|
298
|
+
error: "This folder is not a Grok Bot backup. Choose the folder that contains agent-data.",
|
|
299
|
+
};
|
|
300
|
+
}
|
|
@@ -322,7 +322,8 @@ function readRoutines(reader, profile, config) {
|
|
|
322
322
|
};
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
|
-
|
|
325
|
+
/** SKILL.md plus the text files under references/ and scripts/. Shared with the CLI skills adapter. */
|
|
326
|
+
export function readSkillFolder(reader, dir) {
|
|
326
327
|
const main = reader.readText(`${dir}/SKILL.md`);
|
|
327
328
|
if (main === null)
|
|
328
329
|
return null;
|
|
@@ -369,7 +370,7 @@ function bundledSkills(reader, profile) {
|
|
|
369
370
|
const text = reader.readText(`${profile.base}skills/.bundled_manifest`) ?? "";
|
|
370
371
|
return new Set(text.split(/\r?\n/).map((line) => line.split(":")[0].trim()).filter(Boolean));
|
|
371
372
|
}
|
|
372
|
-
const fingerprint = (files) => createHash("sha256").update(files.map((file) => `${file.file}\0${file.content.replace(/\r\n/g, "\n").trim()}`).join("\0\0")).digest("hex");
|
|
373
|
+
export const fingerprint = (files) => createHash("sha256").update(files.map((file) => `${file.file}\0${file.content.replace(/\r\n/g, "\n").trim()}`).join("\0\0")).digest("hex");
|
|
373
374
|
/** One skill per slug and content across profiles. The version most profiles
|
|
374
375
|
* share keeps the slug; a profile's own edit becomes `<slug>-<profile>`. */
|
|
375
376
|
function mergeSkills(found) {
|
|
@@ -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";
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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));
|