@kya-os/checkpoint-shared 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +1 -1
- package/dist/browser-posture-5fPrsxx7.d.mts.map +1 -1
- package/dist/browser-posture-CCR1kh5e.d.ts.map +1 -1
- package/dist/browser-posture.js +35 -4
- package/dist/browser-posture.mjs +35 -4
- package/dist/browser-posture.mjs.map +1 -1
- package/dist/deploy/index.d.mts +1 -0
- package/dist/deploy/index.d.mts.map +1 -1
- package/dist/deploy/index.d.ts +1 -0
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/index.js +9 -1
- package/dist/deploy/index.mjs +9 -1
- package/dist/deploy/index.mjs.map +1 -1
- package/dist/{fetcher-C8qvwdnA.d.ts → fetcher-CCw4Q95g.d.ts} +2 -2
- package/dist/{fetcher-C8qvwdnA.d.ts.map → fetcher-CCw4Q95g.d.ts.map} +1 -1
- package/dist/{fetcher-D2vjr7jB.d.mts → fetcher-CZfLcbRZ.d.mts} +2 -2
- package/dist/{fetcher-D2vjr7jB.d.mts.map → fetcher-CZfLcbRZ.d.mts.map} +1 -1
- package/dist/host-adapter/index.d.mts +1 -1
- package/dist/host-adapter/index.d.ts +1 -1
- package/dist/{index-DnFsmr_o.d.ts → index-Cdv_FH0H.d.ts} +2 -2
- package/dist/{index-DnFsmr_o.d.ts.map → index-Cdv_FH0H.d.ts.map} +1 -1
- package/dist/{index-rvw5Bz-r.d.mts → index-DL_dmQBY.d.mts} +2 -2
- package/dist/{index-rvw5Bz-r.d.mts.map → index-DL_dmQBY.d.mts.map} +1 -1
- package/dist/index.d.mts +68 -52
- package/dist/index.d.mts.map +1 -1
- package/dist/index.d.ts +68 -52
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -13
- package/dist/index.mjs +24 -14
- package/dist/index.mjs.map +1 -1
- package/dist/kya-http.d.mts +2 -2
- package/dist/kya-http.d.ts +2 -2
- package/dist/kya-http.js +6 -2
- package/dist/kya-http.mjs +2 -2
- package/dist/policy/fetcher.d.mts +1 -1
- package/dist/policy/fetcher.d.ts +1 -1
- package/dist/policy/schemas.d.mts +1 -1
- package/dist/policy/schemas.d.ts +1 -1
- package/dist/{registered-sid-DVGTSH0L.js → registered-sid-BZfDOfXy.js} +107 -4
- package/dist/{registered-sid-26hNxp6t.mjs → registered-sid-CS9V8nPr.mjs} +85 -6
- package/dist/registered-sid-CS9V8nPr.mjs.map +1 -0
- package/dist/{registered-sid-D6KCaT1E.d.ts → registered-sid-CnWIU_l1.d.mts} +13 -2
- package/dist/registered-sid-CnWIU_l1.d.mts.map +1 -0
- package/dist/{registered-sid-D6KCaT1E.d.mts → registered-sid-CnWIU_l1.d.ts} +13 -2
- package/dist/registered-sid-CnWIU_l1.d.ts.map +1 -0
- package/dist/{schemas-m-GqyfyO.d.mts → schemas-BhC88D1-.d.mts} +5 -5
- package/dist/{schemas-m-GqyfyO.d.mts.map → schemas-BhC88D1-.d.mts.map} +1 -1
- package/dist/{schemas-CGKHzcMV.d.ts → schemas-DZa1ouGs.d.ts} +5 -5
- package/dist/{schemas-CGKHzcMV.d.ts.map → schemas-DZa1ouGs.d.ts.map} +1 -1
- package/dist/signals/index.d.mts.map +1 -1
- package/dist/signals/index.d.ts.map +1 -1
- package/dist/signals/index.js +4 -0
- package/dist/signals/index.mjs +4 -0
- package/dist/signals/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/registered-sid-26hNxp6t.mjs.map +0 -1
- package/dist/registered-sid-D6KCaT1E.d.mts.map +0 -1
- package/dist/registered-sid-D6KCaT1E.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/deploy/index.ts"],"sourcesContent":["/**\n * Managed Agent Deployment + Compute Process Contracts (checkpoint-owned subset)\n *\n * Schemas for the managed hosting tier (agents on Fly.io) and the\n * `@kya-os/compute` ⇄ Checkpoint heartbeat/config/control protocol.\n *\n * Ported into checkpoint-shared from `@kya-os/contracts/agent-deployment` +\n * `@kya-os/contracts/compute` as part of the E6 / C-series decommission\n * (#2914 / #2917). Only the symbols re-exported by\n * `apps/web/lib/types/molti-deploy-contracts.ts` (plus their transitive deps —\n * `DidStringSchema`, the compute command sub-schemas) are ported.\n *\n * @module @kya-os/checkpoint-shared/deploy\n */\n\nimport { z } from 'zod';\n\n// ============================================================================\n// Cross-repo endpoint contract\n// ============================================================================\n\n/**\n * The KYA-OS activity-events ingest path (SPEC-EVENTS v0.1 batch endpoint).\n *\n * This is a CROSS-REPO CONTRACT. The Tier 2 worker runtime\n * (`@kya-os/mcp-i-cloudflare`) POSTs `tool.invoked` (and the other SPEC-EVENTS\n * types) to `${AGENTSHIELD_API_URL}${KYA_OS_EVENTS_PATH}`, authenticated by the\n * project API key. Checkpoint serves the batch ingest at this exact path\n * (`apps/web/app${KYA_OS_EVENTS_PATH}/route.ts`) and fans events out into the\n * `detections` table behind `/activity`.\n *\n * Managed deploy deliberately injects NO `KYA_OS_EVENTS_*` secret and relies on\n * this derivation instead, so the two sides agree only by matching this literal.\n * Changing it on either side silently drops all managed activity — it is pinned\n * by a contract test. Keep this value and the worker's derivation in sync.\n */\nexport const KYA_OS_EVENTS_PATH = '/api/v1/kya-os/events';\n\n// ============================================================================\n// Shared Schemas\n// ============================================================================\n\n/**\n * Validated DID string schema.\n * Reusable across all contract files that reference agent DIDs.\n *\n * Format: `did:<method>:<method-specific-id>`\n * - method: 1+ lowercase alphanumeric chars\n * - method-specific-id: 1+ non-whitespace chars\n *\n * Examples: `did:key:z6Mk...`, `did:web:example.com`\n */\nexport const DidStringSchema = z\n .string()\n .min(8, 'DID must be at least 8 characters')\n .regex(/^did:[a-z0-9]+:\\S+$/, 'DID must match format did:<method>:<method-specific-id>');\n\n/**\n * Fly.io deployment regions.\n * Enumerated to prevent arbitrary strings from being accepted.\n * @see https://fly.io/docs/reference/regions/\n */\nexport const FlyRegionSchema = z.enum([\n 'ams', // Amsterdam, Netherlands\n 'arn', // Stockholm, Sweden\n 'atl', // Atlanta, Georgia (US)\n 'bog', // Bogotá, Colombia\n 'bos', // Boston, Massachusetts (US)\n 'cdg', // Paris, France\n 'den', // Denver, Colorado (US)\n 'dfw', // Dallas, Texas (US)\n 'ewr', // Secaucus, NJ (US)\n 'eze', // Ezeiza, Argentina\n 'fra', // Frankfurt, Germany\n 'gdl', // Guadalajara, Mexico\n 'gig', // Rio de Janeiro, Brazil\n 'gru', // São Paulo, Brazil\n 'hkg', // Hong Kong\n 'iad', // Ashburn, Virginia (US)\n 'jnb', // Johannesburg, South Africa\n 'lax', // Los Angeles, California (US)\n 'lhr', // London, United Kingdom\n 'mad', // Madrid, Spain\n 'mia', // Miami, Florida (US)\n 'nrt', // Tokyo, Japan\n 'ord', // Chicago, Illinois (US)\n 'otp', // Bucharest, Romania\n 'phx', // Phoenix, Arizona (US)\n 'qro', // Querétaro, Mexico\n 'scl', // Santiago, Chile\n 'sea', // Seattle, Washington (US)\n 'sin', // Singapore\n 'sjc', // San Jose, California (US)\n 'syd', // Sydney, Australia\n 'waw', // Warsaw, Poland\n 'yul', // Montreal, Canada\n 'yyz', // Toronto, Canada\n]);\n\nexport type FlyRegion = z.infer<typeof FlyRegionSchema>;\n\n/**\n * Hosting mode discriminator — differentiates between deploy backends:\n * - `byok`: self-managed deploy in the customer's own Cloudflare account\n * (customer runs the deploy themselves).\n * - `managed`: platform-managed deploy in our Cloudflare account via Workers\n * for Platforms (dispatch namespace).\n * - `managed-byoa`: platform-managed deploy that lands in the customer's own\n * (\"bring your own account\") Cloudflare account via the standard Workers API,\n * after the org connects Cloudflare over OAuth/token (KYA-906-C).\n */\nexport const HostingModeSchema = z.enum(['byok', 'managed', 'managed-byoa']);\n\nexport type HostingMode = z.infer<typeof HostingModeSchema>;\n\n// ============================================================================\n// Protocol audit deployment contract\n// ============================================================================\n\nexport const AuditAssuranceProfileSchema = z.enum(['AAP-0', 'AAP-1', 'AAP-2', 'AAP-3', 'AAP-4']);\nexport const AuditDeliveryModeSchema = z.enum(['best-effort', 'buffered', 'required']);\n\n/**\n * Serializable request contract shared by the wizard and every deploy lane.\n * `requestedProfile` is intent, never an assurance claim. Only readiness\n * evaluation against observed runtime capabilities yields `effectiveProfile`.\n */\nexport const AuditDeploymentConfigSchema = z\n .object({\n enabled: z.boolean(),\n requestedProfile: AuditAssuranceProfileSchema,\n delivery: AuditDeliveryModeSchema,\n evidenceMode: z.enum(['none', 'encrypted-separate', 'encrypted-inline']),\n retentionClass: z.string().min(1).max(128),\n retentionDays: z.number().int().min(0).max(3650),\n residency: z.enum(['inherit-project', 'us', 'eu', 'global']),\n keyCustody: z.enum(['none', 'checkpoint-managed', 'customer-managed-kms']),\n recorderTopology: z.enum(['none', 'self-hosted', 'managed', 'verified-mirror']),\n })\n .strict()\n .superRefine((value, context) => {\n if (!value.enabled && value.requestedProfile !== 'AAP-0') {\n context.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['requestedProfile'],\n message: 'Disabled audit configuration must request AAP-0',\n });\n }\n if (value.enabled && value.requestedProfile === 'AAP-0') {\n context.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['requestedProfile'],\n message: 'Enabled audit configuration must request AAP-1 or higher',\n });\n }\n if (Number(value.requestedProfile.slice(-1)) >= 2 && value.delivery === 'best-effort') {\n context.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['delivery'],\n message: 'AAP-2 or higher cannot use best-effort delivery',\n });\n }\n if (!value.enabled && (value.keyCustody !== 'none' || value.recorderTopology !== 'none')) {\n context.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'Disabled audit configuration cannot claim key custody or recorder topology',\n });\n }\n });\n\nexport type AuditDeploymentConfig = z.infer<typeof AuditDeploymentConfigSchema>;\nexport type AuditAssuranceProfile = z.infer<typeof AuditAssuranceProfileSchema>;\n\n/** Applied only when a user starts a new platform-managed deployment. */\nexport const NEW_MANAGED_AUDIT_DEPLOYMENT_DEFAULT: Readonly<AuditDeploymentConfig> = Object.freeze({\n enabled: true,\n requestedProfile: 'AAP-2',\n delivery: 'buffered',\n evidenceMode: 'encrypted-separate',\n retentionClass: 'integrity-ledger',\n retentionDays: 365,\n residency: 'inherit-project',\n keyCustody: 'checkpoint-managed',\n recorderTopology: 'managed',\n});\n\n/**\n * Missing audit config in an already persisted manifest is always AAP-0.\n * This prevents a dashboard or redeploy from silently upgrading old workers.\n */\nexport const ABSENT_AUDIT_DEPLOYMENT_CONFIG: Readonly<AuditDeploymentConfig> = Object.freeze({\n enabled: false,\n requestedProfile: 'AAP-0',\n delivery: 'best-effort',\n evidenceMode: 'none',\n retentionClass: 'none',\n retentionDays: 0,\n residency: 'inherit-project',\n keyCustody: 'none',\n recorderTopology: 'none',\n});\n\nexport const AuditRuntimeCapabilitiesSchema = z\n .object({\n recorderTopology: z.enum(['none', 'self-hosted', 'managed', 'verified-mirror']),\n delivery: AuditDeliveryModeSchema,\n journalDurability: z.enum(['none', 'ephemeral', 'durable']),\n atomicAppend: z.boolean(),\n sourceHighWater: z.boolean(),\n merkleCheckpoints: z.boolean(),\n independentObservation: z.boolean(),\n supportingAnchors: z.array(z.enum(['worm', 'rfc3161', 'scitt'])),\n evidenceRetention: z.enum(['none', 'inline', 'separate']),\n })\n .strict();\n\nexport type AuditRuntimeCapabilities = z.infer<typeof AuditRuntimeCapabilitiesSchema>;\n\nexport const AuditRuntimeCanaryResultSchema = z\n .object({\n passed: z.boolean(),\n observedAt: z.number().int().nonnegative(),\n capabilities: AuditRuntimeCapabilitiesSchema,\n checks: z\n .array(\n z\n .object({\n id: z.string().min(1).max(128),\n passed: z.boolean(),\n })\n .strict()\n )\n .min(1),\n bundleHash: z.string().min(1).max(256).optional(),\n })\n .strict()\n .superRefine((value, context) => {\n if (value.passed !== value.checks.every((check) => check.passed)) {\n context.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['passed'],\n message: 'Canary result must equal the aggregate of its mechanical checks',\n });\n }\n });\n\nexport type AuditRuntimeCanaryResult = z.infer<typeof AuditRuntimeCanaryResultSchema>;\n\nexport function requiredAuditRuntimeCanaryChecks(capabilities: AuditRuntimeCapabilities): string[] {\n const checks = [\n 'recorder_round_trip',\n 'verified_receipt',\n 'idempotent_retry',\n 'event_identity_conflict',\n 'source_state',\n ];\n if (capabilities.delivery === 'buffered') checks.push('buffered_outbox');\n if (capabilities.evidenceRetention !== 'none') checks.push('evidence_write_verified');\n return checks;\n}\n\nexport const AuditDeploymentReadinessSchema = z\n .object({\n requestedProfile: AuditAssuranceProfileSchema,\n effectiveProfile: AuditAssuranceProfileSchema,\n status: z.enum(['disabled', 'ready', 'degraded']),\n capabilities: AuditRuntimeCapabilitiesSchema.nullable(),\n canary: AuditRuntimeCanaryResultSchema.nullable(),\n reasonCodes: z.array(z.string().min(1).max(128)),\n })\n .strict();\n\nexport type AuditDeploymentReadiness = z.infer<typeof AuditDeploymentReadinessSchema>;\n\nconst PROFILE_BY_LEVEL = ['AAP-0', 'AAP-1', 'AAP-2', 'AAP-3', 'AAP-4'] as const;\n\nexport function resolveAuditDeploymentReadiness(\n config: AuditDeploymentConfig | undefined,\n capabilities: AuditRuntimeCapabilities | undefined,\n canary?: AuditRuntimeCanaryResult\n): AuditDeploymentReadiness {\n const requested = AuditDeploymentConfigSchema.parse(config ?? ABSENT_AUDIT_DEPLOYMENT_CONFIG);\n const observedCanary = canary ? AuditRuntimeCanaryResultSchema.parse(canary) : null;\n if (!requested.enabled) {\n return {\n requestedProfile: 'AAP-0',\n effectiveProfile: 'AAP-0',\n status: 'disabled',\n capabilities: capabilities ?? null,\n canary: observedCanary,\n reasonCodes: ['audit_not_configured'],\n };\n }\n const observedCapabilities = capabilities ?? observedCanary?.capabilities;\n if (!observedCapabilities) {\n return {\n requestedProfile: requested.requestedProfile,\n effectiveProfile: 'AAP-0',\n status: 'degraded',\n capabilities: null,\n canary: observedCanary,\n reasonCodes: ['runtime_capabilities_unavailable'],\n };\n }\n const observed = AuditRuntimeCapabilitiesSchema.parse(observedCapabilities);\n if (!observedCanary) {\n return {\n requestedProfile: requested.requestedProfile,\n effectiveProfile: 'AAP-0',\n status: 'degraded',\n capabilities: observed,\n canary: null,\n reasonCodes: ['runtime_canary_required'],\n };\n }\n if (\n !observedCanary.passed ||\n JSON.stringify(observedCanary.capabilities) !== JSON.stringify(observed)\n ) {\n return {\n requestedProfile: requested.requestedProfile,\n effectiveProfile: 'AAP-0',\n status: 'degraded',\n capabilities: observed,\n canary: observedCanary,\n reasonCodes: [\n observedCanary.passed ? 'runtime_canary_capability_mismatch' : 'runtime_canary_failed',\n ],\n };\n }\n const passedChecks = new Set(\n observedCanary.checks.filter((check) => check.passed).map((check) => check.id)\n );\n if (requiredAuditRuntimeCanaryChecks(observed).some((check) => !passedChecks.has(check))) {\n return {\n requestedProfile: requested.requestedProfile,\n effectiveProfile: 'AAP-0',\n status: 'degraded',\n capabilities: observed,\n canary: observedCanary,\n reasonCodes: ['runtime_canary_incomplete'],\n };\n }\n let maximum = 0;\n const reasons: string[] = [];\n if (observed.recorderTopology !== requested.recorderTopology) {\n reasons.push('recorder_topology_mismatch');\n }\n const deliveryRank = { 'best-effort': 0, buffered: 1, required: 2 } as const;\n if (deliveryRank[observed.delivery] < deliveryRank[requested.delivery]) {\n reasons.push('delivery_mode_mismatch');\n }\n const expectedEvidence =\n requested.evidenceMode === 'none'\n ? 'none'\n : requested.evidenceMode === 'encrypted-inline'\n ? 'inline'\n : 'separate';\n if (expectedEvidence !== observed.evidenceRetention) {\n reasons.push('evidence_retention_mismatch');\n }\n // These are explicit deployment-contract mismatches, not merely unavailable\n // higher-assurance services. Never activate a recorder against mechanics\n // weaker than (or topologically different from) the binding it was given.\n if (reasons.length > 0) {\n return {\n requestedProfile: requested.requestedProfile,\n effectiveProfile: 'AAP-0',\n status: 'degraded',\n capabilities: observed,\n canary: observedCanary,\n reasonCodes: reasons,\n };\n }\n if (observed.recorderTopology !== 'none' && observed.journalDurability !== 'none') maximum = 1;\n else reasons.push('recorder_or_journal_unavailable');\n if (\n maximum >= 1 &&\n observed.journalDurability === 'durable' &&\n observed.atomicAppend &&\n observed.delivery !== 'best-effort'\n ) {\n maximum = 2;\n } else if (Number(requested.requestedProfile.slice(-1)) >= 2) {\n reasons.push('durable_atomic_buffered_append_unavailable');\n }\n if (maximum >= 2 && observed.merkleCheckpoints && observed.sourceHighWater) maximum = 3;\n else if (Number(requested.requestedProfile.slice(-1)) >= 3) {\n reasons.push('checkpoint_or_source_high_water_unavailable');\n }\n if (maximum >= 3 && observed.independentObservation && observed.supportingAnchors.length > 0) {\n maximum = 4;\n } else if (Number(requested.requestedProfile.slice(-1)) >= 4) {\n reasons.push('independent_observation_or_anchor_unavailable');\n }\n const requestedLevel = Number(requested.requestedProfile.slice(-1));\n const effectiveLevel = Math.min(requestedLevel, maximum);\n return {\n requestedProfile: requested.requestedProfile,\n effectiveProfile: PROFILE_BY_LEVEL[effectiveLevel]!,\n status: effectiveLevel === requestedLevel && reasons.length === 0 ? 'ready' : 'degraded',\n capabilities: observed,\n canary: observedCanary,\n reasonCodes: reasons,\n };\n}\n\n/**\n * Deploy step status — reuses same status enum as BYOK.\n */\nexport const ManagedDeployStepStatusSchema = z.enum([\n 'pending',\n 'in_progress',\n 'completed',\n 'failed',\n 'skipped',\n]);\n\nexport type ManagedDeployStepStatus = z.infer<typeof ManagedDeployStepStatusSchema>;\n\n// ============================================================================\n// Heartbeat Protocol (@kya-os/compute ⇄ AgentShield)\n// ============================================================================\n\n/**\n * Heartbeat request body.\n * Sent by compute process: POST /api/v1/molti/agents/{did}/heartbeat\n * Auth: X-Heartbeat-Token header\n */\nexport const HeartbeatRequestSchema = z.object({\n /** Agent DID this heartbeat is for */\n agentDid: DidStringSchema,\n /** Current compute process status */\n status: z.enum(['starting', 'running', 'error', 'stopping']),\n /** @kya-os/compute package version (from package.json) */\n computeVersion: z.string().min(1).max(50),\n /** Installed OpenClaw version (from npm ls) */\n openclawVersion: z.string().max(50).optional(),\n /** Fly machine ID (from FLY_MACHINE_ID env var) */\n machineId: z.string().max(255).optional(),\n /** Seconds since compute process started */\n uptimeSeconds: z.number().nonnegative().optional(),\n /** Current RSS memory in MB */\n memoryMb: z.number().nonnegative().optional(),\n});\n\nexport type HeartbeatRequest = z.infer<typeof HeartbeatRequestSchema>;\n\n// ============================================================================\n// Compute Commands (Discriminated Union)\n// ============================================================================\n\n/**\n * Stop command — graceful shutdown, no payload accepted.\n */\nexport const StopCommandSchema = z\n .object({\n type: z.literal('stop'),\n })\n .strict();\n\n/**\n * Restart command — restart the compute process, no payload accepted.\n */\nexport const RestartCommandSchema = z\n .object({\n type: z.literal('restart'),\n })\n .strict();\n\n/**\n * Update config command — triggers config re-fetch, no payload accepted.\n */\nexport const UpdateConfigCommandSchema = z\n .object({\n type: z.literal('update_config'),\n })\n .strict();\n\n/**\n * Update version command — requires target version in payload.\n */\nexport const UpdateVersionCommandSchema = z\n .object({\n type: z.literal('update_version'),\n payload: z.object({\n /** Target OpenClaw version to install */\n version: z.string().min(1).max(50),\n }),\n })\n .strict();\n\n/**\n * Command that Agent Shield can send to the compute process\n * via the heartbeat response.\n *\n * Discriminated union by `type` field:\n * - `stop` / `restart` / `update_config` — no payload\n * - `update_version` — requires `{ version: string }` payload\n */\nexport const ComputeCommandSchema = z.discriminatedUnion('type', [\n StopCommandSchema,\n RestartCommandSchema,\n UpdateConfigCommandSchema,\n UpdateVersionCommandSchema,\n]);\n\nexport type ComputeCommand = z.infer<typeof ComputeCommandSchema>;\n\n/**\n * Heartbeat response from Agent Shield.\n * Returned by: POST /api/v1/molti/agents/{did}/heartbeat\n */\nexport const HeartbeatResponseSchema = z.object({\n /** Always true for successful heartbeats */\n ack: z.literal(true),\n /** Pending commands for the compute process to execute */\n commands: z.array(ComputeCommandSchema).default([]),\n /** ISO timestamp of last config change (compute compares to detect updates) */\n configUpdatedAt: z.string().datetime().optional(),\n});\n\nexport type HeartbeatResponse = z.infer<typeof HeartbeatResponseSchema>;\n\n// ============================================================================\n// Config Bundle\n// ============================================================================\n\n/**\n * Config bundle returned by Agent Shield to the compute process.\n * Fetched on boot: GET /api/v1/molti/deployments/{did}/config-bundle\n * Auth: X-Heartbeat-Token header (for managed) or X-API-Key (for BYOK)\n *\n * **Private Key Delivery**: The agent's private key is NOT included in the config bundle.\n * It is delivered as the `AGENT_PRIVATE_KEY` environment variable at Fly machine creation\n * time and persists in the machine's env. This avoids transmitting the key on every\n * config fetch and keeps it out of the config-bundle response surface.\n */\nexport const ConfigBundleSchema = z.object({\n /** Schema version — 2 for managed bundles */\n version: z.number().int().positive(),\n /** Kill switch — if true, compute must exit immediately */\n killed: z.boolean(),\n /** Target OpenClaw version to install */\n openclawVersion: z.string().min(1).max(50),\n /** Agent personality/system prompt file contents (max 100KB) */\n soulFile: z.string().max(100_000).nullable(),\n /** Gateway auth token for OpenClaw */\n gatewayToken: z.string().min(1).max(500),\n /** Channel configurations */\n channels: z.object({\n telegram: z\n .object({\n enabled: z.boolean(),\n token: z.string().optional(),\n })\n .optional(),\n discord: z\n .object({\n enabled: z.boolean(),\n token: z.string().optional(),\n })\n .optional(),\n slack: z\n .object({\n enabled: z.boolean(),\n token: z.string().optional(),\n appToken: z.string().optional(),\n })\n .optional(),\n whatsapp: z\n .object({\n enabled: z.boolean(),\n })\n .strict()\n .optional(),\n }),\n /** AI provider configuration — key is decrypted, sent over TLS */\n aiProvider: z.object({\n type: z.enum(['anthropic', 'openai']),\n apiKey: z.string().min(1).max(500),\n /**\n * Optional base URL override. When set, OpenClaw routes all provider\n * traffic through this URL instead of the provider's default endpoint.\n * Used by managed deployments where AgentShield issues a per-deployment\n * gateway token and proxies to the upstream provider with budget tracking.\n */\n baseUrl: z.string().url().optional(),\n }),\n /**\n * Optional OpenClaw heartbeat interval (`agents.defaults.heartbeat.every`).\n * Drives how often OpenClaw wakes the agent for HEARTBEAT.md processing —\n * the primary token-cost lever. Examples: \"30m\" (active), \"6h\" (idle),\n * \"off\" (dormant — heartbeat disabled entirely). When absent, the patcher\n * preserves whatever value already lives in openclaw.json (OpenClaw's\n * built-in default of \"30m\").\n */\n heartbeatEvery: z.string().min(1).max(20).optional(),\n /**\n * Optional override for `agents.defaults.model.primary` (e.g.\n * \"anthropic/claude-haiku-4-5\" for idle agents). When absent, the patcher\n * derives the model from `aiProvider.type` as before. Format must be\n * \"<provider>/<model-id>\".\n */\n modelOverride: z.string().min(1).max(100).optional(),\n /** ISO timestamp of last config modification */\n updatedAt: z.string().datetime(),\n});\n\nexport type ConfigBundle = z.infer<typeof ConfigBundleSchema>;\n\n// ============================================================================\n// Control Server (WebSocket :18790)\n// ============================================================================\n\n/**\n * Status frame pushed from compute control server to dashboard.\n * Sent on connect + every 5 seconds.\n */\nexport const ControlStatusSchema = z.object({\n /** Whether the agent runtime is healthy */\n healthy: z.boolean(),\n /** Seconds since compute process started */\n uptimeSeconds: z.number().nonnegative(),\n /** Installed OpenClaw version */\n openclawVersion: z.string().min(1).max(50),\n /** @kya-os/compute version */\n computeVersion: z.string().min(1).max(50),\n /** Number of active WS connections to control server */\n activeConnections: z.number().int().nonnegative(),\n /** Current RSS memory in MB */\n memoryMb: z.number().nonnegative(),\n /** CPU usage percentage (0-100) */\n cpuPercent: z.number().nonnegative().max(100),\n});\n\nexport type ControlStatus = z.infer<typeof ControlStatusSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,qBAAqB;;;;;;;;;;;AAgBlC,MAAa,kBAAkB,EAC5B,OAAO,CAAC,CACR,IAAI,GAAG,mCAAmC,CAAC,CAC3C,MAAM,uBAAuB,yDAAyD;;;;;;AAOzF,MAAa,kBAAkB,EAAE,KAAK;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;;;;;AAcD,MAAa,oBAAoB,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C,IAAI,EAAE;;CAExC,mBAAmB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY;;CAEhD,UAAU,EAAE,OAAO,CAAC,CAAC,YAAY;;CAEjC,YAAY,EAAE,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,GAAG;AAC9C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/deploy/index.ts"],"sourcesContent":["/**\n * Managed Agent Deployment + Compute Process Contracts (checkpoint-owned subset)\n *\n * Schemas for the managed hosting tier (agents on Fly.io) and the\n * `@kya-os/compute` ⇄ Checkpoint heartbeat/config/control protocol.\n *\n * Ported into checkpoint-shared from `@kya-os/contracts/agent-deployment` +\n * `@kya-os/contracts/compute` as part of the E6 / C-series decommission\n * (#2914 / #2917). Only the symbols re-exported by\n * `apps/web/lib/types/molti-deploy-contracts.ts` (plus their transitive deps —\n * `DidStringSchema`, the compute command sub-schemas) are ported.\n *\n * @module @kya-os/checkpoint-shared/deploy\n */\n\nimport { z } from 'zod';\n\n// ============================================================================\n// Cross-repo endpoint contract\n// ============================================================================\n\n/**\n * The KYA-OS activity-events ingest path (SPEC-EVENTS v0.1 batch endpoint).\n *\n * This is a CROSS-REPO CONTRACT. The Tier 2 worker runtime\n * (`@kya-os/mcp-i-cloudflare`) POSTs `tool.invoked` (and the other SPEC-EVENTS\n * types) to `${AGENTSHIELD_API_URL}${KYA_OS_EVENTS_PATH}`, authenticated by the\n * project API key. Checkpoint serves the batch ingest at this exact path\n * (`apps/web/app${KYA_OS_EVENTS_PATH}/route.ts`) and fans events out into the\n * `detections` table behind `/activity`.\n *\n * Managed deploy deliberately injects NO `KYA_OS_EVENTS_*` secret and relies on\n * this derivation instead, so the two sides agree only by matching this literal.\n * Changing it on either side silently drops all managed activity — it is pinned\n * by a contract test. Keep this value and the worker's derivation in sync.\n */\nexport const KYA_OS_EVENTS_PATH = '/api/v1/kya-os/events';\n\n// ============================================================================\n// Shared Schemas\n// ============================================================================\n\n/**\n * Validated DID string schema.\n * Reusable across all contract files that reference agent DIDs.\n *\n * Format: `did:<method>:<method-specific-id>`\n * - method: 1+ lowercase alphanumeric chars\n * - method-specific-id: 1+ non-whitespace chars\n *\n * Examples: `did:key:z6Mk...`, `did:web:example.com`\n */\nexport const DidStringSchema = z\n .string()\n .min(8, 'DID must be at least 8 characters')\n .regex(/^did:[a-z0-9]+:\\S+$/, 'DID must match format did:<method>:<method-specific-id>');\n\n/**\n * Fly.io deployment regions.\n * Enumerated to prevent arbitrary strings from being accepted.\n * @see https://fly.io/docs/reference/regions/\n */\nexport const FlyRegionSchema = z.enum([\n 'ams', // Amsterdam, Netherlands\n 'arn', // Stockholm, Sweden\n 'atl', // Atlanta, Georgia (US)\n 'bog', // Bogotá, Colombia\n 'bos', // Boston, Massachusetts (US)\n 'cdg', // Paris, France\n 'den', // Denver, Colorado (US)\n 'dfw', // Dallas, Texas (US)\n 'ewr', // Secaucus, NJ (US)\n 'eze', // Ezeiza, Argentina\n 'fra', // Frankfurt, Germany\n 'gdl', // Guadalajara, Mexico\n 'gig', // Rio de Janeiro, Brazil\n 'gru', // São Paulo, Brazil\n 'hkg', // Hong Kong\n 'iad', // Ashburn, Virginia (US)\n 'jnb', // Johannesburg, South Africa\n 'lax', // Los Angeles, California (US)\n 'lhr', // London, United Kingdom\n 'mad', // Madrid, Spain\n 'mia', // Miami, Florida (US)\n 'nrt', // Tokyo, Japan\n 'ord', // Chicago, Illinois (US)\n 'otp', // Bucharest, Romania\n 'phx', // Phoenix, Arizona (US)\n 'qro', // Querétaro, Mexico\n 'scl', // Santiago, Chile\n 'sea', // Seattle, Washington (US)\n 'sin', // Singapore\n 'sjc', // San Jose, California (US)\n 'syd', // Sydney, Australia\n 'waw', // Warsaw, Poland\n 'yul', // Montreal, Canada\n 'yyz', // Toronto, Canada\n]);\n\nexport type FlyRegion = z.infer<typeof FlyRegionSchema>;\n\n/**\n * Hosting mode discriminator — differentiates between deploy backends:\n * - `byok`: self-managed deploy in the customer's own Cloudflare account\n * (customer runs the deploy themselves).\n * - `managed`: platform-managed deploy in our Cloudflare account via Workers\n * for Platforms (dispatch namespace).\n * - `managed-byoa`: platform-managed deploy that lands in the customer's own\n * (\"bring your own account\") Cloudflare account via the standard Workers API,\n * after the org connects Cloudflare over OAuth/token (KYA-906-C).\n */\nexport const HostingModeSchema = z.enum(['byok', 'managed', 'managed-byoa']);\n\nexport type HostingMode = z.infer<typeof HostingModeSchema>;\n\n// ============================================================================\n// Protocol audit deployment contract\n// ============================================================================\n\nexport const AuditAssuranceProfileSchema = z.enum(['AAP-0', 'AAP-1', 'AAP-2', 'AAP-3', 'AAP-4']);\nexport const AuditDeliveryModeSchema = z.enum(['best-effort', 'buffered', 'required']);\n\n/**\n * Serializable request contract shared by the wizard and every deploy lane.\n * `requestedProfile` is intent, never an assurance claim. Only readiness\n * evaluation against observed runtime capabilities yields `effectiveProfile`.\n */\nexport const AuditDeploymentConfigSchema = z\n .object({\n enabled: z.boolean(),\n requestedProfile: AuditAssuranceProfileSchema,\n delivery: AuditDeliveryModeSchema,\n evidenceMode: z.enum(['none', 'encrypted-separate', 'encrypted-inline']),\n retentionClass: z.string().min(1).max(128),\n retentionDays: z.number().int().min(0).max(3650),\n residency: z.enum(['inherit-project', 'us', 'eu', 'global']),\n keyCustody: z.enum(['none', 'checkpoint-managed', 'customer-managed-kms']),\n recorderTopology: z.enum(['none', 'self-hosted', 'managed', 'verified-mirror']),\n })\n .strict()\n .superRefine((value, context) => {\n if (!value.enabled && value.requestedProfile !== 'AAP-0') {\n context.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['requestedProfile'],\n message: 'Disabled audit configuration must request AAP-0',\n });\n }\n if (value.enabled && value.requestedProfile === 'AAP-0') {\n context.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['requestedProfile'],\n message: 'Enabled audit configuration must request AAP-1 or higher',\n });\n }\n if (Number(value.requestedProfile.slice(-1)) >= 2 && value.delivery === 'best-effort') {\n context.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['delivery'],\n message: 'AAP-2 or higher cannot use best-effort delivery',\n });\n }\n if (!value.enabled && (value.keyCustody !== 'none' || value.recorderTopology !== 'none')) {\n context.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'Disabled audit configuration cannot claim key custody or recorder topology',\n });\n }\n });\n\nexport type AuditDeploymentConfig = z.infer<typeof AuditDeploymentConfigSchema>;\nexport type AuditAssuranceProfile = z.infer<typeof AuditAssuranceProfileSchema>;\n\n/** Applied only when a user starts a new platform-managed deployment. */\nexport const NEW_MANAGED_AUDIT_DEPLOYMENT_DEFAULT: Readonly<AuditDeploymentConfig> = Object.freeze({\n enabled: true,\n requestedProfile: 'AAP-2',\n delivery: 'buffered',\n evidenceMode: 'encrypted-separate',\n retentionClass: 'integrity-ledger',\n retentionDays: 365,\n residency: 'inherit-project',\n keyCustody: 'checkpoint-managed',\n recorderTopology: 'managed',\n});\n\n/**\n * Missing audit config in an already persisted manifest is always AAP-0.\n * This prevents a dashboard or redeploy from silently upgrading old workers.\n */\nexport const ABSENT_AUDIT_DEPLOYMENT_CONFIG: Readonly<AuditDeploymentConfig> = Object.freeze({\n enabled: false,\n requestedProfile: 'AAP-0',\n delivery: 'best-effort',\n evidenceMode: 'none',\n retentionClass: 'none',\n retentionDays: 0,\n residency: 'inherit-project',\n keyCustody: 'none',\n recorderTopology: 'none',\n});\n\nexport const AuditRuntimeCapabilitiesSchema = z\n .object({\n recorderTopology: z.enum(['none', 'self-hosted', 'managed', 'verified-mirror']),\n delivery: AuditDeliveryModeSchema,\n journalDurability: z.enum(['none', 'ephemeral', 'durable']),\n atomicAppend: z.boolean(),\n sourceHighWater: z.boolean(),\n merkleCheckpoints: z.boolean(),\n independentObservation: z.boolean(),\n supportingAnchors: z.array(z.enum(['worm', 'rfc3161', 'scitt'])),\n evidenceRetention: z.enum(['none', 'inline', 'separate']),\n })\n .strict();\n\nexport type AuditRuntimeCapabilities = z.infer<typeof AuditRuntimeCapabilitiesSchema>;\n\nexport const AuditRuntimeCanaryResultSchema = z\n .object({\n passed: z.boolean(),\n observedAt: z.number().int().nonnegative(),\n capabilities: AuditRuntimeCapabilitiesSchema,\n checks: z\n .array(\n z\n .object({\n id: z.string().min(1).max(128),\n passed: z.boolean(),\n })\n .strict()\n )\n .min(1),\n bundleHash: z.string().min(1).max(256).optional(),\n })\n .strict()\n .superRefine((value, context) => {\n if (value.passed !== value.checks.every((check) => check.passed)) {\n context.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['passed'],\n message: 'Canary result must equal the aggregate of its mechanical checks',\n });\n }\n });\n\nexport type AuditRuntimeCanaryResult = z.infer<typeof AuditRuntimeCanaryResultSchema>;\n\nexport function requiredAuditRuntimeCanaryChecks(capabilities: AuditRuntimeCapabilities): string[] {\n const checks = [\n 'recorder_round_trip',\n 'verified_receipt',\n 'idempotent_retry',\n 'event_identity_conflict',\n 'source_state',\n ];\n if (capabilities.delivery === 'buffered') checks.push('buffered_outbox');\n if (capabilities.evidenceRetention !== 'none') checks.push('evidence_write_verified');\n return checks;\n}\n\nexport const AuditDeploymentReadinessSchema = z\n .object({\n requestedProfile: AuditAssuranceProfileSchema,\n effectiveProfile: AuditAssuranceProfileSchema,\n status: z.enum(['disabled', 'ready', 'degraded']),\n capabilities: AuditRuntimeCapabilitiesSchema.nullable(),\n canary: AuditRuntimeCanaryResultSchema.nullable(),\n reasonCodes: z.array(z.string().min(1).max(128)),\n })\n .strict();\n\nexport type AuditDeploymentReadiness = z.infer<typeof AuditDeploymentReadinessSchema>;\n\nconst PROFILE_BY_LEVEL = ['AAP-0', 'AAP-1', 'AAP-2', 'AAP-3', 'AAP-4'] as const;\n\nexport function resolveAuditDeploymentReadiness(\n config: AuditDeploymentConfig | undefined,\n capabilities: AuditRuntimeCapabilities | undefined,\n canary?: AuditRuntimeCanaryResult\n): AuditDeploymentReadiness {\n const requested = AuditDeploymentConfigSchema.parse(config ?? ABSENT_AUDIT_DEPLOYMENT_CONFIG);\n const observedCanary = canary ? AuditRuntimeCanaryResultSchema.parse(canary) : null;\n if (!requested.enabled) {\n return {\n requestedProfile: 'AAP-0',\n effectiveProfile: 'AAP-0',\n status: 'disabled',\n capabilities: capabilities ?? null,\n canary: observedCanary,\n reasonCodes: ['audit_not_configured'],\n };\n }\n const observedCapabilities = capabilities ?? observedCanary?.capabilities;\n if (!observedCapabilities) {\n return {\n requestedProfile: requested.requestedProfile,\n effectiveProfile: 'AAP-0',\n status: 'degraded',\n capabilities: null,\n canary: observedCanary,\n reasonCodes: ['runtime_capabilities_unavailable'],\n };\n }\n const observed = AuditRuntimeCapabilitiesSchema.parse(observedCapabilities);\n if (!observedCanary) {\n return {\n requestedProfile: requested.requestedProfile,\n effectiveProfile: 'AAP-0',\n status: 'degraded',\n capabilities: observed,\n canary: null,\n reasonCodes: ['runtime_canary_required'],\n };\n }\n if (\n !observedCanary.passed ||\n JSON.stringify(observedCanary.capabilities) !== JSON.stringify(observed)\n ) {\n return {\n requestedProfile: requested.requestedProfile,\n effectiveProfile: 'AAP-0',\n status: 'degraded',\n capabilities: observed,\n canary: observedCanary,\n reasonCodes: [\n observedCanary.passed ? 'runtime_canary_capability_mismatch' : 'runtime_canary_failed',\n ],\n };\n }\n const passedChecks = new Set(\n observedCanary.checks.filter((check) => check.passed).map((check) => check.id)\n );\n if (requiredAuditRuntimeCanaryChecks(observed).some((check) => !passedChecks.has(check))) {\n return {\n requestedProfile: requested.requestedProfile,\n effectiveProfile: 'AAP-0',\n status: 'degraded',\n capabilities: observed,\n canary: observedCanary,\n reasonCodes: ['runtime_canary_incomplete'],\n };\n }\n let maximum = 0;\n const reasons: string[] = [];\n if (observed.recorderTopology !== requested.recorderTopology) {\n reasons.push('recorder_topology_mismatch');\n }\n const deliveryRank = { 'best-effort': 0, buffered: 1, required: 2 } as const;\n if (deliveryRank[observed.delivery] < deliveryRank[requested.delivery]) {\n reasons.push('delivery_mode_mismatch');\n }\n const expectedEvidence =\n requested.evidenceMode === 'none'\n ? 'none'\n : requested.evidenceMode === 'encrypted-inline'\n ? 'inline'\n : 'separate';\n if (expectedEvidence !== observed.evidenceRetention) {\n reasons.push('evidence_retention_mismatch');\n }\n // These are explicit deployment-contract mismatches, not merely unavailable\n // higher-assurance services. Never activate a recorder against mechanics\n // weaker than (or topologically different from) the binding it was given.\n if (reasons.length > 0) {\n return {\n requestedProfile: requested.requestedProfile,\n effectiveProfile: 'AAP-0',\n status: 'degraded',\n capabilities: observed,\n canary: observedCanary,\n reasonCodes: reasons,\n };\n }\n if (observed.recorderTopology !== 'none' && observed.journalDurability !== 'none') maximum = 1;\n else reasons.push('recorder_or_journal_unavailable');\n if (\n maximum >= 1 &&\n observed.journalDurability === 'durable' &&\n observed.atomicAppend &&\n observed.delivery !== 'best-effort'\n ) {\n maximum = 2;\n } else if (Number(requested.requestedProfile.slice(-1)) >= 2) {\n reasons.push('durable_atomic_buffered_append_unavailable');\n }\n if (maximum >= 2 && observed.merkleCheckpoints && observed.sourceHighWater) maximum = 3;\n else if (Number(requested.requestedProfile.slice(-1)) >= 3) {\n reasons.push('checkpoint_or_source_high_water_unavailable');\n }\n if (maximum >= 3 && observed.independentObservation && observed.supportingAnchors.length > 0) {\n maximum = 4;\n } else if (Number(requested.requestedProfile.slice(-1)) >= 4) {\n reasons.push('independent_observation_or_anchor_unavailable');\n }\n const requestedLevel = Number(requested.requestedProfile.slice(-1));\n const effectiveLevel = Math.min(requestedLevel, maximum);\n return {\n requestedProfile: requested.requestedProfile,\n effectiveProfile: PROFILE_BY_LEVEL[effectiveLevel]!,\n status: effectiveLevel === requestedLevel && reasons.length === 0 ? 'ready' : 'degraded',\n capabilities: observed,\n canary: observedCanary,\n reasonCodes: reasons,\n };\n}\n\n/**\n * Deploy step status — reuses same status enum as BYOK.\n */\nexport const ManagedDeployStepStatusSchema = z.enum([\n 'pending',\n 'in_progress',\n 'completed',\n 'failed',\n 'skipped',\n]);\n\nexport type ManagedDeployStepStatus = z.infer<typeof ManagedDeployStepStatusSchema>;\n\n// ============================================================================\n// Heartbeat Protocol (@kya-os/compute ⇄ AgentShield)\n// ============================================================================\n\n/**\n * Heartbeat request body.\n * Sent by compute process: POST /api/v1/molti/agents/{did}/heartbeat\n * Auth: X-Heartbeat-Token header\n */\nexport const HeartbeatRequestSchema = z.object({\n /** Agent DID this heartbeat is for */\n agentDid: DidStringSchema,\n /** Current compute process status */\n status: z.enum(['starting', 'running', 'error', 'stopping']),\n /** @kya-os/compute package version (from package.json) */\n computeVersion: z.string().min(1).max(50),\n /** Installed OpenClaw version (from npm ls) */\n openclawVersion: z.string().max(50).optional(),\n /** Fly machine ID (from FLY_MACHINE_ID env var) */\n machineId: z.string().max(255).optional(),\n /** Seconds since compute process started */\n uptimeSeconds: z.number().nonnegative().optional(),\n /** Current RSS memory in MB */\n memoryMb: z.number().nonnegative().optional(),\n /**\n * ISO 8601 time (UTC, or with an offset) of the agent's last real user or channel message: the\n * newest `lastInteractionAt` across its OpenClaw session stores. Omitted while no session has\n * one. Checkpoint records it as user activity for the agent's tier. A value that isn't such a\n * time parses as absent instead of failing the heartbeat, which also carries `stop` and\n * `update_config`.\n */\n lastUserActivityAt: z.string().datetime({ offset: true }).optional().catch(undefined),\n});\n\nexport type HeartbeatRequest = z.infer<typeof HeartbeatRequestSchema>;\n\n// ============================================================================\n// Compute Commands (Discriminated Union)\n// ============================================================================\n\n/**\n * Stop command — graceful shutdown, no payload accepted.\n */\nexport const StopCommandSchema = z\n .object({\n type: z.literal('stop'),\n })\n .strict();\n\n/**\n * Restart command — restart the compute process, no payload accepted.\n */\nexport const RestartCommandSchema = z\n .object({\n type: z.literal('restart'),\n })\n .strict();\n\n/**\n * Update config command — triggers config re-fetch, no payload accepted.\n */\nexport const UpdateConfigCommandSchema = z\n .object({\n type: z.literal('update_config'),\n })\n .strict();\n\n/**\n * Update version command — requires target version in payload.\n */\nexport const UpdateVersionCommandSchema = z\n .object({\n type: z.literal('update_version'),\n payload: z.object({\n /** Target OpenClaw version to install */\n version: z.string().min(1).max(50),\n }),\n })\n .strict();\n\n/**\n * Command that Agent Shield can send to the compute process\n * via the heartbeat response.\n *\n * Discriminated union by `type` field:\n * - `stop` / `restart` / `update_config` — no payload\n * - `update_version` — requires `{ version: string }` payload\n */\nexport const ComputeCommandSchema = z.discriminatedUnion('type', [\n StopCommandSchema,\n RestartCommandSchema,\n UpdateConfigCommandSchema,\n UpdateVersionCommandSchema,\n]);\n\nexport type ComputeCommand = z.infer<typeof ComputeCommandSchema>;\n\n/**\n * Heartbeat response from Agent Shield.\n * Returned by: POST /api/v1/molti/agents/{did}/heartbeat\n */\nexport const HeartbeatResponseSchema = z.object({\n /** Always true for successful heartbeats */\n ack: z.literal(true),\n /** Pending commands for the compute process to execute */\n commands: z.array(ComputeCommandSchema).default([]),\n /** ISO timestamp of last config change (compute compares to detect updates) */\n configUpdatedAt: z.string().datetime().optional(),\n});\n\nexport type HeartbeatResponse = z.infer<typeof HeartbeatResponseSchema>;\n\n// ============================================================================\n// Config Bundle\n// ============================================================================\n\n/**\n * Config bundle returned by Agent Shield to the compute process.\n * Fetched on boot: GET /api/v1/molti/deployments/{did}/config-bundle\n * Auth: X-Heartbeat-Token header (for managed) or X-API-Key (for BYOK)\n *\n * **Private Key Delivery**: The agent's private key is NOT included in the config bundle.\n * It is delivered as the `AGENT_PRIVATE_KEY` environment variable at Fly machine creation\n * time and persists in the machine's env. This avoids transmitting the key on every\n * config fetch and keeps it out of the config-bundle response surface.\n */\nexport const ConfigBundleSchema = z.object({\n /** Schema version — 2 for managed bundles */\n version: z.number().int().positive(),\n /** Kill switch — if true, compute must exit immediately */\n killed: z.boolean(),\n /** Target OpenClaw version to install */\n openclawVersion: z.string().min(1).max(50),\n /** Agent personality/system prompt file contents (max 100KB) */\n soulFile: z.string().max(100_000).nullable(),\n /** Gateway auth token for OpenClaw */\n gatewayToken: z.string().min(1).max(500),\n /** Channel configurations */\n channels: z.object({\n telegram: z\n .object({\n enabled: z.boolean(),\n token: z.string().optional(),\n })\n .optional(),\n discord: z\n .object({\n enabled: z.boolean(),\n token: z.string().optional(),\n })\n .optional(),\n slack: z\n .object({\n enabled: z.boolean(),\n token: z.string().optional(),\n appToken: z.string().optional(),\n })\n .optional(),\n whatsapp: z\n .object({\n enabled: z.boolean(),\n })\n .strict()\n .optional(),\n }),\n /** AI provider configuration — key is decrypted, sent over TLS */\n aiProvider: z.object({\n type: z.enum(['anthropic', 'openai']),\n apiKey: z.string().min(1).max(500),\n /**\n * Optional base URL override. When set, OpenClaw routes all provider\n * traffic through this URL instead of the provider's default endpoint.\n * Used by managed deployments where AgentShield issues a per-deployment\n * gateway token and proxies to the upstream provider with budget tracking.\n */\n baseUrl: z.string().url().optional(),\n }),\n /**\n * Optional OpenClaw heartbeat interval (`agents.defaults.heartbeat.every`).\n * Drives how often OpenClaw wakes the agent for HEARTBEAT.md processing —\n * the primary token-cost lever. Examples: \"30m\" (active), \"6h\" (idle),\n * \"off\" (dormant — heartbeat disabled entirely). When absent, the patcher\n * preserves whatever value already lives in openclaw.json (OpenClaw's\n * built-in default of \"30m\").\n */\n heartbeatEvery: z.string().min(1).max(20).optional(),\n /**\n * Optional override for `agents.defaults.model.primary` (e.g.\n * \"anthropic/claude-haiku-4-5\" for idle agents). When absent, the patcher\n * derives the model from `aiProvider.type` as before. Format must be\n * \"<provider>/<model-id>\".\n */\n modelOverride: z.string().min(1).max(100).optional(),\n /** ISO timestamp of last config modification */\n updatedAt: z.string().datetime(),\n});\n\nexport type ConfigBundle = z.infer<typeof ConfigBundleSchema>;\n\n// ============================================================================\n// Control Server (WebSocket :18790)\n// ============================================================================\n\n/**\n * Status frame pushed from compute control server to dashboard.\n * Sent on connect + every 5 seconds.\n */\nexport const ControlStatusSchema = z.object({\n /** Whether the agent runtime is healthy */\n healthy: z.boolean(),\n /** Seconds since compute process started */\n uptimeSeconds: z.number().nonnegative(),\n /** Installed OpenClaw version */\n openclawVersion: z.string().min(1).max(50),\n /** @kya-os/compute version */\n computeVersion: z.string().min(1).max(50),\n /** Number of active WS connections to control server */\n activeConnections: z.number().int().nonnegative(),\n /** Current RSS memory in MB */\n memoryMb: z.number().nonnegative(),\n /** CPU usage percentage (0-100) */\n cpuPercent: z.number().nonnegative().max(100),\n});\n\nexport type ControlStatus = z.infer<typeof ControlStatusSchema>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,qBAAqB;;;;;;;;;;;AAgBlC,MAAa,kBAAkB,EAC5B,OAAO,CAAC,CACR,IAAI,GAAG,mCAAmC,CAAC,CAC3C,MAAM,uBAAuB,yDAAyD;;;;;;AAOzF,MAAa,kBAAkB,EAAE,KAAK;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;;;;;AAcD,MAAa,oBAAoB,EAAE,KAAK;CAAC;CAAQ;CAAW;AAAc,CAAC;AAQ3E,MAAa,8BAA8B,EAAE,KAAK;CAAC;CAAS;CAAS;CAAS;CAAS;AAAO,CAAC;AAC/F,MAAa,0BAA0B,EAAE,KAAK;CAAC;CAAe;CAAY;AAAU,CAAC;;;;;;AAOrF,MAAa,8BAA8B,EACxC,OAAO;CACN,SAAS,EAAE,QAAQ;CACnB,kBAAkB;CAClB,UAAU;CACV,cAAc,EAAE,KAAK;EAAC;EAAQ;EAAsB;CAAkB,CAAC;CACvE,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;CACzC,eAAe,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI;CAC/C,WAAW,EAAE,KAAK;EAAC;EAAmB;EAAM;EAAM;CAAQ,CAAC;CAC3D,YAAY,EAAE,KAAK;EAAC;EAAQ;EAAsB;CAAsB,CAAC;CACzE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AED,YAAY,EAAE,OAAO;EACnB,MAAM,EAAE,KAAK,CAAC,aAAa,QAAQ,CAAC;EACpC,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG;;;;;;;EAOjC,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;CACrC,CAAC;;;;;;;;;CASD,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,SAAS;;;;;;;CAOnD,eAAe,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS;;CAEnD,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;AACjC,CAAC;;;;;AAYD,MAAa,sBAAsB,EAAE,OAAO;;CAE1C,SAAS,EAAE,QAAQ;;CAEnB,eAAe,EAAE,OAAO,CAAC,CAAC,YAAY;;CAEtC,iBAAiB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;;CAEzC,gBAAgB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;;CAExC,mBAAmB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY;;CAEhD,UAAU,EAAE,OAAO,CAAC,CAAC,YAAY;;CAEjC,YAAY,EAAE,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,GAAG;AAC9C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as PolicyConfig } from "./schemas-
|
|
1
|
+
import { D as PolicyConfig } from "./schemas-DZa1ouGs.js";
|
|
2
2
|
//#region src/policy/fetcher.d.ts
|
|
3
3
|
interface PolicyCacheAdapter {
|
|
4
4
|
get(key: string): Promise<string | null>;
|
|
@@ -41,4 +41,4 @@ declare class PolicyFetcher {
|
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
43
|
export { PolicyUnavailableError as a, PolicyFetcherConfig as i, PolicyCacheAdapter as n, isPolicyUnavailableError as o, PolicyFetcher as r, CachedPolicy as t };
|
|
44
|
-
//# sourceMappingURL=fetcher-
|
|
44
|
+
//# sourceMappingURL=fetcher-CCw4Q95g.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetcher-
|
|
1
|
+
{"version":3,"file":"fetcher-CCw4Q95g.d.ts","names":[],"sources":["../src/policy/fetcher.ts"],"mappings":";;UA0BiB;EACf,IAAI,cAAc;EAClB,IAAI,aAAa,eAAe,qBAAqB;EAErD,QAAQ,cAAc;;UAMP;EAEf;EAEA;EAEA;EAEA,eAAe;EAEf;EAEA;EAEA;EAEA,iBAAiB;;UAMF;EACf,QAAQ;EACR;EACA;EACA;;cA0BW,+BAA+B;WACjC;;;iBASK,yBAAyB;cAoE5B;UACH;UAIA;EAEI,YAAA,QAAQ;UAkBZ;UAWA;EAQF,UAAU,oBAAoB,QAAQ;UAuE9B;EA4Cd,oBAAoB;EAQd,gBAAgB,oBAAoB;EA0B1C;UASQ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as PolicyConfig } from "./schemas-
|
|
1
|
+
import { D as PolicyConfig } from "./schemas-BhC88D1-.mjs";
|
|
2
2
|
//#region src/policy/fetcher.d.ts
|
|
3
3
|
interface PolicyCacheAdapter {
|
|
4
4
|
get(key: string): Promise<string | null>;
|
|
@@ -41,4 +41,4 @@ declare class PolicyFetcher {
|
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
43
|
export { PolicyUnavailableError as a, PolicyFetcherConfig as i, PolicyCacheAdapter as n, isPolicyUnavailableError as o, PolicyFetcher as r, CachedPolicy as t };
|
|
44
|
-
//# sourceMappingURL=fetcher-
|
|
44
|
+
//# sourceMappingURL=fetcher-CZfLcbRZ.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetcher-
|
|
1
|
+
{"version":3,"file":"fetcher-CZfLcbRZ.d.mts","names":[],"sources":["../src/policy/fetcher.ts"],"mappings":";;UA0BiB;EACf,IAAI,cAAc;EAClB,IAAI,aAAa,eAAe,qBAAqB;EAErD,QAAQ,cAAc;;UAMP;EAEf;EAEA;EAEA;EAEA,eAAe;EAEf;EAEA;EAEA;EAEA,iBAAiB;;UAMF;EACf,QAAQ;EACR;EACA;EACA;;cA0BW,+BAA+B;WACjC;;;iBASK,yBAAyB;cAoE5B;UACH;UAIA;EAEI,YAAA,QAAQ;UAkBZ;UAWA;EAQF,UAAU,oBAAoB,QAAQ;UAuE9B;EA4Cd,oBAAoB;EAQd,gBAAgB,oBAAoB;EA0B1C;UASQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as ACCEPT_CHALLENGE_HEADER, B as VERDICT_COOKIE_NAME, C as buildDelegationBearerHeader, D as buildDelegationInstructions, E as buildDelegationChallengeHeader, F as BLOCKED_PATH, H as deriveVerdict, I as ResponseShape, L as classifyResponseShape, M as FetcherHeaderInput, N as selectBodyReadable200, O as deriveDelegationPickupUri, P as serveBodyReadable200, R as acceptsHtml, S as buildChallengeWire, T as buildDelegationChallengeEnvelope, U as encodeVerdictCookie, V as Verdict, _ as DelegationChallengeBody, a as ResolveBotSignalsInput, b as DelegationChallengeWireInput, c as ChallengeContextFailureEvent, d as resolveChallengeContext, f as ApprovalQuorumChallengeWireInput, g as ChallengeWireKind, h as ChallengeWireInput, i as CloudflareRequestCf, j as ChallengeEnvelopeMode, k as generateDelegationSid, l as DEFAULT_CHALLENGE_CONTEXT_TIMEOUT_MS, m as ChallengeWireErrorCode, n as BotSignalsSource, o as resolveBotSignals, p as ChallengeWireError, r as BotSignalsTrustPolicy, s as ChallengeContextFailure, t as BotSignalsResolution, u as ResolveChallengeContextOptions, v as DelegationChallengeEnvelope, w as buildDelegationChallengeBody, x as HeaderEntry, y as DelegationChallengeEnvelopeMode, z as RenderedResponseLike } from "../index-
|
|
1
|
+
import { A as ACCEPT_CHALLENGE_HEADER, B as VERDICT_COOKIE_NAME, C as buildDelegationBearerHeader, D as buildDelegationInstructions, E as buildDelegationChallengeHeader, F as BLOCKED_PATH, H as deriveVerdict, I as ResponseShape, L as classifyResponseShape, M as FetcherHeaderInput, N as selectBodyReadable200, O as deriveDelegationPickupUri, P as serveBodyReadable200, R as acceptsHtml, S as buildChallengeWire, T as buildDelegationChallengeEnvelope, U as encodeVerdictCookie, V as Verdict, _ as DelegationChallengeBody, a as ResolveBotSignalsInput, b as DelegationChallengeWireInput, c as ChallengeContextFailureEvent, d as resolveChallengeContext, f as ApprovalQuorumChallengeWireInput, g as ChallengeWireKind, h as ChallengeWireInput, i as CloudflareRequestCf, j as ChallengeEnvelopeMode, k as generateDelegationSid, l as DEFAULT_CHALLENGE_CONTEXT_TIMEOUT_MS, m as ChallengeWireErrorCode, n as BotSignalsSource, o as resolveBotSignals, p as ChallengeWireError, r as BotSignalsTrustPolicy, s as ChallengeContextFailure, t as BotSignalsResolution, u as ResolveChallengeContextOptions, v as DelegationChallengeEnvelope, w as buildDelegationChallengeBody, x as HeaderEntry, y as DelegationChallengeEnvelopeMode, z as RenderedResponseLike } from "../index-DL_dmQBY.mjs";
|
|
2
2
|
export { ACCEPT_CHALLENGE_HEADER, type ApprovalQuorumChallengeWireInput, BLOCKED_PATH, type BotSignalsResolution, type BotSignalsSource, type BotSignalsTrustPolicy, type ChallengeContextFailure, type ChallengeContextFailureEvent, type ChallengeEnvelopeMode, ChallengeWireError, type ChallengeWireErrorCode, type ChallengeWireInput, type ChallengeWireKind, type CloudflareRequestCf, DEFAULT_CHALLENGE_CONTEXT_TIMEOUT_MS, type DelegationChallengeBody, type DelegationChallengeEnvelope, type DelegationChallengeEnvelopeMode, type DelegationChallengeWireInput, type FetcherHeaderInput, type HeaderEntry, type RenderedResponseLike, type ResolveBotSignalsInput, type ResolveChallengeContextOptions, type ResponseShape, VERDICT_COOKIE_NAME, type Verdict, acceptsHtml, buildChallengeWire, buildDelegationBearerHeader, buildDelegationChallengeBody, buildDelegationChallengeEnvelope, buildDelegationChallengeHeader, buildDelegationInstructions, classifyResponseShape, deriveDelegationPickupUri, deriveVerdict, encodeVerdictCookie, generateDelegationSid, resolveBotSignals, resolveChallengeContext, selectBodyReadable200, serveBodyReadable200 };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as ACCEPT_CHALLENGE_HEADER, B as VERDICT_COOKIE_NAME, C as buildDelegationBearerHeader, D as buildDelegationInstructions, E as buildDelegationChallengeHeader, F as BLOCKED_PATH, H as deriveVerdict, I as ResponseShape, L as classifyResponseShape, M as FetcherHeaderInput, N as selectBodyReadable200, O as deriveDelegationPickupUri, P as serveBodyReadable200, R as acceptsHtml, S as buildChallengeWire, T as buildDelegationChallengeEnvelope, U as encodeVerdictCookie, V as Verdict, _ as DelegationChallengeBody, a as ResolveBotSignalsInput, b as DelegationChallengeWireInput, c as ChallengeContextFailureEvent, d as resolveChallengeContext, f as ApprovalQuorumChallengeWireInput, g as ChallengeWireKind, h as ChallengeWireInput, i as CloudflareRequestCf, j as ChallengeEnvelopeMode, k as generateDelegationSid, l as DEFAULT_CHALLENGE_CONTEXT_TIMEOUT_MS, m as ChallengeWireErrorCode, n as BotSignalsSource, o as resolveBotSignals, p as ChallengeWireError, r as BotSignalsTrustPolicy, s as ChallengeContextFailure, t as BotSignalsResolution, u as ResolveChallengeContextOptions, v as DelegationChallengeEnvelope, w as buildDelegationChallengeBody, x as HeaderEntry, y as DelegationChallengeEnvelopeMode, z as RenderedResponseLike } from "../index-
|
|
1
|
+
import { A as ACCEPT_CHALLENGE_HEADER, B as VERDICT_COOKIE_NAME, C as buildDelegationBearerHeader, D as buildDelegationInstructions, E as buildDelegationChallengeHeader, F as BLOCKED_PATH, H as deriveVerdict, I as ResponseShape, L as classifyResponseShape, M as FetcherHeaderInput, N as selectBodyReadable200, O as deriveDelegationPickupUri, P as serveBodyReadable200, R as acceptsHtml, S as buildChallengeWire, T as buildDelegationChallengeEnvelope, U as encodeVerdictCookie, V as Verdict, _ as DelegationChallengeBody, a as ResolveBotSignalsInput, b as DelegationChallengeWireInput, c as ChallengeContextFailureEvent, d as resolveChallengeContext, f as ApprovalQuorumChallengeWireInput, g as ChallengeWireKind, h as ChallengeWireInput, i as CloudflareRequestCf, j as ChallengeEnvelopeMode, k as generateDelegationSid, l as DEFAULT_CHALLENGE_CONTEXT_TIMEOUT_MS, m as ChallengeWireErrorCode, n as BotSignalsSource, o as resolveBotSignals, p as ChallengeWireError, r as BotSignalsTrustPolicy, s as ChallengeContextFailure, t as BotSignalsResolution, u as ResolveChallengeContextOptions, v as DelegationChallengeEnvelope, w as buildDelegationChallengeBody, x as HeaderEntry, y as DelegationChallengeEnvelopeMode, z as RenderedResponseLike } from "../index-Cdv_FH0H.js";
|
|
2
2
|
export { ACCEPT_CHALLENGE_HEADER, type ApprovalQuorumChallengeWireInput, BLOCKED_PATH, type BotSignalsResolution, type BotSignalsSource, type BotSignalsTrustPolicy, type ChallengeContextFailure, type ChallengeContextFailureEvent, type ChallengeEnvelopeMode, ChallengeWireError, type ChallengeWireErrorCode, type ChallengeWireInput, type ChallengeWireKind, type CloudflareRequestCf, DEFAULT_CHALLENGE_CONTEXT_TIMEOUT_MS, type DelegationChallengeBody, type DelegationChallengeEnvelope, type DelegationChallengeEnvelopeMode, type DelegationChallengeWireInput, type FetcherHeaderInput, type HeaderEntry, type RenderedResponseLike, type ResolveBotSignalsInput, type ResolveChallengeContextOptions, type ResponseShape, VERDICT_COOKIE_NAME, type Verdict, acceptsHtml, buildChallengeWire, buildDelegationBearerHeader, buildDelegationChallengeBody, buildDelegationChallengeEnvelope, buildDelegationChallengeHeader, buildDelegationInstructions, classifyResponseShape, deriveDelegationPickupUri, deriveVerdict, encodeVerdictCookie, generateDelegationSid, resolveBotSignals, resolveChallengeContext, selectBodyReadable200, serveBodyReadable200 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as KYA_HTTP_ERROR } from "./kya-http-error-codes-C14E4gi3.js";
|
|
2
|
-
import { r as AssuranceTier } from "./schemas-
|
|
2
|
+
import { r as AssuranceTier } from "./schemas-DZa1ouGs.js";
|
|
3
3
|
//#region src/host-adapter/verdict-cookie.d.ts
|
|
4
4
|
interface RenderedResponseLike {
|
|
5
5
|
status: number | null;
|
|
@@ -153,4 +153,4 @@ interface ResolveBotSignalsInput {
|
|
|
153
153
|
declare function resolveBotSignals(input: ResolveBotSignalsInput): BotSignalsResolution;
|
|
154
154
|
//#endregion
|
|
155
155
|
export { ACCEPT_CHALLENGE_HEADER as A, VERDICT_COOKIE_NAME as B, buildDelegationBearerHeader as C, buildDelegationInstructions as D, buildDelegationChallengeHeader as E, BLOCKED_PATH as F, deriveVerdict as H, ResponseShape as I, classifyResponseShape as L, FetcherHeaderInput as M, selectBodyReadable200 as N, deriveDelegationPickupUri as O, serveBodyReadable200 as P, acceptsHtml as R, buildChallengeWire as S, buildDelegationChallengeEnvelope as T, encodeVerdictCookie as U, Verdict as V, DelegationChallengeBody as _, ResolveBotSignalsInput as a, DelegationChallengeWireInput as b, ChallengeContextFailureEvent as c, resolveChallengeContext as d, ApprovalQuorumChallengeWireInput as f, ChallengeWireKind as g, ChallengeWireInput as h, CloudflareRequestCf as i, ChallengeEnvelopeMode as j, generateDelegationSid as k, DEFAULT_CHALLENGE_CONTEXT_TIMEOUT_MS as l, ChallengeWireErrorCode as m, BotSignalsSource as n, resolveBotSignals as o, ChallengeWireError as p, BotSignalsTrustPolicy as r, ChallengeContextFailure as s, BotSignalsResolution as t, ResolveChallengeContextOptions as u, DelegationChallengeEnvelope as v, buildDelegationChallengeBody as w, HeaderEntry as x, DelegationChallengeEnvelopeMode as y, RenderedResponseLike as z };
|
|
156
|
-
//# sourceMappingURL=index-
|
|
156
|
+
//# sourceMappingURL=index-Cdv_FH0H.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-Cdv_FH0H.d.ts","names":[],"sources":["../src/host-adapter/verdict-cookie.ts","../src/host-adapter/content-negotiation.ts","../src/host-adapter/decision-mapping.ts","../src/host-adapter/fetcher-envelope.ts","../src/host-adapter/challenge-wire.ts","../src/host-adapter/challenge-context.ts","../src/utils/bot-signals.ts"],"mappings":";;;UA4BiB;EAEf;EAEA,SAAS;;cAOE;KAWD;iBAKI,cAAc,UAAU,uBAAuB;iBAiB/C,oBAAoB,UAAU;;;iBC7C9B,YACd,OAAO,UAAU;;;cCNN;KAOD;iBAeI,sBACd,UAAU,sBACV,6BACC;;;KCfS,qBACR,UACA;cASS;iBAiDG,qBACd,SAAS,oBACT,yBACA;KA2BU;iBAQI,sBACd,MAAM,uBACN,SAAS,oBACT,yBACA;;;KC5GU,wBAAwB,cAAc;KAEtC;UAEF;EAER;EAEA;EAEA;EAEA;EAEA;EAEA;EAEA;EAEA,eAAe;;UAIA,qCAAqC;EACpD;EAEA;;UAIe,yCAAyC;EACxD;EACA;EACA;;KAGU,qBAAqB,+BAA+B;UAEtD;EACR;EACA;EACA;EACA;EACA,gBAAgB;EAChB;EACA;;UAGQ,iCAAiC;EACzC;IACE;IACA;IACA;IACA;IACA;MAAO;;IACP;MAAS;MAAyB;MAAkB;;;;UAI9C,qCAAqC;EAC7C;EACA;EACA;;UAIe;EACf,cAAc,eAAe;EAC7B,OAAO,2BAA2B;EAClC;;UAGe;EACf;EACA,SAAS;EACT,MAAM;;KAGI;KAEA;cAcC,2BAA2B;WAC7B,MAAM;EAEH,YAAA,MAAM,wBAAwB;;iBAQ5B;iBASA,0BAA0B,oBAAoB;iBAO9C,+BAA+B,OAAO;iBAuBtC,4BAA4B;iBAM5B,4BACd,oBACA,mBACA;iBAYc,6BAA6B,OAAO,qBAAqB;iBAuDzD,iCACd,OAAO,oBACP,OAAM,kCACL;cAgDU,2BAAkB;;;cCxSlB;KAED;UAEK;EACf,QAAQ;EACR;;UAGe;EACf;EACA,aAAa,OAAO;;iBASA,wBAAwB,UAC5C,YAEM,SAAS,aACN,iCAAiC,QAAQ,8CAElD,SAAS,UACT,UAAS,iCACR,QAAQ;;;KCXC;UAEK;EAMf;EACA;EACA;EACA;EACA;EACA,QAAQ;;KAGE;EACN;;EACA;;EACA;;EACA;;UASW;EACf;IACE;IACA;IACA;;EAEF;EACA;;UAGe;EAQf,sBAAsB;EAEtB,qBAAqB,KAAK;EAC1B;EACA,QAAQ;;iBAoDM,kBAAkB,OAAO,yBAAyB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as KYA_HTTP_ERROR } from "./kya-http-error-codes-C14E4gi3.mjs";
|
|
2
|
-
import { r as AssuranceTier } from "./schemas-
|
|
2
|
+
import { r as AssuranceTier } from "./schemas-BhC88D1-.mjs";
|
|
3
3
|
//#region src/host-adapter/verdict-cookie.d.ts
|
|
4
4
|
interface RenderedResponseLike {
|
|
5
5
|
status: number | null;
|
|
@@ -153,4 +153,4 @@ interface ResolveBotSignalsInput {
|
|
|
153
153
|
declare function resolveBotSignals(input: ResolveBotSignalsInput): BotSignalsResolution;
|
|
154
154
|
//#endregion
|
|
155
155
|
export { ACCEPT_CHALLENGE_HEADER as A, VERDICT_COOKIE_NAME as B, buildDelegationBearerHeader as C, buildDelegationInstructions as D, buildDelegationChallengeHeader as E, BLOCKED_PATH as F, deriveVerdict as H, ResponseShape as I, classifyResponseShape as L, FetcherHeaderInput as M, selectBodyReadable200 as N, deriveDelegationPickupUri as O, serveBodyReadable200 as P, acceptsHtml as R, buildChallengeWire as S, buildDelegationChallengeEnvelope as T, encodeVerdictCookie as U, Verdict as V, DelegationChallengeBody as _, ResolveBotSignalsInput as a, DelegationChallengeWireInput as b, ChallengeContextFailureEvent as c, resolveChallengeContext as d, ApprovalQuorumChallengeWireInput as f, ChallengeWireKind as g, ChallengeWireInput as h, CloudflareRequestCf as i, ChallengeEnvelopeMode as j, generateDelegationSid as k, DEFAULT_CHALLENGE_CONTEXT_TIMEOUT_MS as l, ChallengeWireErrorCode as m, BotSignalsSource as n, resolveBotSignals as o, ChallengeWireError as p, BotSignalsTrustPolicy as r, ChallengeContextFailure as s, BotSignalsResolution as t, ResolveChallengeContextOptions as u, DelegationChallengeEnvelope as v, buildDelegationChallengeBody as w, HeaderEntry as x, DelegationChallengeEnvelopeMode as y, RenderedResponseLike as z };
|
|
156
|
-
//# sourceMappingURL=index-
|
|
156
|
+
//# sourceMappingURL=index-DL_dmQBY.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-DL_dmQBY.d.mts","names":[],"sources":["../src/host-adapter/verdict-cookie.ts","../src/host-adapter/content-negotiation.ts","../src/host-adapter/decision-mapping.ts","../src/host-adapter/fetcher-envelope.ts","../src/host-adapter/challenge-wire.ts","../src/host-adapter/challenge-context.ts","../src/utils/bot-signals.ts"],"mappings":";;;UA4BiB;EAEf;EAEA,SAAS;;cAOE;KAWD;iBAKI,cAAc,UAAU,uBAAuB;iBAiB/C,oBAAoB,UAAU;;;iBC7C9B,YACd,OAAO,UAAU;;;cCNN;KAOD;iBAeI,sBACd,UAAU,sBACV,6BACC;;;KCfS,qBACR,UACA;cASS;iBAiDG,qBACd,SAAS,oBACT,yBACA;KA2BU;iBAQI,sBACd,MAAM,uBACN,SAAS,oBACT,yBACA;;;KC5GU,wBAAwB,cAAc;KAEtC;UAEF;EAER;EAEA;EAEA;EAEA;EAEA;EAEA;EAEA;EAEA,eAAe;;UAIA,qCAAqC;EACpD;EAEA;;UAIe,yCAAyC;EACxD;EACA;EACA;;KAGU,qBAAqB,+BAA+B;UAEtD;EACR;EACA;EACA;EACA;EACA,gBAAgB;EAChB;EACA;;UAGQ,iCAAiC;EACzC;IACE;IACA;IACA;IACA;IACA;MAAO;;IACP;MAAS;MAAyB;MAAkB;;;;UAI9C,qCAAqC;EAC7C;EACA;EACA;;UAIe;EACf,cAAc,eAAe;EAC7B,OAAO,2BAA2B;EAClC;;UAGe;EACf;EACA,SAAS;EACT,MAAM;;KAGI;KAEA;c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