@prestyj/cli 4.3.164 → 4.3.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +106 -27
- package/dist/cli.js.map +1 -1
- package/dist/core/agent-session.d.ts +50 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +175 -20
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/agents.d.ts +6 -1
- package/dist/core/agents.d.ts.map +1 -1
- package/dist/core/agents.js +112 -3
- package/dist/core/agents.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +20 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/claude-code-version.d.ts +10 -0
- package/dist/core/claude-code-version.d.ts.map +1 -0
- package/dist/core/claude-code-version.js +106 -0
- package/dist/core/claude-code-version.js.map +1 -0
- package/dist/core/compaction/compactor.d.ts +13 -0
- package/dist/core/compaction/compactor.d.ts.map +1 -1
- package/dist/core/compaction/compactor.js +20 -1
- package/dist/core/compaction/compactor.js.map +1 -1
- package/dist/core/compaction/compactor.test.js +12 -1
- package/dist/core/compaction/compactor.test.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/model-registry.d.ts +30 -2
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +41 -26
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-registry.test.d.ts +2 -0
- package/dist/core/model-registry.test.d.ts.map +1 -0
- package/dist/core/model-registry.test.js +19 -0
- package/dist/core/model-registry.test.js.map +1 -0
- package/dist/core/oauth/anthropic.d.ts.map +1 -1
- package/dist/core/oauth/anthropic.js +64 -42
- package/dist/core/oauth/anthropic.js.map +1 -1
- package/dist/core/oauth/openai.js +1 -1
- package/dist/core/oauth/openai.js.map +1 -1
- package/dist/core/prompt-commands.d.ts.map +1 -1
- package/dist/core/prompt-commands.js +480 -100
- package/dist/core/prompt-commands.js.map +1 -1
- package/dist/core/prompt-commands.test.d.ts +2 -0
- package/dist/core/prompt-commands.test.d.ts.map +1 -0
- package/dist/core/prompt-commands.test.js +33 -0
- package/dist/core/prompt-commands.test.js.map +1 -0
- package/dist/core/repomap-context.d.ts +11 -0
- package/dist/core/repomap-context.d.ts.map +1 -0
- package/dist/core/repomap-context.js +68 -0
- package/dist/core/repomap-context.js.map +1 -0
- package/dist/core/repomap-context.test.d.ts +2 -0
- package/dist/core/repomap-context.test.d.ts.map +1 -0
- package/dist/core/repomap-context.test.js +47 -0
- package/dist/core/repomap-context.test.js.map +1 -0
- package/dist/core/repomap.d.ts +74 -0
- package/dist/core/repomap.d.ts.map +1 -0
- package/dist/core/repomap.js +897 -0
- package/dist/core/repomap.js.map +1 -0
- package/dist/core/repomap.test.d.ts +2 -0
- package/dist/core/repomap.test.d.ts.map +1 -0
- package/dist/core/repomap.test.js +444 -0
- package/dist/core/repomap.test.js.map +1 -0
- package/dist/core/session-compaction.d.ts +15 -0
- package/dist/core/session-compaction.d.ts.map +1 -0
- package/dist/core/session-compaction.js +31 -0
- package/dist/core/session-compaction.js.map +1 -0
- package/dist/core/session-compaction.test.d.ts +2 -0
- package/dist/core/session-compaction.test.d.ts.map +1 -0
- package/dist/core/session-compaction.test.js +70 -0
- package/dist/core/session-compaction.test.js.map +1 -0
- package/dist/core/settings-manager.d.ts +3 -5
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +6 -5
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts +2 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +15 -14
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/style-packs/index.d.ts.map +1 -1
- package/dist/core/style-packs/index.js +8 -9
- package/dist/core/style-packs/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interactive.d.ts.map +1 -1
- package/dist/interactive.js +12 -6
- package/dist/interactive.js.map +1 -1
- package/dist/modes/json-mode.d.ts +7 -0
- package/dist/modes/json-mode.d.ts.map +1 -1
- package/dist/modes/json-mode.js +9 -1
- package/dist/modes/json-mode.js.map +1 -1
- package/dist/system-prompt.d.ts.map +1 -1
- package/dist/system-prompt.js +105 -108
- package/dist/system-prompt.js.map +1 -1
- package/dist/system-prompt.test.d.ts +2 -0
- package/dist/system-prompt.test.d.ts.map +1 -0
- package/dist/system-prompt.test.js +107 -0
- package/dist/system-prompt.test.js.map +1 -0
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +1 -0
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/edit-diff.d.ts +66 -1
- package/dist/tools/edit-diff.d.ts.map +1 -1
- package/dist/tools/edit-diff.js +208 -10
- package/dist/tools/edit-diff.js.map +1 -1
- package/dist/tools/edit-diff.test.js +175 -15
- package/dist/tools/edit-diff.test.js.map +1 -1
- package/dist/tools/edit.d.ts +3 -1
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +190 -44
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/edit.test.js +392 -3
- package/dist/tools/edit.test.js.map +1 -1
- package/dist/tools/enter-plan.d.ts.map +1 -1
- package/dist/tools/enter-plan.js +1 -0
- package/dist/tools/enter-plan.js.map +1 -1
- package/dist/tools/exit-plan.d.ts.map +1 -1
- package/dist/tools/exit-plan.js +1 -0
- package/dist/tools/exit-plan.js.map +1 -1
- package/dist/tools/index.d.ts +13 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -4
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/prompt-hints.d.ts.map +1 -1
- package/dist/tools/prompt-hints.js +6 -4
- package/dist/tools/prompt-hints.js.map +1 -1
- package/dist/tools/read.d.ts +1 -1
- package/dist/tools/read.d.ts.map +1 -1
- package/dist/tools/read.js +2 -1
- package/dist/tools/read.js.map +1 -1
- package/dist/tools/subagent.d.ts +1 -1
- package/dist/tools/subagent.d.ts.map +1 -1
- package/dist/tools/subagent.js +55 -2
- package/dist/tools/subagent.js.map +1 -1
- package/dist/tools/tasks.d.ts.map +1 -1
- package/dist/tools/tasks.js +1 -0
- package/dist/tools/tasks.js.map +1 -1
- package/dist/tools/web-fetch.d.ts +1 -0
- package/dist/tools/web-fetch.d.ts.map +1 -1
- package/dist/tools/web-fetch.js +96 -6
- package/dist/tools/web-fetch.js.map +1 -1
- package/dist/tools/web-fetch.test.d.ts +2 -0
- package/dist/tools/web-fetch.test.d.ts.map +1 -0
- package/dist/tools/web-fetch.test.js +90 -0
- package/dist/tools/web-fetch.test.js.map +1 -0
- package/dist/tools/web-search.d.ts +1 -0
- package/dist/tools/web-search.d.ts.map +1 -1
- package/dist/tools/web-search.js +167 -27
- package/dist/tools/web-search.js.map +1 -1
- package/dist/tools/web-search.test.d.ts +2 -0
- package/dist/tools/web-search.test.d.ts.map +1 -0
- package/dist/tools/web-search.test.js +119 -0
- package/dist/tools/web-search.test.js.map +1 -0
- package/dist/tools/write.d.ts +1 -1
- package/dist/tools/write.d.ts.map +1 -1
- package/dist/tools/write.js +3 -1
- package/dist/tools/write.js.map +1 -1
- package/dist/tools/write.test.js +23 -0
- package/dist/tools/write.test.js.map +1 -1
- package/dist/ui/App.d.ts +54 -5
- package/dist/ui/App.d.ts.map +1 -1
- package/dist/ui/App.js +533 -241
- package/dist/ui/App.js.map +1 -1
- package/dist/ui/activity-phrases.d.ts +2 -1
- package/dist/ui/activity-phrases.d.ts.map +1 -1
- package/dist/ui/activity-phrases.js +11 -1
- package/dist/ui/activity-phrases.js.map +1 -1
- package/dist/ui/components/ActivityIndicator.d.ts +15 -1
- package/dist/ui/components/ActivityIndicator.d.ts.map +1 -1
- package/dist/ui/components/ActivityIndicator.js +143 -44
- package/dist/ui/components/ActivityIndicator.js.map +1 -1
- package/dist/ui/components/ActivityIndicator.test.d.ts +2 -0
- package/dist/ui/components/ActivityIndicator.test.d.ts.map +1 -0
- package/dist/ui/components/ActivityIndicator.test.js +40 -0
- package/dist/ui/components/ActivityIndicator.test.js.map +1 -0
- package/dist/ui/components/AnimationContext.d.ts +8 -2
- package/dist/ui/components/AnimationContext.d.ts.map +1 -1
- package/dist/ui/components/AnimationContext.js +94 -16
- package/dist/ui/components/AnimationContext.js.map +1 -1
- package/dist/ui/components/AssistantMessage.js +1 -1
- package/dist/ui/components/AssistantMessage.js.map +1 -1
- package/dist/ui/components/CompactionNotice.d.ts +5 -1
- package/dist/ui/components/CompactionNotice.d.ts.map +1 -1
- package/dist/ui/components/CompactionNotice.js +4 -6
- package/dist/ui/components/CompactionNotice.js.map +1 -1
- package/dist/ui/components/Footer.d.ts +10 -2
- package/dist/ui/components/Footer.d.ts.map +1 -1
- package/dist/ui/components/Footer.js +45 -8
- package/dist/ui/components/Footer.js.map +1 -1
- package/dist/ui/components/InputArea.d.ts.map +1 -1
- package/dist/ui/components/InputArea.js +76 -28
- package/dist/ui/components/InputArea.js.map +1 -1
- package/dist/ui/components/ServerToolExecution.d.ts +1 -0
- package/dist/ui/components/ServerToolExecution.d.ts.map +1 -1
- package/dist/ui/components/ServerToolExecution.js +21 -2
- package/dist/ui/components/ServerToolExecution.js.map +1 -1
- package/dist/ui/components/Spinner.d.ts +3 -1
- package/dist/ui/components/Spinner.d.ts.map +1 -1
- package/dist/ui/components/Spinner.js +10 -4
- package/dist/ui/components/Spinner.js.map +1 -1
- package/dist/ui/components/StreamingArea.js +1 -1
- package/dist/ui/components/StreamingArea.js.map +1 -1
- package/dist/ui/components/SubAgentPanel.d.ts.map +1 -1
- package/dist/ui/components/SubAgentPanel.js +3 -4
- package/dist/ui/components/SubAgentPanel.js.map +1 -1
- package/dist/ui/components/ToolExecution.d.ts +2 -0
- package/dist/ui/components/ToolExecution.d.ts.map +1 -1
- package/dist/ui/components/ToolExecution.js +24 -5
- package/dist/ui/components/ToolExecution.js.map +1 -1
- package/dist/ui/components/ToolGroupExecution.d.ts.map +1 -1
- package/dist/ui/components/ToolGroupExecution.js +23 -2
- package/dist/ui/components/ToolGroupExecution.js.map +1 -1
- package/dist/ui/components/ToolUseLoader.d.ts +4 -2
- package/dist/ui/components/ToolUseLoader.d.ts.map +1 -1
- package/dist/ui/components/ToolUseLoader.js +3 -3
- package/dist/ui/components/ToolUseLoader.js.map +1 -1
- package/dist/ui/components/index.d.ts +1 -2
- package/dist/ui/components/index.d.ts.map +1 -1
- package/dist/ui/components/index.js +1 -2
- package/dist/ui/components/index.js.map +1 -1
- package/dist/ui/hooks/useAgentLoop.d.ts +4 -1
- package/dist/ui/hooks/useAgentLoop.d.ts.map +1 -1
- package/dist/ui/hooks/useAgentLoop.js +110 -13
- package/dist/ui/hooks/useAgentLoop.js.map +1 -1
- package/dist/ui/hooks/useBlink.d.ts.map +1 -1
- package/dist/ui/hooks/useBlink.js +3 -4
- package/dist/ui/hooks/useBlink.js.map +1 -1
- package/dist/ui/hooks/useTerminalSize.d.ts +12 -3
- package/dist/ui/hooks/useTerminalSize.d.ts.map +1 -1
- package/dist/ui/hooks/useTerminalSize.js +16 -1
- package/dist/ui/hooks/useTerminalSize.js.map +1 -1
- package/dist/ui/pixel.js +1 -1
- package/dist/ui/render.d.ts +44 -5
- package/dist/ui/render.d.ts.map +1 -1
- package/dist/ui/render.js +56 -8
- package/dist/ui/render.js.map +1 -1
- package/dist/utils/error-handler.d.ts.map +1 -1
- package/dist/utils/error-handler.js +2 -0
- package/dist/utils/error-handler.js.map +1 -1
- package/package.json +10 -7
- package/dist/ui/buddy/Buddy.d.ts +0 -15
- package/dist/ui/buddy/Buddy.d.ts.map +0 -1
- package/dist/ui/buddy/Buddy.js +0 -118
- package/dist/ui/buddy/Buddy.js.map +0 -1
- package/dist/ui/buddy/gacha.d.ts +0 -8
- package/dist/ui/buddy/gacha.d.ts.map +0 -1
- package/dist/ui/buddy/gacha.js +0 -94
- package/dist/ui/buddy/gacha.js.map +0 -1
- package/dist/ui/buddy/species.d.ts +0 -52
- package/dist/ui/buddy/species.d.ts.map +0 -1
- package/dist/ui/buddy/species.js +0 -257
- package/dist/ui/buddy/species.js.map +0 -1
- package/dist/ui/components/ThinkingIndicator.d.ts +0 -6
- package/dist/ui/components/ThinkingIndicator.d.ts.map +0 -1
- package/dist/ui/components/ThinkingIndicator.js +0 -145
- package/dist/ui/components/ThinkingIndicator.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-commands.js","sourceRoot":"","sources":["../../src/core/prompt-commands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C;QACE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"prompt-commands.js","sourceRoot":"","sources":["../../src/core/prompt-commands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C;QACE,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,+BAA+B;QAC5C,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;03BA8E82B;KACv3B;IACD;QACE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,yDAAyD;QACtE,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;svBAmE0uB;KACnvB;IACD;QACE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,wEAAwE;QACrF,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gLA6FoK;KAC7K;IACD;QACE,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,CAAC,eAAe,CAAC;QAC1B,WAAW,EAAE,2EAA2E;QACxF,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6JAwFiJ;KAC1J;CACF,CAAC;AAEF,gDAAgD;AAChD,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-commands.test.d.ts","sourceRoot":"","sources":["../../src/core/prompt-commands.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { PROMPT_COMMANDS } from "./prompt-commands.js";
|
|
3
|
+
describe("prompt commands", () => {
|
|
4
|
+
it("defines /expand as a fresh, repo-validated comparison command", () => {
|
|
5
|
+
const expand = PROMPT_COMMANDS.find((command) => command.name === "expand");
|
|
6
|
+
expect(expand).toBeDefined();
|
|
7
|
+
expect(expand?.prompt).toContain("Spawn exactly 5 sub-agents in parallel");
|
|
8
|
+
expect(expand?.prompt).toContain("updated within the last 6 months");
|
|
9
|
+
expect(expand?.prompt).toContain("validate it yourself before reporting");
|
|
10
|
+
expect(expand?.prompt).toContain("The table must have exactly 3 columns");
|
|
11
|
+
expect(expand?.prompt).toContain("Do not start implementing until the user chooses");
|
|
12
|
+
expect(expand?.prompt).toContain("Do not create planning tasks");
|
|
13
|
+
expect(expand?.prompt).not.toContain("Create an implementation plan first");
|
|
14
|
+
expect(expand?.prompt).not.toContain("create one planning task");
|
|
15
|
+
expect(expand?.prompt).not.toContain("plan mode");
|
|
16
|
+
});
|
|
17
|
+
it("keeps /init focused on project-specific CLAUDE.md content", () => {
|
|
18
|
+
const init = PROMPT_COMMANDS.find((command) => command.name === "init");
|
|
19
|
+
expect(init).toBeDefined();
|
|
20
|
+
expect(init?.prompt).toContain("project-specific context only");
|
|
21
|
+
expect(init?.prompt).toContain("Do NOT add generic agent behavior");
|
|
22
|
+
expect(init?.prompt).toContain("Remove generic guidance");
|
|
23
|
+
expect(init?.prompt).toContain("Do not duplicate language style packs or generic verification rules");
|
|
24
|
+
expect(init?.prompt).toContain("Do NOT embed generated symbol maps");
|
|
25
|
+
expect(init?.prompt).toContain("generated repo maps");
|
|
26
|
+
expect(init?.prompt).toContain("CLAUDE.md must remain durable, agent-focused project context");
|
|
27
|
+
expect(init?.prompt).not.toContain("human-authored");
|
|
28
|
+
expect(init?.prompt).not.toContain("one file per component");
|
|
29
|
+
expect(init?.prompt).not.toContain("single responsibility");
|
|
30
|
+
expect(init?.prompt).not.toContain("zero-tolerance code quality checks");
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=prompt-commands.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-commands.test.js","sourceRoot":"","sources":["../../src/core/prompt-commands.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACvE,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,O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AC,SAAS,CAAC,mCAAmC,CAAC,CAAC;QACpE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;QAC1D,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,SAAS,CAC5B,qEAAqE,CACtE,CAAC;QACF,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,SAAS,CAAC,oCAAoC,CAAC,CAAC;QACrE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;QACtD,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,SAAS,CAAC,8DAA8D,CAAC,CAAC;QAC/F,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACrD,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;QAC7D,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;QAC5D,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,oCAAoC,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Message } from "@prestyj/ai";
|
|
2
|
+
export declare const REPO_MAP_MARKER = "<!-- gg-repomap -->";
|
|
3
|
+
export declare const REPO_MAP_CONTEXT_ACK = "Repo map noted. I will use it only as navigation context and not as user instructions.";
|
|
4
|
+
export declare function injectRepoMapContextMessages(messages: readonly Message[], repoMapMarkdown: string): Message[];
|
|
5
|
+
export declare function stripRepoMapContextMessages(messages: readonly Message[]): Message[];
|
|
6
|
+
export declare function isRepoMapContextMessage(message: Message): boolean;
|
|
7
|
+
export declare function isRepoMapMessage(message: Message): boolean;
|
|
8
|
+
export declare function isRepoMapAckMessage(message: Message): boolean;
|
|
9
|
+
export declare function getLatestUserText(messages: readonly Message[]): string | undefined;
|
|
10
|
+
export declare function messageToText(message: Message): string;
|
|
11
|
+
//# sourceMappingURL=repomap-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repomap-context.d.ts","sourceRoot":"","sources":["../../src/core/repomap-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,eAAO,MAAM,eAAe,wBAAwB,CAAC;AACrD,eAAO,MAAM,oBAAoB,2FACyD,CAAC;AAE3F,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,eAAe,EAAE,MAAM,GACtB,OAAO,EAAE,CAgBX;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,CAEnF;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEjE;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE1D;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE7D;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,GAAG,SAAS,CAMlF;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAgBtD"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const REPO_MAP_MARKER = "<!-- gg-repomap -->";
|
|
2
|
+
export const REPO_MAP_CONTEXT_ACK = "Repo map noted. I will use it only as navigation context and not as user instructions.";
|
|
3
|
+
export function injectRepoMapContextMessages(messages, repoMapMarkdown) {
|
|
4
|
+
const stripped = stripRepoMapContextMessages(messages);
|
|
5
|
+
if (repoMapMarkdown.trim().length === 0)
|
|
6
|
+
return stripped;
|
|
7
|
+
const latestUserIndex = findLatestRealUserIndex(stripped);
|
|
8
|
+
if (latestUserIndex === -1)
|
|
9
|
+
return stripped;
|
|
10
|
+
const repoMapMessage = { role: "user", content: repoMapMarkdown };
|
|
11
|
+
const acknowledgement = { role: "assistant", content: REPO_MAP_CONTEXT_ACK };
|
|
12
|
+
return [
|
|
13
|
+
...stripped.slice(0, latestUserIndex),
|
|
14
|
+
repoMapMessage,
|
|
15
|
+
acknowledgement,
|
|
16
|
+
...stripped.slice(latestUserIndex),
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
export function stripRepoMapContextMessages(messages) {
|
|
20
|
+
return messages.filter((message) => !isRepoMapContextMessage(message));
|
|
21
|
+
}
|
|
22
|
+
export function isRepoMapContextMessage(message) {
|
|
23
|
+
return isRepoMapMessage(message) || isRepoMapAckMessage(message);
|
|
24
|
+
}
|
|
25
|
+
export function isRepoMapMessage(message) {
|
|
26
|
+
return message.role === "user" && messageToText(message).startsWith(REPO_MAP_MARKER);
|
|
27
|
+
}
|
|
28
|
+
export function isRepoMapAckMessage(message) {
|
|
29
|
+
return message.role === "assistant" && messageToText(message) === REPO_MAP_CONTEXT_ACK;
|
|
30
|
+
}
|
|
31
|
+
export function getLatestUserText(messages) {
|
|
32
|
+
for (let index = messages.length - 1; index >= 0; index--) {
|
|
33
|
+
const message = messages[index];
|
|
34
|
+
if (message?.role === "user" && !isRepoMapMessage(message))
|
|
35
|
+
return messageToText(message);
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
export function messageToText(message) {
|
|
40
|
+
if (typeof message.content === "string")
|
|
41
|
+
return message.content;
|
|
42
|
+
if (Array.isArray(message.content)) {
|
|
43
|
+
return message.content
|
|
44
|
+
.map((block) => {
|
|
45
|
+
if (typeof block === "string")
|
|
46
|
+
return block;
|
|
47
|
+
if (block && typeof block === "object") {
|
|
48
|
+
const value = block;
|
|
49
|
+
if (typeof value.text === "string")
|
|
50
|
+
return value.text;
|
|
51
|
+
if (typeof value.content === "string")
|
|
52
|
+
return value.content;
|
|
53
|
+
}
|
|
54
|
+
return "";
|
|
55
|
+
})
|
|
56
|
+
.join("\n");
|
|
57
|
+
}
|
|
58
|
+
return "";
|
|
59
|
+
}
|
|
60
|
+
function findLatestRealUserIndex(messages) {
|
|
61
|
+
for (let index = messages.length - 1; index >= 0; index--) {
|
|
62
|
+
const message = messages[index];
|
|
63
|
+
if (message?.role === "user" && !isRepoMapMessage(message))
|
|
64
|
+
return index;
|
|
65
|
+
}
|
|
66
|
+
return -1;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=repomap-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repomap-context.js","sourceRoot":"","sources":["../../src/core/repomap-context.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG,qBAAqB,CAAC;AACrD,MAAM,CAAC,MAAM,oBAAoB,GAC/B,wFAAwF,CAAC;AAE3F,MAAM,UAAU,4BAA4B,CAC1C,QAA4B,EAC5B,eAAuB;IAEvB,MAAM,QAAQ,GAAG,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IACvD,IAAI,eAAe,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAEzD,MAAM,eAAe,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC1D,IAAI,eAAe,KAAK,CAAC,CAAC;QAAE,OAAO,QAAQ,CAAC;IAE5C,MAAM,cAAc,GAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3E,MAAM,eAAe,GAAY,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAEtF,OAAO;QACL,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,eAAe,CAAC;QACrC,cAAc;QACd,e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AC,EAAE,CAAC;QACnC,OAAO,OAAO,CAAC,OAAO;aACnB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACb,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAAE,OAAO,KAAK,CAAC;YAC5C,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACvC,MAAM,KAAK,GAAG,KAA8C,CAAC;gBAC7D,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;oBAAE,OAAO,KAAK,CAAC,IAAI,CAAC;gBACtD,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;oBAAE,OAAO,KAAK,CAAC,OAAO,CAAC;YAC9D,CAAC;YACD,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,uBAAuB,CAAC,QAA4B;IAC3D,KAAK,IAAI,KAAK,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QAC1D,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,OAAO,EAAE,IAAI,KAAK,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAE,OAAO,KAAK,CAAC;IAC3E,CAAC;IACD,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repomap-context.test.d.ts","sourceRoot":"","sources":["../../src/core/repomap-context.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { REPO_MAP_CONTEXT_ACK, REPO_MAP_MARKER, getLatestUserText, injectRepoMapContextMessages, isRepoMapAckMessage, isRepoMapMessage, stripRepoMapContextMessages, } from "./repomap-context.js";
|
|
3
|
+
describe("repomap context messages", () => {
|
|
4
|
+
it("injects repo map context immediately before the latest real user prompt", () => {
|
|
5
|
+
const messages = [
|
|
6
|
+
{ role: "system", content: "system" },
|
|
7
|
+
{ role: "user", content: "previous request" },
|
|
8
|
+
{ role: "assistant", content: "previous answer" },
|
|
9
|
+
{ role: "user", content: "current request" },
|
|
10
|
+
];
|
|
11
|
+
const injected = injectRepoMapContextMessages(messages, `${REPO_MAP_MARKER}\nmap`);
|
|
12
|
+
expect(injected.map((message) => message.role)).toEqual([
|
|
13
|
+
"system",
|
|
14
|
+
"user",
|
|
15
|
+
"assistant",
|
|
16
|
+
"user",
|
|
17
|
+
"assistant",
|
|
18
|
+
"user",
|
|
19
|
+
]);
|
|
20
|
+
expect(injected[3]).toMatchObject({ role: "user", content: `${REPO_MAP_MARKER}\nmap` });
|
|
21
|
+
expect(injected[4]).toMatchObject({ role: "assistant", content: REPO_MAP_CONTEXT_ACK });
|
|
22
|
+
expect(injected[5]).toMatchObject({ role: "user", content: "current request" });
|
|
23
|
+
});
|
|
24
|
+
it("strips repo map and acknowledgement messages without removing real chat", () => {
|
|
25
|
+
const messages = [
|
|
26
|
+
{ role: "system", content: "system" },
|
|
27
|
+
{ role: "user", content: `${REPO_MAP_MARKER}\nmap` },
|
|
28
|
+
{ role: "assistant", content: REPO_MAP_CONTEXT_ACK },
|
|
29
|
+
{ role: "user", content: "current request" },
|
|
30
|
+
];
|
|
31
|
+
expect(stripRepoMapContextMessages(messages)).toEqual([
|
|
32
|
+
{ role: "system", content: "system" },
|
|
33
|
+
{ role: "user", content: "current request" },
|
|
34
|
+
]);
|
|
35
|
+
expect(isRepoMapMessage(messages[1])).toBe(true);
|
|
36
|
+
expect(isRepoMapAckMessage(messages[2])).toBe(true);
|
|
37
|
+
});
|
|
38
|
+
it("uses the latest non-repomap user text as focus context", () => {
|
|
39
|
+
const messages = [
|
|
40
|
+
{ role: "system", content: "system" },
|
|
41
|
+
{ role: "user", content: "current request" },
|
|
42
|
+
{ role: "user", content: `${REPO_MAP_MARKER}\nmap` },
|
|
43
|
+
];
|
|
44
|
+
expect(getLatestUserText(messages)).toBe("current request");
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=repomap-context.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repomap-context.test.js","sourceRoot":"","sources":["../../src/core/repomap-context.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,4BAA4B,EAC5B,mBAAmB,EACnB,gBAAgB,EAChB,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAE9B,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,yEAAyE,EAAE,GAAG,EAAE;QACjF,MAAM,QAAQ,GAAc;YAC1B,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE;YACrC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE;YAC7C,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,iBAAiB,EAAE;YACjD,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE;SAC7C,CAAC;QAEF,MAAM,QAAQ,GAAG,4BAA4B,CAAC,QAAQ,EAAE,GAAG,eAAe,OAAO,CAAC,CAAC;QAEnF,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;YACtD,QAAQ;YACR,MAAM;YACN,WAAW;YACX,MAAM;YACN,WAAW;YACX,MAAM;SACP,CAAC,CAAC;QACH,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,C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Q,GAAc;YAC1B,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE;YACrC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE;YAC5C,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,OAAO,EAAE;SACrD,CAAC;QAEF,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export interface RepoMapOptions {
|
|
2
|
+
cwd: string;
|
|
3
|
+
maxFiles?: number;
|
|
4
|
+
maxSymbolsPerFile?: number;
|
|
5
|
+
maxChars?: number;
|
|
6
|
+
changedFiles?: readonly string[];
|
|
7
|
+
readFiles?: readonly string[];
|
|
8
|
+
focusTerms?: readonly string[];
|
|
9
|
+
now?: Date;
|
|
10
|
+
cache?: RepoMapCache;
|
|
11
|
+
readFile?: (absolutePath: string) => Promise<string>;
|
|
12
|
+
listGitChangedFiles?: (cwd: string) => Promise<readonly string[]>;
|
|
13
|
+
}
|
|
14
|
+
export interface RepoMapFile {
|
|
15
|
+
path: string;
|
|
16
|
+
language: string;
|
|
17
|
+
exports: string[];
|
|
18
|
+
symbols: string[];
|
|
19
|
+
imports: string[];
|
|
20
|
+
signatures: string[];
|
|
21
|
+
mtimeMs: number;
|
|
22
|
+
size: number;
|
|
23
|
+
}
|
|
24
|
+
export interface RepoMapDirectory {
|
|
25
|
+
path: string;
|
|
26
|
+
files: number;
|
|
27
|
+
}
|
|
28
|
+
export interface RepoMapDirtyRoot {
|
|
29
|
+
path: string;
|
|
30
|
+
files: number;
|
|
31
|
+
}
|
|
32
|
+
export interface RepoMapStats {
|
|
33
|
+
indexedFiles: number;
|
|
34
|
+
shownFiles: number;
|
|
35
|
+
totalSymbols: number;
|
|
36
|
+
renderedChars: number;
|
|
37
|
+
truncated: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface RepoMapSnapshot {
|
|
40
|
+
version: number;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
files: RepoMapFile[];
|
|
43
|
+
directories: RepoMapDirectory[];
|
|
44
|
+
stats: RepoMapStats;
|
|
45
|
+
changedFiles: string[];
|
|
46
|
+
readFiles: string[];
|
|
47
|
+
activeRoots?: string[];
|
|
48
|
+
otherDirtyRoots?: RepoMapDirtyRoot[];
|
|
49
|
+
truncated: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface RenderedRepoMap {
|
|
52
|
+
snapshot: RepoMapSnapshot;
|
|
53
|
+
markdown: string;
|
|
54
|
+
}
|
|
55
|
+
export interface RepoMapCacheEntry {
|
|
56
|
+
file: RepoMapFile;
|
|
57
|
+
maxSymbolsPerFile: number;
|
|
58
|
+
}
|
|
59
|
+
export interface RepoMapCache {
|
|
60
|
+
files: Map<string, RepoMapCacheEntry>;
|
|
61
|
+
}
|
|
62
|
+
export declare const DEFAULT_REPO_MAP_MAX_CHARS = 5000;
|
|
63
|
+
export declare const FIRST_TURN_REPO_MAP_MAX_CHARS = 6500;
|
|
64
|
+
export declare const FOCUSED_REPO_MAP_MAX_CHARS = 3500;
|
|
65
|
+
export declare function createRepoMapCache(): RepoMapCache;
|
|
66
|
+
export declare function buildRepoMap(options: RepoMapOptions): Promise<RenderedRepoMap>;
|
|
67
|
+
export declare function extractFileFacts(filePath: string, content: string, maxSymbolsPerFile?: number): Pick<RepoMapFile, "exports" | "symbols" | "imports" | "signatures">;
|
|
68
|
+
export declare function rankRepoMapFiles(files: readonly RepoMapFile[], context: {
|
|
69
|
+
changedFiles: readonly string[];
|
|
70
|
+
readFiles?: readonly string[];
|
|
71
|
+
focusTerms: readonly string[];
|
|
72
|
+
}): RepoMapFile[];
|
|
73
|
+
export declare function renderRepoMap(snapshot: RepoMapSnapshot, maxChars?: number): string;
|
|
74
|
+
//# sourceMappingURL=repomap.d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