@agent-watch-ai/edge 0.2.5
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 +251 -0
- package/LICENSE +21 -0
- package/README.md +168 -0
- package/dist/billing/billing-mode.d.ts +16 -0
- package/dist/billing/billing-mode.js +139 -0
- package/dist/billing/constants/billing.constants.d.ts +37 -0
- package/dist/billing/constants/billing.constants.js +38 -0
- package/dist/billing/index.d.ts +6 -0
- package/dist/billing/index.js +6 -0
- package/dist/cli/args.d.ts +29 -0
- package/dist/cli/args.js +61 -0
- package/dist/cli/constants/cli.constants.d.ts +60 -0
- package/dist/cli/constants/cli.constants.js +60 -0
- package/dist/cli/context.d.ts +51 -0
- package/dist/cli/context.js +108 -0
- package/dist/cli/doctor.d.ts +15 -0
- package/dist/cli/doctor.js +416 -0
- package/dist/cli/hook.d.ts +20 -0
- package/dist/cli/hook.js +166 -0
- package/dist/cli/index.d.ts +13 -0
- package/dist/cli/index.js +8 -0
- package/dist/cli/misc.d.ts +31 -0
- package/dist/cli/misc.js +63 -0
- package/dist/cli/setup.d.ts +32 -0
- package/dist/cli/setup.js +298 -0
- package/dist/cli/status.d.ts +11 -0
- package/dist/cli/status.js +174 -0
- package/dist/cli/types/cli.types.d.ts +69 -0
- package/dist/cli/types/cli.types.js +1 -0
- package/dist/cli/ui.d.ts +41 -0
- package/dist/cli/ui.js +78 -0
- package/dist/cli/uninstall.d.ts +13 -0
- package/dist/cli/uninstall.js +83 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +124 -0
- package/dist/config/config-store.d.ts +29 -0
- package/dist/config/config-store.js +75 -0
- package/dist/config/config.d.ts +73 -0
- package/dist/config/config.js +115 -0
- package/dist/config/constants/config.constants.d.ts +62 -0
- package/dist/config/constants/config.constants.js +70 -0
- package/dist/config/index.d.ts +10 -0
- package/dist/config/index.js +5 -0
- package/dist/config/repo-config.d.ts +37 -0
- package/dist/config/repo-config.js +178 -0
- package/dist/config/schemas/config.schema.d.ts +409 -0
- package/dist/config/schemas/config.schema.js +97 -0
- package/dist/config/types/config.types.d.ts +33 -0
- package/dist/config/types/config.types.js +1 -0
- package/dist/core/async.d.ts +20 -0
- package/dist/core/async.js +32 -0
- package/dist/core/constants/core.constants.d.ts +18 -0
- package/dist/core/constants/core.constants.js +18 -0
- package/dist/core/env.d.ts +12 -0
- package/dist/core/env.js +20 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.js +8 -0
- package/dist/core/logger.d.ts +27 -0
- package/dist/core/logger.js +82 -0
- package/dist/core/number.d.ts +33 -0
- package/dist/core/number.js +47 -0
- package/dist/core/object.d.ts +78 -0
- package/dist/core/object.js +127 -0
- package/dist/core/pipe.d.ts +55 -0
- package/dist/core/pipe.js +81 -0
- package/dist/core/types/core.types.d.ts +54 -0
- package/dist/core/types/core.types.js +4 -0
- package/dist/core/version.d.ts +19 -0
- package/dist/core/version.js +35 -0
- package/dist/core/which.d.ts +13 -0
- package/dist/core/which.js +57 -0
- package/dist/enforcement/constants/enforcement.constants.d.ts +23 -0
- package/dist/enforcement/constants/enforcement.constants.js +22 -0
- package/dist/enforcement/decision-cache.d.ts +57 -0
- package/dist/enforcement/decision-cache.js +138 -0
- package/dist/enforcement/decision-client.d.ts +14 -0
- package/dist/enforcement/decision-client.js +84 -0
- package/dist/enforcement/enforcement.d.ts +17 -0
- package/dist/enforcement/enforcement.js +90 -0
- package/dist/enforcement/index.d.ts +11 -0
- package/dist/enforcement/index.js +10 -0
- package/dist/enforcement/schemas/enforcement.schema.d.ts +30 -0
- package/dist/enforcement/schemas/enforcement.schema.js +36 -0
- package/dist/enforcement/types/enforcement.types.d.ts +59 -0
- package/dist/enforcement/types/enforcement.types.js +1 -0
- package/dist/enrollment/constants/enrollment.constants.d.ts +6 -0
- package/dist/enrollment/constants/enrollment.constants.js +6 -0
- package/dist/enrollment/enrollment-provider.d.ts +5 -0
- package/dist/enrollment/enrollment-provider.js +1 -0
- package/dist/enrollment/index.d.ts +7 -0
- package/dist/enrollment/index.js +1 -0
- package/dist/enrollment/manual-enrollment.d.ts +32 -0
- package/dist/enrollment/manual-enrollment.js +72 -0
- package/dist/enrollment/types/enrollment.types.d.ts +25 -0
- package/dist/enrollment/types/enrollment.types.js +1 -0
- package/dist/events/canonical-event.d.ts +10 -0
- package/dist/events/canonical-event.js +9 -0
- package/dist/events/constants/enrich.constants.d.ts +14 -0
- package/dist/events/constants/enrich.constants.js +15 -0
- package/dist/events/constants/events.constants.d.ts +35 -0
- package/dist/events/constants/events.constants.js +57 -0
- package/dist/events/enrich.d.ts +16 -0
- package/dist/events/enrich.js +226 -0
- package/dist/events/event-id.d.ts +32 -0
- package/dist/events/event-id.js +49 -0
- package/dist/events/index.d.ts +14 -0
- package/dist/events/index.js +5 -0
- package/dist/events/llm-call.d.ts +14 -0
- package/dist/events/llm-call.js +84 -0
- package/dist/events/product-event.d.ts +39 -0
- package/dist/events/product-event.js +19 -0
- package/dist/events/types/enrich.types.d.ts +25 -0
- package/dist/events/types/enrich.types.js +1 -0
- package/dist/events/types/events.types.d.ts +112 -0
- package/dist/events/types/events.types.js +1 -0
- package/dist/events/types/llm-call.types.d.ts +79 -0
- package/dist/events/types/llm-call.types.js +1 -0
- package/dist/events/types/repo-snapshot.types.d.ts +32 -0
- package/dist/events/types/repo-snapshot.types.js +1 -0
- package/dist/feature/constants/feature.constants.d.ts +10 -0
- package/dist/feature/constants/feature.constants.js +10 -0
- package/dist/feature/index.d.ts +6 -0
- package/dist/feature/index.js +6 -0
- package/dist/feature/ticket-candidates.d.ts +13 -0
- package/dist/feature/ticket-candidates.js +26 -0
- package/dist/git/constants/git.constants.d.ts +84 -0
- package/dist/git/constants/git.constants.js +113 -0
- package/dist/git/git-context.d.ts +52 -0
- package/dist/git/git-context.js +226 -0
- package/dist/git/index.d.ts +9 -0
- package/dist/git/index.js +3 -0
- package/dist/git/remote-sanitize.d.ts +26 -0
- package/dist/git/remote-sanitize.js +92 -0
- package/dist/git/repo-snapshot.d.ts +40 -0
- package/dist/git/repo-snapshot.js +95 -0
- package/dist/git/types/git.types.d.ts +36 -0
- package/dist/git/types/git.types.js +1 -0
- package/dist/git/types/snapshot.types.d.ts +25 -0
- package/dist/git/types/snapshot.types.js +1 -0
- package/dist/otlp/constants/otlp.constants.d.ts +84 -0
- package/dist/otlp/constants/otlp.constants.js +99 -0
- package/dist/otlp/http.d.ts +24 -0
- package/dist/otlp/http.js +37 -0
- package/dist/otlp/index.d.ts +9 -0
- package/dist/otlp/index.js +3 -0
- package/dist/otlp/normalize.d.ts +14 -0
- package/dist/otlp/normalize.js +404 -0
- package/dist/otlp/types/otlp.types.d.ts +69 -0
- package/dist/otlp/types/otlp.types.js +1 -0
- package/dist/pipeline/constants/pipeline.constants.d.ts +23 -0
- package/dist/pipeline/constants/pipeline.constants.js +22 -0
- package/dist/pipeline/hook-pipeline.d.ts +14 -0
- package/dist/pipeline/hook-pipeline.js +297 -0
- package/dist/pipeline/index.d.ts +6 -0
- package/dist/pipeline/index.js +1 -0
- package/dist/pipeline/types/pipeline.types.d.ts +48 -0
- package/dist/pipeline/types/pipeline.types.js +1 -0
- package/dist/privacy/constants/privacy.constants.d.ts +23 -0
- package/dist/privacy/constants/privacy.constants.js +38 -0
- package/dist/privacy/index.d.ts +7 -0
- package/dist/privacy/index.js +2 -0
- package/dist/privacy/sanitizer.d.ts +20 -0
- package/dist/privacy/sanitizer.js +52 -0
- package/dist/privacy/types/privacy.types.d.ts +13 -0
- package/dist/privacy/types/privacy.types.js +1 -0
- package/dist/providers/antigravity/antigravity.adapter.d.ts +54 -0
- package/dist/providers/antigravity/antigravity.adapter.js +311 -0
- package/dist/providers/antigravity/antigravity.detect.d.ts +25 -0
- package/dist/providers/antigravity/antigravity.detect.js +64 -0
- package/dist/providers/antigravity/antigravity.hooks.d.ts +24 -0
- package/dist/providers/antigravity/antigravity.hooks.js +126 -0
- package/dist/providers/antigravity/antigravity.provider.d.ts +2 -0
- package/dist/providers/antigravity/antigravity.provider.js +22 -0
- package/dist/providers/antigravity/constants/antigravity.constants.d.ts +72 -0
- package/dist/providers/antigravity/constants/antigravity.constants.js +75 -0
- package/dist/providers/antigravity/schemas/antigravity.schema.d.ts +521 -0
- package/dist/providers/antigravity/schemas/antigravity.schema.js +64 -0
- package/dist/providers/antigravity/types/antigravity.types.d.ts +13 -0
- package/dist/providers/antigravity/types/antigravity.types.js +1 -0
- package/dist/providers/claude/claude.adapter.d.ts +15 -0
- package/dist/providers/claude/claude.adapter.js +141 -0
- package/dist/providers/claude/claude.detect.d.ts +20 -0
- package/dist/providers/claude/claude.detect.js +57 -0
- package/dist/providers/claude/claude.hooks.d.ts +23 -0
- package/dist/providers/claude/claude.hooks.js +94 -0
- package/dist/providers/claude/claude.otel.d.ts +95 -0
- package/dist/providers/claude/claude.otel.js +331 -0
- package/dist/providers/claude/claude.provider.d.ts +2 -0
- package/dist/providers/claude/claude.provider.js +26 -0
- package/dist/providers/claude/constants/claude.constants.d.ts +34 -0
- package/dist/providers/claude/constants/claude.constants.js +54 -0
- package/dist/providers/claude/constants/claude.otel.constants.d.ts +17 -0
- package/dist/providers/claude/constants/claude.otel.constants.js +17 -0
- package/dist/providers/claude/schemas/claude.schema.d.ts +72 -0
- package/dist/providers/claude/schemas/claude.schema.js +32 -0
- package/dist/providers/claude/types/claude.types.d.ts +3 -0
- package/dist/providers/claude/types/claude.types.js +1 -0
- package/dist/providers/codex/codex.adapter.d.ts +11 -0
- package/dist/providers/codex/codex.adapter.js +106 -0
- package/dist/providers/codex/codex.detect.d.ts +30 -0
- package/dist/providers/codex/codex.detect.js +58 -0
- package/dist/providers/codex/codex.hooks.d.ts +27 -0
- package/dist/providers/codex/codex.hooks.js +129 -0
- package/dist/providers/codex/codex.otel.d.ts +51 -0
- package/dist/providers/codex/codex.otel.js +325 -0
- package/dist/providers/codex/codex.provider.d.ts +2 -0
- package/dist/providers/codex/codex.provider.js +25 -0
- package/dist/providers/codex/constants/codex.constants.d.ts +41 -0
- package/dist/providers/codex/constants/codex.constants.js +62 -0
- package/dist/providers/codex/constants/codex.otel.constants.d.ts +22 -0
- package/dist/providers/codex/constants/codex.otel.constants.js +22 -0
- package/dist/providers/codex/schemas/codex.schema.d.ts +70 -0
- package/dist/providers/codex/schemas/codex.schema.js +32 -0
- package/dist/providers/codex/types/codex.types.d.ts +3 -0
- package/dist/providers/codex/types/codex.types.js +1 -0
- package/dist/providers/constants/provider.constants.d.ts +33 -0
- package/dist/providers/constants/provider.constants.js +33 -0
- package/dist/providers/cursor/constants/cursor.constants.d.ts +58 -0
- package/dist/providers/cursor/constants/cursor.constants.js +95 -0
- package/dist/providers/cursor/cursor.adapter.d.ts +11 -0
- package/dist/providers/cursor/cursor.adapter.js +331 -0
- package/dist/providers/cursor/cursor.detect.d.ts +23 -0
- package/dist/providers/cursor/cursor.detect.js +66 -0
- package/dist/providers/cursor/cursor.hooks.d.ts +25 -0
- package/dist/providers/cursor/cursor.hooks.js +95 -0
- package/dist/providers/cursor/cursor.provider.d.ts +2 -0
- package/dist/providers/cursor/cursor.provider.js +27 -0
- package/dist/providers/cursor/schemas/cursor.schema.d.ts +130 -0
- package/dist/providers/cursor/schemas/cursor.schema.js +62 -0
- package/dist/providers/cursor/types/cursor.types.d.ts +3 -0
- package/dist/providers/cursor/types/cursor.types.js +1 -0
- package/dist/providers/gemini/constants/gemini.constants.d.ts +36 -0
- package/dist/providers/gemini/constants/gemini.constants.js +58 -0
- package/dist/providers/gemini/constants/gemini.otel.constants.d.ts +34 -0
- package/dist/providers/gemini/constants/gemini.otel.constants.js +48 -0
- package/dist/providers/gemini/gemini.adapter.d.ts +15 -0
- package/dist/providers/gemini/gemini.adapter.js +146 -0
- package/dist/providers/gemini/gemini.detect.d.ts +23 -0
- package/dist/providers/gemini/gemini.detect.js +78 -0
- package/dist/providers/gemini/gemini.hooks.d.ts +22 -0
- package/dist/providers/gemini/gemini.hooks.js +93 -0
- package/dist/providers/gemini/gemini.otel.d.ts +62 -0
- package/dist/providers/gemini/gemini.otel.js +274 -0
- package/dist/providers/gemini/gemini.provider.d.ts +2 -0
- package/dist/providers/gemini/gemini.provider.js +22 -0
- package/dist/providers/gemini/schemas/gemini.schema.d.ts +81 -0
- package/dist/providers/gemini/schemas/gemini.schema.js +35 -0
- package/dist/providers/gemini/types/gemini.types.d.ts +3 -0
- package/dist/providers/gemini/types/gemini.types.js +1 -0
- package/dist/providers/index.d.ts +14 -0
- package/dist/providers/index.js +8 -0
- package/dist/providers/provider.d.ts +16 -0
- package/dist/providers/provider.js +149 -0
- package/dist/providers/registry.d.ts +12 -0
- package/dist/providers/registry.js +23 -0
- package/dist/providers/shared/constants/hook-refusal.constants.d.ts +6 -0
- package/dist/providers/shared/constants/hook-refusal.constants.js +6 -0
- package/dist/providers/shared/constants/tooling.constants.d.ts +25 -0
- package/dist/providers/shared/constants/tooling.constants.js +25 -0
- package/dist/providers/shared/event-builder.d.ts +85 -0
- package/dist/providers/shared/event-builder.js +166 -0
- package/dist/providers/shared/hook-config.d.ts +80 -0
- package/dist/providers/shared/hook-config.js +164 -0
- package/dist/providers/shared/hook-refusal.d.ts +16 -0
- package/dist/providers/shared/hook-refusal.js +33 -0
- package/dist/providers/shared/install-record.d.ts +75 -0
- package/dist/providers/shared/install-record.js +113 -0
- package/dist/providers/shared/tooling.d.ts +58 -0
- package/dist/providers/shared/tooling.js +103 -0
- package/dist/providers/shared/types/adapter.types.d.ts +54 -0
- package/dist/providers/shared/types/adapter.types.js +1 -0
- package/dist/providers/shared/types/hook-config.types.d.ts +32 -0
- package/dist/providers/shared/types/hook-config.types.js +1 -0
- package/dist/providers/types/provider.types.d.ts +98 -0
- package/dist/providers/types/provider.types.js +1 -0
- package/dist/snapshot/branch-selection.d.ts +37 -0
- package/dist/snapshot/branch-selection.js +69 -0
- package/dist/snapshot/budget.d.ts +41 -0
- package/dist/snapshot/budget.js +67 -0
- package/dist/snapshot/constants/snapshot-stages.constants.d.ts +11 -0
- package/dist/snapshot/constants/snapshot-stages.constants.js +11 -0
- package/dist/snapshot/constants/snapshot.constants.d.ts +56 -0
- package/dist/snapshot/constants/snapshot.constants.js +56 -0
- package/dist/snapshot/index.d.ts +16 -0
- package/dist/snapshot/index.js +6 -0
- package/dist/snapshot/snapshot-event.d.ts +17 -0
- package/dist/snapshot/snapshot-event.js +66 -0
- package/dist/snapshot/snapshot-pipeline.d.ts +14 -0
- package/dist/snapshot/snapshot-pipeline.js +163 -0
- package/dist/snapshot/snapshot-state.d.ts +55 -0
- package/dist/snapshot/snapshot-state.js +100 -0
- package/dist/snapshot/types/snapshot.types.d.ts +86 -0
- package/dist/snapshot/types/snapshot.types.js +1 -0
- package/dist/storage/atomic-file.d.ts +25 -0
- package/dist/storage/atomic-file.js +76 -0
- package/dist/storage/constants/storage.constants.d.ts +34 -0
- package/dist/storage/constants/storage.constants.js +35 -0
- package/dist/storage/index.d.ts +10 -0
- package/dist/storage/index.js +5 -0
- package/dist/storage/install-state.d.ts +20 -0
- package/dist/storage/install-state.js +40 -0
- package/dist/storage/json-file.d.ts +13 -0
- package/dist/storage/json-file.js +31 -0
- package/dist/storage/lock.d.ts +15 -0
- package/dist/storage/lock.js +70 -0
- package/dist/storage/paths.d.ts +14 -0
- package/dist/storage/paths.js +42 -0
- package/dist/storage/schemas/storage.schema.d.ts +128 -0
- package/dist/storage/schemas/storage.schema.js +27 -0
- package/dist/storage/types/storage.types.d.ts +36 -0
- package/dist/storage/types/storage.types.js +1 -0
- package/dist/transport/constants/transport.constants.d.ts +47 -0
- package/dist/transport/constants/transport.constants.js +47 -0
- package/dist/transport/cooldown.d.ts +35 -0
- package/dist/transport/cooldown.js +62 -0
- package/dist/transport/delivery-stats.d.ts +65 -0
- package/dist/transport/delivery-stats.js +186 -0
- package/dist/transport/delivery.d.ts +26 -0
- package/dist/transport/delivery.js +80 -0
- package/dist/transport/headers.d.ts +12 -0
- package/dist/transport/headers.js +19 -0
- package/dist/transport/http-transport.d.ts +39 -0
- package/dist/transport/http-transport.js +106 -0
- package/dist/transport/index.d.ts +13 -0
- package/dist/transport/index.js +7 -0
- package/dist/transport/queue.d.ts +177 -0
- package/dist/transport/queue.js +474 -0
- package/dist/transport/schemas/queue.schema.d.ts +30 -0
- package/dist/transport/schemas/queue.schema.js +18 -0
- package/dist/transport/transport.d.ts +6 -0
- package/dist/transport/transport.js +1 -0
- package/dist/transport/types/transport.types.d.ts +102 -0
- package/dist/transport/types/transport.types.js +1 -0
- package/dist/turns/aggregate-usage.d.ts +20 -0
- package/dist/turns/aggregate-usage.js +269 -0
- package/dist/turns/claude-transcript.d.ts +18 -0
- package/dist/turns/claude-transcript.js +80 -0
- package/dist/turns/constants/turns.constants.d.ts +69 -0
- package/dist/turns/constants/turns.constants.js +86 -0
- package/dist/turns/cursor-transcript.d.ts +21 -0
- package/dist/turns/cursor-transcript.js +66 -0
- package/dist/turns/index.d.ts +17 -0
- package/dist/turns/index.js +7 -0
- package/dist/turns/transcript.d.ts +74 -0
- package/dist/turns/transcript.js +188 -0
- package/dist/turns/turn-state.d.ts +94 -0
- package/dist/turns/turn-state.js +234 -0
- package/dist/turns/turn-summary.d.ts +27 -0
- package/dist/turns/turn-summary.js +164 -0
- package/dist/turns/turn-tracker.d.ts +14 -0
- package/dist/turns/turn-tracker.js +521 -0
- package/dist/turns/types/aggregate-usage.types.d.ts +26 -0
- package/dist/turns/types/aggregate-usage.types.js +1 -0
- package/dist/turns/types/transcript.types.d.ts +41 -0
- package/dist/turns/types/transcript.types.js +1 -0
- package/dist/turns/types/turn-state.types.d.ts +37 -0
- package/dist/turns/types/turn-state.types.js +1 -0
- package/dist/turns/types/turn-summary.types.d.ts +106 -0
- package/dist/turns/types/turn-summary.types.js +1 -0
- package/dist/turns/types/turn-tracker.types.d.ts +27 -0
- package/dist/turns/types/turn-tracker.types.js +1 -0
- package/example/README.md +43 -0
- package/example/server.mjs +240 -0
- package/package.json +89 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export const ANTIGRAVITY_PROVIDER_ID = 'antigravity';
|
|
2
|
+
export const ANTIGRAVITY_DISPLAY_NAME = 'Google Antigravity';
|
|
3
|
+
/** Antigravity shares Gemini's home; its own config lives one level down. */
|
|
4
|
+
export const ANTIGRAVITY_ROOT_SEGMENTS = ['.gemini', 'config'];
|
|
5
|
+
export const ANTIGRAVITY_CLI_DIR_SEGMENTS = ['.gemini', 'antigravity-cli'];
|
|
6
|
+
export const ANTIGRAVITY_HOOKS_FILE = 'hooks.json';
|
|
7
|
+
export const ANTIGRAVITY_EXECUTABLES = ['agy', 'antigravity'];
|
|
8
|
+
/**
|
|
9
|
+
* Antigravity reads `~/.gemini/config/hooks.json` as a map of *named* hook
|
|
10
|
+
* groups — its log line is "loaded N named hooks from N hooks.json file(s)" — so
|
|
11
|
+
* AgentWatch owns exactly one top-level key and never touches another tool's
|
|
12
|
+
* group.
|
|
13
|
+
*/
|
|
14
|
+
export const ANTIGRAVITY_GROUP_NAME = 'agentwatch';
|
|
15
|
+
export const ANTIGRAVITY_HOOK_EVENTS = ['PreToolUse', 'PostToolUse', 'PreInvocation', 'PostInvocation', 'Stop'];
|
|
16
|
+
/** Tool-scoped events take a matcher; the rest are plain handler lists. */
|
|
17
|
+
export const ANTIGRAVITY_MATCHED_EVENTS = new Set(['PreToolUse', 'PostToolUse']);
|
|
18
|
+
/**
|
|
19
|
+
* `HookHandlerConfig.timeout` carries no unit suffix, and Gemini CLI — the same
|
|
20
|
+
* Google hook runner — reads the field as milliseconds with a 60,000 default. A
|
|
21
|
+
* bare `30` there timed every AgentWatch hook out before node could start; see
|
|
22
|
+
* the identical constant in gemini.constants.ts. Milliseconds is also the safe
|
|
23
|
+
* reading of the two: an over-large upper bound costs nothing, because the hook
|
|
24
|
+
* exits in well under a second either way.
|
|
25
|
+
*/
|
|
26
|
+
export const ANTIGRAVITY_HOOK_TIMEOUT_MILLISECONDS = 30_000;
|
|
27
|
+
/**
|
|
28
|
+
* The decision each hook result must carry.
|
|
29
|
+
*
|
|
30
|
+
* `decision` is a required field of both `PreToolHookResult` and
|
|
31
|
+
* `StopHookResult`, and Antigravity has a dedicated `PreToolHookDeniedError`
|
|
32
|
+
* for a pre-tool hook that does not answer. A single `{}` for every hook — the
|
|
33
|
+
* previous behavior — therefore did not merely fail to observe: it blocked every
|
|
34
|
+
* tool call the agent tried to make. The remaining result messages
|
|
35
|
+
* (`PostToolHookResult`, the invocation hooks, `SessionStartHookResult`) carry
|
|
36
|
+
* no decision, so silence is correct for those.
|
|
37
|
+
*/
|
|
38
|
+
export const ANTIGRAVITY_HOOK_DECISIONS = {
|
|
39
|
+
PreToolUse: { decision: 'allow' },
|
|
40
|
+
Stop: { decision: 'stop' }
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Answer used for a payload we cannot classify at all.
|
|
44
|
+
*
|
|
45
|
+
* A pre-tool allow: the one payload shape we cannot read is also the one where
|
|
46
|
+
* staying silent would stall the agent, and telemetry must never do that.
|
|
47
|
+
*/
|
|
48
|
+
export const ANTIGRAVITY_FALLBACK_DECISION = ANTIGRAVITY_HOOK_DECISIONS['PreToolUse'];
|
|
49
|
+
/**
|
|
50
|
+
* Antigravity names its model the way its picker shows it — `Claude Opus 4.6
|
|
51
|
+
* (Thinking)`, `Gemini 3 Pro (High)` — not the way an API does. Every other
|
|
52
|
+
* agent reports a model *id*, so a display name reaches the backend as a model
|
|
53
|
+
* nobody has a price for and as a second name for a model the ledger already
|
|
54
|
+
* knows under its id. The patterns below turn one into the other.
|
|
55
|
+
*/
|
|
56
|
+
/** Trailing selector the picker appends: `(Thinking)`, `(High)`, `(Fast)`. */
|
|
57
|
+
export const RE_MODEL_QUALIFIER = /\s*\([^)]*\)\s*$/;
|
|
58
|
+
/** Any run of whitespace, which in an id is a single hyphen. */
|
|
59
|
+
export const RE_MODEL_WHITESPACE = /\s+/g;
|
|
60
|
+
/**
|
|
61
|
+
* Anthropic writes a version as `claude-opus-4-6`; Google and OpenAI keep the
|
|
62
|
+
* dot (`gemini-3.1-pro`, `gpt-5.2`). Converting dots for everyone would invent
|
|
63
|
+
* `gemini-3-1-pro`, which matches no price and no other row in the ledger.
|
|
64
|
+
*/
|
|
65
|
+
export const RE_MODEL_VERSION_DOT = /\./g;
|
|
66
|
+
export const DOTLESS_MODEL_FAMILY = 'claude';
|
|
67
|
+
/** oneof member of `HookArgs` -> the hook Antigravity fired, in hooks.json naming. */
|
|
68
|
+
export const ANTIGRAVITY_HOOK_EVENT_BY_ARGS = {
|
|
69
|
+
preToolHookArgs: 'PreToolUse',
|
|
70
|
+
postToolHookArgs: 'PostToolUse',
|
|
71
|
+
preInvocationHookArgs: 'PreInvocation',
|
|
72
|
+
postInvocationHookArgs: 'PostInvocation',
|
|
73
|
+
stopHookArgs: 'Stop',
|
|
74
|
+
sessionStartHookArgs: 'SessionStart'
|
|
75
|
+
};
|
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const antigravityPayloadSchema: z.ZodObject<{
|
|
3
|
+
common: z.ZodOptional<z.ZodObject<{
|
|
4
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
5
|
+
workspacePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
6
|
+
transcriptPath: z.ZodOptional<z.ZodString>;
|
|
7
|
+
artifactDirectoryPath: z.ZodOptional<z.ZodString>;
|
|
8
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
9
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
10
|
+
isBattleMode: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
lastUserInput: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
13
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
14
|
+
workspacePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
15
|
+
transcriptPath: z.ZodOptional<z.ZodString>;
|
|
16
|
+
artifactDirectoryPath: z.ZodOptional<z.ZodString>;
|
|
17
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
18
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
19
|
+
isBattleMode: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
lastUserInput: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
22
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
23
|
+
workspacePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
24
|
+
transcriptPath: z.ZodOptional<z.ZodString>;
|
|
25
|
+
artifactDirectoryPath: z.ZodOptional<z.ZodString>;
|
|
26
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
27
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
28
|
+
isBattleMode: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
lastUserInput: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
31
|
+
preToolHookArgs: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
name: z.ZodOptional<z.ZodString>;
|
|
34
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
35
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
36
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
37
|
+
name: z.ZodOptional<z.ZodString>;
|
|
38
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
39
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
40
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
41
|
+
name: z.ZodOptional<z.ZodString>;
|
|
42
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
43
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
44
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
45
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
46
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
47
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
name: z.ZodOptional<z.ZodString>;
|
|
49
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
50
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
51
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
52
|
+
name: z.ZodOptional<z.ZodString>;
|
|
53
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
54
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
55
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
56
|
+
name: z.ZodOptional<z.ZodString>;
|
|
57
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
58
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
59
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
60
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
61
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
62
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
name: z.ZodOptional<z.ZodString>;
|
|
64
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
65
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
66
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
67
|
+
name: z.ZodOptional<z.ZodString>;
|
|
68
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
69
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
70
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
71
|
+
name: z.ZodOptional<z.ZodString>;
|
|
72
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
73
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
74
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
75
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
76
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
77
|
+
postToolHookArgs: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
79
|
+
name: z.ZodOptional<z.ZodString>;
|
|
80
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
81
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
82
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
83
|
+
name: z.ZodOptional<z.ZodString>;
|
|
84
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
85
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
86
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
87
|
+
name: z.ZodOptional<z.ZodString>;
|
|
88
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
89
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
90
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
91
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
92
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
93
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
94
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
95
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
96
|
+
name: z.ZodOptional<z.ZodString>;
|
|
97
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
98
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
99
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
100
|
+
name: z.ZodOptional<z.ZodString>;
|
|
101
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
102
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
103
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
104
|
+
name: z.ZodOptional<z.ZodString>;
|
|
105
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
106
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
107
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
108
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
109
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
110
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
111
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
112
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
name: z.ZodOptional<z.ZodString>;
|
|
114
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
115
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
116
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
117
|
+
name: z.ZodOptional<z.ZodString>;
|
|
118
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
119
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
120
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
121
|
+
name: z.ZodOptional<z.ZodString>;
|
|
122
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
123
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
124
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
125
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
126
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
127
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
128
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
129
|
+
preInvocationHookArgs: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
131
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
132
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
133
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
134
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
135
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
136
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
137
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
138
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
139
|
+
postInvocationHookArgs: z.ZodOptional<z.ZodObject<{
|
|
140
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
141
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
142
|
+
modelOutput: z.ZodOptional<z.ZodString>;
|
|
143
|
+
modelThinking: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
145
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
146
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
147
|
+
modelOutput: z.ZodOptional<z.ZodString>;
|
|
148
|
+
modelThinking: z.ZodOptional<z.ZodString>;
|
|
149
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
150
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
151
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
152
|
+
modelOutput: z.ZodOptional<z.ZodString>;
|
|
153
|
+
modelThinking: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
155
|
+
stopHookArgs: z.ZodOptional<z.ZodObject<{
|
|
156
|
+
executionNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
157
|
+
terminationReason: z.ZodOptional<z.ZodString>;
|
|
158
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
159
|
+
fullyIdle: z.ZodOptional<z.ZodBoolean>;
|
|
160
|
+
finalModelOutput: z.ZodOptional<z.ZodString>;
|
|
161
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
162
|
+
executionNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
163
|
+
terminationReason: z.ZodOptional<z.ZodString>;
|
|
164
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
165
|
+
fullyIdle: z.ZodOptional<z.ZodBoolean>;
|
|
166
|
+
finalModelOutput: z.ZodOptional<z.ZodString>;
|
|
167
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
168
|
+
executionNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
169
|
+
terminationReason: z.ZodOptional<z.ZodString>;
|
|
170
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
171
|
+
fullyIdle: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
+
finalModelOutput: z.ZodOptional<z.ZodString>;
|
|
173
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
174
|
+
sessionStartHookArgs: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
175
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
176
|
+
common: z.ZodOptional<z.ZodObject<{
|
|
177
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
178
|
+
workspacePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
179
|
+
transcriptPath: z.ZodOptional<z.ZodString>;
|
|
180
|
+
artifactDirectoryPath: z.ZodOptional<z.ZodString>;
|
|
181
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
182
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
183
|
+
isBattleMode: z.ZodOptional<z.ZodBoolean>;
|
|
184
|
+
lastUserInput: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
186
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
187
|
+
workspacePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
188
|
+
transcriptPath: z.ZodOptional<z.ZodString>;
|
|
189
|
+
artifactDirectoryPath: z.ZodOptional<z.ZodString>;
|
|
190
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
191
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
192
|
+
isBattleMode: z.ZodOptional<z.ZodBoolean>;
|
|
193
|
+
lastUserInput: z.ZodOptional<z.ZodString>;
|
|
194
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
195
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
196
|
+
workspacePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
197
|
+
transcriptPath: z.ZodOptional<z.ZodString>;
|
|
198
|
+
artifactDirectoryPath: z.ZodOptional<z.ZodString>;
|
|
199
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
200
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
201
|
+
isBattleMode: z.ZodOptional<z.ZodBoolean>;
|
|
202
|
+
lastUserInput: z.ZodOptional<z.ZodString>;
|
|
203
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
204
|
+
preToolHookArgs: z.ZodOptional<z.ZodObject<{
|
|
205
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
206
|
+
name: z.ZodOptional<z.ZodString>;
|
|
207
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
208
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
209
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
210
|
+
name: z.ZodOptional<z.ZodString>;
|
|
211
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
212
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
213
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
214
|
+
name: z.ZodOptional<z.ZodString>;
|
|
215
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
216
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
217
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
218
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
219
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
220
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
221
|
+
name: z.ZodOptional<z.ZodString>;
|
|
222
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
223
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
224
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
225
|
+
name: z.ZodOptional<z.ZodString>;
|
|
226
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
227
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
228
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
229
|
+
name: z.ZodOptional<z.ZodString>;
|
|
230
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
231
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
232
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
233
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
234
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
235
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
236
|
+
name: z.ZodOptional<z.ZodString>;
|
|
237
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
238
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
239
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
240
|
+
name: z.ZodOptional<z.ZodString>;
|
|
241
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
242
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
243
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
244
|
+
name: z.ZodOptional<z.ZodString>;
|
|
245
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
246
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
247
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
248
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
249
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
250
|
+
postToolHookArgs: z.ZodOptional<z.ZodObject<{
|
|
251
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
252
|
+
name: z.ZodOptional<z.ZodString>;
|
|
253
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
254
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
255
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
256
|
+
name: z.ZodOptional<z.ZodString>;
|
|
257
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
258
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
259
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
260
|
+
name: z.ZodOptional<z.ZodString>;
|
|
261
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
262
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
263
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
264
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
265
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
266
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
267
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
268
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
269
|
+
name: z.ZodOptional<z.ZodString>;
|
|
270
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
271
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
272
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
273
|
+
name: z.ZodOptional<z.ZodString>;
|
|
274
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
275
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
276
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
277
|
+
name: z.ZodOptional<z.ZodString>;
|
|
278
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
279
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
280
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
281
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
282
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
283
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
284
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
285
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
286
|
+
name: z.ZodOptional<z.ZodString>;
|
|
287
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
288
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
289
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
290
|
+
name: z.ZodOptional<z.ZodString>;
|
|
291
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
292
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
293
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
294
|
+
name: z.ZodOptional<z.ZodString>;
|
|
295
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
296
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
297
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
298
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
299
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
300
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
301
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
302
|
+
preInvocationHookArgs: z.ZodOptional<z.ZodObject<{
|
|
303
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
304
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
305
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
306
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
307
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
308
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
309
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
310
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
311
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
312
|
+
postInvocationHookArgs: z.ZodOptional<z.ZodObject<{
|
|
313
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
314
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
315
|
+
modelOutput: z.ZodOptional<z.ZodString>;
|
|
316
|
+
modelThinking: z.ZodOptional<z.ZodString>;
|
|
317
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
318
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
319
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
320
|
+
modelOutput: z.ZodOptional<z.ZodString>;
|
|
321
|
+
modelThinking: z.ZodOptional<z.ZodString>;
|
|
322
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
323
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
324
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
325
|
+
modelOutput: z.ZodOptional<z.ZodString>;
|
|
326
|
+
modelThinking: z.ZodOptional<z.ZodString>;
|
|
327
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
328
|
+
stopHookArgs: z.ZodOptional<z.ZodObject<{
|
|
329
|
+
executionNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
330
|
+
terminationReason: z.ZodOptional<z.ZodString>;
|
|
331
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
332
|
+
fullyIdle: z.ZodOptional<z.ZodBoolean>;
|
|
333
|
+
finalModelOutput: z.ZodOptional<z.ZodString>;
|
|
334
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
335
|
+
executionNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
336
|
+
terminationReason: z.ZodOptional<z.ZodString>;
|
|
337
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
338
|
+
fullyIdle: z.ZodOptional<z.ZodBoolean>;
|
|
339
|
+
finalModelOutput: z.ZodOptional<z.ZodString>;
|
|
340
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
341
|
+
executionNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
342
|
+
terminationReason: z.ZodOptional<z.ZodString>;
|
|
343
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
344
|
+
fullyIdle: z.ZodOptional<z.ZodBoolean>;
|
|
345
|
+
finalModelOutput: z.ZodOptional<z.ZodString>;
|
|
346
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
347
|
+
sessionStartHookArgs: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
348
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
349
|
+
common: z.ZodOptional<z.ZodObject<{
|
|
350
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
351
|
+
workspacePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
352
|
+
transcriptPath: z.ZodOptional<z.ZodString>;
|
|
353
|
+
artifactDirectoryPath: z.ZodOptional<z.ZodString>;
|
|
354
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
355
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
356
|
+
isBattleMode: z.ZodOptional<z.ZodBoolean>;
|
|
357
|
+
lastUserInput: z.ZodOptional<z.ZodString>;
|
|
358
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
359
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
360
|
+
workspacePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
361
|
+
transcriptPath: z.ZodOptional<z.ZodString>;
|
|
362
|
+
artifactDirectoryPath: z.ZodOptional<z.ZodString>;
|
|
363
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
364
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
365
|
+
isBattleMode: z.ZodOptional<z.ZodBoolean>;
|
|
366
|
+
lastUserInput: z.ZodOptional<z.ZodString>;
|
|
367
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
368
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
369
|
+
workspacePaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
370
|
+
transcriptPath: z.ZodOptional<z.ZodString>;
|
|
371
|
+
artifactDirectoryPath: z.ZodOptional<z.ZodString>;
|
|
372
|
+
executionId: z.ZodOptional<z.ZodString>;
|
|
373
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
374
|
+
isBattleMode: z.ZodOptional<z.ZodBoolean>;
|
|
375
|
+
lastUserInput: z.ZodOptional<z.ZodString>;
|
|
376
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
377
|
+
preToolHookArgs: z.ZodOptional<z.ZodObject<{
|
|
378
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
379
|
+
name: z.ZodOptional<z.ZodString>;
|
|
380
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
381
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
382
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
383
|
+
name: z.ZodOptional<z.ZodString>;
|
|
384
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
385
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
386
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
387
|
+
name: z.ZodOptional<z.ZodString>;
|
|
388
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
389
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
390
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
391
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
392
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
393
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
394
|
+
name: z.ZodOptional<z.ZodString>;
|
|
395
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
396
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
397
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
398
|
+
name: z.ZodOptional<z.ZodString>;
|
|
399
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
400
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
401
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
402
|
+
name: z.ZodOptional<z.ZodString>;
|
|
403
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
404
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
405
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
406
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
407
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
408
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
409
|
+
name: z.ZodOptional<z.ZodString>;
|
|
410
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
411
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
412
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
413
|
+
name: z.ZodOptional<z.ZodString>;
|
|
414
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
415
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
416
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
417
|
+
name: z.ZodOptional<z.ZodString>;
|
|
418
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
419
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
420
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
421
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
422
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
423
|
+
postToolHookArgs: z.ZodOptional<z.ZodObject<{
|
|
424
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
425
|
+
name: z.ZodOptional<z.ZodString>;
|
|
426
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
427
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
428
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
429
|
+
name: z.ZodOptional<z.ZodString>;
|
|
430
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
431
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
432
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
433
|
+
name: z.ZodOptional<z.ZodString>;
|
|
434
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
435
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
436
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
437
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
438
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
439
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
440
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
441
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
442
|
+
name: z.ZodOptional<z.ZodString>;
|
|
443
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
444
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
445
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
446
|
+
name: z.ZodOptional<z.ZodString>;
|
|
447
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
448
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
449
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
450
|
+
name: z.ZodOptional<z.ZodString>;
|
|
451
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
452
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
453
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
454
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
455
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
456
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
457
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
458
|
+
toolCall: z.ZodOptional<z.ZodObject<{
|
|
459
|
+
name: z.ZodOptional<z.ZodString>;
|
|
460
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
461
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
462
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
463
|
+
name: z.ZodOptional<z.ZodString>;
|
|
464
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
465
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
466
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
467
|
+
name: z.ZodOptional<z.ZodString>;
|
|
468
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
469
|
+
args: z.ZodOptional<z.ZodUnknown>;
|
|
470
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
471
|
+
stepIdx: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
472
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
473
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
474
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
475
|
+
preInvocationHookArgs: z.ZodOptional<z.ZodObject<{
|
|
476
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
477
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
478
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
479
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
480
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
481
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
482
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
483
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
484
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
485
|
+
postInvocationHookArgs: z.ZodOptional<z.ZodObject<{
|
|
486
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
487
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
488
|
+
modelOutput: z.ZodOptional<z.ZodString>;
|
|
489
|
+
modelThinking: z.ZodOptional<z.ZodString>;
|
|
490
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
491
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
492
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
493
|
+
modelOutput: z.ZodOptional<z.ZodString>;
|
|
494
|
+
modelThinking: z.ZodOptional<z.ZodString>;
|
|
495
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
496
|
+
invocationNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
497
|
+
initialNumSteps: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
498
|
+
modelOutput: z.ZodOptional<z.ZodString>;
|
|
499
|
+
modelThinking: z.ZodOptional<z.ZodString>;
|
|
500
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
501
|
+
stopHookArgs: z.ZodOptional<z.ZodObject<{
|
|
502
|
+
executionNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
503
|
+
terminationReason: z.ZodOptional<z.ZodString>;
|
|
504
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
505
|
+
fullyIdle: z.ZodOptional<z.ZodBoolean>;
|
|
506
|
+
finalModelOutput: z.ZodOptional<z.ZodString>;
|
|
507
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
508
|
+
executionNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
509
|
+
terminationReason: z.ZodOptional<z.ZodString>;
|
|
510
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
511
|
+
fullyIdle: z.ZodOptional<z.ZodBoolean>;
|
|
512
|
+
finalModelOutput: z.ZodOptional<z.ZodString>;
|
|
513
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
514
|
+
executionNum: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
515
|
+
terminationReason: z.ZodOptional<z.ZodString>;
|
|
516
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
517
|
+
fullyIdle: z.ZodOptional<z.ZodBoolean>;
|
|
518
|
+
finalModelOutput: z.ZodOptional<z.ZodString>;
|
|
519
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
520
|
+
sessionStartHookArgs: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
521
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Antigravity hook payloads.
|
|
4
|
+
*
|
|
5
|
+
* The payload is protojson of `exa.hooks_pb.HookArgs`
|
|
6
|
+
* (`third_party/jetski/hooks_pb/hooks.proto`, read off the `agy` binary), and it
|
|
7
|
+
* differs from every other agent we support in two ways that no amount of field
|
|
8
|
+
* renaming can paper over:
|
|
9
|
+
*
|
|
10
|
+
* - There is no event-name field. `HookArgs` is a `common` block plus a oneof,
|
|
11
|
+
* and the event is whichever member of that oneof is set. Reading a
|
|
12
|
+
* `hookEventName` — a field that exists in no version of this schema — is how
|
|
13
|
+
* this provider previously produced `agent.other` with no session id for every
|
|
14
|
+
* hook, which the turn tracker then discarded.
|
|
15
|
+
* - Identity is nested in `common`, and tool arguments are PascalCase
|
|
16
|
+
* (`TargetFile`, `CommandLine`) rather than the snake_case used elsewhere.
|
|
17
|
+
*/
|
|
18
|
+
/** proto3 JSON encodes int32 as a number and int64 as a string. */
|
|
19
|
+
const protoInt = z.union([z.number(), z.string()]).optional();
|
|
20
|
+
const toolCallSchema = z
|
|
21
|
+
.object({
|
|
22
|
+
name: z.string().optional(),
|
|
23
|
+
/** `google.protobuf.Struct`: an arbitrary JSON object. */
|
|
24
|
+
args: z.unknown().optional()
|
|
25
|
+
})
|
|
26
|
+
.passthrough();
|
|
27
|
+
const commonSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
conversationId: z.string().optional(),
|
|
30
|
+
workspacePaths: z.array(z.string()).optional(),
|
|
31
|
+
transcriptPath: z.string().optional(),
|
|
32
|
+
artifactDirectoryPath: z.string().optional(),
|
|
33
|
+
executionId: z.string().optional(),
|
|
34
|
+
modelName: z.string().optional(),
|
|
35
|
+
isBattleMode: z.boolean().optional(),
|
|
36
|
+
lastUserInput: z.string().optional()
|
|
37
|
+
})
|
|
38
|
+
.passthrough();
|
|
39
|
+
export const antigravityPayloadSchema = z
|
|
40
|
+
.object({
|
|
41
|
+
common: commonSchema.optional(),
|
|
42
|
+
preToolHookArgs: z.object({ toolCall: toolCallSchema.optional(), stepIdx: protoInt }).passthrough().optional(),
|
|
43
|
+
postToolHookArgs: z
|
|
44
|
+
.object({ toolCall: toolCallSchema.optional(), stepIdx: protoInt, error: z.unknown().optional(), result: z.unknown().optional() })
|
|
45
|
+
.passthrough()
|
|
46
|
+
.optional(),
|
|
47
|
+
preInvocationHookArgs: z.object({ invocationNum: protoInt, initialNumSteps: protoInt }).passthrough().optional(),
|
|
48
|
+
postInvocationHookArgs: z
|
|
49
|
+
.object({ invocationNum: protoInt, initialNumSteps: protoInt, modelOutput: z.string().optional(), modelThinking: z.string().optional() })
|
|
50
|
+
.passthrough()
|
|
51
|
+
.optional(),
|
|
52
|
+
stopHookArgs: z
|
|
53
|
+
.object({
|
|
54
|
+
executionNum: protoInt,
|
|
55
|
+
terminationReason: z.string().optional(),
|
|
56
|
+
error: z.unknown().optional(),
|
|
57
|
+
fullyIdle: z.boolean().optional(),
|
|
58
|
+
finalModelOutput: z.string().optional()
|
|
59
|
+
})
|
|
60
|
+
.passthrough()
|
|
61
|
+
.optional(),
|
|
62
|
+
sessionStartHookArgs: z.object({}).passthrough().optional()
|
|
63
|
+
})
|
|
64
|
+
.passthrough();
|