@karmaniverous/jeeves 0.5.9 → 0.5.10

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.
@@ -53,31 +53,31 @@ var hasRequiredExtraTypings;
53
53
  function requireExtraTypings () {
54
54
  if (hasRequiredExtraTypings) return extraTypings.exports;
55
55
  hasRequiredExtraTypings = 1;
56
- (function (module, exports$1) {
56
+ (function (module, exports) {
57
57
  const commander = require$$0;
58
58
 
59
- exports$1 = module.exports = {};
59
+ exports = module.exports = {};
60
60
 
61
61
  // Return a different global program than commander,
62
62
  // and don't also return it as default export.
63
- exports$1.program = new commander.Command();
63
+ exports.program = new commander.Command();
64
64
 
65
65
  /**
66
66
  * Expose classes. The FooT versions are just types, so return Commander original implementations!
67
67
  */
68
68
 
69
- exports$1.Argument = commander.Argument;
70
- exports$1.Command = commander.Command;
71
- exports$1.CommanderError = commander.CommanderError;
72
- exports$1.Help = commander.Help;
73
- exports$1.InvalidArgumentError = commander.InvalidArgumentError;
74
- exports$1.InvalidOptionArgumentError = commander.InvalidArgumentError; // Deprecated
75
- exports$1.Option = commander.Option;
69
+ exports.Argument = commander.Argument;
70
+ exports.Command = commander.Command;
71
+ exports.CommanderError = commander.CommanderError;
72
+ exports.Help = commander.Help;
73
+ exports.InvalidArgumentError = commander.InvalidArgumentError;
74
+ exports.InvalidOptionArgumentError = commander.InvalidArgumentError; // Deprecated
75
+ exports.Option = commander.Option;
76
76
 
77
- exports$1.createCommand = (name) => new commander.Command(name);
78
- exports$1.createOption = (flags, description) =>
77
+ exports.createCommand = (name) => new commander.Command(name);
78
+ exports.createOption = (flags, description) =>
79
79
  new commander.Option(flags, description);
80
- exports$1.createArgument = (name, description) =>
80
+ exports.createArgument = (name, description) =>
81
81
  new commander.Argument(name, description);
82
82
  } (extraTypings, extraTypings.exports));
83
83
  return extraTypings.exports;
@@ -121,8 +121,6 @@ const WORKSPACE_FILES = {
121
121
  };
122
122
  /** Skill directory name within workspace. */
123
123
  const SKILLS_DIR = 'skills';
124
- /** Jeeves skill directory name. */
125
- const JEEVES_SKILL_DIR = 'jeeves';
126
124
  /** Component versions state file name. */
127
125
  const COMPONENT_VERSIONS_FILE = 'component-versions.json';
128
126
 
@@ -130,14 +128,14 @@ const COMPONENT_VERSIONS_FILE = 'component-versions.json';
130
128
  * Core library version, inlined at build time.
131
129
  *
132
130
  * @remarks
133
- * The `0.5.8` placeholder is replaced by
131
+ * The `0.5.9` placeholder is replaced by
134
132
  * `@rollup/plugin-replace` during the build with the actual version
135
133
  * from `package.json`. This ensures the correct version survives
136
134
  * when consumers bundle core into their own dist (where runtime
137
135
  * `import.meta.url`-based resolution would find the wrong package.json).
138
136
  */
139
137
  /** The core library version from package.json (inlined at build time). */
140
- const CORE_VERSION = '0.5.8';
138
+ const CORE_VERSION = '0.5.9';
141
139
 
142
140
  /**
143
141
  * Shared file I/O helpers for managed section operations.
@@ -751,7 +749,158 @@ function buildWithSections(beforeContent, userContent, sections, markers, coreVe
751
749
  return parts.join('\n');
752
750
  }
753
751
 
754
- var skillContent = `---
752
+ var codingContent = `---
753
+ name: coding
754
+ description: Engineering standards for all code work. Use when writing code, reviewing PRs, spawning coding sub-agents, or making architectural decisions in any project (not just Jeeves). Covers design-first development, schema-first patterns, testing, STAN workflow, dependency management, and pre-PR checklist.
755
+ ---
756
+
757
+ # Engineering Standards
758
+
759
+ These standards apply to ALL code work — whether done directly or via sub-agents.
760
+ When spawning sub-agents for coding tasks, include the relevant rules in the task prompt.
761
+ Sub-agents don't inherit your context — if you don't pass the rules, they don't exist.
762
+
763
+ ---
764
+
765
+ ## Design-First Development
766
+
767
+ 1. **Iterate on design until convergence** — Summarize requirements, propose approach, raise questions BEFORE writing code.
768
+ 2. **Services-first architecture** — Core logic in services behind ports; adapters thin; side effects at boundaries.
769
+ 3. **Schema-first** — Runtime schema (Zod) is source of truth; TypeScript types derived via \`z.infer<>\`; validation centralized. Plain TypeScript \`interface\` declarations for config surfaces are not acceptable.
770
+ 4. **300 LOC hard limit** — If a file would exceed 300 lines, stop and decompose first. No exceptions.
771
+ 5. **Avoid \`any\`** — Prefer \`unknown\` + narrowing; if unavoidable, narrowest scope + rationale.
772
+ 6. **Test pairing** — Every non-trivial module gets a \`*.test.ts\`.
773
+ 7. **Open-source first** — Prefer established deps over home-grown solutions. Search npm/GitHub before building anything non-trivial.
774
+
775
+ ## Module Design
776
+
777
+ - **Single Responsibility** applies to modules as well as functions.
778
+ - Prefer many small modules over a few large ones.
779
+ - Keep module boundaries explicit and cohesive; avoid "kitchen-sink" files.
780
+ - Co-locate tests with modules for discoverability.
781
+
782
+ ## Config Surfaces
783
+
784
+ - Define config with **Zod schemas** — never bare TypeScript interfaces.
785
+ - Derive types: \`type MyConfig = z.infer<typeof myConfigSchema>\`
786
+ - Generate **JSON Schema** from Zod for IDE DX (\`\$schema\` pointer in config files).
787
+ - Validate at load time — fail fast with clear error messages.
788
+ - \`init\` commands generate config with \`\$schema\` pointer already in place.
789
+
790
+ ## Testing
791
+
792
+ - **Unit tests** for pure services (no fs/process/network).
793
+ - **Integration tests** for adapters/seams (minimal end-to-end slices).
794
+ - Exercise happy paths AND representative error paths.
795
+ - Table-driven cases encouraged for exhaustive coverage.
796
+ - Keep coverage meaningful — prefer covering branches/decisions over chasing 100% lines.
797
+
798
+ ## STAN-Enabled Repos
799
+
800
+ When working in a repo with \`.stan/\`:
801
+ - Run \`stan run --sequential --no-archive\` **before** each commit. Scripts must pass before you commit. Sequential runs are preferred to limit side effects. Archives are not needed (you won't use them).
802
+ - **Push after every commit.** Don't accumulate unpushed local commits. Jason needs to be able to see your work at any time.
803
+ - All scripts must pass before claiming work is complete.
804
+ - Read \`.stan/output/<script>.txt\` for evidence on failures.
805
+ - When creating stan scripts, eliminate colorized output where possible (e.g. \`--no-color\`, \`NO_COLOR=1\`) to reduce noise in script output files.
806
+
807
+ ## Cross-Package Verification
808
+
809
+ When changes affect exports consumed by another repo:
810
+ - Standalone scripts passing ≠ "ready for review."
811
+ - Use \`npm link\` or equivalent to verify the consumer builds against your changes.
812
+ - Only claim completion when BOTH repos pass.
813
+
814
+ ## Dependencies: Latest Versions Required (HARD GATE)
815
+
816
+ **NEVER use a superseded version of ANY dependency without direct human authorization.** When adding a new dependency — or creating a new project — ALWAYS check the latest stable version and use it. This applies to runtime deps, dev deps, and peer deps alike.
817
+
818
+ - Before \`npm install <package>\`: run \`npm view <package> version\` (or check npmjs.com) to confirm you're installing the current major.
819
+ - Before spawning sub-agents that install packages: include the latest version in the task prompt, or instruct the sub-agent to verify latest before installing.
820
+ - If the latest major has known breaking issues that block adoption, flag it to the human — don't silently pin an old major.
821
+
822
+ LLMs are trained on stale data. Your training cutoff means you will default to old versions of everything. **Assume your version knowledge is wrong** and verify before every install.
823
+
824
+ *Earned: 2026-05-12, created the jeeves-tools repo with Zod 3 despite Zod 4 being available since mid-2025. Shipped 84 commits on the old major before catching it.*
825
+
826
+ ## Dependencies: Local Over Global
827
+
828
+ - **Dev dependencies belong in the project, not the global environment.** Install with \`npm install --save-dev\`, not \`npm install -g\`.
829
+ - This guarantees reproducibility across machines and CI. Global installs mask environment differences that cause "works on my machine" failures.
830
+ - **Rare exceptions:** Tools that are genuinely machine-level utilities (e.g. \`stan-cli\`). If in doubt, install locally.
831
+ ## Dependency Failures
832
+
833
+ When a third-party dependency is broken:
834
+ 1. Summarize the failure concisely.
835
+ 2. Enumerate options: switch dependency → fix upstream → temporary pin → shim (last resort).
836
+ 3. Recommend with rationale.
837
+ 4. Do NOT immediately code around the problem.
838
+
839
+ ## CHANGELOG
840
+
841
+ - **Do not manually update CHANGELOG.md** — it is generated as part of the release process (e.g. via \`standard-version\`, \`changesets\`, or equivalent). Conventional commit messages are the input; the tooling produces the output.
842
+
843
+ ## Pre-PR Checklist (HARD GATE)
844
+
845
+ **Before creating ANY PR, run the full verification sequence. No exceptions.**
846
+
847
+ 1. \`stan run --sequential --no-archive\` if \`.stan/\` exists — this is the canonical check suite
848
+ 2. In monorepos: run checks **from each package directory**, not just the root. Root-level runs may mask package-level failures due to config resolution differences.
849
+ 3. Exercise the release path: check \`release-it\` hooks (or equivalent) in each releasable package — run the same commands (\`lint\`, \`typecheck\`, \`test\`, \`build\`) from the same cwd the release process uses.
850
+
851
+ If any step fails, fix it before committing. Do NOT create the PR and "note" the failures. Do NOT claim pre-existing failures without having actually run the commands first. Skipping this sequence is how we ship broken code and fabricate diagnoses.
852
+
853
+ - **Compare against canonical template** (\`karmaniverous/npm-package-template-ts\`) before any npm package PR. If the project is behind the template, update it to conform. If the template is behind the project, raise the issue with Jason for template upkeep.
854
+ - **Run \`ncu --peer\`** before any PR. Review the output. Update safe patches/minors. **Flag major version bumps for discussion** — never auto-apply \`ncu -u\` without reading what changed. Peer dep conflicts must be resolved, not ignored.
855
+ - When spawning sub-agents, include \`ncu --peer\` in the quality gate commands: \`ncu --peer && npm run lint && npm run typecheck && npm run build && npm test\`. The sub-agent should report \`ncu\` output and only apply updates that don't involve major bumps or peer conflicts.
856
+ - **Resolve ALL script warnings.** It is NOT acceptable to release code with outstanding warnings. They exist for a reason — fix them.
857
+ - **Typecheck/lint rules apply to ALL authored code**, including configs at project root (\`eslint.config.ts\`, \`rollup.config.ts\`, \`vitest.config.ts\`, etc.). Only generated code (e.g. typedoc output) should be excepted from code quality checks.
858
+ - **Never disable lint/typecheck rules** without surfacing it for discussion first. Disabled rules are a major code smell. If a rule must be disabled, document the rationale inline at the point of suppression.
859
+ - **Multiple tsconfigs are a code smell.** Sometimes needed, but often they paper over poor configuration choices. Fix root causes rather than adding tsconfig variants.
860
+ - **In a TS repo, all scripts should be authored in TS** (not JS). Prefer execution with \`tsx\`.
861
+ - **Clean-room verify before claiming "all green."** Run \`rimraf node_modules && npm install && npm run build\` (or equivalent) to catch issues masked by cached state. If someone reports an error you can't reproduce, assume your cache is lying — not that they're wrong.
862
+ - Verify build, test, and lint pass after updates.
863
+
864
+ ## Dev Workspace
865
+
866
+ - **Clone location:** \`D:\\repos\\{org-or-userid}\\{repo}\` (e.g. \`D:\\repos\\karmaniverous\\jeeves-watcher\`)
867
+ - D drive is the dev workspace. Do not clone repos elsewhere.
868
+ - Fresh clones are preferred over copying existing checkouts — \`npm install\` from registry is faster than disk-copying \`node_modules\`.
869
+ - D drive is NOT indexed by jeeves-watcher. Dev work stays off the archive.
870
+
871
+ ## GitHub Auth (HARD GATE)
872
+
873
+ - **ALL GitHub operations use \`jgs-jeeves\` auth.** Set \`GH_TOKEN\` before any \`gh\` CLI command:
874
+ \`\`\`powershell
875
+ \$env:GH_TOKEN = (Get-Content "J:\\config\\credentials\\github\\jgs-jeeves.token" -Raw).Trim()
876
+ \`\`\`
877
+ - Never write to GitHub as \`karmaniverous\` — that's Jason's account.
878
+ - If \`jgs-jeeves\` lacks permissions, **escalate to Jason** rather than falling back to \`karmaniverous\`.
879
+
880
+ ## Issue Hygiene
881
+
882
+ - **Always comment rationale when closing an issue without resolution** (duplicate, won't-fix, obsolete). The close action alone doesn't explain why.
883
+ - Reference the replacement issue/PR when closing as duplicate.
884
+
885
+ ## Code Style
886
+
887
+ - Prettier is source of truth for formatting.
888
+ - Keep imports sorted per repo tooling.
889
+ - Avoid dead code.
890
+ - TSDoc \`@module\` or \`@packageDocumentation\` on every non-test module.
891
+ - First 160 chars of module doc should be high-signal: what it does, IO/side effects, traversal hints.
892
+
893
+ ## eslint-disable is a HARD GATE
894
+
895
+ Never disable lint/typecheck rules without surfacing it for discussion first. Fix the code, don't suppress the warning. For test mocks, use properly typed partial objects (\`Partial<RealType>\`, typed \`MockReply\` interfaces) instead of \`any\`. Tests are code.
896
+
897
+ ## Git Merge Policy
898
+
899
+ - **No squash merges.** Preserve commit history.
900
+ - **PR reviewer:** When creating a PR under \`jgs-jeeves\` auth, always add \`karmaniverous\` (Jason) as a reviewer.
901
+ `;
902
+
903
+ var jeevesContent = `---
755
904
  name: jeeves
756
905
  description: Jeeves platform architecture, data flow, component interaction, scripts repo, and coordination knowledge. Use when making architectural decisions, coordinating across components, checking platform health, managing service lifecycle, or working with the scripts repo.
757
906
  ---
@@ -875,26 +1024,304 @@ When a workspace file exceeds the warning threshold, a \`## {filename}\` alert a
875
1024
  Each file heading follows the same declined/active lifecycle as component headings. Users can decline alerts by changing the heading to \`## {filename}: declined\` (e.g., \`## AGENTS.md: declined\`).
876
1025
  `;
877
1026
 
1027
+ var operationsContent = `---
1028
+ name: operations
1029
+ description: Operational knowledge for a Jeeves installation. Covers date formatting utilities, email pipeline architecture, curation signal protocol, label taxonomy, and data flow patterns. Use when working with date formatting, email scripts, debugging email pipeline issues, or understanding how human email actions are interpreted.
1030
+ ---
1031
+
1032
+ # Operations
1033
+
1034
+ Operational knowledge for the Jeeves platform. Covers email pipeline architecture, curation protocols, and operational conventions.
1035
+
1036
+ ## Date Formatting
1037
+
1038
+ A \`date-fns\` wrapper lives at \`{configRoot}/jeeves-core/scripts/src/lib/dates.ts\`. It provides:
1039
+
1040
+ | Export | Purpose |
1041
+ |--------|---------|
1042
+ | \`dayOfWeek(dateStr)\` | Full weekday name for an ISO date string (e.g. \`'Monday'\`) |
1043
+ | \`formatDate(dateStr, fmt)\` | Format with any date-fns pattern |
1044
+ | \`relativeDays(dateStr, refStr?)\` | Human-friendly relative description (\`'today'\`, \`'tomorrow'\`, \`'3 days ago'\`) |
1045
+ | \`parseISO\` / \`format\` | Re-exported from date-fns for direct use |
1046
+
1047
+ ### Gateway session usage
1048
+
1049
+ From a gateway session, call via \`exec\`:
1050
+
1051
+ \`\`\`
1052
+ node -e "import { dayOfWeek } from './src/lib/dates.js'; console.log(dayOfWeek('2026-05-11'));"
1053
+ \`\`\`
1054
+
1055
+ with \`workdir: {configRoot}/jeeves-core/scripts\`.
1056
+
1057
+ Or use the simpler inline form when the full wrapper isn't needed:
1058
+
1059
+ \`\`\`
1060
+ node -e "import { format, parseISO } from 'date-fns'; console.log(format(parseISO('2026-05-11'), 'EEEE'));"
1061
+ \`\`\`
1062
+
1063
+ with \`workdir: {configRoot}/jeeves-core/scripts\` (so date-fns resolves from \`node_modules\`).
1064
+
1065
+ ### Hard gate
1066
+
1067
+ NEVER state a day of the week without computing it first. LLMs cannot do day-of-week arithmetic reliably.
1068
+
1069
+ ## Email Curation Signal Protocol
1070
+
1071
+ Defines how human email actions in Gmail are interpreted by Jeeves email processes.
1072
+
1073
+ ### Human Signals
1074
+
1075
+ | Signal | Meaning | Action |
1076
+ |--------|---------|--------|
1077
+ | Label added | Human is adjusting Jeeves classification | Update domain process inputs to reflect new classification |
1078
+ | Label removed | Human is adjusting Jeeves classification (removal) | Update domain process inputs to reflect removed classification |
1079
+ | Archived → Inbox | Human wants to keep this email in sight | Add \`watch\` label via update queue |
1080
+ | Starred / Flagged | Elevated attention — email is important in context | Domain processes should weight higher |
1081
+ | Moved to Spam | Confirmed spam — human classified as junk | Learn from classification for future triage |
1082
+ | Removed from Spam | False positive — human rescued from spam | Process as normal email, learn from false positive |
1083
+
1084
+ ### Watch Label
1085
+
1086
+ The \`watch\` label has special semantics:
1087
+ - When present, never auto-archive the email
1088
+ - When a watched email lands in archive (by anyone), remove the watch label
1089
+ - Added automatically when a human moves an archived email back to inbox
1090
+
1091
+ ### Label Taxonomy
1092
+
1093
+ Labels applied by Jeeves processes fall into two categories:
1094
+
1095
+ **Mechanical labels** (applied by domain extractors with high confidence):
1096
+ - \`meeting\` — meeting-related email (invite, notes, transcript)
1097
+ - \`finance\` — financial email (receipt, invoice, billing, statement)
1098
+
1099
+ **Reasoning labels** (applied by Update Email Meta, requiring cross-domain context):
1100
+ - \`project/<name>\` — associated with a known project
1101
+ - \`todo\` — requires action or work from the user
1102
+ - \`reply\` — someone is waiting on a response
1103
+ - \`alert\` — automated notification from a service
1104
+ - \`readme\` — newsletter or subscribed informational content
1105
+
1106
+ ### Labeling Principles
1107
+
1108
+ 1. Label at the earliest point where confidence is high enough
1109
+ 2. Domain extractors label what they know with certainty
1110
+ 3. Update Email Meta labels what requires cross-domain context
1111
+ 4. A thread can have multiple labels
1112
+ 5. Do not re-label threads that already have the label
1113
+ 6. **Prefer false negatives over false positives**
1114
+
1115
+ ### Poll Scope
1116
+
1117
+ Query: \`newer_than:1d in:anywhere\`
1118
+
1119
+ Must include spam and trash to detect human curation signals (e.g., moving to/from spam).
1120
+
1121
+ ## Email Pipeline Architecture
1122
+
1123
+ ### Directory Layout
1124
+
1125
+ \`\`\`
1126
+ {configRoot}/jeeves-core/email-config.json — pipeline configuration (accounts, buckets)
1127
+ {workspace}/../email/threads/{account}/ — canonical email archive (thread.json + per-message JSONs)
1128
+ \`\`\`
1129
+
1130
+ ### Data Flow
1131
+
1132
+ 1. **Poll** (\`email/poll.ts\`) — searches Gmail for recent threads, classifies, enqueues important ones for metadata fetch
1133
+ 2. **Fetch** (\`email/email-fetch.ts\`) — fetches full thread metadata from Gmail, creates/updates \`thread.json\` cache, enqueues for body download
1134
+ 3. **Download** (\`email/download.ts\`) — downloads full message bodies, writes per-message JSONs to \`threads/{account}/{threadId}/\`
1135
+ 4. **Drain Updates** (\`email/drain-updates.ts\`) — applies label changes and other queued updates back to Gmail
1136
+ 5. **Meta synthesis** — jeeves-meta synthesizes email archives into searchable summaries
1137
+
1138
+ ### thread.json (Cache Format)
1139
+
1140
+ Each \`threads/{account}/{threadId}/thread.json\` contains:
1141
+ - \`threadId\`, \`account\`, \`subject\`, \`participants\`
1142
+ - \`messages\` — record of \`{ messageId → { from, to, cc, date, internalDateMs, labels, snippet, attachments } }\`
1143
+ - \`provenance\` — label change history
1144
+ - \`cachedAt\`, \`updatedAt\`
1145
+
1146
+ ### Per-Message JSONs
1147
+
1148
+ Each \`threads/{account}/{threadId}/{messageId}.json\` contains full message data:
1149
+ - \`messageId\`, \`threadId\`, \`account\`, \`subject\`, \`from\`, \`to\`, \`cc\`
1150
+ - \`date\` (RFC 2822), \`internalDateMs\` (epoch ms)
1151
+ - \`labels\`, \`body\`, \`attachments\`, \`downloadedAt\`
1152
+ `;
1153
+
1154
+ var playbooksContent = `---
1155
+ name: playbooks
1156
+ description: >
1157
+ Reusable operational workflow patterns for the Jeeves platform. Use when asked to
1158
+ set up a daily briefing for a person or team, create standing meeting ops (notes +
1159
+ agenda generation), replicate an existing workflow pattern for a new context, or
1160
+ understand how recurring intelligence/ops workflows are structured. Covers the
1161
+ full stack: content directory, TASK files, standing orders, runner jobs, dispatcher
1162
+ scripts, Slack channel integration, and meta synthesis.
1163
+ ---
1164
+
1165
+ # Playbooks
1166
+
1167
+ Proven, replicable operational patterns. Each playbook describes what it does, what
1168
+ infrastructure it needs, and how to instantiate a new instance.
1169
+
1170
+ ## Common Infrastructure
1171
+
1172
+ All playbooks share these building blocks:
1173
+
1174
+ | Component | Purpose |
1175
+ |-----------|---------|
1176
+ | **Content directory** | \`{workspace}/../<silo>/<domain>/\` — stores output files, \`.meta/\`, standing orders |
1177
+ | **TASK file** | Markdown prompt that defines the LLM session's entire job |
1178
+ | **Standing orders** | \`standing-orders.md\` — append-only file for persistent stakeholder preferences |
1179
+ | **Dispatcher script** | TypeScript in \`{configRoot}/jeeves-core/scripts/src/\` — reads TASK, spawns worker |
1180
+ | **Runner job** | jeeves-runner job with cron schedule, timezone, and rrstack |
1181
+ | **Slack channel** | Delivery surface — summary posts, quick-link pins, feedback loop |
1182
+ | **Meta entity** | \`.meta/\` directory seeded so jeeves-meta synthesizes context over time |
1183
+
1184
+ ### Dispatcher Pattern
1185
+
1186
+ All dispatchers use \`taskFileDispatcher\` from \`dispatchers/lib/task-file-dispatcher.ts\`:
1187
+
1188
+ \`\`\`typescript
1189
+ import { taskFileDispatcher } from '../dispatchers/lib/task-file-dispatcher.js';
1190
+
1191
+ taskFileDispatcher({
1192
+ scriptName: '<silo>/<job-name>',
1193
+ jobId: '<runner-job-id>',
1194
+ taskFile: '<path-to-TASK.md>',
1195
+ timeout: 600,
1196
+ injectDateContext: true,
1197
+ dateTimezone: '<IANA timezone>',
1198
+ });
1199
+ \`\`\`
1200
+
1201
+ \`injectDateContext: true\` prepends an authoritative date line so the LLM knows today's date.
1202
+
1203
+ ### Standing Orders Convention
1204
+
1205
+ - Append-only — never modify existing entries
1206
+ - TASK files instruct the LLM to read standing orders at Step 0
1207
+ - TASK files instruct the LLM to append new persistent preferences from channel feedback
1208
+ - Include initial configuration section with participants, timezones, channel rules
1209
+
1210
+ ## Available Playbook Patterns
1211
+
1212
+ | Pattern | Description |
1213
+ |---------|-------------|
1214
+ | **Daily Briefing** | Recurring intelligence or action-item report for a stakeholder |
1215
+ | **Standing Meeting Ops** | Post-meeting notes + next-day agenda generation for a recurring meeting |
1216
+
1217
+ ## Instantiation Checklist
1218
+
1219
+ When creating a new playbook instance:
1220
+
1221
+ 1. Choose the appropriate pattern from the table above
1222
+ 2. Create the content directory with \`.meta/\` and \`standing-orders.md\`
1223
+ 3. Write the TASK file(s) — adapt from an existing instance. Ensure Step 0 reads feedback from the *delivery channel* (where output is posted), not only a DM
1224
+ 4. Write the dispatcher script(s) in \`{configRoot}/jeeves-core/scripts/src/<silo>/\`
1225
+ 5. Register the runner job(s) with appropriate cron, timezone, rrstack
1226
+ 6. Set up the Slack channel — pin a quick-links message if the pattern calls for it
1227
+ 7. Seed \`.meta/\` so meta synthesis begins
1228
+ 8. Test with \`--dry-run\` before going live
1229
+ `;
1230
+
1231
+ var slackBotProvisionerContent = `---
1232
+ name: slack-bot-provisioner
1233
+ description: Provision a new Slack bot identity for Clawdbot on a fresh server. Guides through Slack App creation steps, collects tokens, writes local config/env, and verifies connectivity.
1234
+ ---
1235
+
1236
+ # Slack bot provisioner (per-bot server)
1237
+
1238
+ Use this when you are setting up **a new Clawdbot instance** that should have **its own Slack bot identity** (one Slack App per bot), and you want a repeatable guided setup.
1239
+
1240
+ This skill assumes:
1241
+ - The user is a Slack workspace admin.
1242
+ - Each bot runs on its own server with its own Gateway config.
1243
+
1244
+ ## What can be automated vs not
1245
+
1246
+ **Automated (this skill):**
1247
+ - Create local folders.
1248
+ - Write a \`slack.env\` (bot token, signing secret).
1249
+ - Patch the Clawdbot gateway config to enable Slack for this instance (user approves).
1250
+ - Run a connectivity test (send a message to a channel).
1251
+
1252
+ **Not fully automatable (Slack-side):**
1253
+ - Creating/installing the Slack App and granting scopes (UI/OAuth).
1254
+ - Verifying event subscription URLs (requires public HTTPS endpoint).
1255
+
1256
+ ## Recommended mode
1257
+ Start with **outbound-only** (post messages) and expand to event subscriptions later.
1258
+
1259
+ ## Quick start
1260
+
1261
+ 1) Have the user do the Slack UI steps in \`references/slack-app-checklist.md\`.
1262
+ 2) Run the provisioning script:
1263
+
1264
+ - PowerShell:
1265
+ - \`powershell -NoProfile -ExecutionPolicy Bypass -File scripts/provision.ps1\`
1266
+
1267
+ The script will prompt for:
1268
+ - bot name
1269
+ - Slack bot token (\`xoxb-...\`)
1270
+ - Slack signing secret
1271
+ - (optional) test channel id
1272
+
1273
+ ## Files
1274
+ - Script: \`scripts/provision.ps1\`
1275
+ - Reference checklist: \`references/slack-app-checklist.md\`
1276
+ - Reference scopes: \`references/scopes.md\`
1277
+
1278
+ ## Secrets (best practices)
1279
+ - **Do not** store secrets inside the skill folder (skills are meant to be shareable/publishable).
1280
+ - Store secrets **per-instance** in the Clawdbot runtime directory (recommended):
1281
+ - \`C:\\Users\\Administrator\\.clawdbot\\credentials\\...\`
1282
+ - Prefer environment variables / local credential files loaded by the Gateway/service manager.
1283
+ - Never paste Slack secrets into public chats.
1284
+
1285
+ ## Safety notes
1286
+ - Store secrets per-instance. Do not reuse tokens across bot identities.
1287
+ - Avoid bot-to-bot loops: bots should ignore messages from other bots by default.
1288
+ `;
1289
+
878
1290
  /**
879
- * Skill seeding: write the `jeeves` workspace skill unconditionally.
1291
+ * Skill seeding: write all bundled platform skills to the workspace.
880
1292
  *
881
1293
  * @remarks
882
- * The skill file is entirely generated — no user-authored content (Decision 48).
883
- * Every installer (core CLI and component plugins) writes it unconditionally.
1294
+ * Skill files are entirely generated — no user-authored content (Decision 48).
1295
+ * Every installer (core CLI and component plugins) writes them unconditionally.
884
1296
  * Content is inlined at build time via `rollup-plugin-md.ts`.
1297
+ *
1298
+ * @module
885
1299
  */
1300
+ /** Map of skill directory name to inlined content. */
1301
+ const BUNDLED_SKILLS = {
1302
+ jeeves: jeevesContent,
1303
+ coding: codingContent,
1304
+ 'slack-bot-provisioner': slackBotProvisionerContent,
1305
+ operations: operationsContent,
1306
+ playbooks: playbooksContent,
1307
+ };
886
1308
  /**
887
- * Seed the jeeves workspace skill file.
1309
+ * Seed all bundled platform skills into the workspace.
1310
+ *
1311
+ * @remarks
1312
+ * Writes each skill to `{workspace}/skills/{name}/SKILL.md`, creating
1313
+ * directories as needed. Overwrites existing content unconditionally.
888
1314
  *
889
1315
  * @param workspacePath - Workspace root directory.
890
1316
  */
891
- function seedSkill(workspacePath) {
892
- const skillDir = join(workspacePath, SKILLS_DIR, JEEVES_SKILL_DIR);
893
- if (!existsSync(skillDir)) {
894
- mkdirSync(skillDir, { recursive: true });
1317
+ function seedSkills(workspacePath) {
1318
+ for (const [name, content] of Object.entries(BUNDLED_SKILLS)) {
1319
+ const skillDir = join(workspacePath, SKILLS_DIR, name);
1320
+ if (!existsSync(skillDir)) {
1321
+ mkdirSync(skillDir, { recursive: true });
1322
+ }
1323
+ writeFileSync(join(skillDir, 'SKILL.md'), content, 'utf-8');
895
1324
  }
896
- const skillPath = join(skillDir, 'SKILL.md');
897
- writeFileSync(skillPath, skillContent, 'utf-8');
898
1325
  }
899
1326
 
900
1327
  /**
@@ -1354,11 +1781,11 @@ function createPluginCli(options) {
1354
1781
  console.log(' ⚠ Could not write HEARTBEAT entry');
1355
1782
  }
1356
1783
  try {
1357
- seedSkill(ws);
1358
- console.log(' ✓ Jeeves skill seeded');
1784
+ seedSkills(ws);
1785
+ console.log(' ✓ Platform skills seeded');
1359
1786
  }
1360
1787
  catch {
1361
- console.log(' ⚠ Could not seed Jeeves skill');
1788
+ console.log(' ⚠ Could not seed platform skills');
1362
1789
  }
1363
1790
  }
1364
1791
  }
@@ -48,31 +48,31 @@ var hasRequiredExtraTypings;
48
48
  function requireExtraTypings () {
49
49
  if (hasRequiredExtraTypings) return extraTypings.exports;
50
50
  hasRequiredExtraTypings = 1;
51
- (function (module, exports$1) {
51
+ (function (module, exports) {
52
52
  const commander = require$$0;
53
53
 
54
- exports$1 = module.exports = {};
54
+ exports = module.exports = {};
55
55
 
56
56
  // Return a different global program than commander,
57
57
  // and don't also return it as default export.
58
- exports$1.program = new commander.Command();
58
+ exports.program = new commander.Command();
59
59
 
60
60
  /**
61
61
  * Expose classes. The FooT versions are just types, so return Commander original implementations!
62
62
  */
63
63
 
64
- exports$1.Argument = commander.Argument;
65
- exports$1.Command = commander.Command;
66
- exports$1.CommanderError = commander.CommanderError;
67
- exports$1.Help = commander.Help;
68
- exports$1.InvalidArgumentError = commander.InvalidArgumentError;
69
- exports$1.InvalidOptionArgumentError = commander.InvalidArgumentError; // Deprecated
70
- exports$1.Option = commander.Option;
64
+ exports.Argument = commander.Argument;
65
+ exports.Command = commander.Command;
66
+ exports.CommanderError = commander.CommanderError;
67
+ exports.Help = commander.Help;
68
+ exports.InvalidArgumentError = commander.InvalidArgumentError;
69
+ exports.InvalidOptionArgumentError = commander.InvalidArgumentError; // Deprecated
70
+ exports.Option = commander.Option;
71
71
 
72
- exports$1.createCommand = (name) => new commander.Command(name);
73
- exports$1.createOption = (flags, description) =>
72
+ exports.createCommand = (name) => new commander.Command(name);
73
+ exports.createOption = (flags, description) =>
74
74
  new commander.Option(flags, description);
75
- exports$1.createArgument = (name, description) =>
75
+ exports.createArgument = (name, description) =>
76
76
  new commander.Argument(name, description);
77
77
  } (extraTypings, extraTypings.exports));
78
78
  return extraTypings.exports;
package/dist/index.d.ts CHANGED
@@ -1474,20 +1474,42 @@ interface SeedContentOptions {
1474
1474
  declare function seedContent(options: SeedContentOptions): Promise<void>;
1475
1475
 
1476
1476
  /**
1477
- * Skill seeding: write the `jeeves` workspace skill unconditionally.
1477
+ * Backward-compatible re-export of `seedSkills`.
1478
1478
  *
1479
1479
  * @remarks
1480
- * The skill file is entirely generated — no user-authored content (Decision 48).
1481
- * Every installer (core CLI and component plugins) writes it unconditionally.
1482
- * Content is inlined at build time via `rollup-plugin-md.ts`.
1480
+ * Delegates to `seedSkills` which seeds all bundled platform skills.
1481
+ * Retained for API compatibility with existing component plugins.
1482
+ *
1483
+ * @module
1483
1484
  */
1484
1485
  /**
1485
- * Seed the jeeves workspace skill file.
1486
+ * Seed all bundled platform skills into the workspace.
1486
1487
  *
1487
1488
  * @param workspacePath - Workspace root directory.
1488
1489
  */
1489
1490
  declare function seedSkill(workspacePath: string): void;
1490
1491
 
1492
+ /**
1493
+ * Skill seeding: write all bundled platform skills to the workspace.
1494
+ *
1495
+ * @remarks
1496
+ * Skill files are entirely generated — no user-authored content (Decision 48).
1497
+ * Every installer (core CLI and component plugins) writes them unconditionally.
1498
+ * Content is inlined at build time via `rollup-plugin-md.ts`.
1499
+ *
1500
+ * @module
1501
+ */
1502
+ /**
1503
+ * Seed all bundled platform skills into the workspace.
1504
+ *
1505
+ * @remarks
1506
+ * Writes each skill to `{workspace}/skills/{name}/SKILL.md`, creating
1507
+ * directories as needed. Overwrites existing content unconditionally.
1508
+ *
1509
+ * @param workspacePath - Workspace root directory.
1510
+ */
1511
+ declare function seedSkills(workspacePath: string): void;
1512
+
1491
1513
  /**
1492
1514
  * Factory for the standard plugin tool set.
1493
1515
  *
@@ -1925,5 +1947,5 @@ declare function getErrorMessage(err: unknown): string;
1925
1947
  */
1926
1948
  declare function isTransientError(err: unknown): boolean;
1927
1949
 
1928
- export { AGENTS_MARKERS, CLEANUP_FLAG, COMPONENT_CONFIG_PREFIX, COMPONENT_VERSIONS_FILE, CONFIG_FILE, CORE_CONFIG_DIR, CORE_VERSION, ComponentWriter, DEFAULT_BIND_ADDRESS, DEFAULT_CORE_VERSION, DEFAULT_PORTS, HEARTBEAT_HEADING, JEEVES_SKILL_DIR, MEMORY_HEARTBEAT_NAME, META_PORT, PLATFORM_COMPONENTS, REGISTRY_CACHE_FILE, RUNNER_PORT, SECTION_IDS, SECTION_ORDER, SERVER_PORT, SKILLS_DIR, SOUL_MARKERS, STALENESS_THRESHOLD_MS, STALE_LOCK_MS, TEMPLATES_DIR, TOOLS_MARKERS, VERSION_STAMP_PATTERN, WATCHER_PORT, WORKSPACE_CONFIG_DEFAULTS, WORKSPACE_CONFIG_FILE, WORKSPACE_FILES, analyzeMemory, appendJsonl, atomicWrite, buildEffectiveConfig, buildHeartbeatSection, checkMemoryHealth, checkNodeVersion, checkRegistryVersion, connectionFail, coreConfigSchema, createAsyncContentCache, createComponentWriter, createConfigApplyHandler, createConfigQueryHandler, createGoogleAuth, createPluginCli, createPluginToolset, createServiceCli, createServiceManager, createStatusHandler, ensureDir, fail, fetchJson, fetchWithTimeout, formatBeginMarker, formatEndMarker, generateJsonSchema, generateWorkspaceJsonSchema, getArg, getBindAddress, getChannelWorkspace, getComponentConfigDir, getComponentConfigPath, getConfigRoot, getCoreConfigDir, getCoreConfigFile, getEffectiveServiceName, getErrorMessage, getPackageRoot, getPackageVersion, getServiceState, getServiceUrl, getWorkspacePath, init, isPrime, isTransientError, jaccard, jeevesComponentDescriptorSchema, loadEnvFile, loadWorkspaceConfig, needsCleanup, nowIso, ok, orchestrateHeartbeat, parseArgs, parseHeartbeat, parseManaged, patchConfig, postJson, readComponentVersions, readJson, readJsonl, refreshPlatformContent, registerComponentConfigPath, removeComponentVersion, removeManagedSection, resetInit, resolveConfigPath, resolveConfigValue, resolveOpenClawHome, resolveOptionalPluginSetting, resolvePluginSetting, resolveWorkspacePath, run, runScript, runWithRetry, saveCache, seedContent, seedSkill, shingles, shouldWrite, sleepAsync, sleepMs, updateManagedSection, uuid, withFileLock, workspaceConfigSchema, writeComponentVersion, writeHeartbeatSection, writeJsonAtomic, writeJsonl };
1950
+ export { AGENTS_MARKERS, CLEANUP_FLAG, COMPONENT_CONFIG_PREFIX, COMPONENT_VERSIONS_FILE, CONFIG_FILE, CORE_CONFIG_DIR, CORE_VERSION, ComponentWriter, DEFAULT_BIND_ADDRESS, DEFAULT_CORE_VERSION, DEFAULT_PORTS, HEARTBEAT_HEADING, JEEVES_SKILL_DIR, MEMORY_HEARTBEAT_NAME, META_PORT, PLATFORM_COMPONENTS, REGISTRY_CACHE_FILE, RUNNER_PORT, SECTION_IDS, SECTION_ORDER, SERVER_PORT, SKILLS_DIR, SOUL_MARKERS, STALENESS_THRESHOLD_MS, STALE_LOCK_MS, TEMPLATES_DIR, TOOLS_MARKERS, VERSION_STAMP_PATTERN, WATCHER_PORT, WORKSPACE_CONFIG_DEFAULTS, WORKSPACE_CONFIG_FILE, WORKSPACE_FILES, analyzeMemory, appendJsonl, atomicWrite, buildEffectiveConfig, buildHeartbeatSection, checkMemoryHealth, checkNodeVersion, checkRegistryVersion, connectionFail, coreConfigSchema, createAsyncContentCache, createComponentWriter, createConfigApplyHandler, createConfigQueryHandler, createGoogleAuth, createPluginCli, createPluginToolset, createServiceCli, createServiceManager, createStatusHandler, ensureDir, fail, fetchJson, fetchWithTimeout, formatBeginMarker, formatEndMarker, generateJsonSchema, generateWorkspaceJsonSchema, getArg, getBindAddress, getChannelWorkspace, getComponentConfigDir, getComponentConfigPath, getConfigRoot, getCoreConfigDir, getCoreConfigFile, getEffectiveServiceName, getErrorMessage, getPackageRoot, getPackageVersion, getServiceState, getServiceUrl, getWorkspacePath, init, isPrime, isTransientError, jaccard, jeevesComponentDescriptorSchema, loadEnvFile, loadWorkspaceConfig, needsCleanup, nowIso, ok, orchestrateHeartbeat, parseArgs, parseHeartbeat, parseManaged, patchConfig, postJson, readComponentVersions, readJson, readJsonl, refreshPlatformContent, registerComponentConfigPath, removeComponentVersion, removeManagedSection, resetInit, resolveConfigPath, resolveConfigValue, resolveOpenClawHome, resolveOptionalPluginSetting, resolvePluginSetting, resolveWorkspacePath, run, runScript, runWithRetry, saveCache, seedContent, seedSkill, seedSkills, shingles, shouldWrite, sleepAsync, sleepMs, updateManagedSection, uuid, withFileLock, workspaceConfigSchema, writeComponentVersion, writeHeartbeatSection, writeJsonAtomic, writeJsonl };
1929
1951
  export type { AccountConfig, AsyncContentCacheOptions, ComponentDependencies, ComponentState, ComponentVersionEntry, ComponentVersionsState, ComponentWriterOptions, ConfigApplyHandler, ConfigApplyRequest, ConfigApplyResult, ConfigProvenance, ConfigQueryHandler, ConfigQueryResponse, CoreConfig, CreatePluginCliOptions, CreateStatusHandlerOptions, GoogleAuthOptions, HeartbeatEntry, InitOptions, JeevesComponentDescriptor, ManagedMarkers, ManagedSection, MemoryHygieneOptions, MemoryHygieneResult, OrchestrateHeartbeatOptions, ParseManagedResult, ParsedHeartbeat, PlatformComponent, PluginApi, PluginInstallRecord, RefreshPlatformContentOptions, RemoveManagedSectionOptions, ResolvedCliConfig, ResolvedValue, RetryOptions, RunOptions, SectionId, SeedContentOptions, ServiceAccountFileConfig, ServiceManager, ServiceManagerOptions, ServiceState, SlackWorkspaceOptions, StatusHandler, StatusHandlerResult, StatusResponse, ToolDescriptor, ToolRegistrationOptions, ToolResult, UpdateManagedSectionOptions, VersionStamp, WorkspaceConfig, WorkspaceOptions, WriteComponentVersionOptions };