@code-yeongyu/senpi 2026.8.16 → 2026.8.18-2
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 +102 -0
- package/dist/bun/cli.js +1 -0
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/register-cursor-agent.d.ts +2 -0
- package/dist/bun/register-cursor-agent.d.ts.map +1 -0
- package/dist/bun/register-cursor-agent.js +4 -0
- package/dist/bun/register-cursor-agent.js.map +1 -0
- package/dist/core/agent-session-services.js +2 -2
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +48 -5
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +239 -61
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/cursor-exec-bridge-session.d.ts +11 -0
- package/dist/core/cursor-exec-bridge-session.d.ts.map +1 -0
- package/dist/core/cursor-exec-bridge-session.js +15 -0
- package/dist/core/cursor-exec-bridge-session.js.map +1 -0
- package/dist/core/cursor-exec-bridge.d.ts +52 -0
- package/dist/core/cursor-exec-bridge.d.ts.map +1 -0
- package/dist/core/cursor-exec-bridge.js +205 -0
- package/dist/core/cursor-exec-bridge.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.d.ts +31 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js +298 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.d.ts +38 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.js +75 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.d.ts +24 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.js +64 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.d.ts +139 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.js +362 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/errors.d.ts +19 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/errors.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/errors.js +122 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/errors.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.d.ts +30 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.js +117 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/failover.d.ts +39 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/failover.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/failover.js +155 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/failover.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.d.ts +89 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.js +147 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.d.ts +20 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.js +99 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/index.d.ts +26 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/index.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/index.js +86 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/index.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts +27 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.js +242 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/native-bootstrap.d.ts +14 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/native-bootstrap.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/native-bootstrap.js +58 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/native-bootstrap.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.d.ts +77 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.js +361 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.d.ts +94 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.js +248 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.d.ts +37 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js +196 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.d.ts +11 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.js +17 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.d.ts +104 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.js +301 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream.d.ts +26 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream.js +587 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/transport.d.ts +43 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/transport.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/transport.js +196 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/transport.js.map +1 -0
- package/dist/core/extensions/builtin/goal/channel-state-subscriptions.d.ts +9 -0
- package/dist/core/extensions/builtin/goal/channel-state-subscriptions.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/channel-state-subscriptions.js +18 -0
- package/dist/core/extensions/builtin/goal/channel-state-subscriptions.js.map +1 -0
- package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/index.js +14 -3
- package/dist/core/extensions/builtin/goal/index.js.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts +9 -0
- package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.js +26 -9
- package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
- package/dist/core/extensions/builtin/goal/reload-reengagement.d.ts +30 -0
- package/dist/core/extensions/builtin/goal/reload-reengagement.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/reload-reengagement.js +36 -0
- package/dist/core/extensions/builtin/goal/reload-reengagement.js.map +1 -0
- package/dist/core/extensions/builtin/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/index.js +5 -2
- package/dist/core/extensions/builtin/index.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/detectors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/detectors.js +21 -3
- package/dist/core/extensions/builtin/loop-guard/detectors.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/escalation.d.ts +24 -0
- package/dist/core/extensions/builtin/loop-guard/escalation.d.ts.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/escalation.js +77 -0
- package/dist/core/extensions/builtin/loop-guard/escalation.js.map +1 -0
- package/dist/core/extensions/builtin/loop-guard/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/index.js +98 -3
- package/dist/core/extensions/builtin/loop-guard/index.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/notice.d.ts +9 -0
- package/dist/core/extensions/builtin/loop-guard/notice.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/notice.js +17 -0
- package/dist/core/extensions/builtin/loop-guard/notice.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/policy.d.ts +4 -0
- package/dist/core/extensions/builtin/loop-guard/policy.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/policy.js +4 -0
- package/dist/core/extensions/builtin/loop-guard/policy.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/renderer.d.ts +2 -0
- package/dist/core/extensions/builtin/loop-guard/renderer.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/renderer.js +11 -0
- package/dist/core/extensions/builtin/loop-guard/renderer.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/tracker.d.ts +1 -1
- package/dist/core/extensions/builtin/loop-guard/tracker.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/tracker.js +3 -1
- package/dist/core/extensions/builtin/loop-guard/tracker.js.map +1 -1
- package/dist/core/extensions/builtin/monitor-state-event.d.ts +6 -0
- package/dist/core/extensions/builtin/monitor-state-event.d.ts.map +1 -1
- package/dist/core/extensions/builtin/monitor-state-event.js +10 -0
- package/dist/core/extensions/builtin/monitor-state-event.js.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +7 -2
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +14 -2
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +5 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +8 -9
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/provider-display-names.js +1 -0
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +6 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/modes/interactive/editor-paste-transfer.d.ts +10 -0
- package/dist/modes/interactive/editor-paste-transfer.d.ts.map +1 -1
- package/dist/modes/interactive/editor-paste-transfer.js +16 -0
- package/dist/modes/interactive/editor-paste-transfer.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +14 -7
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +32 -27
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/jsonl.d.ts +6 -1
- package/dist/modes/rpc/jsonl.d.ts.map +1 -1
- package/dist/modes/rpc/jsonl.js +47 -14
- package/dist/modes/rpc/jsonl.js.map +1 -1
- package/dist/modes/rpc/multi-session-host.d.ts.map +1 -1
- package/dist/modes/rpc/multi-session-host.js +26 -4
- package/dist/modes/rpc/multi-session-host.js.map +1 -1
- package/dist/modes/rpc/rpc-command-invocation.d.ts +5 -0
- package/dist/modes/rpc/rpc-command-invocation.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-command-invocation.js +2 -0
- package/dist/modes/rpc/rpc-command-invocation.js.map +1 -0
- package/dist/modes/rpc/rpc-command-surface.d.ts +49 -0
- package/dist/modes/rpc/rpc-command-surface.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-command-surface.js +40 -0
- package/dist/modes/rpc/rpc-command-surface.js.map +1 -0
- package/dist/modes/rpc/rpc-input-validation.d.ts +4 -0
- package/dist/modes/rpc/rpc-input-validation.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-input-validation.js +20 -0
- package/dist/modes/rpc/rpc-input-validation.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +12 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +12 -12
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/docs/providers.md +53 -1
- package/docs/rpc.md +78 -6
- package/docs/skills.md +14 -3
- package/node_modules/@bufbuild/protobuf/README.md +44 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/clone.d.ts +6 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/clone.js +66 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/boot.d.ts +1 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/boot.js +18 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/enum.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/enum.js +31 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/extension.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/extension.js +28 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/file.d.ts +1 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/file.js +18 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/index.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/index.js +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/message.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/message.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/service.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/service.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/symbols.d.ts +140 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/symbols.js +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/types.d.ts +79 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv1/types.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/boot.d.ts +63 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/boot.js +105 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/embed.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/embed.js +244 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/enum.d.ts +29 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/enum.js +58 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/extension.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/extension.js +28 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/file.d.ts +7 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/file.js +35 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/index.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/index.js +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/message.d.ts +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/message.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/restore-json-names.d.ts +5 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/restore-json-names.js +29 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/scalar.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/scalar.js +67 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/service.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/service.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/symbols.d.ts +145 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/symbols.js +74 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/types.d.ts +85 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/codegenv2/types.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/create.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/create.js +259 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/descriptors.d.ts +634 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/descriptors.js +53 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/equals.d.ts +46 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/equals.js +209 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/extensions.d.ts +60 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/extensions.js +168 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/fields.d.ts +23 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/fields.js +45 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-binary.d.ts +48 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-binary.js +247 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-json.d.ts +73 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/from-json.js +739 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/index.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/index.js +55 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/is-message.d.ts +7 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/is-message.js +33 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/json-value.d.ts +16 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/json-value.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/merge.d.ts +13 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/merge.js +70 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/package.json +4 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/proto-int64.d.ts +98 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/proto-int64.js +131 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/error.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/error.js +36 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/guard.d.ts +20 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/guard.js +78 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/index.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/index.js +41 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/names.d.ts +30 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/names.js +115 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/nested-types.d.ts +35 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/nested-types.js +110 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/path.d.ts +107 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/path.js +376 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-check.js +268 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-types.d.ts +217 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect-types.js +16 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/reflect.js +546 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/scalar.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/scalar.js +129 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/unsafe.d.ts +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/reflect/unsafe.js +149 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/registry.d.ts +98 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/registry.js +945 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/to-binary.d.ts +24 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/to-binary.js +199 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/to-json.d.ts +67 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/to-json.js +391 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/from-text.d.ts +35 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/from-text.js +684 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/index.d.ts +4 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/index.js +21 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/is-group-like.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/is-group-like.js +47 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/reader.d.ts +91 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/reader.js +481 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/to-text.d.ts +34 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/to-text.js +358 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/writer.d.ts +76 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/txtpb/writer.js +220 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/types.d.ts +135 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/types.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/unknown-enum.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/unknown-enum.js +26 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.d.ts +23 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.js +156 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.d.ts +268 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/binary-encoding.js +530 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.d.ts +5 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/index.js +34 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/size-delimited.d.ts +69 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/size-delimited.js +191 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-encoding.d.ts +28 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-encoding.js +61 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-format.d.ts +13 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/text-format.js +199 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/varint.d.ts +70 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wire/varint.js +322 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/any.d.ts +38 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/any.js +75 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/duration.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/duration.js +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/any_pb.d.ts +238 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/any_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/api_pb.d.ts +537 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/api_pb.js +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +490 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/compiler/plugin_pb.js +68 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/cpp_features_pb.d.ts +91 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/cpp_features_pb.js +60 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/descriptor_pb.d.ts +4143 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/descriptor_pb.js +892 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/duration_pb.d.ts +161 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/duration_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/empty_pb.d.ts +39 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/empty_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/field_mask_pb.d.ts +424 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/field_mask_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/go_features_pb.d.ts +189 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/go_features_pb.js +126 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/java_features_pb.d.ts +194 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/java_features_pb.js +106 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/source_context_pb.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/source_context_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/struct_pb.d.ts +195 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/struct_pb.js +59 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/timestamp_pb.d.ts +222 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/timestamp_pb.js +27 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/type_pb.d.ts +722 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/type_pb.js +242 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/wrappers_pb.d.ts +330 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/gen/google/protobuf/wrappers_pb.js +67 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/index.js +48 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/timestamp.d.ts +21 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/timestamp.js +57 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/wrappers.d.ts +25 -0
- package/node_modules/@bufbuild/protobuf/dist/commonjs/wkt/wrappers.js +66 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/clone.d.ts +6 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/clone.js +63 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/boot.d.ts +1 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/boot.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/enum.js +26 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/extension.js +25 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.d.ts +1 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/file.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/index.js +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/message.js +21 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/service.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.d.ts +140 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/symbols.js +40 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.d.ts +79 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv1/types.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.d.ts +63 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/boot.js +101 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.js +239 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.d.ts +29 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.js +53 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.js +25 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.d.ts +7 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js +32 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.js +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.d.ts +15 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/message.js +21 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.d.ts +5 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.js +26 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.js +63 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.d.ts +145 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.js +71 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.d.ts +85 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/create.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/create.js +256 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/descriptors.d.ts +634 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/descriptors.js +50 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/equals.d.ts +46 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/equals.js +206 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/extensions.d.ts +60 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/extensions.js +159 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/fields.d.ts +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/fields.js +41 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.d.ts +48 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js +241 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/from-json.d.ts +73 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/from-json.js +731 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/index.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/index.js +29 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/is-message.d.ts +7 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/is-message.js +30 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/json-value.d.ts +16 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/json-value.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/merge.d.ts +13 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/merge.js +67 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/package.json +4 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.d.ts +98 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/proto-int64.js +128 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.js +31 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.d.ts +20 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js +71 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.d.ts +8 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/index.js +21 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.d.ts +30 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.js +109 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.d.ts +35 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.js +105 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.d.ts +107 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.js +369 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-check.js +262 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.d.ts +217 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect-types.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js +541 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.js +124 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.d.ts +39 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/unsafe.js +140 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/registry.d.ts +98 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/registry.js +939 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/to-binary.d.ts +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/to-binary.js +195 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/to-json.d.ts +67 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/to-json.js +386 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/from-text.d.ts +35 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/from-text.js +680 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/index.d.ts +4 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/index.js +15 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/is-group-like.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/is-group-like.js +44 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/reader.d.ts +91 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/reader.js +477 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/to-text.d.ts +34 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/to-text.js +355 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/writer.d.ts +76 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/txtpb/writer.js +214 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/types.d.ts +135 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/types.js +14 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/unknown-enum.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/unknown-enum.js +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.d.ts +23 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.js +152 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.d.ts +268 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js +525 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/index.d.ts +5 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/index.js +18 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.d.ts +69 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.js +186 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.d.ts +28 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js +57 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.d.ts +13 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-format.js +195 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.d.ts +70 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js +313 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.d.ts +38 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.js +69 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.d.ts +9 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.js +35 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.d.ts +238 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.d.ts +537 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.js +36 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +490 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js +65 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.d.ts +91 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.js +57 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.d.ts +4143 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +888 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.d.ts +161 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.d.ts +39 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.d.ts +424 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.d.ts +189 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.js +123 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.d.ts +194 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.js +103 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.d.ts +43 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.d.ts +195 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.js +56 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.d.ts +222 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.d.ts +722 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.js +239 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.d.ts +330 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js +64 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.d.ts +19 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.js +32 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.d.ts +21 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.js +50 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.d.ts +25 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js +61 -0
- package/node_modules/@bufbuild/protobuf/package.json +147 -0
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +38 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-runtime.ts +2 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +43 -6
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +4 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +59 -17
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts +15 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js +18 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +12 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/README.md +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/deterministic-id.d.ts +17 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/deterministic-id.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/deterministic-id.js +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/deterministic-id.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-lifecycle.d.ts +13 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-lifecycle.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-lifecycle.js +33 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-lifecycle.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-modern.d.ts +79 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-modern.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-modern.js +360 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/exec-modern.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.d.ts +16797 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.js +3828 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/pi-args.d.ts +55 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/pi-args.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/pi-args.js +76 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/pi-args.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.d.ts +116 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.js +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts +191 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +3316 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.d.ts +29 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.js +33 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor-agent-provider.d.ts +11 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor-agent-provider.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor-agent-provider.js +11 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor-agent-provider.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.d.ts +6 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts +6 -9
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js +42 -9
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cerebras.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-message-snapshot.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-message-snapshot.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-message-snapshot.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/block-symbols.d.ts +57 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/block-symbols.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/block-symbols.js +57 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/block-symbols.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +3 -2
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js +21 -0
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.d.ts +9 -0
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.js +82 -0
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.js.map +1 -0
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +11 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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7C,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE;IAC3C,EAAE,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,uBAAuB,EAAE;IAC5D,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE;IAC1C,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE;IACtC,EAAE,EAAE,EAAE,iBAAiB,EAAE,OAAO,EAAE,uBAAuB,EAAE;IAC3D,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE;IACtC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE;IACpC,EAAE,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,uBAAuB,EAAE;IAC5D,0IAA0I;IAC1I,EAAE,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,kBAAkB,EAAE;IACjD,oIAAoI;IACpI,EAAE,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,qBAAqB,EAAE;IACvD,8GAA8G;IAC9G,EAAE,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAE;IACnD,iGAAiG;IACjG,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE;CACpC,CAAC","sourcesContent":["import type { ExtensionFactory } from \"../types.ts\";\nimport anthropicBashExtension from \"./anthropic-bash/index.ts\";\nimport anthropicWebSearchExtension from \"./anthropic-web-search/index.ts\";\nimport bashTimeoutExtension from \"./bash-timeout/index.ts\";\nimport btwExtension from \"./btw/index.ts\";\nimport cacheKeepAliveExtension from \"./cache-keepalive/index.ts\";\nimport claudeSdkOauthExtension from \"./claude-sdk-oauth/index.ts\";\nimport compactionExtension from \"./compaction/index.ts\";\nimport configReloadExtension from \"./config-reload/index.ts\";\nimport diffExtension from \"./diff.ts\";\nimport filesExtension from \"./files.ts\";\nimport goalExtension from \"./goal/index.ts\";\nimport gptApplyPatchExtension from \"./gpt-apply-patch/index.ts\";\nimport helpExtension from \"./help/index.ts\";\nimport historySearchExtension from \"./history-search/index.ts\";\nimport hooksExtension from \"./hooks/index.ts\";\nimport imageGenExtension from \"./imagegen/index.ts\";\nimport importReproExtension from \"./import-repro.ts\";\nimport lookAtExtension from \"./look-at/index.ts\";\nimport loopGuardExtension from \"./loop-guard/index.ts\";\nimport mcpExtension from \"./mcp/index.ts\";\nimport modelFallbackExtension from \"./model-fallback/index.ts\";\nimport nestedAgentsMdExtension from \"./nested-agents-md/index.ts\";\nimport openaiImageGenExtension from \"./openai-image-gen/index.ts\";\nimport openaiWebSearchExtension from \"./openai-web-search/index.ts\";\nimport permissionSystemExtension from \"./permission-system/index.ts\";\nimport promptPresetExtension from \"./prompt-preset/index.ts\";\nimport promptUrlWidgetExtension from \"./prompt-url-widget.ts\";\nimport reasoningExtension from \"./reasoning/index.ts\";\nimport recommendedModelsExtension from \"./recommended-models/index.ts\";\nimport redrawsExtension from \"./redraws.ts\";\nimport piRulesExtension from \"./rules/index.ts\";\nimport serviceTierExtension from \"./service-tier.ts\";\nimport terminalExtension from \"./terminal/index.ts\";\nimport todowriteExtension from \"./todotools/index.ts\";\nimport toolPairGuardExtension from \"./tool-pair-guard/index.ts\";\nimport toolSearchExtension from \"./tool-search/index.ts\";\nimport tpsExtension from \"./tps.ts\";\nimport ttsrExtension from \"./ttsr/index.ts\";\nimport videoInExtension from \"./video-in/index.ts\";\nimport webfetchExtension from \"./webfetch/index.ts\";\nimport websearchExtension from \"./websearch/index.ts\";\n\nexport interface BuiltinExtensionFactory {\n\tid: string;\n\tfactory: ExtensionFactory;\n}\n\nexport const globalDefaultExtensionIds = [\"diff\", \"files\", \"prompt-url-widget\", \"tps\"] as const;\n\nexport const globalDefaultExtensionFactories = {\n\tdiff: diffExtension,\n\tfiles: filesExtension,\n\t\"prompt-url-widget\": promptUrlWidgetExtension,\n\ttps: tpsExtension,\n} satisfies Record<(typeof globalDefaultExtensionIds)[number], ExtensionFactory>;\n\nexport const builtinExtensions: BuiltinExtensionFactory[] = [\n\t{ id: \"hooks\", factory: hooksExtension },\n\t{ id: \"permission-system\", factory: permissionSystemExtension },\n\t{ id: \"gpt-apply-patch\", factory: gptApplyPatchExtension },\n\t{ id: \"imagegen\", factory: imageGenExtension },\n\t// Follows imagegen so the native injector's bypass wiring observes the registered client tool.\n\t{ id: \"openai-image-gen\", factory: openaiImageGenExtension },\n\t{ id: \"prompt-preset\", factory: promptPresetExtension },\n\t{ id: \"todowrite\", factory: todowriteExtension },\n\t{ id: \"redraws\", factory: redrawsExtension },\n\t{ id: \"anthropic-web-search\", factory: anthropicWebSearchExtension },\n\t{ id: \"anthropic-bash\", factory: anthropicBashExtension },\n\t{ id: \"openai-web-search\", factory: openaiWebSearchExtension },\n\t{ id: \"service-tier\", factory: serviceTierExtension },\n\t// Sits beside service-tier: both are capability-aware model-control commands that only read\n\t// the active model and notify; neither mutates payloads, so relative order is not load-bearing.\n\t{ id: \"reasoning\", factory: reasoningExtension },\n\t{ id: \"model-fallback\", factory: modelFallbackExtension },\n\t{ id: \"recommended-models\", factory: recommendedModelsExtension },\n\t{ id: \"bash-timeout\", factory: bashTimeoutExtension },\n\t// Terminal follows bash-timeout so its injected default reaches the PTY bash, and follows\n\t// anthropic-bash so mutual-exclusion (companion step-aside) is evaluated after it registers.\n\t{ id: \"terminal\", factory: terminalExtension },\n\t{ id: \"tool-pair-guard\", factory: toolPairGuardExtension },\n\t{ id: \"compaction\", factory: compactionExtension },\n\t{ id: \"history-search\", factory: historySearchExtension },\n\t{ id: \"help\", factory: helpExtension },\n\t{ id: \"import-repro\", factory: importReproExtension },\n\t{ id: \"websearch\", factory: websearchExtension },\n\t{ id: \"webfetch\", factory: webfetchExtension },\n\t{ id: \"video-in\", factory: videoInExtension },\n\t{ id: \"look-at\", factory: lookAtExtension },\n\t{ id: \"nested-agents-md\", factory: nestedAgentsMdExtension },\n\t{ id: \"rules\", factory: piRulesExtension },\n\t{ id: \"goal\", factory: goalExtension },\n\t{ id: \"cache-keepalive\", factory: cacheKeepAliveExtension },\n\t{ id: \"ttsr\", factory: ttsrExtension },\n\t{ id: \"btw\", factory: btwExtension },\n\t{ id: \"claude-sdk-oauth\", factory: claudeSdkOauthExtension },\n\t// Loop guard is a pure observer of tool_execution_start; it never mutates payloads, so it slots before config-reload and leaves MCP last.\n\t{ id: \"loop-guard\", factory: loopGuardExtension },\n\t// Config reload follows settings-dependent builtins so reloads rebuild their resolved settings before catalog feeders observe them.\n\t{ id: \"config-reload\", factory: configReloadExtension },\n\t// Shared catalog wiring loads before MCP, which feeds its tools into the shared catalog as the final builtin.\n\t{ id: \"tool-search\", factory: toolSearchExtension },\n\t// Keep MCP last so its eventual provider-payload tap observes all co-resident builtin mutations.\n\t{ id: \"mcp\", factory: mcpExtension },\n];\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/index.ts"],"names":[],"mappings":"AACA,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAC/D,OAAO,2BAA2B,MAAM,iCAAiC,CAAC;AAC1E,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAC3D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,uBAAuB,MAAM,4BAA4B,CAAC;AACjE,OAAO,uBAAuB,MAAM,6BAA6B,CAAC;AAClE,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAC7D,OAAO,uBAAuB,MAAM,6BAA6B,CAAC;AAClE,OAAO,aAAa,MAAM,WAAW,CAAC;AACtC,OAAO,cAAc,MAAM,YAAY,CAAC;AACxC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AAChE,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,sBAAsB,MAAM,2BAA2B,CAAC;AAC/D,OAAO,cAAc,MAAM,kB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,EAAE;IAC5D,oIAAoI;IACpI,EAAE,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,qBAAqB,EAAE;IACvD,8GAA8G;IAC9G,EAAE,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAE;IACnD,iGAAiG;IACjG,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE;CACpC,CAAC","sourcesContent":["import type { ExtensionFactory } from \"../types.ts\";\nimport anthropicBashExtension from \"./anthropic-bash/index.ts\";\nimport anthropicWebSearchExtension from \"./anthropic-web-search/index.ts\";\nimport bashTimeoutExtension from \"./bash-timeout/index.ts\";\nimport btwExtension from \"./btw/index.ts\";\nimport cacheKeepAliveExtension from \"./cache-keepalive/index.ts\";\nimport claudeSdkOauthExtension from \"./claude-sdk-oauth/index.ts\";\nimport compactionExtension from \"./compaction/index.ts\";\nimport configReloadExtension from \"./config-reload/index.ts\";\nimport cursorCliOauthExtension from \"./cursor-cli-oauth/index.ts\";\nimport diffExtension from \"./diff.ts\";\nimport filesExtension from \"./files.ts\";\nimport goalExtension from \"./goal/index.ts\";\nimport gptApplyPatchExtension from \"./gpt-apply-patch/index.ts\";\nimport helpExtension from \"./help/index.ts\";\nimport historySearchExtension from \"./history-search/index.ts\";\nimport hooksExtension from \"./hooks/index.ts\";\nimport imageGenExtension from \"./imagegen/index.ts\";\nimport importReproExtension from \"./import-repro.ts\";\nimport lookAtExtension from \"./look-at/index.ts\";\nimport loopGuardExtension from \"./loop-guard/index.ts\";\nimport mcpExtension from \"./mcp/index.ts\";\nimport modelFallbackExtension from \"./model-fallback/index.ts\";\nimport nestedAgentsMdExtension from \"./nested-agents-md/index.ts\";\nimport openaiImageGenExtension from \"./openai-image-gen/index.ts\";\nimport openaiWebSearchExtension from \"./openai-web-search/index.ts\";\nimport permissionSystemExtension from \"./permission-system/index.ts\";\nimport promptPresetExtension from \"./prompt-preset/index.ts\";\nimport promptUrlWidgetExtension from \"./prompt-url-widget.ts\";\nimport reasoningExtension from \"./reasoning/index.ts\";\nimport recommendedModelsExtension from \"./recommended-models/index.ts\";\nimport redrawsExtension from \"./redraws.ts\";\nimport piRulesExtension from \"./rules/index.ts\";\nimport serviceTierExtension from \"./service-tier.ts\";\nimport terminalExtension from \"./terminal/index.ts\";\nimport todowriteExtension from \"./todotools/index.ts\";\nimport toolPairGuardExtension from \"./tool-pair-guard/index.ts\";\nimport toolSearchExtension from \"./tool-search/index.ts\";\nimport tpsExtension from \"./tps.ts\";\nimport ttsrExtension from \"./ttsr/index.ts\";\nimport videoInExtension from \"./video-in/index.ts\";\nimport webfetchExtension from \"./webfetch/index.ts\";\nimport websearchExtension from \"./websearch/index.ts\";\n\nexport interface BuiltinExtensionFactory {\n\tid: string;\n\tfactory: ExtensionFactory;\n}\n\nexport const globalDefaultExtensionIds = [\"diff\", \"files\", \"prompt-url-widget\", \"tps\"] as const;\n\nexport const globalDefaultExtensionFactories = {\n\tdiff: diffExtension,\n\tfiles: filesExtension,\n\t\"prompt-url-widget\": promptUrlWidgetExtension,\n\ttps: tpsExtension,\n} satisfies Record<(typeof globalDefaultExtensionIds)[number], ExtensionFactory>;\n\nexport const builtinExtensions: BuiltinExtensionFactory[] = [\n\t// Loop guard owns the first veto opportunity so repeated calls never re-run hooks or permission prompts.\n\t{ id: \"loop-guard\", factory: loopGuardExtension },\n\t{ id: \"hooks\", factory: hooksExtension },\n\t{ id: \"permission-system\", factory: permissionSystemExtension },\n\t{ id: \"gpt-apply-patch\", factory: gptApplyPatchExtension },\n\t{ id: \"imagegen\", factory: imageGenExtension },\n\t// Follows imagegen so the native injector's bypass wiring observes the registered client tool.\n\t{ id: \"openai-image-gen\", factory: openaiImageGenExtension },\n\t{ id: \"prompt-preset\", factory: promptPresetExtension },\n\t{ id: \"todowrite\", factory: todowriteExtension },\n\t{ id: \"redraws\", factory: redrawsExtension },\n\t{ id: \"anthropic-web-search\", factory: anthropicWebSearchExtension },\n\t{ id: \"anthropic-bash\", factory: anthropicBashExtension },\n\t{ id: \"openai-web-search\", factory: openaiWebSearchExtension },\n\t{ id: \"service-tier\", factory: serviceTierExtension },\n\t// Sits beside service-tier: both are capability-aware model-control commands that only read\n\t// the active model and notify; neither mutates payloads, so relative order is not load-bearing.\n\t{ id: \"reasoning\", factory: reasoningExtension },\n\t{ id: \"model-fallback\", factory: modelFallbackExtension },\n\t{ id: \"recommended-models\", factory: recommendedModelsExtension },\n\t{ id: \"bash-timeout\", factory: bashTimeoutExtension },\n\t// Terminal follows bash-timeout so its injected default reaches the PTY bash, and follows\n\t// anthropic-bash so mutual-exclusion (companion step-aside) is evaluated after it registers.\n\t{ id: \"terminal\", factory: terminalExtension },\n\t{ id: \"tool-pair-guard\", factory: toolPairGuardExtension },\n\t{ id: \"compaction\", factory: compactionExtension },\n\t{ id: \"history-search\", factory: historySearchExtension },\n\t{ id: \"help\", factory: helpExtension },\n\t{ id: \"import-repro\", factory: importReproExtension },\n\t{ id: \"websearch\", factory: websearchExtension },\n\t{ id: \"webfetch\", factory: webfetchExtension },\n\t{ id: \"video-in\", factory: videoInExtension },\n\t{ id: \"look-at\", factory: lookAtExtension },\n\t{ id: \"nested-agents-md\", factory: nestedAgentsMdExtension },\n\t{ id: \"rules\", factory: piRulesExtension },\n\t{ id: \"goal\", factory: goalExtension },\n\t{ id: \"cache-keepalive\", factory: cacheKeepAliveExtension },\n\t{ id: \"ttsr\", factory: ttsrExtension },\n\t{ id: \"btw\", factory: btwExtension },\n\t{ id: \"claude-sdk-oauth\", factory: claudeSdkOauthExtension },\n\t// Registers unconditionally and reports executable/auth state through its oauth check, so it stays beside the other provider lane.\n\t{ id: \"cursor-cli-oauth\", factory: cursorCliOauthExtension },\n\t// Config reload follows settings-dependent builtins so reloads rebuild their resolved settings before catalog feeders observe them.\n\t{ id: \"config-reload\", factory: configReloadExtension },\n\t// Shared catalog wiring loads before MCP, which feeds its tools into the shared catalog as the final builtin.\n\t{ id: \"tool-search\", factory: toolSearchExtension },\n\t// Keep MCP last so its eventual provider-payload tap observes all co-resident builtin mutations.\n\t{ id: \"mcp\", factory: mcpExtension },\n];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detectors.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/detectors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"detectors.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/detectors.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAWnD,MAAM,MAAM,kBAAkB,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC/G;IACA,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC5B,GACD;IACA,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEL,MAAM,MAAM,aAAa,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;AA6BvD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,GAAG,kBAAkB,GAAG,SAAS,CAUrG;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,GAAG,kBAAkB,GAAG,SAAS,CAgBnG;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,GAAG,kBAAkB,GAAG,SAAS,CA6B9F;AAkBD,qBAAa,UAAU;IACtB,OAAO,CAAC,OAAO,CAAuC;IAEtD,KAAK,CAAC,SAAS,EAAE,kBAAkB,GAAG,OAAO;IAqB7C,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG,IAAI;IAMvD,KAAK,IAAI,IAAI;CAGb;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,EAAE,IAAI,EAAE,UAAU,GAAG,kBAAkB,GAAG,SAAS,CAW/G"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CYCLE_MAX_PERIOD, CYCLE_MIN_PERIOD, CYCLE_REPETITION_THRESHOLD, ESCALATION_FACTOR, IDENTICAL_RUN_THRESHOLD, SIMILAR_RUN_THRESHOLD, SIMILARITY_THRESHOLD, } from "./policy.js";
|
|
1
|
+
import { CYCLE_MAX_PERIOD, CYCLE_MIN_PERIOD, CYCLE_REPETITION_THRESHOLD, ESCALATION_FACTOR, IDENTICAL_RUN_THRESHOLD, SIMILAR_RUN_THRESHOLD, SIMILARITY_THRESHOLD, TRACK_WINDOW, } from "./policy.js";
|
|
2
2
|
import { meanAdjacentSimilarity } from "./similarity.js";
|
|
3
3
|
const TARGET_FIELDS = new Map([
|
|
4
4
|
["read", ["path"]],
|
|
@@ -109,18 +109,36 @@ export function detectCycle(records) {
|
|
|
109
109
|
}
|
|
110
110
|
return undefined;
|
|
111
111
|
}
|
|
112
|
+
function maximumObservableCount(detection) {
|
|
113
|
+
switch (detection.kind) {
|
|
114
|
+
case "identical":
|
|
115
|
+
case "similar":
|
|
116
|
+
return TRACK_WINDOW;
|
|
117
|
+
case "cycle":
|
|
118
|
+
return Math.floor(TRACK_WINDOW / detection.period);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
112
121
|
export class NoticeGate {
|
|
113
122
|
constructor() {
|
|
114
123
|
this.entries = new Map();
|
|
115
124
|
}
|
|
116
125
|
admit(detection) {
|
|
126
|
+
const maximumCount = maximumObservableCount(detection);
|
|
117
127
|
const existing = this.entries.get(detection.kind);
|
|
118
128
|
if (existing === undefined || existing.fingerprint !== detection.fingerprint) {
|
|
119
|
-
this.entries.set(detection.kind, {
|
|
129
|
+
this.entries.set(detection.kind, {
|
|
130
|
+
fingerprint: detection.fingerprint,
|
|
131
|
+
lastNotifiedCount: detection.count,
|
|
132
|
+
saturationNotified: detection.count >= maximumCount,
|
|
133
|
+
});
|
|
120
134
|
return true;
|
|
121
135
|
}
|
|
122
|
-
|
|
136
|
+
const reachedDoubledCount = detection.count >= existing.lastNotifiedCount * ESCALATION_FACTOR;
|
|
137
|
+
const reachedSaturation = !existing.saturationNotified && detection.count >= maximumCount;
|
|
138
|
+
if (reachedDoubledCount || reachedSaturation) {
|
|
123
139
|
existing.lastNotifiedCount = detection.count;
|
|
140
|
+
if (reachedSaturation)
|
|
141
|
+
existing.saturationNotified = true;
|
|
124
142
|
return true;
|
|
125
143
|
}
|
|
126
144
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detectors.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/detectors.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,0BAA0B,EAC1B,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,MAAM,aAAa,GAAG,IAAI,GAAG,CAA4B;IACxD,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC,aAAa,EAA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C,KAAK,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;IACxE,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["import {\n\tCYCLE_MAX_PERIOD,\n\tCYCLE_MIN_PERIOD,\n\tCYCLE_REPETITION_THRESHOLD,\n\tESCALATION_FACTOR,\n\tIDENTICAL_RUN_THRESHOLD,\n\tSIMILAR_RUN_THRESHOLD,\n\tSIMILARITY_THRESHOLD,\n} from \"./policy.ts\";\nimport { meanAdjacentSimilarity } from \"./similarity.ts\";\nimport type { ToolCallRecord } from \"./tracker.ts\";\n\nconst TARGET_FIELDS = new Map<string, readonly string[]>([\n\t[\"read\", [\"path\"]],\n\t[\"bash_output\", [\"bash_id\"]],\n\t[\"task_output\", [\"task_id\", \"name\"]],\n\t[\"task_update\", [\"task_id\"]],\n\t[\"task_send\", [\"to\"]],\n\t[\"lsp_diagnostics\", [\"filePath\"]],\n]);\n\nexport type LoopGuardDetection =\n\t| { readonly kind: \"identical\"; readonly toolName: string; readonly count: number; readonly fingerprint: string }\n\t| {\n\t\t\treadonly kind: \"similar\";\n\t\t\treadonly toolName: string;\n\t\t\treadonly count: number;\n\t\t\treadonly similarity: number;\n\t\t\treadonly fingerprint: string;\n\t }\n\t| {\n\t\t\treadonly kind: \"cycle\";\n\t\t\treadonly period: number;\n\t\t\treadonly count: number;\n\t\t\treadonly cycleTools: readonly string[];\n\t\t\treadonly fingerprint: string;\n\t };\n\nexport type LoopGuardKind = LoopGuardDetection[\"kind\"];\n\nfunction targetIdentity(record: ToolCallRecord): string | undefined {\n\tconst fields = TARGET_FIELDS.get(record.toolName);\n\tif (fields === undefined) return undefined;\n\tlet args: unknown;\n\ttry {\n\t\targs = JSON.parse(record.argsJson);\n\t} catch {\n\t\treturn undefined;\n\t}\n\tif (typeof args !== \"object\" || args === null || Array.isArray(args)) return undefined;\n\tfor (const field of fields) {\n\t\tconst value: unknown = Reflect.get(args, field);\n\t\tif (typeof value === \"string\" && value.length > 0) return value;\n\t}\n\treturn undefined;\n}\n\nfunction hasAllDistinctTargets(records: readonly ToolCallRecord[]): boolean {\n\tconst identities: string[] = [];\n\tfor (const record of records) {\n\t\tconst identity = targetIdentity(record);\n\t\tif (identity === undefined) return false;\n\t\tidentities.push(identity);\n\t}\n\treturn new Set(identities).size === identities.length;\n}\n\nexport function detectIdenticalRun(records: readonly ToolCallRecord[]): LoopGuardDetection | undefined {\n\tconst last = records[records.length - 1];\n\tif (last === undefined) return undefined;\n\tlet run = 1;\n\tfor (let i = records.length - 2; i >= 0; i--) {\n\t\tif (records[i]?.signature !== last.signature) break;\n\t\trun++;\n\t}\n\tif (run < IDENTICAL_RUN_THRESHOLD) return undefined;\n\treturn { kind: \"identical\", toolName: last.toolName, count: run, fingerprint: last.signature };\n}\n\nexport function detectSimilarRun(records: readonly ToolCallRecord[]): LoopGuardDetection | undefined {\n\tconst last = records[records.length - 1];\n\tif (last === undefined) return undefined;\n\tlet run = 1;\n\tfor (let i = records.length - 2; i >= 0; i--) {\n\t\tif (records[i]?.toolName !== last.toolName) break;\n\t\trun++;\n\t}\n\tif (run < SIMILAR_RUN_THRESHOLD) return undefined;\n\tconst runRecords = records.slice(records.length - run);\n\tconst argStrings = runRecords.map((record) => record.argsJson);\n\tif (new Set(argStrings).size === 1) return undefined;\n\tif (hasAllDistinctTargets(runRecords)) return undefined;\n\tconst similarity = meanAdjacentSimilarity(argStrings);\n\tif (similarity < SIMILARITY_THRESHOLD) return undefined;\n\treturn { kind: \"similar\", toolName: last.toolName, count: run, similarity, fingerprint: last.toolName };\n}\n\nexport function detectCycle(records: readonly ToolCallRecord[]): LoopGuardDetection | undefined {\n\tconst total = records.length;\n\tfor (let period = CYCLE_MIN_PERIOD; period <= CYCLE_MAX_PERIOD; period++) {\n\t\tif (total < period * CYCLE_REPETITION_THRESHOLD) continue;\n\t\tconst cycle = records.slice(total - period);\n\t\tif (new Set(cycle.map((record) => record.signature)).size < 2) continue;\n\t\tlet repetitions = 1;\n\t\twhile (repetitions * period + period <= total) {\n\t\t\tconst blockStart = total - (repetitions + 1) * period;\n\t\t\tlet matches = true;\n\t\t\tfor (let offset = 0; offset < period; offset++) {\n\t\t\t\tif (records[blockStart + offset]?.signature !== cycle[offset]?.signature) {\n\t\t\t\t\tmatches = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!matches) break;\n\t\t\trepetitions++;\n\t\t}\n\t\tif (repetitions < CYCLE_REPETITION_THRESHOLD) continue;\n\t\treturn {\n\t\t\tkind: \"cycle\",\n\t\t\tperiod,\n\t\t\tcount: repetitions,\n\t\t\tcycleTools: cycle.map((record) => record.toolName),\n\t\t\tfingerprint: cycle.map((record) => record.signature).join(\"\\u0001\"),\n\t\t};\n\t}\n\treturn undefined;\n}\n\ninterface GateEntry {\n\tfingerprint: string;\n\tlastNotifiedCount: number;\n}\n\nexport class NoticeGate {\n\tprivate entries = new Map<LoopGuardKind, GateEntry>();\n\n\tadmit(detection: LoopGuardDetection): boolean {\n\t\tconst existing = this.entries.get(detection.kind);\n\t\tif (existing === undefined || existing.fingerprint !== detection.fingerprint) {\n\t\t\tthis.entries.set(detection.kind, { fingerprint: detection.fingerprint, lastNotifiedCount: detection.count });\n\t\t\treturn true;\n\t\t}\n\t\tif (detection.count >= existing.lastNotifiedCount * ESCALATION_FACTOR) {\n\t\t\texisting.lastNotifiedCount = detection.count;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprune(active: ReadonlyMap<LoopGuardKind, string>): void {\n\t\tfor (const [kind, entry] of this.entries) {\n\t\t\tif (active.get(kind) !== entry.fingerprint) this.entries.delete(kind);\n\t\t}\n\t}\n\n\treset(): void {\n\t\tthis.entries.clear();\n\t}\n}\n\nexport function detectLoop(records: readonly ToolCallRecord[], gate: NoticeGate): LoopGuardDetection | undefined {\n\tconst detections = [detectIdenticalRun(records), detectCycle(records), detectSimilarRun(records)];\n\tconst active = new Map<LoopGuardKind, string>();\n\tfor (const detection of detections) {\n\t\tif (detection !== undefined) active.set(detection.kind, detection.fingerprint);\n\t}\n\tgate.prune(active);\n\tfor (const detection of detections) {\n\t\tif (detection !== undefined && gate.admit(detection)) return detection;\n\t}\n\treturn undefined;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"detectors.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/detectors.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,0BAA0B,EAC1B,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,YAAY,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAGzD,MAAM,aAAa,GAAG,IAAI,GAAG,CAA4B;IACxD,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,iBAAiB,EAAE,CAAC,UAAU,CAAC,CAAC;CACjC,CAAC,CAAC;AAqBH,SAAS,cAAc,CAAC,MAAsB;IAC7C,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC3C,IAAI,IAAa,CAAC;IAClB,IAAI,CAAC;QACJ,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,I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AC;YAAE,OAAO,SAAS,CAAC;IACxE,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["import {\n\tCYCLE_MAX_PERIOD,\n\tCYCLE_MIN_PERIOD,\n\tCYCLE_REPETITION_THRESHOLD,\n\tESCALATION_FACTOR,\n\tIDENTICAL_RUN_THRESHOLD,\n\tSIMILAR_RUN_THRESHOLD,\n\tSIMILARITY_THRESHOLD,\n\tTRACK_WINDOW,\n} from \"./policy.ts\";\nimport { meanAdjacentSimilarity } from \"./similarity.ts\";\nimport type { ToolCallRecord } from \"./tracker.ts\";\n\nconst TARGET_FIELDS = new Map<string, readonly string[]>([\n\t[\"read\", [\"path\"]],\n\t[\"bash_output\", [\"bash_id\"]],\n\t[\"task_output\", [\"task_id\", \"name\"]],\n\t[\"task_update\", [\"task_id\"]],\n\t[\"task_send\", [\"to\"]],\n\t[\"lsp_diagnostics\", [\"filePath\"]],\n]);\n\nexport type LoopGuardDetection =\n\t| { readonly kind: \"identical\"; readonly toolName: string; readonly count: number; readonly fingerprint: string }\n\t| {\n\t\t\treadonly kind: \"similar\";\n\t\t\treadonly toolName: string;\n\t\t\treadonly count: number;\n\t\t\treadonly similarity: number;\n\t\t\treadonly fingerprint: string;\n\t }\n\t| {\n\t\t\treadonly kind: \"cycle\";\n\t\t\treadonly period: number;\n\t\t\treadonly count: number;\n\t\t\treadonly cycleTools: readonly string[];\n\t\t\treadonly fingerprint: string;\n\t };\n\nexport type LoopGuardKind = LoopGuardDetection[\"kind\"];\n\nfunction targetIdentity(record: ToolCallRecord): string | undefined {\n\tconst fields = TARGET_FIELDS.get(record.toolName);\n\tif (fields === undefined) return undefined;\n\tlet args: unknown;\n\ttry {\n\t\targs = JSON.parse(record.argsJson);\n\t} catch {\n\t\treturn undefined;\n\t}\n\tif (typeof args !== \"object\" || args === null || Array.isArray(args)) return undefined;\n\tfor (const field of fields) {\n\t\tconst value: unknown = Reflect.get(args, field);\n\t\tif (typeof value === \"string\" && value.length > 0) return value;\n\t}\n\treturn undefined;\n}\n\nfunction hasAllDistinctTargets(records: readonly ToolCallRecord[]): boolean {\n\tconst identities: string[] = [];\n\tfor (const record of records) {\n\t\tconst identity = targetIdentity(record);\n\t\tif (identity === undefined) return false;\n\t\tidentities.push(identity);\n\t}\n\treturn new Set(identities).size === identities.length;\n}\n\nexport function detectIdenticalRun(records: readonly ToolCallRecord[]): LoopGuardDetection | undefined {\n\tconst last = records[records.length - 1];\n\tif (last === undefined) return undefined;\n\tlet run = 1;\n\tfor (let i = records.length - 2; i >= 0; i--) {\n\t\tif (records[i]?.signature !== last.signature) break;\n\t\trun++;\n\t}\n\tif (run < IDENTICAL_RUN_THRESHOLD) return undefined;\n\treturn { kind: \"identical\", toolName: last.toolName, count: run, fingerprint: last.signature };\n}\n\nexport function detectSimilarRun(records: readonly ToolCallRecord[]): LoopGuardDetection | undefined {\n\tconst last = records[records.length - 1];\n\tif (last === undefined) return undefined;\n\tlet run = 1;\n\tfor (let i = records.length - 2; i >= 0; i--) {\n\t\tif (records[i]?.toolName !== last.toolName) break;\n\t\trun++;\n\t}\n\tif (run < SIMILAR_RUN_THRESHOLD) return undefined;\n\tconst runRecords = records.slice(records.length - run);\n\tconst argStrings = runRecords.map((record) => record.argsJson);\n\tif (new Set(argStrings).size === 1) return undefined;\n\tif (hasAllDistinctTargets(runRecords)) return undefined;\n\tconst similarity = meanAdjacentSimilarity(argStrings);\n\tif (similarity < SIMILARITY_THRESHOLD) return undefined;\n\treturn { kind: \"similar\", toolName: last.toolName, count: run, similarity, fingerprint: last.toolName };\n}\n\nexport function detectCycle(records: readonly ToolCallRecord[]): LoopGuardDetection | undefined {\n\tconst total = records.length;\n\tfor (let period = CYCLE_MIN_PERIOD; period <= CYCLE_MAX_PERIOD; period++) {\n\t\tif (total < period * CYCLE_REPETITION_THRESHOLD) continue;\n\t\tconst cycle = records.slice(total - period);\n\t\tif (new Set(cycle.map((record) => record.signature)).size < 2) continue;\n\t\tlet repetitions = 1;\n\t\twhile (repetitions * period + period <= total) {\n\t\t\tconst blockStart = total - (repetitions + 1) * period;\n\t\t\tlet matches = true;\n\t\t\tfor (let offset = 0; offset < period; offset++) {\n\t\t\t\tif (records[blockStart + offset]?.signature !== cycle[offset]?.signature) {\n\t\t\t\t\tmatches = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!matches) break;\n\t\t\trepetitions++;\n\t\t}\n\t\tif (repetitions < CYCLE_REPETITION_THRESHOLD) continue;\n\t\treturn {\n\t\t\tkind: \"cycle\",\n\t\t\tperiod,\n\t\t\tcount: repetitions,\n\t\t\tcycleTools: cycle.map((record) => record.toolName),\n\t\t\tfingerprint: cycle.map((record) => record.signature).join(\"\\u0001\"),\n\t\t};\n\t}\n\treturn undefined;\n}\n\ninterface GateEntry {\n\tfingerprint: string;\n\tlastNotifiedCount: number;\n\tsaturationNotified: boolean;\n}\n\nfunction maximumObservableCount(detection: LoopGuardDetection): number {\n\tswitch (detection.kind) {\n\t\tcase \"identical\":\n\t\tcase \"similar\":\n\t\t\treturn TRACK_WINDOW;\n\t\tcase \"cycle\":\n\t\t\treturn Math.floor(TRACK_WINDOW / detection.period);\n\t}\n}\n\nexport class NoticeGate {\n\tprivate entries = new Map<LoopGuardKind, GateEntry>();\n\n\tadmit(detection: LoopGuardDetection): boolean {\n\t\tconst maximumCount = maximumObservableCount(detection);\n\t\tconst existing = this.entries.get(detection.kind);\n\t\tif (existing === undefined || existing.fingerprint !== detection.fingerprint) {\n\t\t\tthis.entries.set(detection.kind, {\n\t\t\t\tfingerprint: detection.fingerprint,\n\t\t\t\tlastNotifiedCount: detection.count,\n\t\t\t\tsaturationNotified: detection.count >= maximumCount,\n\t\t\t});\n\t\t\treturn true;\n\t\t}\n\t\tconst reachedDoubledCount = detection.count >= existing.lastNotifiedCount * ESCALATION_FACTOR;\n\t\tconst reachedSaturation = !existing.saturationNotified && detection.count >= maximumCount;\n\t\tif (reachedDoubledCount || reachedSaturation) {\n\t\t\texisting.lastNotifiedCount = detection.count;\n\t\t\tif (reachedSaturation) existing.saturationNotified = true;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprune(active: ReadonlyMap<LoopGuardKind, string>): void {\n\t\tfor (const [kind, entry] of this.entries) {\n\t\t\tif (active.get(kind) !== entry.fingerprint) this.entries.delete(kind);\n\t\t}\n\t}\n\n\treset(): void {\n\t\tthis.entries.clear();\n\t}\n}\n\nexport function detectLoop(records: readonly ToolCallRecord[], gate: NoticeGate): LoopGuardDetection | undefined {\n\tconst detections = [detectIdenticalRun(records), detectCycle(records), detectSimilarRun(records)];\n\tconst active = new Map<LoopGuardKind, string>();\n\tfor (const detection of detections) {\n\t\tif (detection !== undefined) active.set(detection.kind, detection.fingerprint);\n\t}\n\tgate.prune(active);\n\tfor (const detection of detections) {\n\t\tif (detection !== undefined && gate.admit(detection)) return detection;\n\t}\n\treturn undefined;\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { LoopGuardDetection } from "./detectors.ts";
|
|
2
|
+
import type { ToolCallRecord } from "./tracker.ts";
|
|
3
|
+
export type IdenticalEscalationDecision = {
|
|
4
|
+
readonly kind: "allow";
|
|
5
|
+
} | {
|
|
6
|
+
readonly kind: "block";
|
|
7
|
+
readonly toolName: string;
|
|
8
|
+
readonly blockedCallCount: number;
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: "hardStop";
|
|
11
|
+
readonly toolName: string;
|
|
12
|
+
readonly blockedCallCount: number;
|
|
13
|
+
readonly announce: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare class IdenticalLoopEscalation {
|
|
16
|
+
private episode;
|
|
17
|
+
private readonly attempts;
|
|
18
|
+
observeAttempt(toolCallId: string, record: ToolCallRecord): boolean;
|
|
19
|
+
observeNotice(detection: LoopGuardDetection): void;
|
|
20
|
+
finishTurn(): void;
|
|
21
|
+
consumeToolCall(toolCallId: string): IdenticalEscalationDecision;
|
|
22
|
+
reset(): void;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=escalation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escalation.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/escalation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,MAAM,MAAM,2BAA2B,GACpC;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,GACxF;IACA,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC1B,CAAC;AAcL,qBAAa,uBAAuB;IACnC,OAAO,CAAC,OAAO,CAAmC;IAClD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqC;IAE9D,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO;IASnE,aAAa,CAAC,SAAS,EAAE,kBAAkB,GAAG,IAAI;IAyBlD,UAAU,IAAI,IAAI;IAIlB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,2BAA2B;IA+BhE,KAAK,IAAI,IAAI;CAIb"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { IDENTICAL_BLOCK_NOTICE_THRESHOLD, IDENTICAL_HARD_STOP_BLOCK_THRESHOLD } from "./policy.js";
|
|
2
|
+
const ALLOW_DECISION = { kind: "allow" };
|
|
3
|
+
export class IdenticalLoopEscalation {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.attempts = new Map();
|
|
6
|
+
}
|
|
7
|
+
observeAttempt(toolCallId, record) {
|
|
8
|
+
const patternChanged = this.episode !== undefined && this.episode.fingerprint !== record.signature;
|
|
9
|
+
if (patternChanged) {
|
|
10
|
+
this.reset();
|
|
11
|
+
}
|
|
12
|
+
this.attempts.set(toolCallId, record);
|
|
13
|
+
return patternChanged;
|
|
14
|
+
}
|
|
15
|
+
observeNotice(detection) {
|
|
16
|
+
switch (detection.kind) {
|
|
17
|
+
case "similar":
|
|
18
|
+
case "cycle":
|
|
19
|
+
return;
|
|
20
|
+
case "identical": {
|
|
21
|
+
if (this.episode === undefined || this.episode.fingerprint !== detection.fingerprint) {
|
|
22
|
+
this.episode = {
|
|
23
|
+
fingerprint: detection.fingerprint,
|
|
24
|
+
toolName: detection.toolName,
|
|
25
|
+
admittedNoticeCount: 0,
|
|
26
|
+
activateBlockAfterAttempt: false,
|
|
27
|
+
blockActive: false,
|
|
28
|
+
blockedCallCount: 0,
|
|
29
|
+
hardStopAnnounced: false,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
this.episode.admittedNoticeCount++;
|
|
33
|
+
if (this.episode.admittedNoticeCount >= IDENTICAL_BLOCK_NOTICE_THRESHOLD) {
|
|
34
|
+
this.episode.activateBlockAfterAttempt = true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
finishTurn() {
|
|
40
|
+
this.attempts.clear();
|
|
41
|
+
}
|
|
42
|
+
consumeToolCall(toolCallId) {
|
|
43
|
+
const attempt = this.attempts.get(toolCallId);
|
|
44
|
+
this.attempts.delete(toolCallId);
|
|
45
|
+
if (attempt === undefined || this.episode === undefined || this.episode.fingerprint !== attempt.signature) {
|
|
46
|
+
return ALLOW_DECISION;
|
|
47
|
+
}
|
|
48
|
+
if (!this.episode.blockActive) {
|
|
49
|
+
if (this.episode.activateBlockAfterAttempt) {
|
|
50
|
+
this.episode.activateBlockAfterAttempt = false;
|
|
51
|
+
this.episode.blockActive = true;
|
|
52
|
+
}
|
|
53
|
+
return ALLOW_DECISION;
|
|
54
|
+
}
|
|
55
|
+
this.episode.blockedCallCount++;
|
|
56
|
+
if (this.episode.blockedCallCount >= IDENTICAL_HARD_STOP_BLOCK_THRESHOLD) {
|
|
57
|
+
const announce = !this.episode.hardStopAnnounced;
|
|
58
|
+
this.episode.hardStopAnnounced = true;
|
|
59
|
+
return {
|
|
60
|
+
kind: "hardStop",
|
|
61
|
+
toolName: this.episode.toolName,
|
|
62
|
+
blockedCallCount: this.episode.blockedCallCount,
|
|
63
|
+
announce,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
kind: "block",
|
|
68
|
+
toolName: this.episode.toolName,
|
|
69
|
+
blockedCallCount: this.episode.blockedCallCount,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
reset() {
|
|
73
|
+
this.episode = undefined;
|
|
74
|
+
this.attempts.clear();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=escalation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escalation.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/escalation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,mCAAmC,EAAE,MAAM,aAAa,CAAC;AAuBpG,MAAM,cAAc,GAAG,EAAE,IAAI,EAAE,OAAO,EAAW,CAAC;AAElD,MAAM,OAAO,uBAAuB;IAApC;QAEkB,aAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;IA2E/D,CAAC;IAzEA,cAAc,CAAC,UAAkB,EAAE,MAAsB;QACxD,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,KAAK,MAAM,CAAC,SAAS,CAAC;QACnG,IAAI,cAAc,EAAE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import type { ToolCallRecord } from \"./tracker.ts\";\n\nexport type IdenticalEscalationDecision =\n\t| { readonly kind: \"allow\" }\n\t| { readonly kind: \"block\"; readonly toolName: string; readonly blockedCallCount: number }\n\t| {\n\t\t\treadonly kind: \"hardStop\";\n\t\t\treadonly toolName: string;\n\t\t\treadonly blockedCallCount: number;\n\t\t\treadonly announce: boolean;\n\t };\n\ninterface IdenticalLoopEpisode {\n\tfingerprint: string;\n\ttoolName: string;\n\tadmittedNoticeCount: number;\n\tactivateBlockAfterAttempt: boolean;\n\tblockActive: boolean;\n\tblockedCallCount: number;\n\thardStopAnnounced: boolean;\n}\n\nconst ALLOW_DECISION = { kind: \"allow\" } as const;\n\nexport class IdenticalLoopEscalation {\n\tprivate episode: IdenticalLoopEpisode | undefined;\n\tprivate readonly attempts = new Map<string, ToolCallRecord>();\n\n\tobserveAttempt(toolCallId: string, record: ToolCallRecord): boolean {\n\t\tconst patternChanged = this.episode !== undefined && this.episode.fingerprint !== record.signature;\n\t\tif (patternChanged) {\n\t\t\tthis.reset();\n\t\t}\n\t\tthis.attempts.set(toolCallId, record);\n\t\treturn patternChanged;\n\t}\n\n\tobserveNotice(detection: LoopGuardDetection): void {\n\t\tswitch (detection.kind) {\n\t\t\tcase \"similar\":\n\t\t\tcase \"cycle\":\n\t\t\t\treturn;\n\t\t\tcase \"identical\": {\n\t\t\t\tif (this.episode === undefined || this.episode.fingerprint !== detection.fingerprint) {\n\t\t\t\t\tthis.episode = {\n\t\t\t\t\t\tfingerprint: detection.fingerprint,\n\t\t\t\t\t\ttoolName: detection.toolName,\n\t\t\t\t\t\tadmittedNoticeCount: 0,\n\t\t\t\t\t\tactivateBlockAfterAttempt: false,\n\t\t\t\t\t\tblockActive: false,\n\t\t\t\t\t\tblockedCallCount: 0,\n\t\t\t\t\t\thardStopAnnounced: false,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tthis.episode.admittedNoticeCount++;\n\t\t\t\tif (this.episode.admittedNoticeCount >= IDENTICAL_BLOCK_NOTICE_THRESHOLD) {\n\t\t\t\t\tthis.episode.activateBlockAfterAttempt = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfinishTurn(): void {\n\t\tthis.attempts.clear();\n\t}\n\n\tconsumeToolCall(toolCallId: string): IdenticalEscalationDecision {\n\t\tconst attempt = this.attempts.get(toolCallId);\n\t\tthis.attempts.delete(toolCallId);\n\t\tif (attempt === undefined || this.episode === undefined || this.episode.fingerprint !== attempt.signature) {\n\t\t\treturn ALLOW_DECISION;\n\t\t}\n\t\tif (!this.episode.blockActive) {\n\t\t\tif (this.episode.activateBlockAfterAttempt) {\n\t\t\t\tthis.episode.activateBlockAfterAttempt = false;\n\t\t\t\tthis.episode.blockActive = true;\n\t\t\t}\n\t\t\treturn ALLOW_DECISION;\n\t\t}\n\t\tthis.episode.blockedCallCount++;\n\t\tif (this.episode.blockedCallCount >= IDENTICAL_HARD_STOP_BLOCK_THRESHOLD) {\n\t\t\tconst announce = !this.episode.hardStopAnnounced;\n\t\t\tthis.episode.hardStopAnnounced = true;\n\t\t\treturn {\n\t\t\t\tkind: \"hardStop\",\n\t\t\t\ttoolName: this.episode.toolName,\n\t\t\t\tblockedCallCount: this.episode.blockedCallCount,\n\t\t\t\tannounce,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tkind: \"block\",\n\t\t\ttoolName: this.episode.toolName,\n\t\t\tblockedCallCount: this.episode.blockedCallCount,\n\t\t};\n\t}\n\n\treset(): void {\n\t\tthis.episode = undefined;\n\t\tthis.attempts.clear();\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAkBnD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAkIjE"}
|
|
@@ -1,25 +1,63 @@
|
|
|
1
|
+
import { CONTINUATION_HOLD_STATE_EVENT, WAKE_SOURCE_STATE_EVENT } from "../monitor-state-event.js";
|
|
1
2
|
import { detectLoop, NoticeGate } from "./detectors.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
3
|
+
import { IdenticalLoopEscalation } from "./escalation.js";
|
|
4
|
+
import { buildLoopGuardBlockReason, buildLoopGuardHardStopSteer, buildLoopGuardHardStopWarning, buildLoopGuardReminder, LOOP_GUARD_ESCALATION_CUSTOM_TYPE, LOOP_GUARD_NOTICE_CUSTOM_TYPE, LOOP_GUARD_RECOVERY_CUSTOM_TYPE, } from "./notice.js";
|
|
5
|
+
import { renderLoopGuardEscalation, renderLoopGuardNotice } from "./renderer.js";
|
|
4
6
|
import { ToolCallTracker } from "./tracker.js";
|
|
7
|
+
const LOOP_GUARD_HARD_STOP_WAKE_SOURCE = "loop-guard-hard-stop";
|
|
5
8
|
export default function loopGuardExtension(pi) {
|
|
6
9
|
const tracker = new ToolCallTracker();
|
|
7
10
|
const gate = new NoticeGate();
|
|
11
|
+
const escalation = new IdenticalLoopEscalation();
|
|
12
|
+
let pendingRecoveryToolName;
|
|
13
|
+
let recoveryWakeSourceActive = false;
|
|
14
|
+
let continuationHoldActive = false;
|
|
15
|
+
const setRecoveryWakeSourceActive = (active) => {
|
|
16
|
+
if (recoveryWakeSourceActive === active)
|
|
17
|
+
return;
|
|
18
|
+
recoveryWakeSourceActive = active;
|
|
19
|
+
pi.events?.emit(WAKE_SOURCE_STATE_EVENT, {
|
|
20
|
+
source: LOOP_GUARD_HARD_STOP_WAKE_SOURCE,
|
|
21
|
+
activeCount: active ? 1 : 0,
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const setContinuationHoldActive = (active) => {
|
|
25
|
+
if (continuationHoldActive === active)
|
|
26
|
+
return;
|
|
27
|
+
continuationHoldActive = active;
|
|
28
|
+
pi.events?.emit(CONTINUATION_HOLD_STATE_EVENT, {
|
|
29
|
+
source: LOOP_GUARD_HARD_STOP_WAKE_SOURCE,
|
|
30
|
+
active,
|
|
31
|
+
});
|
|
32
|
+
};
|
|
8
33
|
const reset = () => {
|
|
9
34
|
tracker.reset();
|
|
10
35
|
gate.reset();
|
|
36
|
+
escalation.reset();
|
|
37
|
+
pendingRecoveryToolName = undefined;
|
|
38
|
+
setRecoveryWakeSourceActive(false);
|
|
39
|
+
setContinuationHoldActive(false);
|
|
11
40
|
};
|
|
12
41
|
pi.registerMessageRenderer(LOOP_GUARD_NOTICE_CUSTOM_TYPE, renderLoopGuardNotice);
|
|
42
|
+
pi.registerMessageRenderer(LOOP_GUARD_ESCALATION_CUSTOM_TYPE, renderLoopGuardEscalation);
|
|
13
43
|
pi.on("session_start", () => reset());
|
|
44
|
+
pi.on("session_shutdown", () => reset());
|
|
14
45
|
pi.on("input", (event) => {
|
|
15
46
|
if (event.source !== "extension")
|
|
16
47
|
reset();
|
|
17
48
|
});
|
|
18
49
|
pi.on("tool_execution_start", (event) => {
|
|
19
|
-
tracker.record(event.toolName, event.args);
|
|
50
|
+
const record = tracker.record(event.toolName, event.args);
|
|
51
|
+
const patternChanged = escalation.observeAttempt(event.toolCallId, record);
|
|
52
|
+
if (patternChanged) {
|
|
53
|
+
pendingRecoveryToolName = undefined;
|
|
54
|
+
setRecoveryWakeSourceActive(false);
|
|
55
|
+
setContinuationHoldActive(false);
|
|
56
|
+
}
|
|
20
57
|
const detection = detectLoop(tracker.records, gate);
|
|
21
58
|
if (detection === undefined)
|
|
22
59
|
return;
|
|
60
|
+
escalation.observeNotice(detection);
|
|
23
61
|
pi.sendMessage({
|
|
24
62
|
customType: LOOP_GUARD_NOTICE_CUSTOM_TYPE,
|
|
25
63
|
content: buildLoopGuardReminder(detection),
|
|
@@ -27,5 +65,62 @@ export default function loopGuardExtension(pi) {
|
|
|
27
65
|
details: detection,
|
|
28
66
|
}, { triggerTurn: false, deliverAs: "steer" });
|
|
29
67
|
});
|
|
68
|
+
pi.on("turn_end", () => {
|
|
69
|
+
escalation.finishTurn();
|
|
70
|
+
});
|
|
71
|
+
pi.on("tool_call", (event, ctx) => {
|
|
72
|
+
const decision = escalation.consumeToolCall(event.toolCallId);
|
|
73
|
+
switch (decision.kind) {
|
|
74
|
+
case "allow":
|
|
75
|
+
return undefined;
|
|
76
|
+
case "block":
|
|
77
|
+
return {
|
|
78
|
+
block: true,
|
|
79
|
+
reason: buildLoopGuardBlockReason(decision.toolName, decision.blockedCallCount),
|
|
80
|
+
terminate: false,
|
|
81
|
+
};
|
|
82
|
+
case "hardStop": {
|
|
83
|
+
const warning = buildLoopGuardHardStopWarning(decision.toolName, decision.blockedCallCount);
|
|
84
|
+
setRecoveryWakeSourceActive(true);
|
|
85
|
+
if (!decision.announce)
|
|
86
|
+
setContinuationHoldActive(true);
|
|
87
|
+
if (decision.announce) {
|
|
88
|
+
pi.sendMessage({
|
|
89
|
+
customType: LOOP_GUARD_ESCALATION_CUSTOM_TYPE,
|
|
90
|
+
content: warning,
|
|
91
|
+
display: true,
|
|
92
|
+
details: {
|
|
93
|
+
toolName: decision.toolName,
|
|
94
|
+
blockedCallCount: decision.blockedCallCount,
|
|
95
|
+
},
|
|
96
|
+
}, { triggerTurn: false, deliverAs: "steer" });
|
|
97
|
+
if (ctx.hasUI)
|
|
98
|
+
ctx.ui.notify(warning, "warning");
|
|
99
|
+
pendingRecoveryToolName = decision.toolName;
|
|
100
|
+
}
|
|
101
|
+
ctx.abort("system");
|
|
102
|
+
return {
|
|
103
|
+
block: true,
|
|
104
|
+
reason: buildLoopGuardBlockReason(decision.toolName, decision.blockedCallCount),
|
|
105
|
+
terminate: false,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
pi.on("agent_start", () => {
|
|
111
|
+
setRecoveryWakeSourceActive(false);
|
|
112
|
+
setContinuationHoldActive(false);
|
|
113
|
+
});
|
|
114
|
+
pi.on("agent_settled", () => {
|
|
115
|
+
const toolName = pendingRecoveryToolName;
|
|
116
|
+
if (toolName === undefined)
|
|
117
|
+
return;
|
|
118
|
+
pendingRecoveryToolName = undefined;
|
|
119
|
+
pi.sendMessage({
|
|
120
|
+
customType: LOOP_GUARD_RECOVERY_CUSTOM_TYPE,
|
|
121
|
+
content: buildLoopGuardHardStopSteer(toolName),
|
|
122
|
+
display: false,
|
|
123
|
+
}, { triggerTurn: true });
|
|
124
|
+
});
|
|
30
125
|
}
|
|
31
126
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EACN,yBAAyB,EACzB,2BAA2B,EAC3B,6BAA6B,EAC7B,sBAAsB,EACtB,iCAAiC,EACjC,6BAA6B,EAC7B,+BAA+B,GAC/B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,gCAAgC,GAAG,sBA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AS,CAAC,CAAC;oBACjD,uBAAuB,GAAG,QAAQ,CAAC,QAAQ,CAAC;gBAC7C,CAAC;gBACD,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;gBACpB,OAAO;oBACN,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE,yBAAyB,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,gBAAgB,CAAC;oBAC/E,SAAS,EAAE,KAAK;iBAChB,CAAC;YACH,CAAC;QACF,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;QACzB,2BAA2B,CAAC,KAAK,CAAC,CAAC;QACnC,yBAAyB,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;QAC3B,MAAM,QAAQ,GAAG,uBAAuB,CAAC;QACzC,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO;QACnC,uBAAuB,GAAG,SAAS,CAAC;QACpC,EAAE,CAAC,WAAW,CACb;YACC,UAAU,EAAE,+BAA+B;YAC3C,OAAO,EAAE,2BAA2B,CAAC,QAAQ,CAAC;YAC9C,OAAO,EAAE,KAAK;SACd,EACD,EAAE,WAAW,EAAE,IAAI,EAAE,CACrB,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { ExtensionAPI } from \"../../types.ts\";\nimport { CONTINUATION_HOLD_STATE_EVENT, WAKE_SOURCE_STATE_EVENT } from \"../monitor-state-event.ts\";\nimport { detectLoop, NoticeGate } from \"./detectors.ts\";\nimport { IdenticalLoopEscalation } from \"./escalation.ts\";\nimport {\n\tbuildLoopGuardBlockReason,\n\tbuildLoopGuardHardStopSteer,\n\tbuildLoopGuardHardStopWarning,\n\tbuildLoopGuardReminder,\n\tLOOP_GUARD_ESCALATION_CUSTOM_TYPE,\n\tLOOP_GUARD_NOTICE_CUSTOM_TYPE,\n\tLOOP_GUARD_RECOVERY_CUSTOM_TYPE,\n} from \"./notice.ts\";\nimport { renderLoopGuardEscalation, renderLoopGuardNotice } from \"./renderer.ts\";\nimport { ToolCallTracker } from \"./tracker.ts\";\n\nconst LOOP_GUARD_HARD_STOP_WAKE_SOURCE = \"loop-guard-hard-stop\";\n\nexport default function loopGuardExtension(pi: ExtensionAPI): void {\n\tconst tracker = new ToolCallTracker();\n\tconst gate = new NoticeGate();\n\tconst escalation = new IdenticalLoopEscalation();\n\tlet pendingRecoveryToolName: string | undefined;\n\tlet recoveryWakeSourceActive = false;\n\tlet continuationHoldActive = false;\n\n\tconst setRecoveryWakeSourceActive = (active: boolean): void => {\n\t\tif (recoveryWakeSourceActive === active) return;\n\t\trecoveryWakeSourceActive = active;\n\t\tpi.events?.emit(WAKE_SOURCE_STATE_EVENT, {\n\t\t\tsource: LOOP_GUARD_HARD_STOP_WAKE_SOURCE,\n\t\t\tactiveCount: active ? 1 : 0,\n\t\t});\n\t};\n\n\tconst setContinuationHoldActive = (active: boolean): void => {\n\t\tif (continuationHoldActive === active) return;\n\t\tcontinuationHoldActive = active;\n\t\tpi.events?.emit(CONTINUATION_HOLD_STATE_EVENT, {\n\t\t\tsource: LOOP_GUARD_HARD_STOP_WAKE_SOURCE,\n\t\t\tactive,\n\t\t});\n\t};\n\n\tconst reset = (): void => {\n\t\ttracker.reset();\n\t\tgate.reset();\n\t\tescalation.reset();\n\t\tpendingRecoveryToolName = undefined;\n\t\tsetRecoveryWakeSourceActive(false);\n\t\tsetContinuationHoldActive(false);\n\t};\n\n\tpi.registerMessageRenderer(LOOP_GUARD_NOTICE_CUSTOM_TYPE, renderLoopGuardNotice);\n\tpi.registerMessageRenderer(LOOP_GUARD_ESCALATION_CUSTOM_TYPE, renderLoopGuardEscalation);\n\n\tpi.on(\"session_start\", () => reset());\n\tpi.on(\"session_shutdown\", () => reset());\n\n\tpi.on(\"input\", (event) => {\n\t\tif (event.source !== \"extension\") reset();\n\t});\n\n\tpi.on(\"tool_execution_start\", (event) => {\n\t\tconst record = tracker.record(event.toolName, event.args);\n\t\tconst patternChanged = escalation.observeAttempt(event.toolCallId, record);\n\t\tif (patternChanged) {\n\t\t\tpendingRecoveryToolName = undefined;\n\t\t\tsetRecoveryWakeSourceActive(false);\n\t\t\tsetContinuationHoldActive(false);\n\t\t}\n\t\tconst detection = detectLoop(tracker.records, gate);\n\t\tif (detection === undefined) return;\n\t\tescalation.observeNotice(detection);\n\t\tpi.sendMessage(\n\t\t\t{\n\t\t\t\tcustomType: LOOP_GUARD_NOTICE_CUSTOM_TYPE,\n\t\t\t\tcontent: buildLoopGuardReminder(detection),\n\t\t\t\tdisplay: true,\n\t\t\t\tdetails: detection,\n\t\t\t},\n\t\t\t{ triggerTurn: false, deliverAs: \"steer\" },\n\t\t);\n\t});\n\n\tpi.on(\"turn_end\", () => {\n\t\tescalation.finishTurn();\n\t});\n\n\tpi.on(\"tool_call\", (event, ctx) => {\n\t\tconst decision = escalation.consumeToolCall(event.toolCallId);\n\t\tswitch (decision.kind) {\n\t\t\tcase \"allow\":\n\t\t\t\treturn undefined;\n\t\t\tcase \"block\":\n\t\t\t\treturn {\n\t\t\t\t\tblock: true,\n\t\t\t\t\treason: buildLoopGuardBlockReason(decision.toolName, decision.blockedCallCount),\n\t\t\t\t\tterminate: false,\n\t\t\t\t};\n\t\t\tcase \"hardStop\": {\n\t\t\t\tconst warning = buildLoopGuardHardStopWarning(decision.toolName, decision.blockedCallCount);\n\t\t\t\tsetRecoveryWakeSourceActive(true);\n\t\t\t\tif (!decision.announce) setContinuationHoldActive(true);\n\t\t\t\tif (decision.announce) {\n\t\t\t\t\tpi.sendMessage(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcustomType: LOOP_GUARD_ESCALATION_CUSTOM_TYPE,\n\t\t\t\t\t\t\tcontent: warning,\n\t\t\t\t\t\t\tdisplay: true,\n\t\t\t\t\t\t\tdetails: {\n\t\t\t\t\t\t\t\ttoolName: decision.toolName,\n\t\t\t\t\t\t\t\tblockedCallCount: decision.blockedCallCount,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ triggerTurn: false, deliverAs: \"steer\" },\n\t\t\t\t\t);\n\t\t\t\t\tif (ctx.hasUI) ctx.ui.notify(warning, \"warning\");\n\t\t\t\t\tpendingRecoveryToolName = decision.toolName;\n\t\t\t\t}\n\t\t\t\tctx.abort(\"system\");\n\t\t\t\treturn {\n\t\t\t\t\tblock: true,\n\t\t\t\t\treason: buildLoopGuardBlockReason(decision.toolName, decision.blockedCallCount),\n\t\t\t\t\tterminate: false,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t});\n\n\tpi.on(\"agent_start\", () => {\n\t\tsetRecoveryWakeSourceActive(false);\n\t\tsetContinuationHoldActive(false);\n\t});\n\n\tpi.on(\"agent_settled\", () => {\n\t\tconst toolName = pendingRecoveryToolName;\n\t\tif (toolName === undefined) return;\n\t\tpendingRecoveryToolName = undefined;\n\t\tpi.sendMessage(\n\t\t\t{\n\t\t\t\tcustomType: LOOP_GUARD_RECOVERY_CUSTOM_TYPE,\n\t\t\t\tcontent: buildLoopGuardHardStopSteer(toolName),\n\t\t\t\tdisplay: false,\n\t\t\t},\n\t\t\t{ triggerTurn: true },\n\t\t);\n\t});\n}\n"]}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { LoopGuardDetection } from "./detectors.ts";
|
|
2
2
|
export declare const LOOP_GUARD_NOTICE_CUSTOM_TYPE = "loop-guard:notice";
|
|
3
|
+
export declare const LOOP_GUARD_ESCALATION_CUSTOM_TYPE = "loop-guard:escalation";
|
|
4
|
+
export declare const LOOP_GUARD_RECOVERY_CUSTOM_TYPE = "loop-guard:recovery";
|
|
3
5
|
export type LoopGuardNoticeDetails = LoopGuardDetection;
|
|
6
|
+
export interface LoopGuardEscalationDetails {
|
|
7
|
+
readonly toolName: string;
|
|
8
|
+
readonly blockedCallCount: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function buildLoopGuardBlockReason(toolName: string, blockedCallCount: number): string;
|
|
11
|
+
export declare function buildLoopGuardHardStopWarning(toolName: string, blockedCallCount: number): string;
|
|
12
|
+
export declare function buildLoopGuardHardStopSteer(toolName: string): string;
|
|
4
13
|
export declare function buildLoopGuardReminder(detection: LoopGuardDetection): string;
|
|
5
14
|
//# sourceMappingURL=notice.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/notice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,eAAO,MAAM,6BAA6B,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"notice.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/notice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,eAAO,MAAM,6BAA6B,sBAAsB,CAAC;AACjE,eAAO,MAAM,iCAAiC,0BAA0B,CAAC;AACzE,eAAO,MAAM,+BAA+B,wBAAwB,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAExD,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CAClC;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAK5F;AAED,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAEhG;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKpE;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,kBAAkB,GAAG,MAAM,CAuC5E"}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
export const LOOP_GUARD_NOTICE_CUSTOM_TYPE = "loop-guard:notice";
|
|
2
|
+
export const LOOP_GUARD_ESCALATION_CUSTOM_TYPE = "loop-guard:escalation";
|
|
3
|
+
export const LOOP_GUARD_RECOVERY_CUSTOM_TYPE = "loop-guard:recovery";
|
|
4
|
+
export function buildLoopGuardBlockReason(toolName, blockedCallCount) {
|
|
5
|
+
return [
|
|
6
|
+
`Loop guard blocked repeated call ${blockedCallCount} to \`${toolName}\` with arguments that already triggered two identical-call warnings.`,
|
|
7
|
+
"Reuse the existing result, change an argument deliberately, or choose a different tool.",
|
|
8
|
+
].join(" ");
|
|
9
|
+
}
|
|
10
|
+
export function buildLoopGuardHardStopWarning(toolName, blockedCallCount) {
|
|
11
|
+
return `Loop guard interrupted the turn after blocking ${blockedCallCount} repeated calls to ${toolName}.`;
|
|
12
|
+
}
|
|
13
|
+
export function buildLoopGuardHardStopSteer(toolName) {
|
|
14
|
+
return [
|
|
15
|
+
`The loop guard stopped the previous turn because you kept calling \`${toolName}\` with arguments that had already been blocked.`,
|
|
16
|
+
"Do not repeat that call. Re-plan from the current goal and use a different tool or deliberately changed arguments.",
|
|
17
|
+
].join(" ");
|
|
18
|
+
}
|
|
2
19
|
export function buildLoopGuardReminder(detection) {
|
|
3
20
|
switch (detection.kind) {
|
|
4
21
|
case "identical": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/notice.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,6BAA6B,GAAG,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"notice.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/notice.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,6BAA6B,GAAG,mBAAmB,CAAC;AACjE,MAAM,CAAC,MAAM,iCAAiC,GAAG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iJAAiJ;gBACjJ,oBAAoB;aACpB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,CAAC;QACD,KAAK,OAAO,CAAC,CAAC,CAAC;YACd,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;YAChD,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACxC,OAAO;gBACN,mBAAmB;gBACnB,sFAAsF,OAAO,KAAK,KAAK,kBAAkB,MAAM,uJAAuJ;gBACtR,kKAAkK;gBAClK,sMAAsM;gBACtM,yKAAyK;gBACzK,oBAAoB;aACpB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["import type { LoopGuardDetection } from \"./detectors.ts\";\n\nexport const LOOP_GUARD_NOTICE_CUSTOM_TYPE = \"loop-guard:notice\";\nexport const LOOP_GUARD_ESCALATION_CUSTOM_TYPE = \"loop-guard:escalation\";\nexport const LOOP_GUARD_RECOVERY_CUSTOM_TYPE = \"loop-guard:recovery\";\n\nexport type LoopGuardNoticeDetails = LoopGuardDetection;\n\nexport interface LoopGuardEscalationDetails {\n\treadonly toolName: string;\n\treadonly blockedCallCount: number;\n}\n\nexport function buildLoopGuardBlockReason(toolName: string, blockedCallCount: number): string {\n\treturn [\n\t\t`Loop guard blocked repeated call ${blockedCallCount} to \\`${toolName}\\` with arguments that already triggered two identical-call warnings.`,\n\t\t\"Reuse the existing result, change an argument deliberately, or choose a different tool.\",\n\t].join(\" \");\n}\n\nexport function buildLoopGuardHardStopWarning(toolName: string, blockedCallCount: number): string {\n\treturn `Loop guard interrupted the turn after blocking ${blockedCallCount} repeated calls to ${toolName}.`;\n}\n\nexport function buildLoopGuardHardStopSteer(toolName: string): string {\n\treturn [\n\t\t`The loop guard stopped the previous turn because you kept calling \\`${toolName}\\` with arguments that had already been blocked.`,\n\t\t\"Do not repeat that call. Re-plan from the current goal and use a different tool or deliberately changed arguments.\",\n\t].join(\" \");\n}\n\nexport function buildLoopGuardReminder(detection: LoopGuardDetection): string {\n\tswitch (detection.kind) {\n\t\tcase \"identical\": {\n\t\t\tconst { toolName, count } = detection;\n\t\t\treturn [\n\t\t\t\t`<system-reminder>`,\n\t\t\t\t`LOOP GUARD - IDENTICAL TOOL CALLS: you called \\`${toolName}\\` ${count} times in a row with the EXACT same arguments. This is the tool-call stream, not consecutive text - another tool ran between these calls and it changed nothing about your plan. Re-issuing the same call returns the same result. Snap out of it:`,\n\t\t\t\t`- reuse the result you already received from this exact call;`,\n\t\t\t\t`- if you were re-checking for new output or state, switch to the monitor/watch tool or change one parameter deliberately (filter, offset, query);`,\n\t\t\t\t`- if nothing is actually changing, stop calling this tool, state what is blocking you, and try a different tool or ask the user.`,\n\t\t\t\t`Do not call \\`${toolName}\\` again with identical arguments.`,\n\t\t\t\t`</system-reminder>`,\n\t\t\t].join(\"\\n\");\n\t\t}\n\t\tcase \"similar\": {\n\t\t\tconst { toolName, count, similarity } = detection;\n\t\t\tconst percent = Math.round(similarity * 100);\n\t\t\treturn [\n\t\t\t\t`<system-reminder>`,\n\t\t\t\t`LOOP GUARD - NEAR-IDENTICAL TOOL CALLS: your last ${count} calls to \\`${toolName}\\` had arguments about ${percent}% identical (bigram similarity over canonical args). This may be legitimate batch work - or it may be a lazy loop that only LOOKS like progress. Attention check:`,\n\t\t\t\t`- if these calls target genuinely different inputs (distinct files, queries, offsets), continue deliberately - but consider batching or widening the scope instead of one call per tiny variation;`,\n\t\t\t\t`- if you are scanning output incrementally (reads, peeks, polls), widen the window once or use the monitor/watch tool rather than nudging parameters;`,\n\t\t\t\t`- if the results keep saying the same thing, change strategy now - a different tool, a wider query, or asking the user beats a sixth near-copy.`,\n\t\t\t\t`</system-reminder>`,\n\t\t\t].join(\"\\n\");\n\t\t}\n\t\tcase \"cycle\": {\n\t\t\tconst { period, count, cycleTools } = detection;\n\t\t\tconst pattern = cycleTools.join(\" -> \");\n\t\t\treturn [\n\t\t\t\t`<system-reminder>`,\n\t\t\t\t`LOOP GUARD - REPEATING TOOL-CALL PATTERN: your recent tool calls repeat the cycle [${pattern}] ${count} times (period ${period}), with other calls possibly interleaved between repetitions. A fixed rotation usually means waiting, guessing, or searching without a discriminator:`,\n\t\t\t\t`- if this is a wait/poll rotation (spawn then peek, write then check), replace the rotation with the monitor/watch tool and react to the decisive event instead;`,\n\t\t\t\t`- if this is a search rotation, change ONE axis decisively: broader query, different tool, or a different source - repeating the same rotation at the same parameters will not find new information;`,\n\t\t\t\t`- if the cycle is genuinely progressing (each rotation moves distinct work forward), keep going - but say what each rotation accomplished so the next rotation can end.`,\n\t\t\t\t`</system-reminder>`,\n\t\t\t].join(\"\\n\");\n\t\t}\n\t}\n}\n"]}
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
export declare const TRACK_WINDOW = 64;
|
|
17
17
|
/** Consecutive byte-identical (tool + canonical args) calls before the firm reminder fires. */
|
|
18
18
|
export declare const IDENTICAL_RUN_THRESHOLD = 3;
|
|
19
|
+
/** Admitted identical-loop reminders ignored before the next same call is blocked. */
|
|
20
|
+
export declare const IDENTICAL_BLOCK_NOTICE_THRESHOLD = 2;
|
|
21
|
+
/** Loop-guard-owned blocked calls before the active turn is interrupted. */
|
|
22
|
+
export declare const IDENTICAL_HARD_STOP_BLOCK_THRESHOLD = 3;
|
|
19
23
|
/** Consecutive same-tool calls with near-identical args before the caution fires. */
|
|
20
24
|
export declare const SIMILAR_RUN_THRESHOLD = 5;
|
|
21
25
|
/** Mean adjacent bigram-Dice similarity over canonical args that counts as "near-identical". */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,iGAAiG;AACjG,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B,+FAA+F;AAC/F,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,gGAAgG;AAChG,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,sEAAsE;AACtE,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,8DAA8D;AAC9D,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,6GAA6G;AAC7G,eAAO,MAAM,iBAAiB,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,iGAAiG;AACjG,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B,+FAA+F;AAC/F,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,sFAAsF;AACtF,eAAO,MAAM,gCAAgC,IAAI,CAAC;AAElD,4EAA4E;AAC5E,eAAO,MAAM,mCAAmC,IAAI,CAAC;AAErD,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,gGAAgG;AAChG,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,sEAAsE;AACtE,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,8DAA8D;AAC9D,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,6GAA6G;AAC7G,eAAO,MAAM,iBAAiB,IAAI,CAAC"}
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
export const TRACK_WINDOW = 64;
|
|
17
17
|
/** Consecutive byte-identical (tool + canonical args) calls before the firm reminder fires. */
|
|
18
18
|
export const IDENTICAL_RUN_THRESHOLD = 3;
|
|
19
|
+
/** Admitted identical-loop reminders ignored before the next same call is blocked. */
|
|
20
|
+
export const IDENTICAL_BLOCK_NOTICE_THRESHOLD = 2;
|
|
21
|
+
/** Loop-guard-owned blocked calls before the active turn is interrupted. */
|
|
22
|
+
export const IDENTICAL_HARD_STOP_BLOCK_THRESHOLD = 3;
|
|
19
23
|
/** Consecutive same-tool calls with near-identical args before the caution fires. */
|
|
20
24
|
export const SIMILAR_RUN_THRESHOLD = 5;
|
|
21
25
|
/** Mean adjacent bigram-Dice similarity over canonical args that counts as "near-identical". */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,iGAAiG;AACjG,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAE/B,+FAA+F;AAC/F,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAEzC,qFAAqF;AACrF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC,gGAAgG;AAChG,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC,sEAAsE;AACtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAE5C,6GAA6G;AAC7G,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC","sourcesContent":["/**\n * Loop-guard thresholds.\n *\n * Evidence base (see changes.md for the full rationale):\n * - gemini-cli LoopDetectionService: sha256(name+args) signatures, cycle periods 1..5,\n * threshold 5 repetitions — but it HALTS the run. Loop-guard only steers a reminder,\n * so it can afford to fire earlier.\n * - OpenHands stuck detector: 4+ identical action-observation pairs, 3+ error cycles,\n * 6+ alternating ping-pong cycles — also halting behavior.\n * - Corpus of 400 real senpi sessions: productive same-tool runs (bash/eval/edit/todo)\n * show mean adjacent-args bigram-Dice ~0.52-0.55 (p90 <= 0.72), while repetitive\n * classes (read pagination, bash_output/task_output polling) sit at 0.84-0.93.\n * 0.85 cleanly separates distinct work from near-identical repetition.\n */\n\n/** Max tool-call records kept per prompt segment. Covers 6-period cycles at escalated counts. */\nexport const TRACK_WINDOW = 64;\n\n/** Consecutive byte-identical (tool + canonical args) calls before the firm reminder fires. */\nexport const IDENTICAL_RUN_THRESHOLD = 3;\n\n/** Consecutive same-tool calls with near-identical args before the caution fires. */\nexport const SIMILAR_RUN_THRESHOLD = 5;\n\n/** Mean adjacent bigram-Dice similarity over canonical args that counts as \"near-identical\". */\nexport const SIMILARITY_THRESHOLD = 0.85;\n\n/** Cycle period bounds (period 1 is the identical detector's job). */\nexport const CYCLE_MIN_PERIOD = 2;\nexport const CYCLE_MAX_PERIOD = 6;\n\n/** Full cycle repetitions before the pattern notice fires. */\nexport const CYCLE_REPETITION_THRESHOLD = 3;\n\n/** A pattern that keeps growing re-notifies only when its count reaches this multiple of the last notice. */\nexport const ESCALATION_FACTOR = 2;\n"]}
|
|
1
|
+
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,iGAAiG;AACjG,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC;AAE/B,+FAA+F;AAC/F,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAEzC,sFAAsF;AACtF,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC;AAElD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC;AAErD,qFAAqF;AACrF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC,gGAAgG;AAChG,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC,sEAAsE;AACtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAClC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAE5C,6GAA6G;AAC7G,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC","sourcesContent":["/**\n * Loop-guard thresholds.\n *\n * Evidence base (see changes.md for the full rationale):\n * - gemini-cli LoopDetectionService: sha256(name+args) signatures, cycle periods 1..5,\n * threshold 5 repetitions — but it HALTS the run. Loop-guard only steers a reminder,\n * so it can afford to fire earlier.\n * - OpenHands stuck detector: 4+ identical action-observation pairs, 3+ error cycles,\n * 6+ alternating ping-pong cycles — also halting behavior.\n * - Corpus of 400 real senpi sessions: productive same-tool runs (bash/eval/edit/todo)\n * show mean adjacent-args bigram-Dice ~0.52-0.55 (p90 <= 0.72), while repetitive\n * classes (read pagination, bash_output/task_output polling) sit at 0.84-0.93.\n * 0.85 cleanly separates distinct work from near-identical repetition.\n */\n\n/** Max tool-call records kept per prompt segment. Covers 6-period cycles at escalated counts. */\nexport const TRACK_WINDOW = 64;\n\n/** Consecutive byte-identical (tool + canonical args) calls before the firm reminder fires. */\nexport const IDENTICAL_RUN_THRESHOLD = 3;\n\n/** Admitted identical-loop reminders ignored before the next same call is blocked. */\nexport const IDENTICAL_BLOCK_NOTICE_THRESHOLD = 2;\n\n/** Loop-guard-owned blocked calls before the active turn is interrupted. */\nexport const IDENTICAL_HARD_STOP_BLOCK_THRESHOLD = 3;\n\n/** Consecutive same-tool calls with near-identical args before the caution fires. */\nexport const SIMILAR_RUN_THRESHOLD = 5;\n\n/** Mean adjacent bigram-Dice similarity over canonical args that counts as \"near-identical\". */\nexport const SIMILARITY_THRESHOLD = 0.85;\n\n/** Cycle period bounds (period 1 is the identical detector's job). */\nexport const CYCLE_MIN_PERIOD = 2;\nexport const CYCLE_MAX_PERIOD = 6;\n\n/** Full cycle repetitions before the pattern notice fires. */\nexport const CYCLE_REPETITION_THRESHOLD = 3;\n\n/** A pattern that keeps growing re-notifies only when its count reaches this multiple of the last notice. */\nexport const ESCALATION_FACTOR = 2;\n"]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { MessageRenderer } from "../../types.ts";
|
|
2
2
|
import type { LoopGuardDetection } from "./detectors.ts";
|
|
3
|
+
import type { LoopGuardEscalationDetails } from "./notice.ts";
|
|
3
4
|
export declare const renderLoopGuardNotice: MessageRenderer<LoopGuardDetection>;
|
|
5
|
+
export declare const renderLoopGuardEscalation: MessageRenderer<LoopGuardEscalationDetails>;
|
|
4
6
|
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/renderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/loop-guard/renderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAE9D,eAAO,MAAM,qBAAqB,EAAE,eAAe,CAAC,kBAAkB,CAIpE,CAAC;AAEH,eAAO,MAAM,yBAAyB,EAAE,eAAe,CAAC,0BAA0B,CAWjF,CAAC"}
|