@sayknow-cli/coding-agent 0.4.6 → 0.5.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 +112 -0
- package/dist/types/capability/index.d.ts +10 -20
- package/dist/types/capability/types.d.ts +3 -0
- package/dist/types/cli/args.d.ts +0 -2
- package/dist/types/cli/read-cli.d.ts +1 -0
- package/dist/types/cli.d.ts +9 -1
- package/dist/types/commands/daemon.d.ts +2 -2
- package/dist/types/commands/deep-interview.d.ts +9 -0
- package/dist/types/commands/harness.d.ts +22 -0
- package/dist/types/commands/read.d.ts +6 -0
- package/dist/types/commands/sdk.d.ts +20 -2
- package/dist/types/config/keybindings.d.ts +34 -4
- package/dist/types/config/model-profile-contract.d.ts +40 -0
- package/dist/types/config/model-profiles.d.ts +2 -3
- package/dist/types/config/model-registry.d.ts +5 -0
- package/dist/types/config/provider-auth-health.d.ts +14 -0
- package/dist/types/config/provider-ranking.d.ts +59 -0
- package/dist/types/config/settings-schema.d.ts +156 -10
- package/dist/types/config/settings.d.ts +3 -0
- package/dist/types/edit/modes/patch.d.ts +13 -0
- package/dist/types/edit/path-mutation-lock.d.ts +15 -0
- package/dist/types/eval/py/executor.d.ts +1 -1
- package/dist/types/eval/py/runner-artifact.d.ts +8 -0
- package/dist/types/eval/py/tool-bridge.d.ts +1 -2
- package/dist/types/extensibility/extensions/types.d.ts +43 -2
- package/dist/types/extensibility/shared-events.d.ts +6 -0
- package/dist/types/internal-urls/local-root-gc.d.ts +2 -0
- package/dist/types/main.d.ts +33 -2
- package/dist/types/memories/index.d.ts +2 -0
- package/dist/types/modes/acp/acp-agent.d.ts +22 -9
- package/dist/types/modes/components/assistant-message.d.ts +3 -1
- package/dist/types/modes/components/btw-panel.d.ts +1 -0
- package/dist/types/modes/components/irc-sidebar.d.ts +41 -0
- package/dist/types/modes/components/queue-pane.d.ts +8 -0
- package/dist/types/modes/components/queued-message-selector.d.ts +6 -0
- package/dist/types/modes/components/read-tool-group.d.ts +4 -4
- package/dist/types/modes/components/runtime-mcp-add-wizard.d.ts +2 -1
- package/dist/types/modes/components/session-observer-overlay.d.ts +4 -0
- package/dist/types/modes/components/settings-selector.d.ts +2 -0
- package/dist/types/modes/components/tool-execution.d.ts +8 -0
- package/dist/types/modes/components/tool-status-header.d.ts +4 -2
- package/dist/types/modes/components/welcome.d.ts +5 -0
- package/dist/types/modes/controllers/btw-controller.d.ts +5 -0
- package/dist/types/modes/controllers/command-controller.d.ts +2 -0
- package/dist/types/modes/controllers/event-controller.d.ts +3 -0
- package/dist/types/modes/interactive-mode.d.ts +13 -2
- package/dist/types/modes/irc-observation-ledger.d.ts +17 -1
- package/dist/types/modes/prompt-action-autocomplete.d.ts +6 -1
- package/dist/types/modes/prompt-suggestion-controller.d.ts +35 -0
- package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +2 -2
- package/dist/types/modes/types.d.ts +6 -0
- package/dist/types/modes/utils/hotkeys-markdown.d.ts +2 -1
- package/dist/types/modes/utils/ui-helpers.d.ts +16 -0
- package/dist/types/runtime/memory-domain.d.ts +9 -0
- package/dist/types/runtime/memory-guard-contract.d.ts +71 -0
- package/dist/types/runtime/memory-guard.d.ts +39 -0
- package/dist/types/runtime/memory-limit.d.ts +11 -0
- package/dist/types/runtime-mcp/content-limits.d.ts +7 -0
- package/dist/types/runtime-mcp/discoverable-tool-metadata.d.ts +1 -1
- package/dist/types/runtime-mcp/manager.d.ts +9 -1
- package/dist/types/runtime-mcp/oauth-flow.d.ts +0 -5
- package/dist/types/runtime-mcp/plugin-network-boundary.d.ts +14 -0
- package/dist/types/runtime-mcp/redaction.d.ts +2 -0
- package/dist/types/runtime-mcp/smithery-auth.d.ts +5 -0
- package/dist/types/sdk/acp/final-text.d.ts +19 -0
- package/dist/types/sdk/acp/mcp.d.ts +23 -0
- package/dist/types/sdk/broker/broker.d.ts +2 -0
- package/dist/types/sdk/broker/lifecycle.d.ts +13 -0
- package/dist/types/sdk/bus/chat-daemon-control.d.ts +9 -1
- package/dist/types/sdk/bus/config-commands.d.ts +2 -2
- package/dist/types/sdk/bus/config.d.ts +2 -0
- package/dist/types/sdk/bus/control-drain-lease.d.ts +52 -0
- package/dist/types/sdk/bus/conversation-store.d.ts +1 -0
- package/dist/types/sdk/bus/daemon-paths.d.ts +1 -0
- package/dist/types/sdk/bus/index.d.ts +52 -4
- package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +37 -0
- package/dist/types/sdk/bus/lifecycle-commands.d.ts +5 -4
- package/dist/types/sdk/bus/notification-orchestration.d.ts +1 -0
- package/dist/types/sdk/bus/notification-service.d.ts +34 -0
- package/dist/types/sdk/bus/operator-runtime.d.ts +1 -0
- package/dist/types/sdk/bus/prompt-reconciliation.d.ts +106 -0
- package/dist/types/sdk/bus/rate-limit-pool.d.ts +2 -0
- package/dist/types/sdk/bus/reconciliation-store.d.ts +65 -0
- package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +33 -9
- package/dist/types/sdk/bus/telegram-daemon-control.d.ts +5 -1
- package/dist/types/sdk/bus/telegram-daemon.d.ts +286 -12
- package/dist/types/sdk/bus/telegram-reference.d.ts +2 -0
- package/dist/types/sdk/bus/topic-registry.d.ts +88 -2
- package/dist/types/sdk/client/discovery.d.ts +2 -0
- package/dist/types/sdk/client/liveness.d.ts +7 -0
- package/dist/types/sdk/host/control/operations.d.ts +3 -2
- package/dist/types/sdk/host/host.d.ts +3 -1
- package/dist/types/sdk/host/query/handlers.d.ts +14 -0
- package/dist/types/sdk/index.d.ts +2 -0
- package/dist/types/sdk/lifecycle-session.d.ts +10 -1
- package/dist/types/sdk/prompt-status.d.ts +88 -0
- package/dist/types/sdk/session-directory.d.ts +1 -1
- package/dist/types/sdk/session.d.ts +7 -0
- package/dist/types/sdk/startup-capability.d.ts +9 -0
- package/dist/types/sdk/transport/auth-preface.d.ts +9 -0
- package/dist/types/sdk/transport/index.d.ts +12 -0
- package/dist/types/sdk/transport/relay.d.ts +43 -0
- package/dist/types/sdk/transport/serve-cli.d.ts +4 -0
- package/dist/types/sdk/transport/socket.d.ts +7 -0
- package/dist/types/sdk/transport/stdio.d.ts +3 -0
- package/dist/types/session/agent-session.d.ts +83 -24
- package/dist/types/session/btw-contract.d.ts +16 -0
- package/dist/types/session/fallback-chain-controller.d.ts +18 -2
- package/dist/types/session/internal/managed-session-scope.d.ts +70 -10
- package/dist/types/session/internal/managed-session-storage.d.ts +34 -12
- package/dist/types/session/internal/native-publish-outcome.d.ts +48 -0
- package/dist/types/session/memory-guard-checkpoint-participant.d.ts +69 -0
- package/dist/types/session/session-manager.d.ts +89 -18
- package/dist/types/session/session-storage.d.ts +31 -0
- package/dist/types/session/streaming-output.d.ts +60 -5
- package/dist/types/setup/credential-import.d.ts +5 -1
- package/dist/types/setup/provider-onboarding.d.ts +2 -0
- package/dist/types/skc-runtime/deep-interview-runtime.d.ts +1 -1
- package/dist/types/skc-runtime/deep-interview-stage.d.ts +37 -0
- package/dist/types/skc-runtime/gc-runtime.d.ts +1 -1
- package/dist/types/skc-runtime/linux-proc.d.ts +22 -14
- package/dist/types/skc-runtime/memory-guard-owner-claims.d.ts +47 -0
- package/dist/types/skc-runtime/ralplan-runtime.d.ts +112 -1
- package/dist/types/skc-runtime/repository-binding.d.ts +63 -0
- package/dist/types/skc-runtime/state-runtime.d.ts +3 -1
- package/dist/types/skc-runtime/state-writer.d.ts +5 -1
- package/dist/types/skc-runtime/team-launch.d.ts +1 -1
- package/dist/types/skc-runtime/team-runtime.d.ts +9 -2
- package/dist/types/skc-runtime/team-store.d.ts +12 -0
- package/dist/types/skc-runtime/team-worker-memory-guard.d.ts +92 -0
- package/dist/types/skc-runtime/tmux-owner-isolation.d.ts +7 -0
- package/dist/types/skc-runtime/ultragoal-guard.d.ts +6 -5
- package/dist/types/skc-runtime/ultragoal-receipt-freshness.d.ts +28 -0
- package/dist/types/skc-runtime/ultragoal-runtime.d.ts +43 -5
- package/dist/types/skill-state/workflow-hud.d.ts +3 -0
- package/dist/types/ssh/utils.d.ts +1 -0
- package/dist/types/task/discovery.d.ts +3 -1
- package/dist/types/task/executor.d.ts +6 -0
- package/dist/types/task/index.d.ts +3 -1
- package/dist/types/task/provider-retry-status.d.ts +13 -0
- package/dist/types/task/receipt.d.ts +2 -0
- package/dist/types/task/types.d.ts +133 -0
- package/dist/types/task/ultragoal-redteam-activation.d.ts +33 -0
- package/dist/types/tools/browser/launch.d.ts +7 -0
- package/dist/types/tools/fetch.d.ts +22 -9
- package/dist/types/tools/image-gen.d.ts +63 -1
- package/dist/types/tools/index.d.ts +7 -1
- package/dist/types/tools/output-meta.d.ts +21 -1
- package/dist/types/tools/read-internals.d.ts +12 -0
- package/dist/types/tools/read.d.ts +45 -1
- package/dist/types/tools/resource-gc.d.ts +23 -0
- package/dist/types/tools/skill-discovery.d.ts +7 -0
- package/dist/types/tools/sqlite-reader.d.ts +7 -0
- package/dist/types/tools/tool-result.d.ts +7 -1
- package/dist/types/utils/prompt-suggestion.d.ts +33 -0
- package/dist/types/utils/shell-snapshot.d.ts +12 -0
- package/dist/types/web/insane/bridge.d.ts +1 -0
- package/dist/types/web/insane/url-guard.d.ts +17 -0
- package/package.json +8 -12
- package/scripts/benchmark-sticky-viewport-pr1.ts +239 -0
- package/scripts/capture-platform-shortcut-labels-showcase.ts +342 -0
- package/scripts/capture-sticky-viewport-showcase.ts +292 -0
- package/scripts/compile-args.ts +0 -1
- package/scripts/dogfood-repository-binding.ts +209 -0
- package/scripts/generate-docs-index.ts +4 -1
- package/scripts/generate-sdk-operation-inventory.ts +9 -0
- package/scripts/run-test-manifest.ts +6 -4
- package/scripts/verify-skc-sdk-canonicalization.ts +122 -18
- package/scripts/verify-sticky-viewport-showcase.ts +611 -0
- package/src/capability/index.ts +58 -42
- package/src/capability/types.ts +3 -0
- package/src/cli/args.ts +16 -100
- package/src/cli/fast-help.ts +1 -1
- package/src/cli/mcp-cli.ts +4 -21
- package/src/cli/notify-cli.ts +6 -38
- package/src/cli/read-cli.ts +2 -1
- package/src/cli/setup-cli.ts +10 -4
- package/src/cli.ts +133 -11
- package/src/commands/daemon.ts +22 -5
- package/src/commands/deep-interview.ts +26 -1
- package/src/commands/harness.ts +35 -12
- package/src/commands/read.ts +11 -2
- package/src/commands/sdk.ts +134 -17
- package/src/commands/team.ts +1 -1
- package/src/commit/agentic/index.ts +3 -3
- package/src/commit/map-reduce/index.ts +2 -2
- package/src/config/keybindings.ts +158 -25
- package/src/config/model-profile-contract.ts +174 -0
- package/src/config/model-profiles.ts +51 -10
- package/src/config/model-registry.ts +24 -4
- package/src/config/model-resolver.ts +2 -2
- package/src/config/provider-auth-health.ts +42 -0
- package/src/config/provider-ranking.ts +119 -0
- package/src/config/settings-schema.ts +157 -10
- package/src/config/settings.ts +254 -108
- package/src/coordinator-mcp/model-preset.ts +21 -74
- package/src/defaults/skc/skills/deep-interview/SKILL.md +147 -24
- package/src/defaults/skc/skills/ralplan/SKILL.md +91 -34
- package/src/defaults/skc/skills/team/SKILL.md +1 -1
- package/src/defaults/skc/skills/ultragoal/SKILL.md +68 -17
- package/src/discovery/ssh.ts +12 -1
- package/src/edit/index.ts +3 -6
- package/src/edit/modes/patch.ts +38 -1
- package/src/edit/modes/replace.ts +42 -0
- package/src/edit/path-mutation-lock.ts +112 -0
- package/src/eval/js/tool-bridge.ts +1 -1
- package/src/eval/py/executor.ts +37 -13
- package/src/eval/py/kernel.ts +1 -21
- package/src/eval/py/prelude.py +2 -2
- package/src/eval/py/runner-artifact.ts +84 -0
- package/src/eval/py/tool-bridge.ts +34 -18
- package/src/extensibility/extensions/runner.ts +4 -0
- package/src/extensibility/extensions/types.ts +42 -4
- package/src/extensibility/plugins/marketplace/fetcher.ts +191 -7
- package/src/extensibility/shared-events.ts +5 -0
- package/src/extensibility/skc-plugins/runtime-adapters.ts +2 -1
- package/src/hooks/native-skill-hook.ts +17 -4
- package/src/internal-urls/docs-index.generated.ts +17 -16
- package/src/internal-urls/local-protocol.ts +87 -25
- package/src/internal-urls/local-root-gc.ts +127 -0
- package/src/internal-urls/mcp-protocol.ts +73 -11
- package/src/main.ts +120 -42
- package/src/memories/index.ts +10 -0
- package/src/modes/DESIGN.md +52 -0
- package/src/modes/acp/acp-agent.ts +647 -83
- package/src/modes/acp/acp-event-mapper.ts +106 -12
- package/src/modes/acp/acp-mode.ts +39 -3
- package/src/modes/action-registry.ts +1 -1
- package/src/modes/components/assistant-message.ts +123 -22
- package/src/modes/components/btw-panel.ts +82 -16
- package/src/modes/components/irc-sidebar.ts +176 -62
- package/src/modes/components/model-selector.ts +61 -4
- package/src/modes/components/notifications-settings-editor.ts +1 -1
- package/src/modes/components/oauth-selector.ts +42 -12
- package/src/modes/components/plan-preview-overlay.ts +1 -1
- package/src/modes/components/queue-pane.ts +55 -9
- package/src/modes/components/queued-message-selector.ts +53 -10
- package/src/modes/components/read-tool-group.ts +82 -14
- package/src/modes/components/runtime-mcp-add-wizard.ts +5 -0
- package/src/modes/components/sayknow-pet-widget.ts +27 -8
- package/src/modes/components/session-observer-overlay.ts +187 -32
- package/src/modes/components/settings-selector.ts +60 -18
- package/src/modes/components/tool-execution.ts +138 -27
- package/src/modes/components/tool-status-header.ts +26 -8
- package/src/modes/components/welcome.ts +50 -23
- package/src/modes/controllers/btw-controller.ts +119 -36
- package/src/modes/controllers/command-controller.ts +101 -54
- package/src/modes/controllers/event-controller.ts +119 -27
- package/src/modes/controllers/extension-ui-controller.ts +23 -12
- package/src/modes/controllers/input-controller.ts +100 -8
- package/src/modes/controllers/runtime-mcp-command-controller.ts +29 -6
- package/src/modes/controllers/selector-controller.ts +4 -1
- package/src/modes/interactive-mode.ts +201 -60
- package/src/modes/irc-observation-ledger.ts +71 -15
- package/src/modes/prompt-action-autocomplete.ts +32 -13
- package/src/modes/prompt-suggestion-controller.ts +96 -0
- package/src/modes/runtime-init.ts +20 -2
- package/src/modes/shared/agent-wire/command-dispatch.ts +3 -3
- package/src/modes/shared/agent-wire/workflow-gate-broker.ts +2 -2
- package/src/modes/types.ts +6 -0
- package/src/modes/utils/hotkeys-markdown.ts +64 -36
- package/src/modes/utils/ui-helpers.ts +99 -4
- package/src/prompts/agent-fragments/restricted-bash.md +1 -1
- package/src/prompts/agents/architect.md +17 -3
- package/src/prompts/agents/critic.md +17 -2
- package/src/prompts/agents/executor.md +1 -1
- package/src/prompts/agents/planner.md +8 -1
- package/src/prompts/system/btw-user.md +3 -8
- package/src/prompts/system/prompt-suggestion-system.md +32 -0
- package/src/prompts/system/system-prompt.md +6 -3
- package/src/prompts/tools/cron.md +3 -1
- package/src/prompts/tools/read.md +4 -2
- package/src/prompts/tools/skill-discovery.md +1 -0
- package/src/runtime/memory-domain.ts +66 -0
- package/src/runtime/memory-guard-contract.ts +73 -0
- package/src/runtime/memory-guard.ts +292 -0
- package/src/runtime/memory-limit.ts +50 -0
- package/src/runtime-mcp/client.ts +41 -55
- package/src/runtime-mcp/content-limits.ts +71 -0
- package/src/runtime-mcp/discoverable-tool-metadata.ts +1 -1
- package/src/runtime-mcp/json-rpc.ts +28 -11
- package/src/runtime-mcp/manager.ts +77 -59
- package/src/runtime-mcp/oauth-flow.ts +0 -72
- package/src/runtime-mcp/plugin-network-boundary.ts +101 -0
- package/src/runtime-mcp/redaction.ts +30 -0
- package/src/runtime-mcp/smithery-auth.ts +17 -2
- package/src/runtime-mcp/smithery-connect.ts +11 -1
- package/src/runtime-mcp/transports/http.ts +63 -22
- package/src/sdk/acp/adapter.ts +8 -1
- package/src/sdk/acp/final-text.ts +40 -0
- package/src/sdk/acp/mcp.ts +26 -0
- package/src/sdk/broker/broker.ts +34 -20
- package/src/sdk/broker/identity.ts +22 -12
- package/src/sdk/broker/lifecycle.ts +293 -43
- package/src/sdk/broker/session-index.ts +11 -1
- package/src/sdk/bus/chat-daemon-cli.ts +2 -2
- package/src/sdk/bus/chat-daemon-control.ts +22 -5
- package/src/sdk/bus/config-commands.ts +2 -2
- package/src/sdk/bus/config.ts +10 -2
- package/src/sdk/bus/control-drain-lease.ts +104 -0
- package/src/sdk/bus/conversation-store.ts +40 -6
- package/src/sdk/bus/daemon-paths.ts +2 -0
- package/src/sdk/bus/index.ts +793 -121
- package/src/sdk/bus/kind-aware-reconciliation.ts +242 -0
- package/src/sdk/bus/lifecycle-commands.ts +63 -10
- package/src/sdk/bus/lifecycle-control-runtime.ts +11 -2
- package/src/sdk/bus/lifecycle-orchestrator.ts +32 -1
- package/src/sdk/bus/notification-orchestration.ts +12 -0
- package/src/sdk/bus/notification-service.ts +87 -25
- package/src/sdk/bus/operator-runtime.ts +31 -5
- package/src/sdk/bus/prompt-reconciliation.ts +240 -0
- package/src/sdk/bus/rate-limit-pool.ts +8 -0
- package/src/sdk/bus/recent-activity.ts +90 -26
- package/src/sdk/bus/reconciliation-store.ts +224 -0
- package/src/sdk/bus/telegram-cli.ts +6 -13
- package/src/sdk/bus/telegram-daemon-cli.ts +8 -3
- package/src/sdk/bus/telegram-daemon-contract.ts +34 -9
- package/src/sdk/bus/telegram-daemon-control.ts +161 -40
- package/src/sdk/bus/telegram-daemon.ts +3649 -593
- package/src/sdk/bus/telegram-reference.ts +20 -2
- package/src/sdk/bus/topic-registry.ts +451 -12
- package/src/sdk/cli/session-cli.ts +15 -2
- package/src/sdk/client/discovery.ts +19 -3
- package/src/sdk/client/liveness.ts +49 -0
- package/src/sdk/host/control/dispatch.ts +8 -2
- package/src/sdk/host/control/operations.ts +3 -2
- package/src/sdk/host/host.ts +27 -9
- package/src/sdk/host/query/handlers.ts +125 -5
- package/src/sdk/index.ts +12 -0
- package/src/sdk/lifecycle-session.ts +19 -3
- package/src/sdk/mcp/server.ts +46 -18
- package/src/sdk/prompt-status.ts +97 -0
- package/src/sdk/protocol/operation-inventory.generated.json +145 -0
- package/src/sdk/protocol/operation-registry.ts +24 -4
- package/src/sdk/session-directory.ts +5 -1
- package/src/sdk/session.ts +69 -8
- package/src/sdk/startup-capability.ts +15 -1
- package/src/sdk/transport/auth-preface.ts +82 -0
- package/src/sdk/transport/index.ts +18 -0
- package/src/sdk/transport/relay.ts +252 -0
- package/src/sdk/transport/serve-cli.ts +105 -0
- package/src/sdk/transport/socket.ts +197 -0
- package/src/sdk/transport/stdio.ts +17 -0
- package/src/session/agent-session.ts +1112 -314
- package/src/session/blob-store.ts +25 -7
- package/src/session/btw-contract.ts +59 -0
- package/src/session/fallback-chain-controller.ts +47 -8
- package/src/session/internal/managed-session-scope.ts +1426 -259
- package/src/session/internal/managed-session-storage.ts +414 -238
- package/src/session/internal/native-publish-outcome.ts +271 -0
- package/src/session/memory-guard-checkpoint-participant.ts +131 -0
- package/src/session/session-manager.ts +2079 -469
- package/src/session/session-storage.ts +151 -11
- package/src/session/streaming-output.ts +262 -43
- package/src/setup/credential-import.ts +28 -3
- package/src/setup/provider-onboarding.ts +49 -5
- package/src/setup/provider-presets.json +2 -1
- package/src/skc-runtime/deep-interview-runtime.ts +303 -36
- package/src/skc-runtime/deep-interview-stage.ts +1016 -0
- package/src/skc-runtime/deep-interview-state.ts +8 -5
- package/src/skc-runtime/gc-render.ts +1 -0
- package/src/skc-runtime/gc-runtime.ts +11 -1
- package/src/skc-runtime/linux-proc.ts +70 -36
- package/src/skc-runtime/managed-owner-supervisor.ts +83 -4
- package/src/skc-runtime/memory-guard-owner-claims.ts +389 -0
- package/src/skc-runtime/ralplan-runtime.ts +1057 -75
- package/src/skc-runtime/repository-binding.ts +267 -0
- package/src/skc-runtime/session-state-sidecar.ts +25 -9
- package/src/skc-runtime/state-runtime.ts +50 -12
- package/src/skc-runtime/state-writer.ts +68 -56
- package/src/skc-runtime/team-launch.ts +34 -5
- package/src/skc-runtime/team-runtime.ts +41 -1
- package/src/skc-runtime/team-store.ts +32 -0
- package/src/skc-runtime/team-worker-memory-guard.ts +363 -0
- package/src/skc-runtime/team-workers.ts +1 -0
- package/src/skc-runtime/tmux-common.ts +13 -2
- package/src/skc-runtime/tmux-owner-isolation.ts +20 -1
- package/src/skc-runtime/tmux-sessions.ts +45 -6
- package/src/skc-runtime/ultragoal-guard.ts +93 -15
- package/src/skc-runtime/ultragoal-receipt-freshness.ts +123 -0
- package/src/skc-runtime/ultragoal-runtime.ts +469 -38
- package/src/skc-runtime/workflow-manifest.generated.json +195 -5
- package/src/skc-runtime/workflow-manifest.ts +67 -3
- package/src/skill-state/workflow-hud.ts +25 -2
- package/src/skill-state/workflow-mutation-guard.ts +104 -12
- package/src/slash-commands/builtin-registry.ts +1 -1
- package/src/ssh/utils.ts +14 -0
- package/src/task/discovery.ts +8 -2
- package/src/task/executor.ts +165 -47
- package/src/task/index.ts +123 -15
- package/src/task/provider-retry-status.ts +88 -0
- package/src/task/receipt.ts +3 -0
- package/src/task/render.ts +45 -26
- package/src/task/skc-command.ts +2 -2
- package/src/task/types.ts +55 -10
- package/src/task/ultragoal-redteam-activation.ts +75 -0
- package/src/tools/ask.ts +1 -1
- package/src/tools/ast-edit.ts +2 -2
- package/src/tools/bash-allowed-prefixes.ts +45 -1
- package/src/tools/bash-pty-selection.ts +2 -2
- package/src/tools/browser/launch.ts +41 -6
- package/src/tools/browser/screenshot-format.ts +6 -1
- package/src/tools/cron.ts +1 -1
- package/src/tools/fetch.ts +127 -154
- package/src/tools/image-gen.ts +476 -23
- package/src/tools/index.ts +7 -1
- package/src/tools/output-meta.ts +176 -9
- package/src/tools/path-utils.ts +5 -1
- package/src/tools/read-internals.ts +44 -0
- package/src/tools/read.ts +1544 -310
- package/src/tools/resource-gc.ts +665 -125
- package/src/tools/skill-discovery.ts +39 -3
- package/src/tools/sqlite-reader.ts +63 -5
- package/src/tools/subagent-render.ts +74 -16
- package/src/tools/subagent.ts +2 -0
- package/src/tools/tool-result.ts +14 -1
- package/src/utils/edit-mode.ts +2 -2
- package/src/utils/pasted-image-path.ts +15 -6
- package/src/utils/prompt-suggestion.ts +265 -0
- package/src/utils/shell-snapshot.ts +173 -63
- package/src/utils/sixel.ts +3 -3
- package/src/web/insane/bridge.ts +5 -1
- package/src/web/insane/url-guard.ts +140 -27
- package/src/web/scrapers/docs-rs.ts +30 -5
- package/src/web/scrapers/types.ts +19 -49
- package/src/web/scrapers/utils.ts +12 -26
- package/src/web/search/providers/codex.ts +1 -1
- package/src/workflow/workflow-intent-diff.ts +4 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentMessage } from "@sayknow-cli/agent-core";
|
|
2
2
|
import type { AssistantMessage, ImageContent, Message } from "@sayknow-cli/ai";
|
|
3
|
-
import { type Component, Spacer, Text, TruncatedText, type TUI, truncateToWidth } from "@sayknow-cli/tui";
|
|
3
|
+
import { type Component, Loader, Spacer, Text, TruncatedText, type TUI, truncateToWidth } from "@sayknow-cli/tui";
|
|
4
4
|
import { settings } from "../../config/settings";
|
|
5
5
|
import { resolveSubskillActivationForSkillInvocation } from "../../extensibility/skc-plugins";
|
|
6
6
|
import { buildSkillPromptMessage, parseSkillInvocations } from "../../extensibility/skills";
|
|
@@ -86,6 +86,99 @@ export function prepareTranscriptRebuild(ui: TUI, policy: TranscriptRebuildPolic
|
|
|
86
86
|
if (policy === "replace-identity") ui.resetViewportAnchorIntent();
|
|
87
87
|
else ui.prepareViewportAnchorForTranscriptRebuild();
|
|
88
88
|
}
|
|
89
|
+
|
|
90
|
+
export const RESUME_PROGRESS_COMMIT_TIMEOUT_MS = 250;
|
|
91
|
+
|
|
92
|
+
export interface ResumeProgressLease {
|
|
93
|
+
readonly committed: Promise<boolean>;
|
|
94
|
+
clear(): void;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Mount a resume loader on the live status rail and wait for its render generation
|
|
99
|
+
* to commit before session I/O begins. The commit is advisory: a stopped or
|
|
100
|
+
* unavailable terminal resolves false and callers continue without blocking.
|
|
101
|
+
*
|
|
102
|
+
* Fail open (no-op lease, committed=false) when the status rail or UI lacks the
|
|
103
|
+
* child-mutation/render-commit surface required to mount progress. Headless and
|
|
104
|
+
* minimal controller contexts keep resume/migration semantics; full interactive
|
|
105
|
+
* TUI containers retain progress-before-switch.
|
|
106
|
+
*/
|
|
107
|
+
export function acquireResumeProgressLease(
|
|
108
|
+
ctx: Pick<InteractiveModeContext, "ui" | "statusContainer">,
|
|
109
|
+
): ResumeProgressLease {
|
|
110
|
+
if (!canMountResumeProgressLease(ctx)) {
|
|
111
|
+
return {
|
|
112
|
+
committed: Promise.resolve(false),
|
|
113
|
+
clear(): void {},
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const statusContainer = ctx.statusContainer as ResumeProgressStatusSurface;
|
|
118
|
+
const ui = ctx.ui as ResumeProgressUiSurface;
|
|
119
|
+
const loader = new Loader(
|
|
120
|
+
ui,
|
|
121
|
+
spinner => theme?.fg?.("accent", spinner) ?? spinner,
|
|
122
|
+
message => theme?.fg?.("muted", message) ?? message,
|
|
123
|
+
"Resuming session…",
|
|
124
|
+
);
|
|
125
|
+
statusContainer.addChild(loader);
|
|
126
|
+
const generation = ui.requestRenderWithGeneration(false, "resume-progress");
|
|
127
|
+
let active = true;
|
|
128
|
+
const committed = ui.waitForRenderCommit(generation, RESUME_PROGRESS_COMMIT_TIMEOUT_MS).catch(() => false);
|
|
129
|
+
return {
|
|
130
|
+
committed,
|
|
131
|
+
clear(): void {
|
|
132
|
+
if (!active) return;
|
|
133
|
+
active = false;
|
|
134
|
+
if (statusContainer.children.includes(loader)) statusContainer.removeChild(loader);
|
|
135
|
+
else loader.stop();
|
|
136
|
+
ui.requestRender(false, "resume-progress-clear");
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
type ResumeProgressStatusSurface = {
|
|
142
|
+
addChild: (child: Component) => void;
|
|
143
|
+
removeChild: (child: Component) => void;
|
|
144
|
+
children: Component[];
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
type ResumeProgressUiSurface = InteractiveModeContext["ui"] & {
|
|
148
|
+
requestRenderWithGeneration: (force?: boolean, source?: string) => number;
|
|
149
|
+
waitForRenderCommit: (generation: number, timeoutMs?: number) => Promise<boolean>;
|
|
150
|
+
requestRender: (force?: boolean, source?: string) => void;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
function canMountResumeProgressLease(ctx: Pick<InteractiveModeContext, "ui" | "statusContainer">): boolean {
|
|
154
|
+
const status = ctx.statusContainer as
|
|
155
|
+
| Partial<{
|
|
156
|
+
addChild: unknown;
|
|
157
|
+
removeChild: unknown;
|
|
158
|
+
children: unknown;
|
|
159
|
+
}>
|
|
160
|
+
| null
|
|
161
|
+
| undefined;
|
|
162
|
+
const ui = ctx.ui as
|
|
163
|
+
| Partial<{
|
|
164
|
+
requestRenderWithGeneration: unknown;
|
|
165
|
+
waitForRenderCommit: unknown;
|
|
166
|
+
requestRender: unknown;
|
|
167
|
+
}>
|
|
168
|
+
| null
|
|
169
|
+
| undefined;
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
!!status &&
|
|
173
|
+
typeof status.addChild === "function" &&
|
|
174
|
+
typeof status.removeChild === "function" &&
|
|
175
|
+
Array.isArray(status.children) &&
|
|
176
|
+
!!ui &&
|
|
177
|
+
typeof ui.requestRenderWithGeneration === "function" &&
|
|
178
|
+
typeof ui.waitForRenderCommit === "function" &&
|
|
179
|
+
typeof ui.requestRender === "function"
|
|
180
|
+
);
|
|
181
|
+
}
|
|
89
182
|
type TextBlock = { type: "text"; text: string };
|
|
90
183
|
interface RenderInitialMessagesOptions {
|
|
91
184
|
preserveExistingChat?: boolean;
|
|
@@ -922,9 +1015,11 @@ export class UiHelpers {
|
|
|
922
1015
|
const queuedText = theme.fg("dim", `${entry.label}: ${entry.message}`);
|
|
923
1016
|
this.ctx.pendingMessagesContainer.addChild(new TruncatedText(queuedText, 1, 0));
|
|
924
1017
|
}
|
|
925
|
-
const dequeueKey = this.ctx.keybindings.getDisplayString("app.message.dequeue")
|
|
926
|
-
|
|
927
|
-
|
|
1018
|
+
const dequeueKey = this.ctx.keybindings.getDisplayString("app.message.dequeue");
|
|
1019
|
+
if (dequeueKey) {
|
|
1020
|
+
const hintText = theme.fg("dim", `${theme.tree.hook} ${dequeueKey} to select/edit/reorder`);
|
|
1021
|
+
this.ctx.pendingMessagesContainer.addChild(new TruncatedText(hintText, 1, 0));
|
|
1022
|
+
}
|
|
928
1023
|
}
|
|
929
1024
|
}
|
|
930
1025
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
- Exception: restricted `bash` is only for sanctioned SKC workflow persistence (`skc ralplan --write ...`)
|
|
1
|
+
- Exception: restricted `bash` is only for sanctioned SKC workflow persistence (`skc ralplan --write ...`), SKC workflow state commands (`skc state ...`), and read-only git inspection (`git status`, `git log`, `git show`, `git diff`, `git blame`, `git rev-parse`, `git ls-files`). Pass artifacts through `SKC_RALPLAN_ARTIFACT` with `--artifact-env SKC_RALPLAN_ARTIFACT`; never use bash for product-source writes, commits, pushes, or other mutating/general shell work.
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: architect
|
|
3
3
|
description: Read-only architecture and code-review agent with severity-rated findings and status verdicts
|
|
4
|
-
tools: read, search, find, lsp, ast_grep, web_search, bash, report_finding
|
|
4
|
+
tools: read, search, find, lsp, ast_grep, web_search, bash, report_finding, irc
|
|
5
5
|
thinking-level: high
|
|
6
6
|
blocking: true
|
|
7
7
|
forkContext: allowed
|
|
8
8
|
bashAllowedPrefixes:
|
|
9
9
|
- skc ralplan --write
|
|
10
10
|
- skc state
|
|
11
|
+
- git status
|
|
12
|
+
- git log
|
|
13
|
+
- git show
|
|
14
|
+
- git diff
|
|
15
|
+
- git blame
|
|
16
|
+
- git rev-parse
|
|
17
|
+
- git ls-files
|
|
11
18
|
---
|
|
12
19
|
<identity>
|
|
13
20
|
You are Architect. You combine system architecture review with code-review discipline. Diagnose, analyze, and recommend with file-backed evidence. You are read-only.
|
|
@@ -30,12 +37,19 @@ You may receive a forked parent-conversation snapshot as background. Your read-o
|
|
|
30
37
|
{{restrictedBash}}
|
|
31
38
|
- Never approve code or plans you have not grounded in inspected files.
|
|
32
39
|
- Never give generic advice detached from this codebase.
|
|
33
|
-
- Never approve CRITICAL or HIGH severity issues.
|
|
40
|
+
- Never approve carryover CRITICAL or HIGH severity issues (raised in a prior pass and still unresolved). A fresh CRITICAL/HIGH minted from pass 2 on previously-approved ground blocks only with an explicit why-not-visible-earlier justification (rule 2); without that justification, record it as a non-blocking caveat with its severity noted. On pass 1 every CRITICAL/HIGH blocks.
|
|
34
41
|
- Do not skip spec compliance to jump to style nitpicks.
|
|
35
42
|
- Be constructive: explain why an issue matters and how to fix it or strengthen the design.
|
|
36
|
-
- Practical sufficiency beats endless logical completeness: treat preemptive logic for edge cases with no observed or evidenced trigger as over-engineering, but never downgrade genuine CRITICAL/HIGH architecture, extensibility, or robustness risks that have observability-based evidence.
|
|
37
43
|
</constraints>
|
|
38
44
|
|
|
45
|
+
<re_review_ratchet>
|
|
46
|
+
- Rule 1 (delta-only): from pass 2, review only the delta against the prior pass plus the resolution of previously raised findings; do not re-litigate previously-approved ground. The prior pass is identified by the re-review context bundle: prior reviewed-plan path, prior same-lane review path, and the explicit run-level pass number supplied in the assignment.
|
|
47
|
+
- Rule 2 (novelty justification): a new blocker on previously-reviewed ground requires an explicit "why this was not visible in the prior pass" justification (e.g. revealed by a fix, new file evidence); without it, demote to a non-blocking caveat.
|
|
48
|
+
- Rule 3 (verdict monotonicity): once all blockers from the prior pass are resolved, neither Architectural Status (`CLEAR`/`WATCH`/`BLOCK`) nor Code Review Recommendation (`APPROVE`/`COMMENT`/`REQUEST CHANGES`) may worsen absent a rule-2-justified new blocker.
|
|
49
|
+
- Rule 4 (severity discipline): carryover CRITICAL or HIGH severity issues (raised in a prior pass and still unresolved) remain blocking regardless of pass number. A fresh CRITICAL/HIGH minted from pass 2 on previously-approved ground blocks only with an explicit why-not-visible-earlier justification (rule 2); without that justification, record it as a non-blocking caveat with its severity noted. On pass 1 every CRITICAL/HIGH blocks.
|
|
50
|
+
- Rule 5 (counter-review awareness): From pass 2 your output is counter-reviewed by Critic for over-engineering and unnecessary scope expansion; unjustified scope inflation is flagged as a review defect and does not force revision passes. On pass 2+, do not broaden scope, add options, or demand synthesis beyond what resolves prior findings; constructive synthesis (Stage 3) stays full-strength on pass 1 only.
|
|
51
|
+
</re_review_ratchet>
|
|
52
|
+
|
|
39
53
|
<review_stages>
|
|
40
54
|
1. Understand the request, spec, plan, or diff.
|
|
41
55
|
2. Gather file-backed evidence.
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: critic
|
|
3
3
|
description: Read-only plan critic that approves only actionable, verifiable execution plans
|
|
4
|
-
tools: read, search, find, lsp, ast_grep, web_search, bash
|
|
4
|
+
tools: read, search, find, lsp, ast_grep, web_search, bash, irc
|
|
5
5
|
thinking-level: high
|
|
6
6
|
bashAllowedPrefixes:
|
|
7
7
|
- skc ralplan --write
|
|
8
8
|
- skc state
|
|
9
|
+
- git status
|
|
10
|
+
- git log
|
|
11
|
+
- git show
|
|
12
|
+
- git diff
|
|
13
|
+
- git blame
|
|
14
|
+
- git rev-parse
|
|
15
|
+
- git ls-files
|
|
9
16
|
---
|
|
10
17
|
<identity>
|
|
11
18
|
You are Critic. Decide whether a work plan is actionable before execution begins.
|
|
@@ -23,9 +30,17 @@ Review plan clarity, completeness, verification, big-picture fit, referenced fil
|
|
|
23
30
|
- Do not invent problems; report no issues found when the plan passes.
|
|
24
31
|
- Escalate routing needs upward: planner for plan revision, the deep-interview skill for requirements gathering, architect for code analysis.
|
|
25
32
|
- For consensus planning, reject shallow alternatives, driver contradictions, vague risks, weak verification, missing acceptance criteria, or under-specified areas needing expansion before execution.
|
|
26
|
-
- Prefer practical sufficiency over endless logical completeness: do not demand preemptive logic for edge cases that are not actually observed or evidenced, yet still require extensibility and robustness when observability-based evidence shows the investment is worth the token and time.
|
|
27
33
|
</constraints>
|
|
28
34
|
|
|
35
|
+
<re_review_ratchet>
|
|
36
|
+
- Rule 1 (delta-only): from pass 2, review only the delta against the prior pass plus the resolution of previously raised findings; do not re-litigate previously-approved ground. The prior pass is identified by the re-review context bundle (WI-3): prior reviewed-plan path, prior same-lane review path, and the explicit run-level pass number supplied in the assignment.
|
|
37
|
+
- Rule 2 (novelty justification): a new blocker on previously-reviewed ground requires an explicit "why this was not visible in the prior pass" justification (e.g. revealed by a fix, new file evidence); without it, demote to a non-blocking caveat.
|
|
38
|
+
- Rule 3 (verdict monotonicity): once all blockers from the prior pass are resolved, the verdict must not worsen (e.g. ITERATE -> REJECT) absent a rule-2-justified new blocker.
|
|
39
|
+
- Rule 4 (severity discipline): carryover blockers (raised in a prior pass, still unresolved) remain blocking regardless of pass number. A fresh high-severity concern minted from pass 2 on previously-approved ground follows rule 2: it blocks only with the why-not-visible-earlier justification, else it is recorded as a non-blocking caveat with severity noted.
|
|
40
|
+
- Rule 5 (counter-review duty): from pass 2, Critic also reviews the Architect output (routed via the context bundle) for over-engineering and unnecessary scope expansion; flag inflation as a review defect and do NOT convert unjustified Architect demands into ITERATE — inflating demands must not force revision passes.
|
|
41
|
+
- Enrichment lane ("spec too thin — expand") preserved verbatim but justification-gated from pass 2: expansion requests on already-reviewed ground need the rule-2 justification.
|
|
42
|
+
</re_review_ratchet>
|
|
43
|
+
|
|
29
44
|
<execution_loop>
|
|
30
45
|
1. Read the plan and referenced artifacts.
|
|
31
46
|
2. Extract and verify file references.
|
|
@@ -34,7 +34,7 @@ Explore just enough context, implement the smallest correct change, and leave co
|
|
|
34
34
|
{{#if ultragoalRedTeam}}
|
|
35
35
|
|
|
36
36
|
<ultragoal_red_team_mode>
|
|
37
|
-
This mode activates only when the assignment explicitly labels Executor as Ultragoal completion QA/red-team or asks for `executorQa` red-team evidence. Otherwise, preserve ordinary Executor behavior.
|
|
37
|
+
This mode activates only when the task sets typed `executionMode: "ultragoal-red-team"`, or — as a compatibility fallback — when the assignment text explicitly labels Executor as Ultragoal completion QA/red-team or asks for `executorQa` red-team evidence (not a bare `executorQa` field-name mention). Prefer the typed flag. Otherwise, preserve ordinary Executor behavior.
|
|
38
38
|
|
|
39
39
|
When active:
|
|
40
40
|
- Follow the exact `executorQa` contract provided in the assignment (matrix shape, row fields, artifact/replay rules); the runtime validates it strictly. If the assignment omits the contract, read the ultragoal SKILL's executor QA section before producing evidence.
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: planner
|
|
3
3
|
description: Read-only planning agent for sequencing, acceptance criteria, risks, and handoff shape
|
|
4
|
-
tools: read, search, find, lsp, ast_grep, web_search, bash
|
|
4
|
+
tools: read, search, find, lsp, ast_grep, web_search, bash, irc
|
|
5
5
|
thinking-level: medium
|
|
6
6
|
bashAllowedPrefixes:
|
|
7
7
|
- skc ralplan --write
|
|
8
8
|
- skc state
|
|
9
|
+
- git status
|
|
10
|
+
- git log
|
|
11
|
+
- git show
|
|
12
|
+
- git diff
|
|
13
|
+
- git blame
|
|
14
|
+
- git rev-parse
|
|
15
|
+
- git ls-files
|
|
9
16
|
---
|
|
10
17
|
<identity>
|
|
11
18
|
You are Planner. Turn requests into actionable work plans. You plan; you do not implement.
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Answer
|
|
4
|
-
Do not use tools.
|
|
5
|
-
Do not ask follow-up questions.
|
|
6
|
-
Question:
|
|
7
|
-
{{question}}
|
|
8
|
-
</btw>
|
|
1
|
+
You are answering inside an ephemeral multi-turn side chat for the interactive session.
|
|
2
|
+
Use only the sanitized visible-text conversation scope and prior side-chat turns provided as messages.
|
|
3
|
+
Answer directly. Do not use tools or request hidden session state.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[SUGGESTION MODE: Suggest what the user might naturally type next into the coding agent.]
|
|
2
|
+
|
|
3
|
+
FIRST: Look at the user's recent messages and original request.
|
|
4
|
+
|
|
5
|
+
Your job is to predict what THEY would type - not what you think they should do.
|
|
6
|
+
|
|
7
|
+
THE TEST: Would they think "I was just about to type that"?
|
|
8
|
+
|
|
9
|
+
EXAMPLES:
|
|
10
|
+
User asked "fix the bug and run tests", bug is fixed → "run the tests"
|
|
11
|
+
After code written → "try it out"
|
|
12
|
+
Agent offers options → suggest the one the user would likely pick, based on conversation
|
|
13
|
+
Agent asks to continue → "yes" or "go ahead"
|
|
14
|
+
Task complete, obvious follow-up → "commit this" or "push it"
|
|
15
|
+
After error or misunderstanding → silence (let them assess/correct)
|
|
16
|
+
|
|
17
|
+
Be specific: "run the tests" beats "continue".
|
|
18
|
+
|
|
19
|
+
NEVER SUGGEST:
|
|
20
|
+
- Evaluative ("looks good", "thanks")
|
|
21
|
+
- Questions ("what about…?")
|
|
22
|
+
- Agent-voice ("Let me…", "I'll…", "Here's…")
|
|
23
|
+
- New ideas they didn't ask about
|
|
24
|
+
- Multiple sentences
|
|
25
|
+
|
|
26
|
+
Stay silent if the next step isn't obvious from what the user said.
|
|
27
|
+
|
|
28
|
+
Stay silent if a suggestion could be unsafe or inappropriate — including any sensitive topic (security incidents, credentials, harm, private data). Even when the user is doing legitimate security or cybersecurity work, do not predict potentially unsafe actions.
|
|
29
|
+
|
|
30
|
+
Format: 2-12 words, match the user's style. Or nothing.
|
|
31
|
+
|
|
32
|
+
Reply with ONLY the suggestion, no quotes or explanation.
|
|
@@ -19,12 +19,15 @@ Optimize for correctness first, maintainability second, and brevity third. Prefe
|
|
|
19
19
|
{{#unless subagent}}
|
|
20
20
|
<skc-runtime>
|
|
21
21
|
<routing>
|
|
22
|
-
- Clear, low-risk implementation requests use direct tools and focused verification; do not invoke workflows or role agents for ceremony.
|
|
22
|
+
- Clear, low-risk implementation requests use direct tools and focused verification; do not invoke workflows or role agents for ceremony. Small verification needs do not turn a clear request into a planning workflow.
|
|
23
|
+
- Ambiguous implementation asks with a missing target, scope, acceptance criteria, or safety boundary require clarification or the appropriate planning workflow before mutation.
|
|
23
24
|
- Informational questions are answer-only/read-only unless the user explicitly requests a change, command, or execution.
|
|
24
|
-
- Vague requirements use `/skill:deep-interview
|
|
25
|
+
- Vague requirements use `/skill:deep-interview`: a requirements-only workflow that must not mutate product code. Its spec hands off as deep-interview → ralplan consensus → pending approval → separately approved execution.
|
|
26
|
+
- Clear work with non-trivial architecture or sequencing risk uses `/skill:ralplan --deliberate` and stops pending approval.
|
|
25
27
|
- Use `/skill:ultragoal` for durable goal ledgers and `/skill:team` for approved coordinated persistent work.
|
|
26
28
|
- Delegate large implementation slices to `executor`; use `planner`, `architect`, or `critic` for bounded planning and review.
|
|
27
|
-
- Active skills are authoritative:
|
|
29
|
+
- Active skills are authoritative: never ignore an invoked skill; read the full skill text and follow it exactly.
|
|
30
|
+
- Before explicit execution approval, planning and interview workflows NEVER edit product source, run mutating shell commands, commit, push, open PRs, or delegate implementation.
|
|
28
31
|
</routing>
|
|
29
32
|
</skc-runtime>
|
|
30
33
|
{{/unless}}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
Schedule a prompt to fire on a recurring cron schedule, or one-shot at the next match. Cron tasks
|
|
1
|
+
Schedule a prompt to fire on a recurring cron schedule, or one-shot at the next match. Cron tasks re-run an agent prompt automatically on an interval when every firing is allowed to produce a normal assistant response, such as a reminder or a scheduled status report.
|
|
2
|
+
|
|
3
|
+
Cron is not a silent polling primitive. Every firing starts an agent turn, and hiding the injected cron message does not hide that turn's assistant response. For ongoing logs, file watching, or PR/CI polling that should report only meaningful state changes, use `monitor` with a script that writes a line only when there is an event to process, and set `persistent: true` so the monitor survives the first emitted event. Do not schedule a cron prompt that asks the agent to suppress routine polls; prompt wording cannot make a cron-triggered assistant turn reliably silent.
|
|
2
4
|
|
|
3
5
|
Use a single `op` field to select the operation:
|
|
4
6
|
|
|
@@ -9,12 +9,13 @@ Read files, directories, archives, SQLite databases, images, documents, internal
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
11
11
|
- `path` — required. Local path, internal URI (`agent://`, `artifact://`, `rule://`, `local://`), or URL. Append `:<sel>` for line ranges, raw mode, or special modes (e.g. `src/foo.ts:50-200`, `src/foo.ts:raw`, `db.sqlite:users:42`).
|
|
12
|
+
- `truncation` — optional `head` | `last` | `both`; selects which end of an over-budget result to retain. Configured default: {{TRUNCATION_DEFAULT}} (factory default: `last`); non-file routes such as URLs, directories and converted documents default to `head`. A line-range selector still bounds the selection — this only picks which end of that selection survives the byte/line cap. SQLite row queries page via their own `limit`/`offset` and ignore it.
|
|
12
13
|
|
|
13
|
-
## Selectors
|
|
14
14
|
|
|
15
|
+
## Selectors
|
|
15
16
|
Append `:<sel>` to `path`. The bare path falls back to the default mode.
|
|
16
17
|
|
|
17
|
-
- _(none)_ — parseable code → structural summary (signatures kept, bodies elided);
|
|
18
|
+
- _(none)_ — parseable code → structural summary (signatures kept, bodies elided); a plain text file → a bounded receipt of about {{RECEIPT_LINES}} lines or {{RECEIPT_KIB}} KiB, whichever is smaller; the configured truncation direction is {{TRUNCATION_DEFAULT}} (factory default: last). Line+hash anchors keep their real file line numbers and a footer names the omitted range. Archive members use the larger {{DEFAULT_MAX_LINES}}-line / 50 KiB budget. Converted documents, notebooks, URLs and directory listings still start from the beginning.
|
|
18
19
|
- `:50` / `:50-` — read from line 50 onward.
|
|
19
20
|
- `:50-200` — lines 50–200 inclusive.
|
|
20
21
|
- `:50+150` — 150 lines starting at line 50.
|
|
@@ -39,6 +40,7 @@ Append `:<sel>` to `path`. The bare path falls back to the default mode.
|
|
|
39
40
|
`[NN lines across MM elided regions; read <path>:raw or a line range like <path>:1-9999 for verbatim content]`
|
|
40
41
|
|
|
41
42
|
If the elided body is what you actually need, re-issue the **exact selector the footer names**. NEVER guess what's inside `..` / `…` — those markers carry no content.
|
|
43
|
+
- Directional windows identify the retained first/last lines and the omitted range; use the `re-read <path>:1-<total>` or `:raw` hint in the footer to recover the full content.
|
|
42
44
|
|
|
43
45
|
# Documents & Notebooks
|
|
44
46
|
|
|
@@ -3,6 +3,7 @@ Discover project and user runtime skills without loading full skill content.
|
|
|
3
3
|
<instruction>
|
|
4
4
|
- Searches only custom runtime skill locations: nearest project `.skc/skills`; then, under the home directory, canonical `<config>/agent/skills`, configured legacy `<config>/skills`, and historical legacy `.skc/skills`. `<config>` is the home-relative directory name from `SKC_CONFIG_DIR`, then `PI_CONFIG_DIR`, then `.skc`; even an absolute-looking configured name is joined beneath `<home>`. Duplicate names use that exact precedence. Built-in, bundled, and internal workflow skills are intentionally excluded.
|
|
5
5
|
- Returns thin metadata only: name, description, source scope, path, and use conditions when present.
|
|
6
|
+
- When zero candidates are returned because discovery config is disabled (`skills.enabled`, `skills.enablePiProject`, `skills.enablePiUser`), the result carries a `notice` explaining which setting blocked the search — an empty result without a `notice` means the searched scopes genuinely contain no matching skills.
|
|
6
7
|
- To load a selected skill's full `SKILL.md`, invoke it through the existing `skill` tool with the exact `name` returned here.
|
|
7
8
|
</instruction>
|
|
8
9
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
MemoryGuardDomainSnapshot,
|
|
3
|
+
MemoryGuardWorkerAccounting,
|
|
4
|
+
MemoryGuardWorkerSample,
|
|
5
|
+
} from "./memory-guard-contract";
|
|
6
|
+
|
|
7
|
+
export interface MemoryGuardDomainInput {
|
|
8
|
+
effectiveLimitBytes: number;
|
|
9
|
+
totalUsageBytes: number;
|
|
10
|
+
parentBytes: number;
|
|
11
|
+
parentReserveBytes: number;
|
|
12
|
+
workers: readonly MemoryGuardWorkerSample[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function assertNonNegativeSafeInteger(name: string, value: number): number {
|
|
16
|
+
if (!Number.isSafeInteger(value) || value < 0) throw new Error(`invalid_${name}`);
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function sumWorkerBytes(workers: readonly MemoryGuardWorkerSample[]): number {
|
|
21
|
+
let total = 0;
|
|
22
|
+
for (const worker of workers) {
|
|
23
|
+
total += assertNonNegativeSafeInteger(`worker_bytes:${worker.workerId}`, worker.bytes);
|
|
24
|
+
if (!Number.isSafeInteger(total)) throw new Error("invalid_worker_total_bytes");
|
|
25
|
+
}
|
|
26
|
+
return total;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function computeMemoryGuardDomain(input: MemoryGuardDomainInput): MemoryGuardDomainSnapshot {
|
|
30
|
+
const effectiveLimitBytes = assertNonNegativeSafeInteger("effective_limit_bytes", input.effectiveLimitBytes);
|
|
31
|
+
const totalUsageBytes = assertNonNegativeSafeInteger("total_usage_bytes", input.totalUsageBytes);
|
|
32
|
+
const parentBytes = assertNonNegativeSafeInteger("parent_bytes", input.parentBytes);
|
|
33
|
+
const parentReserveBytes = assertNonNegativeSafeInteger("parent_reserve_bytes", input.parentReserveBytes);
|
|
34
|
+
const totalWorkerBytes = sumWorkerBytes(input.workers);
|
|
35
|
+
const acceptedWorkers = input.workers.filter(worker => worker.accepted !== false);
|
|
36
|
+
const acceptedWorkerBytes = sumWorkerBytes(acceptedWorkers);
|
|
37
|
+
const acceptedWorkerCount = acceptedWorkers.length;
|
|
38
|
+
const unmanagedBytes = Math.max(0, totalUsageBytes - parentBytes - acceptedWorkerBytes);
|
|
39
|
+
const headroomBytes = Math.max(0, effectiveLimitBytes - totalUsageBytes);
|
|
40
|
+
const workerBudgetBytes = Math.max(0, effectiveLimitBytes - unmanagedBytes - parentReserveBytes);
|
|
41
|
+
const perWorkerAllowanceBytes = acceptedWorkerCount === 0 ? 0 : workerBudgetBytes / acceptedWorkerCount;
|
|
42
|
+
const workers: MemoryGuardWorkerAccounting[] = input.workers.map(worker => {
|
|
43
|
+
const accepted = worker.accepted !== false;
|
|
44
|
+
return {
|
|
45
|
+
workerId: worker.workerId,
|
|
46
|
+
bytes: worker.bytes,
|
|
47
|
+
accepted,
|
|
48
|
+
allowanceBytes: accepted ? perWorkerAllowanceBytes : 0,
|
|
49
|
+
excessBytes: accepted ? Math.max(0, worker.bytes - perWorkerAllowanceBytes) : 0,
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
effectiveLimitBytes,
|
|
54
|
+
totalUsageBytes,
|
|
55
|
+
parentBytes,
|
|
56
|
+
parentReserveBytes,
|
|
57
|
+
totalWorkerBytes,
|
|
58
|
+
acceptedWorkerCount,
|
|
59
|
+
unmanagedBytes,
|
|
60
|
+
headroomBytes,
|
|
61
|
+
workerBudgetBytes,
|
|
62
|
+
perWorkerAllowanceBytes,
|
|
63
|
+
hostExcessBytes: Math.max(0, parentBytes - parentReserveBytes),
|
|
64
|
+
workers,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export interface MemoryGuardPolicy {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
checkIntervalMs: number;
|
|
4
|
+
gcThresholdRatio: number;
|
|
5
|
+
restartThresholdRatio: number;
|
|
6
|
+
restartThresholdWindowMs: number;
|
|
7
|
+
cooldownMs: number;
|
|
8
|
+
parentReserveBytes: number;
|
|
9
|
+
policyLimitBytes: number | null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface MemoryGuardWorkerSample {
|
|
13
|
+
workerId: string;
|
|
14
|
+
bytes: number;
|
|
15
|
+
accepted?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface MemoryGuardWorkerAccounting {
|
|
19
|
+
workerId: string;
|
|
20
|
+
bytes: number;
|
|
21
|
+
accepted: boolean;
|
|
22
|
+
allowanceBytes: number;
|
|
23
|
+
excessBytes: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface MemoryGuardDomainSnapshot {
|
|
27
|
+
effectiveLimitBytes: number;
|
|
28
|
+
totalUsageBytes: number;
|
|
29
|
+
parentBytes: number;
|
|
30
|
+
parentReserveBytes: number;
|
|
31
|
+
totalWorkerBytes: number;
|
|
32
|
+
acceptedWorkerCount: number;
|
|
33
|
+
unmanagedBytes: number;
|
|
34
|
+
headroomBytes: number;
|
|
35
|
+
workerBudgetBytes: number;
|
|
36
|
+
perWorkerAllowanceBytes: number;
|
|
37
|
+
hostExcessBytes: number;
|
|
38
|
+
workers: MemoryGuardWorkerAccounting[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface MemoryGuardHostTarget {
|
|
42
|
+
kind: "host";
|
|
43
|
+
excessBytes: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface MemoryGuardWorkerTarget {
|
|
47
|
+
kind: "worker";
|
|
48
|
+
workerId: string;
|
|
49
|
+
excessBytes: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type MemoryGuardActionTarget = MemoryGuardHostTarget | MemoryGuardWorkerTarget;
|
|
53
|
+
|
|
54
|
+
export type MemoryGuardNoopReason =
|
|
55
|
+
| "memory_guard_action_noop_unmanaged_or_within_allowance"
|
|
56
|
+
| "memory_guard_action_noop_unsupported";
|
|
57
|
+
|
|
58
|
+
export type MemoryGuardDecision =
|
|
59
|
+
| { kind: "execute"; target: MemoryGuardActionTarget }
|
|
60
|
+
| { kind: "noop"; reason: MemoryGuardNoopReason }
|
|
61
|
+
| { kind: "revalidated_out"; reason: "memory_guard_action_revalidated_out" };
|
|
62
|
+
|
|
63
|
+
export interface MemoryGuardSchedulerState {
|
|
64
|
+
timerActive: boolean;
|
|
65
|
+
registrationCount: number;
|
|
66
|
+
inProgress: boolean;
|
|
67
|
+
generation: number;
|
|
68
|
+
pendingDeadline: number | null;
|
|
69
|
+
pendingOwner: { generation: number; token: number } | null;
|
|
70
|
+
deferredDeadline: number | null;
|
|
71
|
+
deferredGeneration: number | null;
|
|
72
|
+
activeGeneration: number | null;
|
|
73
|
+
}
|