hoomanjs 1.29.2 → 1.30.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 +216 -69
- package/dist/acp/acp-agent.d.ts +5 -5
- package/dist/acp/acp-agent.js +55 -54
- package/dist/acp/acp-agent.js.map +1 -1
- package/dist/acp/approvals.d.ts +3 -3
- package/dist/acp/approvals.js +73 -115
- package/dist/acp/approvals.js.map +1 -1
- package/dist/acp/sessions/options.js +11 -25
- package/dist/acp/sessions/options.js.map +1 -1
- package/dist/acp/utils/tool-kind.js +1 -5
- package/dist/acp/utils/tool-kind.js.map +1 -1
- package/dist/chat/app.d.ts +5 -1
- package/dist/chat/app.js +322 -202
- package/dist/chat/app.js.map +1 -1
- package/dist/chat/approvals.d.ts +4 -3
- package/dist/chat/approvals.js +11 -45
- package/dist/chat/approvals.js.map +1 -1
- package/dist/chat/components/ChatMessage.d.ts +1 -2
- package/dist/chat/components/ChatMessage.js +4 -5
- package/dist/chat/components/ChatMessage.js.map +1 -1
- package/dist/chat/components/EmptyChatBanner.js +2 -3
- package/dist/chat/components/EmptyChatBanner.js.map +1 -1
- package/dist/chat/components/StatusBar.js +6 -2
- package/dist/chat/components/StatusBar.js.map +1 -1
- package/dist/chat/components/ThoughtEvent.d.ts +6 -0
- package/dist/chat/components/ThoughtEvent.js +30 -0
- package/dist/chat/components/ThoughtEvent.js.map +1 -0
- package/dist/chat/components/ToolEvent.js +1 -1
- package/dist/chat/components/ToolEvent.js.map +1 -1
- package/dist/chat/components/Transcript.d.ts +7 -2
- package/dist/chat/components/Transcript.js +6 -2
- package/dist/chat/components/Transcript.js.map +1 -1
- package/dist/chat/components/markdown/BlockRenderer.js +7 -7
- package/dist/chat/components/markdown/BlockRenderer.js.map +1 -1
- package/dist/chat/components/markdown/MarkdownMessage.js +1 -1
- package/dist/chat/components/markdown/MarkdownMessage.js.map +1 -1
- package/dist/chat/components/shared.js +2 -0
- package/dist/chat/components/shared.js.map +1 -1
- package/dist/chat/index.d.ts +4 -0
- package/dist/chat/index.js +17 -3
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/steering.d.ts +20 -0
- package/dist/chat/steering.js +67 -0
- package/dist/chat/steering.js.map +1 -0
- package/dist/chat/types.d.ts +5 -1
- package/dist/cli.js +91 -13
- package/dist/cli.js.map +1 -1
- package/dist/configure/app.d.ts +1 -1
- package/dist/configure/app.js +581 -303
- package/dist/configure/app.js.map +1 -1
- package/dist/configure/components/MenuScreen.d.ts +4 -2
- package/dist/configure/components/MenuScreen.js +33 -6
- package/dist/configure/components/MenuScreen.js.map +1 -1
- package/dist/configure/components/SelectMenuItem.d.ts +1 -0
- package/dist/configure/components/SelectMenuItem.js +19 -10
- package/dist/configure/components/SelectMenuItem.js.map +1 -1
- package/dist/configure/index.js +4 -2
- package/dist/configure/index.js.map +1 -1
- package/dist/configure/types.d.ts +14 -12
- package/dist/configure/utils.d.ts +2 -0
- package/dist/configure/utils.js +21 -2
- package/dist/configure/utils.js.map +1 -1
- package/dist/core/agent/index.d.ts +3 -3
- package/dist/core/agent/index.js +20 -25
- package/dist/core/agent/index.js.map +1 -1
- package/dist/core/agent/mode-aware-tool-registry.js +2 -1
- package/dist/core/agent/mode-aware-tool-registry.js.map +1 -1
- package/dist/core/approvals/intervention.d.ts +34 -0
- package/dist/core/approvals/intervention.js +94 -0
- package/dist/core/approvals/intervention.js.map +1 -0
- package/dist/core/config.d.ts +49 -28
- package/dist/core/config.js +85 -26
- package/dist/core/config.js.map +1 -1
- package/dist/core/context/index.d.ts +11 -2
- package/dist/core/context/index.js +54 -4
- package/dist/core/context/index.js.map +1 -1
- package/dist/core/context/model-extractor.d.ts +13 -0
- package/dist/core/context/model-extractor.js +98 -0
- package/dist/core/context/model-extractor.js.map +1 -0
- package/dist/core/index.d.ts +6 -2
- package/dist/core/index.js +6 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/mcp/config.d.ts +28 -0
- package/dist/core/mcp/index.d.ts +5 -3
- package/dist/core/mcp/index.js +4 -2
- package/dist/core/mcp/index.js.map +1 -1
- package/dist/core/mcp/manager.d.ts +14 -1
- package/dist/core/mcp/manager.js +76 -4
- package/dist/core/mcp/manager.js.map +1 -1
- package/dist/core/mcp/oauth/callback-server.d.ts +16 -0
- package/dist/core/mcp/oauth/callback-server.js +134 -0
- package/dist/core/mcp/oauth/callback-server.js.map +1 -0
- package/dist/core/mcp/oauth/identity.d.ts +9 -0
- package/dist/core/mcp/oauth/identity.js +31 -0
- package/dist/core/mcp/oauth/identity.js.map +1 -0
- package/dist/core/mcp/oauth/index.d.ts +11 -0
- package/dist/core/mcp/oauth/index.js +15 -0
- package/dist/core/mcp/oauth/index.js.map +1 -0
- package/dist/core/mcp/oauth/provider.d.ts +43 -0
- package/dist/core/mcp/oauth/provider.js +203 -0
- package/dist/core/mcp/oauth/provider.js.map +1 -0
- package/dist/core/mcp/oauth/service.d.ts +29 -0
- package/dist/core/mcp/oauth/service.js +139 -0
- package/dist/core/mcp/oauth/service.js.map +1 -0
- package/dist/core/mcp/oauth/store.d.ts +14 -0
- package/dist/core/mcp/oauth/store.js +86 -0
- package/dist/core/mcp/oauth/store.js.map +1 -0
- package/dist/core/mcp/oauth/types.d.ts +87 -0
- package/dist/core/mcp/oauth/types.js +45 -0
- package/dist/core/mcp/oauth/types.js.map +1 -0
- package/dist/core/mcp/types.d.ts +56 -0
- package/dist/core/mcp/types.js +3 -0
- package/dist/core/mcp/types.js.map +1 -1
- package/dist/core/memory/file-store.d.ts +24 -0
- package/dist/core/memory/file-store.js +151 -0
- package/dist/core/memory/file-store.js.map +1 -0
- package/dist/core/memory/index.d.ts +2 -5
- package/dist/core/memory/index.js +2 -3
- package/dist/core/memory/index.js.map +1 -1
- package/dist/core/memory/runtime.d.ts +4 -0
- package/dist/core/memory/runtime.js +37 -0
- package/dist/core/memory/runtime.js.map +1 -0
- package/dist/core/models/anthropic.js +24 -1
- package/dist/core/models/anthropic.js.map +1 -1
- package/dist/core/models/moonshot.js +33 -1
- package/dist/core/models/moonshot.js.map +1 -1
- package/dist/core/modes/definitions.d.ts +19 -0
- package/dist/core/modes/definitions.js +99 -0
- package/dist/core/modes/definitions.js.map +1 -0
- package/dist/core/modes/index.d.ts +3 -0
- package/dist/core/modes/index.js +4 -0
- package/dist/core/modes/index.js.map +1 -0
- package/dist/core/modes/registry.d.ts +9 -0
- package/dist/core/modes/registry.js +57 -0
- package/dist/core/modes/registry.js.map +1 -0
- package/dist/core/modes/schema.d.ts +5 -0
- package/dist/core/modes/schema.js +6 -0
- package/dist/core/modes/schema.js.map +1 -0
- package/dist/core/prompts/agents/research.md +8 -8
- package/dist/core/prompts/bundled.d.ts +3 -0
- package/dist/core/prompts/bundled.js +14 -0
- package/dist/core/prompts/bundled.js.map +1 -0
- package/dist/core/prompts/environment.d.ts +0 -1
- package/dist/core/prompts/environment.js +0 -2
- package/dist/core/prompts/environment.js.map +1 -1
- package/dist/core/prompts/index.d.ts +1 -4
- package/dist/core/prompts/index.js +1 -7
- package/dist/core/prompts/index.js.map +1 -1
- package/dist/core/prompts/modes/agent.md +3 -0
- package/dist/core/prompts/modes/ask.md +5 -3
- package/dist/core/prompts/modes/plan.md +2 -2
- package/dist/core/prompts/session-mode-appendix.d.ts +3 -9
- package/dist/core/prompts/session-mode-appendix.js +32 -69
- package/dist/core/prompts/session-mode-appendix.js.map +1 -1
- package/dist/core/prompts/static/environment.md +2 -2
- package/dist/core/prompts/static/init.md +25 -0
- package/dist/core/prompts/static/memory.md +9 -123
- package/dist/core/prompts/static/planning.md +1 -1
- package/dist/core/prompts/static/skills.md +6 -5
- package/dist/core/prompts/static/subagents.md +2 -2
- package/dist/core/prompts/static/web-search.md +2 -1
- package/dist/core/prompts/system.js +8 -22
- package/dist/core/prompts/system.js.map +1 -1
- package/dist/core/skills/built-in/hooman-config/SKILL.md +105 -32
- package/dist/core/skills/built-in/hooman-skills/SKILL.md +1 -1
- package/dist/core/skills/index.d.ts +1 -0
- package/dist/core/skills/index.js +1 -0
- package/dist/core/skills/index.js.map +1 -1
- package/dist/core/skills/plugin.d.ts +7 -0
- package/dist/core/skills/plugin.js +40 -0
- package/dist/core/skills/plugin.js.map +1 -0
- package/dist/core/state/agent-app-state.d.ts +1 -1
- package/dist/core/state/agent-app-state.js +1 -1
- package/dist/core/state/session-mode.d.ts +2 -9
- package/dist/core/state/session-mode.js +4 -12
- package/dist/core/state/session-mode.js.map +1 -1
- package/dist/core/state/tool-approvals.d.ts +4 -8
- package/dist/core/state/tool-approvals.js +14 -76
- package/dist/core/state/tool-approvals.js.map +1 -1
- package/dist/core/subagents/index.d.ts +3 -0
- package/dist/core/subagents/index.js +4 -0
- package/dist/core/subagents/index.js.map +1 -0
- package/dist/core/subagents/research.d.ts +16 -0
- package/dist/core/subagents/research.js +58 -0
- package/dist/core/subagents/research.js.map +1 -0
- package/dist/core/{agents → subagents}/runner.d.ts +6 -5
- package/dist/core/{agents → subagents}/runner.js +8 -10
- package/dist/core/subagents/runner.js.map +1 -0
- package/dist/core/{agents/tools.d.ts → subagents/tool.d.ts} +6 -6
- package/dist/core/{agents/tools.js → subagents/tool.js} +14 -16
- package/dist/core/subagents/tool.js.map +1 -0
- package/dist/core/tools/plan.js +2 -6
- package/dist/core/tools/plan.js.map +1 -1
- package/dist/core/tools/time.js +1 -1
- package/dist/core/tools/time.js.map +1 -1
- package/dist/core/utils/browser.d.ts +1 -0
- package/dist/core/utils/browser.js +25 -0
- package/dist/core/utils/browser.js.map +1 -0
- package/dist/core/utils/paths.d.ts +2 -4
- package/dist/core/utils/paths.js +2 -4
- package/dist/core/utils/paths.js.map +1 -1
- package/dist/daemon/approvals.d.ts +2 -2
- package/dist/daemon/approvals.js +51 -56
- package/dist/daemon/approvals.js.map +1 -1
- package/dist/daemon/index.js +9 -6
- package/dist/daemon/index.js.map +1 -1
- package/dist/exec/approvals.d.ts +2 -4
- package/dist/exec/approvals.js +16 -48
- package/dist/exec/approvals.js.map +1 -1
- package/dist/index.d.ts +13 -18
- package/dist/index.js +9 -11
- package/dist/index.js.map +1 -1
- package/package.json +5 -18
- package/dist/chat/components/ScrollView.d.ts +0 -106
- package/dist/chat/components/ScrollView.js +0 -80
- package/dist/chat/components/ScrollView.js.map +0 -1
- package/dist/chat/components/TranscriptViewport.d.ts +0 -9
- package/dist/chat/components/TranscriptViewport.js +0 -124
- package/dist/chat/components/TranscriptViewport.js.map +0 -1
- package/dist/core/agents/definitions.d.ts +0 -12
- package/dist/core/agents/definitions.js +0 -20
- package/dist/core/agents/definitions.js.map +0 -1
- package/dist/core/agents/index.d.ts +0 -4
- package/dist/core/agents/index.js +0 -5
- package/dist/core/agents/index.js.map +0 -1
- package/dist/core/agents/registry.d.ts +0 -5
- package/dist/core/agents/registry.js +0 -84
- package/dist/core/agents/registry.js.map +0 -1
- package/dist/core/agents/runner.js.map +0 -1
- package/dist/core/agents/tools.js.map +0 -1
- package/dist/core/inference/embedder.d.ts +0 -26
- package/dist/core/inference/embedder.js +0 -85
- package/dist/core/inference/embedder.js.map +0 -1
- package/dist/core/inference/index.d.ts +0 -9
- package/dist/core/inference/index.js +0 -13
- package/dist/core/inference/index.js.map +0 -1
- package/dist/core/inference/loader.d.ts +0 -16
- package/dist/core/inference/loader.js +0 -129
- package/dist/core/inference/loader.js.map +0 -1
- package/dist/core/inference/reranker.d.ts +0 -28
- package/dist/core/inference/reranker.js +0 -66
- package/dist/core/inference/reranker.js.map +0 -1
- package/dist/core/memory/brain.d.ts +0 -25
- package/dist/core/memory/brain.js +0 -137
- package/dist/core/memory/brain.js.map +0 -1
- package/dist/core/memory/database.d.ts +0 -4
- package/dist/core/memory/database.js +0 -87
- package/dist/core/memory/database.js.map +0 -1
- package/dist/core/memory/tools.d.ts +0 -16
- package/dist/core/memory/tools.js +0 -110
- package/dist/core/memory/tools.js.map +0 -1
- package/dist/core/memory/types.d.ts +0 -11
- package/dist/core/memory/types.js +0 -2
- package/dist/core/memory/types.js.map +0 -1
- package/dist/core/prompts/skills.d.ts +0 -15
- package/dist/core/prompts/skills.js +0 -92
- package/dist/core/prompts/skills.js.map +0 -1
- package/dist/core/prompts/static/wiki.md +0 -25
- package/dist/core/wiki/converters.d.ts +0 -12
- package/dist/core/wiki/converters.js +0 -73
- package/dist/core/wiki/converters.js.map +0 -1
- package/dist/core/wiki/database.d.ts +0 -39
- package/dist/core/wiki/database.js +0 -177
- package/dist/core/wiki/database.js.map +0 -1
- package/dist/core/wiki/index.d.ts +0 -7
- package/dist/core/wiki/index.js +0 -5
- package/dist/core/wiki/index.js.map +0 -1
- package/dist/core/wiki/storage.d.ts +0 -38
- package/dist/core/wiki/storage.js +0 -206
- package/dist/core/wiki/storage.js.map +0 -1
- package/dist/core/wiki/tools.d.ts +0 -5
- package/dist/core/wiki/tools.js +0 -32
- package/dist/core/wiki/tools.js.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
const PROMPTS_ROOT = dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
export function bundledPromptPath(...parts) {
|
|
6
|
+
return join(PROMPTS_ROOT, ...parts);
|
|
7
|
+
}
|
|
8
|
+
export function hasBundledPrompt(...parts) {
|
|
9
|
+
return existsSync(bundledPromptPath(...parts));
|
|
10
|
+
}
|
|
11
|
+
export function readBundledPrompt(...parts) {
|
|
12
|
+
return readFileSync(bundledPromptPath(...parts), "utf8").trim();
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=bundled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundled.js","sourceRoot":"","sources":["../../../src/core/prompts/bundled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE7D,MAAM,UAAU,iBAAiB,CAAC,GAAG,KAAe;IAClD,OAAO,IAAI,CAAC,YAAY,EAAE,GAAG,KAAK,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,GAAG,KAAe;IACjD,OAAO,UAAU,CAAC,iBAAiB,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,GAAG,KAAe;IAClD,OAAO,YAAY,CAAC,iBAAiB,CAAC,GAAG,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AAClE,CAAC"}
|
|
@@ -37,14 +37,12 @@ function detectTimeZone() {
|
|
|
37
37
|
}
|
|
38
38
|
export function getEnvironmentPromptContext() {
|
|
39
39
|
const cwd = process.cwd();
|
|
40
|
-
const now = new Date();
|
|
41
40
|
return {
|
|
42
41
|
cwd,
|
|
43
42
|
platform: detectPlatform(),
|
|
44
43
|
osVersion: detectOsVersion(),
|
|
45
44
|
shell: detectShell(),
|
|
46
45
|
isGitRepo: detectGitRepo(cwd),
|
|
47
|
-
currentDateTime: now.toString(),
|
|
48
46
|
timeZone: detectTimeZone(),
|
|
49
47
|
};
|
|
50
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/core/prompts/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,OAAO,IAAI,SAAS,EACpB,IAAI,IAAI,MAAM,EACd,OAAO,IAAI,SAAS,GACrB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/core/prompts/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,OAAO,IAAI,SAAS,EACpB,IAAI,IAAI,MAAM,EACd,OAAO,IAAI,SAAS,GACrB,MAAM,SAAS,CAAC;AAWjB,SAAS,cAAc;IACrB,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC5D,CAAC,CAAC,OAAO,CAAC,QAAQ;QAClB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;AACvB,CAAC;AAED,SAAS,eAAe;IACtB,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,GAAG,SAAS,EAAE,IAAI,SAAS,EAAE,EAAE,CAAC;IACzC,CAAC;IACD,OAAO,GAAG,MAAM,EAAE,IAAI,SAAS,EAAE,EAAE,CAAC;AACtC,CAAC;AAED,SAAS,WAAW;IAClB,MAAM,KAAK,GACT,OAAO,CAAC,GAAG,CAAC,KAAK;QACjB,OAAO,CAAC,GAAG,CAAC,OAAO;QACnB,OAAO,CAAC,GAAG,CAAC,OAAO;QACnB,SAAS,CAAC;IACZ,OAAO,KAAK,CAAC,IAAI,EAAE,IAAI,SAAS,CAAC;AACnC,CAAC;AAED,SAAS,aAAa,CAAC,QAAgB;IACrC,IAAI,OAAO,GAAG,QAAQ,CAAC;IACvB,OAAO,IAAI,EAAE,CAAC;QACZ,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;YACtC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,cAAc;IACrB,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ,IAAI,SAAS,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,OAAO;QACL,GAAG;QACH,QAAQ,EAAE,cAAc,EAAE;QAC1B,SAAS,EAAE,eAAe,EAAE;QAC5B,KAAK,EAAE,WAAW,EAAE;QACpB,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC;QAC7B,QAAQ,EAAE,cAAc,EAAE;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { Config } from "../config.js";
|
|
2
|
-
import type { Registry } from "../skills/registry.js";
|
|
3
|
-
import { Skills } from "./skills.js";
|
|
4
2
|
import { System, type SystemMode } from "./system.js";
|
|
5
|
-
export {
|
|
3
|
+
export { System };
|
|
6
4
|
export declare function system(path: string, config: Config, mode?: SystemMode): Promise<System>;
|
|
7
|
-
export declare function skills(registry: Registry): Promise<Skills>;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { Skills } from "./skills.js";
|
|
2
1
|
import { System } from "./system.js";
|
|
3
|
-
export {
|
|
2
|
+
export { System };
|
|
4
3
|
export async function system(path, config, mode = "default") {
|
|
5
4
|
const prompt = new System(path, config, mode);
|
|
6
5
|
await prompt.reload();
|
|
7
6
|
return prompt;
|
|
8
7
|
}
|
|
9
|
-
export async function skills(registry) {
|
|
10
|
-
const prompt = new Skills(registry);
|
|
11
|
-
await prompt.reload();
|
|
12
|
-
return prompt;
|
|
13
|
-
}
|
|
14
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/prompts/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/prompts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAmB,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,IAAY,EACZ,MAAc,EACd,OAAmB,SAAS;IAE5B,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC9C,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;IACtB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
## Ask mode
|
|
2
|
+
|
|
1
3
|
You are in **ask** mode: a narrowed tool surface for exploration, research, and answering questions.
|
|
2
4
|
|
|
3
5
|
## Ask mode
|
|
@@ -9,9 +11,9 @@ You are in **ask** mode: a narrowed tool surface for exploration, research, and
|
|
|
9
11
|
### Discipline
|
|
10
12
|
|
|
11
13
|
- Do **not** imply you can use tools that are not exposed in this phase.
|
|
12
|
-
- If the user needs a **written plan on disk** and the staged planning workflow, they should switch to **plan** mode (or **
|
|
13
|
-
- If they want **full implementation** or unrestricted editing commands, they should switch to **
|
|
14
|
-
- When **`
|
|
14
|
+
- If the user needs a **written plan on disk** and the staged planning workflow, they should switch to **plan** mode (or **agent** when those tools are available).
|
|
15
|
+
- If they want **full implementation** or unrestricted editing commands, they should switch to **agent** mode (or approve work explicitly once they have switched).
|
|
16
|
+
- When **`run_subagents`** is available, use it only for **read-only** parallel exploration; you remain responsible for synthesizing answers.
|
|
15
17
|
|
|
16
18
|
### Output
|
|
17
19
|
|
|
@@ -6,7 +6,7 @@ You are in planning mode. **Implementation still requires an explicit go-ahead f
|
|
|
6
6
|
|
|
7
7
|
### Mandatory order
|
|
8
8
|
|
|
9
|
-
1. **Plan stub before exploration.** If the line above shows **—**, your **only** tool call until the path appears must be **`enter_plan_mode`**. Do **not** run **`list_directory`**, **`read_file`**, **`fetch`**, **`web_search`**, **`
|
|
9
|
+
1. **Plan stub before exploration.** If the line above shows **—**, your **only** tool call until the path appears must be **`enter_plan_mode`**. Do **not** run **`list_directory`**, **`read_file`**, **`fetch`**, **`web_search`**, **`run_subagents`**, or any other tool first—there is nothing substantive to inspect until the plan document exists. You may send a **short** chat line saying you are allocating the plan; then call **`enter_plan_mode`** in that same turn.
|
|
10
10
|
2. **Treat that file as the single source of truth.** Do not rely on chat alone to hold the plan—everything negotiated belongs in the plan file.
|
|
11
11
|
3. **Every assistant turn** after the plan path exists: incorporate user messages (and new facts), then **update the plan file** with **`write_file`** / **`edit_file`** so it reflects objectives, constraints, open questions, and steps. If the user corrects or adds information, **edit the plan file in the same turn**.
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ Exception: if the user **explicitly** asks you to read a specific path they gave
|
|
|
20
20
|
|
|
21
21
|
### Boundaries (your direct actions)
|
|
22
22
|
|
|
23
|
-
- Do not create, edit, move, or delete files **other than the plan file** shown above (delegated **`
|
|
23
|
+
- Do not create, edit, move, or delete files **other than the plan file** shown above (delegated **`run_subagents`** tasks stay **read-only** exploration).
|
|
24
24
|
- Do not run commands that change system state outside tools exposed in this mode.
|
|
25
25
|
- Do not ship the final deliverable here—only the reviewed plan document.
|
|
26
26
|
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ContextInjector } from "@strands-agents/sdk/vended-plugins/context-injector";
|
|
2
2
|
import { type SessionMode } from "../state/session-mode.js";
|
|
3
|
-
export declare function registerAgentSystemPromptBaseBuilder(agent: LocalAgent, buildBase: () => Promise<string>): void;
|
|
4
|
-
/** Rebuild base instructions from disk/config and re-apply the session-mode appendix. */
|
|
5
|
-
export declare function refreshAgentFullSystemPrompt(agent: LocalAgent): Promise<void>;
|
|
6
3
|
/** Plain snapshot of selected `appState` entries for mode prompts (Handlebars `state`). */
|
|
7
4
|
export declare function snapshotAppStateForSessionModePrompt(agent: {
|
|
8
5
|
appState: {
|
|
9
6
|
get(key: string): unknown;
|
|
10
7
|
};
|
|
11
8
|
}): Record<string, unknown>;
|
|
12
|
-
export declare function
|
|
13
|
-
|
|
14
|
-
sessionModeState?: Record<string, unknown>): string;
|
|
15
|
-
/** Applies the session-mode appendix to `base` and updates `agent.systemPrompt` when it changes. */
|
|
16
|
-
export declare function refreshAgentSystemPromptForSessionMode(agent: LocalAgent, base: string): void;
|
|
9
|
+
export declare function renderSessionModePrompt(mode: SessionMode, sessionModeState?: Record<string, unknown>): string;
|
|
10
|
+
export declare function createSessionModePromptPlugin(): ContextInjector;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
-
import { dirname, join } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
1
|
import handlebars from "handlebars";
|
|
2
|
+
import { ContextInjector } from "@strands-agents/sdk/vended-plugins/context-injector";
|
|
3
|
+
import { hasBundledPrompt, readBundledPrompt } from "./bundled.js";
|
|
4
|
+
import { getModeDefinition, } from "../modes/definitions.js";
|
|
5
5
|
import { PLAN_ENTERED_AT_STATE_KEY, PLAN_ENTER_REASON_STATE_KEY, PLAN_FILE_STATE_KEY, } from "../state/plan.js";
|
|
6
6
|
import { getModeState, MODE_STATE_KEY, } from "../state/session-mode.js";
|
|
7
7
|
const { compile } = handlebars;
|
|
8
|
-
const SECTION_BREAK = "\n\n---\n\n";
|
|
9
8
|
/** Keys exposed as `state` in session-mode Handlebars templates (e.g. plan.md). */
|
|
10
9
|
const SESSION_MODE_TEMPLATE_STATE_KEYS = [
|
|
11
10
|
MODE_STATE_KEY,
|
|
@@ -13,29 +12,13 @@ const SESSION_MODE_TEMPLATE_STATE_KEYS = [
|
|
|
13
12
|
PLAN_ENTER_REASON_STATE_KEY,
|
|
14
13
|
PLAN_ENTERED_AT_STATE_KEY,
|
|
15
14
|
];
|
|
16
|
-
|
|
17
|
-
let cachedPlanTemplateCompiled = null;
|
|
18
|
-
let cachedAskAppendix = null;
|
|
19
|
-
const systemPromptBaseBuilders = new WeakMap();
|
|
20
|
-
export function registerAgentSystemPromptBaseBuilder(agent, buildBase) {
|
|
21
|
-
systemPromptBaseBuilders.set(agent, buildBase);
|
|
22
|
-
}
|
|
23
|
-
/** Rebuild base instructions from disk/config and re-apply the session-mode appendix. */
|
|
24
|
-
export async function refreshAgentFullSystemPrompt(agent) {
|
|
25
|
-
const build = systemPromptBaseBuilders.get(agent);
|
|
26
|
-
if (!build) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const base = await build();
|
|
30
|
-
refreshAgentSystemPromptForSessionMode(agent, base);
|
|
31
|
-
}
|
|
15
|
+
const cachedModeTemplates = new Map();
|
|
32
16
|
function readBundledModeFile(file) {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
if (!existsSync(full)) {
|
|
17
|
+
const parts = file.split("/");
|
|
18
|
+
if (!hasBundledPrompt(...parts)) {
|
|
36
19
|
return "";
|
|
37
20
|
}
|
|
38
|
-
return
|
|
21
|
+
return readBundledPrompt(...parts);
|
|
39
22
|
}
|
|
40
23
|
/** Plain snapshot of selected `appState` entries for mode prompts (Handlebars `state`). */
|
|
41
24
|
export function snapshotAppStateForSessionModePrompt(agent) {
|
|
@@ -45,54 +28,34 @@ export function snapshotAppStateForSessionModePrompt(agent) {
|
|
|
45
28
|
}
|
|
46
29
|
return state;
|
|
47
30
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return "";
|
|
54
|
-
}
|
|
55
|
-
if (cachedPlanTemplateCompiled === null) {
|
|
56
|
-
cachedPlanTemplateCompiled = compile(cachedPlanTemplateSource, {
|
|
57
|
-
strict: false,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
return cachedPlanTemplateCompiled({ state }).trim();
|
|
61
|
-
}
|
|
62
|
-
function appendixForMode(mode, state) {
|
|
63
|
-
switch (mode) {
|
|
64
|
-
case "plan":
|
|
65
|
-
return renderPlanAppendix(state);
|
|
66
|
-
case "ask": {
|
|
67
|
-
if (cachedAskAppendix === null) {
|
|
68
|
-
cachedAskAppendix = readBundledModeFile("ask.md");
|
|
69
|
-
}
|
|
70
|
-
return cachedAskAppendix;
|
|
71
|
-
}
|
|
72
|
-
default:
|
|
31
|
+
function renderModePrompt(config, state) {
|
|
32
|
+
let compiled = cachedModeTemplates.get(config.id);
|
|
33
|
+
if (!compiled) {
|
|
34
|
+
const source = readBundledModeFile(config.instructions);
|
|
35
|
+
if (!source) {
|
|
73
36
|
return "";
|
|
37
|
+
}
|
|
38
|
+
compiled = compile(source, { strict: false });
|
|
39
|
+
cachedModeTemplates.set(config.id, compiled);
|
|
74
40
|
}
|
|
41
|
+
return compiled({ state }).trim();
|
|
75
42
|
}
|
|
76
|
-
export function
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (!extra) {
|
|
81
|
-
return base;
|
|
82
|
-
}
|
|
83
|
-
if (!base) {
|
|
84
|
-
return extra;
|
|
85
|
-
}
|
|
86
|
-
return `${base}${SECTION_BREAK}${extra}`;
|
|
87
|
-
}
|
|
88
|
-
/** Applies the session-mode appendix to `base` and updates `agent.systemPrompt` when it changes. */
|
|
89
|
-
export function refreshAgentSystemPromptForSessionMode(agent, base) {
|
|
90
|
-
const mode = getModeState(agent).mode;
|
|
91
|
-
const sessionModeState = snapshotAppStateForSessionModePrompt(agent);
|
|
92
|
-
const next = composeSystemPromptWithSessionMode(base, mode, sessionModeState);
|
|
93
|
-
const cur = typeof agent.systemPrompt === "string" ? agent.systemPrompt : "";
|
|
94
|
-
if (cur !== next && typeof agent.systemPrompt === "string") {
|
|
95
|
-
agent.systemPrompt = next;
|
|
43
|
+
export function renderSessionModePrompt(mode, sessionModeState = {}) {
|
|
44
|
+
const config = getModeDefinition(mode);
|
|
45
|
+
if (!config) {
|
|
46
|
+
return "";
|
|
96
47
|
}
|
|
48
|
+
return renderModePrompt(config, sessionModeState);
|
|
49
|
+
}
|
|
50
|
+
export function createSessionModePromptPlugin() {
|
|
51
|
+
return new ContextInjector({
|
|
52
|
+
name: "hooman:session-mode-prompt",
|
|
53
|
+
trigger: "everyTurn",
|
|
54
|
+
renderContent: async ({ agent }) => {
|
|
55
|
+
const mode = getModeState(agent).mode;
|
|
56
|
+
const sessionModeState = snapshotAppStateForSessionModePrompt(agent);
|
|
57
|
+
return renderSessionModePrompt(mode, sessionModeState);
|
|
58
|
+
},
|
|
59
|
+
});
|
|
97
60
|
}
|
|
98
61
|
//# sourceMappingURL=session-mode-appendix.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-mode-appendix.js","sourceRoot":"","sources":["../../../src/core/prompts/session-mode-appendix.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"session-mode-appendix.js","sourceRoot":"","sources":["../../../src/core/prompts/session-mode-appendix.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,qDAAqD,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EACL,iBAAiB,GAElB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,YAAY,EACZ,cAAc,GAEf,MAAM,0BAA0B,CAAC;AAElC,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;AAE/B,mFAAmF;AACnF,MAAM,gCAAgC,GAAG;IACvC,cAAc;IACd,mBAAmB;IACnB,2BAA2B;IAC3B,yBAAyB;CACjB,CAAC;AAEX,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAsC,CAAC;AAE1E,SAAS,mBAAmB,CAAC,IAAY;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,iBAAiB,CAAC,GAAG,KAAK,CAAC,CAAC;AACrC,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,oCAAoC,CAAC,KAEpD;IACC,MAAM,KAAK,GAA4B,EAAE,CAAC;IAC1C,KAAK,MAAM,GAAG,IAAI,gCAAgC,EAAE,CAAC;QACnD,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,gBAAgB,CACvB,MAAsB,EACtB,KAA8B;IAE9B,IAAI,QAAQ,GAAG,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAClD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACxD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9C,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,IAAiB,EACjB,mBAA4C,EAAE;IAE9C,MAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,OAAO,IAAI,eAAe,CAAC;QACzB,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,WAAW;QACpB,aAAa,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;YACjC,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;YACtC,MAAM,gBAAgB,GAAG,oCAAoC,CAAC,KAAK,CAAC,CAAC;YACrE,OAAO,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QACzD,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -7,11 +7,11 @@ You are running in the following runtime environment:
|
|
|
7
7
|
- Shell: `{{ environment.shell }}`
|
|
8
8
|
- OS version: `{{ environment.osVersion }}`
|
|
9
9
|
- Is git repository: `{{ environment.isGitRepo }}`
|
|
10
|
-
- Current date/time: `{{ environment.currentDateTime }}`
|
|
11
10
|
- Time zone: `{{ environment.timeZone }}`
|
|
12
11
|
|
|
13
12
|
### How To Use This
|
|
14
13
|
|
|
15
14
|
- Use this information to choose correct path handling, shell syntax, and platform-specific behavior
|
|
16
15
|
- Treat this section as runtime context captured when the prompt was built
|
|
17
|
-
-
|
|
16
|
+
- For precise current date/time on each model call, use the injected `<now>...</now>` ISO timestamp
|
|
17
|
+
- Use `get_current_time` only when you need the current time in a specific timezone beyond the injected timestamp
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Please explore the current project directory and create or update `AGENTS.md` in the project root so it accurately explains this repository to AI coding agents.
|
|
2
|
+
|
|
3
|
+
Requirements:
|
|
4
|
+
|
|
5
|
+
1. Analyze the project structure and identify key configuration files such as `package.json`, `tsconfig.json`, `pyproject.toml`, `Cargo.toml`, and similar files when they exist.
|
|
6
|
+
2. Understand the technology stack, build process, runtime architecture, and major entrypoints.
|
|
7
|
+
3. Identify how the code is organized, including the main modules, packages, or feature areas.
|
|
8
|
+
4. Discover project-specific development conventions, testing strategies, verification commands, and deployment or release workflows when they are present.
|
|
9
|
+
5. Review any existing `AGENTS.md` content before changing it, preserve accurate guidance, remove stale claims, and improve the file in place instead of replacing useful information blindly.
|
|
10
|
+
|
|
11
|
+
Output requirements for `AGENTS.md`:
|
|
12
|
+
|
|
13
|
+
- Write only what you can verify from the repository.
|
|
14
|
+
- Use the main natural language already used by the project docs and comments.
|
|
15
|
+
- Keep it concise, practical, and easy for an agent to follow.
|
|
16
|
+
- Prefer concrete commands, paths, and conventions over generic advice.
|
|
17
|
+
|
|
18
|
+
Useful sections usually include:
|
|
19
|
+
|
|
20
|
+
- Project overview
|
|
21
|
+
- Repository layout
|
|
22
|
+
- Build and run commands
|
|
23
|
+
- Testing and verification
|
|
24
|
+
- Code style or implementation conventions
|
|
25
|
+
- Security or operational notes
|
|
@@ -1,125 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
Extract durable facts worth remembering across future conversations from a transcript.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use the `remember` tool once for each discrete fact worth saving.
|
|
4
|
+
Each tool call must match the full ExtractionResult shape: `content` plus optional `metadata`.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
### Scopes
|
|
12
|
-
|
|
13
|
-
- `user`: useful across many repositories/sessions for the same user.
|
|
14
|
-
- `project`: specific to the current repository or working directory.
|
|
15
|
-
- Rule of thumb:
|
|
16
|
-
- If it helps only this codebase/task flow -> `project`
|
|
17
|
-
- If it reflects stable personal preference/style/rule across projects -> `user`
|
|
18
|
-
|
|
19
|
-
### Types
|
|
20
|
-
|
|
21
|
-
- `fact`: stable concrete info
|
|
22
|
-
- `observation`: pattern noticed from recent work
|
|
23
|
-
- `preference`: how user wants things done
|
|
24
|
-
- `task`: ongoing objective or follow-up commitment
|
|
25
|
-
|
|
26
|
-
### Required Habit After Successful Work
|
|
27
|
-
|
|
28
|
-
After each successful, non-trivial turn, add one very concise `project` memory capturing:
|
|
29
|
-
|
|
30
|
-
- what was done
|
|
31
|
-
- how it was done
|
|
32
|
-
- why that approach was used
|
|
33
|
-
|
|
34
|
-
Keep this to 1-2 short sentences total.
|
|
35
|
-
|
|
36
|
-
If, during the same turn, you identify something broadly reusable across projects (preference, style, recurring rule, communication preference), also add a separate `user` memory.
|
|
37
|
-
|
|
38
|
-
### What To Store
|
|
39
|
-
|
|
40
|
-
Store only information that is likely to matter later:
|
|
41
|
-
|
|
42
|
-
- decisions, constraints, conventions, trade-offs
|
|
43
|
-
- user preferences that affect future behavior
|
|
44
|
-
- durable troubleshooting findings and known pitfalls
|
|
45
|
-
- active tasks/goals that may continue in later sessions
|
|
46
|
-
|
|
47
|
-
Do not store:
|
|
48
|
-
|
|
49
|
-
- transient one-off chatter
|
|
50
|
-
- data obvious from current files unless the decision/rationale matters
|
|
51
|
-
- duplicate entries with no new value
|
|
52
|
-
|
|
53
|
-
### How To Write `content`
|
|
54
|
-
|
|
55
|
-
Write retrieval-friendly content:
|
|
56
|
-
|
|
57
|
-
- concise and specific
|
|
58
|
-
- include key nouns (feature/module/file/tool)
|
|
59
|
-
- include outcome + rationale
|
|
60
|
-
- avoid fluff
|
|
61
|
-
|
|
62
|
-
Good pattern:
|
|
63
|
-
|
|
64
|
-
- `<Outcome>. <Method>. <Reason/constraint>.`
|
|
65
|
-
|
|
66
|
-
### `metadata` Usage
|
|
67
|
-
|
|
68
|
-
Use `metadata` as optional structured context (dictionary), for example:
|
|
69
|
-
|
|
70
|
-
- `files`: touched paths
|
|
71
|
-
- `decision`: short decision tag
|
|
72
|
-
- `reason`: main rationale
|
|
73
|
-
- `scope_hint`: optional discriminator
|
|
74
|
-
- `title`: short label (helps embeddings)
|
|
75
|
-
|
|
76
|
-
Prefer small, meaningful keys and values.
|
|
77
|
-
|
|
78
|
-
### When To Search
|
|
79
|
-
|
|
80
|
-
Use `memory_search` when prior context may matter:
|
|
81
|
-
|
|
82
|
-
- user says "continue", "as before", "same style", "like last time"
|
|
83
|
-
- implementation likely depends on earlier decisions
|
|
84
|
-
- personalization may affect response style or technical choices
|
|
85
|
-
|
|
86
|
-
Avoid broad fishing queries. Use targeted query strings and optional `types` filters.
|
|
87
|
-
|
|
88
|
-
### Examples
|
|
89
|
-
|
|
90
|
-
Project memory after successful turn:
|
|
91
|
-
|
|
92
|
-
- `memory_add`
|
|
93
|
-
- `scope`: `project`
|
|
94
|
-
- `type`: `fact`
|
|
95
|
-
- `content`: `Created a consistent scope strategy so project-specific context stays separated from broader user context. Updated the workflow guide to match the new memory commands and argument order. Chosen to improve retrieval precision and reduce accidental cross-context mixing.`
|
|
96
|
-
- `metadata`: `{ "title": "scope strategy update", "decision": "context-isolation" }`
|
|
97
|
-
|
|
98
|
-
User preference memory:
|
|
99
|
-
|
|
100
|
-
- `memory_add`
|
|
101
|
-
- `scope`: `user`
|
|
102
|
-
- `type`: `preference`
|
|
103
|
-
- `content`: `User prefers concise updates and practical, low-overhead solutions unless extra detail is requested.`
|
|
104
|
-
- `metadata`: `{ "title": "communication preference", "style": "concise" }`
|
|
105
|
-
|
|
106
|
-
Targeted search:
|
|
107
|
-
|
|
108
|
-
- `memory_search`
|
|
109
|
-
- `scope`: `project`
|
|
110
|
-
- `query`: `scope strategy archive behavior usage guidance`
|
|
111
|
-
- `types`: `[ "fact", "observation" ]`
|
|
112
|
-
- `k`: `5`
|
|
113
|
-
|
|
114
|
-
Archive obsolete memory:
|
|
115
|
-
|
|
116
|
-
- `memory_archive`
|
|
117
|
-
- `scope`: `project`
|
|
118
|
-
- `id`: `<memory-id>`
|
|
119
|
-
- `reason`: `Superseded by newer guidance and no longer reflects current behavior`
|
|
120
|
-
|
|
121
|
-
### Conflict Handling
|
|
122
|
-
|
|
123
|
-
- Current user message and current session context override memory.
|
|
124
|
-
- If memory conflicts with fresh instructions, follow fresh instructions.
|
|
125
|
-
- Archive stale/incorrect memory once confirmed.
|
|
6
|
+
Only save facts that are likely to be useful in a later conversation without rereading this transcript.
|
|
7
|
+
High-value memories include things like user preferences, standing requirements, recurring workflows, long-lived goals, stable project context, durable decisions, and constraints that should influence future behavior.
|
|
8
|
+
Low-value memories include things like transient chatter, one-off requests, intermediate reasoning, raw tool output, temporary diagnostics, and facts that were only useful for the current turn.
|
|
9
|
+
Prefer memories that will still matter later over details that were merely true during this exchange.
|
|
10
|
+
If nothing is worth saving, do not call the tool.
|
|
11
|
+
When you are done, respond briefly with `done`.
|
|
@@ -10,7 +10,7 @@ Call **`enter_plan_mode`** when the task is multi-step, ambiguous, or could caus
|
|
|
10
10
|
|
|
11
11
|
- You receive a **`plan_file`** path under the app plans directory. Expand it with **`read_file`**, **`write_file`**, and **`edit_file`** as needed (paths must stay within allowed locations).
|
|
12
12
|
- Prefer **`think`** or **`update_todos`** to organize reasoning; avoid shell and other tools not exposed in this phase.
|
|
13
|
-
- **`
|
|
13
|
+
- **`run_subagents`** is available: use it for **read-only** parallel exploration when splitting investigations helps (same discipline as subagents—narrow prompts, synthesize results yourself). Child agents are constrained like other tooling in this phase; you remain responsible for the plan document.
|
|
14
14
|
|
|
15
15
|
### Leaving plan mode
|
|
16
16
|
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
## Skills
|
|
2
2
|
|
|
3
|
-
You may have
|
|
3
|
+
You may have an `<available_skills>` section elsewhere in the system prompt listing skill names, descriptions, and optional `SKILL.md` locations. Use the `skills` tool to activate a skill and load its full instructions when needed.
|
|
4
4
|
|
|
5
5
|
### When to use a skill during this turn
|
|
6
6
|
|
|
7
7
|
- When the user's goal, stack, or workflow clearly matches a listed skill (same product, API, or task family), treat that skill as the preferred playbook before improvising.
|
|
8
|
-
- **Programming and implementation** (creating or changing source, tests, tooling config, dependencies, package manifests, installs, builds, or new scaffold directories): **before** your first implementation tool call in that task,
|
|
9
|
-
- When you are unsure but a skill
|
|
10
|
-
- Prefer
|
|
8
|
+
- **Programming and implementation** (creating or changing source, tests, tooling config, dependencies, package manifests, installs, builds, or new scaffold directories): **before** your first implementation tool call in that task, activate the built-in `hooman-coding` skill with the `skills` tool so you have its full instructions in context. Do **not** skip this because the task seems small, throwaway, or tutorial-sized.
|
|
9
|
+
- When you are unsure but a listed skill plausibly fits the task, activate it with the `skills` tool and skim the returned instructions; if it helps, follow it for the rest of the turn.
|
|
10
|
+
- Prefer using the `skills` tool over guessing conventions (naming, CLI flags, safety steps) that the skill is meant to encode.
|
|
11
11
|
- Do **not** load skills unrelated to the request. Other skills stay selective; **hooman-coding** is the exception for any implementation work as above.
|
|
12
12
|
|
|
13
13
|
### Coordination with tools
|
|
14
14
|
|
|
15
|
-
- Use
|
|
15
|
+
- Use the `skills` tool to load full instructions.
|
|
16
|
+
- Use **filesystem** tools to inspect a skill's `SKILL.md`, scripts, references, or assets only when the task specifically needs the underlying files.
|
|
16
17
|
- When the user wants to manage Hooman skills, use the built-in `hooman-skills` skill and edit `~/.hooman/skills` directly.
|
|
17
18
|
|
|
18
19
|
### Goal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
## Sub Agents
|
|
2
2
|
|
|
3
|
-
You can delegate specific work using the `
|
|
3
|
+
You can delegate specific work using the `run_subagents` tool.
|
|
4
4
|
|
|
5
5
|
Use this tool when delegation makes the response better:
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ Use delegation thoughtfully:
|
|
|
15
15
|
- Prefer concise descriptions that state the expected output.
|
|
16
16
|
- Run only as many jobs as needed for quality and speed.
|
|
17
17
|
|
|
18
|
-
Do not use `
|
|
18
|
+
Do not use `run_subagents` when:
|
|
19
19
|
|
|
20
20
|
- The task is simple and can be handled directly.
|
|
21
21
|
- The work is tightly coupled and cannot be split cleanly.
|
|
@@ -26,7 +26,8 @@ Do not invent provider-specific parameters.
|
|
|
26
26
|
- Keep `query` focused on the topic, entity, source, and search operators.
|
|
27
27
|
- Do not add specific dates, months, or years to `query` for recency unless the user explicitly asked for that date/month/year or it is essential to disambiguate the topic.
|
|
28
28
|
- For "latest", "recent", "today", "this week", "this month", or other relative-time requests, use `freshness` or `start_date` + `end_date` instead of adding date words to `query`.
|
|
29
|
-
- Use the
|
|
29
|
+
- Use the injected `<now>...</now>` ISO timestamp when interpreting relative dates.
|
|
30
|
+
- Use `get_current_time` only if you need current time in a specific timezone before choosing `freshness` or date ranges.
|
|
30
31
|
|
|
31
32
|
### Examples
|
|
32
33
|
|