@punch-bot/cli 1.2.0 → 1.4.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/CHANGELOG.md +54 -7
- package/README.md +4 -4
- package/dist/bundle/chunks/{anthropic-messages-DA6M7CRN.js → anthropic-messages-BUUFZMRE.js} +3 -3
- package/dist/bundle/chunks/{azure-openai-responses-IJO5RNR3.js → azure-openai-responses-WZ4GZHD2.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +1 -1
- package/dist/bundle/chunks/{chunk-5OD3Y36V.js → chunk-BYHXHV4K.js} +1 -1
- package/dist/bundle/chunks/{chunk-JHYQSLCR.js → chunk-LP6WVVUV.js} +1 -1
- package/dist/bundle/chunks/{chunk-FLX3SJDL.js → chunk-MCGQGCDS.js} +95 -63
- package/dist/bundle/chunks/{chunk-5HTGPCR7.js → chunk-OWCYH5W2.js} +1 -1
- package/dist/bundle/chunks/{chunk-FJPXW4TE.js → chunk-YGGF2ZM6.js} +1 -1
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-JSIIVUNP.js → google-generative-ai-S2KXX5PQ.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-BZ3ID54S.js → google-vertex-LQOUTFJN.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-RMNTDYQK.js → mistral-conversations-VNJYBSRF.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-O3P3UWDP.js → openai-codex-responses-E6BLZPYJ.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-G4BKSHGH.js → openai-completions-LUDIAWSG.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-377V6EDU.js → openai-responses-IOCBEIVC.js} +1 -1
- package/dist/bundle/chunks/{virtual-modules-FOSN3OT2.js → virtual-modules-WOHWUS3S.js} +1 -1
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.js +4 -4
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js +4 -4
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +0 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +0 -1
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/model-resolver.d.ts +67 -25
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +379 -194
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +4 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +7 -2
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/model-suffix-variants.d.ts +14 -0
- package/dist/core/model-suffix-variants.d.ts.map +1 -0
- package/dist/core/model-suffix-variants.js +27 -0
- package/dist/core/model-suffix-variants.js.map +1 -0
- package/dist/core/sdk.d.ts +0 -2
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +6 -22
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/system-prompt.d.ts +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +8 -9
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/extensions/punch/auth.d.ts +2 -1
- package/dist/extensions/punch/auth.d.ts.map +1 -1
- package/dist/extensions/punch/auth.js +5 -1
- package/dist/extensions/punch/auth.js.map +1 -1
- package/dist/extensions/punch/index.d.ts.map +1 -1
- package/dist/extensions/punch/index.js +2 -1
- package/dist/extensions/punch/index.js.map +1 -1
- package/dist/extensions/punch/server.d.ts +3 -0
- package/dist/extensions/punch/server.d.ts.map +1 -1
- package/dist/extensions/punch/server.js +41 -3
- package/dist/extensions/punch/server.js.map +1 -1
- package/dist/extensions/punch/todo-store.d.ts +15 -0
- package/dist/extensions/punch/todo-store.d.ts.map +1 -0
- package/dist/extensions/punch/todo-store.js +208 -0
- package/dist/extensions/punch/todo-store.js.map +1 -0
- package/dist/extensions/punch/todos.d.ts +7 -3
- package/dist/extensions/punch/todos.d.ts.map +1 -1
- package/dist/extensions/punch/todos.js +40 -17
- package/dist/extensions/punch/todos.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +9 -8
- package/dist/main.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +4 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +7 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +14 -2
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +11 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/docs/cli.md +6 -6
- package/docs/configuration.md +2 -2
- package/docs/docs.json +4 -0
- package/docs/punch-todos.md +24 -0
- package/docs/rpc-commands.md +30 -2
- package/docs/rpc.md +1 -1
- package/docs/settings.md +2 -2
- package/docs/usage.md +6 -4
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/03-custom-prompt.ts +1 -1
- package/npm-shrinkwrap.json +21 -21
- package/package.json +17 -7
- package/src/extensions/punch/sqlite-bun.mjs +1 -0
- package/src/extensions/punch/sqlite-driver.d.mts +15 -0
- package/src/extensions/punch/sqlite-node.mjs +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-types.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * RPC protocol types for headless operation.\n *\n * Commands are sent as JSON lines on stdin.\n * Responses and events are emitted as JSON lines on stdout.\n */\n\nimport type { AgentMessage, ThinkingLevel } from \"@punch-bot/agent\";\nimport type { ImageContent, Model } from \"@punch-bot/ai\";\nimport type { PromptDisposition, QueuedInputDisposition, SessionStats } from \"../../core/agent-session.ts\";\nimport type { BashResult } from \"../../core/bash-executor.ts\";\nimport type { CompactionResult } from \"../../core/compaction/index.ts\";\nimport type { Delivery } from \"../../core/delivery.ts\";\nimport type { SessionEntry, SessionTreeNode } from \"../../core/session-manager.ts\";\nimport type { SourceInfo } from \"../../core/source-info.ts\";\n\n// ============================================================================\n// RPC Commands (stdin)\n// ============================================================================\n\nexport type RpcCommand =\n\t// Prompting\n\t| { id?: string; type: \"prompt\"; message: string; images?: ImageContent[]; streamingBehavior?: \"steer\" | \"followUp\" }\n\t| { id?: string; type: \"steer\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"follow_up\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"abort\" }\n\t| { id?: string; type: \"clear_queue\" }\n\t| { id?: string; type: \"new_session\"; parentSession?: string }\n\n\t// State\n\t| { id?: string; type: \"get_state\" }\n\n\t// Model\n\t| { id?: string; type: \"set_model\"; provider: string; modelId: string }\n\t| { id?: string; type: \"cycle_model\" }\n\t| { id?: string; type: \"get_available_models\" }\n\n\t// Thinking\n\t| { id?: string; type: \"set_thinking_level\"; level: ThinkingLevel }\n\t| { id?: string; type: \"cycle_thinking_level\" }\n\t| { id?: string; type: \"get_available_thinking_levels\" }\n\n\t// Queue modes\n\t| { id?: string; type: \"set_steering_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\t| { id?: string; type: \"set_follow_up_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\n\t// Compaction\n\t| { id?: string; type: \"compact\"; customInstructions?: string }\n\t| { id?: string; type: \"set_auto_compaction\"; enabled: boolean }\n\n\t// Retry\n\t| { id?: string; type: \"set_auto_retry\"; enabled: boolean }\n\t| { id?: string; type: \"abort_retry\" }\n\n\t// Bash\n\t| { id?: string; type: \"bash\"; command: string; excludeFromContext?: boolean }\n\t| { id?: string; type: \"abort_bash\" }\n\n\t// Files\n\t| { id?: string; type: \"read_file\"; path: string; maxBytes?: number }\n\n\t// Session\n\t| { id?: string; type: \"get_session_stats\" }\n\t| { id?: string; type: \"export_html\"; outputPath?: string }\n\t| { id?: string; type: \"switch_session\"; sessionPath: string }\n\t| { id?: string; type: \"fork\"; entryId: string }\n\t| { id?: string; type: \"clone\" }\n\t| { id?: string; type: \"get_fork_messages\" }\n\t| { id?: string; type: \"get_entries\"; since?: string }\n\t| { id?: string; type: \"get_tree\" }\n\t| { id?: string; type: \"get_last_assistant_text\" }\n\t| { id?: string; type: \"set_session_name\"; name: string }\n\n\t// Messages\n\t| { id?: string; type: \"get_messages\" }\n\n\t// Commands (available for invocation via prompt)\n\t| { id?: string; type: \"get_commands\" };\n\n// ============================================================================\n// RPC Slash Command (for get_commands response)\n// ============================================================================\n\n/** A command available for invocation via prompt */\nexport interface RpcSlashCommand {\n\t/** Command name (without leading slash) */\n\tname: string;\n\t/** Human-readable description */\n\tdescription?: string;\n\t/** What kind of command this is */\n\tsource: \"extension\" | \"prompt\" | \"skill\";\n\t/** Source metadata for the owning resource */\n\tsourceInfo: SourceInfo;\n}\n\n// ============================================================================\n// RPC State\n// ============================================================================\n\nexport interface RpcSessionState {\n\tmodel?: Model<any>;\n\tthinkingLevel: ThinkingLevel;\n\tisStreaming: boolean;\n\tisCompacting: boolean;\n\tsteeringMode: \"all\" | \"one-at-a-time\";\n\tfollowUpMode: \"all\" | \"one-at-a-time\";\n\tsessionFile?: string;\n\tsessionId: string;\n\tsessionName?: string;\n\tautoCompactionEnabled: boolean;\n\tmessageCount: number;\n\tpendingMessageCount: number;\n}\n\n// ============================================================================\n// RPC Responses (stdout)\n// ============================================================================\n\n// Success responses with data\nexport type RpcResponse =\n\t// Prompting\n\t| { id?: string; type: \"response\"; command: \"prompt\"; success: true; data: { disposition: PromptDisposition } }\n\t| { id?: string; type: \"response\"; command: \"steer\"; success: true; data: { disposition: QueuedInputDisposition } }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"follow_up\";\n\t\t\tsuccess: true;\n\t\t\tdata: { disposition: QueuedInputDisposition };\n\t }\n\t| { id?: string; type: \"response\"; command: \"abort\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"clear_queue\";\n\t\t\tsuccess: true;\n\t\t\tdata: { steering: string[]; followUp: string[] };\n\t }\n\t| { id?: string; type: \"response\"; command: \"new_session\"; success: true; data: { cancelled: boolean } }\n\n\t// State\n\t| { id?: string; type: \"response\"; command: \"get_state\"; success: true; data: RpcSessionState }\n\n\t// Model\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"set_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: Model<any>;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: { model: Model<any>; thinkingLevel: ThinkingLevel; isScoped: boolean } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_models\";\n\t\t\tsuccess: true;\n\t\t\tdata: { models: Model<any>[] };\n\t }\n\n\t// Thinking\n\t| { id?: string; type: \"response\"; command: \"set_thinking_level\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_thinking_level\";\n\t\t\tsuccess: true;\n\t\t\tdata: { level: ThinkingLevel } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_thinking_levels\";\n\t\t\tsuccess: true;\n\t\t\tdata: { levels: ThinkingLevel[] };\n\t }\n\n\t// Queue modes\n\t| { id?: string; type: \"response\"; command: \"set_steering_mode\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"set_follow_up_mode\"; success: true }\n\n\t// Compaction\n\t| { id?: string; type: \"response\"; command: \"compact\"; success: true; data: CompactionResult }\n\t| { id?: string; type: \"response\"; command: \"set_auto_compaction\"; success: true }\n\n\t// Retry\n\t| { id?: string; type: \"response\"; command: \"set_auto_retry\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort_retry\"; success: true }\n\n\t// Bash\n\t| { id?: string; type: \"response\"; command: \"bash\"; success: true; data: BashResult }\n\t| { id?: string; type: \"response\"; command: \"abort_bash\"; success: true }\n\n\t// Files\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"read_file\";\n\t\t\tsuccess: true;\n\t\t\tdata: { text?: string; base64?: string; mimeType?: string; size: number; truncated: boolean };\n\t }\n\n\t// Session\n\t| { id?: string; type: \"response\"; command: \"get_session_stats\"; success: true; data: SessionStats }\n\t| { id?: string; type: \"response\"; command: \"export_html\"; success: true; data: { path: string } }\n\t| { id?: string; type: \"response\"; command: \"switch_session\"; success: true; data: { cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"fork\"; success: true; data: { text: string; cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"clone\"; success: true; data: { cancelled: boolean } }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_fork_messages\";\n\t\t\tsuccess: true;\n\t\t\tdata: { messages: Array<{ entryId: string; text: string }> };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_entries\";\n\t\t\tsuccess: true;\n\t\t\tdata: { entries: SessionEntry[]; leafId: string | null };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_tree\";\n\t\t\tsuccess: true;\n\t\t\tdata: { tree: SessionTreeNode[]; leafId: string | null };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_last_assistant_text\";\n\t\t\tsuccess: true;\n\t\t\tdata: { text: string | null };\n\t }\n\t| { id?: string; type: \"response\"; command: \"set_session_name\"; success: true }\n\n\t// Messages\n\t| { id?: string; type: \"response\"; command: \"get_messages\"; success: true; data: { messages: AgentMessage[] } }\n\n\t// Commands\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_commands\";\n\t\t\tsuccess: true;\n\t\t\tdata: { commands: RpcSlashCommand[] };\n\t }\n\n\t// Error response (any command can fail)\n\t| { id?: string; type: \"response\"; command: string; success: false; error: string };\n\n// ============================================================================\n// Delivery Event (stdout)\n// ============================================================================\n\n/** Structured platform-neutral delivery parsed from the final assistant message */\nexport type RpcDeliveryEvent = { type: \"delivery\"; delivery: Delivery };\n\n// ============================================================================\n// Extension UI Events (stdout)\n// ============================================================================\n\n/** Emitted when an extension needs user input */\nexport type RpcExtensionUIRequest =\n\t| { type: \"extension_ui_request\"; id: string; method: \"select\"; title: string; options: string[]; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"confirm\"; title: string; message: string; timeout?: number }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"input\";\n\t\t\ttitle: string;\n\t\t\tplaceholder?: string;\n\t\t\ttimeout?: number;\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"editor\"; title: string; prefill?: string }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"notify\";\n\t\t\tmessage: string;\n\t\t\tnotifyType?: \"info\" | \"warning\" | \"error\";\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setStatus\";\n\t\t\tstatusKey: string;\n\t\t\tstatusText: string | undefined;\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setWidget\";\n\t\t\twidgetKey: string;\n\t\t\twidgetLines: string[] | undefined;\n\t\t\twidgetPlacement?: \"aboveEditor\" | \"belowEditor\";\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setTitle\"; title: string }\n\t| { type: \"extension_ui_request\"; id: string; method: \"set_editor_text\"; text: string };\n\n// ============================================================================\n// Extension UI Commands (stdin)\n// ============================================================================\n\n/** Response to an extension UI request */\nexport type RpcExtensionUIResponse =\n\t| { type: \"extension_ui_response\"; id: string; value: string }\n\t| { type: \"extension_ui_response\"; id: string; confirmed: boolean }\n\t| { type: \"extension_ui_response\"; id: string; cancelled: true };\n\n// ============================================================================\n// Helper type for extracting command types\n// ============================================================================\n\nexport type RpcCommandType = RpcCommand[\"type\"];\n"]}
|
|
1
|
+
{"version":3,"file":"rpc-types.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * RPC protocol types for headless operation.\n *\n * Commands are sent as JSON lines on stdin.\n * Responses and events are emitted as JSON lines on stdout.\n */\n\nimport type { AgentMessage, ThinkingLevel } from \"@punch-bot/agent\";\nimport type { ImageContent, Model } from \"@punch-bot/ai\";\nimport type { PromptDisposition, QueuedInputDisposition, SessionStats } from \"../../core/agent-session.ts\";\nimport type { BashResult } from \"../../core/bash-executor.ts\";\nimport type { CompactionResult } from \"../../core/compaction/index.ts\";\nimport type { Delivery } from \"../../core/delivery.ts\";\nimport type { SessionEntry, SessionTreeNode } from \"../../core/session-manager.ts\";\nimport type { SourceInfo } from \"../../core/source-info.ts\";\n\n// ============================================================================\n// RPC Commands (stdin)\n// ============================================================================\n\nexport type RpcCommand =\n\t// Prompting\n\t| { id?: string; type: \"prompt\"; message: string; images?: ImageContent[]; streamingBehavior?: \"steer\" | \"followUp\" }\n\t| { id?: string; type: \"steer\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"follow_up\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"abort\" }\n\t| { id?: string; type: \"clear_queue\" }\n\t| { id?: string; type: \"new_session\"; parentSession?: string }\n\n\t// State\n\t| { id?: string; type: \"get_state\" }\n\n\t// Model\n\t| { id?: string; type: \"set_model\"; provider: string; modelId: string }\n\t| { id?: string; type: \"resolve_model\"; provider: string; modelId: string }\n\t| { id?: string; type: \"cycle_model\" }\n\t| { id?: string; type: \"get_available_models\" }\n\n\t// Thinking\n\t| { id?: string; type: \"set_thinking_level\"; level: ThinkingLevel }\n\t| { id?: string; type: \"cycle_thinking_level\" }\n\t| { id?: string; type: \"get_available_thinking_levels\" }\n\n\t// Queue modes\n\t| { id?: string; type: \"set_steering_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\t| { id?: string; type: \"set_follow_up_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\n\t// Compaction\n\t| { id?: string; type: \"compact\"; customInstructions?: string }\n\t| { id?: string; type: \"set_auto_compaction\"; enabled: boolean }\n\n\t// Retry\n\t| { id?: string; type: \"set_auto_retry\"; enabled: boolean }\n\t| { id?: string; type: \"abort_retry\" }\n\n\t// Bash\n\t| { id?: string; type: \"bash\"; command: string; excludeFromContext?: boolean }\n\t| { id?: string; type: \"abort_bash\" }\n\n\t// Files\n\t| { id?: string; type: \"read_file\"; path: string; maxBytes?: number }\n\n\t// Session\n\t| { id?: string; type: \"get_session_stats\" }\n\t| { id?: string; type: \"export_html\"; outputPath?: string }\n\t| { id?: string; type: \"switch_session\"; sessionPath: string }\n\t| { id?: string; type: \"fork\"; entryId: string }\n\t| { id?: string; type: \"clone\" }\n\t| { id?: string; type: \"get_fork_messages\" }\n\t| { id?: string; type: \"get_entries\"; since?: string }\n\t| { id?: string; type: \"get_tree\" }\n\t| { id?: string; type: \"get_last_assistant_text\" }\n\t| { id?: string; type: \"set_session_name\"; name: string }\n\n\t// Messages\n\t| { id?: string; type: \"get_messages\" }\n\n\t// Commands (available for invocation via prompt)\n\t| { id?: string; type: \"get_commands\" };\n\n// ============================================================================\n// RPC Slash Command (for get_commands response)\n// ============================================================================\n\n/** A command available for invocation via prompt */\nexport interface RpcSlashCommand {\n\t/** Command name (without leading slash) */\n\tname: string;\n\t/** Human-readable description */\n\tdescription?: string;\n\t/** What kind of command this is */\n\tsource: \"extension\" | \"prompt\" | \"skill\";\n\t/** Source metadata for the owning resource */\n\tsourceInfo: SourceInfo;\n}\n\n// ============================================================================\n// RPC State\n// ============================================================================\n\nexport interface RpcSessionState {\n\tmodel?: Model<any>;\n\tthinkingLevel: ThinkingLevel;\n\tisStreaming: boolean;\n\tisCompacting: boolean;\n\tsteeringMode: \"all\" | \"one-at-a-time\";\n\tfollowUpMode: \"all\" | \"one-at-a-time\";\n\tsessionFile?: string;\n\tsessionId: string;\n\tsessionName?: string;\n\tautoCompactionEnabled: boolean;\n\tmessageCount: number;\n\tpendingMessageCount: number;\n}\n\n// ============================================================================\n// RPC Responses (stdout)\n// ============================================================================\n\n// Success responses with data\nexport type RpcResponse =\n\t// Prompting\n\t| { id?: string; type: \"response\"; command: \"prompt\"; success: true; data: { disposition: PromptDisposition } }\n\t| { id?: string; type: \"response\"; command: \"steer\"; success: true; data: { disposition: QueuedInputDisposition } }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"follow_up\";\n\t\t\tsuccess: true;\n\t\t\tdata: { disposition: QueuedInputDisposition };\n\t }\n\t| { id?: string; type: \"response\"; command: \"abort\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"clear_queue\";\n\t\t\tsuccess: true;\n\t\t\tdata: { steering: string[]; followUp: string[] };\n\t }\n\t| { id?: string; type: \"response\"; command: \"new_session\"; success: true; data: { cancelled: boolean } }\n\n\t// State\n\t| { id?: string; type: \"response\"; command: \"get_state\"; success: true; data: RpcSessionState }\n\n\t// Model\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"set_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: Model<any>;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"resolve_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: Model<any>;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: { model: Model<any>; thinkingLevel: ThinkingLevel; isScoped: boolean } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_models\";\n\t\t\tsuccess: true;\n\t\t\tdata: { models: Model<any>[] };\n\t }\n\n\t// Thinking\n\t| { id?: string; type: \"response\"; command: \"set_thinking_level\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_thinking_level\";\n\t\t\tsuccess: true;\n\t\t\tdata: { level: ThinkingLevel } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_thinking_levels\";\n\t\t\tsuccess: true;\n\t\t\tdata: { levels: ThinkingLevel[] };\n\t }\n\n\t// Queue modes\n\t| { id?: string; type: \"response\"; command: \"set_steering_mode\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"set_follow_up_mode\"; success: true }\n\n\t// Compaction\n\t| { id?: string; type: \"response\"; command: \"compact\"; success: true; data: CompactionResult }\n\t| { id?: string; type: \"response\"; command: \"set_auto_compaction\"; success: true }\n\n\t// Retry\n\t| { id?: string; type: \"response\"; command: \"set_auto_retry\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort_retry\"; success: true }\n\n\t// Bash\n\t| { id?: string; type: \"response\"; command: \"bash\"; success: true; data: BashResult }\n\t| { id?: string; type: \"response\"; command: \"abort_bash\"; success: true }\n\n\t// Files\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"read_file\";\n\t\t\tsuccess: true;\n\t\t\tdata: { text?: string; base64?: string; mimeType?: string; size: number; truncated: boolean };\n\t }\n\n\t// Session\n\t| { id?: string; type: \"response\"; command: \"get_session_stats\"; success: true; data: SessionStats }\n\t| { id?: string; type: \"response\"; command: \"export_html\"; success: true; data: { path: string } }\n\t| { id?: string; type: \"response\"; command: \"switch_session\"; success: true; data: { cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"fork\"; success: true; data: { text: string; cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"clone\"; success: true; data: { cancelled: boolean } }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_fork_messages\";\n\t\t\tsuccess: true;\n\t\t\tdata: { messages: Array<{ entryId: string; text: string }> };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_entries\";\n\t\t\tsuccess: true;\n\t\t\tdata: { entries: SessionEntry[]; leafId: string | null };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_tree\";\n\t\t\tsuccess: true;\n\t\t\tdata: { tree: SessionTreeNode[]; leafId: string | null };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_last_assistant_text\";\n\t\t\tsuccess: true;\n\t\t\tdata: { text: string | null };\n\t }\n\t| { id?: string; type: \"response\"; command: \"set_session_name\"; success: true }\n\n\t// Messages\n\t| { id?: string; type: \"response\"; command: \"get_messages\"; success: true; data: { messages: AgentMessage[] } }\n\n\t// Commands\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_commands\";\n\t\t\tsuccess: true;\n\t\t\tdata: { commands: RpcSlashCommand[] };\n\t }\n\n\t// Error response (any command can fail)\n\t| { id?: string; type: \"response\"; command: string; success: false; error: string };\n\n// ============================================================================\n// Delivery Event (stdout)\n// ============================================================================\n\n/** Structured platform-neutral delivery parsed from the final assistant message */\nexport type RpcDeliveryEvent = { type: \"delivery\"; delivery: Delivery };\n\n// ============================================================================\n// Extension UI Events (stdout)\n// ============================================================================\n\n/** Emitted when an extension needs user input */\nexport type RpcExtensionUIRequest =\n\t| { type: \"extension_ui_request\"; id: string; method: \"select\"; title: string; options: string[]; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"confirm\"; title: string; message: string; timeout?: number }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"input\";\n\t\t\ttitle: string;\n\t\t\tplaceholder?: string;\n\t\t\ttimeout?: number;\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"editor\"; title: string; prefill?: string }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"notify\";\n\t\t\tmessage: string;\n\t\t\tnotifyType?: \"info\" | \"warning\" | \"error\";\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setStatus\";\n\t\t\tstatusKey: string;\n\t\t\tstatusText: string | undefined;\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setWidget\";\n\t\t\twidgetKey: string;\n\t\t\twidgetLines: string[] | undefined;\n\t\t\twidgetPlacement?: \"aboveEditor\" | \"belowEditor\";\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setTitle\"; title: string }\n\t| { type: \"extension_ui_request\"; id: string; method: \"set_editor_text\"; text: string };\n\n// ============================================================================\n// Extension UI Commands (stdin)\n// ============================================================================\n\n/** Response to an extension UI request */\nexport type RpcExtensionUIResponse =\n\t| { type: \"extension_ui_response\"; id: string; value: string }\n\t| { type: \"extension_ui_response\"; id: string; confirmed: boolean }\n\t| { type: \"extension_ui_response\"; id: string; cancelled: true };\n\n// ============================================================================\n// Helper type for extracting command types\n// ============================================================================\n\nexport type RpcCommandType = RpcCommand[\"type\"];\n"]}
|
package/docs/cli.md
CHANGED
|
@@ -61,15 +61,15 @@ pi --model sonnet:high
|
|
|
61
61
|
See [Choose a Model](models.md) for model selection and [Providers](providers.md) for credentials.
|
|
62
62
|
|
|
63
63
|
- `--provider <name>`<br>
|
|
64
|
-
Selects the provider for `--model`. It requires `--model`.
|
|
65
|
-
- `--model <
|
|
66
|
-
Selects
|
|
64
|
+
Selects the provider to search for `--model`. It requires `--model`.
|
|
65
|
+
- `--model <pattern>`<br>
|
|
66
|
+
Selects by exact ID or partial ID/name match. It accepts `provider/id` and an optional `:<thinking>` suffix, which is parsed only when the full string is not a catalog ID. If several providers match, Pi prefers the one with credentials, otherwise it asks for `--provider`. A partial match prints a warning naming the model it selected. Among partial matches, a base ID beats its catalog variants (`gemini-2.5-pro` selects `google/gemini-2.5-pro`, not `google/gemini-2.5-pro:batch`), an ID ending in the text beats one continuing it (`sonnet-5` selects `claude-sonnet-5`, not `claude-sonnet-5.5`), and otherwise the latest ID wins. With `--provider` or a known `provider/` prefix, an ID the catalog does not list is used as a custom model ID with a warning; a bare unknown ID fails. If it is a catalog ID plus a suffix, such as OpenRouter's routing variants (`openrouter/openai/gpt-6.1-sol:nitro`), it keeps that model's limits and prices.
|
|
67
67
|
- `--api-key <key>`<br>
|
|
68
68
|
Uses a non-persistent API-key override. It requires a model selected through `--model` or `--models`. It does not choose between providers that offer the same model.
|
|
69
69
|
- `--thinking <level>`<br>
|
|
70
70
|
Sets `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, or `max`. It overrides a `--model` suffix and is clamped to the model's capabilities.
|
|
71
|
-
- `--models <
|
|
72
|
-
Sets a comma-separated scope for startup and cycling. It accepts exact IDs,
|
|
71
|
+
- `--models <patterns>`<br>
|
|
72
|
+
Sets a comma-separated scope for startup and cycling. It accepts exact IDs, partial matches (with a warning), case-insensitive globs, and optional `:<thinking>` suffixes. A model offered by several providers is added for each, with a warning. An entry that matches nothing is skipped with a warning.
|
|
73
73
|
- `--list-models [search]`<br>
|
|
74
74
|
Lists available models, optionally filtered by a fuzzy search, then exits.
|
|
75
75
|
|
|
@@ -227,7 +227,7 @@ pi --append-system-prompt ./instructions.md
|
|
|
227
227
|
See [Configuration](configuration.md) for saved configuration, [Security](security.md#understand-project-trust) for project trust, and [Environment Variables](environment-variables.md) for process controls.
|
|
228
228
|
|
|
229
229
|
- `--system-prompt <text|path>`<br>
|
|
230
|
-
Replaces the default system prompt with text or the contents of an existing file.
|
|
230
|
+
Replaces the opening of the default system prompt with text or the contents of an existing file. The tool list and rules still follow it.
|
|
231
231
|
- `--append-system-prompt <text|path>`<br>
|
|
232
232
|
Appends text or an existing file to the system prompt and is repeatable.
|
|
233
233
|
- `--tui-mode <mode>`<br>
|
package/docs/configuration.md
CHANGED
|
@@ -16,7 +16,7 @@ The agent directory is shown as `<agent-dir>` below. Set its location with the `
|
|
|
16
16
|
| `<agent-dir>/models.json` | [Compatible endpoints, models, and model overrides](models.md#configure-a-compatible-endpoint). |
|
|
17
17
|
| `<agent-dir>/auth.json` | Saved API keys and OAuth credentials. |
|
|
18
18
|
| `<agent-dir>/AGENTS.override.md`, `AGENTS.md`, `AGENTS.MD`, `CLAUDE.md`, or `CLAUDE.MD` | User instructions applied across working directories. |
|
|
19
|
-
| `<agent-dir>/SYSTEM.md` | Replaces Pi’s default system prompt. |
|
|
19
|
+
| `<agent-dir>/SYSTEM.md` | Replaces the opening of Pi’s default system prompt. The tool list and rules still follow it. |
|
|
20
20
|
| `<agent-dir>/APPEND_SYSTEM.md` | Adds instructions to Pi’s system prompt. |
|
|
21
21
|
| `<agent-dir>/extensions/` | User [extensions](extensions.md). |
|
|
22
22
|
| `<agent-dir>/skills/` | User [skills](skills.md) and supporting files. |
|
|
@@ -29,7 +29,7 @@ The agent directory is shown as `<agent-dir>` below. Set its location with the `
|
|
|
29
29
|
|---|---|
|
|
30
30
|
| `.pi/settings.json` | Project-level [settings](settings.md), resource paths, and Pi package declarations. |
|
|
31
31
|
| `.pi/mcp.json` | Project [MCP servers](mcp.md). |
|
|
32
|
-
| `.pi/SYSTEM.md` | Replaces the system prompt for the project. |
|
|
32
|
+
| `.pi/SYSTEM.md` | Replaces the opening of the system prompt for the project. The tool list and rules still follow it. |
|
|
33
33
|
| `.pi/APPEND_SYSTEM.md` | Adds project-specific instructions to the system prompt. |
|
|
34
34
|
| `.pi/extensions/` | Project extensions. |
|
|
35
35
|
| `.pi/skills/` | Project skills and supporting files. |
|
package/docs/docs.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Punch todos
|
|
2
|
+
|
|
3
|
+
The Punch `todo` tool stores ordered tasks in `todos.sqlite` under `PI_DATA_DIR`, or under the user agent directory when `PI_DATA_DIR` is unset. Each task list belongs to one core session ID and the original working directory recorded in its session header. Resuming with a working directory override keeps the same list. A new session starts with an empty list. Sessions without persistence keep their tasks in memory. The context hook reads that session's current list before model requests.
|
|
4
|
+
|
|
5
|
+
Every `todo` tool result carries the session's full list after the action in `details.todos`, in plan order. RPC clients can read it from the `tool_execution_end` event's `result.details` without polling the HTTP API:
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{ "todos": [{ "id": 1, "text": "Write tests", "done": true }, { "id": 2, "text": "Ship", "done": false }] }
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
A failed action, such as toggling a missing ID, ends with `isError: true` and empty `details`; keep the last list you received.
|
|
12
|
+
|
|
13
|
+
The embedded Punch HTTP server provides authenticated task access:
|
|
14
|
+
|
|
15
|
+
| Method | Path | Result |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| `GET` | `/todos/{sessionId}` | Current tasks, next ID, and recent changes |
|
|
18
|
+
| `DELETE` | `/todos/{sessionId}` | Deletes the list and blocks later writes to that session ID |
|
|
19
|
+
|
|
20
|
+
The API is limited to the sandbox owner, the first configured Punch HTTP user. The bot should call `DELETE` with the old **core session ID** when it discards that session on `/punch new`. Deleting the bot's logical conversation ID will not affect a different core session ID. The delete is idempotent. Creating or switching core sessions does not delete another session's tasks, because a sandbox can serve multiple conversations.
|
|
21
|
+
|
|
22
|
+
Both endpoints use the server's current working directory by default. When the session header records another directory, pass that original absolute path as the URL-encoded `cwd` query parameter, such as `/todos/work?cwd=%2Fworkspace%2Fproject`. Use the header's directory even when the session resumes with a working directory override. For legacy headers without `cwd`, the storage scope is the absolute directory containing the session file; pass that directory in the query.
|
|
23
|
+
|
|
24
|
+
Earlier versions kept one list in `todos.json`: `$PI_DATA_DIR/todos.json` when `PI_DATA_DIR` is set, which every project in that data directory shares, otherwise `.pi/todos.json` in the working directory. After the upgrade, each such file is imported once, into the first persistent session that starts with that file in reach and has no stored tasks yet. A session that already has tasks skips the import and leaves the file for a later session. The extension leaves the JSON file in place and records its migration in SQLite, so it cannot import again after a reset. The old file has no thread or session identifier; its original owner cannot be recovered automatically.
|
package/docs/rpc-commands.md
CHANGED
|
@@ -209,7 +209,7 @@ Messages are `AgentMessage` objects (see [Message Types](message-types.md)).
|
|
|
209
209
|
|
|
210
210
|
### set_model
|
|
211
211
|
|
|
212
|
-
Switch to an exact provider and model ID. `modelId` is literal, including
|
|
212
|
+
Switch to an exact provider and model ID. `modelId` is literal, including catalog suffixes such as `:free`, and is never matched partially; use `set_thinking_level` separately. An available catalog ID may also carry suffixes the catalog does not list, such as OpenRouter's routing variants (`openai/gpt-6.1-sol:floor`, `openai/gpt-6.1-sol:nitro:exacto`). The selected model is a copy of the base catalog model whose `id` keeps the suffixes, so they reach the provider verbatim, and whose `name` lists them. Missing or unavailable IDs, empty suffixes, and thinking levels used as suffixes (`:high`) return an error and leave the current model selected.
|
|
213
213
|
|
|
214
214
|
```json
|
|
215
215
|
{"type": "set_model", "provider": "anthropic", "modelId": "claude-sonnet-4-20250514"}
|
|
@@ -225,6 +225,34 @@ Response contains the full [Model](#model-object) object:
|
|
|
225
225
|
}
|
|
226
226
|
```
|
|
227
227
|
|
|
228
|
+
### resolve_model
|
|
229
|
+
|
|
230
|
+
Resolve a provider and model ID exactly as `set_model` would, without changing the session's model. Use it to validate a model reference before saving it.
|
|
231
|
+
|
|
232
|
+
```json
|
|
233
|
+
{"type": "resolve_model", "provider": "openrouter", "modelId": "openai/gpt-6.1-sol:floor"}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Response contains the full [Model](#model-object) object `set_model` would select:
|
|
237
|
+
```json
|
|
238
|
+
{
|
|
239
|
+
"type": "response",
|
|
240
|
+
"command": "resolve_model",
|
|
241
|
+
"success": true,
|
|
242
|
+
"data": {"provider": "openrouter", "id": "openai/gpt-6.1-sol:floor", "name": "OpenAI: GPT-6.1 Sol (floor)", ...}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
A reference `set_model` would reject returns the same error message:
|
|
247
|
+
```json
|
|
248
|
+
{
|
|
249
|
+
"type": "response",
|
|
250
|
+
"command": "resolve_model",
|
|
251
|
+
"success": false,
|
|
252
|
+
"error": "Model not found: openrouter/openai/gpt-6.1-sol:turbo"
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
228
256
|
### cycle_model
|
|
229
257
|
|
|
230
258
|
Cycle to the next available model. Returns `null` data if only one model available.
|
|
@@ -251,7 +279,7 @@ The `model` field is a full [Model](#model-object) object.
|
|
|
251
279
|
|
|
252
280
|
### get_available_models
|
|
253
281
|
|
|
254
|
-
List all configured models.
|
|
282
|
+
List all configured models. OpenRouter routing-suffix variants are not listed; use `resolve_model` to check one.
|
|
255
283
|
|
|
256
284
|
```json
|
|
257
285
|
{"type": "get_available_models"}
|
package/docs/rpc.md
CHANGED
|
@@ -17,7 +17,7 @@ pi --mode rpc --no-session
|
|
|
17
17
|
|
|
18
18
|
Normal CLI options still select the working folder, model, tools, resources, and session behavior. Common choices include `--provider`, `--model`, `--name`, `--no-session`, and `--session-dir`. See [Command Line](cli.md) for the complete, version-specific interface; `pi --help` is authoritative for the installed version.
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Startup `--model` and `--models` accept partial matches as described in [Command Line](cli.md) and print a warning naming the model they selected. RPC commands never match partially: `set_model` takes an available `provider` and `modelId` exactly, or a catalog ID plus a suffix the catalog does not list, such as OpenRouter's `openai/gpt-6.1-sol:nitro`, which keeps the base model's metadata. `resolve_model` checks a reference the same way without selecting it. A restored session or saved default whose model is gone falls back to an available model, and startup prints a warning naming both. Switching to or forking a session with a saved model restores that model; startup `--model` applies to the first session and to sessions without a saved model.
|
|
21
21
|
|
|
22
22
|
RPC mode rejects `@file` prompt arguments. Send prompts through the [`prompt`](rpc-commands.md#prompt) command instead.
|
|
23
23
|
|
package/docs/settings.md
CHANGED
|
@@ -15,7 +15,7 @@ Add `"$schema": "https://raw.githubusercontent.com/punch-bot/core/main/packages/
|
|
|
15
15
|
| `defaultThinkingLevel` | `"off" \| "minimal" \| "low" \| "medium" \| "high" \| "xhigh" \| "max"` | `"medium"` | Startup thinking level. |
|
|
16
16
|
| `modelThinkingLevels` | object | None | Per-model startup thinking levels keyed by exact `provider/modelId`. |
|
|
17
17
|
| `thinkingBudgets` | object | Built-in budgets | Token budgets for `minimal`, `low`, `medium`, and `high` thinking levels. |
|
|
18
|
-
| `enabledModels` | `string[]` | All available models |
|
|
18
|
+
| `enabledModels` | `string[]` | All available models | Model patterns or globs used for startup selection and model cycling. Uses the same format as `--models`; stale entries are skipped with a warning. |
|
|
19
19
|
| `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in the transcript. |
|
|
20
20
|
| `showCacheMissNotices` | boolean | `false` | Show notices for significant cache misses, successful cache warming, compaction usage, and provider recovery. |
|
|
21
21
|
| `cacheWarming` | `"off" \| "streaming" \| "idle"` | `"streaming"` | Keep eligible provider prompt caches warm during active runs or, with `"idle"`, between runs. Global setting only. |
|
|
@@ -146,7 +146,7 @@ When multiple sources specify a session directory, precedence is `--session-dir`
|
|
|
146
146
|
|
|
147
147
|
| Setting | Type | Default | Description |
|
|
148
148
|
|---------|------|---------|-------------|
|
|
149
|
-
| `enabledModels` | string[] | - |
|
|
149
|
+
| `enabledModels` | string[] | - | Model patterns or globs available to the session (same format as `--models`); stale entries are skipped with a warning |
|
|
150
150
|
|
|
151
151
|
See [Shell aliases](shell-aliases.md) for shell setup and [Pi Packages](packages.md) for package-manager behavior.
|
|
152
152
|
|
package/docs/usage.md
CHANGED
|
@@ -47,11 +47,13 @@ Use context files for project conventions, commands, safety rules, and preferenc
|
|
|
47
47
|
|
|
48
48
|
### System Prompt Files
|
|
49
49
|
|
|
50
|
-
Replace the default system prompt with:
|
|
50
|
+
Replace the opening of the default system prompt (Pi's persona and role) with:
|
|
51
51
|
|
|
52
52
|
- `.pi/SYSTEM.md` for a project
|
|
53
53
|
- `~/.pi/agent/SYSTEM.md` globally
|
|
54
54
|
|
|
55
|
+
The tool list and rules, including tool and extension guidelines, still follow the custom opening. Pi's documentation pointers are left out.
|
|
56
|
+
|
|
55
57
|
Run `pi` from the folder you want to work in. Pi uses that folder to discover files, instructions, and configuration, and to group saved sessions. If you have not installed Pi or chosen a model yet, follow the [Quickstart](quickstart.md).
|
|
56
58
|
|
|
57
59
|
Pi may ask whether you trust the working folder before loading its project resources. See [Project trust](security.md#understand-project-trust).
|
|
@@ -120,10 +122,10 @@ Prompt templates, skills, and extensions can add more commands to the same menu.
|
|
|
120
122
|
| Option | Description |
|
|
121
123
|
|--------|-------------|
|
|
122
124
|
| `--provider <name>` | Provider, such as `anthropic`, `openai`, or `google` |
|
|
123
|
-
| `--model <
|
|
125
|
+
| `--model <pattern>` | Model ID or partial match (warns), supports `provider/id` and optional `:<thinking>` |
|
|
124
126
|
| `--api-key <key>` | API key, overriding environment variables |
|
|
125
127
|
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
|
|
126
|
-
| `--models <
|
|
128
|
+
| `--models <patterns>` | Comma-separated model patterns or globs (e.g. `openrouter/*`) available to the session |
|
|
127
129
|
| `--list-models [search]` | List available models |
|
|
128
130
|
|
|
129
131
|
### Session Options
|
|
@@ -173,7 +175,7 @@ Pi saves sessions automatically unless session persistence is disabled.
|
|
|
173
175
|
|
|
174
176
|
| Option | Description |
|
|
175
177
|
|--------|-------------|
|
|
176
|
-
| `--system-prompt <text>` | Replace default prompt; context files and skills are still appended |
|
|
178
|
+
| `--system-prompt <text>` | Replace the default prompt's opening; tools, rules, context files, and skills are still appended |
|
|
177
179
|
| `--append-system-prompt <text>` | Append to system prompt |
|
|
178
180
|
| `--use-theme <name[/name]>` | Set the theme for this run without changing settings |
|
|
179
181
|
| `--verbose` | Force verbose startup |
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.4.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-gondolin",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.4.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.12.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.4.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "0.0.26"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.4.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
|
@@ -9,7 +9,7 @@ import { createAgentSession, DefaultResourceLoader, getAgentDir, SessionManager
|
|
|
9
9
|
const cwd = process.cwd();
|
|
10
10
|
const agentDir = getAgentDir();
|
|
11
11
|
|
|
12
|
-
// Option 1: Replace prompt
|
|
12
|
+
// Option 1: Replace the prompt's opening (tool list and rules still follow)
|
|
13
13
|
const loader1 = new DefaultResourceLoader({
|
|
14
14
|
cwd,
|
|
15
15
|
agentDir,
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@punch-bot/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@punch-bot/cli",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.4.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@punch-bot/a2a": "1.
|
|
13
|
-
"@punch-bot/agent": "1.
|
|
14
|
-
"@punch-bot/ai": "1.
|
|
12
|
+
"@punch-bot/a2a": "1.4.0",
|
|
13
|
+
"@punch-bot/agent": "1.4.0",
|
|
14
|
+
"@punch-bot/ai": "1.4.0",
|
|
15
15
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
16
16
|
"brace-expansion": "5.0.12",
|
|
17
17
|
"chalk": "6.0.0",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"typebox": "1.3.27",
|
|
32
32
|
"undici": "8.11.0",
|
|
33
33
|
"yaml": "2.9.0",
|
|
34
|
-
"@punch-bot/codemode": "1.
|
|
35
|
-
"@punch-bot/mcp": "1.
|
|
34
|
+
"@punch-bot/codemode": "1.4.0",
|
|
35
|
+
"@punch-bot/mcp": "1.4.0",
|
|
36
36
|
"quickjs-wasi": "3.6.2"
|
|
37
37
|
},
|
|
38
38
|
"bin": {
|
|
@@ -159,8 +159,8 @@
|
|
|
159
159
|
"license": "BSD-3-Clause"
|
|
160
160
|
},
|
|
161
161
|
"node_modules/@punch-bot/a2a": {
|
|
162
|
-
"version": "1.
|
|
163
|
-
"resolved": "https://registry.npmjs.org/@punch-bot/a2a/-/a2a-1.
|
|
162
|
+
"version": "1.4.0",
|
|
163
|
+
"resolved": "https://registry.npmjs.org/@punch-bot/a2a/-/a2a-1.4.0.tgz",
|
|
164
164
|
"license": "MIT",
|
|
165
165
|
"dependencies": {
|
|
166
166
|
"@a2a-js/sdk": "1.0.1",
|
|
@@ -171,11 +171,11 @@
|
|
|
171
171
|
}
|
|
172
172
|
},
|
|
173
173
|
"node_modules/@punch-bot/agent": {
|
|
174
|
-
"version": "1.
|
|
175
|
-
"resolved": "https://registry.npmjs.org/@punch-bot/agent/-/agent-1.
|
|
174
|
+
"version": "1.4.0",
|
|
175
|
+
"resolved": "https://registry.npmjs.org/@punch-bot/agent/-/agent-1.4.0.tgz",
|
|
176
176
|
"license": "MIT",
|
|
177
177
|
"dependencies": {
|
|
178
|
-
"@punch-bot/ai": "1.
|
|
178
|
+
"@punch-bot/ai": "1.4.0",
|
|
179
179
|
"typebox": "1.3.27"
|
|
180
180
|
},
|
|
181
181
|
"engines": {
|
|
@@ -183,13 +183,13 @@
|
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
185
|
"node_modules/@punch-bot/ai": {
|
|
186
|
-
"version": "1.
|
|
187
|
-
"resolved": "https://registry.npmjs.org/@punch-bot/ai/-/ai-1.
|
|
186
|
+
"version": "1.4.0",
|
|
187
|
+
"resolved": "https://registry.npmjs.org/@punch-bot/ai/-/ai-1.4.0.tgz",
|
|
188
188
|
"license": "MIT",
|
|
189
189
|
"dependencies": {
|
|
190
190
|
"@anthropic-ai/sdk": "0.129.0",
|
|
191
191
|
"@aws-sdk/client-bedrock-runtime": "3.1127.0",
|
|
192
|
-
"@punch-bot/telemetry": "1.
|
|
192
|
+
"@punch-bot/telemetry": "1.4.0",
|
|
193
193
|
"@google/genai": "2.21.0",
|
|
194
194
|
"@smithy/node-http-handler": "4.12.1",
|
|
195
195
|
"http-proxy-agent": "9.1.0",
|
|
@@ -689,8 +689,8 @@
|
|
|
689
689
|
}
|
|
690
690
|
},
|
|
691
691
|
"node_modules/@punch-bot/codemode": {
|
|
692
|
-
"version": "1.
|
|
693
|
-
"resolved": "https://registry.npmjs.org/@punch-bot/codemode/-/codemode-1.
|
|
692
|
+
"version": "1.4.0",
|
|
693
|
+
"resolved": "https://registry.npmjs.org/@punch-bot/codemode/-/codemode-1.4.0.tgz",
|
|
694
694
|
"license": "MIT",
|
|
695
695
|
"dependencies": {
|
|
696
696
|
"quickjs-wasi": "3.6.2"
|
|
@@ -700,8 +700,8 @@
|
|
|
700
700
|
}
|
|
701
701
|
},
|
|
702
702
|
"node_modules/@punch-bot/mcp": {
|
|
703
|
-
"version": "1.
|
|
704
|
-
"resolved": "https://registry.npmjs.org/@punch-bot/mcp/-/mcp-1.
|
|
703
|
+
"version": "1.4.0",
|
|
704
|
+
"resolved": "https://registry.npmjs.org/@punch-bot/mcp/-/mcp-1.4.0.tgz",
|
|
705
705
|
"license": "MIT",
|
|
706
706
|
"dependencies": {
|
|
707
707
|
"cross-spawn": "7.0.6"
|
|
@@ -711,8 +711,8 @@
|
|
|
711
711
|
}
|
|
712
712
|
},
|
|
713
713
|
"node_modules/@punch-bot/telemetry": {
|
|
714
|
-
"version": "1.
|
|
715
|
-
"resolved": "https://registry.npmjs.org/@punch-bot/telemetry/-/telemetry-1.
|
|
714
|
+
"version": "1.4.0",
|
|
715
|
+
"resolved": "https://registry.npmjs.org/@punch-bot/telemetry/-/telemetry-1.4.0.tgz",
|
|
716
716
|
"license": "MIT",
|
|
717
717
|
"engines": {
|
|
718
718
|
"node": ">=22.19.0"
|
package/package.json
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@punch-bot/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Headless coding agent SDK, RPC, and print modes with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"imports": {
|
|
7
|
+
"#punch-sqlite": {
|
|
8
|
+
"types": "./src/extensions/punch/sqlite-driver.d.mts",
|
|
9
|
+
"bun": "./src/extensions/punch/sqlite-bun.mjs",
|
|
10
|
+
"default": "./src/extensions/punch/sqlite-node.mjs"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
6
13
|
"piConfig": {
|
|
7
14
|
"configDir": ".pi"
|
|
8
15
|
},
|
|
@@ -22,6 +29,9 @@
|
|
|
22
29
|
},
|
|
23
30
|
"files": [
|
|
24
31
|
"dist",
|
|
32
|
+
"src/extensions/punch/sqlite-bun.mjs",
|
|
33
|
+
"src/extensions/punch/sqlite-driver.d.mts",
|
|
34
|
+
"src/extensions/punch/sqlite-node.mjs",
|
|
25
35
|
"docs",
|
|
26
36
|
"examples",
|
|
27
37
|
"schemas",
|
|
@@ -42,9 +52,9 @@
|
|
|
42
52
|
"prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
|
|
43
53
|
},
|
|
44
54
|
"dependencies": {
|
|
45
|
-
"@punch-bot/a2a": "1.
|
|
46
|
-
"@punch-bot/agent": "1.
|
|
47
|
-
"@punch-bot/ai": "1.
|
|
55
|
+
"@punch-bot/a2a": "1.4.0",
|
|
56
|
+
"@punch-bot/agent": "1.4.0",
|
|
57
|
+
"@punch-bot/ai": "1.4.0",
|
|
48
58
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
49
59
|
"brace-expansion": "5.0.12",
|
|
50
60
|
"chalk": "6.0.0",
|
|
@@ -64,8 +74,8 @@
|
|
|
64
74
|
"typebox": "1.3.27",
|
|
65
75
|
"undici": "8.11.0",
|
|
66
76
|
"yaml": "2.9.0",
|
|
67
|
-
"@punch-bot/codemode": "1.
|
|
68
|
-
"@punch-bot/mcp": "1.
|
|
77
|
+
"@punch-bot/codemode": "1.4.0",
|
|
78
|
+
"@punch-bot/mcp": "1.4.0",
|
|
69
79
|
"quickjs-wasi": "3.6.2"
|
|
70
80
|
},
|
|
71
81
|
"overrides": {
|
|
@@ -80,7 +90,7 @@
|
|
|
80
90
|
"marked": "18.0.11",
|
|
81
91
|
"shx": "0.3.4",
|
|
82
92
|
"vitest": "5.0.0",
|
|
83
|
-
"@punch-bot/durable": "1.
|
|
93
|
+
"@punch-bot/durable": "1.4.0"
|
|
84
94
|
},
|
|
85
95
|
"keywords": [
|
|
86
96
|
"coding-agent",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Database as DatabaseSync } from "bun:sqlite";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Keep this interface limited to the API shared by node:sqlite and bun:sqlite.
|
|
2
|
+
// Driver changes must be checked with both Node and a compiled Bun smoke test.
|
|
3
|
+
interface Statement {
|
|
4
|
+
run(...params: Array<string | number>): unknown;
|
|
5
|
+
// node:sqlite returns undefined for no row; bun:sqlite returns null.
|
|
6
|
+
get(...params: Array<string | number>): Record<string, unknown> | null | undefined;
|
|
7
|
+
all(...params: Array<string | number>): Array<Record<string, unknown>>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export declare class DatabaseSync {
|
|
11
|
+
constructor(path: string);
|
|
12
|
+
exec(sql: string): void;
|
|
13
|
+
prepare(sql: string): Statement;
|
|
14
|
+
close(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DatabaseSync } from "node:sqlite";
|