@oh-my-pi/pi-coding-agent 17.2.13 → 17.2.15
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/CHANGELOG.md +30 -0
- package/dist/{CHANGELOG-d8xh7keh.md → CHANGELOG-fk29zh06.md} +30 -0
- package/dist/cli.js +5114 -5417
- package/dist/types/cleanse/agent.d.ts +3 -0
- package/dist/types/cleanse/checkers.d.ts +21 -1
- package/dist/types/cleanse/index.d.ts +4 -0
- package/dist/types/cleanse/parsers.d.ts +3 -1
- package/dist/types/cli/args.d.ts +1 -0
- package/dist/types/cli/cleanse-picker.d.ts +17 -0
- package/dist/types/cli/command-help.d.ts +3 -0
- package/dist/types/cli/progress-reporter.d.ts +19 -0
- package/dist/types/commands/cleanse.d.ts +11 -0
- package/dist/types/commands/compress.d.ts +37 -0
- package/dist/types/commands/launch-help.d.ts +3 -0
- package/dist/types/commands/launch.d.ts +3 -0
- package/dist/types/compress/index.d.ts +27 -0
- package/dist/types/compress/protocol.d.ts +49 -0
- package/dist/types/compress/session.d.ts +15 -0
- package/dist/types/compress/types.d.ts +54 -0
- package/dist/types/config/settings-schema.d.ts +10 -0
- package/dist/types/internal-urls/local-protocol.d.ts +8 -0
- package/dist/types/mcp/transports/header-policy.d.ts +8 -0
- package/dist/types/mcp/transports/http.d.ts +2 -0
- package/dist/types/mcp/types.d.ts +19 -0
- package/dist/types/modes/components/late-diagnostics-message.d.ts +2 -0
- package/dist/types/modes/components/todo-reminder.d.ts +2 -0
- package/dist/types/modes/components/tool-activity.d.ts +17 -0
- package/dist/types/modes/components/transcript-container.d.ts +2 -0
- package/dist/types/modes/components/ttsr-notification.d.ts +2 -0
- package/dist/types/modes/interactive-mode.d.ts +3 -1
- package/dist/types/modes/types.d.ts +3 -1
- package/dist/types/modes/utils/transcript-render-helpers.d.ts +2 -1
- package/dist/types/modes/utils/ui-helpers.d.ts +3 -1
- package/dist/types/session/agent-session-types.d.ts +2 -0
- package/dist/types/session/agent-session.d.ts +2 -0
- package/dist/types/session/session-tools.d.ts +13 -0
- package/dist/types/tools/builtin-names.d.ts +1 -2
- package/dist/types/tools/index.d.ts +1 -0
- package/dist/types/tools/think.d.ts +41 -0
- package/dist/types/utils/zip.d.ts +19 -9
- package/package.json +13 -13
- package/src/cleanse/agent.ts +67 -2
- package/src/cleanse/checkers.ts +252 -21
- package/src/cleanse/index.ts +90 -36
- package/src/cleanse/parsers.ts +243 -20
- package/src/cleanse/prompts/discovery.md +74 -0
- package/src/cli/args.ts +3 -0
- package/src/cli/cleanse-picker.ts +86 -0
- package/src/cli/command-help.ts +4 -0
- package/src/cli/flag-tables.ts +1 -0
- package/src/cli/gallery-fixtures/agentic.ts +16 -0
- package/src/{cleanse/progress.ts → cli/progress-reporter.ts} +12 -7
- package/src/cli-commands.ts +5 -0
- package/src/commands/cleanse.ts +19 -4
- package/src/commands/compress.ts +45 -0
- package/src/commands/launch-help.ts +3 -0
- package/src/commit/agentic/prompts/analyze-file.md +6 -6
- package/src/commit/agentic/prompts/session-user.md +4 -4
- package/src/compress/index.ts +318 -0
- package/src/compress/prompts/request.md +11 -0
- package/src/compress/prompts/review.md +17 -0
- package/src/compress/prompts/system.md +81 -0
- package/src/compress/protocol.ts +210 -0
- package/src/compress/session.ts +72 -0
- package/src/compress/types.ts +59 -0
- package/src/config/settings-schema.ts +11 -0
- package/src/discovery/builtin-rules/go-add-cleanup.md +8 -8
- package/src/discovery/builtin-rules/go-exp-promoted.md +8 -8
- package/src/discovery/builtin-rules/go-ioutil.md +12 -12
- package/src/discovery/builtin-rules/go-new-expr.md +8 -8
- package/src/discovery/builtin-rules/go-range-int.md +5 -5
- package/src/discovery/builtin-rules/rs-box-leak.md +7 -7
- package/src/discovery/builtin-rules/rs-future-prelude.md +4 -4
- package/src/discovery/builtin-rules/rs-parking-lot.md +6 -6
- package/src/discovery/builtin-rules/ts-no-any.md +5 -5
- package/src/discovery/builtin-rules/ts-no-deprecated-leftovers.md +8 -8
- package/src/discovery/builtin-rules/ts-no-inline-cast-access.md +13 -14
- package/src/discovery/builtin-rules/ts-no-local-is-record.md +7 -7
- package/src/discovery/builtin-rules/ts-no-test-timers.md +3 -9
- package/src/discovery/builtin-rules/ts-no-tiny-functions.md +7 -7
- package/src/discovery/builtin-rules/ts-promise-with-resolvers.md +2 -2
- package/src/discovery/builtin-rules/ts-redundant-clear-guard.md +3 -9
- package/src/discovery/builtin-rules/ts-set-map.md +2 -4
- package/src/internal-urls/local-protocol.ts +42 -0
- package/src/live/prompts/live-instructions.md +10 -10
- package/src/main.ts +4 -0
- package/src/mcp/client.ts +7 -3
- package/src/mcp/transports/header-policy.ts +28 -0
- package/src/mcp/transports/http.ts +200 -35
- package/src/mcp/types.ts +21 -0
- package/src/modes/components/chat-transcript-builder.ts +17 -5
- package/src/modes/components/late-diagnostics-message.ts +12 -1
- package/src/modes/components/todo-reminder.ts +12 -0
- package/src/modes/components/tool-activity.ts +45 -0
- package/src/modes/components/transcript-container.ts +16 -0
- package/src/modes/components/ttsr-notification.ts +12 -0
- package/src/modes/controllers/event-controller.ts +3 -6
- package/src/modes/controllers/input-controller.ts +6 -6
- package/src/modes/controllers/selector-controller.ts +8 -6
- package/src/modes/interactive-mode.ts +5 -40
- package/src/modes/print-mode.ts +13 -54
- package/src/modes/types.ts +1 -1
- package/src/modes/utils/transcript-render-helpers.ts +3 -2
- package/src/modes/utils/ui-helpers.ts +17 -7
- package/src/prompts/advisor/active-repo-watchdog.md +3 -4
- package/src/prompts/advisor/advise-tool.md +3 -3
- package/src/prompts/advisor/context-files.md +1 -1
- package/src/prompts/advisor/system.md +45 -65
- package/src/prompts/agents/designer.md +44 -44
- package/src/prompts/agents/init.md +18 -18
- package/src/prompts/agents/librarian.md +31 -31
- package/src/prompts/agents/reviewer.md +34 -39
- package/src/prompts/agents/security-reviewer.md +3 -5
- package/src/prompts/agents/task.md +11 -12
- package/src/prompts/bench.md +2 -5
- package/src/prompts/ci-green-request.md +13 -15
- package/src/prompts/dry-balance-bench.md +5 -5
- package/src/prompts/goals/goal-budget-limit.md +4 -5
- package/src/prompts/goals/goal-continuation.md +11 -11
- package/src/prompts/goals/goal-mode-active.md +7 -7
- package/src/prompts/goals/goal-todo-context.md +2 -2
- package/src/prompts/goals/guided-goal-interview.md +18 -24
- package/src/prompts/memories/read-path.md +9 -9
- package/src/prompts/memories/stage_one_system.md +9 -11
- package/src/prompts/review-custom-request.md +8 -11
- package/src/prompts/review-headless-request.md +3 -10
- package/src/prompts/security/scan-coordinator.md +6 -5
- package/src/prompts/security/validate-request.md +4 -7
- package/src/prompts/skills/user-invocation.md +2 -2
- package/src/prompts/steering/parent-irc.md +1 -1
- package/src/prompts/steering/user-interjection.md +1 -3
- package/src/prompts/system/active-repo-context.md +4 -2
- package/src/prompts/system/agent-creation-architect.md +22 -37
- package/src/prompts/system/agent-creation-user.md +3 -3
- package/src/prompts/system/auto-continue.md +1 -1
- package/src/prompts/system/auto-thinking-difficulty-local.md +5 -7
- package/src/prompts/system/auto-thinking-difficulty.md +8 -10
- package/src/prompts/system/autolearn-guidance-learn.md +2 -1
- package/src/prompts/system/autolearn-guidance.md +5 -4
- package/src/prompts/system/autolearn-nudge-autocontinue.md +3 -3
- package/src/prompts/system/background-tan-dispatch.md +3 -3
- package/src/prompts/system/btw-user.md +2 -2
- package/src/prompts/system/commit-message-system.md +8 -6
- package/src/prompts/system/eager-task.md +3 -3
- package/src/prompts/system/empty-stop-retry.md +1 -1
- package/src/prompts/system/gemini-tool-call-reminder.md +5 -5
- package/src/prompts/system/interrupted-thinking.md +3 -3
- package/src/prompts/system/irc-autoreply.md +1 -1
- package/src/prompts/system/irc-incoming.md +3 -3
- package/src/prompts/system/manual-continue.md +3 -3
- package/src/prompts/system/mcp-xdev-guidance.md +2 -2
- package/src/prompts/system/memory-consolidation-system.md +2 -2
- package/src/prompts/system/mid-run-todo-nudge.md +1 -1
- package/src/prompts/system/orchestrate-notice.md +25 -25
- package/src/prompts/system/personalities/default.md +9 -9
- package/src/prompts/system/personalities/friendly.md +11 -11
- package/src/prompts/system/personalities/pragmatic.md +8 -8
- package/src/prompts/system/plan-mode-active.md +61 -64
- package/src/prompts/system/plan-mode-approved.md +10 -11
- package/src/prompts/system/plan-mode-compact-instructions.md +11 -11
- package/src/prompts/system/plan-mode-reference.md +5 -5
- package/src/prompts/system/plan-yolo-handoff.md +2 -2
- package/src/prompts/system/prewalk-checklist.md +5 -5
- package/src/prompts/system/prewalk-continue.md +1 -1
- package/src/prompts/system/prewalk-plan.md +8 -9
- package/src/prompts/system/project-prompt.md +11 -12
- package/src/prompts/system/recap-user.md +1 -1
- package/src/prompts/system/resolve-device-reminder.md +1 -1
- package/src/prompts/system/rewind-report.md +3 -3
- package/src/prompts/system/side-channel-no-tools.md +3 -1
- package/src/prompts/system/snapcompact-context-stub.md +1 -1
- package/src/prompts/system/snapcompact-system-frames-note.md +1 -1
- package/src/prompts/system/snapcompact-system-stub.md +1 -1
- package/src/prompts/system/snapcompact-toolresult-note.md +1 -1
- package/src/prompts/system/speech-rewrite.md +11 -13
- package/src/prompts/system/subagent-async-pending.md +5 -5
- package/src/prompts/system/subagent-system-prompt.md +5 -15
- package/src/prompts/system/subagent-user-prompt.md +1 -1
- package/src/prompts/system/subagent-yield-reminder.md +12 -12
- package/src/prompts/system/system-prompt.md +110 -136
- package/src/prompts/system/tan-context-switch.md +8 -14
- package/src/prompts/system/task-label.md +3 -3
- package/src/prompts/system/thinking-loop-redirect.md +6 -6
- package/src/prompts/system/title-marker-instruction.md +2 -1
- package/src/prompts/system/title-system.md +3 -5
- package/src/prompts/system/ttsr-interrupt.md +3 -3
- package/src/prompts/system/ttsr-tool-reminder.md +1 -1
- package/src/prompts/system/ultrathink-notice.md +1 -1
- package/src/prompts/system/unexpected-stop-classifier.md +3 -3
- package/src/prompts/system/vibe-mode-active.md +15 -15
- package/src/prompts/system/web-search.md +16 -16
- package/src/prompts/system/workflow-notice.md +35 -33
- package/src/prompts/system/xdev-mount-notice.md +4 -4
- package/src/prompts/tools/apply-patch.md +22 -23
- package/src/prompts/tools/approve.md +5 -0
- package/src/prompts/tools/ask.md +10 -10
- package/src/prompts/tools/checkpoint.md +7 -7
- package/src/prompts/tools/computer.md +16 -16
- package/src/prompts/tools/github.md +12 -12
- package/src/prompts/tools/goal.md +8 -9
- package/src/prompts/tools/grep.md +5 -5
- package/src/prompts/tools/image-attachment-describe-system.md +6 -6
- package/src/prompts/tools/image-attachment-describe.md +3 -8
- package/src/prompts/tools/image-gen.md +4 -4
- package/src/prompts/tools/inspect-image-system.md +10 -10
- package/src/prompts/tools/inspect-image.md +10 -13
- package/src/prompts/tools/learn.md +4 -4
- package/src/prompts/tools/manage-skill.md +9 -6
- package/src/prompts/tools/memory-edit.md +8 -8
- package/src/prompts/tools/recall.md +4 -4
- package/src/prompts/tools/reflect.md +2 -2
- package/src/prompts/tools/replace.md +13 -11
- package/src/prompts/tools/retain.md +3 -4
- package/src/prompts/tools/rewind.md +7 -8
- package/src/prompts/tools/rewrite.md +12 -0
- package/src/prompts/tools/security-publish.md +5 -1
- package/src/prompts/tools/security-scan.md +10 -1
- package/src/prompts/tools/task-async-contract.md +7 -1
- package/src/prompts/tools/todo.md +27 -25
- package/src/prompts/tools/vibe-kill.md +2 -2
- package/src/prompts/tools/vibe-list.md +2 -2
- package/src/prompts/tools/vibe-send.md +6 -7
- package/src/prompts/tools/vibe-spawn.md +8 -6
- package/src/prompts/tools/web-search.md +5 -5
- package/src/sdk.ts +10 -1
- package/src/session/agent-session-types.ts +2 -0
- package/src/session/agent-session.ts +28 -0
- package/src/session/session-handoff.ts +21 -0
- package/src/session/session-tools.ts +47 -0
- package/src/tools/builtin-names.ts +1 -2
- package/src/tools/index.ts +10 -0
- package/src/tools/read-format.ts +8 -3
- package/src/tools/read.ts +18 -7
- package/src/tools/renderers.ts +2 -0
- package/src/tools/think.ts +84 -0
- package/src/tools/write.ts +1 -1
- package/src/utils/file-mentions.ts +8 -2
- package/src/utils/zip.ts +858 -94
- package/dist/types/cleanse/progress.d.ts +0 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Generates
|
|
1
|
+
Generates/edits images.
|
|
2
2
|
|
|
3
3
|
<instructions>
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
4
|
+
- One detailed `subject` prompt: generation or editing.
|
|
5
|
+
- Multiple `input`: describe each image's role in `subject` (e.g. `Image 1` for composition, `Image 2` for lighting).
|
|
6
|
+
- Text: add "sharp, legible, correctly spelled"; keep short.
|
|
7
7
|
</instructions>
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
Image-analysis assistant.
|
|
2
2
|
|
|
3
3
|
Core behavior:
|
|
4
|
-
-
|
|
5
|
-
- If
|
|
4
|
+
- Evidence-first: direct observations and inferences distinct.
|
|
5
|
+
- If unclear, say uncertain—not guess.
|
|
6
6
|
- NEVER fabricate unreadable or occluded details.
|
|
7
|
-
-
|
|
7
|
+
- Output compact, useful.
|
|
8
8
|
|
|
9
|
-
Default
|
|
9
|
+
Default format unless question requests another:
|
|
10
10
|
1) Answer
|
|
11
11
|
2) Key evidence
|
|
12
12
|
3) Caveats / uncertainty
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
OCR-style requests:
|
|
15
15
|
- Preserve exact visible text, including casing and punctuation.
|
|
16
|
-
-
|
|
16
|
+
- Partially unreadable text: explicitly mark unreadable segments.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
- Focus
|
|
20
|
-
-
|
|
18
|
+
UI/screenshot debugging:
|
|
19
|
+
- Focus: visible states, labels, toggles, error messages, disabled controls, relevant affordances.
|
|
20
|
+
- Observed UI state and probable root cause separate.
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
Inspects
|
|
1
|
+
Inspects image files via a vision-capable model; returns compact text analysis.
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
|
-
- Use
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- desired output format (bullets/table/JSON/short answer)
|
|
10
|
-
- Keep `question` grounded in observable evidence and ask for uncertainty when details are unclear
|
|
11
|
-
- Use this tool over `read` when the goal is image analysis
|
|
4
|
+
- Use for image understanding: OCR, UI/screenshot debugging, scene/object questions.
|
|
5
|
+
- `path`: local image-file path | `Image #N` attachment label | `attachment://N` URI.
|
|
6
|
+
- `question` specific: inspection target; constraints (e.g. "quote visible text verbatim", "only report confirmed findings"); output format (bullets/table/JSON/short answer).
|
|
7
|
+
- Ground `question` in observable evidence; request uncertainty for unclear details.
|
|
8
|
+
- For image analysis, use over `read`.
|
|
12
9
|
</instruction>
|
|
13
10
|
|
|
14
11
|
<output>
|
|
15
|
-
-
|
|
16
|
-
-
|
|
12
|
+
- Vision-model text-only analysis.
|
|
13
|
+
- Tool output: no image content blocks.
|
|
17
14
|
</output>
|
|
18
15
|
|
|
19
16
|
<critical>
|
|
20
|
-
-
|
|
21
|
-
-
|
|
17
|
+
- Settings-blocked image submission → actionable error.
|
|
18
|
+
- Configured model lacks image input → configure a vision-capable model role before retrying.
|
|
22
19
|
</critical>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Capture
|
|
1
|
+
Capture reusable lessons in long-term memory; optionally mint/enhance a managed skill in the same call.
|
|
2
2
|
|
|
3
|
-
Use after solving
|
|
3
|
+
Use after solving insight likely to pay off again: a non-obvious fix, discovered project convention, or workflow that worked.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`skill` optional; provide only for a repeatable procedure worth codifying as `SKILL.md`, not a fact. Managed skills: isolated `~/.omp/agent/managed-skills`; surfaced as normal skills next session; NEVER touch user-authored skills. Frontmatter: generated from `name` and `description`.
|
|
6
6
|
|
|
7
|
-
Capture sparingly
|
|
7
|
+
Capture sparingly, specifically: one strong reusable lesson > several vague ones.
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
Managed skill: `SKILL.md` in isolated `~/.omp/agent/managed-skills`; surfaced as a normal skill in future sessions.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use: repeatable procedures worth codifying — setup sequence, debugging recipe, project-specific workflow.
|
|
4
|
+
User-authored skills separate; tool NEVER edits them.
|
|
4
5
|
|
|
5
|
-
- `action: "create"` — fails if
|
|
6
|
-
- `action: "update"` — overwrites
|
|
7
|
-
- `action: "delete"` — fails if
|
|
6
|
+
- `action: "create"` — fails if skill exists.
|
|
7
|
+
- `action: "update"` — overwrites body; fails if skill absent.
|
|
8
|
+
- `action: "delete"` — fails if skill absent.
|
|
8
9
|
|
|
9
|
-
`name
|
|
10
|
+
`name`: kebab-case (lowercase letters, digits, hyphens).
|
|
11
|
+
`description`: specific; drives discovery.
|
|
12
|
+
No frontmatter in `body`; generated from `name` and `description`.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
Edit Mnemopi long-term memories by id.
|
|
1
|
+
Edit Mnemopi long-term memories by id. Only ids returned by `recall`.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
- `update`: replace content and/or importance
|
|
5
|
-
- `forget`: permanently delete
|
|
6
|
-
- `invalidate`: softly supersede
|
|
3
|
+
Operations:
|
|
4
|
+
- `update`: working memory; replace content and/or importance.
|
|
5
|
+
- `forget`: permanently delete working memory.
|
|
6
|
+
- `invalidate`: softly supersede working or episodic memory; optional `replacement_id`.
|
|
7
7
|
|
|
8
|
-
Fact ids
|
|
8
|
+
Fact ids — `recall` results marked `[facts]`: read-only. Inspect with `read memory://<id>`; any edit op → `not_editable`.
|
|
9
9
|
|
|
10
|
-
Prefer `invalidate`
|
|
10
|
+
Prefer `invalidate` for stale memory whose history may still be useful. Use `forget` only for content requiring hard deletion.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
MUST read full memory before `update`. Recall previews clipped: trailing `…` marks truncation; `full_length` original size. `update` replaces content wholesale → updating a preview deletes its unseen tail. First `read memory://<id>`; pass merged content in `content`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
Search long-term memory
|
|
1
|
+
Search long-term memory; return raw relevance-ranked matching entries.
|
|
2
2
|
|
|
3
|
-
Use proactively
|
|
3
|
+
Use proactively before questions about past conversations, user preferences, project decisions, or topics where prior context improves accuracy. When in doubt, recall first.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`recall`: specific facts or entries. `reflect`: synthesized answer across many memories.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Results: content preview. Trailing `…`: truncation (`truncated: true`; `full_length`: original size). Before any `memory_edit update`, MUST fetch full row: `read memory://<id>`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
`reflect`: synthesizes a coherent response from relevant long-term memories; unlike `recall`, blends them.
|
|
2
2
|
|
|
3
3
|
Use for open-ended questions spanning many stored facts: "What do you know about this user?", "Summarize project decisions.", "What are my preferences for X?"
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`context` optional; focuses synthesis on a specific angle or sub-topic.
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
Single file string replacement; fuzzy whitespace matching.
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
4
|
+
- MUST use smallest `old_string` uniquely identifying change.
|
|
5
|
+
- Nonunique `old_string` → MUST add context or use `replace_all: true` for all occurrences.
|
|
6
|
+
- Rename a string across file → use `replace_all: true`.
|
|
7
|
+
- SHOULD edit existing files, not create new.
|
|
8
8
|
</instruction>
|
|
9
9
|
|
|
10
10
|
<output>
|
|
11
|
-
|
|
11
|
+
Success/failure status.
|
|
12
|
+
Success: file modified in place; replacement applied.
|
|
13
|
+
Failure — e.g., `old_string` absent or multiple matches without `replace_all: true`: error describes issue.
|
|
12
14
|
</output>
|
|
13
15
|
|
|
14
16
|
<critical>
|
|
15
|
-
-
|
|
17
|
+
- MUST read file at least once in conversation before editing. Tool errors on edit before read.
|
|
16
18
|
</critical>
|
|
17
19
|
|
|
18
20
|
<bash-alternatives>
|
|
19
|
-
Replace
|
|
21
|
+
Replace content-addressed — identify change by text.
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
Pattern-addressed bulk changes: bash more efficient:
|
|
22
24
|
|
|
23
25
|
|Operation|Command|
|
|
24
26
|
|---|---|
|
|
25
27
|
|Regex replace|`sd 'pattern' 'replacement' file`|
|
|
26
28
|
|Bulk replace across files|`sd 'pattern' 'replacement' **/*.ts`|
|
|
27
29
|
|
|
28
|
-
Use Replace when
|
|
29
|
-
For in-place edits prefer
|
|
30
|
+
Use Replace when content identifies location; `ast_edit` for structure-aware codemods.
|
|
31
|
+
For in-place edits prefer Replace or `write` — diff preview and fuzzy matching.
|
|
30
32
|
</bash-alternatives>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
Store
|
|
1
|
+
Store ≥1 fact in long-term memory for future sessions.
|
|
2
2
|
|
|
3
|
-
Use
|
|
4
|
-
Ephemeral task state does not belong here.
|
|
3
|
+
Use: durable, reusable knowledge—user preferences, project decisions, architectural choices; anything improving future responses. No ephemeral task state.
|
|
5
4
|
|
|
6
|
-
Each item MUST be specific
|
|
5
|
+
Each item MUST be specific, self-contained: who, what, when, why. Batch related facts per call; deduplicated and consolidated.
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
End
|
|
1
|
+
End active checkpoint; rewind context to it, replacing intermediate exploration with your report.
|
|
2
2
|
|
|
3
|
-
Call immediately after
|
|
3
|
+
Call immediately after investigative work started by `checkpoint`.
|
|
4
4
|
|
|
5
5
|
Requirements:
|
|
6
|
-
- `report` MUST be concise, factual,
|
|
7
|
-
- Include key findings, decisions, and any unresolved risks.
|
|
6
|
+
- `report` MUST be concise, factual, actionable; include key findings, decisions, unresolved risks.
|
|
8
7
|
- AVOID raw scratch logs unless essential.
|
|
9
|
-
-
|
|
8
|
+
- MUST call before yielding if checkpoint active.
|
|
10
9
|
|
|
11
10
|
Behavior:
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
11
|
+
- No active checkpoint → error. Checkpoint already rewound → continue from retained report; NEVER retry.
|
|
12
|
+
- Success → session rewinds, retains your report as context, closes checkpoint.
|
|
13
|
+
- Successful rewind final for that checkpoint; repeat calls error.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Submit compressed source draft + every drop.
|
|
2
|
+
|
|
3
|
+
- `text`: complete, verbatim, ready-to-ship compressed output; NEVER diff, summary, or edit description.
|
|
4
|
+
- `losses`: one entry per omitted claim, qualifier, default, bound, example, or exact string; quote/name it and why omission remains correct. Empty array: no losses.
|
|
5
|
+
|
|
6
|
+
Each call: review turn → reply with draft, measured size, declared losses; ask verdict. `rewrite` replaces draft; `approve` accepts.
|
|
7
|
+
|
|
8
|
+
<critical>
|
|
9
|
+
- Declare losses honestly: declared losses auditable; undeclared loss: silent regression.
|
|
10
|
+
- `text` MUST stand alone: reader without source can execute it.
|
|
11
|
+
- New draft supersedes earlier approval.
|
|
12
|
+
</critical>
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
Publish
|
|
1
|
+
Publish current OMP-native security scan's canonical result.
|
|
2
|
+
Call exactly once after every in-scope file and candidate reaches final disposition.
|
|
3
|
+
Evidence: only repository files inspected during this scan.
|
|
4
|
+
Tool: validates, fingerprints, assigns OMP-owned IDs, writes canonical security store, creates SARIF.
|
|
5
|
+
NEVER invent IDs or edit store directly.
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
OMP-native repository security scans: plan, start, inspect, cancel, validate.
|
|
2
|
+
`preflight`: immutable plan pinned to repository snapshot, model, exact OAuth credential.
|
|
3
|
+
`start`: plan → background OMP job.
|
|
4
|
+
`status`, `cancel`: returned operation ID.
|
|
5
|
+
`cloud_scans`: Codex Security cloud configurations for exact selected ChatGPT OAuth account.
|
|
6
|
+
`cloud_start`: creates/enables configuration using `repository_id`, `repository_url`, `environment_id`; consumes account's separate Codex Security cloud allowance; NEVER native-scan fallback.
|
|
7
|
+
`cloud_status`: cloud progress.
|
|
8
|
+
`cloud_pull`: cloud findings → canonical OMP security store, available through `security://`.
|
|
9
|
+
Cloud actions: `cloud_configuration_id` required; `credential_id` MAY pin account.
|
|
10
|
+
Security MUST be enabled in settings.
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
No polling
|
|
1
|
+
No polling needed.
|
|
2
|
+
|
|
3
|
+
Settled-job inspection: `hub jobs` | `hub wait` delivers its snapshot → no duplicate `async-result`.
|
|
4
|
+
|
|
5
|
+
Job IDs: process memory ~5min after settlement; afterward use agent ID: `hub send`, `agent://<id>`, `history://<id>`.
|
|
6
|
+
|
|
7
|
+
`completed`: subagent yielded successfully; claimed artifacts unverified.
|
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
**Tasks
|
|
1
|
+
**Tasks: verbatim content strings, NEVER auto-generated IDs; no "task-1"/"task-N". Pass content in `task`.**
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Completing tasks out of phase order can move this pointer **back** to an earlier phase — expected; completed tasks are never reverted.
|
|
3
|
+
Each completion: earliest still-open task (phase order) auto-promotes to `in_progress`. Out-of-order completion may move pointer back to an earlier phase—expected; completed tasks NEVER revert.
|
|
5
4
|
|
|
6
5
|
## Operations
|
|
7
6
|
|
|
8
|
-
|`op`|
|
|
7
|
+
|`op`|Fields|Effect|
|
|
9
8
|
|---|---|---|
|
|
10
|
-
|`init`|`list: [{phase, items: string[]}]`|Initialize full list
|
|
9
|
+
|`init`|`list: [{phase, items: string[]}]`|Initialize full list; replaces existing|
|
|
11
10
|
|`init`|`items: string[]`|Flattened single-phase init|
|
|
12
11
|
|`start`|`task`|Mark in progress|
|
|
13
12
|
|`done`|`task` or `phase`|Mark completed|
|
|
14
13
|
|`drop`|`task` or `phase`|Mark abandoned|
|
|
15
|
-
|`block`|`task` or `phase
|
|
16
|
-
|`unblock`|`task` or `phase`|
|
|
17
|
-
|`rm
|
|
18
|
-
|`append`|`phase
|
|
19
|
-
|`view`|—|Read-only
|
|
14
|
+
|`block`|`task` or `phase`; optional `reason`|Mark blocked: open, awaiting external input; excluded from stop-time incomplete-todo reminder|
|
|
15
|
+
|`unblock`|`task` or `phase`|Blocked task → `pending`|
|
|
16
|
+
|`rm`|optional `task` or `phase`|Remove task/phase; omit both → clear|
|
|
17
|
+
|`append`|`phase`; `items: string[]`|Append tasks to phase; lazily creates phase|
|
|
18
|
+
|`view`|—|Read-only; echo list|
|
|
20
19
|
|
|
21
20
|
## Anatomy
|
|
22
|
-
|
|
23
|
-
-
|
|
21
|
+
|
|
22
|
+
- Task content: 5–10 words; what, not how; unique identifier.
|
|
23
|
+
- Phase name: short noun phrase (e.g. `Foundation`, `Auth`, `Verification`); unique identifier. NEVER prefix `1.`, `A)`, `Phase 1:`.
|
|
24
24
|
|
|
25
25
|
## Rules
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
26
|
+
|
|
27
|
+
- Mark tasks done immediately after finishing; complete phases in order.
|
|
28
|
+
- NEVER make a todo call the turn's only tool call. Batch with real work: `init` with first reads/edits; each `done`/`start` with next action. Solo todo turns waste a round trip.
|
|
29
|
+
- Waiting on something you can't act on—a user decision, another agent, external service: `block` task (optional `reason`); remains tracked but avoids stop reminder. `unblock` when actionable. If blocker agent-actionable, `append` an unblocking task instead.
|
|
30
|
+
- Keep introduced `task`/`phase` strings stable.
|
|
31
|
+
- Lost exact task text: `view` echoes list; NEVER guess from memory.
|
|
32
|
+
|
|
33
|
+
## Create a list
|
|
34
|
+
|
|
35
|
+
- Task requires 3+ distinct steps.
|
|
36
|
+
- User explicitly requests one.
|
|
37
|
+
- User provides a set of tasks.
|
|
38
|
+
- New instructions arrive mid-task: capture before proceeding.
|
|
37
39
|
|
|
38
40
|
<critical>
|
|
39
|
-
User
|
|
40
|
-
-
|
|
41
|
+
User gives multi-step plan—phased todo, numbered/bulleted checklist, or "N bugs/items/tasks":
|
|
42
|
+
- MUST `init` every item as its own task before working.
|
|
41
43
|
- Enumerate all; NEVER summarize into fewer tasks, sample "the important ones", drop items, or track the rest from memory.
|
|
42
44
|
</critical>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
Terminates
|
|
1
|
+
Terminates worker session: aborts in-flight turn, if any; discards session. Conversation cannot continue; transcript remains readable at `history://<id>`.
|
|
2
2
|
|
|
3
|
-
Kill
|
|
3
|
+
Kill stuck, looping, or completed-workstream sessions. Free dead weight → legible roster.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
Worker-session roster: id, CLI flavor (`fast`/`good`), state (`starting`/`running`/`idle`/`dead`), model, turn count, queued messages, one-line gist of latest activity.
|
|
2
2
|
|
|
3
|
-
Use
|
|
3
|
+
Use to reorient: existing sessions, busy workers, idle workers ready for next instruction.
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
Send a worker session message by id from `vibe_spawn`/`vibe_list`. Session retains full conversation history; refer naturally ("now do the same for the other module").
|
|
2
2
|
|
|
3
|
-
Returns immediately with an ack
|
|
3
|
+
Returns immediately with an ack:
|
|
4
|
+
- `turn`: worker idle → new turn; result self-delivers when done.
|
|
5
|
+
- `steered`: worker mid-turn → message injected into the running turn as live steering.
|
|
6
|
+
- `queued`: worker mid-turn and not currently steerable → message runs automatically as next turn.
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
- `steered` — the worker was mid-turn; your message was injected into the running turn as live steering.
|
|
7
|
-
- `queued` — the worker was mid-turn and not steerable right now; your message runs as the next turn automatically.
|
|
8
|
-
|
|
9
|
-
Use it for follow-ups, corrections, scope changes, and review requests. Never re-explain prior context — the session already has it.
|
|
8
|
+
Use for follow-ups, corrections, scope changes, review requests. NEVER re-explain prior context; session already has it.
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
Starts
|
|
1
|
+
Starts persistent conversational coding-agent worker session (edit, bash, grep, everything).
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
- `
|
|
3
|
+
CLI flavor by task:
|
|
4
|
+
- `fast`: low-latency model; mechanical, well-specified work (renames, boilerplate, running tests, data collection).
|
|
5
|
+
- `good`: strong model; hard work (design, debugging, multi-file changes, judgment calls).
|
|
5
6
|
|
|
6
|
-
`prompt
|
|
7
|
+
`prompt`: first session instruction. Worker starts with NO context beyond it; include files, constraints, acceptance criteria.
|
|
8
|
+
`name`: optional session label; otherwise generated.
|
|
7
9
|
|
|
8
|
-
Returns
|
|
10
|
+
Returns session id immediately. On worker completion, turn result—activity trace + worker response—delivered automatically. Do not wait unless blocked; direct other sessions.
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
Session persists after turn; remembers whole conversation. Same-workstream follow-up: `vibe_send`; NEVER spawn second session.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
Web search: current information beyond knowledge cutoff.
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
- NEVER use for
|
|
7
|
-
- `query
|
|
4
|
+
- SHOULD prefer primary sources (papers, official docs); corroborate key claims with multiple sources.
|
|
5
|
+
- MUST link cited sources in final response.
|
|
6
|
+
- NEVER use for programmatically accessible content or known URLs (GitHub repos/issues, known arXiv papers, Wikipedia pages, official docs) — `read` URL directly.
|
|
7
|
+
- `query`: every provider supports Google-style `site:`/`-site:`, `after:`/`before:` (`YYYY-MM-DD`), `inurl:`, `intitle:`, `filetype:`, `"exact phrase"`, `-term`, `OR`. Map constraints to native filters when available; otherwise filter results leniently. If a constraint matches nothing, relax and report it; do not return zero results.
|
|
8
8
|
</instruction>
|
package/src/sdk.ts
CHANGED
|
@@ -201,6 +201,7 @@ import {
|
|
|
201
201
|
ReadTool,
|
|
202
202
|
releaseComputerSessionsForOwner,
|
|
203
203
|
resolveMountedXdevExecutable,
|
|
204
|
+
supportsExternalThinking,
|
|
204
205
|
type Tool,
|
|
205
206
|
type ToolSession,
|
|
206
207
|
WebSearchTool,
|
|
@@ -3237,7 +3238,14 @@ async function createAgentSessionScoped(options: CreateAgentSessionOptions): Pro
|
|
|
3237
3238
|
});
|
|
3238
3239
|
}
|
|
3239
3240
|
}
|
|
3240
|
-
|
|
3241
|
+
const externalThinking =
|
|
3242
|
+
settings.get("externalThinking") &&
|
|
3243
|
+
agent.state.tools.some(tool => tool.name === "think") &&
|
|
3244
|
+
supportsExternalThinking(streamModel);
|
|
3245
|
+
return settingsAwareStreamFn(streamModel, context, {
|
|
3246
|
+
...streamOptions,
|
|
3247
|
+
forceReasoningOff: externalThinking || streamOptions?.forceReasoningOff,
|
|
3248
|
+
});
|
|
3241
3249
|
},
|
|
3242
3250
|
cursorExecHandlers,
|
|
3243
3251
|
getCursorTools: () => (toolSession.xdev ? listXdevTools(toolSession.xdev) : []),
|
|
@@ -3393,6 +3401,7 @@ async function createAgentSessionScoped(options: CreateAgentSessionOptions): Pro
|
|
|
3393
3401
|
createComputerTool: restrictToolNames
|
|
3394
3402
|
? undefined
|
|
3395
3403
|
: async () => (await BUILTIN_TOOLS.computer(toolSession)) ?? null,
|
|
3404
|
+
createThinkTool: async () => (await HIDDEN_TOOLS.think(toolSession)) ?? null,
|
|
3396
3405
|
createInspectImageTool: restrictToolNames
|
|
3397
3406
|
? undefined
|
|
3398
3407
|
: async () => (await BUILTIN_TOOLS.inspect_image(toolSession)) ?? null,
|
|
@@ -164,6 +164,8 @@ export interface AgentSessionConfig {
|
|
|
164
164
|
createMemoryTools?: () => Promise<AgentTool[]>;
|
|
165
165
|
/** Creates the built-in `computer` tool for session-scoped runtime enablement (see {@link AgentSession.setComputerToolEnabled}). */
|
|
166
166
|
createComputerTool?: () => Promise<AgentTool | null>;
|
|
167
|
+
/** Creates the private `think` scratchpad tool for runtime setting changes. */
|
|
168
|
+
createThinkTool?: () => Promise<AgentTool | null>;
|
|
167
169
|
/** Creates the built-in `inspect_image` tool for session-scoped runtime enablement (see {@link AgentSession.setInspectImageMode}). */
|
|
168
170
|
createInspectImageTool?: () => Promise<AgentTool | null>;
|
|
169
171
|
/** Model registry for API key resolution and model discovery. */
|
|
@@ -199,6 +199,7 @@ import {
|
|
|
199
199
|
PROPOSE_DEVICE_NAME,
|
|
200
200
|
writeDeviceDispatch,
|
|
201
201
|
} from "../tools/resolve";
|
|
202
|
+
import { supportsExternalThinking } from "../tools/think";
|
|
202
203
|
import type { TodoPhase } from "../tools/todo";
|
|
203
204
|
import { ToolError } from "../tools/tool-errors";
|
|
204
205
|
import { parseCommandArgs } from "../utils/command-args";
|
|
@@ -1241,6 +1242,7 @@ export class AgentSession {
|
|
|
1241
1242
|
toolRegistry: config.toolRegistry,
|
|
1242
1243
|
createVibeTools: config.createVibeTools,
|
|
1243
1244
|
createComputerTool: config.createComputerTool,
|
|
1245
|
+
createThinkTool: config.createThinkTool,
|
|
1244
1246
|
createInspectImageTool: config.createInspectImageTool,
|
|
1245
1247
|
builtInToolNames: config.builtInToolNames,
|
|
1246
1248
|
mcpManagerToolNames: config.mcpManagerToolNames,
|
|
@@ -4419,6 +4421,11 @@ export class AgentSession {
|
|
|
4419
4421
|
return this.#tools.setComputerToolEnabled(enabled);
|
|
4420
4422
|
}
|
|
4421
4423
|
|
|
4424
|
+
/** Applies the external-thinking setting to the private scratchpad tool immediately. */
|
|
4425
|
+
setThinkToolEnabled(enabled: boolean): Promise<boolean> {
|
|
4426
|
+
return this.#tools.setThinkToolEnabled(enabled);
|
|
4427
|
+
}
|
|
4428
|
+
|
|
4422
4429
|
/**
|
|
4423
4430
|
* Session-scoped inspect_image mode (`/vision`). `auto` clears the override
|
|
4424
4431
|
* and returns to the persisted `inspect_image.mode` setting; `on`/`off`
|
|
@@ -5176,6 +5183,15 @@ export class AgentSession {
|
|
|
5176
5183
|
|
|
5177
5184
|
// Skip eager preludes when the user has already queued a directive
|
|
5178
5185
|
const hasPendingUserDirective = this.#toolChoiceQueue.inspect().includes("user-force");
|
|
5186
|
+
const activeModel = this.agent.state.model;
|
|
5187
|
+
const externalThinkingToolChoice =
|
|
5188
|
+
!options?.synthetic &&
|
|
5189
|
+
!hasPendingUserDirective &&
|
|
5190
|
+
this.settings.get("externalThinking") &&
|
|
5191
|
+
this.getEnabledToolNames().includes("think") &&
|
|
5192
|
+
supportsExternalThinking(activeModel)
|
|
5193
|
+
? buildNamedToolChoice("think", activeModel)
|
|
5194
|
+
: undefined;
|
|
5179
5195
|
const eagerTodoPrelude =
|
|
5180
5196
|
!options?.synthetic && !hasPendingUserDirective ? this.#todo.createEagerTodoPrelude(expandedText) : undefined;
|
|
5181
5197
|
const eagerTaskPrelude =
|
|
@@ -5193,6 +5209,12 @@ export class AgentSession {
|
|
|
5193
5209
|
: undefined;
|
|
5194
5210
|
|
|
5195
5211
|
const promptAttribution = options?.attribution ?? (options?.synthetic ? "agent" : "user");
|
|
5212
|
+
if (externalThinkingToolChoice) {
|
|
5213
|
+
this.#toolChoiceQueue.pushOnce(externalThinkingToolChoice, {
|
|
5214
|
+
label: "external-thinking",
|
|
5215
|
+
now: true,
|
|
5216
|
+
});
|
|
5217
|
+
}
|
|
5196
5218
|
const message = options?.synthetic
|
|
5197
5219
|
? { role: "developer" as const, content: userContent, attribution: promptAttribution, timestamp: Date.now() }
|
|
5198
5220
|
: { role: "user" as const, content: userContent, attribution: promptAttribution, timestamp: Date.now() };
|
|
@@ -5223,6 +5245,7 @@ export class AgentSession {
|
|
|
5223
5245
|
// Clean up residual eager-todo directive if the prompt never consumed it
|
|
5224
5246
|
// (e.g., compaction aborted, validation failed).
|
|
5225
5247
|
this.#toolChoiceQueue.removeByLabel("eager-todo");
|
|
5248
|
+
this.#toolChoiceQueue.removeByLabel("external-thinking");
|
|
5226
5249
|
}
|
|
5227
5250
|
return true;
|
|
5228
5251
|
}
|
|
@@ -7043,6 +7066,11 @@ export class AgentSession {
|
|
|
7043
7066
|
} catch (error) {
|
|
7044
7067
|
logger.warn("inspect_image reconcile after model change failed", { error: String(error) });
|
|
7045
7068
|
}
|
|
7069
|
+
try {
|
|
7070
|
+
await this.#tools.reconcileThinkTool();
|
|
7071
|
+
} catch (error) {
|
|
7072
|
+
logger.warn("think tool reconcile after model change failed", { error: String(error) });
|
|
7073
|
+
}
|
|
7046
7074
|
}
|
|
7047
7075
|
|
|
7048
7076
|
#closeCodexProviderSessionsForHistoryRewrite(): void {
|
|
@@ -14,6 +14,7 @@ import { logger, Snowflake } from "@oh-my-pi/pi-utils";
|
|
|
14
14
|
import type { ModelRegistry } from "../config/model-registry";
|
|
15
15
|
import type { Settings } from "../config/settings";
|
|
16
16
|
import type { ExtensionRunner, SessionBeforeSwitchResult } from "../extensibility/extensions";
|
|
17
|
+
import { copyLocalArtifacts, resolveLocalUrlToPath } from "../internal-urls";
|
|
17
18
|
import { obfuscateProviderContext } from "../secrets/message-transform";
|
|
18
19
|
import type { SecretObfuscator } from "../secrets/obfuscator";
|
|
19
20
|
import type { HandoffResult, SessionHandoffOptions } from "./agent-session-types";
|
|
@@ -255,6 +256,15 @@ export class SessionHandoff {
|
|
|
255
256
|
// Stop and settle in-flight advisors while the old-session feeds can still
|
|
256
257
|
// observe message_end, then mute before opening the replacement session.
|
|
257
258
|
await this.#host.drainAndDetachAdvisorRecorders();
|
|
259
|
+
// Snapshot the outgoing session's local:// root BEFORE newSession() mints a
|
|
260
|
+
// fresh session id (and therefore a fresh, empty local root). The handoff
|
|
261
|
+
// document routinely references plans/scratch files under local://, so those
|
|
262
|
+
// artifacts must follow the session switch or every reference dangles.
|
|
263
|
+
const localProtocolOptions = {
|
|
264
|
+
getArtifactsDir: () => this.#host.sessionManager.getArtifactsDir(),
|
|
265
|
+
getSessionId: () => this.#host.sessionManager.getSessionId(),
|
|
266
|
+
};
|
|
267
|
+
const previousLocalRoot = resolveLocalUrlToPath("local://", localProtocolOptions);
|
|
258
268
|
const bashTransition = this.#host.beginBashSessionTransition();
|
|
259
269
|
this.#host.cancelOwnAsyncJobs();
|
|
260
270
|
try {
|
|
@@ -292,6 +302,17 @@ export class SessionHandoff {
|
|
|
292
302
|
this.#host.clearPendingNextTurnMessages();
|
|
293
303
|
this.#host.resetTodoCycle();
|
|
294
304
|
|
|
305
|
+
// Carry local:// artifacts into the replacement session (best-effort: the
|
|
306
|
+
// switch is already committed, so a copy failure must not fail the handoff).
|
|
307
|
+
try {
|
|
308
|
+
const newLocalRoot = resolveLocalUrlToPath("local://", localProtocolOptions);
|
|
309
|
+
await copyLocalArtifacts(previousLocalRoot, newLocalRoot);
|
|
310
|
+
} catch (error) {
|
|
311
|
+
logger.warn("Failed to copy local artifacts into handoff session", {
|
|
312
|
+
error: error instanceof Error ? error.message : String(error),
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
|
|
295
316
|
// Inject the handoff document as a custom message
|
|
296
317
|
const handoffContent = createHandoffContext(handoffText);
|
|
297
318
|
this.#host.sessionManager.appendCustomMessageEntry("handoff", handoffContent, true, undefined, "agent");
|