@code-yeongyu/senpi 2026.8.16 → 2026.8.18
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 +74 -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 +31 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js +298 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.d.ts +38 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.js +75 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.d.ts +24 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.js +64 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.d.ts +139 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.js +362 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/errors.d.ts +19 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/errors.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/errors.js +122 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/errors.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.d.ts +30 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.js +117 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/failover.d.ts +39 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/failover.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/failover.js +155 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/failover.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.d.ts +89 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.js +147 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.d.ts +20 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.js +99 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/home-store.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/index.d.ts +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 +69 -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 +77 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.js +361 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.d.ts +94 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.js +248 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.d.ts +37 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js +196 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.d.ts +11 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.js +17 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/spawn-args.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.d.ts +104 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.js +301 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream.d.ts +26 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream.js +587 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream.js.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/transport.d.ts +43 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/transport.d.ts.map +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/transport.js +196 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/transport.js.map +1 -0
- package/dist/core/extensions/builtin/goal/channel-state-subscriptions.d.ts +9 -0
- package/dist/core/extensions/builtin/goal/channel-state-subscriptions.d.ts.map +1 -0
- package/dist/core/extensions/builtin/goal/channel-state-subscriptions.js +18 -0
- package/dist/core/extensions/builtin/goal/channel-state-subscriptions.js.map +1 -0
- package/dist/core/extensions/builtin/goal/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.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +13 -7
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +32 -27
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/jsonl.d.ts +6 -1
- package/dist/modes/rpc/jsonl.d.ts.map +1 -1
- package/dist/modes/rpc/jsonl.js +47 -14
- package/dist/modes/rpc/jsonl.js.map +1 -1
- package/dist/modes/rpc/multi-session-host.d.ts.map +1 -1
- package/dist/modes/rpc/multi-session-host.js +26 -4
- package/dist/modes/rpc/multi-session-host.js.map +1 -1
- package/dist/modes/rpc/rpc-command-invocation.d.ts +5 -0
- package/dist/modes/rpc/rpc-command-invocation.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-command-invocation.js +2 -0
- package/dist/modes/rpc/rpc-command-invocation.js.map +1 -0
- package/dist/modes/rpc/rpc-command-surface.d.ts +49 -0
- package/dist/modes/rpc/rpc-command-surface.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-command-surface.js +40 -0
- package/dist/modes/rpc/rpc-command-surface.js.map +1 -0
- package/dist/modes/rpc/rpc-input-validation.d.ts +4 -0
- package/dist/modes/rpc/rpc-input-validation.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-input-validation.js +20 -0
- package/dist/modes/rpc/rpc-input-validation.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +12 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +12 -12
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/docs/providers.md +52 -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 +26 -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/baseten.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cerebras.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openai-codex.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/together.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/xai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/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,541 @@
|
|
|
1
|
+
// Copyright 2021-2026 Buf Technologies, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { ScalarType, } from "../descriptors.js";
|
|
15
|
+
import { checkField, checkListItem, checkMapEntry } from "./reflect-check.js";
|
|
16
|
+
import { FieldError } from "./error.js";
|
|
17
|
+
import { unsafeClear, unsafeGet, unsafeIsSet, unsafeLocal, unsafeOneofCase, unsafeSet, } from "./unsafe.js";
|
|
18
|
+
import { create } from "../create.js";
|
|
19
|
+
import { isWrapper, isWrapperDesc } from "../wkt/wrappers.js";
|
|
20
|
+
import { scalarZeroValue } from "./scalar.js";
|
|
21
|
+
import { protoInt64 } from "../proto-int64.js";
|
|
22
|
+
import { isObject, isReflectList, isReflectMap, isReflectMessage, } from "./guard.js";
|
|
23
|
+
// google.protobuf.NullValue.NULL_VALUE;
|
|
24
|
+
const NULL_VALUE = 0;
|
|
25
|
+
/**
|
|
26
|
+
* Create a ReflectMessage.
|
|
27
|
+
*/
|
|
28
|
+
export function reflect(messageDesc, message,
|
|
29
|
+
/**
|
|
30
|
+
* By default, field values are validated when setting them. For example,
|
|
31
|
+
* a value for an uint32 field must be a ECMAScript Number >= 0.
|
|
32
|
+
*
|
|
33
|
+
* When field values are trusted, performance can be improved by disabling
|
|
34
|
+
* checks.
|
|
35
|
+
*/
|
|
36
|
+
check = true) {
|
|
37
|
+
return new ReflectMessageImpl(messageDesc, message, check);
|
|
38
|
+
}
|
|
39
|
+
const messageSortedFields = new WeakMap();
|
|
40
|
+
class ReflectMessageImpl {
|
|
41
|
+
get sortedFields() {
|
|
42
|
+
const cached = messageSortedFields.get(this.desc);
|
|
43
|
+
if (cached) {
|
|
44
|
+
return cached;
|
|
45
|
+
}
|
|
46
|
+
const sortedFields = this.desc.fields
|
|
47
|
+
.concat()
|
|
48
|
+
.sort((a, b) => a.number - b.number);
|
|
49
|
+
messageSortedFields.set(this.desc, sortedFields);
|
|
50
|
+
return sortedFields;
|
|
51
|
+
}
|
|
52
|
+
constructor(messageDesc, message, check = true) {
|
|
53
|
+
this.lists = new Map();
|
|
54
|
+
this.maps = new Map();
|
|
55
|
+
this.check = check;
|
|
56
|
+
this.desc = messageDesc;
|
|
57
|
+
this.message = this[unsafeLocal] = message !== null && message !== void 0 ? message : create(messageDesc);
|
|
58
|
+
this.fields = messageDesc.fields;
|
|
59
|
+
this.oneofs = messageDesc.oneofs;
|
|
60
|
+
this.members = messageDesc.members;
|
|
61
|
+
}
|
|
62
|
+
findNumber(number) {
|
|
63
|
+
if (!this._fieldsByNumber) {
|
|
64
|
+
this._fieldsByNumber = new Map(this.desc.fields.map((f) => [f.number, f]));
|
|
65
|
+
}
|
|
66
|
+
return this._fieldsByNumber.get(number);
|
|
67
|
+
}
|
|
68
|
+
oneofCase(oneof) {
|
|
69
|
+
assertOwn(this.message, oneof);
|
|
70
|
+
return unsafeOneofCase(this.message, oneof);
|
|
71
|
+
}
|
|
72
|
+
isSet(field) {
|
|
73
|
+
assertOwn(this.message, field);
|
|
74
|
+
return unsafeIsSet(this.message, field);
|
|
75
|
+
}
|
|
76
|
+
clear(field) {
|
|
77
|
+
assertOwn(this.message, field);
|
|
78
|
+
unsafeClear(this.message, field);
|
|
79
|
+
}
|
|
80
|
+
get(field) {
|
|
81
|
+
assertOwn(this.message, field);
|
|
82
|
+
const value = unsafeGet(this.message, field);
|
|
83
|
+
switch (field.fieldKind) {
|
|
84
|
+
case "list":
|
|
85
|
+
// eslint-disable-next-line no-case-declarations
|
|
86
|
+
let list = this.lists.get(field);
|
|
87
|
+
if (!list || list[unsafeLocal] !== value) {
|
|
88
|
+
this.lists.set(field,
|
|
89
|
+
// biome-ignore lint/suspicious/noAssignInExpressions: no
|
|
90
|
+
(list = new ReflectListImpl(field, value, this.check)));
|
|
91
|
+
}
|
|
92
|
+
return list;
|
|
93
|
+
case "map":
|
|
94
|
+
let map = this.maps.get(field);
|
|
95
|
+
if (!map || map[unsafeLocal] !== value) {
|
|
96
|
+
this.maps.set(field,
|
|
97
|
+
// biome-ignore lint/suspicious/noAssignInExpressions: no
|
|
98
|
+
(map = new ReflectMapImpl(field, value, this.check)));
|
|
99
|
+
}
|
|
100
|
+
return map;
|
|
101
|
+
case "message":
|
|
102
|
+
return messageToReflect(field, value, this.check);
|
|
103
|
+
case "scalar":
|
|
104
|
+
return (value === undefined
|
|
105
|
+
? scalarZeroValue(field.scalar, false)
|
|
106
|
+
: longToReflect(field, value));
|
|
107
|
+
case "enum":
|
|
108
|
+
return (value !== null && value !== void 0 ? value : field.enum.values[0].number);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
set(field, value) {
|
|
112
|
+
assertOwn(this.message, field);
|
|
113
|
+
if (this.check) {
|
|
114
|
+
const err = checkField(field, value);
|
|
115
|
+
if (err) {
|
|
116
|
+
throw err;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
let local;
|
|
120
|
+
if (field.fieldKind == "message") {
|
|
121
|
+
local = messageToLocal(field, value);
|
|
122
|
+
}
|
|
123
|
+
else if (isReflectMap(value) || isReflectList(value)) {
|
|
124
|
+
local = value[unsafeLocal];
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
local = longToLocal(field, value);
|
|
128
|
+
}
|
|
129
|
+
unsafeSet(this.message, field, local);
|
|
130
|
+
}
|
|
131
|
+
getUnknown() {
|
|
132
|
+
return this.message.$unknown;
|
|
133
|
+
}
|
|
134
|
+
setUnknown(value) {
|
|
135
|
+
this.message.$unknown = value;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function assertOwn(owner, member) {
|
|
139
|
+
if (member.parent.typeName !== owner.$typeName) {
|
|
140
|
+
throw new FieldError(member, `cannot use ${member.toString()} with message ${owner.$typeName}`, "ForeignFieldError");
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Create a ReflectList.
|
|
145
|
+
*/
|
|
146
|
+
export function reflectList(field, unsafeInput,
|
|
147
|
+
/**
|
|
148
|
+
* By default, field values are validated when setting them. For example,
|
|
149
|
+
* a value for an uint32 field must be a ECMAScript Number >= 0.
|
|
150
|
+
*
|
|
151
|
+
* When field values are trusted, performance can be improved by disabling
|
|
152
|
+
* checks.
|
|
153
|
+
*/
|
|
154
|
+
check = true) {
|
|
155
|
+
return new ReflectListImpl(field, unsafeInput !== null && unsafeInput !== void 0 ? unsafeInput : [], check);
|
|
156
|
+
}
|
|
157
|
+
class ReflectListImpl {
|
|
158
|
+
field() {
|
|
159
|
+
return this._field;
|
|
160
|
+
}
|
|
161
|
+
get size() {
|
|
162
|
+
return this._arr.length;
|
|
163
|
+
}
|
|
164
|
+
constructor(field, unsafeInput, check) {
|
|
165
|
+
this._field = field;
|
|
166
|
+
this._arr = this[unsafeLocal] = unsafeInput;
|
|
167
|
+
this.check = check;
|
|
168
|
+
}
|
|
169
|
+
get(index) {
|
|
170
|
+
const item = this._arr[index];
|
|
171
|
+
return item === undefined
|
|
172
|
+
? undefined
|
|
173
|
+
: listItemToReflect(this._field, item, this.check);
|
|
174
|
+
}
|
|
175
|
+
set(index, item) {
|
|
176
|
+
if (index < 0 || index >= this._arr.length) {
|
|
177
|
+
throw new FieldError(this._field, `list item #${index + 1}: out of range`);
|
|
178
|
+
}
|
|
179
|
+
if (this.check) {
|
|
180
|
+
const err = checkListItem(this._field, index, item);
|
|
181
|
+
if (err) {
|
|
182
|
+
throw err;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
this._arr[index] = listItemToLocal(this._field, item);
|
|
186
|
+
}
|
|
187
|
+
add(item) {
|
|
188
|
+
if (this.check) {
|
|
189
|
+
const err = checkListItem(this._field, this._arr.length, item);
|
|
190
|
+
if (err) {
|
|
191
|
+
throw err;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
this._arr.push(listItemToLocal(this._field, item));
|
|
195
|
+
return undefined;
|
|
196
|
+
}
|
|
197
|
+
clear() {
|
|
198
|
+
this._arr.splice(0, this._arr.length);
|
|
199
|
+
}
|
|
200
|
+
[Symbol.iterator]() {
|
|
201
|
+
return this.values();
|
|
202
|
+
}
|
|
203
|
+
keys() {
|
|
204
|
+
return this._arr.keys();
|
|
205
|
+
}
|
|
206
|
+
*values() {
|
|
207
|
+
for (const item of this._arr) {
|
|
208
|
+
yield listItemToReflect(this._field, item, this.check);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
*entries() {
|
|
212
|
+
for (let i = 0; i < this._arr.length; i++) {
|
|
213
|
+
yield [i, listItemToReflect(this._field, this._arr[i], this.check)];
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Create a ReflectMap.
|
|
219
|
+
*/
|
|
220
|
+
export function reflectMap(field, unsafeInput,
|
|
221
|
+
/**
|
|
222
|
+
* By default, field values are validated when setting them. For example,
|
|
223
|
+
* a value for an uint32 field must be a ECMAScript Number >= 0.
|
|
224
|
+
*
|
|
225
|
+
* When field values are trusted, performance can be improved by disabling
|
|
226
|
+
* checks.
|
|
227
|
+
*/
|
|
228
|
+
check = true) {
|
|
229
|
+
return new ReflectMapImpl(field, unsafeInput, check);
|
|
230
|
+
}
|
|
231
|
+
class ReflectMapImpl {
|
|
232
|
+
constructor(field, unsafeInput, check = true) {
|
|
233
|
+
this.obj = this[unsafeLocal] = unsafeInput !== null && unsafeInput !== void 0 ? unsafeInput : {};
|
|
234
|
+
this.check = check;
|
|
235
|
+
this._field = field;
|
|
236
|
+
}
|
|
237
|
+
field() {
|
|
238
|
+
return this._field;
|
|
239
|
+
}
|
|
240
|
+
set(key, value) {
|
|
241
|
+
if (this.check) {
|
|
242
|
+
const err = checkMapEntry(this._field, key, value);
|
|
243
|
+
if (err) {
|
|
244
|
+
throw err;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
this.obj[mapKeyToLocal(key)] = mapValueToLocal(this._field, value);
|
|
248
|
+
return this;
|
|
249
|
+
}
|
|
250
|
+
delete(key) {
|
|
251
|
+
const k = mapKeyToLocal(key);
|
|
252
|
+
const has = Object.prototype.hasOwnProperty.call(this.obj, k);
|
|
253
|
+
if (has) {
|
|
254
|
+
delete this.obj[k];
|
|
255
|
+
}
|
|
256
|
+
return has;
|
|
257
|
+
}
|
|
258
|
+
clear() {
|
|
259
|
+
for (const key of Object.keys(this.obj)) {
|
|
260
|
+
delete this.obj[key];
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
get(key) {
|
|
264
|
+
let val = this.obj[mapKeyToLocal(key)];
|
|
265
|
+
if (val !== undefined) {
|
|
266
|
+
val = mapValueToReflect(this._field, val, this.check);
|
|
267
|
+
}
|
|
268
|
+
return val;
|
|
269
|
+
}
|
|
270
|
+
has(key) {
|
|
271
|
+
return Object.prototype.hasOwnProperty.call(this.obj, mapKeyToLocal(key));
|
|
272
|
+
}
|
|
273
|
+
*keys() {
|
|
274
|
+
for (const objKey of Object.keys(this.obj)) {
|
|
275
|
+
yield mapKeyToReflect(objKey, this._field.mapKey);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
*entries() {
|
|
279
|
+
for (const objEntry of Object.entries(this.obj)) {
|
|
280
|
+
yield [
|
|
281
|
+
mapKeyToReflect(objEntry[0], this._field.mapKey),
|
|
282
|
+
mapValueToReflect(this._field, objEntry[1], this.check),
|
|
283
|
+
];
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
[Symbol.iterator]() {
|
|
287
|
+
return this.entries();
|
|
288
|
+
}
|
|
289
|
+
get size() {
|
|
290
|
+
return Object.keys(this.obj).length;
|
|
291
|
+
}
|
|
292
|
+
*values() {
|
|
293
|
+
for (const val of Object.values(this.obj)) {
|
|
294
|
+
yield mapValueToReflect(this._field, val, this.check);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
forEach(callbackfn, thisArg) {
|
|
298
|
+
for (const mapEntry of this.entries()) {
|
|
299
|
+
callbackfn.call(thisArg, mapEntry[1], mapEntry[0], this);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
function messageToLocal(field, value) {
|
|
304
|
+
if (!isReflectMessage(value)) {
|
|
305
|
+
return value;
|
|
306
|
+
}
|
|
307
|
+
if (isWrapper(value.message) &&
|
|
308
|
+
!field.oneof &&
|
|
309
|
+
field.fieldKind == "message") {
|
|
310
|
+
// Types from google/protobuf/wrappers.proto are unwrapped when used in
|
|
311
|
+
// a singular field that is not part of a oneof group.
|
|
312
|
+
return value.message.value;
|
|
313
|
+
}
|
|
314
|
+
if (value.desc.typeName == "google.protobuf.Struct" &&
|
|
315
|
+
field.parent.typeName != "google.protobuf.Value") {
|
|
316
|
+
// google.protobuf.Struct is represented with JsonObject when used in a
|
|
317
|
+
// field, except when used in google.protobuf.Value.
|
|
318
|
+
return wktStructToLocal(value.message);
|
|
319
|
+
}
|
|
320
|
+
return value.message;
|
|
321
|
+
}
|
|
322
|
+
function messageToReflect(field, value, check) {
|
|
323
|
+
if (value !== undefined) {
|
|
324
|
+
if (isWrapperDesc(field.message) &&
|
|
325
|
+
!field.oneof &&
|
|
326
|
+
field.fieldKind == "message") {
|
|
327
|
+
// Types from google/protobuf/wrappers.proto are unwrapped when used in
|
|
328
|
+
// a singular field that is not part of a oneof group.
|
|
329
|
+
value = {
|
|
330
|
+
$typeName: field.message.typeName,
|
|
331
|
+
value: longToReflect(field.message.fields[0], value),
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
else if (field.message.typeName == "google.protobuf.Struct" &&
|
|
335
|
+
field.parent.typeName != "google.protobuf.Value" &&
|
|
336
|
+
isObject(value)) {
|
|
337
|
+
// google.protobuf.Struct is represented with JsonObject when used in a
|
|
338
|
+
// field, except when used in google.protobuf.Value.
|
|
339
|
+
value = wktStructToReflect(value);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return new ReflectMessageImpl(field.message, value, check);
|
|
343
|
+
}
|
|
344
|
+
function listItemToLocal(field, value) {
|
|
345
|
+
if (field.listKind == "message") {
|
|
346
|
+
return messageToLocal(field, value);
|
|
347
|
+
}
|
|
348
|
+
return longToLocal(field, value);
|
|
349
|
+
}
|
|
350
|
+
function listItemToReflect(field, value, check) {
|
|
351
|
+
if (field.listKind == "message") {
|
|
352
|
+
return messageToReflect(field, value, check);
|
|
353
|
+
}
|
|
354
|
+
return longToReflect(field, value);
|
|
355
|
+
}
|
|
356
|
+
function mapValueToLocal(field, value) {
|
|
357
|
+
if (field.mapKind == "message") {
|
|
358
|
+
return messageToLocal(field, value);
|
|
359
|
+
}
|
|
360
|
+
return longToLocal(field, value);
|
|
361
|
+
}
|
|
362
|
+
function mapValueToReflect(field, value, check) {
|
|
363
|
+
if (field.mapKind == "message") {
|
|
364
|
+
return messageToReflect(field, value, check);
|
|
365
|
+
}
|
|
366
|
+
return value;
|
|
367
|
+
}
|
|
368
|
+
function mapKeyToLocal(key) {
|
|
369
|
+
return typeof key == "string" || typeof key == "number" ? key : String(key);
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Converts a map key (any scalar value except float, double, or bytes) from its
|
|
373
|
+
* representation in a message (string or number, the only possible object key
|
|
374
|
+
* types) to the closest possible type in ECMAScript.
|
|
375
|
+
*/
|
|
376
|
+
function mapKeyToReflect(key, type) {
|
|
377
|
+
switch (type) {
|
|
378
|
+
case ScalarType.STRING:
|
|
379
|
+
return key;
|
|
380
|
+
case ScalarType.INT32:
|
|
381
|
+
case ScalarType.FIXED32:
|
|
382
|
+
case ScalarType.UINT32:
|
|
383
|
+
case ScalarType.SFIXED32:
|
|
384
|
+
case ScalarType.SINT32: {
|
|
385
|
+
const n = Number.parseInt(key);
|
|
386
|
+
if (Number.isFinite(n)) {
|
|
387
|
+
return n;
|
|
388
|
+
}
|
|
389
|
+
break;
|
|
390
|
+
}
|
|
391
|
+
case ScalarType.BOOL:
|
|
392
|
+
switch (key) {
|
|
393
|
+
case "true":
|
|
394
|
+
return true;
|
|
395
|
+
case "false":
|
|
396
|
+
return false;
|
|
397
|
+
}
|
|
398
|
+
break;
|
|
399
|
+
case ScalarType.UINT64:
|
|
400
|
+
case ScalarType.FIXED64:
|
|
401
|
+
try {
|
|
402
|
+
return protoInt64.uParse(key);
|
|
403
|
+
}
|
|
404
|
+
catch (_a) {
|
|
405
|
+
//
|
|
406
|
+
}
|
|
407
|
+
break;
|
|
408
|
+
default:
|
|
409
|
+
// INT64, SFIXED64, SINT64
|
|
410
|
+
try {
|
|
411
|
+
return protoInt64.parse(key);
|
|
412
|
+
}
|
|
413
|
+
catch (_b) {
|
|
414
|
+
//
|
|
415
|
+
}
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
return key;
|
|
419
|
+
}
|
|
420
|
+
function longToReflect(field, value) {
|
|
421
|
+
switch (field.scalar) {
|
|
422
|
+
case ScalarType.INT64:
|
|
423
|
+
case ScalarType.SFIXED64:
|
|
424
|
+
case ScalarType.SINT64:
|
|
425
|
+
if ("longAsString" in field &&
|
|
426
|
+
field.longAsString &&
|
|
427
|
+
typeof value == "string") {
|
|
428
|
+
value = protoInt64.parse(value);
|
|
429
|
+
}
|
|
430
|
+
break;
|
|
431
|
+
case ScalarType.FIXED64:
|
|
432
|
+
case ScalarType.UINT64:
|
|
433
|
+
if ("longAsString" in field &&
|
|
434
|
+
field.longAsString &&
|
|
435
|
+
typeof value == "string") {
|
|
436
|
+
value = protoInt64.uParse(value);
|
|
437
|
+
}
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
return value;
|
|
441
|
+
}
|
|
442
|
+
function longToLocal(field, value) {
|
|
443
|
+
switch (field.scalar) {
|
|
444
|
+
case ScalarType.INT64:
|
|
445
|
+
case ScalarType.SFIXED64:
|
|
446
|
+
case ScalarType.SINT64:
|
|
447
|
+
if ("longAsString" in field && field.longAsString) {
|
|
448
|
+
value = String(value);
|
|
449
|
+
}
|
|
450
|
+
else if (typeof value == "string" || typeof value == "number") {
|
|
451
|
+
value = protoInt64.parse(value);
|
|
452
|
+
}
|
|
453
|
+
break;
|
|
454
|
+
case ScalarType.FIXED64:
|
|
455
|
+
case ScalarType.UINT64:
|
|
456
|
+
if ("longAsString" in field && field.longAsString) {
|
|
457
|
+
value = String(value);
|
|
458
|
+
}
|
|
459
|
+
else if (typeof value == "string" || typeof value == "number") {
|
|
460
|
+
value = protoInt64.uParse(value);
|
|
461
|
+
}
|
|
462
|
+
break;
|
|
463
|
+
}
|
|
464
|
+
return value;
|
|
465
|
+
}
|
|
466
|
+
function wktStructToReflect(json) {
|
|
467
|
+
const struct = {
|
|
468
|
+
$typeName: "google.protobuf.Struct",
|
|
469
|
+
fields: {},
|
|
470
|
+
};
|
|
471
|
+
if (isObject(json)) {
|
|
472
|
+
for (const [k, v] of Object.entries(json)) {
|
|
473
|
+
struct.fields[k] = wktValueToReflect(v);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return struct;
|
|
477
|
+
}
|
|
478
|
+
function wktStructToLocal(val) {
|
|
479
|
+
const json = {};
|
|
480
|
+
for (const [k, v] of Object.entries(val.fields)) {
|
|
481
|
+
json[k] = wktValueToLocal(v);
|
|
482
|
+
}
|
|
483
|
+
return json;
|
|
484
|
+
}
|
|
485
|
+
function wktValueToLocal(val) {
|
|
486
|
+
switch (val.kind.case) {
|
|
487
|
+
case "structValue":
|
|
488
|
+
return wktStructToLocal(val.kind.value);
|
|
489
|
+
case "listValue":
|
|
490
|
+
return val.kind.value.values.map(wktValueToLocal);
|
|
491
|
+
case "nullValue":
|
|
492
|
+
case undefined:
|
|
493
|
+
return null;
|
|
494
|
+
default:
|
|
495
|
+
return val.kind.value;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
function wktValueToReflect(json) {
|
|
499
|
+
const value = {
|
|
500
|
+
$typeName: "google.protobuf.Value",
|
|
501
|
+
kind: { case: undefined },
|
|
502
|
+
};
|
|
503
|
+
switch (typeof json) {
|
|
504
|
+
case "number":
|
|
505
|
+
value.kind = { case: "numberValue", value: json };
|
|
506
|
+
break;
|
|
507
|
+
case "string":
|
|
508
|
+
value.kind = { case: "stringValue", value: json };
|
|
509
|
+
break;
|
|
510
|
+
case "boolean":
|
|
511
|
+
value.kind = { case: "boolValue", value: json };
|
|
512
|
+
break;
|
|
513
|
+
case "object":
|
|
514
|
+
if (json === null) {
|
|
515
|
+
value.kind = { case: "nullValue", value: NULL_VALUE };
|
|
516
|
+
}
|
|
517
|
+
else if (Array.isArray(json)) {
|
|
518
|
+
const listValue = {
|
|
519
|
+
$typeName: "google.protobuf.ListValue",
|
|
520
|
+
values: [],
|
|
521
|
+
};
|
|
522
|
+
if (Array.isArray(json)) {
|
|
523
|
+
for (const e of json) {
|
|
524
|
+
listValue.values.push(wktValueToReflect(e));
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
value.kind = {
|
|
528
|
+
case: "listValue",
|
|
529
|
+
value: listValue,
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
value.kind = {
|
|
534
|
+
case: "structValue",
|
|
535
|
+
value: wktStructToReflect(json),
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
return value;
|
|
541
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ScalarType } from "../descriptors.js";
|
|
2
|
+
/**
|
|
3
|
+
* ScalarValue maps from a scalar field type to a TypeScript value type.
|
|
4
|
+
*/
|
|
5
|
+
export type ScalarValue<T = ScalarType, LongAsString extends boolean = false> = T extends ScalarType.STRING ? string : T extends ScalarType.INT32 ? number : T extends ScalarType.UINT32 ? number : T extends ScalarType.SINT32 ? number : T extends ScalarType.FIXED32 ? number : T extends ScalarType.SFIXED32 ? number : T extends ScalarType.FLOAT ? number : T extends ScalarType.DOUBLE ? number : T extends ScalarType.INT64 ? LongAsString extends true ? string : bigint : T extends ScalarType.SINT64 ? LongAsString extends true ? string : bigint : T extends ScalarType.SFIXED64 ? LongAsString extends true ? string : bigint : T extends ScalarType.UINT64 ? LongAsString extends true ? string : bigint : T extends ScalarType.FIXED64 ? LongAsString extends true ? string : bigint : T extends ScalarType.BOOL ? boolean : T extends ScalarType.BYTES ? Uint8Array : never;
|
|
6
|
+
/**
|
|
7
|
+
* Returns true if both scalar values are equal.
|
|
8
|
+
*
|
|
9
|
+
* For float and double, values are compared following IEEE semantics: -0
|
|
10
|
+
* equals 0, and NaN does not equal NaN. This is value equality, not identity.
|
|
11
|
+
*
|
|
12
|
+
* It deliberately differs from isScalarZeroValue, which treats -0 as distinct
|
|
13
|
+
* from 0. A value can equal the zero value without being a zero value
|
|
14
|
+
* (scalarEquals(DOUBLE, -0, 0) is true while isScalarZeroValue(DOUBLE, -0) is
|
|
15
|
+
* false) so this function must not be used to derive implicit presence.
|
|
16
|
+
*/
|
|
17
|
+
export declare function scalarEquals(type: ScalarType, a: ScalarValue | undefined, b: ScalarValue | undefined): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the zero value for the given scalar type, the value a field of this
|
|
20
|
+
* type has when unset: 0 for numeric types, "" for strings, false for
|
|
21
|
+
* booleans, and an empty Uint8Array for bytes. For 64-bit integer types, the
|
|
22
|
+
* result is "0" when longAsString is true, otherwise 0n.
|
|
23
|
+
*
|
|
24
|
+
* This is the type's zero value, not a proto2 custom field default. For float
|
|
25
|
+
* and double it is +0; isScalarZeroValue treats only +0, not -0, as this value.
|
|
26
|
+
*/
|
|
27
|
+
export declare function scalarZeroValue<T extends ScalarType, LongAsString extends boolean>(type: T, longAsString: LongAsString): ScalarValue<T, LongAsString>;
|
|
28
|
+
/**
|
|
29
|
+
* Returns true if the value is the zero value for the given scalar type: `0`
|
|
30
|
+
* for numeric types, `false` for booleans, `""` for strings, and an empty
|
|
31
|
+
* Uint8Array for bytes.
|
|
32
|
+
*
|
|
33
|
+
* This is the implicit-presence default check. A singular field with implicit
|
|
34
|
+
* presence is treated as unset, and omitted from the wire, when its value is
|
|
35
|
+
* the zero value. With explicit presence, or in repeated and map fields,
|
|
36
|
+
* presence is structural and this function does not apply.
|
|
37
|
+
*
|
|
38
|
+
* Note that -0 is NOT a zero value for float and double: under implicit
|
|
39
|
+
* presence, +0 is omitted from the wire but -0 is written, following the
|
|
40
|
+
* proto3 specification. As a result this can disagree with scalarEquals, which
|
|
41
|
+
* compares by value and treats -0 as equal to 0.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isScalarZeroValue(type: ScalarType, value: unknown): boolean;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Copyright 2021-2026 Buf Technologies, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { protoInt64 } from "../proto-int64.js";
|
|
15
|
+
import { ScalarType } from "../descriptors.js";
|
|
16
|
+
/**
|
|
17
|
+
* Returns true if both scalar values are equal.
|
|
18
|
+
*
|
|
19
|
+
* For float and double, values are compared following IEEE semantics: -0
|
|
20
|
+
* equals 0, and NaN does not equal NaN. This is value equality, not identity.
|
|
21
|
+
*
|
|
22
|
+
* It deliberately differs from isScalarZeroValue, which treats -0 as distinct
|
|
23
|
+
* from 0. A value can equal the zero value without being a zero value
|
|
24
|
+
* (scalarEquals(DOUBLE, -0, 0) is true while isScalarZeroValue(DOUBLE, -0) is
|
|
25
|
+
* false) so this function must not be used to derive implicit presence.
|
|
26
|
+
*/
|
|
27
|
+
export function scalarEquals(type, a, b) {
|
|
28
|
+
if (a === b) {
|
|
29
|
+
// This correctly matches equal values except BYTES and (possibly) 64-bit integers.
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
// Special case BYTES - we need to compare each byte individually
|
|
33
|
+
if (type == ScalarType.BYTES) {
|
|
34
|
+
if (!(a instanceof Uint8Array) || !(b instanceof Uint8Array)) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
if (a.length !== b.length) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
for (let i = 0; i < a.length; i++) {
|
|
41
|
+
if (a[i] !== b[i]) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
// Special case 64-bit integers - we support number, string and bigint representation.
|
|
48
|
+
switch (type) {
|
|
49
|
+
case ScalarType.UINT64:
|
|
50
|
+
case ScalarType.FIXED64:
|
|
51
|
+
case ScalarType.INT64:
|
|
52
|
+
case ScalarType.SFIXED64:
|
|
53
|
+
case ScalarType.SINT64:
|
|
54
|
+
// Loose comparison will match between 0n, 0 and "0".
|
|
55
|
+
return a == b;
|
|
56
|
+
}
|
|
57
|
+
// Anything that hasn't been caught by strict comparison or special cased
|
|
58
|
+
// BYTES and 64-bit integers is not equal.
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Returns the zero value for the given scalar type, the value a field of this
|
|
63
|
+
* type has when unset: 0 for numeric types, "" for strings, false for
|
|
64
|
+
* booleans, and an empty Uint8Array for bytes. For 64-bit integer types, the
|
|
65
|
+
* result is "0" when longAsString is true, otherwise 0n.
|
|
66
|
+
*
|
|
67
|
+
* This is the type's zero value, not a proto2 custom field default. For float
|
|
68
|
+
* and double it is +0; isScalarZeroValue treats only +0, not -0, as this value.
|
|
69
|
+
*/
|
|
70
|
+
export function scalarZeroValue(type, longAsString) {
|
|
71
|
+
switch (type) {
|
|
72
|
+
case ScalarType.STRING:
|
|
73
|
+
return "";
|
|
74
|
+
case ScalarType.BOOL:
|
|
75
|
+
return false;
|
|
76
|
+
case ScalarType.DOUBLE:
|
|
77
|
+
case ScalarType.FLOAT:
|
|
78
|
+
return 0.0;
|
|
79
|
+
case ScalarType.INT64:
|
|
80
|
+
case ScalarType.UINT64:
|
|
81
|
+
case ScalarType.SFIXED64:
|
|
82
|
+
case ScalarType.FIXED64:
|
|
83
|
+
case ScalarType.SINT64:
|
|
84
|
+
return (longAsString ? "0" : protoInt64.zero);
|
|
85
|
+
case ScalarType.BYTES:
|
|
86
|
+
return new Uint8Array(0);
|
|
87
|
+
default:
|
|
88
|
+
// Handles INT32, UINT32, SINT32, FIXED32, SFIXED32.
|
|
89
|
+
// We do not use individual cases to save a few bytes code size.
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Returns true if the value is the zero value for the given scalar type: `0`
|
|
95
|
+
* for numeric types, `false` for booleans, `""` for strings, and an empty
|
|
96
|
+
* Uint8Array for bytes.
|
|
97
|
+
*
|
|
98
|
+
* This is the implicit-presence default check. A singular field with implicit
|
|
99
|
+
* presence is treated as unset, and omitted from the wire, when its value is
|
|
100
|
+
* the zero value. With explicit presence, or in repeated and map fields,
|
|
101
|
+
* presence is structural and this function does not apply.
|
|
102
|
+
*
|
|
103
|
+
* Note that -0 is NOT a zero value for float and double: under implicit
|
|
104
|
+
* presence, +0 is omitted from the wire but -0 is written, following the
|
|
105
|
+
* proto3 specification. As a result this can disagree with scalarEquals, which
|
|
106
|
+
* compares by value and treats -0 as equal to 0.
|
|
107
|
+
*/
|
|
108
|
+
export function isScalarZeroValue(type, value) {
|
|
109
|
+
switch (type) {
|
|
110
|
+
case ScalarType.BOOL:
|
|
111
|
+
return value === false;
|
|
112
|
+
case ScalarType.STRING:
|
|
113
|
+
return value === "";
|
|
114
|
+
case ScalarType.BYTES:
|
|
115
|
+
return value instanceof Uint8Array && !value.byteLength;
|
|
116
|
+
case ScalarType.DOUBLE:
|
|
117
|
+
case ScalarType.FLOAT:
|
|
118
|
+
// Object.is distinguishes -0 from 0.
|
|
119
|
+
return Object.is(value, 0);
|
|
120
|
+
default:
|
|
121
|
+
// Loose comparison matches 0n, 0 and "0".
|
|
122
|
+
return value == 0;
|
|
123
|
+
}
|
|
124
|
+
}
|