rookery-agent 0.1.0 → 0.2.0
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/README.md +467 -367
- package/docs/migration.md +88 -88
- package/docs/updates.md +112 -0
- package/package.json +11 -3
- package/packages/cli/dist/commands/config.js +2 -2
- package/packages/cli/dist/commands/doctor.d.ts.map +1 -1
- package/packages/cli/dist/commands/doctor.js +13 -9
- package/packages/cli/dist/commands/doctor.js.map +1 -1
- package/packages/cli/dist/commands/memory.js +1 -1
- package/packages/cli/dist/commands/org.d.ts +2 -2
- package/packages/cli/dist/commands/org.d.ts.map +1 -1
- package/packages/cli/dist/commands/org.js +19 -17
- package/packages/cli/dist/commands/org.js.map +1 -1
- package/packages/cli/dist/commands/serve.js +1 -1
- package/packages/cli/dist/commands/serve.js.map +1 -1
- package/packages/cli/dist/commands/shared.d.ts.map +1 -1
- package/packages/cli/dist/commands/shared.js +2 -1
- package/packages/cli/dist/commands/shared.js.map +1 -1
- package/packages/cli/dist/commands/tasks.d.ts.map +1 -1
- package/packages/cli/dist/commands/tasks.js +25 -11
- package/packages/cli/dist/commands/tasks.js.map +1 -1
- package/packages/cli/dist/commands/tools.js +1 -1
- package/packages/cli/dist/commands/tools.js.map +1 -1
- package/packages/cli/dist/index.js +13 -13
- package/packages/cli/dist/index.js.map +1 -1
- package/packages/cli/dist/repl.d.ts +12 -0
- package/packages/cli/dist/repl.d.ts.map +1 -1
- package/packages/cli/dist/repl.js +170 -16
- package/packages/cli/dist/repl.js.map +1 -1
- package/packages/cli/dist/tui/App.d.ts +7 -3
- package/packages/cli/dist/tui/App.d.ts.map +1 -1
- package/packages/cli/dist/tui/App.js +182 -16
- package/packages/cli/dist/tui/App.js.map +1 -1
- package/packages/cli/dist/tui/commands.d.ts +7 -0
- package/packages/cli/dist/tui/commands.d.ts.map +1 -1
- package/packages/cli/dist/tui/commands.js +70 -8
- package/packages/cli/dist/tui/commands.js.map +1 -1
- package/packages/cli/dist/tui/components/AssignmentsView.js +4 -4
- package/packages/cli/dist/tui/components/AssignmentsView.js.map +1 -1
- package/packages/cli/dist/tui/components/Banner.d.ts +11 -2
- package/packages/cli/dist/tui/components/Banner.d.ts.map +1 -1
- package/packages/cli/dist/tui/components/Banner.js +7 -10
- package/packages/cli/dist/tui/components/Banner.js.map +1 -1
- package/packages/cli/dist/tui/components/CodeBlock.js +2 -2
- package/packages/cli/dist/tui/components/CodeBlock.js.map +1 -1
- package/packages/cli/dist/tui/components/InputBox.d.ts.map +1 -1
- package/packages/cli/dist/tui/components/InputBox.js +4 -4
- package/packages/cli/dist/tui/components/InputBox.js.map +1 -1
- package/packages/cli/dist/tui/components/Logo.d.ts +56 -0
- package/packages/cli/dist/tui/components/Logo.d.ts.map +1 -0
- package/packages/cli/dist/tui/components/Logo.js +50 -0
- package/packages/cli/dist/tui/components/Logo.js.map +1 -0
- package/packages/cli/dist/tui/components/Markdown.js +8 -8
- package/packages/cli/dist/tui/components/Markdown.js.map +1 -1
- package/packages/cli/dist/tui/components/Message.d.ts +1 -1
- package/packages/cli/dist/tui/components/Message.d.ts.map +1 -1
- package/packages/cli/dist/tui/components/Message.js +5 -4
- package/packages/cli/dist/tui/components/Message.js.map +1 -1
- package/packages/cli/dist/tui/components/QuestionView.d.ts +29 -0
- package/packages/cli/dist/tui/components/QuestionView.d.ts.map +1 -0
- package/packages/cli/dist/tui/components/QuestionView.js +53 -0
- package/packages/cli/dist/tui/components/QuestionView.js.map +1 -0
- package/packages/cli/dist/tui/components/SlashPalette.d.ts +5 -2
- package/packages/cli/dist/tui/components/SlashPalette.d.ts.map +1 -1
- package/packages/cli/dist/tui/components/SlashPalette.js +2 -2
- package/packages/cli/dist/tui/components/SlashPalette.js.map +1 -1
- package/packages/cli/dist/tui/components/StatusLine.d.ts +0 -2
- package/packages/cli/dist/tui/components/StatusLine.d.ts.map +1 -1
- package/packages/cli/dist/tui/components/StatusLine.js +8 -5
- package/packages/cli/dist/tui/components/StatusLine.js.map +1 -1
- package/packages/cli/dist/tui/components/ToolGroup.js +2 -2
- package/packages/cli/dist/tui/components/ToolGroup.js.map +1 -1
- package/packages/cli/dist/tui/components/WatchView.d.ts +21 -0
- package/packages/cli/dist/tui/components/WatchView.d.ts.map +1 -0
- package/packages/cli/dist/tui/components/WatchView.js +36 -0
- package/packages/cli/dist/tui/components/WatchView.js.map +1 -0
- package/packages/cli/dist/tui/history.d.ts +20 -0
- package/packages/cli/dist/tui/history.d.ts.map +1 -0
- package/packages/cli/dist/tui/history.js +105 -0
- package/packages/cli/dist/tui/history.js.map +1 -0
- package/packages/cli/dist/tui/hooks/useSlash.d.ts.map +1 -1
- package/packages/cli/dist/tui/hooks/useSlash.js +3 -2
- package/packages/cli/dist/tui/hooks/useSlash.js.map +1 -1
- package/packages/cli/dist/tui/hooks/useTurn.d.ts +58 -1
- package/packages/cli/dist/tui/hooks/useTurn.d.ts.map +1 -1
- package/packages/cli/dist/tui/hooks/useTurn.js +214 -36
- package/packages/cli/dist/tui/hooks/useTurn.js.map +1 -1
- package/packages/cli/dist/tui/hooks/useWatch.d.ts +52 -0
- package/packages/cli/dist/tui/hooks/useWatch.d.ts.map +1 -0
- package/packages/cli/dist/tui/hooks/useWatch.js +145 -0
- package/packages/cli/dist/tui/hooks/useWatch.js.map +1 -0
- package/packages/cli/dist/tui/inkTheme.d.ts +19 -0
- package/packages/cli/dist/tui/inkTheme.d.ts.map +1 -0
- package/packages/cli/dist/tui/inkTheme.js +81 -0
- package/packages/cli/dist/tui/inkTheme.js.map +1 -0
- package/packages/cli/dist/tui/theme.d.ts +39 -29
- package/packages/cli/dist/tui/theme.d.ts.map +1 -1
- package/packages/cli/dist/tui/theme.js +35 -25
- package/packages/cli/dist/tui/theme.js.map +1 -1
- package/packages/cli/dist/tui/types.d.ts +56 -3
- package/packages/cli/dist/tui/types.d.ts.map +1 -1
- package/packages/cli/dist/tui/types.js +85 -0
- package/packages/cli/dist/tui/types.js.map +1 -1
- package/packages/cli/dist/ui/modelNames.d.ts +51 -0
- package/packages/cli/dist/ui/modelNames.d.ts.map +1 -0
- package/packages/cli/dist/ui/modelNames.js +134 -0
- package/packages/cli/dist/ui/modelNames.js.map +1 -0
- package/packages/cli/dist/ui/render.d.ts.map +1 -1
- package/packages/cli/dist/ui/render.js +17 -8
- package/packages/cli/dist/ui/render.js.map +1 -1
- package/packages/cli/dist/ui/speech.js +5 -0
- package/packages/cli/dist/ui/speech.js.map +1 -1
- package/packages/cli/dist/ui/theme.d.ts +33 -9
- package/packages/cli/dist/ui/theme.d.ts.map +1 -1
- package/packages/cli/dist/ui/theme.js +33 -9
- package/packages/cli/dist/ui/theme.js.map +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/core/dist/agents/persona.d.ts.map +1 -1
- package/packages/core/dist/agents/persona.js +4 -1
- package/packages/core/dist/agents/persona.js.map +1 -1
- package/packages/core/dist/computer/accessibility.d.ts +78 -0
- package/packages/core/dist/computer/accessibility.d.ts.map +1 -0
- package/packages/core/dist/computer/accessibility.js +270 -0
- package/packages/core/dist/computer/accessibility.js.map +1 -0
- package/packages/core/dist/computer/assemblies.d.ts +17 -0
- package/packages/core/dist/computer/assemblies.d.ts.map +1 -0
- package/packages/core/dist/computer/assemblies.js +55 -0
- package/packages/core/dist/computer/assemblies.js.map +1 -0
- package/packages/core/dist/computer/browser-init.d.ts +9 -0
- package/packages/core/dist/computer/browser-init.d.ts.map +1 -0
- package/packages/core/dist/computer/browser-init.js +133 -0
- package/packages/core/dist/computer/browser-init.js.map +1 -0
- package/packages/core/dist/computer/cursor.d.ts +30 -0
- package/packages/core/dist/computer/cursor.d.ts.map +1 -0
- package/packages/core/dist/computer/cursor.js +30 -0
- package/packages/core/dist/computer/cursor.js.map +1 -0
- package/packages/core/dist/computer/mcp-server.js +524 -82
- package/packages/core/dist/computer/mcp-server.js.map +1 -1
- package/packages/core/dist/computer/powershell.d.ts +4 -0
- package/packages/core/dist/computer/powershell.d.ts.map +1 -1
- package/packages/core/dist/computer/powershell.js +471 -81
- package/packages/core/dist/computer/powershell.js.map +1 -1
- package/packages/core/dist/computer/screen-text.d.ts +82 -0
- package/packages/core/dist/computer/screen-text.d.ts.map +1 -0
- package/packages/core/dist/computer/screen-text.js +243 -0
- package/packages/core/dist/computer/screen-text.js.map +1 -0
- package/packages/core/dist/computer/sketch.d.ts +66 -0
- package/packages/core/dist/computer/sketch.d.ts.map +1 -0
- package/packages/core/dist/computer/sketch.js +540 -0
- package/packages/core/dist/computer/sketch.js.map +1 -0
- package/packages/core/dist/computer/tools.d.ts +8 -8
- package/packages/core/dist/computer/tools.d.ts.map +1 -1
- package/packages/core/dist/computer/tools.js +186 -31
- package/packages/core/dist/computer/tools.js.map +1 -1
- package/packages/core/dist/computer/validation.d.ts +555 -0
- package/packages/core/dist/computer/validation.d.ts.map +1 -0
- package/packages/core/dist/computer/validation.js +111 -0
- package/packages/core/dist/computer/validation.js.map +1 -0
- package/packages/core/dist/computer/windows-cursor.d.ts +14 -0
- package/packages/core/dist/computer/windows-cursor.d.ts.map +1 -0
- package/packages/core/dist/computer/windows-cursor.js +713 -0
- package/packages/core/dist/computer/windows-cursor.js.map +1 -0
- package/packages/core/dist/config.d.ts.map +1 -1
- package/packages/core/dist/config.js +284 -10
- package/packages/core/dist/config.js.map +1 -1
- package/packages/core/dist/cron/scheduler.d.ts +49 -3
- package/packages/core/dist/cron/scheduler.d.ts.map +1 -1
- package/packages/core/dist/cron/scheduler.js +268 -25
- package/packages/core/dist/cron/scheduler.js.map +1 -1
- package/packages/core/dist/cron/store.d.ts +19 -1
- package/packages/core/dist/cron/store.d.ts.map +1 -1
- package/packages/core/dist/cron/store.js +36 -8
- package/packages/core/dist/cron/store.js.map +1 -1
- package/packages/core/dist/external/claude-code.d.ts +4 -0
- package/packages/core/dist/external/claude-code.d.ts.map +1 -0
- package/packages/core/dist/external/claude-code.js +111 -0
- package/packages/core/dist/external/claude-code.js.map +1 -0
- package/packages/core/dist/external/discovery.d.ts +33 -0
- package/packages/core/dist/external/discovery.d.ts.map +1 -0
- package/packages/core/dist/external/discovery.js +144 -0
- package/packages/core/dist/external/discovery.js.map +1 -0
- package/packages/core/dist/external/homes.d.ts +26 -0
- package/packages/core/dist/external/homes.d.ts.map +1 -0
- package/packages/core/dist/external/homes.js +49 -0
- package/packages/core/dist/external/homes.js.map +1 -0
- package/packages/core/dist/external/shared.d.ts +201 -0
- package/packages/core/dist/external/shared.d.ts.map +1 -0
- package/packages/core/dist/external/shared.js +308 -0
- package/packages/core/dist/external/shared.js.map +1 -0
- package/packages/core/dist/gateway/policy.d.ts +100 -2
- package/packages/core/dist/gateway/policy.d.ts.map +1 -1
- package/packages/core/dist/gateway/policy.js +270 -6
- package/packages/core/dist/gateway/policy.js.map +1 -1
- package/packages/core/dist/index.d.ts +36 -10
- package/packages/core/dist/index.d.ts.map +1 -1
- package/packages/core/dist/index.js +64 -10
- package/packages/core/dist/index.js.map +1 -1
- package/packages/core/dist/memory/db.d.ts +1 -1
- package/packages/core/dist/memory/db.d.ts.map +1 -1
- package/packages/core/dist/memory/db.js +741 -1
- package/packages/core/dist/memory/db.js.map +1 -1
- package/packages/core/dist/memory/dream/admission.d.ts +124 -0
- package/packages/core/dist/memory/dream/admission.d.ts.map +1 -0
- package/packages/core/dist/memory/dream/admission.js +116 -0
- package/packages/core/dist/memory/dream/admission.js.map +1 -0
- package/packages/core/dist/memory/dream/candidate.d.ts +152 -0
- package/packages/core/dist/memory/dream/candidate.d.ts.map +1 -0
- package/packages/core/dist/memory/dream/candidate.js +547 -0
- package/packages/core/dist/memory/dream/candidate.js.map +1 -0
- package/packages/core/dist/memory/dream/evaluate.d.ts +394 -0
- package/packages/core/dist/memory/dream/evaluate.d.ts.map +1 -0
- package/packages/core/dist/memory/dream/evaluate.js +1032 -0
- package/packages/core/dist/memory/dream/evaluate.js.map +1 -0
- package/packages/core/dist/memory/dream/frame.d.ts +61 -0
- package/packages/core/dist/memory/dream/frame.d.ts.map +1 -0
- package/packages/core/dist/memory/dream/frame.js +292 -0
- package/packages/core/dist/memory/dream/frame.js.map +1 -0
- package/packages/core/dist/memory/dream/label.d.ts +370 -0
- package/packages/core/dist/memory/dream/label.d.ts.map +1 -0
- package/packages/core/dist/memory/dream/label.js +439 -0
- package/packages/core/dist/memory/dream/label.js.map +1 -0
- package/packages/core/dist/memory/dream/measure.d.ts +114 -0
- package/packages/core/dist/memory/dream/measure.d.ts.map +1 -0
- package/packages/core/dist/memory/dream/measure.js +205 -0
- package/packages/core/dist/memory/dream/measure.js.map +1 -0
- package/packages/core/dist/memory/dream/policy.d.ts +21 -0
- package/packages/core/dist/memory/dream/policy.d.ts.map +1 -0
- package/packages/core/dist/memory/dream/policy.js +157 -0
- package/packages/core/dist/memory/dream/policy.js.map +1 -0
- package/packages/core/dist/memory/dream/probe.d.ts +202 -0
- package/packages/core/dist/memory/dream/probe.d.ts.map +1 -0
- package/packages/core/dist/memory/dream/probe.js +671 -0
- package/packages/core/dist/memory/dream/probe.js.map +1 -0
- package/packages/core/dist/memory/dream/promote.d.ts +312 -0
- package/packages/core/dist/memory/dream/promote.d.ts.map +1 -0
- package/packages/core/dist/memory/dream/promote.js +528 -0
- package/packages/core/dist/memory/dream/promote.js.map +1 -0
- package/packages/core/dist/memory/dream/score.d.ts +103 -0
- package/packages/core/dist/memory/dream/score.d.ts.map +1 -0
- package/packages/core/dist/memory/dream/score.js +334 -0
- package/packages/core/dist/memory/dream/score.js.map +1 -0
- package/packages/core/dist/memory/dream/slots.d.ts +193 -0
- package/packages/core/dist/memory/dream/slots.d.ts.map +1 -0
- package/packages/core/dist/memory/dream/slots.js +0 -0
- package/packages/core/dist/memory/dream/slots.js.map +1 -0
- package/packages/core/dist/memory/dream/trajectory.d.ts +262 -0
- package/packages/core/dist/memory/dream/trajectory.d.ts.map +1 -0
- package/packages/core/dist/memory/dream/trajectory.js +366 -0
- package/packages/core/dist/memory/dream/trajectory.js.map +1 -0
- package/packages/core/dist/memory/extractor.d.ts +7 -0
- package/packages/core/dist/memory/extractor.d.ts.map +1 -1
- package/packages/core/dist/memory/extractor.js +35 -12
- package/packages/core/dist/memory/extractor.js.map +1 -1
- package/packages/core/dist/memory/gate.d.ts +43 -7
- package/packages/core/dist/memory/gate.d.ts.map +1 -1
- package/packages/core/dist/memory/gate.js +91 -4
- package/packages/core/dist/memory/gate.js.map +1 -1
- package/packages/core/dist/memory/recall.d.ts +57 -0
- package/packages/core/dist/memory/recall.d.ts.map +1 -1
- package/packages/core/dist/memory/recall.js +60 -123
- package/packages/core/dist/memory/recall.js.map +1 -1
- package/packages/core/dist/memory/sleep.d.ts +131 -4
- package/packages/core/dist/memory/sleep.d.ts.map +1 -1
- package/packages/core/dist/memory/sleep.js +2384 -65
- package/packages/core/dist/memory/sleep.js.map +1 -1
- package/packages/core/dist/memory/store.d.ts +564 -10
- package/packages/core/dist/memory/store.d.ts.map +1 -1
- package/packages/core/dist/memory/store.js +1673 -102
- package/packages/core/dist/memory/store.js.map +1 -1
- package/packages/core/dist/org/controller.d.ts +282 -3
- package/packages/core/dist/org/controller.d.ts.map +1 -1
- package/packages/core/dist/org/controller.js +2334 -237
- package/packages/core/dist/org/controller.js.map +1 -1
- package/packages/core/dist/org/ponytail.d.ts +1 -1
- package/packages/core/dist/org/ponytail.js +1 -1
- package/packages/core/dist/org/project-mcp.d.ts +3 -3
- package/packages/core/dist/org/prompts.d.ts +41 -28
- package/packages/core/dist/org/prompts.d.ts.map +1 -1
- package/packages/core/dist/org/prompts.js +281 -94
- package/packages/core/dist/org/prompts.js.map +1 -1
- package/packages/core/dist/org/questions.d.ts +104 -0
- package/packages/core/dist/org/questions.d.ts.map +1 -0
- package/packages/core/dist/org/questions.js +136 -0
- package/packages/core/dist/org/questions.js.map +1 -0
- package/packages/core/dist/org/review.d.ts +100 -0
- package/packages/core/dist/org/review.d.ts.map +1 -0
- package/packages/core/dist/org/review.js +256 -0
- package/packages/core/dist/org/review.js.map +1 -0
- package/packages/core/dist/org/store.d.ts +249 -2
- package/packages/core/dist/org/store.d.ts.map +1 -1
- package/packages/core/dist/org/store.js +787 -13
- package/packages/core/dist/org/store.js.map +1 -1
- package/packages/core/dist/org/tools.d.ts +26 -2
- package/packages/core/dist/org/tools.d.ts.map +1 -1
- package/packages/core/dist/org/tools.js +352 -63
- package/packages/core/dist/org/tools.js.map +1 -1
- package/packages/core/dist/providers/catalogue.d.ts +1 -1
- package/packages/core/dist/providers/catalogue.d.ts.map +1 -1
- package/packages/core/dist/providers/catalogue.js +2 -2
- package/packages/core/dist/providers/catalogue.js.map +1 -1
- package/packages/core/dist/providers/claude-code.d.ts +18 -3
- package/packages/core/dist/providers/claude-code.d.ts.map +1 -1
- package/packages/core/dist/providers/claude-code.js +490 -40
- package/packages/core/dist/providers/claude-code.js.map +1 -1
- package/packages/core/dist/providers/claude-tui.d.ts +175 -0
- package/packages/core/dist/providers/claude-tui.d.ts.map +1 -0
- package/packages/core/dist/providers/claude-tui.js +683 -0
- package/packages/core/dist/providers/claude-tui.js.map +1 -0
- package/packages/core/dist/providers/codex-auth.d.ts +15 -0
- package/packages/core/dist/providers/codex-auth.d.ts.map +1 -0
- package/packages/core/dist/providers/codex-auth.js +127 -0
- package/packages/core/dist/providers/codex-auth.js.map +1 -0
- package/packages/core/dist/providers/codex-bridge.d.ts +58 -0
- package/packages/core/dist/providers/codex-bridge.d.ts.map +1 -0
- package/packages/core/dist/providers/codex-bridge.js +375 -0
- package/packages/core/dist/providers/codex-bridge.js.map +1 -0
- package/packages/core/dist/providers/codex-translate.d.ts +75 -0
- package/packages/core/dist/providers/codex-translate.d.ts.map +1 -0
- package/packages/core/dist/providers/codex-translate.js +383 -0
- package/packages/core/dist/providers/codex-translate.js.map +1 -0
- package/packages/core/dist/providers/model-gateway.d.ts +56 -0
- package/packages/core/dist/providers/model-gateway.d.ts.map +1 -0
- package/packages/core/dist/providers/model-gateway.js +119 -0
- package/packages/core/dist/providers/model-gateway.js.map +1 -0
- package/packages/core/dist/providers/process.d.ts +3 -1
- package/packages/core/dist/providers/process.d.ts.map +1 -1
- package/packages/core/dist/providers/process.js +3 -3
- package/packages/core/dist/providers/process.js.map +1 -1
- package/packages/core/dist/providers/profiles.d.ts +11 -0
- package/packages/core/dist/providers/profiles.d.ts.map +1 -0
- package/packages/core/dist/providers/profiles.js +28 -0
- package/packages/core/dist/providers/profiles.js.map +1 -0
- package/packages/core/dist/providers/provider-catalog.d.ts +72 -0
- package/packages/core/dist/providers/provider-catalog.d.ts.map +1 -0
- package/packages/core/dist/providers/provider-catalog.js +144 -0
- package/packages/core/dist/providers/provider-catalog.js.map +1 -0
- package/packages/core/dist/providers/quota.d.ts +40 -1
- package/packages/core/dist/providers/quota.d.ts.map +1 -1
- package/packages/core/dist/providers/quota.js +288 -25
- package/packages/core/dist/providers/quota.js.map +1 -1
- package/packages/core/dist/providers/registry.d.ts +46 -3
- package/packages/core/dist/providers/registry.d.ts.map +1 -1
- package/packages/core/dist/providers/registry.js +148 -13
- package/packages/core/dist/providers/registry.js.map +1 -1
- package/packages/core/dist/providers/router.d.ts +28 -0
- package/packages/core/dist/providers/router.d.ts.map +1 -0
- package/packages/core/dist/providers/router.js +88 -0
- package/packages/core/dist/providers/router.js.map +1 -0
- package/packages/core/dist/providers/user-settings-guard.d.ts +12 -0
- package/packages/core/dist/providers/user-settings-guard.d.ts.map +1 -0
- package/packages/core/dist/providers/user-settings-guard.js +130 -0
- package/packages/core/dist/providers/user-settings-guard.js.map +1 -0
- package/packages/core/dist/runtime.d.ts +140 -6
- package/packages/core/dist/runtime.d.ts.map +1 -1
- package/packages/core/dist/runtime.js +1312 -225
- package/packages/core/dist/runtime.js.map +1 -1
- package/packages/core/dist/skills/builtin.d.ts +34 -0
- package/packages/core/dist/skills/builtin.d.ts.map +1 -0
- package/packages/core/dist/skills/builtin.js +305 -0
- package/packages/core/dist/skills/builtin.js.map +1 -0
- package/packages/core/dist/skills/shelf.d.ts +30 -0
- package/packages/core/dist/skills/shelf.d.ts.map +1 -0
- package/packages/core/dist/skills/shelf.js +159 -0
- package/packages/core/dist/skills/shelf.js.map +1 -0
- package/packages/core/dist/skills/store.d.ts +66 -4
- package/packages/core/dist/skills/store.d.ts.map +1 -1
- package/packages/core/dist/skills/store.js +105 -18
- package/packages/core/dist/skills/store.js.map +1 -1
- package/packages/core/dist/skills/suggest.d.ts +21 -0
- package/packages/core/dist/skills/suggest.d.ts.map +1 -0
- package/packages/core/dist/skills/suggest.js +150 -0
- package/packages/core/dist/skills/suggest.js.map +1 -0
- package/packages/core/dist/tools/catalog.d.ts +1 -3
- package/packages/core/dist/tools/catalog.d.ts.map +1 -1
- package/packages/core/dist/tools/catalog.js +38 -26
- package/packages/core/dist/tools/catalog.js.map +1 -1
- package/packages/core/dist/tools/hub.d.ts +136 -10
- package/packages/core/dist/tools/hub.d.ts.map +1 -1
- package/packages/core/dist/tools/hub.js +418 -24
- package/packages/core/dist/tools/hub.js.map +1 -1
- package/packages/core/dist/turns/journal.d.ts +78 -0
- package/packages/core/dist/turns/journal.d.ts.map +1 -0
- package/packages/core/dist/turns/journal.js +104 -0
- package/packages/core/dist/turns/journal.js.map +1 -0
- package/packages/core/dist/types.d.ts +1598 -12
- package/packages/core/dist/types.d.ts.map +1 -1
- package/packages/core/dist/types.js.map +1 -1
- package/packages/core/dist/util/blocks.d.ts +41 -0
- package/packages/core/dist/util/blocks.d.ts.map +1 -0
- package/packages/core/dist/util/blocks.js +175 -0
- package/packages/core/dist/util/blocks.js.map +1 -0
- package/packages/core/dist/util/queue.d.ts +12 -0
- package/packages/core/dist/util/queue.d.ts.map +1 -1
- package/packages/core/dist/util/queue.js +16 -0
- package/packages/core/dist/util/queue.js.map +1 -1
- package/packages/core/dist/util/time.d.ts +39 -0
- package/packages/core/dist/util/time.d.ts.map +1 -0
- package/packages/core/dist/util/time.js +71 -0
- package/packages/core/dist/util/time.js.map +1 -0
- package/packages/core/package.json +1 -1
- package/packages/server/dist/auth.d.ts +14 -1
- package/packages/server/dist/auth.d.ts.map +1 -1
- package/packages/server/dist/auth.js +19 -0
- package/packages/server/dist/auth.js.map +1 -1
- package/packages/server/dist/context.d.ts +35 -1
- package/packages/server/dist/context.d.ts.map +1 -1
- package/packages/server/dist/context.js +28 -8
- package/packages/server/dist/context.js.map +1 -1
- package/packages/server/dist/gateways/attachments.d.ts +32 -0
- package/packages/server/dist/gateways/attachments.d.ts.map +1 -0
- package/packages/server/dist/gateways/attachments.js +167 -0
- package/packages/server/dist/gateways/attachments.js.map +1 -0
- package/packages/server/dist/gateways/markdown.d.ts +9 -0
- package/packages/server/dist/gateways/markdown.d.ts.map +1 -0
- package/packages/server/dist/gateways/markdown.js +170 -0
- package/packages/server/dist/gateways/markdown.js.map +1 -0
- package/packages/server/dist/gateways/push.d.ts +1 -1
- package/packages/server/dist/gateways/push.d.ts.map +1 -1
- package/packages/server/dist/gateways/push.js +347 -6
- package/packages/server/dist/gateways/push.js.map +1 -1
- package/packages/server/dist/gateways/telegram-api.d.ts +70 -1
- package/packages/server/dist/gateways/telegram-api.d.ts.map +1 -1
- package/packages/server/dist/gateways/telegram-api.js +140 -1
- package/packages/server/dist/gateways/telegram-api.js.map +1 -1
- package/packages/server/dist/gateways/telegram.d.ts +158 -1
- package/packages/server/dist/gateways/telegram.d.ts.map +1 -1
- package/packages/server/dist/gateways/telegram.js +1471 -78
- package/packages/server/dist/gateways/telegram.js.map +1 -1
- package/packages/server/dist/gateways/threads.d.ts +79 -0
- package/packages/server/dist/gateways/threads.d.ts.map +1 -0
- package/packages/server/dist/gateways/threads.js +279 -0
- package/packages/server/dist/gateways/threads.js.map +1 -0
- package/packages/server/dist/index.d.ts +2 -1
- package/packages/server/dist/index.d.ts.map +1 -1
- package/packages/server/dist/index.js +2 -1
- package/packages/server/dist/index.js.map +1 -1
- package/packages/server/dist/listeners/imap.d.ts +13 -0
- package/packages/server/dist/listeners/imap.d.ts.map +1 -0
- package/packages/server/dist/listeners/imap.js +0 -0
- package/packages/server/dist/listeners/imap.js.map +1 -0
- package/packages/server/dist/listeners/registry.d.ts +18 -0
- package/packages/server/dist/listeners/registry.d.ts.map +1 -0
- package/packages/server/dist/listeners/registry.js +88 -0
- package/packages/server/dist/listeners/registry.js.map +1 -0
- package/packages/server/dist/listeners/types.d.ts +55 -0
- package/packages/server/dist/listeners/types.d.ts.map +1 -0
- package/packages/server/dist/listeners/types.js +2 -0
- package/packages/server/dist/listeners/types.js.map +1 -0
- package/packages/server/dist/main.js +15 -1
- package/packages/server/dist/main.js.map +1 -1
- package/packages/server/dist/routes/chat.d.ts +7 -3
- package/packages/server/dist/routes/chat.d.ts.map +1 -1
- package/packages/server/dist/routes/chat.js +8 -17
- package/packages/server/dist/routes/chat.js.map +1 -1
- package/packages/server/dist/routes/config.d.ts.map +1 -1
- package/packages/server/dist/routes/config.js +39 -7
- package/packages/server/dist/routes/config.js.map +1 -1
- package/packages/server/dist/routes/cron.d.ts.map +1 -1
- package/packages/server/dist/routes/cron.js +65 -8
- package/packages/server/dist/routes/cron.js.map +1 -1
- package/packages/server/dist/routes/dream.d.ts +22 -0
- package/packages/server/dist/routes/dream.d.ts.map +1 -0
- package/packages/server/dist/routes/dream.js +152 -0
- package/packages/server/dist/routes/dream.js.map +1 -0
- package/packages/server/dist/routes/hooks.d.ts +18 -0
- package/packages/server/dist/routes/hooks.d.ts.map +1 -0
- package/packages/server/dist/routes/hooks.js +62 -0
- package/packages/server/dist/routes/hooks.js.map +1 -0
- package/packages/server/dist/routes/listeners.d.ts +10 -0
- package/packages/server/dist/routes/listeners.d.ts.map +1 -0
- package/packages/server/dist/routes/listeners.js +12 -0
- package/packages/server/dist/routes/listeners.js.map +1 -0
- package/packages/server/dist/routes/memories.d.ts.map +1 -1
- package/packages/server/dist/routes/memories.js +55 -3
- package/packages/server/dist/routes/memories.js.map +1 -1
- package/packages/server/dist/routes/org.d.ts.map +1 -1
- package/packages/server/dist/routes/org.js +284 -48
- package/packages/server/dist/routes/org.js.map +1 -1
- package/packages/server/dist/routes/profile.d.ts.map +1 -1
- package/packages/server/dist/routes/profile.js +6 -3
- package/packages/server/dist/routes/profile.js.map +1 -1
- package/packages/server/dist/routes/providers.d.ts.map +1 -1
- package/packages/server/dist/routes/providers.js +66 -7
- package/packages/server/dist/routes/providers.js.map +1 -1
- package/packages/server/dist/routes/questions.d.ts +45 -0
- package/packages/server/dist/routes/questions.d.ts.map +1 -0
- package/packages/server/dist/routes/questions.js +73 -0
- package/packages/server/dist/routes/questions.js.map +1 -0
- package/packages/server/dist/routes/sessions.d.ts.map +1 -1
- package/packages/server/dist/routes/sessions.js +26 -6
- package/packages/server/dist/routes/sessions.js.map +1 -1
- package/packages/server/dist/routes/sleep.d.ts.map +1 -1
- package/packages/server/dist/routes/sleep.js +71 -2
- package/packages/server/dist/routes/sleep.js.map +1 -1
- package/packages/server/dist/routes/terminals.d.ts +25 -0
- package/packages/server/dist/routes/terminals.d.ts.map +1 -0
- package/packages/server/dist/routes/terminals.js +35 -0
- package/packages/server/dist/routes/terminals.js.map +1 -0
- package/packages/server/dist/routes/tools.d.ts.map +1 -1
- package/packages/server/dist/routes/tools.js +140 -6
- package/packages/server/dist/routes/tools.js.map +1 -1
- package/packages/server/dist/routes/updates.d.ts +10 -0
- package/packages/server/dist/routes/updates.d.ts.map +1 -0
- package/packages/server/dist/routes/updates.js +22 -0
- package/packages/server/dist/routes/updates.js.map +1 -0
- package/packages/server/dist/routes/ws.d.ts +11 -5
- package/packages/server/dist/routes/ws.d.ts.map +1 -1
- package/packages/server/dist/routes/ws.js +162 -28
- package/packages/server/dist/routes/ws.js.map +1 -1
- package/packages/server/dist/schemas.d.ts +1125 -211
- package/packages/server/dist/schemas.d.ts.map +1 -1
- package/packages/server/dist/schemas.js +300 -12
- package/packages/server/dist/schemas.js.map +1 -1
- package/packages/server/dist/server.d.ts +7 -1
- package/packages/server/dist/server.d.ts.map +1 -1
- package/packages/server/dist/server.js +186 -3
- package/packages/server/dist/server.js.map +1 -1
- package/packages/server/dist/services/stream.d.ts +89 -5
- package/packages/server/dist/services/stream.d.ts.map +1 -1
- package/packages/server/dist/services/stream.js +9 -20
- package/packages/server/dist/services/stream.js.map +1 -1
- package/packages/server/dist/services/stt.d.ts +65 -0
- package/packages/server/dist/services/stt.d.ts.map +1 -0
- package/packages/server/dist/services/stt.js +306 -0
- package/packages/server/dist/services/stt.js.map +1 -0
- package/packages/server/dist/services/turns.d.ts +49 -0
- package/packages/server/dist/services/turns.d.ts.map +1 -0
- package/packages/server/dist/services/turns.js +138 -0
- package/packages/server/dist/services/turns.js.map +1 -0
- package/packages/server/dist/services/updates.d.ts +99 -0
- package/packages/server/dist/services/updates.d.ts.map +1 -0
- package/packages/server/dist/services/updates.js +316 -0
- package/packages/server/dist/services/updates.js.map +1 -0
- package/packages/server/package.json +1 -1
- package/packages/web/dist/app-icon.svg +2 -0
- package/packages/web/dist/apple-touch-icon.png +0 -0
- package/packages/web/dist/assets/abnfDiagram-O67JEVCF-B4qWcqra.js +1 -0
- package/packages/web/dist/assets/arc-CQult7TN.js +1 -0
- package/packages/web/dist/assets/architectureDiagram-NJMV4G6O-DFTRvl66.js +36 -0
- package/packages/web/dist/assets/blockDiagram-BEXU5L5S-TCFoK_k-.js +140 -0
- package/packages/web/dist/assets/c4Diagram-YGBWAQC7-i5_GqhJa.js +38 -0
- package/packages/web/dist/assets/channel-D_4EmqNR.js +1 -0
- package/packages/web/dist/assets/chunk-2Q5K7J3B-BK6I2wfW.js +1 -0
- package/packages/web/dist/assets/chunk-3FUC2YCW-Dw-TfKT0.js +2 -0
- package/packages/web/dist/assets/chunk-5VM5RSS4-AE_XRNTT.js +15 -0
- package/packages/web/dist/assets/chunk-GTNCS2PH-DO18WaaJ.js +88 -0
- package/packages/web/dist/assets/chunk-GWA4HPMP-3rdjszP_.js +1 -0
- package/packages/web/dist/assets/chunk-JWPE2WC7-C93LH2D0.js +1 -0
- package/packages/web/dist/assets/chunk-NETBCI7D-Dj7O3-H-.js +1 -0
- package/packages/web/dist/assets/chunk-WEXAMYUT-BRFvQUIn.js +1 -0
- package/packages/web/dist/assets/chunk-XXDRQBXY-CXx6HMbz.js +1 -0
- package/packages/web/dist/assets/classDiagram-v2-NBCMYWYE-BGXszxjn.js +217 -0
- package/packages/web/dist/assets/cose-bilkent-JH36ORCC-BAuXqkne.js +1 -0
- package/packages/web/dist/assets/cynefin-OW5HDTMX-plNzhY7J.js +178 -0
- package/packages/web/dist/assets/cynefinDiagram-VND7K2PF-DuPlljFS.js +62 -0
- package/packages/web/dist/assets/cytoscape.esm-Ix0LnXOy.js +331 -0
- package/packages/web/dist/assets/dagre-6A5THRUB-CXzwdR-6.js +4 -0
- package/packages/web/dist/assets/diagram-22UHCM2B-B7iv_V2D.js +200 -0
- package/packages/web/dist/assets/diagram-3UASUU5V-BMvi7gSi.js +24 -0
- package/packages/web/dist/assets/diagram-ATOU4E4O-NJ7EB5Qg.js +3 -0
- package/packages/web/dist/assets/diagram-CDSNMT55-DccMMNJ-.js +30 -0
- package/packages/web/dist/assets/diagram-MLGK6HIB-BbwGHK4g.js +24 -0
- package/packages/web/dist/assets/diagram-MPIPVDR6-BbSSZfM3.js +41 -0
- package/packages/web/dist/assets/draco_decoder-C32yEggz.wasm +0 -0
- package/packages/web/dist/assets/draco_decoder-Z1_iN-Ht.wasm +0 -0
- package/packages/web/dist/assets/draco_decoder-fzg4nYZr.js +34 -0
- package/packages/web/dist/assets/draco_wasm_wrapper-DxJM36Ib.js +117 -0
- package/packages/web/dist/assets/draco_wasm_wrapper-fZCQGLGb.js +116 -0
- package/packages/web/dist/assets/ebnfDiagram-ZINNZB2B-BBfPNM85.js +1 -0
- package/packages/web/dist/assets/elk-276RUBZZ-dM3Y1d2a.js +27 -0
- package/packages/web/dist/assets/erDiagram-OPXOYQCR-iWrUegxy.js +99 -0
- package/packages/web/dist/assets/flowDiagram-KWPJA3E3-B6DYlbkV.js +213 -0
- package/packages/web/dist/assets/ganttDiagram-FUAMR5RP-D7dSWZcC.js +292 -0
- package/packages/web/dist/assets/gitGraphDiagram-X574FWY7-DguFgcbW.js +106 -0
- package/packages/web/dist/assets/graph-Bn3Yngep.js +1 -0
- package/packages/web/dist/assets/index-B1QvSHA5.js +660 -0
- package/packages/web/dist/assets/index-zwMuaz90.css +32 -0
- package/packages/web/dist/assets/infoDiagram-VRGFBTTK-CuiuO3uo.js +2 -0
- package/packages/web/dist/assets/ishikawaDiagram-OU5B5YK6-wBS1_40m.js +70 -0
- package/packages/web/dist/assets/journeyDiagram-ZHPQQLJL-Bd1YE2gP.js +139 -0
- package/packages/web/dist/assets/kanban-definition-PNTS6WVX-BlQzv_X1.js +89 -0
- package/packages/web/dist/assets/katex-C5jXJg4s.js +257 -0
- package/packages/web/dist/assets/mermaid.core-p3CwmLUb.js +313 -0
- package/packages/web/dist/assets/mindmap-definition-NLK3R4M7-BlticnKl.js +96 -0
- package/packages/web/dist/assets/pegDiagram-GJSIUBJH-BbXsP47B.js +1 -0
- package/packages/web/dist/assets/pieDiagram-5QR66LMP-BooBSBug.js +39 -0
- package/packages/web/dist/assets/quadrantDiagram-O4NWA36T-CkXC6VCh.js +7 -0
- package/packages/web/dist/assets/railroadDiagram-XR7U4H2S-BphzYiW-.js +1 -0
- package/packages/web/dist/assets/requirementDiagram-PLB6GJNP-PWpD4zpQ.js +84 -0
- package/packages/web/dist/assets/sankeyDiagram-IPEJSGJF-5Qm39Vfz.js +40 -0
- package/packages/web/dist/assets/scene-D4LPicHk.js +4620 -0
- package/packages/web/dist/assets/sequenceDiagram-PO4LG4MO-DA673J_w.js +169 -0
- package/packages/web/dist/assets/sizeCapture-INFHLROL-1KsNwBhd.js +1 -0
- package/packages/web/dist/assets/stateDiagram-v2-GCMORJYK-D7O0UyHr.js +291 -0
- package/packages/web/dist/assets/swimlanes-2SLR337P-culFSb1R.js +1 -0
- package/packages/web/dist/assets/swimlanesDiagram-TC7HE7FX-kzTmK2BP.js +8 -0
- package/packages/web/dist/assets/timeline-definition-EJHVYXUP-6GIO5p-k.js +120 -0
- package/packages/web/dist/assets/usecaseDiagram-POWQR4AR-BAGHDBzZ.js +370 -0
- package/packages/web/dist/assets/vennDiagram-UO4OBE2U-PbtBvPRE.js +34 -0
- package/packages/web/dist/assets/wardleyDiagram-VNRHLVJA-9scbtDvX.js +78 -0
- package/packages/web/dist/assets/xychartDiagram-PMCCYNJV-C51PiF4p.js +7 -0
- package/packages/web/dist/draco/draco_decoder.js +33 -0
- package/packages/web/dist/draco/draco_decoder.wasm +0 -0
- package/packages/web/dist/draco/draco_wasm_wrapper.js +116 -0
- package/packages/web/dist/favicon-16.png +0 -0
- package/packages/web/dist/favicon-32.png +0 -0
- package/packages/web/dist/favicon-48.png +0 -0
- package/packages/web/dist/favicon.ico +0 -0
- package/packages/web/dist/favicon.svg +1 -1
- package/packages/web/dist/icon-192.png +0 -0
- package/packages/web/dist/icon-512.png +0 -0
- package/packages/web/dist/index.html +12 -4
- package/packages/web/dist/logo-light.svg +1 -1
- package/packages/web/dist/logo-mono.svg +2 -0
- package/packages/web/dist/logo-stacked-light.svg +2 -0
- package/packages/web/dist/logo-stacked.svg +2 -0
- package/packages/web/dist/logo-white.svg +2 -0
- package/packages/web/dist/logo.svg +1 -1
- package/packages/web/dist/mark-light.svg +1 -1
- package/packages/web/dist/mark-mono.svg +2 -0
- package/packages/web/dist/mark-small-light.svg +2 -0
- package/packages/web/dist/mark-small.svg +2 -0
- package/packages/web/dist/mark-white.svg +2 -0
- package/packages/web/dist/mark.svg +1 -1
- package/packages/web/dist/models/LICENSE.txt +5 -0
- package/packages/web/dist/models/brain.glb +0 -0
- package/packages/web/dist/site.webmanifest +23 -0
- package/packages/web/dist/wordmark-light.svg +2 -0
- package/packages/web/dist/wordmark.svg +2 -0
- package/packages/web/package.json +1 -1
- package/scripts/rookery.mjs +204 -122
- package/scripts/updater.mjs +227 -0
- package/packages/cli/dist/tui/components/Wordmark.d.ts +0 -35
- package/packages/cli/dist/tui/components/Wordmark.d.ts.map +0 -1
- package/packages/cli/dist/tui/components/Wordmark.js +0 -81
- package/packages/cli/dist/tui/components/Wordmark.js.map +0 -1
- package/packages/core/dist/agents/orchestrator.d.ts +0 -24
- package/packages/core/dist/agents/orchestrator.d.ts.map +0 -1
- package/packages/core/dist/agents/orchestrator.js +0 -88
- package/packages/core/dist/agents/orchestrator.js.map +0 -1
- package/packages/core/dist/agents/roles.d.ts +0 -21
- package/packages/core/dist/agents/roles.d.ts.map +0 -1
- package/packages/core/dist/agents/roles.js +0 -81
- package/packages/core/dist/agents/roles.js.map +0 -1
- package/packages/core/dist/agents/team.d.ts +0 -105
- package/packages/core/dist/agents/team.d.ts.map +0 -1
- package/packages/core/dist/agents/team.js +0 -623
- package/packages/core/dist/agents/team.js.map +0 -1
- package/packages/core/dist/providers/codex.d.ts +0 -10
- package/packages/core/dist/providers/codex.d.ts.map +0 -1
- package/packages/core/dist/providers/codex.js +0 -375
- package/packages/core/dist/providers/codex.js.map +0 -1
- package/packages/core/dist/tools/browser.d.ts +0 -20
- package/packages/core/dist/tools/browser.d.ts.map +0 -1
- package/packages/core/dist/tools/browser.js +0 -72
- package/packages/core/dist/tools/browser.js.map +0 -1
- package/packages/server/dist/routes/agents.d.ts +0 -5
- package/packages/server/dist/routes/agents.d.ts.map +0 -1
- package/packages/server/dist/routes/agents.js +0 -6
- package/packages/server/dist/routes/agents.js.map +0 -1
- package/packages/server/dist/routes/team.d.ts +0 -11
- package/packages/server/dist/routes/team.d.ts.map +0 -1
- package/packages/server/dist/routes/team.js +0 -36
- package/packages/server/dist/routes/team.js.map +0 -1
- package/packages/web/dist/assets/3d-force-graph-BPZmoydi.js +0 -1163
- package/packages/web/dist/assets/index-IBSTzK7-.js +0 -1255
- package/packages/web/dist/assets/index-qUXUui7W.css +0 -1
- package/packages/web/dist/assets/three-spritetext-B9ZIW7c-.js +0 -4
- package/packages/web/dist/assets/three.module-cmFfBtHS.js +0 -4228
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { Agent, AgentMessage, Assignment, CronJob,
|
|
1
|
+
import type { Agent, AgentMessage, Assignment, CronJob, Mail, Organization, Project, RookeryConfig, ScoredMemory, Task, Team } from '../types.js';
|
|
2
2
|
import type { OrgStore } from './store.js';
|
|
3
|
+
import type { Store } from '../memory/store.js';
|
|
3
4
|
/**
|
|
4
5
|
* Prompt text for the organisation.
|
|
5
6
|
*
|
|
6
7
|
* Two kinds of prompt come out of here. The assistant's turn gets a block
|
|
7
8
|
* describing the company it runs and how to use its tools; it is appended to
|
|
8
|
-
* the ordinary identity prompt. An agent's
|
|
9
|
+
* the ordinary identity prompt. An agent's run gets a complete system
|
|
9
10
|
* prompt of its own, pointedly not built on the assistant's identity: an
|
|
10
11
|
* agent is a member of staff, and its notes must never read like the
|
|
11
12
|
* assistant speaking to the user.
|
|
@@ -16,18 +17,27 @@ export interface OrgSnapshot {
|
|
|
16
17
|
teams: Team[];
|
|
17
18
|
agents: Agent[];
|
|
18
19
|
projects: Project[];
|
|
19
|
-
/**
|
|
20
|
+
/** Runs currently pending or running. */
|
|
20
21
|
active: Assignment[];
|
|
21
22
|
}
|
|
22
|
-
/**
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* The org chart as plain text, shared by the overview tool and the prompts.
|
|
25
|
+
*
|
|
26
|
+
* `org` is optional and only buys the run numbers: without it a running piece
|
|
27
|
+
* of work still has its name, which is the part that makes the list readable.
|
|
28
|
+
*/
|
|
29
|
+
export declare function renderOrgOverview(snapshot: OrgSnapshot, org?: OrgStore): string;
|
|
24
30
|
/** Inbox lines for a prompt; empty string when there is nothing unread. */
|
|
25
31
|
export declare function renderInbox(messages: AgentMessage[], snapshot: OrgSnapshot, heading: string): string;
|
|
32
|
+
/** Who sent one mail, as a prompt says it: an agent's slug, or "user"/"assistant". */
|
|
33
|
+
export declare function mailSender(mail: Mail, snapshot: OrgSnapshot): string;
|
|
34
|
+
/** Mail lines for a prompt or a read_mail reply; empty string when there is none. */
|
|
35
|
+
export declare function renderMail(mail: Mail[], snapshot: OrgSnapshot, heading: string, bodyChars?: number): string;
|
|
26
36
|
/**
|
|
27
37
|
* The block appended to the assistant's identity prompt: what it runs, how
|
|
28
38
|
* to delegate, and what arrived in its inbox since the last turn.
|
|
29
39
|
*/
|
|
30
|
-
export declare function assistantOrgBlock(config: RookeryConfig, snapshot: OrgSnapshot,
|
|
40
|
+
export declare function assistantOrgBlock(config: RookeryConfig, snapshot: OrgSnapshot, mail: Mail[], activeProject?: Project, schedules?: CronJob[], store?: Store): string;
|
|
31
41
|
/** The schedules, one line each, as the assistant's prompt and the list tool show them. */
|
|
32
42
|
export declare function renderSchedules(schedules: CronJob[], snapshot: OrgSnapshot): string;
|
|
33
43
|
export interface AgentPromptInput {
|
|
@@ -36,36 +46,39 @@ export interface AgentPromptInput {
|
|
|
36
46
|
snapshot: OrgSnapshot;
|
|
37
47
|
project?: Project;
|
|
38
48
|
memories: ScoredMemory[];
|
|
39
|
-
|
|
49
|
+
mail: Mail[];
|
|
40
50
|
assignmentId: string;
|
|
41
|
-
/** Who
|
|
51
|
+
/** Who asked for the work, for the prompt's sense of the chain of command. */
|
|
42
52
|
requestedBy: string;
|
|
53
|
+
/** Set when this run came from mail: its subject, for the reply paragraph below. */
|
|
54
|
+
sourceMailSubject?: string;
|
|
55
|
+
/** That mail's id and thread, so the prompt can point at the history instead of carrying it. */
|
|
56
|
+
sourceMailId?: string;
|
|
57
|
+
sourceMailThreadId?: string;
|
|
58
|
+
/** The rest of that mail's thread, oldest first - listed as an index, not in full. */
|
|
59
|
+
sourceMailThread?: Mail[];
|
|
43
60
|
/** One paragraph per tool server attached to this run, from the hub. */
|
|
44
61
|
toolHints?: string[];
|
|
45
62
|
/** The skills index, when there are skills for agents. */
|
|
46
63
|
skillsIndex?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Development feedback written since the last reconfig (decision E2): no
|
|
66
|
+
* number, no dimension name and no reference to being reviewed ever
|
|
67
|
+
* reaches this far - only the qualitative note itself. Newest first,
|
|
68
|
+
* at most two shown.
|
|
69
|
+
*/
|
|
70
|
+
agentNotes?: {
|
|
71
|
+
note: string;
|
|
72
|
+
createdAt: number;
|
|
73
|
+
}[];
|
|
74
|
+
/** Set only for a successor agent: who it replaced, and the condensed handover (decision E3). */
|
|
75
|
+
handoverFrom?: {
|
|
76
|
+
predecessorName: string;
|
|
77
|
+
text: string;
|
|
78
|
+
};
|
|
47
79
|
}
|
|
48
|
-
/** The complete system prompt for one agent
|
|
80
|
+
/** The complete system prompt for one agent carrying out one task. */
|
|
49
81
|
export declare function buildAgentPrompt(input: AgentPromptInput): string;
|
|
50
82
|
/** The board as the assistant reads it. */
|
|
51
83
|
export declare function renderBoard(tasks: Task[], snapshot: OrgSnapshot, store: OrgStore): string;
|
|
52
|
-
export interface AgentChatPromptInput {
|
|
53
|
-
config: RookeryConfig;
|
|
54
|
-
agent: Agent;
|
|
55
|
-
snapshot: OrgSnapshot;
|
|
56
|
-
memories: ScoredMemory[];
|
|
57
|
-
inbox: AgentMessage[];
|
|
58
|
-
history?: Message[];
|
|
59
|
-
resumed: boolean;
|
|
60
|
-
project?: Project;
|
|
61
|
-
toolHints?: string[];
|
|
62
|
-
skillsIndex?: string;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* The system prompt for a direct conversation between the user and one
|
|
66
|
-
* agent - a direct message in the company chat. The agent speaks as itself,
|
|
67
|
-
* knows its place in the company, and may hand work to its reports, but it
|
|
68
|
-
* is not the assistant and does not pretend to be.
|
|
69
|
-
*/
|
|
70
|
-
export declare function buildAgentChatPrompt(input: AgentChatPromptInput): string;
|
|
71
84
|
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/org/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,YAAY,EACZ,UAAU,EACV,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/org/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,YAAY,EACZ,UAAU,EACV,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,OAAO,EAEP,aAAa,EACb,YAAY,EACZ,IAAI,EACJ,IAAI,EACL,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAOhD;;;;;;;;;GASG;AAEH,2DAA2D;AAC3D,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,yCAAyC;IACzC,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAgCD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,QAAQ,GAAG,MAAM,CA4D/E;AAED,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAQpG;AAED,sFAAsF;AACtF,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,GAAG,MAAM,CAGpE;AAED,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,SAAM,GAAG,MAAM,CAexG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAE,IAAI,EAAE,EACZ,aAAa,CAAC,EAAE,OAAO,EACvB,SAAS,GAAE,OAAO,EAAO,EACzB,KAAK,CAAC,EAAE,KAAK,GACZ,MAAM,CAsFR;AAED,2FAA2F;AAC3F,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,WAAW,GAAG,MAAM,CAKnF;AA4BD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,IAAI,EAAE,IAAI,EAAE,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,WAAW,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gGAAgG;IAChG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC;IAC1B,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,UAAU,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnD,iGAAiG;IACjG,YAAY,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1D;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CA4LhE;AAED,2CAA2C;AAC3C,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,GAAG,MAAM,CAyBzF"}
|
|
@@ -2,9 +2,43 @@ import { renderMemoryBlock } from '../memory/recall.js';
|
|
|
2
2
|
import { PONYTAIL_RULESET } from './ponytail.js';
|
|
3
3
|
import { describeCronJob } from '../cron/scheduler.js';
|
|
4
4
|
import { clip, shorten } from '../util/queue.js';
|
|
5
|
+
import { formatAge, formatNow } from '../util/time.js';
|
|
6
|
+
/** How many of a thread's mails a continued run reads without asking (F4). */
|
|
7
|
+
const THREAD_TAIL_MAILS = 2;
|
|
8
|
+
/** And how much of each of them. */
|
|
9
|
+
const THREAD_TAIL_CHARS = 4000;
|
|
5
10
|
const agentById = (snapshot) => new Map(snapshot.agents.map((agent) => [agent.id, agent]));
|
|
6
|
-
/**
|
|
7
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Voices of one agent's own team and manager only - never the whole company
|
|
13
|
+
* (decision E13, section 6.4): a company of twenty would otherwise carry
|
|
14
|
+
* nineteen irrelevant voice descriptions into every single run. An agent
|
|
15
|
+
* with no voice set contributes no line here at all; that is the silent,
|
|
16
|
+
* neutral default (F5), not something worth naming as absent.
|
|
17
|
+
*/
|
|
18
|
+
function renderColleagueVoices(agent, snapshot) {
|
|
19
|
+
const byId = agentById(snapshot);
|
|
20
|
+
const manager = agent.managerId ? byId.get(agent.managerId) : undefined;
|
|
21
|
+
const teammates = agent.teamId
|
|
22
|
+
? snapshot.agents.filter((entry) => entry.teamId === agent.teamId && entry.id !== agent.id)
|
|
23
|
+
: [];
|
|
24
|
+
const lines = [];
|
|
25
|
+
if (manager?.voice)
|
|
26
|
+
lines.push('- ' + manager.slug + ' (your manager): ' + manager.voice);
|
|
27
|
+
for (const mate of teammates) {
|
|
28
|
+
if (mate.voice)
|
|
29
|
+
lines.push('- ' + mate.slug + ' (your team): ' + mate.voice);
|
|
30
|
+
}
|
|
31
|
+
if (!lines.length)
|
|
32
|
+
return '';
|
|
33
|
+
return 'How your manager and team write, so mail from or about them reads like them:\n' + lines.join('\n');
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The org chart as plain text, shared by the overview tool and the prompts.
|
|
37
|
+
*
|
|
38
|
+
* `org` is optional and only buys the run numbers: without it a running piece
|
|
39
|
+
* of work still has its name, which is the part that makes the list readable.
|
|
40
|
+
*/
|
|
41
|
+
export function renderOrgOverview(snapshot, org) {
|
|
8
42
|
const byId = agentById(snapshot);
|
|
9
43
|
const teamName = new Map(snapshot.teams.map((team) => [team.id, team.name]));
|
|
10
44
|
const lines = [];
|
|
@@ -41,10 +75,15 @@ export function renderOrgOverview(snapshot) {
|
|
|
41
75
|
}
|
|
42
76
|
if (snapshot.active.length) {
|
|
43
77
|
lines.push('');
|
|
44
|
-
lines.push('Running
|
|
78
|
+
lines.push('Running now:');
|
|
45
79
|
for (const assignment of snapshot.active) {
|
|
46
80
|
const agent = byId.get(assignment.agentId);
|
|
47
|
-
|
|
81
|
+
// The name, not the first 120 characters of the brief: three errands
|
|
82
|
+
// for the same agent open with the same twenty words, and a list of
|
|
83
|
+
// those tells nobody which is which (concept 7.1).
|
|
84
|
+
const run = org?.taskRunNumber(assignment.id) ?? null;
|
|
85
|
+
lines.push('- ' + assignment.id.slice(0, 8) + ' ' + (agent?.slug ?? '?') + ': ' + shorten(assignment.title, 120) +
|
|
86
|
+
(run && run > 1 ? ' (run ' + run + ')' : ''));
|
|
48
87
|
}
|
|
49
88
|
}
|
|
50
89
|
return lines.join('\n');
|
|
@@ -60,35 +99,64 @@ export function renderInbox(messages, snapshot, heading) {
|
|
|
60
99
|
});
|
|
61
100
|
return heading + '\n' + lines.join('\n');
|
|
62
101
|
}
|
|
102
|
+
/** Who sent one mail, as a prompt says it: an agent's slug, or "user"/"assistant". */
|
|
103
|
+
export function mailSender(mail, snapshot) {
|
|
104
|
+
if (mail.fromKind !== 'agent')
|
|
105
|
+
return mail.fromKind;
|
|
106
|
+
return (mail.fromAgentId ? agentById(snapshot).get(mail.fromAgentId)?.slug : undefined) ?? 'unknown agent';
|
|
107
|
+
}
|
|
108
|
+
/** Mail lines for a prompt or a read_mail reply; empty string when there is none. */
|
|
109
|
+
export function renderMail(mail, snapshot, heading, bodyChars = 600) {
|
|
110
|
+
if (!mail.length)
|
|
111
|
+
return '';
|
|
112
|
+
const byId = agentById(snapshot);
|
|
113
|
+
const who = (kind, id) => kind === 'agent' ? (id ? (byId.get(id)?.slug ?? 'unknown agent') : 'unknown agent') : kind;
|
|
114
|
+
const lines = mail.map((entry) => {
|
|
115
|
+
const from = who(entry.fromKind, entry.fromAgentId);
|
|
116
|
+
const to = entry.recipients.filter((r) => r.box === 'to').map((r) => who(r.recipientKind, r.recipientId)).join(', ');
|
|
117
|
+
const cc = entry.recipients.filter((r) => r.box === 'cc').map((r) => who(r.recipientKind, r.recipientId)).join(', ');
|
|
118
|
+
return ('- [' + entry.id.slice(0, 8) + '] from ' + from + ' to ' + (to || '-') + (cc ? ', cc ' + cc : '') +
|
|
119
|
+
' - subject: ' + entry.subject + '\n ' + clip(entry.body, bodyChars));
|
|
120
|
+
});
|
|
121
|
+
return heading + '\n' + lines.join('\n');
|
|
122
|
+
}
|
|
63
123
|
/**
|
|
64
124
|
* The block appended to the assistant's identity prompt: what it runs, how
|
|
65
125
|
* to delegate, and what arrived in its inbox since the last turn.
|
|
66
126
|
*/
|
|
67
|
-
export function assistantOrgBlock(config, snapshot,
|
|
127
|
+
export function assistantOrgBlock(config, snapshot, mail, activeProject, schedules = [], store) {
|
|
68
128
|
const sections = [];
|
|
69
129
|
sections.push([
|
|
70
130
|
'As the personal assistant described in your saved profile, you run a small company of AI agents on their behalf.',
|
|
71
|
-
'The agents are permanent staff with roles and their own memory; every
|
|
131
|
+
'The agents are permanent staff with roles and their own memory; every task you hand',
|
|
72
132
|
'one runs as a separate process in the background, in the project directory when the project',
|
|
73
|
-
'has one. The rookery tools are yours: `assign` hands a task to one agent
|
|
74
|
-
'report (several `assign` calls in one message run in parallel);
|
|
133
|
+
'has one. The rookery tools are yours: `assign` hands a task to one agent, puts it on the',
|
|
134
|
+
'board and returns the report (several `assign` calls in one message run in parallel);',
|
|
135
|
+
'`create_task`, `plan_task`',
|
|
75
136
|
'and `run_task` put bigger work on the board, decide who does it or how to split it, and',
|
|
76
137
|
'execute it; `hire_agent`, `update_agent`, `create_team`, `update_team`, `create_project` and',
|
|
77
138
|
'`update_project` shape the company when the user asks or when a job clearly needs a role',
|
|
78
139
|
'nobody holds. `list_assignments` is the history of what ran; `cancel_assignment` stops a',
|
|
79
|
-
'stuck or unwanted
|
|
140
|
+
'stuck or unwanted run, and `update_task` with status "cancelled" stops a running task.',
|
|
141
|
+
'Everything that gets worked on is a task: it has a card on the board and the mail thread it',
|
|
142
|
+
'is discussed in, and those are two sides of one thing rather than two places to look.',
|
|
143
|
+
'Name every task you create: three to eight words, no full stop, a noun phrase or an',
|
|
144
|
+
'imperative, in the language of the brief - never the brief itself pasted into the title.',
|
|
145
|
+
'A task whose run ended with a question to whoever asked for it is set to "blocked" by itself',
|
|
146
|
+
'and waits there; the next mail in its thread carries it on, and you may set that status by hand.',
|
|
80
147
|
'`remember`, `forget` and `search_memory` are your long-term memory of the user;',
|
|
81
148
|
'`get_settings` and `update_settings` are the defaults and limits you work under.',
|
|
82
149
|
'`create_schedule`, `list_schedules`, `update_schedule`, `delete_schedule` and `run_schedule`',
|
|
83
150
|
'are your schedules (cron jobs): standing orders that fire on a timetable without anyone',
|
|
84
|
-
'asking - a turn of your own in a conversation
|
|
85
|
-
'
|
|
86
|
-
'
|
|
151
|
+
'asking - a turn of your own in a fresh conversation, or a task for an agent - with the',
|
|
152
|
+
'outcome posted to your inbox. Use them whenever the user wants something regularly ("every',
|
|
153
|
+
'morning at 8", "on Fridays") or at a later time ("tomorrow at 15:00", once).',
|
|
87
154
|
'Turn what they say into a cron expression yourself and confirm the time in words.',
|
|
155
|
+
'A scheduled run of your own always ends with that "completed" note in the inbox, unless the',
|
|
156
|
+
'run itself already delivered the result to the user - a mail you sent them as the point of the',
|
|
157
|
+
'job. In that case end the turn with exactly [SILENT] instead of a report, or the user gets the',
|
|
158
|
+
'same thing twice: the mail the job exists to send, and a second mail just saying it ran.',
|
|
88
159
|
'Nothing here needs permission from anyone: you own the company and its machinery.',
|
|
89
|
-
'Two words to keep apart when you talk to the user: an assignment is',
|
|
90
|
-
'one agent running one brief, with a result; a task is an item on the',
|
|
91
|
-
'board that gets planned and then executed as one or more assignments.',
|
|
92
160
|
'Delegate real work - code, research, analysis, long writing - instead of doing it here;',
|
|
93
161
|
'you have no project files in this conversation.',
|
|
94
162
|
'Most turns are not work at all. Small talk, questions about the user, their day or their',
|
|
@@ -97,17 +165,39 @@ export function assistantOrgBlock(config, snapshot, inbox, activeProject, schedu
|
|
|
97
165
|
'When you delegated, report the outcome in your own identity and words; never narrate',
|
|
98
166
|
'tool mechanics.',
|
|
99
167
|
].join(' '));
|
|
100
|
-
sections.push(
|
|
168
|
+
sections.push([
|
|
169
|
+
'Company mail is how everyone here talks to everyone else, and how you reach the user when no',
|
|
170
|
+
'conversation is running. `send_mail` writes to an agent, to "user", or to several at once;',
|
|
171
|
+
'`read_mail` and `read_mail_thread` are your side of it. Mail with an agent on To hands them the',
|
|
172
|
+
'work and its report comes back to you as a reply; Cc only delivers. Use `assign` when you need',
|
|
173
|
+
'the result inside this turn, and mail when you do not have to wait for it - the same task',
|
|
174
|
+
'either way, on the same board.',
|
|
175
|
+
'Write to the user by mail when you are the one starting it: a finished piece of work, a report',
|
|
176
|
+
'they asked for, a decision only they can make. Answering a mail that arrived for you works the',
|
|
177
|
+
'other way round - the answer is what you write in that turn, it goes back as the reply on its',
|
|
178
|
+
'own, and a send_mail carrying the same thing delivers it twice.',
|
|
179
|
+
'A mail to the user also reaches their phone',
|
|
180
|
+
'through whatever channel is connected, so it is a real message and not a note left in a drawer -',
|
|
181
|
+
'say the thing and stop; never mail them a running commentary on what the company is doing.',
|
|
182
|
+
'`notify` is not a second mailbox: it is the one line that has to arrive now, and everything',
|
|
183
|
+
'that can be read later is mail.',
|
|
184
|
+
].join(' '));
|
|
185
|
+
sections.push(renderOrgOverview(snapshot, store?.org));
|
|
186
|
+
if (store) {
|
|
187
|
+
const flags = renderPerformanceFlags(snapshot, store.org);
|
|
188
|
+
if (flags)
|
|
189
|
+
sections.push(flags);
|
|
190
|
+
}
|
|
101
191
|
if (activeProject) {
|
|
102
192
|
sections.push('Active project for this conversation: ' + activeProject.name +
|
|
103
193
|
(activeProject.path ? ' at ' + activeProject.path : ' (no directory)') +
|
|
104
|
-
'.
|
|
194
|
+
'. Work you hand out defaults to it.');
|
|
105
195
|
}
|
|
106
196
|
if (schedules.length)
|
|
107
197
|
sections.push(renderSchedules(schedules, snapshot));
|
|
108
|
-
const
|
|
109
|
-
if (
|
|
110
|
-
sections.push(
|
|
198
|
+
const mailBlock = renderMail(mail, snapshot, 'Mail waiting for you:');
|
|
199
|
+
if (mailBlock)
|
|
200
|
+
sections.push(mailBlock);
|
|
111
201
|
return sections.join('\n\n');
|
|
112
202
|
}
|
|
113
203
|
/** The schedules, one line each, as the assistant's prompt and the list tool show them. */
|
|
@@ -118,7 +208,31 @@ export function renderSchedules(schedules, snapshot) {
|
|
|
118
208
|
const lines = schedules.map((job) => describeCronJob(job, job.agentId ? byId.get(job.agentId)?.slug : undefined));
|
|
119
209
|
return 'Your schedules (cron jobs, local time):\n' + lines.join('\n');
|
|
120
210
|
}
|
|
121
|
-
/**
|
|
211
|
+
/**
|
|
212
|
+
* One line per agent at escalation stage >= 1 (agent-performance-
|
|
213
|
+
* management, section 5): the point is that Jarvis brings this up on its
|
|
214
|
+
* own turn rather than waiting to be asked. Empty string when nobody is
|
|
215
|
+
* flagged, so a healthy company adds nothing to the prompt.
|
|
216
|
+
*/
|
|
217
|
+
function renderPerformanceFlags(snapshot, org) {
|
|
218
|
+
const lines = [];
|
|
219
|
+
for (const agent of snapshot.agents) {
|
|
220
|
+
const performance = org.performance(agent.id);
|
|
221
|
+
if (performance.stage === 0)
|
|
222
|
+
continue;
|
|
223
|
+
const detail = performance.stage === 1
|
|
224
|
+
? 'flagged, a development note is on record'
|
|
225
|
+
: performance.stage === 2
|
|
226
|
+
? 'reconfigured, on probation'
|
|
227
|
+
: 'reconfigured twice, a replacement has been proposed - awaiting your decision';
|
|
228
|
+
lines.push('- ' + agent.slug + ': stage ' + performance.stage + ' (' + detail + ')' +
|
|
229
|
+
(performance.average !== null ? ', average ' + performance.average.toFixed(1) : ''));
|
|
230
|
+
}
|
|
231
|
+
if (!lines.length)
|
|
232
|
+
return '';
|
|
233
|
+
return 'Staff performance needing your attention (agent_performance for detail):\n' + lines.join('\n');
|
|
234
|
+
}
|
|
235
|
+
/** The complete system prompt for one agent carrying out one task. */
|
|
122
236
|
export function buildAgentPrompt(input) {
|
|
123
237
|
const { agent, snapshot, config } = input;
|
|
124
238
|
const byId = agentById(snapshot);
|
|
@@ -126,6 +240,10 @@ export function buildAgentPrompt(input) {
|
|
|
126
240
|
const manager = agent.managerId ? byId.get(agent.managerId) : undefined;
|
|
127
241
|
const reports = snapshot.agents.filter((entry) => entry.managerId === agent.id);
|
|
128
242
|
const sections = [];
|
|
243
|
+
// A run answers as a letter only when it was born from mail and the
|
|
244
|
+
// company has roleplay switched on (decision E10/E14, F6); a run started
|
|
245
|
+
// by `assign` keeps today's report register unconditionally.
|
|
246
|
+
const letterRegister = Boolean(input.sourceMailSubject) && config.org.roleplay;
|
|
129
247
|
sections.push([
|
|
130
248
|
'You are ' + agent.name + ', ' + agent.title + ' at ' + snapshot.organization.name + ',',
|
|
131
249
|
'a company of AI agents run by the assistant ' + (config.assistantName || 'Rookery') + '.',
|
|
@@ -137,11 +255,37 @@ export function buildAgentPrompt(input) {
|
|
|
137
255
|
? 'Your direct reports: ' + reports.map((entry) => entry.slug + ' (' + entry.title + ')').join(', ') +
|
|
138
256
|
'. You may hand them parts of your work with the assign tool.'
|
|
139
257
|
: 'You have no reports; do the work yourself.',
|
|
140
|
-
'This
|
|
258
|
+
'This task (' + input.assignmentId.slice(0, 8) + ') was given to you by ' + input.requestedBy + '.',
|
|
141
259
|
]
|
|
142
260
|
.filter(Boolean)
|
|
143
261
|
.join(' '));
|
|
144
262
|
sections.push('Your standing instructions:\n' + agent.instructions);
|
|
263
|
+
const colleagueVoices = renderColleagueVoices(agent, snapshot);
|
|
264
|
+
if (colleagueVoices)
|
|
265
|
+
sections.push(colleagueVoices);
|
|
266
|
+
// Mail is the company's only channel between colleagues, so the prompt
|
|
267
|
+
// says who to write to rather than leaving `send_mail` as a tool nobody
|
|
268
|
+
// reaches for. The lead sentence is the reason the user's phone stays
|
|
269
|
+
// quiet: a team speaks to them through one agent, not five.
|
|
270
|
+
sections.push([
|
|
271
|
+
'Company mail is how people here reach each other. `send_mail` writes to a colleague by slug, to',
|
|
272
|
+
'your manager, to "assistant" or to "user"; `read_mail` and `read_mail_thread` are your side of',
|
|
273
|
+
'it. Mail with a colleague on To starts a real run of theirs and their answer comes back as a',
|
|
274
|
+
'reply, so it is how you ask somebody for something you do not have to sit and wait for; Cc only',
|
|
275
|
+
'delivers, for keeping somebody in the picture. Use it: a question for whoever knows the system,',
|
|
276
|
+
'a heads-up that changes their plans, a hand-off of work that is not yours. What it is not for is a',
|
|
277
|
+
'mail whose entire content is politeness - if there is nothing in it beyond a thank-you, do not send',
|
|
278
|
+
'it, because every mail you send costs somebody a run. A mail that has something to say may say it',
|
|
279
|
+
'in whatever tone fits; that cost is about content, not about tone.',
|
|
280
|
+
team && team.leadId === agent.id
|
|
281
|
+
? 'You lead ' + team.name + ': your team reaches the user through you, so what the team has to ' +
|
|
282
|
+
'tell them is yours to write - one mail with the whole picture, not one per person.'
|
|
283
|
+
: 'Write to the user only when the work was theirs to begin with or nobody else can answer; ' +
|
|
284
|
+
'otherwise it goes to your manager, your team lead or the assistant, who decides what ' +
|
|
285
|
+
'reaches them.',
|
|
286
|
+
]
|
|
287
|
+
.filter(Boolean)
|
|
288
|
+
.join(' '));
|
|
145
289
|
// How the work gets done, below the role and above the task: the agent's
|
|
146
290
|
// own instructions still win, because they were written for this job.
|
|
147
291
|
if (config.org.lazyCoding)
|
|
@@ -159,13 +303,62 @@ export function buildAgentPrompt(input) {
|
|
|
159
303
|
const memoryBlock = renderMemoryBlock(input.memories, Math.floor(config.memory.contextBudget * 0.4), 'your work');
|
|
160
304
|
if (memoryBlock)
|
|
161
305
|
sections.push(memoryBlock);
|
|
162
|
-
const
|
|
163
|
-
if (
|
|
164
|
-
sections.push(
|
|
306
|
+
const mailBlock = renderMail(input.mail, snapshot, 'Mail waiting for you:');
|
|
307
|
+
if (mailBlock)
|
|
308
|
+
sections.push(mailBlock);
|
|
165
309
|
for (const hint of input.toolHints ?? [])
|
|
166
310
|
sections.push(hint);
|
|
167
311
|
if (input.skillsIndex)
|
|
168
312
|
sections.push(input.skillsIndex);
|
|
313
|
+
if (input.sourceMailSubject) {
|
|
314
|
+
// Most of the thread stays out of the prompt: a long conversation would
|
|
315
|
+
// cost more context than most mails need. What goes in is the index and
|
|
316
|
+
// where to get the rest, so the agent pays for the history only when it
|
|
317
|
+
// reads it - plus the last two mails at length, because a run that
|
|
318
|
+
// continues a thread almost always turns on what was said last, and
|
|
319
|
+
// making it fetch that costs a tool call every time (F4).
|
|
320
|
+
const earlier = input.sourceMailThread ?? [];
|
|
321
|
+
if (earlier.length && input.sourceMailThreadId) {
|
|
322
|
+
// With the id: eight replies in one thread share almost the same
|
|
323
|
+
// subject, and without it there is no way to name one of them.
|
|
324
|
+
const index = earlier
|
|
325
|
+
.map((entry) => '- [' + entry.id.slice(0, 8) + '] ' + mailSender(entry, snapshot) + ': ' + entry.subject)
|
|
326
|
+
.join('\n');
|
|
327
|
+
sections.push('Earlier in this mail thread (' + earlier.length + ' mail(s) you sent or were To/Cc on), subjects only:\n' +
|
|
328
|
+
index + '\nRead the full text with read_mail_thread("' + input.sourceMailThreadId + '") when the answer ' +
|
|
329
|
+
'depends on it.');
|
|
330
|
+
const recent = earlier.slice(-THREAD_TAIL_MAILS);
|
|
331
|
+
sections.push(renderMail(recent, snapshot, 'The last of those, at length:', THREAD_TAIL_CHARS));
|
|
332
|
+
}
|
|
333
|
+
// Decision E10 (section 6.3): the same text stays `assignment.result` -
|
|
334
|
+
// no second model call, no rewrite, no marker in it for anybody to
|
|
335
|
+
// parse. Only the instruction changes which register that one text is
|
|
336
|
+
// written in. Off, or born from `assign` rather than mail, this is
|
|
337
|
+
// always the plain paragraph below, unchanged from before roleplay
|
|
338
|
+
// existed (F6).
|
|
339
|
+
if (letterRegister) {
|
|
340
|
+
sections.push([
|
|
341
|
+
'This task arrived as an email from ' + input.requestedBy + ', subject "' + input.sourceMailSubject + '".',
|
|
342
|
+
"It goes back as the reply's body automatically, and everyone who was Cc on their mail stays Cc on",
|
|
343
|
+
'yours. Do not send_mail the same answer to them on top of it; that tool is for bringing in',
|
|
344
|
+
'somebody who was not on the thread.',
|
|
345
|
+
'Write it as a letter to a colleague, not a report: a short salutation, one sentence of context,',
|
|
346
|
+
'the result, a stance on it, and a sign-off' +
|
|
347
|
+
(agent.voice ? ', in your own voice: ' + agent.voice : ', in a plain, neutral voice') + '.',
|
|
348
|
+
'The result stands in the first paragraph; politeness frames it and never postpones it - a letter',
|
|
349
|
+
'where the reader has to hunt for the answer is worse than the report it replaces. No invented',
|
|
350
|
+
'private life, no weekends, no coffee breaks; no played delay and no "I will look at that shortly"',
|
|
351
|
+
'without work already done behind it - a run either did the work or it is answering, never',
|
|
352
|
+
'pretending to be about to. Write in the language the task is written in.',
|
|
353
|
+
].join(' '));
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
sections.push('This task arrived as an email from ' + input.requestedBy + ', subject "' + input.sourceMailSubject + '". ' +
|
|
357
|
+
"Write your result as the reply's body, not a chat answer or a report - it goes back to them " +
|
|
358
|
+
'automatically, and everyone who was Cc on their mail stays Cc on yours. Do not send_mail the ' +
|
|
359
|
+
'same answer to them on top of it; send_mail is for bringing in somebody who was not on the thread.');
|
|
360
|
+
}
|
|
361
|
+
}
|
|
169
362
|
// The assistant is told not to accept dead ends; an agent that reports
|
|
170
363
|
// "not possible" after one attempt would hand it one anyway.
|
|
171
364
|
sections.push([
|
|
@@ -173,17 +366,38 @@ export function buildAgentPrompt(input) {
|
|
|
173
366
|
'closed door is the first attempt, not the answer: read what the error actually says, change',
|
|
174
367
|
'the approach rather than the parameter, and try a genuinely different route before you report',
|
|
175
368
|
'that something cannot be done. When you do report it, say what you tried and what would',
|
|
176
|
-
'unblock it. Stop short of anything irreversible or consequential the
|
|
369
|
+
'unblock it. Stop short of anything irreversible or consequential the task did not ask',
|
|
177
370
|
'for, and never claim a result you have not seen.',
|
|
178
371
|
].join(' '));
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
372
|
+
// Skipped for a letter-register reply: "lead with the result, no preamble"
|
|
373
|
+
// directly contradicts a salutation and a sign-off, and E10 means only one
|
|
374
|
+
// of the two instructions is ever in the prompt for a given run.
|
|
375
|
+
if (!letterRegister) {
|
|
376
|
+
sections.push([
|
|
377
|
+
'Work the task and nothing else. Your output is a report to whoever asked for it,',
|
|
378
|
+
'not a chat with the user: lead with the result, then what you changed or found, then open',
|
|
379
|
+
'questions. No preamble, no restating the brief. Separate what you verified from what you',
|
|
380
|
+
'assume. Anything that belongs to somebody other than whoever asked for this goes by mail, as',
|
|
381
|
+
'described above, not into the report. Write in the language the task is written in.',
|
|
382
|
+
].join(' '));
|
|
383
|
+
}
|
|
384
|
+
// Decision E2: qualitative, never a number - see AgentPromptInput.agentNotes.
|
|
385
|
+
if (input.agentNotes?.length) {
|
|
386
|
+
const notes = input.agentNotes
|
|
387
|
+
.slice(0, 2)
|
|
388
|
+
.map((entry) => '- ' + entry.note)
|
|
389
|
+
.join('\n');
|
|
390
|
+
sections.push('Feedback on your work:\n' + notes);
|
|
391
|
+
}
|
|
392
|
+
// Decision E3: fixed prompt text, never through recall - a successor gets
|
|
393
|
+
// exactly one telling of this, not a memory that might not surface.
|
|
394
|
+
if (input.handoverFrom) {
|
|
395
|
+
sections.push('Handover from ' + input.handoverFrom.predecessorName + ':\n' + input.handoverFrom.text);
|
|
396
|
+
}
|
|
397
|
+
// The clock a model judges every other stamp against, in this machine's own
|
|
398
|
+
// zone. A UTC date here and a local one elsewhere is how a healthy run comes
|
|
399
|
+
// to look hours old.
|
|
400
|
+
sections.push('It is now ' + formatNow() + '.');
|
|
187
401
|
return sections.join('\n\n');
|
|
188
402
|
}
|
|
189
403
|
/** The board as the assistant reads it. */
|
|
@@ -191,78 +405,51 @@ export function renderBoard(tasks, snapshot, store) {
|
|
|
191
405
|
if (!tasks.length)
|
|
192
406
|
return 'The board is empty.';
|
|
193
407
|
const byId = agentById(snapshot);
|
|
408
|
+
// A status filter searches the whole board, subtasks included, so a task
|
|
409
|
+
// that is on the list in its own right must not turn up a second time
|
|
410
|
+
// under its parent.
|
|
411
|
+
const listed = new Set(tasks.map((task) => task.id));
|
|
194
412
|
const lines = [];
|
|
195
413
|
for (const task of tasks) {
|
|
196
414
|
const assignee = task.assigneeId ? (byId.get(task.assigneeId)?.slug ?? '?') : 'unassigned';
|
|
197
415
|
lines.push('- [' + task.id.slice(0, 8) + '] ' + task.status.toUpperCase() + ' ' + task.priority + ' — ' + task.title +
|
|
198
|
-
' (' + assignee + ')' + (task.planNote ? ' · ' + shorten(task.planNote, 80) : '')
|
|
416
|
+
' (' + assignee + ')' + (task.planNote ? ' · ' + shorten(task.planNote, 80) : '') +
|
|
417
|
+
waitingOn(task, store) + attemptsOn(task, store));
|
|
199
418
|
for (const child of store.listTasks(task.orgId, { parentId: task.id })) {
|
|
200
|
-
if (child.status === 'cancelled')
|
|
419
|
+
if (child.status === 'cancelled' || listed.has(child.id))
|
|
201
420
|
continue;
|
|
202
421
|
const who = child.assigneeId ? (byId.get(child.assigneeId)?.slug ?? '?') : 'unassigned';
|
|
203
|
-
lines.push(' - [' + child.id.slice(0, 8) + '] ' + child.status + ' — ' + child.title + ' (' + who + ')'
|
|
422
|
+
lines.push(' - [' + child.id.slice(0, 8) + '] ' + child.status + ' — ' + child.title + ' (' + who + ')' +
|
|
423
|
+
waitingOn(child, store));
|
|
204
424
|
}
|
|
205
425
|
}
|
|
206
426
|
return lines.join('\n');
|
|
207
427
|
}
|
|
208
428
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
429
|
+
* What a waiting task waits for: how long it has stood there and the subject
|
|
430
|
+
* of the last mail in its thread (concept section 9). The board is all the
|
|
431
|
+
* watcher gets to read, and "BLOCKED normal — Fix the gate (mara)" says
|
|
432
|
+
* neither what was asked nor for how long.
|
|
213
433
|
*/
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
'something is outside your role. Match the language the user writes in.',
|
|
235
|
-
]
|
|
236
|
-
.filter(Boolean)
|
|
237
|
-
.join(' '));
|
|
238
|
-
sections.push('Your standing instructions:\n' + agent.instructions);
|
|
239
|
-
// How the work gets done, below the role and above the task: the agent's
|
|
240
|
-
// own instructions still win, because they were written for this job.
|
|
241
|
-
if (config.org.lazyCoding)
|
|
242
|
-
sections.push(PONYTAIL_RULESET);
|
|
243
|
-
if (input.project) {
|
|
244
|
-
sections.push('Project in focus: ' + input.project.name +
|
|
245
|
-
(input.project.description ? ' — ' + input.project.description : '') +
|
|
246
|
-
(input.project.path ? ' at ' + input.project.path : ''));
|
|
247
|
-
}
|
|
248
|
-
const memoryBlock = renderMemoryBlock(input.memories, Math.floor(config.memory.contextBudget * 0.4), 'your work and this person');
|
|
249
|
-
if (memoryBlock)
|
|
250
|
-
sections.push(memoryBlock);
|
|
251
|
-
if (!input.resumed && input.history?.length) {
|
|
252
|
-
const lines = input.history.slice(-12).map((message) => {
|
|
253
|
-
const speaker = message.role === 'user' ? 'User' : 'You';
|
|
254
|
-
return speaker + ': ' + shorten(message.content, 400);
|
|
255
|
-
});
|
|
256
|
-
sections.push('Earlier in this conversation:\n' + lines.join('\n'));
|
|
257
|
-
}
|
|
258
|
-
const inboxBlock = renderInbox(input.inbox, snapshot, 'Messages waiting for you:');
|
|
259
|
-
if (inboxBlock)
|
|
260
|
-
sections.push(inboxBlock);
|
|
261
|
-
for (const hint of input.toolHints ?? [])
|
|
262
|
-
sections.push(hint);
|
|
263
|
-
if (input.skillsIndex)
|
|
264
|
-
sections.push(input.skillsIndex);
|
|
265
|
-
sections.push('Today is ' + new Date().toISOString().slice(0, 10) + '.');
|
|
266
|
-
return sections.join('\n\n');
|
|
434
|
+
/**
|
|
435
|
+
* How often a failed task has already been tried. The board watcher reports
|
|
436
|
+
* rather than retries, and "failed" on its own does not say whether this is
|
|
437
|
+
* the first attempt or the fourth - which is the difference between "worth
|
|
438
|
+
* another go" and "something here is broken and no amount of running it
|
|
439
|
+
* again will help". Only shown where it changes the reading.
|
|
440
|
+
*/
|
|
441
|
+
function attemptsOn(task, store) {
|
|
442
|
+
if (task.status !== 'failed')
|
|
443
|
+
return '';
|
|
444
|
+
const runs = store.taskRunCount(task.id);
|
|
445
|
+
return runs > 1 ? ' · failed on run ' + runs : '';
|
|
446
|
+
}
|
|
447
|
+
function waitingOn(task, store) {
|
|
448
|
+
if (task.status !== 'blocked')
|
|
449
|
+
return '';
|
|
450
|
+
const thread = store.getMailThreadForTask(task.orgId, task.id);
|
|
451
|
+
const last = thread ? store.thread(task.orgId, thread.threadId, { limit: 1 }).at(-1) : null;
|
|
452
|
+
const span = formatAge(task.updatedAt || task.createdAt, Date.now(), 'minute');
|
|
453
|
+
return ' · waiting ' + span + (last ? ' on "' + shorten(last.subject, 60) + '"' : '');
|
|
267
454
|
}
|
|
268
455
|
//# sourceMappingURL=prompts.js.map
|