@code-yeongyu/senpi 2026.8.16 → 2026.8.17
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 +51 -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 +17 -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 +196 -0
- package/dist/core/cursor-exec-bridge.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.d.ts +28 -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 +278 -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 +25 -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 +67 -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/oauth-login.d.ts +73 -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 +330 -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 +35 -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 +186 -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/monitor-continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.js +10 -9
- package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
- 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.js +2 -2
- 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 +50 -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 +14 -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 +14 -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 +14 -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/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/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/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
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { emptyCredential, listAccounts } from "./accounts.js";
|
|
2
|
+
import { selectAccount } from "./affinity.js";
|
|
3
|
+
import { CursorAgentNotInstalledError, defaultCursorAgentExecutableDeps, probeCursorAgentVersion, resolveCursorAgentExecutable, } from "./executable.js";
|
|
4
|
+
import { cursorCliSessionRouter } from "./session-router.js";
|
|
5
|
+
import { CURSOR_CLI_ABORT_GRACE_MS, spawnCursorCli, } from "./transport.js";
|
|
6
|
+
/** Minimum known-good cursor-agent version; below it senpi warns once per session but never blocks. */
|
|
7
|
+
export const CURSOR_CLI_MINIMUM_KNOWN_GOOD_VERSION = "2026.08.11";
|
|
8
|
+
/** This lane always authenticates through per-account sandboxed HOME file stores. */
|
|
9
|
+
export const CURSOR_CLI_STATUS_LANE = "file-store";
|
|
10
|
+
/** senpi never delegates compaction on this lane, so it is always the context owner. */
|
|
11
|
+
export const CURSOR_CLI_STATUS_CONTEXT_OWNER = "senpi";
|
|
12
|
+
/** The native Cursor provider id; the recommended default when both providers are configured. */
|
|
13
|
+
export const NATIVE_CURSOR_PROVIDER_ID = "cursor";
|
|
14
|
+
function asCursorCredential(value) {
|
|
15
|
+
return value !== undefined && value.type === "oauth" ? value : emptyCredential();
|
|
16
|
+
}
|
|
17
|
+
function isUsableOAuthCredential(value) {
|
|
18
|
+
return value !== undefined && value.type === "oauth" && typeof value.access === "string" && value.access.length > 0;
|
|
19
|
+
}
|
|
20
|
+
export function parseCursorCliVersion(version) {
|
|
21
|
+
const match = /^v?(\d{1,4})\.(\d{1,2})\.(\d{1,2})/.exec(version.trim());
|
|
22
|
+
if (!match)
|
|
23
|
+
return undefined;
|
|
24
|
+
return { year: Number(match[1]), month: Number(match[2]), day: Number(match[3]) };
|
|
25
|
+
}
|
|
26
|
+
/** Compares two `YYYY.MM.DD[-suffix]` version strings; undefined when either cannot be parsed. */
|
|
27
|
+
export function compareCursorCliVersions(version, floor) {
|
|
28
|
+
const parsed = parseCursorCliVersion(version);
|
|
29
|
+
const baseline = parseCursorCliVersion(floor);
|
|
30
|
+
if (parsed === undefined || baseline === undefined)
|
|
31
|
+
return undefined;
|
|
32
|
+
const left = [parsed.year, parsed.month, parsed.day];
|
|
33
|
+
const right = [baseline.year, baseline.month, baseline.day];
|
|
34
|
+
for (let index = 0; index < 3; index += 1) {
|
|
35
|
+
if (left[index] !== right[index])
|
|
36
|
+
return left[index] < right[index] ? -1 : 1;
|
|
37
|
+
}
|
|
38
|
+
return 0;
|
|
39
|
+
}
|
|
40
|
+
function blockWindowFor(account, now) {
|
|
41
|
+
if (account.blockReason === "auth_error") {
|
|
42
|
+
return { account: account.name, reason: "auth_error", blockedUntil: undefined };
|
|
43
|
+
}
|
|
44
|
+
if (account.blockedUntil !== undefined && account.blockedUntil > now) {
|
|
45
|
+
return { account: account.name, reason: "rate_limit", blockedUntil: account.blockedUntil };
|
|
46
|
+
}
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
const defaultResolveExecutable = (settings) => resolveCursorAgentExecutable({
|
|
50
|
+
...defaultCursorAgentExecutableDeps(),
|
|
51
|
+
settings: { executablePath: settings.executablePath },
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Collects the status snapshot. Account data is read fresh from the credential
|
|
55
|
+
* store on every call - never memoized - so the rendered state always matches
|
|
56
|
+
* the store even after concurrent logins, removals, or failover blocks. Only
|
|
57
|
+
* account names and metadata are extracted; tokens never enter the report.
|
|
58
|
+
*/
|
|
59
|
+
export async function collectCursorCliStatus(deps) {
|
|
60
|
+
const now = deps.now ?? Date.now;
|
|
61
|
+
const credential = asCursorCredential(await deps.readCredential());
|
|
62
|
+
const accounts = listAccounts(credential);
|
|
63
|
+
const pinnedAccount = deps.settings.pinnedAccount ?? credential.pinned;
|
|
64
|
+
const record = (deps.router ?? cursorCliSessionRouter).getRecord(deps.sessionId);
|
|
65
|
+
let selectedAccount = record?.accountName;
|
|
66
|
+
if (selectedAccount === undefined && accounts.length > 0) {
|
|
67
|
+
try {
|
|
68
|
+
selectedAccount = selectAccount(accounts, {
|
|
69
|
+
sessionId: deps.sessionId,
|
|
70
|
+
pinnedAccount,
|
|
71
|
+
now: now(),
|
|
72
|
+
}).name;
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
// Every account is blocked; report no selection instead of failing status.
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
let executablePath;
|
|
79
|
+
let executableProblem;
|
|
80
|
+
try {
|
|
81
|
+
executablePath = (deps.resolveExecutable ?? defaultResolveExecutable)(deps.settings);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
executableProblem = error instanceof Error ? error.message : String(error);
|
|
85
|
+
if (!(error instanceof CursorAgentNotInstalledError))
|
|
86
|
+
executablePath = undefined;
|
|
87
|
+
}
|
|
88
|
+
let executableVersion;
|
|
89
|
+
if (executablePath !== undefined) {
|
|
90
|
+
try {
|
|
91
|
+
executableVersion = await (deps.probeVersion ?? probeCursorAgentVersion)(executablePath);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
// Version unknown; the floor warning only applies to parseable versions.
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const comparison = executableVersion === undefined
|
|
98
|
+
? undefined
|
|
99
|
+
: compareCursorCliVersions(executableVersion, CURSOR_CLI_MINIMUM_KNOWN_GOOD_VERSION);
|
|
100
|
+
const nativeCredential = deps.readNativeCredential === undefined ? undefined : await deps.readNativeCredential();
|
|
101
|
+
return {
|
|
102
|
+
lane: CURSOR_CLI_STATUS_LANE,
|
|
103
|
+
selectedAccount,
|
|
104
|
+
pinnedAccount,
|
|
105
|
+
chatId: record?.chatId,
|
|
106
|
+
lastModel: record?.lastModel,
|
|
107
|
+
contextOwner: CURSOR_CLI_STATUS_CONTEXT_OWNER,
|
|
108
|
+
executablePath,
|
|
109
|
+
executableVersion,
|
|
110
|
+
minimumKnownGoodVersion: CURSOR_CLI_MINIMUM_KNOWN_GOOD_VERSION,
|
|
111
|
+
belowMinimumKnownGood: comparison !== undefined && comparison < 0,
|
|
112
|
+
executableProblem,
|
|
113
|
+
blockWindows: accounts
|
|
114
|
+
.map((account) => blockWindowFor(account, now()))
|
|
115
|
+
.filter((window) => window !== undefined),
|
|
116
|
+
accountNames: accounts.map((account) => account.name),
|
|
117
|
+
nativeCursorConfigured: isUsableOAuthCredential(nativeCredential),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/** Pure renderer: names and metadata only, never token material. */
|
|
121
|
+
export function renderCursorCliStatus(report) {
|
|
122
|
+
const lines = ["Cursor CLI (OAuth) status:"];
|
|
123
|
+
lines.push(` Auth lane: ${report.lane}`);
|
|
124
|
+
lines.push(` Context owner: ${report.contextOwner}`);
|
|
125
|
+
lines.push(` Selected account: ${report.selectedAccount === undefined
|
|
126
|
+
? "none"
|
|
127
|
+
: report.selectedAccount === report.pinnedAccount
|
|
128
|
+
? `${report.selectedAccount} (pinned)`
|
|
129
|
+
: report.selectedAccount}`);
|
|
130
|
+
lines.push(` Chat id: ${report.chatId ?? "none (no turns yet on this session)"}`);
|
|
131
|
+
lines.push(` Last model: ${report.lastModel ?? "none"}`);
|
|
132
|
+
if (report.executableProblem !== undefined) {
|
|
133
|
+
lines.push(` Executable: not installed - ${report.executableProblem}`);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
lines.push(` Executable: ${report.executablePath ?? "not installed"}`);
|
|
137
|
+
}
|
|
138
|
+
if (report.executableVersion !== undefined)
|
|
139
|
+
lines.push(` Version: ${report.executableVersion}`);
|
|
140
|
+
if (report.belowMinimumKnownGood) {
|
|
141
|
+
lines.push(` WARNING: cursor-agent ${report.executableVersion} is below the minimum known-good ${report.minimumKnownGoodVersion}; upgrade recommended`);
|
|
142
|
+
}
|
|
143
|
+
if (report.blockWindows.length === 0) {
|
|
144
|
+
lines.push(" Block windows: none");
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
lines.push(" Block windows:");
|
|
148
|
+
for (const window of report.blockWindows) {
|
|
149
|
+
lines.push(window.blockedUntil === undefined
|
|
150
|
+
? ` ${window.account}: ${window.reason}, until re-login`
|
|
151
|
+
: ` ${window.account}: ${window.reason}, expires ${new Date(window.blockedUntil).toISOString()}`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (report.nativeCursorConfigured) {
|
|
155
|
+
lines.push(` Recommended default: the native '${NATIVE_CURSOR_PROVIDER_ID}' provider is configured; use this Cursor CLI (OAuth) lane as the fallback when the native path misbehaves.`);
|
|
156
|
+
}
|
|
157
|
+
return lines.join("\n");
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* A reload retires this extension generation (`AgentSession.reload()` then
|
|
161
|
+
* invalidates the old runner) while timers and promise continuations captured
|
|
162
|
+
* by it are still armed; every `ExtensionContext` getter then throws
|
|
163
|
+
* "stale extension generation after reload". The context carries no liveness
|
|
164
|
+
* flag, so a retired generation is only observable by probing a getter.
|
|
165
|
+
*/
|
|
166
|
+
export function isCursorCliContextRetired(ctx) {
|
|
167
|
+
try {
|
|
168
|
+
ctx.isIdle();
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/** Per-registration generation fence; one per extension registration (a reload builds a new one). */
|
|
176
|
+
export class CursorCliGenerationGuard {
|
|
177
|
+
constructor() {
|
|
178
|
+
this.retired = false;
|
|
179
|
+
this.timers = new Set();
|
|
180
|
+
}
|
|
181
|
+
isRetired() {
|
|
182
|
+
return this.retired;
|
|
183
|
+
}
|
|
184
|
+
retire(reason) {
|
|
185
|
+
if (this.retired)
|
|
186
|
+
return;
|
|
187
|
+
this.retired = true;
|
|
188
|
+
this.retirementReason = `extension generation retired (${reason})`;
|
|
189
|
+
}
|
|
190
|
+
onDropped(reporter) {
|
|
191
|
+
this.droppedReporter = reporter;
|
|
192
|
+
}
|
|
193
|
+
/** Arms a timer the shutdown path cancels; arming after retirement is a no-op by construction. */
|
|
194
|
+
setTrackedTimeout(callback, delayMs) {
|
|
195
|
+
const timer = this.armTracked(callback, delayMs);
|
|
196
|
+
return () => {
|
|
197
|
+
if (timer !== undefined)
|
|
198
|
+
this.cancelTimer(timer);
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
/** Cancels every armed timer; returns how many were pending. */
|
|
202
|
+
clearTrackedTimers() {
|
|
203
|
+
const pending = this.timers.size;
|
|
204
|
+
for (const timer of this.timers)
|
|
205
|
+
clearTimeout(timer);
|
|
206
|
+
this.timers.clear();
|
|
207
|
+
return pending;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Runs a deferred continuation behind the generation fence. A dropped
|
|
211
|
+
* continuation is reported, never silently presented as completed.
|
|
212
|
+
*/
|
|
213
|
+
async runFenced(ctx, work) {
|
|
214
|
+
const blockedReason = this.retirementReasonFor(ctx);
|
|
215
|
+
if (blockedReason !== undefined) {
|
|
216
|
+
this.reportDropped("deferred continuation", blockedReason);
|
|
217
|
+
return { status: "dropped", reason: blockedReason };
|
|
218
|
+
}
|
|
219
|
+
return { status: "completed", value: await work(ctx) };
|
|
220
|
+
}
|
|
221
|
+
/** Synchronous variant for continuations that only touch the context once, after an outer await. */
|
|
222
|
+
runFencedSync(ctx, work) {
|
|
223
|
+
const blockedReason = this.retirementReasonFor(ctx);
|
|
224
|
+
if (blockedReason !== undefined) {
|
|
225
|
+
this.reportDropped("deferred continuation", blockedReason);
|
|
226
|
+
return { ran: false };
|
|
227
|
+
}
|
|
228
|
+
work();
|
|
229
|
+
return { ran: true };
|
|
230
|
+
}
|
|
231
|
+
defer(ctx, work, delayMs = 0) {
|
|
232
|
+
const fire = () => this.runFenced(ctx, work);
|
|
233
|
+
const timer = this.armTracked(() => {
|
|
234
|
+
// The timer path has no caller to receive a rejection (senpi #866 crash
|
|
235
|
+
// class), so a post-fence failure is reported instead of escaping to the
|
|
236
|
+
// timer queue.
|
|
237
|
+
void fire().catch((error) => {
|
|
238
|
+
this.reportDropped("deferred continuation", `failed after the retirement check: ${error instanceof Error ? error.message : String(error)}`);
|
|
239
|
+
});
|
|
240
|
+
}, delayMs);
|
|
241
|
+
return {
|
|
242
|
+
fire,
|
|
243
|
+
cancel: () => {
|
|
244
|
+
if (timer !== undefined)
|
|
245
|
+
this.cancelTimer(timer);
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
armTracked(callback, delayMs) {
|
|
250
|
+
if (this.retired)
|
|
251
|
+
return undefined;
|
|
252
|
+
const timer = setTimeout(() => {
|
|
253
|
+
this.timers.delete(timer);
|
|
254
|
+
callback();
|
|
255
|
+
}, delayMs);
|
|
256
|
+
this.timers.add(timer);
|
|
257
|
+
return timer;
|
|
258
|
+
}
|
|
259
|
+
cancelTimer(timer) {
|
|
260
|
+
clearTimeout(timer);
|
|
261
|
+
this.timers.delete(timer);
|
|
262
|
+
}
|
|
263
|
+
retirementReasonFor(ctx) {
|
|
264
|
+
if (this.retired)
|
|
265
|
+
return this.retirementReason ?? "extension generation retired";
|
|
266
|
+
if (isCursorCliContextRetired(ctx))
|
|
267
|
+
return "extension context retired by reload";
|
|
268
|
+
return undefined;
|
|
269
|
+
}
|
|
270
|
+
reportDropped(description, reason) {
|
|
271
|
+
this.droppedReporter?.(description, reason);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/** Process-group kill on the tracked pid, mirroring transport.ts's mechanism (never name matching). */
|
|
275
|
+
function killCursorCliProcessGroup(pid, signal) {
|
|
276
|
+
try {
|
|
277
|
+
if (process.platform === "win32")
|
|
278
|
+
process.kill(pid, signal);
|
|
279
|
+
else
|
|
280
|
+
process.kill(-pid, signal);
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
if (error.code !== "ESRCH")
|
|
284
|
+
throw error;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Registry of live children this extension spawned. Entries leave the registry
|
|
289
|
+
* when their transport run settles, so `killAll` only ever signals live
|
|
290
|
+
* process groups and is idempotent across repeated interruptions.
|
|
291
|
+
*/
|
|
292
|
+
export class CursorCliChildRegistry {
|
|
293
|
+
constructor() {
|
|
294
|
+
this.children = new Map();
|
|
295
|
+
}
|
|
296
|
+
track(handle) {
|
|
297
|
+
this.children.set(handle.pid, { pid: handle.pid, abort: () => handle.abort(), killed: false });
|
|
298
|
+
void handle.completed.then(() => this.children.delete(handle.pid), () => this.children.delete(handle.pid));
|
|
299
|
+
return handle;
|
|
300
|
+
}
|
|
301
|
+
livePids() {
|
|
302
|
+
return [...this.children.keys()];
|
|
303
|
+
}
|
|
304
|
+
/** SIGTERMs every tracked process group with a SIGKILL escalation; returns the pids it signalled. */
|
|
305
|
+
killAll(graceMs = CURSOR_CLI_ABORT_GRACE_MS) {
|
|
306
|
+
const signalled = [];
|
|
307
|
+
for (const entry of this.children.values()) {
|
|
308
|
+
if (entry.killed)
|
|
309
|
+
continue;
|
|
310
|
+
entry.killed = true;
|
|
311
|
+
signalled.push(entry.pid);
|
|
312
|
+
// Teardown must never throw into the shutdown event loop; individual
|
|
313
|
+
// failures are contained per child, and the SIGKILL escalation below
|
|
314
|
+
// still runs for that pid.
|
|
315
|
+
try {
|
|
316
|
+
entry.abort();
|
|
317
|
+
}
|
|
318
|
+
catch {
|
|
319
|
+
// Deliberate: shutdown stays idempotent even if one child misbehaves.
|
|
320
|
+
}
|
|
321
|
+
try {
|
|
322
|
+
killCursorCliProcessGroup(entry.pid, "SIGTERM");
|
|
323
|
+
}
|
|
324
|
+
catch {
|
|
325
|
+
// Deliberate: see above.
|
|
326
|
+
}
|
|
327
|
+
const escalation = setTimeout(() => killCursorCliProcessGroup(entry.pid, "SIGKILL"), graceMs);
|
|
328
|
+
escalation.unref?.();
|
|
329
|
+
}
|
|
330
|
+
return signalled;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/** Shared registry; child pids are process-wide resources, so one registry serves every generation. */
|
|
334
|
+
export const cursorCliChildRegistry = new CursorCliChildRegistry();
|
|
335
|
+
/** Spawns one cursor-agent run through the transport and registers it for shutdown teardown. */
|
|
336
|
+
export function spawnCursorCliTracked(input, registry = cursorCliChildRegistry) {
|
|
337
|
+
return registry.track(spawnCursorCli(input));
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Installs the `session_shutdown`/`session_extensions_removed` teardown: kill
|
|
341
|
+
* every tracked child's process group, cancel the generation's pending timers,
|
|
342
|
+
* and retire the generation so every deferred continuation is fenced. Safe to
|
|
343
|
+
* fire repeatedly; a retired generation is never resurrected (a reload builds a
|
|
344
|
+
* new registration with a fresh guard).
|
|
345
|
+
*/
|
|
346
|
+
export function registerCursorCliShutdownSafety(pi, deps = {}) {
|
|
347
|
+
const generation = deps.generation ?? new CursorCliGenerationGuard();
|
|
348
|
+
const registry = deps.registry ?? cursorCliChildRegistry;
|
|
349
|
+
const teardown = (reason) => {
|
|
350
|
+
registry.killAll();
|
|
351
|
+
generation.clearTrackedTimers();
|
|
352
|
+
generation.retire(reason);
|
|
353
|
+
};
|
|
354
|
+
pi.on("session_shutdown", (event) => {
|
|
355
|
+
teardown(event.reason);
|
|
356
|
+
});
|
|
357
|
+
pi.on("session_extensions_removed", (event) => {
|
|
358
|
+
teardown(event.reason);
|
|
359
|
+
});
|
|
360
|
+
return generation;
|
|
361
|
+
}
|
|
362
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../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AAE,CAAC,EAAE,CAAC,4BAA4B,EAAE,CAAC,KAAoC,EAAE,EAAE;QAC5E,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IACH,OAAO,UAAU,CAAC;AACnB,CAAC","sourcesContent":["import type { Credential } from \"@earendil-works/pi-ai\";\nimport type {\n\tExtensionAPI,\n\tExtensionContext,\n\tSessionExtensionsRemovedEvent,\n\tSessionShutdownEvent,\n} from \"../../types.ts\";\nimport { type CursorCliAccountSlot, type CursorCliOauthCredential, emptyCredential, listAccounts } from \"./accounts.ts\";\nimport { selectAccount } from \"./affinity.ts\";\nimport {\n\tCursorAgentNotInstalledError,\n\tdefaultCursorAgentExecutableDeps,\n\tprobeCursorAgentVersion,\n\tresolveCursorAgentExecutable,\n} from \"./executable.ts\";\nimport { type CursorCliSessionRouter, cursorCliSessionRouter } from \"./session-router.ts\";\nimport type { CursorCliOauthProviderSettings } from \"./settings.ts\";\nimport {\n\tCURSOR_CLI_ABORT_GRACE_MS,\n\ttype CursorCliTransportHandle,\n\ttype CursorCliTransportInput,\n\tspawnCursorCli,\n} from \"./transport.ts\";\n\n/** Minimum known-good cursor-agent version; below it senpi warns once per session but never blocks. */\nexport const CURSOR_CLI_MINIMUM_KNOWN_GOOD_VERSION = \"2026.08.11\";\n/** This lane always authenticates through per-account sandboxed HOME file stores. */\nexport const CURSOR_CLI_STATUS_LANE = \"file-store\";\n/** senpi never delegates compaction on this lane, so it is always the context owner. */\nexport const CURSOR_CLI_STATUS_CONTEXT_OWNER = \"senpi\";\n/** The native Cursor provider id; the recommended default when both providers are configured. */\nexport const NATIVE_CURSOR_PROVIDER_ID = \"cursor\";\n\n// ============================================================================\n// Status diagnostics\n// ============================================================================\n\nexport type CursorCliBlockWindow = {\n\treadonly account: string;\n\treadonly reason: \"rate_limit\" | \"auth_error\";\n\t/** Expiry timestamp; undefined means blocked until the account logs in again. */\n\treadonly blockedUntil: number | undefined;\n};\n\nexport type CursorCliStatusReport = {\n\treadonly lane: typeof CURSOR_CLI_STATUS_LANE;\n\treadonly selectedAccount: string | undefined;\n\treadonly pinnedAccount: string | undefined;\n\treadonly chatId: string | undefined;\n\treadonly lastModel: string | undefined;\n\treadonly contextOwner: typeof CURSOR_CLI_STATUS_CONTEXT_OWNER;\n\treadonly executablePath: string | undefined;\n\treadonly executableVersion: string | undefined;\n\treadonly minimumKnownGoodVersion: string;\n\treadonly belowMinimumKnownGood: boolean;\n\treadonly executableProblem: string | undefined;\n\treadonly blockWindows: readonly CursorCliBlockWindow[];\n\treadonly accountNames: readonly string[];\n\treadonly nativeCursorConfigured: boolean;\n};\n\nexport type CursorCliStatusDeps = {\n\treadonly sessionId: string;\n\treadonly settings: CursorCliOauthProviderSettings;\n\treadonly readCredential: () => Credential | undefined | Promise<Credential | undefined>;\n\treadonly readNativeCredential?: () => Credential | undefined | Promise<Credential | undefined>;\n\treadonly router?: CursorCliSessionRouter;\n\treadonly resolveExecutable?: (settings: CursorCliOauthProviderSettings) => string;\n\treadonly probeVersion?: (executable: string) => Promise<string>;\n\treadonly now?: () => number;\n};\n\nfunction asCursorCredential(value: Credential | undefined): CursorCliOauthCredential {\n\treturn value !== undefined && value.type === \"oauth\" ? (value as CursorCliOauthCredential) : emptyCredential();\n}\n\nfunction isUsableOAuthCredential(value: Credential | undefined): boolean {\n\treturn value !== undefined && value.type === \"oauth\" && typeof value.access === \"string\" && value.access.length > 0;\n}\n\nexport function parseCursorCliVersion(version: string): { year: number; month: number; day: number } | undefined {\n\tconst match = /^v?(\\d{1,4})\\.(\\d{1,2})\\.(\\d{1,2})/.exec(version.trim());\n\tif (!match) return undefined;\n\treturn { year: Number(match[1]), month: Number(match[2]), day: Number(match[3]) };\n}\n\n/** Compares two `YYYY.MM.DD[-suffix]` version strings; undefined when either cannot be parsed. */\nexport function compareCursorCliVersions(version: string, floor: string): number | undefined {\n\tconst parsed = parseCursorCliVersion(version);\n\tconst baseline = parseCursorCliVersion(floor);\n\tif (parsed === undefined || baseline === undefined) return undefined;\n\tconst left = [parsed.year, parsed.month, parsed.day] as const;\n\tconst right = [baseline.year, baseline.month, baseline.day] as const;\n\tfor (let index = 0; index < 3; index += 1) {\n\t\tif (left[index] !== right[index]) return left[index] < right[index] ? -1 : 1;\n\t}\n\treturn 0;\n}\n\nfunction blockWindowFor(account: CursorCliAccountSlot, now: number): CursorCliBlockWindow | undefined {\n\tif (account.blockReason === \"auth_error\") {\n\t\treturn { account: account.name, reason: \"auth_error\", blockedUntil: undefined };\n\t}\n\tif (account.blockedUntil !== undefined && account.blockedUntil > now) {\n\t\treturn { account: account.name, reason: \"rate_limit\", blockedUntil: account.blockedUntil };\n\t}\n\treturn undefined;\n}\n\nconst defaultResolveExecutable = (settings: CursorCliOauthProviderSettings): string =>\n\tresolveCursorAgentExecutable({\n\t\t...defaultCursorAgentExecutableDeps(),\n\t\tsettings: { executablePath: settings.executablePath },\n\t});\n\n/**\n * Collects the status snapshot. Account data is read fresh from the credential\n * store on every call - never memoized - so the rendered state always matches\n * the store even after concurrent logins, removals, or failover blocks. Only\n * account names and metadata are extracted; tokens never enter the report.\n */\nexport async function collectCursorCliStatus(deps: CursorCliStatusDeps): Promise<CursorCliStatusReport> {\n\tconst now = deps.now ?? Date.now;\n\tconst credential = asCursorCredential(await deps.readCredential());\n\tconst accounts = listAccounts(credential);\n\tconst pinnedAccount = deps.settings.pinnedAccount ?? credential.pinned;\n\tconst record = (deps.router ?? cursorCliSessionRouter).getRecord(deps.sessionId);\n\n\tlet selectedAccount = record?.accountName;\n\tif (selectedAccount === undefined && accounts.length > 0) {\n\t\ttry {\n\t\t\tselectedAccount = selectAccount(accounts, {\n\t\t\t\tsessionId: deps.sessionId,\n\t\t\t\tpinnedAccount,\n\t\t\t\tnow: now(),\n\t\t\t}).name;\n\t\t} catch {\n\t\t\t// Every account is blocked; report no selection instead of failing status.\n\t\t}\n\t}\n\n\tlet executablePath: string | undefined;\n\tlet executableProblem: string | undefined;\n\ttry {\n\t\texecutablePath = (deps.resolveExecutable ?? defaultResolveExecutable)(deps.settings);\n\t} catch (error) {\n\t\texecutableProblem = error instanceof Error ? error.message : String(error);\n\t\tif (!(error instanceof CursorAgentNotInstalledError)) executablePath = undefined;\n\t}\n\n\tlet executableVersion: string | undefined;\n\tif (executablePath !== undefined) {\n\t\ttry {\n\t\t\texecutableVersion = await (deps.probeVersion ?? probeCursorAgentVersion)(executablePath);\n\t\t} catch {\n\t\t\t// Version unknown; the floor warning only applies to parseable versions.\n\t\t}\n\t}\n\tconst comparison =\n\t\texecutableVersion === undefined\n\t\t\t? undefined\n\t\t\t: compareCursorCliVersions(executableVersion, CURSOR_CLI_MINIMUM_KNOWN_GOOD_VERSION);\n\n\tconst nativeCredential = deps.readNativeCredential === undefined ? undefined : await deps.readNativeCredential();\n\n\treturn {\n\t\tlane: CURSOR_CLI_STATUS_LANE,\n\t\tselectedAccount,\n\t\tpinnedAccount,\n\t\tchatId: record?.chatId,\n\t\tlastModel: record?.lastModel,\n\t\tcontextOwner: CURSOR_CLI_STATUS_CONTEXT_OWNER,\n\t\texecutablePath,\n\t\texecutableVersion,\n\t\tminimumKnownGoodVersion: CURSOR_CLI_MINIMUM_KNOWN_GOOD_VERSION,\n\t\tbelowMinimumKnownGood: comparison !== undefined && comparison < 0,\n\t\texecutableProblem,\n\t\tblockWindows: accounts\n\t\t\t.map((account) => blockWindowFor(account, now()))\n\t\t\t.filter((window): window is CursorCliBlockWindow => window !== undefined),\n\t\taccountNames: accounts.map((account) => account.name),\n\t\tnativeCursorConfigured: isUsableOAuthCredential(nativeCredential),\n\t};\n}\n\n/** Pure renderer: names and metadata only, never token material. */\nexport function renderCursorCliStatus(report: CursorCliStatusReport): string {\n\tconst lines: string[] = [\"Cursor CLI (OAuth) status:\"];\n\tlines.push(` Auth lane: ${report.lane}`);\n\tlines.push(` Context owner: ${report.contextOwner}`);\n\tlines.push(\n\t\t` Selected account: ${\n\t\t\treport.selectedAccount === undefined\n\t\t\t\t? \"none\"\n\t\t\t\t: report.selectedAccount === report.pinnedAccount\n\t\t\t\t\t? `${report.selectedAccount} (pinned)`\n\t\t\t\t\t: report.selectedAccount\n\t\t}`,\n\t);\n\tlines.push(` Chat id: ${report.chatId ?? \"none (no turns yet on this session)\"}`);\n\tlines.push(` Last model: ${report.lastModel ?? \"none\"}`);\n\tif (report.executableProblem !== undefined) {\n\t\tlines.push(` Executable: not installed - ${report.executableProblem}`);\n\t} else {\n\t\tlines.push(` Executable: ${report.executablePath ?? \"not installed\"}`);\n\t}\n\tif (report.executableVersion !== undefined) lines.push(` Version: ${report.executableVersion}`);\n\tif (report.belowMinimumKnownGood) {\n\t\tlines.push(\n\t\t\t` WARNING: cursor-agent ${report.executableVersion} is below the minimum known-good ${report.minimumKnownGoodVersion}; upgrade recommended`,\n\t\t);\n\t}\n\tif (report.blockWindows.length === 0) {\n\t\tlines.push(\" Block windows: none\");\n\t} else {\n\t\tlines.push(\" Block windows:\");\n\t\tfor (const window of report.blockWindows) {\n\t\t\tlines.push(\n\t\t\t\twindow.blockedUntil === undefined\n\t\t\t\t\t? ` ${window.account}: ${window.reason}, until re-login`\n\t\t\t\t\t: ` ${window.account}: ${window.reason}, expires ${new Date(window.blockedUntil).toISOString()}`,\n\t\t\t);\n\t\t}\n\t}\n\tif (report.nativeCursorConfigured) {\n\t\tlines.push(\n\t\t\t` Recommended default: the native '${NATIVE_CURSOR_PROVIDER_ID}' provider is configured; use this Cursor CLI (OAuth) lane as the fallback when the native path misbehaves.`,\n\t\t);\n\t}\n\treturn lines.join(\"\\n\");\n}\n\n// ============================================================================\n// Reload / shutdown safety (senpi #866 regression class)\n// ============================================================================\n\nexport type CursorCliFencedOutcome<T> =\n\t| { readonly status: \"completed\"; readonly value: T }\n\t| { readonly status: \"dropped\"; readonly reason: string };\n\nexport type CursorCliDeferredContinuation<T> = {\n\t/** Runs the continuation through the fence, even if its timer was cancelled or already fired. */\n\tfire(): Promise<CursorCliFencedOutcome<T>>;\n\tcancel(): void;\n};\n\nexport type CursorCliDroppedReporter = (description: string, reason: string) => void;\n\n/**\n * A reload retires this extension generation (`AgentSession.reload()` then\n * invalidates the old runner) while timers and promise continuations captured\n * by it are still armed; every `ExtensionContext` getter then throws\n * \"stale extension generation after reload\". The context carries no liveness\n * flag, so a retired generation is only observable by probing a getter.\n */\nexport function isCursorCliContextRetired(ctx: ExtensionContext): boolean {\n\ttry {\n\t\tctx.isIdle();\n\t\treturn false;\n\t} catch {\n\t\treturn true;\n\t}\n}\n\n/** Per-registration generation fence; one per extension registration (a reload builds a new one). */\nexport class CursorCliGenerationGuard {\n\tprivate retired = false;\n\tprivate retirementReason: string | undefined;\n\tprivate readonly timers = new Set<ReturnType<typeof setTimeout>>();\n\tprivate droppedReporter: CursorCliDroppedReporter | undefined;\n\n\tisRetired(): boolean {\n\t\treturn this.retired;\n\t}\n\n\tretire(reason: string): void {\n\t\tif (this.retired) return;\n\t\tthis.retired = true;\n\t\tthis.retirementReason = `extension generation retired (${reason})`;\n\t}\n\n\tonDropped(reporter: CursorCliDroppedReporter): void {\n\t\tthis.droppedReporter = reporter;\n\t}\n\n\t/** Arms a timer the shutdown path cancels; arming after retirement is a no-op by construction. */\n\tsetTrackedTimeout(callback: () => void, delayMs: number): () => void {\n\t\tconst timer = this.armTracked(callback, delayMs);\n\t\treturn () => {\n\t\t\tif (timer !== undefined) this.cancelTimer(timer);\n\t\t};\n\t}\n\n\t/** Cancels every armed timer; returns how many were pending. */\n\tclearTrackedTimers(): number {\n\t\tconst pending = this.timers.size;\n\t\tfor (const timer of this.timers) clearTimeout(timer);\n\t\tthis.timers.clear();\n\t\treturn pending;\n\t}\n\n\t/**\n\t * Runs a deferred continuation behind the generation fence. A dropped\n\t * continuation is reported, never silently presented as completed.\n\t */\n\tasync runFenced<T>(\n\t\tctx: ExtensionContext,\n\t\twork: (ctx: ExtensionContext) => Promise<T> | T,\n\t): Promise<CursorCliFencedOutcome<T>> {\n\t\tconst blockedReason = this.retirementReasonFor(ctx);\n\t\tif (blockedReason !== undefined) {\n\t\t\tthis.reportDropped(\"deferred continuation\", blockedReason);\n\t\t\treturn { status: \"dropped\", reason: blockedReason };\n\t\t}\n\t\treturn { status: \"completed\", value: await work(ctx) };\n\t}\n\n\t/** Synchronous variant for continuations that only touch the context once, after an outer await. */\n\trunFencedSync(ctx: ExtensionContext, work: () => void): { ran: boolean } {\n\t\tconst blockedReason = this.retirementReasonFor(ctx);\n\t\tif (blockedReason !== undefined) {\n\t\t\tthis.reportDropped(\"deferred continuation\", blockedReason);\n\t\t\treturn { ran: false };\n\t\t}\n\t\twork();\n\t\treturn { ran: true };\n\t}\n\n\tdefer<T>(\n\t\tctx: ExtensionContext,\n\t\twork: (ctx: ExtensionContext) => Promise<T> | T,\n\t\tdelayMs = 0,\n\t): CursorCliDeferredContinuation<T> {\n\t\tconst fire = (): Promise<CursorCliFencedOutcome<T>> => this.runFenced(ctx, work);\n\t\tconst timer = this.armTracked(() => {\n\t\t\t// The timer path has no caller to receive a rejection (senpi #866 crash\n\t\t\t// class), so a post-fence failure is reported instead of escaping to the\n\t\t\t// timer queue.\n\t\t\tvoid fire().catch((error: unknown) => {\n\t\t\t\tthis.reportDropped(\n\t\t\t\t\t\"deferred continuation\",\n\t\t\t\t\t`failed after the retirement check: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\t);\n\t\t\t});\n\t\t}, delayMs);\n\t\treturn {\n\t\t\tfire,\n\t\t\tcancel: () => {\n\t\t\t\tif (timer !== undefined) this.cancelTimer(timer);\n\t\t\t},\n\t\t};\n\t}\n\n\tprivate armTracked(callback: () => void, delayMs: number): ReturnType<typeof setTimeout> | undefined {\n\t\tif (this.retired) return undefined;\n\t\tconst timer = setTimeout(() => {\n\t\t\tthis.timers.delete(timer);\n\t\t\tcallback();\n\t\t}, delayMs);\n\t\tthis.timers.add(timer);\n\t\treturn timer;\n\t}\n\n\tprivate cancelTimer(timer: ReturnType<typeof setTimeout>): void {\n\t\tclearTimeout(timer);\n\t\tthis.timers.delete(timer);\n\t}\n\n\tprivate retirementReasonFor(ctx: ExtensionContext): string | undefined {\n\t\tif (this.retired) return this.retirementReason ?? \"extension generation retired\";\n\t\tif (isCursorCliContextRetired(ctx)) return \"extension context retired by reload\";\n\t\treturn undefined;\n\t}\n\n\tprivate reportDropped(description: string, reason: string): void {\n\t\tthis.droppedReporter?.(description, reason);\n\t}\n}\n\n/** Process-group kill on the tracked pid, mirroring transport.ts's mechanism (never name matching). */\nfunction killCursorCliProcessGroup(pid: number, signal: NodeJS.Signals): void {\n\ttry {\n\t\tif (process.platform === \"win32\") process.kill(pid, signal);\n\t\telse process.kill(-pid, signal);\n\t} catch (error) {\n\t\tif ((error as NodeJS.ErrnoException).code !== \"ESRCH\") throw error;\n\t}\n}\n\ntype TrackedCursorCliChild = {\n\treadonly pid: number;\n\treadonly abort: () => void;\n\tkilled: boolean;\n};\n\n/**\n * Registry of live children this extension spawned. Entries leave the registry\n * when their transport run settles, so `killAll` only ever signals live\n * process groups and is idempotent across repeated interruptions.\n */\nexport class CursorCliChildRegistry {\n\tprivate readonly children = new Map<number, TrackedCursorCliChild>();\n\n\ttrack(handle: CursorCliTransportHandle): CursorCliTransportHandle {\n\t\tthis.children.set(handle.pid, { pid: handle.pid, abort: () => handle.abort(), killed: false });\n\t\tvoid handle.completed.then(\n\t\t\t() => this.children.delete(handle.pid),\n\t\t\t() => this.children.delete(handle.pid),\n\t\t);\n\t\treturn handle;\n\t}\n\n\tlivePids(): number[] {\n\t\treturn [...this.children.keys()];\n\t}\n\n\t/** SIGTERMs every tracked process group with a SIGKILL escalation; returns the pids it signalled. */\n\tkillAll(graceMs: number = CURSOR_CLI_ABORT_GRACE_MS): number[] {\n\t\tconst signalled: number[] = [];\n\t\tfor (const entry of this.children.values()) {\n\t\t\tif (entry.killed) continue;\n\t\t\tentry.killed = true;\n\t\t\tsignalled.push(entry.pid);\n\t\t\t// Teardown must never throw into the shutdown event loop; individual\n\t\t\t// failures are contained per child, and the SIGKILL escalation below\n\t\t\t// still runs for that pid.\n\t\t\ttry {\n\t\t\t\tentry.abort();\n\t\t\t} catch {\n\t\t\t\t// Deliberate: shutdown stays idempotent even if one child misbehaves.\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tkillCursorCliProcessGroup(entry.pid, \"SIGTERM\");\n\t\t\t} catch {\n\t\t\t\t// Deliberate: see above.\n\t\t\t}\n\t\t\tconst escalation = setTimeout(() => killCursorCliProcessGroup(entry.pid, \"SIGKILL\"), graceMs);\n\t\t\tescalation.unref?.();\n\t\t}\n\t\treturn signalled;\n\t}\n}\n\n/** Shared registry; child pids are process-wide resources, so one registry serves every generation. */\nexport const cursorCliChildRegistry = new CursorCliChildRegistry();\n\n/** Spawns one cursor-agent run through the transport and registers it for shutdown teardown. */\nexport function spawnCursorCliTracked(\n\tinput: CursorCliTransportInput,\n\tregistry: CursorCliChildRegistry = cursorCliChildRegistry,\n): CursorCliTransportHandle {\n\treturn registry.track(spawnCursorCli(input));\n}\n\nexport type CursorCliShutdownSafetyDeps = {\n\treadonly generation?: CursorCliGenerationGuard;\n\treadonly registry?: CursorCliChildRegistry;\n};\n\n/**\n * Installs the `session_shutdown`/`session_extensions_removed` teardown: kill\n * every tracked child's process group, cancel the generation's pending timers,\n * and retire the generation so every deferred continuation is fenced. Safe to\n * fire repeatedly; a retired generation is never resurrected (a reload builds a\n * new registration with a fresh guard).\n */\nexport function registerCursorCliShutdownSafety(\n\tpi: Pick<ExtensionAPI, \"on\">,\n\tdeps: CursorCliShutdownSafetyDeps = {},\n): CursorCliGenerationGuard {\n\tconst generation = deps.generation ?? new CursorCliGenerationGuard();\n\tconst registry = deps.registry ?? cursorCliChildRegistry;\n\tconst teardown = (reason: string): void => {\n\t\tregistry.killAll();\n\t\tgeneration.clearTrackedTimers();\n\t\tgeneration.retire(reason);\n\t};\n\tpi.on(\"session_shutdown\", (event: SessionShutdownEvent) => {\n\t\tteardown(event.reason);\n\t});\n\tpi.on(\"session_extensions_removed\", (event: SessionExtensionsRemovedEvent) => {\n\t\tteardown(event.reason);\n\t});\n\treturn generation;\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type CursorCliErrorKind = "binary_missing" | "invalid_api_key" | "keychain_locked" | "invalid_model" | "rate_limit" | "auth_error" | "context_overflow" | "network" | "malformed_stream" | "other";
|
|
2
|
+
export type CursorCliErrorClassification = {
|
|
3
|
+
kind: CursorCliErrorKind;
|
|
4
|
+
retryable: boolean;
|
|
5
|
+
blockMs?: number;
|
|
6
|
+
};
|
|
7
|
+
export type CursorCliErrorInput = {
|
|
8
|
+
exitCode?: unknown;
|
|
9
|
+
stderr?: unknown;
|
|
10
|
+
resultEvent?: unknown;
|
|
11
|
+
thrown?: unknown;
|
|
12
|
+
};
|
|
13
|
+
export declare const DEFAULT_RATE_LIMIT_BLOCK_MS = 60000;
|
|
14
|
+
export declare const MAX_RATE_LIMIT_BLOCK_MS: number;
|
|
15
|
+
/** Add each probe-observed Cursor context failure as one exact line. */
|
|
16
|
+
export declare const CURSOR_CONTEXT_OVERFLOW_WORDINGS: readonly string[];
|
|
17
|
+
/** Classifies observed cursor-agent stderr, result events, and typed transport failures. */
|
|
18
|
+
export declare function classifyCursorCliError(input: CursorCliErrorInput | null | undefined): CursorCliErrorClassification;
|
|
19
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/cursor-cli-oauth/errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC3B,gBAAgB,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,eAAe,GACf,YAAY,GACZ,YAAY,GACZ,kBAAkB,GAClB,SAAS,GACT,kBAAkB,GAClB,OAAO,CAAC;AAEX,MAAM,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,kBAAkB,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAClD,eAAO,MAAM,uBAAuB,QAAuB,CAAC;AAE5D,wEAAwE;AACxE,eAAO,MAAM,gCAAgC,EAAE,SAAS,MAAM,EAAO,CAAC;AAuFtE,4FAA4F;AAC5F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,GAAG,4BAA4B,CA0ClH"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export const DEFAULT_RATE_LIMIT_BLOCK_MS = 60_000;
|
|
2
|
+
export const MAX_RATE_LIMIT_BLOCK_MS = 48 * 60 * 60 * 1_000;
|
|
3
|
+
/** Add each probe-observed Cursor context failure as one exact line. */
|
|
4
|
+
export const CURSOR_CONTEXT_OVERFLOW_WORDINGS = [];
|
|
5
|
+
const OTHER_ERROR = { kind: "other", retryable: false };
|
|
6
|
+
const MAX_TEXT_DEPTH = 5;
|
|
7
|
+
const MAX_TEXT_VALUES = 100;
|
|
8
|
+
function record(value) {
|
|
9
|
+
return value !== null && typeof value === "object" && !Array.isArray(value)
|
|
10
|
+
? value
|
|
11
|
+
: undefined;
|
|
12
|
+
}
|
|
13
|
+
function collectText(value, output, seen, depth) {
|
|
14
|
+
if (output.length >= MAX_TEXT_VALUES || depth > MAX_TEXT_DEPTH)
|
|
15
|
+
return;
|
|
16
|
+
if (typeof value === "string") {
|
|
17
|
+
output.push(value);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (value instanceof Error) {
|
|
21
|
+
output.push(value.message);
|
|
22
|
+
}
|
|
23
|
+
if (value === null || typeof value !== "object" || seen.has(value))
|
|
24
|
+
return;
|
|
25
|
+
seen.add(value);
|
|
26
|
+
for (const nested of Object.values(value)) {
|
|
27
|
+
collectText(nested, output, seen, depth + 1);
|
|
28
|
+
if (output.length >= MAX_TEXT_VALUES)
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function errorText(input) {
|
|
33
|
+
const parts = [];
|
|
34
|
+
const seen = new Set();
|
|
35
|
+
collectText(input.stderr, parts, seen, 0);
|
|
36
|
+
collectText(input.resultEvent, parts, seen, 0);
|
|
37
|
+
collectText(input.thrown, parts, seen, 0);
|
|
38
|
+
return parts.join("\n");
|
|
39
|
+
}
|
|
40
|
+
function errorLines(text) {
|
|
41
|
+
return text
|
|
42
|
+
.split(/\r?\n/)
|
|
43
|
+
.map((line) => line.trim())
|
|
44
|
+
.filter((line) => line.length > 0);
|
|
45
|
+
}
|
|
46
|
+
function hasExactLine(lines, wording) {
|
|
47
|
+
return lines.some((line) => line === wording);
|
|
48
|
+
}
|
|
49
|
+
function hasTypedKind(value, kind) {
|
|
50
|
+
return record(value)?.kind === kind;
|
|
51
|
+
}
|
|
52
|
+
function positiveNumber(value) {
|
|
53
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0)
|
|
54
|
+
return undefined;
|
|
55
|
+
return Math.ceil(value);
|
|
56
|
+
}
|
|
57
|
+
function findRetryAfterMs(value, seen, depth) {
|
|
58
|
+
if (depth > MAX_TEXT_DEPTH || value === null || typeof value !== "object" || seen.has(value))
|
|
59
|
+
return undefined;
|
|
60
|
+
seen.add(value);
|
|
61
|
+
const object = record(value);
|
|
62
|
+
if (object) {
|
|
63
|
+
const direct = positiveNumber(object.retryAfterMs) ?? positiveNumber(object.retry_after_ms);
|
|
64
|
+
if (direct !== undefined)
|
|
65
|
+
return direct;
|
|
66
|
+
}
|
|
67
|
+
for (const nested of Object.values(value)) {
|
|
68
|
+
const found = findRetryAfterMs(nested, seen, depth + 1);
|
|
69
|
+
if (found !== undefined)
|
|
70
|
+
return found;
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
function retryAfterMs(input, text) {
|
|
75
|
+
const structured = findRetryAfterMs(input.resultEvent, new Set(), 0) ?? findRetryAfterMs(input.thrown, new Set(), 0);
|
|
76
|
+
if (structured !== undefined)
|
|
77
|
+
return structured;
|
|
78
|
+
const milliseconds = text.match(/\bretry[-_ ]?after[-_ ]?ms\s*[:=]\s*(\d+(?:\.\d+)?)/i);
|
|
79
|
+
if (milliseconds)
|
|
80
|
+
return Math.ceil(Number(milliseconds[1]));
|
|
81
|
+
const seconds = text.match(/\bretry[-_ ]?after\s*[:=]\s*(\d+(?:\.\d+)?)/i);
|
|
82
|
+
return seconds ? Math.ceil(Number(seconds[1]) * 1_000) : undefined;
|
|
83
|
+
}
|
|
84
|
+
function rateLimitBlockMs(input, text) {
|
|
85
|
+
return Math.min(MAX_RATE_LIMIT_BLOCK_MS, retryAfterMs(input, text) ?? DEFAULT_RATE_LIMIT_BLOCK_MS);
|
|
86
|
+
}
|
|
87
|
+
/** Classifies observed cursor-agent stderr, result events, and typed transport failures. */
|
|
88
|
+
export function classifyCursorCliError(input) {
|
|
89
|
+
if (!input || typeof input !== "object")
|
|
90
|
+
return OTHER_ERROR;
|
|
91
|
+
if (hasTypedKind(input.thrown, "binary_missing"))
|
|
92
|
+
return { kind: "binary_missing", retryable: false };
|
|
93
|
+
if (hasTypedKind(input.thrown, "malformed_stream") || hasTypedKind(input.resultEvent, "malformed_stream")) {
|
|
94
|
+
return { kind: "malformed_stream", retryable: false };
|
|
95
|
+
}
|
|
96
|
+
const text = errorText(input);
|
|
97
|
+
const lines = errorLines(text);
|
|
98
|
+
if (hasExactLine(lines, "The provided API key is invalid.") &&
|
|
99
|
+
hasExactLine(lines, "The API key was loaded from the CURSOR_API_KEY environment variable.")) {
|
|
100
|
+
return { kind: "invalid_api_key", retryable: false };
|
|
101
|
+
}
|
|
102
|
+
if (hasExactLine(lines, "Error: Your macOS login keychain is locked.")) {
|
|
103
|
+
return { kind: "keychain_locked", retryable: false };
|
|
104
|
+
}
|
|
105
|
+
if (lines.some((line) => /^(?:Error:\s*)?Invalid model value:\s+\S.*$/.test(line))) {
|
|
106
|
+
return { kind: "invalid_model", retryable: false };
|
|
107
|
+
}
|
|
108
|
+
if (/\b(?:HTTP\s*)?429\b|\brate[ _-]?limit(?:ed|ing)?\b|\btoo many requests\b/i.test(text)) {
|
|
109
|
+
return { kind: "rate_limit", retryable: true, blockMs: rateLimitBlockMs(input, text) };
|
|
110
|
+
}
|
|
111
|
+
if (/\b(?:HTTP\s*)?401\b|\bunauthori[sz]ed\b|\bauthentication (?:failed|required)\b|\bnot logged in\b/i.test(text)) {
|
|
112
|
+
return { kind: "auth_error", retryable: false };
|
|
113
|
+
}
|
|
114
|
+
if (CURSOR_CONTEXT_OVERFLOW_WORDINGS.some((wording) => hasExactLine(lines, wording) || hasExactLine(lines, `Error: ${wording}`))) {
|
|
115
|
+
return { kind: "context_overflow", retryable: false };
|
|
116
|
+
}
|
|
117
|
+
if (/\b(?:ECONNRESET|ECONNREFUSED|ETIMEDOUT|ENETUNREACH|EHOSTUNREACH|ENOTFOUND|EAI_AGAIN)\b|\bnetwork error\b|\bconnection (?:reset|refused|lost)\b|\bsocket hang up\b|\bfetch failed\b/i.test(text)) {
|
|
118
|
+
return { kind: "network", retryable: true };
|
|
119
|
+
}
|
|
120
|
+
return OTHER_ERROR;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/cursor-cli-oauth/errors.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAClD,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;AAE5D,wEAAwE;AACxE,MAAM,CA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AAE,iBAAiB,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACtD,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,6CAA6C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACpF,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACpD,CAAC;IACD,IAAI,2EAA2E,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5F,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;IACxF,CAAC;IACD,IAAI,mGAAmG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACpH,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACjD,CAAC;IACD,IACC,gCAAgC,CAAC,IAAI,CACpC,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,YAAY,CAAC,KAAK,EAAE,UAAU,OAAO,EAAE,CAAC,CACrF,EACA,CAAC;QACF,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACvD,CAAC;IACD,IACC,qLAAqL,CAAC,IAAI,CACzL,IAAI,CACJ,EACA,CAAC;QACF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC7C,CAAC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC","sourcesContent":["export type CursorCliErrorKind =\n\t| \"binary_missing\"\n\t| \"invalid_api_key\"\n\t| \"keychain_locked\"\n\t| \"invalid_model\"\n\t| \"rate_limit\"\n\t| \"auth_error\"\n\t| \"context_overflow\"\n\t| \"network\"\n\t| \"malformed_stream\"\n\t| \"other\";\n\nexport type CursorCliErrorClassification = {\n\tkind: CursorCliErrorKind;\n\tretryable: boolean;\n\tblockMs?: number;\n};\n\nexport type CursorCliErrorInput = {\n\texitCode?: unknown;\n\tstderr?: unknown;\n\tresultEvent?: unknown;\n\tthrown?: unknown;\n};\n\nexport const DEFAULT_RATE_LIMIT_BLOCK_MS = 60_000;\nexport const MAX_RATE_LIMIT_BLOCK_MS = 48 * 60 * 60 * 1_000;\n\n/** Add each probe-observed Cursor context failure as one exact line. */\nexport const CURSOR_CONTEXT_OVERFLOW_WORDINGS: readonly string[] = [];\n\nconst OTHER_ERROR: CursorCliErrorClassification = { kind: \"other\", retryable: false };\nconst MAX_TEXT_DEPTH = 5;\nconst MAX_TEXT_VALUES = 100;\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n\treturn value !== null && typeof value === \"object\" && !Array.isArray(value)\n\t\t? (value as Record<string, unknown>)\n\t\t: undefined;\n}\n\nfunction collectText(value: unknown, output: string[], seen: Set<object>, depth: number): void {\n\tif (output.length >= MAX_TEXT_VALUES || depth > MAX_TEXT_DEPTH) return;\n\tif (typeof value === \"string\") {\n\t\toutput.push(value);\n\t\treturn;\n\t}\n\tif (value instanceof Error) {\n\t\toutput.push(value.message);\n\t}\n\tif (value === null || typeof value !== \"object\" || seen.has(value)) return;\n\tseen.add(value);\n\tfor (const nested of Object.values(value)) {\n\t\tcollectText(nested, output, seen, depth + 1);\n\t\tif (output.length >= MAX_TEXT_VALUES) return;\n\t}\n}\n\nfunction errorText(input: CursorCliErrorInput): string {\n\tconst parts: string[] = [];\n\tconst seen = new Set<object>();\n\tcollectText(input.stderr, parts, seen, 0);\n\tcollectText(input.resultEvent, parts, seen, 0);\n\tcollectText(input.thrown, parts, seen, 0);\n\treturn parts.join(\"\\n\");\n}\n\nfunction errorLines(text: string): string[] {\n\treturn text\n\t\t.split(/\\r?\\n/)\n\t\t.map((line) => line.trim())\n\t\t.filter((line) => line.length > 0);\n}\n\nfunction hasExactLine(lines: readonly string[], wording: string): boolean {\n\treturn lines.some((line) => line === wording);\n}\n\nfunction hasTypedKind(value: unknown, kind: CursorCliErrorKind): boolean {\n\treturn record(value)?.kind === kind;\n}\n\nfunction positiveNumber(value: unknown): number | undefined {\n\tif (typeof value !== \"number\" || !Number.isFinite(value) || value <= 0) return undefined;\n\treturn Math.ceil(value);\n}\n\nfunction findRetryAfterMs(value: unknown, seen: Set<object>, depth: number): number | undefined {\n\tif (depth > MAX_TEXT_DEPTH || value === null || typeof value !== \"object\" || seen.has(value)) return undefined;\n\tseen.add(value);\n\tconst object = record(value);\n\tif (object) {\n\t\tconst direct = positiveNumber(object.retryAfterMs) ?? positiveNumber(object.retry_after_ms);\n\t\tif (direct !== undefined) return direct;\n\t}\n\tfor (const nested of Object.values(value)) {\n\t\tconst found = findRetryAfterMs(nested, seen, depth + 1);\n\t\tif (found !== undefined) return found;\n\t}\n\treturn undefined;\n}\n\nfunction retryAfterMs(input: CursorCliErrorInput, text: string): number | undefined {\n\tconst structured =\n\t\tfindRetryAfterMs(input.resultEvent, new Set<object>(), 0) ?? findRetryAfterMs(input.thrown, new Set<object>(), 0);\n\tif (structured !== undefined) return structured;\n\tconst milliseconds = text.match(/\\bretry[-_ ]?after[-_ ]?ms\\s*[:=]\\s*(\\d+(?:\\.\\d+)?)/i);\n\tif (milliseconds) return Math.ceil(Number(milliseconds[1]));\n\tconst seconds = text.match(/\\bretry[-_ ]?after\\s*[:=]\\s*(\\d+(?:\\.\\d+)?)/i);\n\treturn seconds ? Math.ceil(Number(seconds[1]) * 1_000) : undefined;\n}\n\nfunction rateLimitBlockMs(input: CursorCliErrorInput, text: string): number {\n\treturn Math.min(MAX_RATE_LIMIT_BLOCK_MS, retryAfterMs(input, text) ?? DEFAULT_RATE_LIMIT_BLOCK_MS);\n}\n\n/** Classifies observed cursor-agent stderr, result events, and typed transport failures. */\nexport function classifyCursorCliError(input: CursorCliErrorInput | null | undefined): CursorCliErrorClassification {\n\tif (!input || typeof input !== \"object\") return OTHER_ERROR;\n\tif (hasTypedKind(input.thrown, \"binary_missing\")) return { kind: \"binary_missing\", retryable: false };\n\tif (hasTypedKind(input.thrown, \"malformed_stream\") || hasTypedKind(input.resultEvent, \"malformed_stream\")) {\n\t\treturn { kind: \"malformed_stream\", retryable: false };\n\t}\n\n\tconst text = errorText(input);\n\tconst lines = errorLines(text);\n\tif (\n\t\thasExactLine(lines, \"The provided API key is invalid.\") &&\n\t\thasExactLine(lines, \"The API key was loaded from the CURSOR_API_KEY environment variable.\")\n\t) {\n\t\treturn { kind: \"invalid_api_key\", retryable: false };\n\t}\n\tif (hasExactLine(lines, \"Error: Your macOS login keychain is locked.\")) {\n\t\treturn { kind: \"keychain_locked\", retryable: false };\n\t}\n\tif (lines.some((line) => /^(?:Error:\\s*)?Invalid model value:\\s+\\S.*$/.test(line))) {\n\t\treturn { kind: \"invalid_model\", retryable: false };\n\t}\n\tif (/\\b(?:HTTP\\s*)?429\\b|\\brate[ _-]?limit(?:ed|ing)?\\b|\\btoo many requests\\b/i.test(text)) {\n\t\treturn { kind: \"rate_limit\", retryable: true, blockMs: rateLimitBlockMs(input, text) };\n\t}\n\tif (/\\b(?:HTTP\\s*)?401\\b|\\bunauthori[sz]ed\\b|\\bauthentication (?:failed|required)\\b|\\bnot logged in\\b/i.test(text)) {\n\t\treturn { kind: \"auth_error\", retryable: false };\n\t}\n\tif (\n\t\tCURSOR_CONTEXT_OVERFLOW_WORDINGS.some(\n\t\t\t(wording) => hasExactLine(lines, wording) || hasExactLine(lines, `Error: ${wording}`),\n\t\t)\n\t) {\n\t\treturn { kind: \"context_overflow\", retryable: false };\n\t}\n\tif (\n\t\t/\\b(?:ECONNRESET|ECONNREFUSED|ETIMEDOUT|ENETUNREACH|EHOSTUNREACH|ENOTFOUND|EAI_AGAIN)\\b|\\bnetwork error\\b|\\bconnection (?:reset|refused|lost)\\b|\\bsocket hang up\\b|\\bfetch failed\\b/i.test(\n\t\t\ttext,\n\t\t)\n\t) {\n\t\treturn { kind: \"network\", retryable: true };\n\t}\n\treturn OTHER_ERROR;\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type CursorAgentDirectoryEntry = {
|
|
2
|
+
name: string;
|
|
3
|
+
isDirectory: boolean;
|
|
4
|
+
};
|
|
5
|
+
export type CursorAgentExecutableDeps = {
|
|
6
|
+
env: (name: string) => string | undefined;
|
|
7
|
+
settings: {
|
|
8
|
+
executablePath?: string;
|
|
9
|
+
};
|
|
10
|
+
homeDirectory: string;
|
|
11
|
+
pathDelimiter: string;
|
|
12
|
+
isExecutableFile: (candidate: string) => boolean;
|
|
13
|
+
readDirectory: (directory: string) => CursorAgentDirectoryEntry[];
|
|
14
|
+
};
|
|
15
|
+
export type VersionProbeOptions = {
|
|
16
|
+
encoding: "utf8";
|
|
17
|
+
timeout: number;
|
|
18
|
+
};
|
|
19
|
+
export type VersionProbeCallback = (error: Error | null, stdout: string, stderr: string) => void;
|
|
20
|
+
export type VersionProbeDeps = {
|
|
21
|
+
execFile: (file: string, args: string[], options: VersionProbeOptions, callback: VersionProbeCallback) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare class CursorAgentNotInstalledError extends Error {
|
|
24
|
+
readonly kind = "binary_missing";
|
|
25
|
+
constructor();
|
|
26
|
+
}
|
|
27
|
+
export declare function resolveCursorAgentExecutable(deps: CursorAgentExecutableDeps): string;
|
|
28
|
+
export declare function probeCursorAgentVersion(executable: string, deps?: VersionProbeDeps): Promise<string>;
|
|
29
|
+
export declare function defaultCursorAgentExecutableDeps(): CursorAgentExecutableDeps;
|
|
30
|
+
//# sourceMappingURL=executable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executable.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/cursor-cli-oauth/executable.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;CACr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