@athenaintel/react 0.26.6 → 0.28.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.
Files changed (75) hide show
  1. package/README.md +32 -1
  2. package/dist/chat/StatewireApprovalCard.cjs +19 -0
  3. package/dist/chat/StatewireApprovalCard.cjs.map +1 -1
  4. package/dist/chat/StatewireApprovalCard.js +19 -0
  5. package/dist/chat/StatewireApprovalCard.js.map +1 -1
  6. package/dist/chat/message-time.cjs.map +1 -1
  7. package/dist/chat/message-time.d.ts +4 -3
  8. package/dist/chat/message-time.js.map +1 -1
  9. package/dist/composer/QuoteContext.cjs +13 -1
  10. package/dist/composer/QuoteContext.cjs.map +1 -1
  11. package/dist/composer/QuoteContext.d.ts +11 -1
  12. package/dist/composer/QuoteContext.js +13 -1
  13. package/dist/composer/QuoteContext.js.map +1 -1
  14. package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
  15. package/dist/diagnostics/athena-diagnostics.d.ts +1 -1
  16. package/dist/diagnostics/athena-diagnostics.js.map +1 -1
  17. package/dist/diagnostics/errors.cjs +11 -2
  18. package/dist/diagnostics/errors.cjs.map +1 -1
  19. package/dist/diagnostics/errors.d.ts +11 -2
  20. package/dist/diagnostics/errors.js +11 -2
  21. package/dist/diagnostics/errors.js.map +1 -1
  22. package/dist/lib/athena-urls.cjs +1 -1
  23. package/dist/lib/athena-urls.cjs.map +1 -1
  24. package/dist/lib/athena-urls.js +1 -1
  25. package/dist/lib/athena-urls.js.map +1 -1
  26. package/dist/lib/posthog/mask-sensitive-input.cjs +34 -0
  27. package/dist/lib/posthog/mask-sensitive-input.cjs.map +1 -0
  28. package/dist/lib/posthog/mask-sensitive-input.d.ts +9 -0
  29. package/dist/lib/posthog/mask-sensitive-input.js +34 -0
  30. package/dist/lib/posthog/mask-sensitive-input.js.map +1 -0
  31. package/dist/packages/agent-runtime/src/conversation-index.cjs +2 -1
  32. package/dist/packages/agent-runtime/src/conversation-index.cjs.map +1 -1
  33. package/dist/packages/agent-runtime/src/conversation-index.js +2 -1
  34. package/dist/packages/agent-runtime/src/conversation-index.js.map +1 -1
  35. package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs +2 -0
  36. package/dist/packages/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
  37. package/dist/packages/agent-runtime/src/generated/runconfig-contract.js +2 -0
  38. package/dist/packages/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
  39. package/dist/packages/agent-runtime/src/interrupts.cjs +26 -8
  40. package/dist/packages/agent-runtime/src/interrupts.cjs.map +1 -1
  41. package/dist/packages/agent-runtime/src/interrupts.js +26 -8
  42. package/dist/packages/agent-runtime/src/interrupts.js.map +1 -1
  43. package/dist/packages/agent-runtime/src/messages.cjs +70 -14
  44. package/dist/packages/agent-runtime/src/messages.cjs.map +1 -1
  45. package/dist/packages/agent-runtime/src/messages.js +71 -15
  46. package/dist/packages/agent-runtime/src/messages.js.map +1 -1
  47. package/dist/packages/agent-runtime/src/tool-metadata.cjs +75 -0
  48. package/dist/packages/agent-runtime/src/tool-metadata.cjs.map +1 -1
  49. package/dist/packages/agent-runtime/src/tool-metadata.js +75 -0
  50. package/dist/packages/agent-runtime/src/tool-metadata.js.map +1 -1
  51. package/dist/packages/agent-runtime/src/tool-result.cjs +19 -4
  52. package/dist/packages/agent-runtime/src/tool-result.cjs.map +1 -1
  53. package/dist/packages/agent-runtime/src/tool-result.js +19 -4
  54. package/dist/packages/agent-runtime/src/tool-result.js.map +1 -1
  55. package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs +23 -4
  56. package/dist/packages/agent-runtime/src/use-deep-agent-thread.cjs.map +1 -1
  57. package/dist/packages/agent-runtime/src/use-deep-agent-thread.js +24 -5
  58. package/dist/packages/agent-runtime/src/use-deep-agent-thread.js.map +1 -1
  59. package/dist/packages/react/package.json.cjs +1 -1
  60. package/dist/packages/react/package.json.js +1 -1
  61. package/dist/provider/AthenaProvider.cjs +3 -0
  62. package/dist/provider/AthenaProvider.cjs.map +1 -1
  63. package/dist/provider/AthenaProvider.js +3 -0
  64. package/dist/provider/AthenaProvider.js.map +1 -1
  65. package/dist/provider/PostHogProvider.cjs +3 -1
  66. package/dist/provider/PostHogProvider.cjs.map +1 -1
  67. package/dist/provider/PostHogProvider.js +3 -1
  68. package/dist/provider/PostHogProvider.js.map +1 -1
  69. package/dist/runtime/auth.cjs +307 -108
  70. package/dist/runtime/auth.cjs.map +1 -1
  71. package/dist/runtime/auth.d.ts +151 -10
  72. package/dist/runtime/auth.js +307 -108
  73. package/dist/runtime/auth.js.map +1 -1
  74. package/dist/styles.css +1 -1
  75. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"athena-urls.cjs","sources":["../../src/lib/athena-urls.ts"],"sourcesContent":["export type AthenaEnvironment = 'production' | 'staging';\n\nexport interface AthenaEnvironmentUrls {\n apiUrl: string;\n backendUrl: string;\n appUrl: string;\n}\n\n/**\n * Bare origins: `apiUrl` is the Iris host fronting the deployment (its origin\n * derives the `/v2/threads` statewire mount) and `backendUrl` is the Agora\n * REST base. Neither carries a path — `deriveStatewireSyncUrl` and the REST\n * helpers append their own.\n */\nconst ATHENA_ENVIRONMENT_URLS: Record<AthenaEnvironment, AthenaEnvironmentUrls> = {\n production: {\n apiUrl: 'https://iris.prd.athenaintel.com',\n backendUrl: 'https://api.athenaintel.com',\n appUrl: 'https://app.athenaintel.com',\n },\n staging: {\n apiUrl: 'https://iris.stg.athenaintel.com',\n backendUrl: 'https://staging-api.athenaintel.com',\n appUrl: 'https://staging-app.athenaintel.com',\n },\n};\n\nexport const DEFAULT_ATHENA_ENVIRONMENT: AthenaEnvironment = 'production';\nexport const DEFAULT_APP_URL = ATHENA_ENVIRONMENT_URLS.production.appUrl;\n/** Production statewire sync endpoint — the same host the mobile app and\n * Chrome extension ship as their production statewire base. Exported as a\n * constant for explicit configuration; it is deliberately NOT used as an\n * implicit fallback (see {@link resolveStatewireSyncUrl}). */\nexport const DEFAULT_STATEWIRE_SYNC_URL = 'https://iris.prd.athenaintel.com/v2/threads';\n\nconst STATEWIRE_SYNC_PATHNAME = '/v2/threads';\n\n/**\n * Derive the statewire sync endpoint (the `…/v2/threads` mount) from the Iris\n * host's origin: staging `https://iris.stg.athenaintel.com` maps to\n * `https://iris.stg.athenaintel.com/v2/threads`, and likewise for production\n * and workspace Iris hosts (a URL still carrying the retired `/api/chat` path\n * resolves the same way). Unparseable inputs return `null` so callers can\n * fall back explicitly.\n */\nexport function deriveStatewireSyncUrl({\n apiUrl,\n}: {\n apiUrl?: string | null;\n}): string | null {\n if (!apiUrl) return null;\n\n try {\n const parsedUrl = new URL(apiUrl);\n return `${parsedUrl.origin}${STATEWIRE_SYNC_PATHNAME}`;\n } catch {\n return null;\n }\n}\n\n/**\n * Resolve the statewire sync endpoint for a provider configuration: an\n * explicit `statewireSyncUrl` wins, otherwise it is derived from the\n * effective `apiUrl` host.\n *\n * When neither yields a URL this throws instead of falling back to an Athena\n * default — mirroring `deriveAthenaApiUrl`'s null-for-unknown-hosts rule, so\n * a misconfigured custom deployment can never silently send its bearer token\n * or API key to Athena production.\n */\nexport function resolveStatewireSyncUrl({\n statewireSyncUrl,\n apiUrl,\n}: {\n statewireSyncUrl?: string;\n apiUrl?: string | null;\n}): string {\n if (statewireSyncUrl) return statewireSyncUrl;\n\n const derived = deriveStatewireSyncUrl({ apiUrl });\n if (derived) return derived;\n\n throw new Error(\n `[AthenaSDK] transport 'statewire' could not derive a sync URL from apiUrl (${JSON.stringify(\n apiUrl ?? null,\n )}). Pass an explicit statewireSyncUrl (the …/v2/threads mount). Credentials are never sent to a default host.`,\n );\n}\n\n/**\n * Refuse to attach a host-authenticated app to a guessed host. A host that\n * answered the auth bridge (a `/_athena/auth` mint, an `athena-config`\n * message) but minted no statewire mount predates the statewire-native\n * mint; without an explicit `statewireSyncUrl` or `apiUrl` the provider\n * would otherwise fall back to the environment preset and send that host's\n * credential to managed-cloud Athena. No host answering at all is not this\n * case: the preset is the documented default for a standalone app.\n */\nexport function assertHostMintedStatewireMount({\n hostAnswered,\n hostStatewireSyncUrl,\n statewireSyncUrl,\n apiUrl,\n}: {\n hostAnswered: boolean;\n hostStatewireSyncUrl: string | null;\n statewireSyncUrl?: string;\n apiUrl?: string;\n}): void {\n if (!hostAnswered || hostStatewireSyncUrl || statewireSyncUrl || apiUrl) return;\n throw new Error(\n '[AthenaSDK] The host answered the auth bridge without a statewire sync mount (statewireSyncUrl): it predates the statewire-native mint. Update the host (Marathon >= 2026-08-29), or configure statewireSyncUrl / apiUrl explicitly. Credentials are never sent to a default host.',\n );\n}\n\nconst MARATHON_APP_PORT = '8082';\nconst SPACES_PATHNAME = 'dashboard/spaces/';\n\nconst normalizeBaseUrl = (url: string): string => url.replace(/\\/+$/, '');\n\nconst createUrlWithFallback = (url: string, fallbackUrl: string): URL => {\n try {\n return new URL(`${normalizeBaseUrl(url)}/`);\n } catch {\n return new URL(`${normalizeBaseUrl(fallbackUrl)}/`);\n }\n};\n\nconst getHostname = (value?: string | null): string | null => {\n if (!value) return null;\n\n try {\n return new URL(value).hostname;\n } catch {\n return null;\n }\n};\n\nconst deriveWorkspaceAppUrl = ({\n sourceUrl,\n sourcePort,\n}: {\n sourceUrl: string;\n sourcePort: '8000' | '8787';\n}): string | null => {\n try {\n const parsedUrl = new URL(sourceUrl);\n const match = parsedUrl.hostname.match(\n new RegExp(`^(?<prefix>.+)--${sourcePort}\\\\.(?<domain>app\\\\.athenaintel\\\\.com|staging-app\\\\.athenaintel\\\\.com)$`),\n );\n\n if (!match?.groups?.prefix || !match.groups.domain) {\n return null;\n }\n\n return `${parsedUrl.protocol}//${match.groups.prefix}--${MARATHON_APP_PORT}.${match.groups.domain}`;\n } catch {\n return null;\n }\n};\n\nconst deriveWorkspaceApiUrl = (backendUrl: string): string | null => {\n try {\n const parsedUrl = new URL(backendUrl);\n const match = parsedUrl.hostname.match(\n /^(?<prefix>.+)--8000\\.(?<domain>app\\.athenaintel\\.com|staging-app\\.athenaintel\\.com)$/,\n );\n\n if (!match?.groups?.prefix || !match.groups.domain) {\n return null;\n }\n\n return `${parsedUrl.protocol}//${match.groups.prefix}--8787.${match.groups.domain}`;\n } catch {\n return null;\n }\n};\n\nexport function getAthenaEnvironmentUrls({\n environment = DEFAULT_ATHENA_ENVIRONMENT,\n}: {\n environment?: AthenaEnvironment;\n} = {}): AthenaEnvironmentUrls {\n return ATHENA_ENVIRONMENT_URLS[environment];\n}\n\n/**\n * Resolve the Iris origin that fronts a known Agora backend.\n *\n * Unknown custom backends deliberately return `null`: callers can preserve a\n * direct-Agora fallback instead of accidentally sending a custom environment's\n * bearer token and traffic through production Iris.\n */\nexport function deriveAthenaApiUrl({\n backendUrl,\n}: {\n backendUrl?: string | null;\n}): string | null {\n if (!backendUrl) return null;\n\n const workspaceApiUrl = deriveWorkspaceApiUrl(backendUrl);\n if (workspaceApiUrl) return workspaceApiUrl;\n\n try {\n const parsedUrl = new URL(backendUrl);\n if (parsedUrl.hostname === 'api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.production.apiUrl;\n }\n if (parsedUrl.hostname === 'staging-api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.staging.apiUrl;\n }\n if (parsedUrl.hostname === 'localhost' || parsedUrl.hostname === '127.0.0.1') {\n parsedUrl.port = '8787';\n return parsedUrl.origin;\n }\n } catch {\n return null;\n }\n\n return null;\n}\n\nexport function deriveAthenaAppUrl({\n apiUrl,\n backendUrl,\n}: {\n apiUrl?: string | null;\n backendUrl?: string | null;\n}): string | null {\n if (backendUrl) {\n const workspaceAppUrl = deriveWorkspaceAppUrl({\n sourceUrl: backendUrl,\n sourcePort: '8000',\n });\n if (workspaceAppUrl) return workspaceAppUrl;\n\n const backendHostname = getHostname(backendUrl);\n if (backendHostname === 'api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.production.appUrl;\n }\n if (backendHostname === 'staging-api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.staging.appUrl;\n }\n }\n\n if (apiUrl) {\n const workspaceAppUrl = deriveWorkspaceAppUrl({\n sourceUrl: apiUrl,\n sourcePort: '8787',\n });\n if (workspaceAppUrl) return workspaceAppUrl;\n\n const apiHostname = getHostname(apiUrl);\n if (apiHostname === 'iris.prd.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.production.appUrl;\n }\n if (apiHostname === 'iris.stg.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.staging.appUrl;\n }\n }\n\n return null;\n}\n\nexport function createAthenaSpacesUrl({\n appUrl = DEFAULT_APP_URL,\n assetIds,\n sessionId,\n}: {\n appUrl?: string;\n assetIds?: string | string[];\n sessionId?: string;\n}): string {\n const url = new URL(SPACES_PATHNAME, createUrlWithFallback(appUrl, DEFAULT_APP_URL));\n\n if (assetIds) {\n const normalizedAssetIds = (Array.isArray(assetIds) ? assetIds : [assetIds])\n .map((assetId) => assetId.trim())\n .filter((assetId) => assetId.length > 0);\n\n if (normalizedAssetIds.length > 0) {\n url.searchParams.set('asset_ids', normalizedAssetIds.join(','));\n }\n }\n\n if (sessionId) {\n url.searchParams.set('session_id', sessionId);\n }\n\n return url.toString();\n}\n"],"names":[],"mappings":";;AAcA,MAAM,0BAA4E;AAAA,EAChF,YAAY;AAAA,IACV,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EAAA;AAAA,EAEV,SAAS;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EAAA;AAEZ;AAEO,MAAM,6BAAgD;AACtD,MAAM,kBAAkB,wBAAwB,WAAW;AAK3D,MAAM,6BAA6B;AAE1C,MAAM,0BAA0B;AAUzB,SAAS,uBAAuB;AAAA,EACrC;AACF,GAEkB;AAChB,MAAI,CAAC,OAAQ,QAAO;AAEpB,MAAI;AACF,UAAM,YAAY,IAAI,IAAI,MAAM;AAChC,WAAO,GAAG,UAAU,MAAM,GAAG,uBAAuB;AAAA,EACtD,QAAQ;AACN,WAAO;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AAU;AAC9C,QAAI,oBAAoB,uBAAuB;AAC7C,aAAO,wBAAwB,WAAW;AAAA,IAC5C;AACA,QAAI,oBAAoB,+BAA+B;AACrD,aAAO,wBAAwB,QAAQ;AAAA,IACzC;AAAA,EACF;AAEA,MAAI,QAAQ;AACV,UAAM,kBAAkB,sBAAsB;AAAA,MAC5C,WAAW;AAAA,MACX,YAAY;AAAA,IAAA,CACb;AACD,QAAI,gBAAiB,QAAO;AAE5B,UAAM,cAAc,YAAY,MAAM;AACtC,QAAI,gBAAgB,4BAA4B;AAC9C,aAAO,wBAAwB,WAAW;AAAA,IAC5C;AACA,QAAI,gBAAgB,4BAA4B;AAC9C,aAAO,wBAAwB,QAAQ;AAAA,IACzC;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,sBAAsB;AAAA,EACpC,SAAS;AAAA,EACT;AAAA,EACA;AACF,GAIW;AACT,QAAM,MAAM,IAAI,IAAI,iBAAiB,sBAAsB,QAAQ,eAAe,CAAC;AAEnF,MAAI,UAAU;AACZ,UAAM,sBAAsB,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC,QAAQ,GACvE,IAAI,CAAC,YAAY,QAAQ,MAAM,EAC/B,OAAO,CAAC,YAAY,QAAQ,SAAS,CAAC;AAEzC,QAAI,mBAAmB,SAAS,GAAG;AACjC,UAAI,aAAa,IAAI,aAAa,mBAAmB,KAAK,GAAG,CAAC;AAAA,IAChE;AAAA,EACF;AAEA,MAAI,WAAW;AACb,QAAI,aAAa,IAAI,cAAc,SAAS;AAAA,EAC9C;AAEA,SAAO,IAAI,SAAA;AACb;;;;;;;;;;;"}
1
+ {"version":3,"file":"athena-urls.cjs","sources":["../../src/lib/athena-urls.ts"],"sourcesContent":["export type AthenaEnvironment = 'production' | 'staging';\n\nexport interface AthenaEnvironmentUrls {\n apiUrl: string;\n backendUrl: string;\n appUrl: string;\n}\n\n/**\n * Bare origins: `apiUrl` is the Iris host fronting the deployment (its origin\n * derives the `/v2/threads` statewire mount) and `backendUrl` is the Agora\n * REST base. Neither carries a path — `deriveStatewireSyncUrl` and the REST\n * helpers append their own.\n */\nconst ATHENA_ENVIRONMENT_URLS: Record<AthenaEnvironment, AthenaEnvironmentUrls> = {\n production: {\n apiUrl: 'https://iris.prd.athenaintel.com',\n backendUrl: 'https://api.athenaintel.com',\n appUrl: 'https://app.athenaintel.com',\n },\n staging: {\n apiUrl: 'https://iris.stg.athenaintel.com',\n backendUrl: 'https://staging-api.athenaintel.com',\n appUrl: 'https://staging-app.athenaintel.com',\n },\n};\n\nexport const DEFAULT_ATHENA_ENVIRONMENT: AthenaEnvironment = 'production';\nexport const DEFAULT_APP_URL = ATHENA_ENVIRONMENT_URLS.production.appUrl;\n/** Production statewire sync endpoint — the same host the mobile app and\n * Chrome extension ship as their production statewire base. Exported as a\n * constant for explicit configuration; it is deliberately NOT used as an\n * implicit fallback (see {@link resolveStatewireSyncUrl}). */\nexport const DEFAULT_STATEWIRE_SYNC_URL = 'https://iris.prd.athenaintel.com/v2/threads';\n\nconst STATEWIRE_SYNC_PATHNAME = '/v2/threads';\n\n/**\n * Derive the statewire sync endpoint (the `…/v2/threads` mount) from the Iris\n * host's origin: staging `https://iris.stg.athenaintel.com` maps to\n * `https://iris.stg.athenaintel.com/v2/threads`, and likewise for production\n * and workspace Iris hosts (a URL still carrying the retired `/api/chat` path\n * resolves the same way). Unparseable inputs return `null` so callers can\n * fall back explicitly.\n */\nexport function deriveStatewireSyncUrl({\n apiUrl,\n}: {\n apiUrl?: string | null;\n}): string | null {\n if (!apiUrl) return null;\n\n try {\n const parsedUrl = new URL(apiUrl);\n return `${parsedUrl.origin}${STATEWIRE_SYNC_PATHNAME}`;\n } catch {\n return null;\n }\n}\n\n/**\n * Resolve the statewire sync endpoint for a provider configuration: an\n * explicit `statewireSyncUrl` wins, otherwise it is derived from the\n * effective `apiUrl` host.\n *\n * When neither yields a URL this throws instead of falling back to an Athena\n * default — mirroring `deriveAthenaApiUrl`'s null-for-unknown-hosts rule, so\n * a misconfigured custom deployment can never silently send its bearer token\n * or API key to Athena production.\n */\nexport function resolveStatewireSyncUrl({\n statewireSyncUrl,\n apiUrl,\n}: {\n statewireSyncUrl?: string;\n apiUrl?: string | null;\n}): string {\n if (statewireSyncUrl) return statewireSyncUrl;\n\n const derived = deriveStatewireSyncUrl({ apiUrl });\n if (derived) return derived;\n\n throw new Error(\n `[AthenaSDK] transport 'statewire' could not derive a sync URL from apiUrl (${JSON.stringify(\n apiUrl ?? null,\n )}). Pass an explicit statewireSyncUrl (the …/v2/threads mount). Credentials are never sent to a default host.`,\n );\n}\n\n/**\n * Refuse to attach a host-authenticated app to a guessed host. A host that\n * answered the auth bridge (a `/_athena/auth` mint, an `athena-config`\n * message) but minted no statewire mount predates the statewire-native\n * mint; without an explicit `statewireSyncUrl` or `apiUrl` the provider\n * would otherwise fall back to the environment preset and send that host's\n * credential to managed-cloud Athena. No host answering at all is not this\n * case: the preset is the documented default for a standalone app.\n */\nexport function assertHostMintedStatewireMount({\n hostAnswered,\n hostStatewireSyncUrl,\n statewireSyncUrl,\n apiUrl,\n}: {\n hostAnswered: boolean;\n hostStatewireSyncUrl: string | null;\n statewireSyncUrl?: string;\n apiUrl?: string;\n}): void {\n if (!hostAnswered || hostStatewireSyncUrl || statewireSyncUrl || apiUrl) return;\n throw new Error(\n '[AthenaSDK] The host answered the auth bridge without a statewire sync mount (statewireSyncUrl) the SDK accepted: either the host predates the statewire-native mint (update it: Marathon >= 2026-08-29), or the parent page sent a URL the SDK refused (see the auth.bridge.config_rejected diagnostics event: it must be https, on an Athena host or under the parent page\\'s own domain). Or configure statewireSyncUrl / apiUrl explicitly. Credentials are never sent to a default host.',\n );\n}\n\nconst MARATHON_APP_PORT = '8082';\nconst SPACES_PATHNAME = 'dashboard/spaces/';\n\nconst normalizeBaseUrl = (url: string): string => url.replace(/\\/+$/, '');\n\nconst createUrlWithFallback = (url: string, fallbackUrl: string): URL => {\n try {\n return new URL(`${normalizeBaseUrl(url)}/`);\n } catch {\n return new URL(`${normalizeBaseUrl(fallbackUrl)}/`);\n }\n};\n\nconst getHostname = (value?: string | null): string | null => {\n if (!value) return null;\n\n try {\n return new URL(value).hostname;\n } catch {\n return null;\n }\n};\n\nconst deriveWorkspaceAppUrl = ({\n sourceUrl,\n sourcePort,\n}: {\n sourceUrl: string;\n sourcePort: '8000' | '8787';\n}): string | null => {\n try {\n const parsedUrl = new URL(sourceUrl);\n const match = parsedUrl.hostname.match(\n new RegExp(`^(?<prefix>.+)--${sourcePort}\\\\.(?<domain>app\\\\.athenaintel\\\\.com|staging-app\\\\.athenaintel\\\\.com)$`),\n );\n\n if (!match?.groups?.prefix || !match.groups.domain) {\n return null;\n }\n\n return `${parsedUrl.protocol}//${match.groups.prefix}--${MARATHON_APP_PORT}.${match.groups.domain}`;\n } catch {\n return null;\n }\n};\n\nconst deriveWorkspaceApiUrl = (backendUrl: string): string | null => {\n try {\n const parsedUrl = new URL(backendUrl);\n const match = parsedUrl.hostname.match(\n /^(?<prefix>.+)--8000\\.(?<domain>app\\.athenaintel\\.com|staging-app\\.athenaintel\\.com)$/,\n );\n\n if (!match?.groups?.prefix || !match.groups.domain) {\n return null;\n }\n\n return `${parsedUrl.protocol}//${match.groups.prefix}--8787.${match.groups.domain}`;\n } catch {\n return null;\n }\n};\n\nexport function getAthenaEnvironmentUrls({\n environment = DEFAULT_ATHENA_ENVIRONMENT,\n}: {\n environment?: AthenaEnvironment;\n} = {}): AthenaEnvironmentUrls {\n return ATHENA_ENVIRONMENT_URLS[environment];\n}\n\n/**\n * Resolve the Iris origin that fronts a known Agora backend.\n *\n * Unknown custom backends deliberately return `null`: callers can preserve a\n * direct-Agora fallback instead of accidentally sending a custom environment's\n * bearer token and traffic through production Iris.\n */\nexport function deriveAthenaApiUrl({\n backendUrl,\n}: {\n backendUrl?: string | null;\n}): string | null {\n if (!backendUrl) return null;\n\n const workspaceApiUrl = deriveWorkspaceApiUrl(backendUrl);\n if (workspaceApiUrl) return workspaceApiUrl;\n\n try {\n const parsedUrl = new URL(backendUrl);\n if (parsedUrl.hostname === 'api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.production.apiUrl;\n }\n if (parsedUrl.hostname === 'staging-api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.staging.apiUrl;\n }\n if (parsedUrl.hostname === 'localhost' || parsedUrl.hostname === '127.0.0.1') {\n parsedUrl.port = '8787';\n return parsedUrl.origin;\n }\n } catch {\n return null;\n }\n\n return null;\n}\n\nexport function deriveAthenaAppUrl({\n apiUrl,\n backendUrl,\n}: {\n apiUrl?: string | null;\n backendUrl?: string | null;\n}): string | null {\n if (backendUrl) {\n const workspaceAppUrl = deriveWorkspaceAppUrl({\n sourceUrl: backendUrl,\n sourcePort: '8000',\n });\n if (workspaceAppUrl) return workspaceAppUrl;\n\n const backendHostname = getHostname(backendUrl);\n if (backendHostname === 'api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.production.appUrl;\n }\n if (backendHostname === 'staging-api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.staging.appUrl;\n }\n }\n\n if (apiUrl) {\n const workspaceAppUrl = deriveWorkspaceAppUrl({\n sourceUrl: apiUrl,\n sourcePort: '8787',\n });\n if (workspaceAppUrl) return workspaceAppUrl;\n\n const apiHostname = getHostname(apiUrl);\n if (apiHostname === 'iris.prd.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.production.appUrl;\n }\n if (apiHostname === 'iris.stg.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.staging.appUrl;\n }\n }\n\n return null;\n}\n\nexport function createAthenaSpacesUrl({\n appUrl = DEFAULT_APP_URL,\n assetIds,\n sessionId,\n}: {\n appUrl?: string;\n assetIds?: string | string[];\n sessionId?: string;\n}): string {\n const url = new URL(SPACES_PATHNAME, createUrlWithFallback(appUrl, DEFAULT_APP_URL));\n\n if (assetIds) {\n const normalizedAssetIds = (Array.isArray(assetIds) ? assetIds : [assetIds])\n .map((assetId) => assetId.trim())\n .filter((assetId) => assetId.length > 0);\n\n if (normalizedAssetIds.length > 0) {\n url.searchParams.set('asset_ids', normalizedAssetIds.join(','));\n }\n }\n\n if (sessionId) {\n url.searchParams.set('session_id', sessionId);\n }\n\n return url.toString();\n}\n"],"names":[],"mappings":";;AAcA,MAAM,0BAA4E;AAAA,EAChF,YAAY;AAAA,IACV,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EAAA;AAAA,EAEV,SAAS;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EAAA;AAEZ;AAEO,MAAM,6BAAgD;AACtD,MAAM,kBAAkB,wBAAwB,WAAW;AAK3D,MAAM,6BAA6B;AAE1C,MAAM,0BAA0B;AAUzB,SAAS,uBAAuB;AAAA,EACrC;AACF,GAEkB;AAChB,MAAI,CAAC,OAAQ,QAAO;AAEpB,MAAI;AACF,UAAM,YAAY,IAAI,IAAI,MAAM;AAChC,WAAO,GAAG,UAAU,MAAM,GAAG,uBAAuB;AAAA,EACtD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAYO,SAAS,wBAAwB;AAAA,EACtC;AAAA,EACA;AACF,GAGW;AACT,MAAI,iBAAkB,QAAO;AAE7B,QAAM,UAAU,uBAAuB,EAAE,QAAQ;AACjD,MAAI,QAAS,QAAO;AAEpB,QAAM,IAAI;AAAA,IACR,8EAA8E,KAAK;AAAA,MACjF,UAAU;AAAA,IAAA,CACX;AAAA,EAAA;AAEL;AAWO,SAAS,+BAA+B;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKS;AACP,MAAI,CAAC,gBAAgB,wBAAwB,oBAAoB,OAAQ;AACzE,QAAM,IAAI;AAAA,IACR;AAAA,EAAA;AAEJ;AAEA,MAAM,oBAAoB;AAC1B,MAAM,kBAAkB;AAExB,MAAM,mBAAmB,CAAC,QAAwB,IAAI,QAAQ,QAAQ,EAAE;AAExE,MAAM,wBAAwB,CAAC,KAA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IAAI,IAAI,iBAAiB,sBAAsB,QAAQ,eAAe,CAAC;AAEnF,MAAI,UAAU;AACZ,UAAM,sBAAsB,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC,QAAQ,GACvE,IAAI,CAAC,YAAY,QAAQ,MAAM,EAC/B,OAAO,CAAC,YAAY,QAAQ,SAAS,CAAC;AAEzC,QAAI,mBAAmB,SAAS,GAAG;AACjC,UAAI,aAAa,IAAI,aAAa,mBAAmB,KAAK,GAAG,CAAC;AAAA,IAChE;AAAA,EACF;AAEA,MAAI,WAAW;AACb,QAAI,aAAa,IAAI,cAAc,SAAS;AAAA,EAC9C;AAEA,SAAO,IAAI,SAAA;AACb;;;;;;;;;;;"}
@@ -46,7 +46,7 @@ function assertHostMintedStatewireMount({
46
46
  }) {
47
47
  if (!hostAnswered || hostStatewireSyncUrl || statewireSyncUrl || apiUrl) return;
48
48
  throw new Error(
49
- "[AthenaSDK] The host answered the auth bridge without a statewire sync mount (statewireSyncUrl): it predates the statewire-native mint. Update the host (Marathon >= 2026-08-29), or configure statewireSyncUrl / apiUrl explicitly. Credentials are never sent to a default host."
49
+ "[AthenaSDK] The host answered the auth bridge without a statewire sync mount (statewireSyncUrl) the SDK accepted: either the host predates the statewire-native mint (update it: Marathon >= 2026-08-29), or the parent page sent a URL the SDK refused (see the auth.bridge.config_rejected diagnostics event: it must be https, on an Athena host or under the parent page's own domain). Or configure statewireSyncUrl / apiUrl explicitly. Credentials are never sent to a default host."
50
50
  );
51
51
  }
52
52
  const MARATHON_APP_PORT = "8082";
@@ -1 +1 @@
1
- {"version":3,"file":"athena-urls.js","sources":["../../src/lib/athena-urls.ts"],"sourcesContent":["export type AthenaEnvironment = 'production' | 'staging';\n\nexport interface AthenaEnvironmentUrls {\n apiUrl: string;\n backendUrl: string;\n appUrl: string;\n}\n\n/**\n * Bare origins: `apiUrl` is the Iris host fronting the deployment (its origin\n * derives the `/v2/threads` statewire mount) and `backendUrl` is the Agora\n * REST base. Neither carries a path — `deriveStatewireSyncUrl` and the REST\n * helpers append their own.\n */\nconst ATHENA_ENVIRONMENT_URLS: Record<AthenaEnvironment, AthenaEnvironmentUrls> = {\n production: {\n apiUrl: 'https://iris.prd.athenaintel.com',\n backendUrl: 'https://api.athenaintel.com',\n appUrl: 'https://app.athenaintel.com',\n },\n staging: {\n apiUrl: 'https://iris.stg.athenaintel.com',\n backendUrl: 'https://staging-api.athenaintel.com',\n appUrl: 'https://staging-app.athenaintel.com',\n },\n};\n\nexport const DEFAULT_ATHENA_ENVIRONMENT: AthenaEnvironment = 'production';\nexport const DEFAULT_APP_URL = ATHENA_ENVIRONMENT_URLS.production.appUrl;\n/** Production statewire sync endpoint — the same host the mobile app and\n * Chrome extension ship as their production statewire base. Exported as a\n * constant for explicit configuration; it is deliberately NOT used as an\n * implicit fallback (see {@link resolveStatewireSyncUrl}). */\nexport const DEFAULT_STATEWIRE_SYNC_URL = 'https://iris.prd.athenaintel.com/v2/threads';\n\nconst STATEWIRE_SYNC_PATHNAME = '/v2/threads';\n\n/**\n * Derive the statewire sync endpoint (the `…/v2/threads` mount) from the Iris\n * host's origin: staging `https://iris.stg.athenaintel.com` maps to\n * `https://iris.stg.athenaintel.com/v2/threads`, and likewise for production\n * and workspace Iris hosts (a URL still carrying the retired `/api/chat` path\n * resolves the same way). Unparseable inputs return `null` so callers can\n * fall back explicitly.\n */\nexport function deriveStatewireSyncUrl({\n apiUrl,\n}: {\n apiUrl?: string | null;\n}): string | null {\n if (!apiUrl) return null;\n\n try {\n const parsedUrl = new URL(apiUrl);\n return `${parsedUrl.origin}${STATEWIRE_SYNC_PATHNAME}`;\n } catch {\n return null;\n }\n}\n\n/**\n * Resolve the statewire sync endpoint for a provider configuration: an\n * explicit `statewireSyncUrl` wins, otherwise it is derived from the\n * effective `apiUrl` host.\n *\n * When neither yields a URL this throws instead of falling back to an Athena\n * default — mirroring `deriveAthenaApiUrl`'s null-for-unknown-hosts rule, so\n * a misconfigured custom deployment can never silently send its bearer token\n * or API key to Athena production.\n */\nexport function resolveStatewireSyncUrl({\n statewireSyncUrl,\n apiUrl,\n}: {\n statewireSyncUrl?: string;\n apiUrl?: string | null;\n}): string {\n if (statewireSyncUrl) return statewireSyncUrl;\n\n const derived = deriveStatewireSyncUrl({ apiUrl });\n if (derived) return derived;\n\n throw new Error(\n `[AthenaSDK] transport 'statewire' could not derive a sync URL from apiUrl (${JSON.stringify(\n apiUrl ?? null,\n )}). Pass an explicit statewireSyncUrl (the …/v2/threads mount). Credentials are never sent to a default host.`,\n );\n}\n\n/**\n * Refuse to attach a host-authenticated app to a guessed host. A host that\n * answered the auth bridge (a `/_athena/auth` mint, an `athena-config`\n * message) but minted no statewire mount predates the statewire-native\n * mint; without an explicit `statewireSyncUrl` or `apiUrl` the provider\n * would otherwise fall back to the environment preset and send that host's\n * credential to managed-cloud Athena. No host answering at all is not this\n * case: the preset is the documented default for a standalone app.\n */\nexport function assertHostMintedStatewireMount({\n hostAnswered,\n hostStatewireSyncUrl,\n statewireSyncUrl,\n apiUrl,\n}: {\n hostAnswered: boolean;\n hostStatewireSyncUrl: string | null;\n statewireSyncUrl?: string;\n apiUrl?: string;\n}): void {\n if (!hostAnswered || hostStatewireSyncUrl || statewireSyncUrl || apiUrl) return;\n throw new Error(\n '[AthenaSDK] The host answered the auth bridge without a statewire sync mount (statewireSyncUrl): it predates the statewire-native mint. Update the host (Marathon >= 2026-08-29), or configure statewireSyncUrl / apiUrl explicitly. Credentials are never sent to a default host.',\n );\n}\n\nconst MARATHON_APP_PORT = '8082';\nconst SPACES_PATHNAME = 'dashboard/spaces/';\n\nconst normalizeBaseUrl = (url: string): string => url.replace(/\\/+$/, '');\n\nconst createUrlWithFallback = (url: string, fallbackUrl: string): URL => {\n try {\n return new URL(`${normalizeBaseUrl(url)}/`);\n } catch {\n return new URL(`${normalizeBaseUrl(fallbackUrl)}/`);\n }\n};\n\nconst getHostname = (value?: string | null): string | null => {\n if (!value) return null;\n\n try {\n return new URL(value).hostname;\n } catch {\n return null;\n }\n};\n\nconst deriveWorkspaceAppUrl = ({\n sourceUrl,\n sourcePort,\n}: {\n sourceUrl: string;\n sourcePort: '8000' | '8787';\n}): string | null => {\n try {\n const parsedUrl = new URL(sourceUrl);\n const match = parsedUrl.hostname.match(\n new RegExp(`^(?<prefix>.+)--${sourcePort}\\\\.(?<domain>app\\\\.athenaintel\\\\.com|staging-app\\\\.athenaintel\\\\.com)$`),\n );\n\n if (!match?.groups?.prefix || !match.groups.domain) {\n return null;\n }\n\n return `${parsedUrl.protocol}//${match.groups.prefix}--${MARATHON_APP_PORT}.${match.groups.domain}`;\n } catch {\n return null;\n }\n};\n\nconst deriveWorkspaceApiUrl = (backendUrl: string): string | null => {\n try {\n const parsedUrl = new URL(backendUrl);\n const match = parsedUrl.hostname.match(\n /^(?<prefix>.+)--8000\\.(?<domain>app\\.athenaintel\\.com|staging-app\\.athenaintel\\.com)$/,\n );\n\n if (!match?.groups?.prefix || !match.groups.domain) {\n return null;\n }\n\n return `${parsedUrl.protocol}//${match.groups.prefix}--8787.${match.groups.domain}`;\n } catch {\n return null;\n }\n};\n\nexport function getAthenaEnvironmentUrls({\n environment = DEFAULT_ATHENA_ENVIRONMENT,\n}: {\n environment?: AthenaEnvironment;\n} = {}): AthenaEnvironmentUrls {\n return ATHENA_ENVIRONMENT_URLS[environment];\n}\n\n/**\n * Resolve the Iris origin that fronts a known Agora backend.\n *\n * Unknown custom backends deliberately return `null`: callers can preserve a\n * direct-Agora fallback instead of accidentally sending a custom environment's\n * bearer token and traffic through production Iris.\n */\nexport function deriveAthenaApiUrl({\n backendUrl,\n}: {\n backendUrl?: string | null;\n}): string | null {\n if (!backendUrl) return null;\n\n const workspaceApiUrl = deriveWorkspaceApiUrl(backendUrl);\n if (workspaceApiUrl) return workspaceApiUrl;\n\n try {\n const parsedUrl = new URL(backendUrl);\n if (parsedUrl.hostname === 'api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.production.apiUrl;\n }\n if (parsedUrl.hostname === 'staging-api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.staging.apiUrl;\n }\n if (parsedUrl.hostname === 'localhost' || parsedUrl.hostname === '127.0.0.1') {\n parsedUrl.port = '8787';\n return parsedUrl.origin;\n }\n } catch {\n return null;\n }\n\n return null;\n}\n\nexport function deriveAthenaAppUrl({\n apiUrl,\n backendUrl,\n}: {\n apiUrl?: string | null;\n backendUrl?: string | null;\n}): string | null {\n if (backendUrl) {\n const workspaceAppUrl = deriveWorkspaceAppUrl({\n sourceUrl: backendUrl,\n sourcePort: '8000',\n });\n if (workspaceAppUrl) return workspaceAppUrl;\n\n const backendHostname = getHostname(backendUrl);\n if (backendHostname === 'api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.production.appUrl;\n }\n if (backendHostname === 'staging-api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.staging.appUrl;\n }\n }\n\n if (apiUrl) {\n const workspaceAppUrl = deriveWorkspaceAppUrl({\n sourceUrl: apiUrl,\n sourcePort: '8787',\n });\n if (workspaceAppUrl) return workspaceAppUrl;\n\n const apiHostname = getHostname(apiUrl);\n if (apiHostname === 'iris.prd.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.production.appUrl;\n }\n if (apiHostname === 'iris.stg.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.staging.appUrl;\n }\n }\n\n return null;\n}\n\nexport function createAthenaSpacesUrl({\n appUrl = DEFAULT_APP_URL,\n assetIds,\n sessionId,\n}: {\n appUrl?: string;\n assetIds?: string | string[];\n sessionId?: string;\n}): string {\n const url = new URL(SPACES_PATHNAME, createUrlWithFallback(appUrl, DEFAULT_APP_URL));\n\n if (assetIds) {\n const normalizedAssetIds = (Array.isArray(assetIds) ? assetIds : [assetIds])\n .map((assetId) => assetId.trim())\n .filter((assetId) => assetId.length > 0);\n\n if (normalizedAssetIds.length > 0) {\n url.searchParams.set('asset_ids', normalizedAssetIds.join(','));\n }\n }\n\n if (sessionId) {\n url.searchParams.set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,IAAI,WAAW,CAAC,QAAQ,GACvE,IAAI,CAAC,YAAY,QAAQ,MAAM,EAC/B,OAAO,CAAC,YAAY,QAAQ,SAAS,CAAC;AAEzC,QAAI,mBAAmB,SAAS,GAAG;AACjC,UAAI,aAAa,IAAI,aAAa,mBAAmB,KAAK,GAAG,CAAC;AAAA,IAChE;AAAA,EACF;AAEA,MAAI,WAAW;AACb,QAAI,aAAa,IAAI,cAAc,SAAS;AAAA,EAC9C;AAEA,SAAO,IAAI,SAAA;AACb;"}
1
+ {"version":3,"file":"athena-urls.js","sources":["../../src/lib/athena-urls.ts"],"sourcesContent":["export type AthenaEnvironment = 'production' | 'staging';\n\nexport interface AthenaEnvironmentUrls {\n apiUrl: string;\n backendUrl: string;\n appUrl: string;\n}\n\n/**\n * Bare origins: `apiUrl` is the Iris host fronting the deployment (its origin\n * derives the `/v2/threads` statewire mount) and `backendUrl` is the Agora\n * REST base. Neither carries a path — `deriveStatewireSyncUrl` and the REST\n * helpers append their own.\n */\nconst ATHENA_ENVIRONMENT_URLS: Record<AthenaEnvironment, AthenaEnvironmentUrls> = {\n production: {\n apiUrl: 'https://iris.prd.athenaintel.com',\n backendUrl: 'https://api.athenaintel.com',\n appUrl: 'https://app.athenaintel.com',\n },\n staging: {\n apiUrl: 'https://iris.stg.athenaintel.com',\n backendUrl: 'https://staging-api.athenaintel.com',\n appUrl: 'https://staging-app.athenaintel.com',\n },\n};\n\nexport const DEFAULT_ATHENA_ENVIRONMENT: AthenaEnvironment = 'production';\nexport const DEFAULT_APP_URL = ATHENA_ENVIRONMENT_URLS.production.appUrl;\n/** Production statewire sync endpoint — the same host the mobile app and\n * Chrome extension ship as their production statewire base. Exported as a\n * constant for explicit configuration; it is deliberately NOT used as an\n * implicit fallback (see {@link resolveStatewireSyncUrl}). */\nexport const DEFAULT_STATEWIRE_SYNC_URL = 'https://iris.prd.athenaintel.com/v2/threads';\n\nconst STATEWIRE_SYNC_PATHNAME = '/v2/threads';\n\n/**\n * Derive the statewire sync endpoint (the `…/v2/threads` mount) from the Iris\n * host's origin: staging `https://iris.stg.athenaintel.com` maps to\n * `https://iris.stg.athenaintel.com/v2/threads`, and likewise for production\n * and workspace Iris hosts (a URL still carrying the retired `/api/chat` path\n * resolves the same way). Unparseable inputs return `null` so callers can\n * fall back explicitly.\n */\nexport function deriveStatewireSyncUrl({\n apiUrl,\n}: {\n apiUrl?: string | null;\n}): string | null {\n if (!apiUrl) return null;\n\n try {\n const parsedUrl = new URL(apiUrl);\n return `${parsedUrl.origin}${STATEWIRE_SYNC_PATHNAME}`;\n } catch {\n return null;\n }\n}\n\n/**\n * Resolve the statewire sync endpoint for a provider configuration: an\n * explicit `statewireSyncUrl` wins, otherwise it is derived from the\n * effective `apiUrl` host.\n *\n * When neither yields a URL this throws instead of falling back to an Athena\n * default — mirroring `deriveAthenaApiUrl`'s null-for-unknown-hosts rule, so\n * a misconfigured custom deployment can never silently send its bearer token\n * or API key to Athena production.\n */\nexport function resolveStatewireSyncUrl({\n statewireSyncUrl,\n apiUrl,\n}: {\n statewireSyncUrl?: string;\n apiUrl?: string | null;\n}): string {\n if (statewireSyncUrl) return statewireSyncUrl;\n\n const derived = deriveStatewireSyncUrl({ apiUrl });\n if (derived) return derived;\n\n throw new Error(\n `[AthenaSDK] transport 'statewire' could not derive a sync URL from apiUrl (${JSON.stringify(\n apiUrl ?? null,\n )}). Pass an explicit statewireSyncUrl (the …/v2/threads mount). Credentials are never sent to a default host.`,\n );\n}\n\n/**\n * Refuse to attach a host-authenticated app to a guessed host. A host that\n * answered the auth bridge (a `/_athena/auth` mint, an `athena-config`\n * message) but minted no statewire mount predates the statewire-native\n * mint; without an explicit `statewireSyncUrl` or `apiUrl` the provider\n * would otherwise fall back to the environment preset and send that host's\n * credential to managed-cloud Athena. No host answering at all is not this\n * case: the preset is the documented default for a standalone app.\n */\nexport function assertHostMintedStatewireMount({\n hostAnswered,\n hostStatewireSyncUrl,\n statewireSyncUrl,\n apiUrl,\n}: {\n hostAnswered: boolean;\n hostStatewireSyncUrl: string | null;\n statewireSyncUrl?: string;\n apiUrl?: string;\n}): void {\n if (!hostAnswered || hostStatewireSyncUrl || statewireSyncUrl || apiUrl) return;\n throw new Error(\n '[AthenaSDK] The host answered the auth bridge without a statewire sync mount (statewireSyncUrl) the SDK accepted: either the host predates the statewire-native mint (update it: Marathon >= 2026-08-29), or the parent page sent a URL the SDK refused (see the auth.bridge.config_rejected diagnostics event: it must be https, on an Athena host or under the parent page\\'s own domain). Or configure statewireSyncUrl / apiUrl explicitly. Credentials are never sent to a default host.',\n );\n}\n\nconst MARATHON_APP_PORT = '8082';\nconst SPACES_PATHNAME = 'dashboard/spaces/';\n\nconst normalizeBaseUrl = (url: string): string => url.replace(/\\/+$/, '');\n\nconst createUrlWithFallback = (url: string, fallbackUrl: string): URL => {\n try {\n return new URL(`${normalizeBaseUrl(url)}/`);\n } catch {\n return new URL(`${normalizeBaseUrl(fallbackUrl)}/`);\n }\n};\n\nconst getHostname = (value?: string | null): string | null => {\n if (!value) return null;\n\n try {\n return new URL(value).hostname;\n } catch {\n return null;\n }\n};\n\nconst deriveWorkspaceAppUrl = ({\n sourceUrl,\n sourcePort,\n}: {\n sourceUrl: string;\n sourcePort: '8000' | '8787';\n}): string | null => {\n try {\n const parsedUrl = new URL(sourceUrl);\n const match = parsedUrl.hostname.match(\n new RegExp(`^(?<prefix>.+)--${sourcePort}\\\\.(?<domain>app\\\\.athenaintel\\\\.com|staging-app\\\\.athenaintel\\\\.com)$`),\n );\n\n if (!match?.groups?.prefix || !match.groups.domain) {\n return null;\n }\n\n return `${parsedUrl.protocol}//${match.groups.prefix}--${MARATHON_APP_PORT}.${match.groups.domain}`;\n } catch {\n return null;\n }\n};\n\nconst deriveWorkspaceApiUrl = (backendUrl: string): string | null => {\n try {\n const parsedUrl = new URL(backendUrl);\n const match = parsedUrl.hostname.match(\n /^(?<prefix>.+)--8000\\.(?<domain>app\\.athenaintel\\.com|staging-app\\.athenaintel\\.com)$/,\n );\n\n if (!match?.groups?.prefix || !match.groups.domain) {\n return null;\n }\n\n return `${parsedUrl.protocol}//${match.groups.prefix}--8787.${match.groups.domain}`;\n } catch {\n return null;\n }\n};\n\nexport function getAthenaEnvironmentUrls({\n environment = DEFAULT_ATHENA_ENVIRONMENT,\n}: {\n environment?: AthenaEnvironment;\n} = {}): AthenaEnvironmentUrls {\n return ATHENA_ENVIRONMENT_URLS[environment];\n}\n\n/**\n * Resolve the Iris origin that fronts a known Agora backend.\n *\n * Unknown custom backends deliberately return `null`: callers can preserve a\n * direct-Agora fallback instead of accidentally sending a custom environment's\n * bearer token and traffic through production Iris.\n */\nexport function deriveAthenaApiUrl({\n backendUrl,\n}: {\n backendUrl?: string | null;\n}): string | null {\n if (!backendUrl) return null;\n\n const workspaceApiUrl = deriveWorkspaceApiUrl(backendUrl);\n if (workspaceApiUrl) return workspaceApiUrl;\n\n try {\n const parsedUrl = new URL(backendUrl);\n if (parsedUrl.hostname === 'api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.production.apiUrl;\n }\n if (parsedUrl.hostname === 'staging-api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.staging.apiUrl;\n }\n if (parsedUrl.hostname === 'localhost' || parsedUrl.hostname === '127.0.0.1') {\n parsedUrl.port = '8787';\n return parsedUrl.origin;\n }\n } catch {\n return null;\n }\n\n return null;\n}\n\nexport function deriveAthenaAppUrl({\n apiUrl,\n backendUrl,\n}: {\n apiUrl?: string | null;\n backendUrl?: string | null;\n}): string | null {\n if (backendUrl) {\n const workspaceAppUrl = deriveWorkspaceAppUrl({\n sourceUrl: backendUrl,\n sourcePort: '8000',\n });\n if (workspaceAppUrl) return workspaceAppUrl;\n\n const backendHostname = getHostname(backendUrl);\n if (backendHostname === 'api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.production.appUrl;\n }\n if (backendHostname === 'staging-api.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.staging.appUrl;\n }\n }\n\n if (apiUrl) {\n const workspaceAppUrl = deriveWorkspaceAppUrl({\n sourceUrl: apiUrl,\n sourcePort: '8787',\n });\n if (workspaceAppUrl) return workspaceAppUrl;\n\n const apiHostname = getHostname(apiUrl);\n if (apiHostname === 'iris.prd.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.production.appUrl;\n }\n if (apiHostname === 'iris.stg.athenaintel.com') {\n return ATHENA_ENVIRONMENT_URLS.staging.appUrl;\n }\n }\n\n return null;\n}\n\nexport function createAthenaSpacesUrl({\n appUrl = DEFAULT_APP_URL,\n assetIds,\n sessionId,\n}: {\n appUrl?: string;\n assetIds?: string | string[];\n sessionId?: string;\n}): string {\n const url = new URL(SPACES_PATHNAME, createUrlWithFallback(appUrl, DEFAULT_APP_URL));\n\n if (assetIds) {\n const normalizedAssetIds = (Array.isArray(assetIds) ? assetIds : [assetIds])\n .map((assetId) => assetId.trim())\n .filter((assetId) => assetId.length > 0);\n\n if (normalizedAssetIds.length > 0) {\n url.searchParams.set('asset_ids', normalizedAssetIds.join(','));\n }\n }\n\n if (sessionId) {\n url.searchParams.set('session_id', sessionId);\n }\n\n return url.toString();\n}\n"],"names":[],"mappings":"AAcA,MAAM,0BAA4E;AAAA,EAChF,YAAY;AAAA,IACV,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EAAA;AAAA,EAEV,SAAS;AAAA,IACP,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EAAA;AAEZ;AAEO,MAAM,6BAAgD;AACtD,MAAM,kBAAkB,wBAAwB,WAAW;AAK3D,MAAM,6BAA6B;AAE1C,MAAM,0BAA0B;AAUzB,SAAS,uBAAuB;AAAA,EACrC;AACF,GAEkB;AAChB,MAAI,CAAC,OAAQ,QAAO;AAEpB,MAAI;AACF,UAAM,YAAY,IAAI,IAAI,MAAM;AAChC,WAAO,GAAG,UAAU,MAAM,GAAG,uBAAuB;AAAA,EACtD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAY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U;AAC9C,QAAI,oBAAoB,uBAAuB;AAC7C,aAAO,wBAAwB,WAAW;AAAA,IAC5C;AACA,QAAI,oBAAoB,+BAA+B;AACrD,aAAO,wBAAwB,QAAQ;AAAA,IACzC;AAAA,EACF;AAEA,MAAI,QAAQ;AACV,UAAM,kBAAkB,sBAAsB;AAAA,MAC5C,WAAW;AAAA,MACX,YAAY;AAAA,IAAA,CACb;AACD,QAAI,gBAAiB,QAAO;AAE5B,UAAM,cAAc,YAAY,MAAM;AACtC,QAAI,gBAAgB,4BAA4B;AAC9C,aAAO,wBAAwB,WAAW;AAAA,IAC5C;AACA,QAAI,gBAAgB,4BAA4B;AAC9C,aAAO,wBAAwB,QAAQ;AAAA,IACzC;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,sBAAsB;AAAA,EACpC,SAAS;AAAA,EACT;AAAA,EACA;AACF,GAIW;AACT,QAAM,MAAM,IAAI,IAAI,iBAAiB,sBAAsB,QAAQ,eAAe,CAAC;AAEnF,MAAI,UAAU;AACZ,UAAM,sBAAsB,MAAM,QAAQ,QAAQ,IAAI,WAAW,CAAC,QAAQ,GACvE,IAAI,CAAC,YAAY,QAAQ,MAAM,EAC/B,OAAO,CAAC,YAAY,QAAQ,SAAS,CAAC;AAEzC,QAAI,mBAAmB,SAAS,GAAG;AACjC,UAAI,aAAa,IAAI,aAAa,mBAAmB,KAAK,GAAG,CAAC;AAAA,IAChE;AAAA,EACF;AAEA,MAAI,WAAW;AACb,QAAI,aAAa,IAAI,cAAc,SAAS;AAAA,EAC9C;AAEA,SAAO,IAAI,SAAA;AACb;"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const SENSITIVE_FIELD_HINT = /password|passphrase|passcode|secret|token|api[\s_-]?key|private[\s_-]?key|access[\s_-]?key|credential|bearer|one-time-code|\b(otp|pat|ssn|cvc|cvv)\b/i;
4
+ const SENSITIVE_VALUE_PATTERN_LIST = [
5
+ /-----BEGIN [A-Z ]+-----/,
6
+ /\beyJ[\w-]{8,}\.[\w-]{8,}\./,
7
+ /"private_key"\s*:/,
8
+ /\b(sk|pk|rk)[-_][\w-]{16,}/,
9
+ /\b(ghp|gho|ghu|ghs|ghr|github_pat)_[A-Za-z0-9_]{20,}/,
10
+ /\bxox[abposr]-[\w-]{10,}/,
11
+ /\bAKIA[0-9A-Z]{16}\b/,
12
+ /\bAIza[\w-]{35}\b/
13
+ ];
14
+ const HINT_ATTRIBUTE_LIST = ["type", "name", "id", "autocomplete", "placeholder", "aria-label"];
15
+ function fieldHintText(element) {
16
+ const attributes = HINT_ATTRIBUTE_LIST.map((name) => element.getAttribute(name) ?? "");
17
+ const labels = "labels" in element && element.labels instanceof NodeList ? Array.from(element.labels, (label) => label.textContent ?? "") : [];
18
+ return [...attributes, ...labels].join(" ");
19
+ }
20
+ function isSensitiveInput({
21
+ text,
22
+ element
23
+ }) {
24
+ if (SENSITIVE_VALUE_PATTERN_LIST.some((pattern) => pattern.test(text))) return true;
25
+ if (!element) return false;
26
+ if (element.hasAttribute("data-rr-is-password") || element.closest(".ph-mask")) return true;
27
+ return SENSITIVE_FIELD_HINT.test(fieldHintText(element));
28
+ }
29
+ function maskSensitiveInput(text, element) {
30
+ return isSensitiveInput({ text, element }) ? "*".repeat(text.length) : text;
31
+ }
32
+ exports.isSensitiveInput = isSensitiveInput;
33
+ exports.maskSensitiveInput = maskSensitiveInput;
34
+ //# sourceMappingURL=mask-sensitive-input.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-sensitive-input.cjs","sources":["../../../src/lib/posthog/mask-sensitive-input.ts"],"sourcesContent":["/**\n * Mirror of `olympus/src/lib/posthog/mask-sensitive-input.ts` (the source of\n * truth); keep the two in sync.\n *\n * Session-replay input masking. Replays record what users type so searches and\n * form entries are readable, but any field that looks like it holds a\n * credential is masked: password inputs, fields whose name/label/placeholder\n * mentions a secret, anything inside `.ph-mask`, and values shaped like a key\n * or token (PEM blocks, JWTs, common API-key prefixes). Use `.ph-no-capture`\n * to drop a whole region from replays instead.\n */\nconst SENSITIVE_FIELD_HINT =\n /password|passphrase|passcode|secret|token|api[\\s_-]?key|private[\\s_-]?key|access[\\s_-]?key|credential|bearer|one-time-code|\\b(otp|pat|ssn|cvc|cvv)\\b/i;\n\nconst SENSITIVE_VALUE_PATTERN_LIST = [\n /-----BEGIN [A-Z ]+-----/,\n /\\beyJ[\\w-]{8,}\\.[\\w-]{8,}\\./,\n /\"private_key\"\\s*:/,\n /\\b(sk|pk|rk)[-_][\\w-]{16,}/,\n /\\b(ghp|gho|ghu|ghs|ghr|github_pat)_[A-Za-z0-9_]{20,}/,\n /\\bxox[abposr]-[\\w-]{10,}/,\n /\\bAKIA[0-9A-Z]{16}\\b/,\n /\\bAIza[\\w-]{35}\\b/,\n];\n\nconst HINT_ATTRIBUTE_LIST = ['type', 'name', 'id', 'autocomplete', 'placeholder', 'aria-label'];\n\nfunction fieldHintText(element: HTMLElement): string {\n const attributes = HINT_ATTRIBUTE_LIST.map((name) => element.getAttribute(name) ?? '');\n const labels =\n 'labels' in element && element.labels instanceof NodeList\n ? Array.from(element.labels, (label) => label.textContent ?? '')\n : [];\n return [...attributes, ...labels].join(' ');\n}\n\nexport function isSensitiveInput({\n text,\n element,\n}: {\n text: string;\n element?: HTMLElement;\n}): boolean {\n if (SENSITIVE_VALUE_PATTERN_LIST.some((pattern) => pattern.test(text))) return true;\n if (!element) return false;\n if (element.hasAttribute('data-rr-is-password') || element.closest('.ph-mask')) return true;\n return SENSITIVE_FIELD_HINT.test(fieldHintText(element));\n}\n\n/**\n * Mirror of `olympus/src/lib/posthog/mask-sensitive-input.ts` (the source of\n * truth); keep the two in sync.\n * posthog-js `session_recording.maskInputFn`; requires `maskAllInputs: true`. */\nexport function maskSensitiveInput(text: string, element?: HTMLElement): string {\n return isSensitiveInput({ text, element }) ? '*'.repeat(text.length) : text;\n}\n"],"names":[],"mappings":";;AAWA,MAAM,uBACJ;AAEF,MAAM,+BAA+B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,sBAAsB,CAAC,QAAQ,QAAQ,MAAM,gBAAgB,eAAe,YAAY;AAE9F,SAAS,cAAc,SAA8B;AACnD,QAAM,aAAa,oBAAoB,IAAI,CAAC,SAAS,QAAQ,aAAa,IAAI,KAAK,EAAE;AACrF,QAAM,SACJ,YAAY,WAAW,QAAQ,kBAAkB,WAC7C,MAAM,KAAK,QAAQ,QAAQ,CAAC,UAAU,MAAM,eAAe,EAAE,IAC7D,CAAA;AACN,SAAO,CAAC,GAAG,YAAY,GAAG,MAAM,EAAE,KAAK,GAAG;AAC5C;AAEO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AACF,GAGY;AACV,MAAI,6BAA6B,KAAK,CAAC,YAAY,QAAQ,KAAK,IAAI,CAAC,EAAG,QAAO;AAC/E,MAAI,CAAC,QAAS,QAAO;AACrB,MAAI,QAAQ,aAAa,qBAAqB,KAAK,QAAQ,QAAQ,UAAU,EAAG,QAAO;AACvF,SAAO,qBAAqB,KAAK,cAAc,OAAO,CAAC;AACzD;AAMO,SAAS,mBAAmB,MAAc,SAA+B;AAC9E,SAAO,iBAAiB,EAAE,MAAM,QAAA,CAAS,IAAI,IAAI,OAAO,KAAK,MAAM,IAAI;AACzE;;;"}
@@ -0,0 +1,9 @@
1
+ export declare function isSensitiveInput({ text, element, }: {
2
+ text: string;
3
+ element?: HTMLElement;
4
+ }): boolean;
5
+ /**
6
+ * Mirror of `olympus/src/lib/posthog/mask-sensitive-input.ts` (the source of
7
+ * truth); keep the two in sync.
8
+ * posthog-js `session_recording.maskInputFn`; requires `maskAllInputs: true`. */
9
+ export declare function maskSensitiveInput(text: string, element?: HTMLElement): string;
@@ -0,0 +1,34 @@
1
+ const SENSITIVE_FIELD_HINT = /password|passphrase|passcode|secret|token|api[\s_-]?key|private[\s_-]?key|access[\s_-]?key|credential|bearer|one-time-code|\b(otp|pat|ssn|cvc|cvv)\b/i;
2
+ const SENSITIVE_VALUE_PATTERN_LIST = [
3
+ /-----BEGIN [A-Z ]+-----/,
4
+ /\beyJ[\w-]{8,}\.[\w-]{8,}\./,
5
+ /"private_key"\s*:/,
6
+ /\b(sk|pk|rk)[-_][\w-]{16,}/,
7
+ /\b(ghp|gho|ghu|ghs|ghr|github_pat)_[A-Za-z0-9_]{20,}/,
8
+ /\bxox[abposr]-[\w-]{10,}/,
9
+ /\bAKIA[0-9A-Z]{16}\b/,
10
+ /\bAIza[\w-]{35}\b/
11
+ ];
12
+ const HINT_ATTRIBUTE_LIST = ["type", "name", "id", "autocomplete", "placeholder", "aria-label"];
13
+ function fieldHintText(element) {
14
+ const attributes = HINT_ATTRIBUTE_LIST.map((name) => element.getAttribute(name) ?? "");
15
+ const labels = "labels" in element && element.labels instanceof NodeList ? Array.from(element.labels, (label) => label.textContent ?? "") : [];
16
+ return [...attributes, ...labels].join(" ");
17
+ }
18
+ function isSensitiveInput({
19
+ text,
20
+ element
21
+ }) {
22
+ if (SENSITIVE_VALUE_PATTERN_LIST.some((pattern) => pattern.test(text))) return true;
23
+ if (!element) return false;
24
+ if (element.hasAttribute("data-rr-is-password") || element.closest(".ph-mask")) return true;
25
+ return SENSITIVE_FIELD_HINT.test(fieldHintText(element));
26
+ }
27
+ function maskSensitiveInput(text, element) {
28
+ return isSensitiveInput({ text, element }) ? "*".repeat(text.length) : text;
29
+ }
30
+ export {
31
+ isSensitiveInput,
32
+ maskSensitiveInput
33
+ };
34
+ //# sourceMappingURL=mask-sensitive-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-sensitive-input.js","sources":["../../../src/lib/posthog/mask-sensitive-input.ts"],"sourcesContent":["/**\n * Mirror of `olympus/src/lib/posthog/mask-sensitive-input.ts` (the source of\n * truth); keep the two in sync.\n *\n * Session-replay input masking. Replays record what users type so searches and\n * form entries are readable, but any field that looks like it holds a\n * credential is masked: password inputs, fields whose name/label/placeholder\n * mentions a secret, anything inside `.ph-mask`, and values shaped like a key\n * or token (PEM blocks, JWTs, common API-key prefixes). Use `.ph-no-capture`\n * to drop a whole region from replays instead.\n */\nconst SENSITIVE_FIELD_HINT =\n /password|passphrase|passcode|secret|token|api[\\s_-]?key|private[\\s_-]?key|access[\\s_-]?key|credential|bearer|one-time-code|\\b(otp|pat|ssn|cvc|cvv)\\b/i;\n\nconst SENSITIVE_VALUE_PATTERN_LIST = [\n /-----BEGIN [A-Z ]+-----/,\n /\\beyJ[\\w-]{8,}\\.[\\w-]{8,}\\./,\n /\"private_key\"\\s*:/,\n /\\b(sk|pk|rk)[-_][\\w-]{16,}/,\n /\\b(ghp|gho|ghu|ghs|ghr|github_pat)_[A-Za-z0-9_]{20,}/,\n /\\bxox[abposr]-[\\w-]{10,}/,\n /\\bAKIA[0-9A-Z]{16}\\b/,\n /\\bAIza[\\w-]{35}\\b/,\n];\n\nconst HINT_ATTRIBUTE_LIST = ['type', 'name', 'id', 'autocomplete', 'placeholder', 'aria-label'];\n\nfunction fieldHintText(element: HTMLElement): string {\n const attributes = HINT_ATTRIBUTE_LIST.map((name) => element.getAttribute(name) ?? '');\n const labels =\n 'labels' in element && element.labels instanceof NodeList\n ? Array.from(element.labels, (label) => label.textContent ?? '')\n : [];\n return [...attributes, ...labels].join(' ');\n}\n\nexport function isSensitiveInput({\n text,\n element,\n}: {\n text: string;\n element?: HTMLElement;\n}): boolean {\n if (SENSITIVE_VALUE_PATTERN_LIST.some((pattern) => pattern.test(text))) return true;\n if (!element) return false;\n if (element.hasAttribute('data-rr-is-password') || element.closest('.ph-mask')) return true;\n return SENSITIVE_FIELD_HINT.test(fieldHintText(element));\n}\n\n/**\n * Mirror of `olympus/src/lib/posthog/mask-sensitive-input.ts` (the source of\n * truth); keep the two in sync.\n * posthog-js `session_recording.maskInputFn`; requires `maskAllInputs: true`. */\nexport function maskSensitiveInput(text: string, element?: HTMLElement): string {\n return isSensitiveInput({ text, element }) ? '*'.repeat(text.length) : text;\n}\n"],"names":[],"mappings":"AAWA,MAAM,uBACJ;AAEF,MAAM,+BAA+B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,sBAAsB,CAAC,QAAQ,QAAQ,MAAM,gBAAgB,eAAe,YAAY;AAE9F,SAAS,cAAc,SAA8B;AACnD,QAAM,aAAa,oBAAoB,IAAI,CAAC,SAAS,QAAQ,aAAa,IAAI,KAAK,EAAE;AACrF,QAAM,SACJ,YAAY,WAAW,QAAQ,kBAAkB,WAC7C,MAAM,KAAK,QAAQ,QAAQ,CAAC,UAAU,MAAM,eAAe,EAAE,IAC7D,CAAA;AACN,SAAO,CAAC,GAAG,YAAY,GAAG,MAAM,EAAE,KAAK,GAAG;AAC5C;AAEO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AACF,GAGY;AACV,MAAI,6BAA6B,KAAK,CAAC,YAAY,QAAQ,KAAK,IAAI,CAAC,EAAG,QAAO;AAC/E,MAAI,CAAC,QAAS,QAAO;AACrB,MAAI,QAAQ,aAAa,qBAAqB,KAAK,QAAQ,QAAQ,UAAU,EAAG,QAAO;AACvF,SAAO,qBAAqB,KAAK,cAAc,OAAO,CAAC;AACzD;AAMO,SAAS,mBAAmB,MAAc,SAA+B;AAC9E,SAAO,iBAAiB,EAAE,MAAM,QAAA,CAAS,IAAI,IAAI,OAAO,KAAK,MAAM,IAAI;AACzE;"}
@@ -24,7 +24,7 @@ function useConversationIndex({
24
24
  headers,
25
25
  enabled = true
26
26
  }) {
27
- var _a, _b, _c;
27
+ var _a, _b, _c, _d;
28
28
  const headersRef = react.useRef(headers);
29
29
  headersRef.current = headers;
30
30
  const indexId = conversationIndexId({ workspaceId, userId });
@@ -78,6 +78,7 @@ function useConversationIndex({
78
78
  entries: ((_a = client.state) == null ? void 0 : _a.conversations) ?? null,
79
79
  hasNextPage: ((_b = client.state) == null ? void 0 : _b.has_more) ?? false,
80
80
  totalCount: ((_c = client.state) == null ? void 0 : _c.total_count) ?? null,
81
+ watchActivity: ((_d = client.state) == null ? void 0 : _d.watch_activity) ?? null,
81
82
  connection: client.connection,
82
83
  refresh,
83
84
  loadMore
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-index.cjs","sources":["../../../../../agent-runtime/src/conversation-index.ts"],"sourcesContent":["import { withKey } from '@assistant-ui/tap';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useStatewire, type StatewireClient } from 'statewire';\nimport { initialAuthDenialTrackerState, observeAuthDenial } from './auth-denial';\nimport type { ConversationAttention, ConversationAttentionSource } from './conversation-list';\nimport { projectDeepAgentConnection } from './errors';\nimport { StatewireSuspended } from './statewire-suspended';\nimport { statewireTransport } from './statewire-transport';\nimport type { DeepAgentHeadersResolver } from './use-deep-agent-thread';\n\n/**\n * Client side of the conversation-index statewire (issue #29088): agora\n * replicates the newest page of one viewer's conversation list as one state\n * object, so thread creation / lifecycle / title changes arrive as ops\n * instead of newest-page polling. The replicated rows are renderable and the\n * typed commands extend or refresh the inclusive window; reconnects are free\n * because the protocol's snapshot-first attach IS the newest-page reconcile.\n *\n * A viewer is a `(workspaceId, userId)` pair and every pair is its own\n * instance (`/conversation-index/<workspaceId>-<userId>`): workspaces are\n * tenants, so a tab in one workspace never shares a window with a tab in\n * another, and switching workspaces attaches to a different instance instead\n * of retagging the one other tabs are still reading.\n */\nexport interface ConversationIndexEntry {\n thread_id: string;\n title: string;\n updated_at: string;\n state: string | null;\n runtime: string | null;\n start_channel: string | null;\n asset_type: string;\n asset_id: string | null;\n app_id: string | null;\n trigger_type: string | null;\n last_message_preview: string | null;\n message_count: number | null;\n is_unread: boolean | null;\n /**\n * Canonical status_v2 planes, present once the publishing agora reports them\n * (absent from snapshots replicated by an older pod during a rollout).\n */\n session_status?: string | null;\n run_status?: string | null;\n /**\n * The viewer's attention state and its one-line next action, present once\n * the publishing agora derives them (absent from snapshots replicated by\n * an older pod). Pull-request state is never pushed — it rides the list\n * fetch only (`include_pull_requests`).\n */\n attention?: ConversationAttention | null;\n next_action?: string | null;\n attention_source?: ConversationAttentionSource | null;\n is_favorited?: boolean | null;\n}\n\ninterface ConversationIndexState {\n conversations?: ConversationIndexEntry[];\n has_more?: boolean;\n total_count?: number;\n}\n\ninterface ConversationIndexCommands {\n [key: string]: (...args: never[]) => unknown;\n refresh(): void;\n load_more(): void;\n}\n\nexport interface UseConversationIndexOptions {\n /** Base URL of the conversation-index host (the `…/v2/conversation-index` mount). */\n baseUrl: string;\n /** The workspace being viewed — half of the instance id. Callers gate mounting on it. */\n workspaceId: string;\n /** The signed-in user's id — the other half. Callers gate mounting on it. */\n userId: string;\n /** Transport selection: SSE when true, WebSocket otherwise. */\n sse?: boolean;\n headers: DeepAgentHeadersResolver;\n /** Park the transport until the caller has a resolved principal. */\n enabled?: boolean;\n}\n\nexport interface UseConversationIndexResult {\n /** Newest-page entries, or `null` until the attach snapshot applies. */\n entries: ConversationIndexEntry[] | null;\n hasNextPage: boolean;\n totalCount: number | null;\n connection: StatewireClient.Connection;\n refresh: () => Promise<void>;\n loadMore: () => Promise<void>;\n}\n\n/** The conversation-index host is mounted beside the threads host. */\nexport function conversationIndexUrlFromStatewireUrl(statewireUrl: string): string {\n return statewireUrl.replace(/\\/threads\\/?$/, '/conversation-index');\n}\n\n/** Instance id of one viewer's index; mirrors agora's `conversation_index_id`. */\nexport function conversationIndexId({\n workspaceId,\n userId,\n}: {\n workspaceId: string;\n userId: string;\n}): string {\n return `${workspaceId}-${userId}`;\n}\n\n/**\n * Attach to the live conversation index of one `(workspace, user)` viewer.\n */\nexport function useConversationIndex({\n baseUrl,\n workspaceId,\n userId,\n sse = false,\n headers,\n enabled = true,\n}: UseConversationIndexOptions): UseConversationIndexResult {\n const headersRef = useRef(headers);\n headersRef.current = headers;\n const indexId = conversationIndexId({ workspaceId, userId });\n // Auth-denial park (same policy as the thread transport): the index is a\n // pure push signal, so after a streak of `unauthorized` denials the retry\n // loop stops instead of hammering the attach endpoint every 30s for as long\n // as the tab lives. A remount or the parked connection's `reconnect()`\n // re-arms it.\n const [parked, setParked] = useState<{ indexId: string; message: string | undefined } | null>(\n null\n );\n const denialRef = useRef({ indexId, state: initialAuthDenialTrackerState() });\n if (denialRef.current.indexId !== indexId) {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n }\n const isParked = parked !== null && parked.indexId === indexId;\n const client = useStatewire<ConversationIndexState | undefined, ConversationIndexCommands>({\n transport: withKey(\n indexId,\n !enabled || isParked\n ? StatewireSuspended<ConversationIndexCommands>({\n message:\n parked?.message ??\n (enabled\n ? 'Conversation index authorization was refused.'\n : 'Conversation index is waiting for a signed-in user and workspace.'),\n ...(enabled\n ? {\n onReconnectRequested: () => {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n setParked(null);\n },\n }\n : {}),\n })\n : statewireTransport<ConversationIndexState, ConversationIndexCommands>(\n {\n url: `${baseUrl.replace(/\\/+$/, '')}/${encodeURIComponent(indexId)}`,\n headers: (ctx: { staleAuth: boolean }) => headersRef.current(ctx),\n },\n { sse }\n )\n ),\n initialState: undefined,\n });\n // Observing during render is idempotent (the tracker dedupes by attempt\n // number), so a re-render of the same connection state cannot double-count.\n // The tracker consumes the projected vocabulary, never the raw connection.\n const denial = observeAuthDenial(\n denialRef.current.state,\n projectDeepAgentConnection(client.connection)\n );\n denialRef.current.state = denial.state;\n const shouldPark = denial.park;\n const parkMessage = denial.state.message;\n useEffect(() => {\n if (!enabled || !shouldPark) return;\n setParked((prev) =>\n prev?.indexId === indexId ? prev : { indexId, message: parkMessage }\n );\n }, [enabled, shouldPark, parkMessage, indexId]);\n const commandsRef = useRef(client.commands);\n commandsRef.current = client.commands;\n const refresh = useCallback(() => commandsRef.current.refresh(), []);\n const loadMore = useCallback(() => commandsRef.current.load_more(), []);\n return {\n entries: client.state?.conversations ?? null,\n hasNextPage: client.state?.has_more ?? false,\n totalCount: client.state?.total_count ?? null,\n connection: client.connection,\n refresh,\n loadMore,\n };\n}\n\n/**\n * Stable change fingerprint over the entries a list surface reacts to. An\n * empty string means \"no snapshot yet\" — effects keyed on the fingerprint\n * should treat it as a no-op rather than an empty list. An applied-but-empty\n * snapshot serializes to `'[]'`, so deleting the last conversation still\n * changes the fingerprint. JSON-encoding keeps arbitrary titles from\n * colliding across field or entry boundaries.\n */\nexport function conversationIndexFingerprint(\n entries: ConversationIndexEntry[] | null\n): string {\n if (entries === null) return '';\n return JSON.stringify(\n entries.map((entry) => [\n entry.thread_id,\n entry.updated_at,\n entry.state,\n entry.title,\n entry.run_status ?? null,\n entry.is_unread ?? null,\n entry.attention ?? null,\n entry.next_action ?? null,\n entry.attention_source ?? null,\n entry.is_favorited ?? null,\n ])\n );\n}\n"],"names":["useRef","useState","initialAuthDenialTrackerState","useStatewire","withKey","StatewireSuspended","statewireTransport","observeAuthDenial","projectDeepAgentConnection","useEffect","useCallback"],"mappings":";;;;;;;;;AA6FO,SAAS,qCAAqC,cAA8B;AACjF,SAAO,aAAa,QAAQ,iBAAiB,qBAAqB;AACpE;AAGO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AACF,GAGW;AACT,SAAO,GAAG,WAAW,IAAI,MAAM;AACjC;AAKO,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA,UAAU;AACZ,GAA4D;;AAC1D,QAAM,aAAaA,MAAAA,OAAO,OAAO;AACjC,aAAW,UAAU;AACrB,QAAM,UAAU,oBAAoB,EAAE,aAAa,QAAQ;AAM3D,QAAM,CAAC,QAAQ,SAAS,IAAIC,MAAAA;AAAAA,IAC1B;AAAA,EAAA;AAEF,QAAM,YAAYD,MAAAA,OAAO,EAAE,SAAS,OAAOE,WAAAA,8BAAA,GAAiC;AAC5E,MAAI,UAAU,QAAQ,YAAY,SAAS;AACzC,cAAU,UAAU,EAAE,SAAS,OAAOA,WAAAA,g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,UAAA,GAAa,EAAE;AACtE,SAAO;AAAA,IACL,WAAS,YAAO,UAAP,mBAAc,kBAAiB;AAAA,IACxC,eAAa,YAAO,UAAP,mBAAc,aAAY;AAAA,IACvC,cAAY,YAAO,UAAP,mBAAc,gBAAe;AAAA,IACzC,YAAY,OAAO;AAAA,IACnB;AAAA,IACA;AAAA,EAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"conversation-index.cjs","sources":["../../../../../agent-runtime/src/conversation-index.ts"],"sourcesContent":["import { withKey } from '@assistant-ui/tap';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useStatewire, type StatewireClient } from 'statewire';\nimport { initialAuthDenialTrackerState, observeAuthDenial } from './auth-denial';\nimport type { ConversationAttention, ConversationAttentionSource } from './conversation-list';\nimport { projectDeepAgentConnection } from './errors';\nimport { StatewireSuspended } from './statewire-suspended';\nimport { statewireTransport } from './statewire-transport';\nimport type { DeepAgentHeadersResolver } from './use-deep-agent-thread';\n\n/**\n * Client side of the conversation-index statewire (issue #29088): agora\n * replicates the newest page of one viewer's conversation list as one state\n * object, so thread creation / lifecycle / title changes arrive as ops\n * instead of newest-page polling. The replicated rows are renderable and the\n * typed commands extend or refresh the inclusive window; reconnects are free\n * because the protocol's snapshot-first attach IS the newest-page reconcile.\n *\n * A viewer is a `(workspaceId, userId)` pair and every pair is its own\n * instance (`/conversation-index/<workspaceId>-<userId>`): workspaces are\n * tenants, so a tab in one workspace never shares a window with a tab in\n * another, and switching workspaces attaches to a different instance instead\n * of retagging the one other tabs are still reading.\n */\nexport interface ConversationIndexEntry {\n thread_id: string;\n title: string;\n updated_at: string;\n state: string | null;\n runtime: string | null;\n start_channel: string | null;\n asset_type: string;\n asset_id: string | null;\n app_id: string | null;\n trigger_type: string | null;\n last_message_preview: string | null;\n message_count: number | null;\n is_unread: boolean | null;\n /**\n * Canonical status_v2 planes, present once the publishing agora reports them\n * (absent from snapshots replicated by an older pod during a rollout).\n */\n session_status?: string | null;\n run_status?: string | null;\n /**\n * The viewer's attention state and its one-line next action, present once\n * the publishing agora derives them (absent from snapshots replicated by\n * an older pod). Pull-request state is never pushed — it rides the list\n * fetch only (`include_pull_requests`).\n */\n attention?: ConversationAttention | null;\n next_action?: string | null;\n attention_source?: ConversationAttentionSource | null;\n is_favorited?: boolean | null;\n}\n\n/**\n * When one of this viewer's own asset subscriptions on a thread last queued or\n * settled an event: thread id → ISO instant. A contentless \"re-read now\" for\n * Olympus's Watching card, which reads what changed through its own gated\n * query; it never says what changed, who changed it, or where. Absent from an\n * older agora's snapshot.\n */\nexport type ConversationWatchActivity = Readonly<Record<string, string>>;\n\ninterface ConversationIndexState {\n conversations?: ConversationIndexEntry[];\n has_more?: boolean;\n total_count?: number;\n watch_activity?: ConversationWatchActivity;\n}\n\ninterface ConversationIndexCommands {\n [key: string]: (...args: never[]) => unknown;\n refresh(): void;\n load_more(): void;\n}\n\nexport interface UseConversationIndexOptions {\n /** Base URL of the conversation-index host (the `…/v2/conversation-index` mount). */\n baseUrl: string;\n /** The workspace being viewed — half of the instance id. Callers gate mounting on it. */\n workspaceId: string;\n /** The signed-in user's id — the other half. Callers gate mounting on it. */\n userId: string;\n /** Transport selection: SSE when true, WebSocket otherwise. */\n sse?: boolean;\n headers: DeepAgentHeadersResolver;\n /** Park the transport until the caller has a resolved principal. */\n enabled?: boolean;\n}\n\nexport interface UseConversationIndexResult {\n /** Newest-page entries, or `null` until the attach snapshot applies. */\n entries: ConversationIndexEntry[] | null;\n hasNextPage: boolean;\n totalCount: number | null;\n /**\n * The viewer's watch-activity stamps (see {@link ConversationWatchActivity});\n * `null` until the snapshot applies or when the host does not send them.\n */\n watchActivity: ConversationWatchActivity | null;\n connection: StatewireClient.Connection;\n refresh: () => Promise<void>;\n loadMore: () => Promise<void>;\n}\n\n/** The conversation-index host is mounted beside the threads host. */\nexport function conversationIndexUrlFromStatewireUrl(statewireUrl: string): string {\n return statewireUrl.replace(/\\/threads\\/?$/, '/conversation-index');\n}\n\n/** Instance id of one viewer's index; mirrors agora's `conversation_index_id`. */\nexport function conversationIndexId({\n workspaceId,\n userId,\n}: {\n workspaceId: string;\n userId: string;\n}): string {\n return `${workspaceId}-${userId}`;\n}\n\n/**\n * Attach to the live conversation index of one `(workspace, user)` viewer.\n */\nexport function useConversationIndex({\n baseUrl,\n workspaceId,\n userId,\n sse = false,\n headers,\n enabled = true,\n}: UseConversationIndexOptions): UseConversationIndexResult {\n const headersRef = useRef(headers);\n headersRef.current = headers;\n const indexId = conversationIndexId({ workspaceId, userId });\n // Auth-denial park (same policy as the thread transport): the index is a\n // pure push signal, so after a streak of `unauthorized` denials the retry\n // loop stops instead of hammering the attach endpoint every 30s for as long\n // as the tab lives. A remount or the parked connection's `reconnect()`\n // re-arms it.\n const [parked, setParked] = useState<{ indexId: string; message: string | undefined } | null>(\n null\n );\n const denialRef = useRef({ indexId, state: initialAuthDenialTrackerState() });\n if (denialRef.current.indexId !== indexId) {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n }\n const isParked = parked !== null && parked.indexId === indexId;\n const client = useStatewire<ConversationIndexState | undefined, ConversationIndexCommands>({\n transport: withKey(\n indexId,\n !enabled || isParked\n ? StatewireSuspended<ConversationIndexCommands>({\n message:\n parked?.message ??\n (enabled\n ? 'Conversation index authorization was refused.'\n : 'Conversation index is waiting for a signed-in user and workspace.'),\n ...(enabled\n ? {\n onReconnectRequested: () => {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n setParked(null);\n },\n }\n : {}),\n })\n : statewireTransport<ConversationIndexState, ConversationIndexCommands>(\n {\n url: `${baseUrl.replace(/\\/+$/, '')}/${encodeURIComponent(indexId)}`,\n headers: (ctx: { staleAuth: boolean }) => headersRef.current(ctx),\n },\n { sse }\n )\n ),\n initialState: undefined,\n });\n // Observing during render is idempotent (the tracker dedupes by attempt\n // number), so a re-render of the same connection state cannot double-count.\n // The tracker consumes the projected vocabulary, never the raw connection.\n const denial = observeAuthDenial(\n denialRef.current.state,\n projectDeepAgentConnection(client.connection)\n );\n denialRef.current.state = denial.state;\n const shouldPark = denial.park;\n const parkMessage = denial.state.message;\n useEffect(() => {\n if (!enabled || !shouldPark) return;\n setParked((prev) =>\n prev?.indexId === indexId ? prev : { indexId, message: parkMessage }\n );\n }, [enabled, shouldPark, parkMessage, indexId]);\n const commandsRef = useRef(client.commands);\n commandsRef.current = client.commands;\n const refresh = useCallback(() => commandsRef.current.refresh(), []);\n const loadMore = useCallback(() => commandsRef.current.load_more(), []);\n return {\n entries: client.state?.conversations ?? null,\n hasNextPage: client.state?.has_more ?? false,\n totalCount: client.state?.total_count ?? null,\n watchActivity: client.state?.watch_activity ?? null,\n connection: client.connection,\n refresh,\n loadMore,\n };\n}\n\n/**\n * Stable change fingerprint over a snapshot's watch-activity stamps: the\n * well-formed `[threadId, instant]` pairs, sorted by thread. An empty string\n * means \"nothing sent yet\" (no snapshot, or a host that predates the stamps),\n * so an effect keyed on it skips; an applied-but-empty map is `'[]'`.\n */\nexport function watchActivityFingerprint(activity: unknown): string {\n if (activity === null || typeof activity !== 'object' || Array.isArray(activity)) return '';\n return JSON.stringify(\n Object.entries(activity)\n .filter((entry): entry is [string, string] => typeof entry[1] === 'string')\n .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))\n );\n}\n\n/**\n * Stable change fingerprint over the entries a list surface reacts to. An\n * empty string means \"no snapshot yet\" — effects keyed on the fingerprint\n * should treat it as a no-op rather than an empty list. An applied-but-empty\n * snapshot serializes to `'[]'`, so deleting the last conversation still\n * changes the fingerprint. JSON-encoding keeps arbitrary titles from\n * colliding across field or entry boundaries.\n */\nexport function conversationIndexFingerprint(\n entries: ConversationIndexEntry[] | null\n): string {\n if (entries === null) return '';\n return JSON.stringify(\n entries.map((entry) => [\n entry.thread_id,\n entry.updated_at,\n entry.state,\n entry.title,\n entry.run_status ?? null,\n entry.is_unread ?? null,\n entry.attention ?? null,\n entry.next_action ?? null,\n entry.attention_source ?? null,\n entry.is_favorited ?? null,\n ])\n );\n}\n"],"names":["useRef","useState","initialAuthDenialTrackerState","useStatewire","withKey","StatewireSuspended","statewireTransport","observeAuthDenial","projectDeepAgentConnection","useEffect","useCallback"],"mappings":";;;;;;;;;AA4GO,SAAS,qCAAqC,cAA8B;AACjF,SAAO,aAAa,QAAQ,iBAAiB,qBAAqB;AACpE;AAGO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AACF,GAGW;AACT,SAAO,GAAG,WAAW,IAAI,MAAM;AACjC;AAKO,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA,UAAU;AACZ,GAA4D;;AAC1D,QAAM,aAAaA,MAAAA,OAAO,OAAO;AACjC,aAAW,UAAU;AACrB,QAAM,UAAU,oBAAoB,EAAE,aAAa,QAAQ;AAM3D,QAAM,CAAC,QAAQ,SAAS,IAAIC,MAAAA;AAAAA,IAC1B;AAAA,EAAA;AAEF,QAAM,YAAYD,MAAAA,OAAO,EAAE,SAAS,OAAOE,WAAAA,8BAAA,GAAiC;AAC5E,MAAI,UAAU,QAAQ,YAAY,SAAS;AACzC,cAAU,UAAU,EAAE,SAAS,OAAOA,WAAAA,gCAA8B;AAAA,EACtE;AACA,QAAM,WAAW,WAAW,QAAQ,OAAO,YAAY;AACvD,QAAM,SAASC,UAAAA,aAA4E;AAAA,IACzF,WAAWC,IAAAA;AAAAA,MACT;AAAA,MACA,CAAC,WAAW,WACRC,sCAA8C;AAAA,QAC5C,UACE,iCAAQ,aACP,UACG,kDACA;AAAA,QACN,GAAI,UACA;AAAA,UACE,sBAAsB,MAAM;AAC1B,sBAAU,UAAU,EAAE,SAAS,OAAOH,WAAAA,gCAA8B;AACpE,sBAAU,IAAI;AAAA,UAChB;AAAA,QAAA,IAEF,CAAA;AAAA,MAAC,CACN,IACDI,mBAAAA;AAAAA,QACE;AAAA,UACE,KAAK,GAAG,QAAQ,QAAQ,QAAQ,EAAE,CAAC,IAAI,mBAAmB,OAAO,CAAC;AAAA,UAClE,SAAS,CAAC,QAAgC,WAAW,QAAQ,GAAG;AAAA,QAAA;AAAA,QAElE,EAAE,IAAA;AAAA,MAAI;AAAA,IACR;AAAA,IAEN,cAAc;AAAA,EAAA,CACf;AAID,QAAM,SAASC,WAAAA;AAAAA,IACb,UAAU,QAAQ;AAAA,IAClBC,OAAAA,2BAA2B,OAAO,UAAU;AAAA,EAAA;AAE9C,YAAU,QAAQ,QAAQ,OAAO;AACjC,QAAM,aAAa,OAAO;AAC1B,QAAM,cAAc,OAAO,MAAM;AACjCC,QAAAA,UAAU,MAAM;AACd,QAAI,CAAC,WAAW,CAAC,WAAY;AAC7B;AAAA,MAAU,CAAC,UACT,6BAAM,aAAY,UAAU,OAAO,EAAE,SAAS,SAAS,YAAA;AAAA,IAAY;AAAA,EAEvE,GAAG,CAAC,SAAS,YAAY,aAAa,OAAO,CAAC;AAC9C,QAAM,cAAcT,MAAAA,OAAO,OAAO,QAAQ;AAC1C,cAAY,UAAU,OAAO;AAC7B,QAAM,UAAUU,MAAAA,YAAY,MAAM,YAAY,QAAQ,QAAA,GAAW,EAAE;AACnE,QAAM,WAAWA,MAAAA,YAAY,MAAM,YAAY,QAAQ,UAAA,GAAa,EAAE;AACtE,SAAO;AAAA,IACL,WAAS,YAAO,UAAP,mBAAc,kBAAiB;AAAA,IACxC,eAAa,YAAO,UAAP,mBAAc,aAAY;AAAA,IACvC,cAAY,YAAO,UAAP,mBAAc,gBAAe;AAAA,IACzC,iBAAe,YAAO,UAAP,mBAAc,mBAAkB;AAAA,IAC/C,YAAY,OAAO;AAAA,IACnB;AAAA,IACA;AAAA,EAAA;AAEJ;;;;"}
@@ -22,7 +22,7 @@ function useConversationIndex({
22
22
  headers,
23
23
  enabled = true
24
24
  }) {
25
- var _a, _b, _c;
25
+ var _a, _b, _c, _d;
26
26
  const headersRef = useRef(headers);
27
27
  headersRef.current = headers;
28
28
  const indexId = conversationIndexId({ workspaceId, userId });
@@ -76,6 +76,7 @@ function useConversationIndex({
76
76
  entries: ((_a = client.state) == null ? void 0 : _a.conversations) ?? null,
77
77
  hasNextPage: ((_b = client.state) == null ? void 0 : _b.has_more) ?? false,
78
78
  totalCount: ((_c = client.state) == null ? void 0 : _c.total_count) ?? null,
79
+ watchActivity: ((_d = client.state) == null ? void 0 : _d.watch_activity) ?? null,
79
80
  connection: client.connection,
80
81
  refresh,
81
82
  loadMore
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-index.js","sources":["../../../../../agent-runtime/src/conversation-index.ts"],"sourcesContent":["import { withKey } from '@assistant-ui/tap';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useStatewire, type StatewireClient } from 'statewire';\nimport { initialAuthDenialTrackerState, observeAuthDenial } from './auth-denial';\nimport type { ConversationAttention, ConversationAttentionSource } from './conversation-list';\nimport { projectDeepAgentConnection } from './errors';\nimport { StatewireSuspended } from './statewire-suspended';\nimport { statewireTransport } from './statewire-transport';\nimport type { DeepAgentHeadersResolver } from './use-deep-agent-thread';\n\n/**\n * Client side of the conversation-index statewire (issue #29088): agora\n * replicates the newest page of one viewer's conversation list as one state\n * object, so thread creation / lifecycle / title changes arrive as ops\n * instead of newest-page polling. The replicated rows are renderable and the\n * typed commands extend or refresh the inclusive window; reconnects are free\n * because the protocol's snapshot-first attach IS the newest-page reconcile.\n *\n * A viewer is a `(workspaceId, userId)` pair and every pair is its own\n * instance (`/conversation-index/<workspaceId>-<userId>`): workspaces are\n * tenants, so a tab in one workspace never shares a window with a tab in\n * another, and switching workspaces attaches to a different instance instead\n * of retagging the one other tabs are still reading.\n */\nexport interface ConversationIndexEntry {\n thread_id: string;\n title: string;\n updated_at: string;\n state: string | null;\n runtime: string | null;\n start_channel: string | null;\n asset_type: string;\n asset_id: string | null;\n app_id: string | null;\n trigger_type: string | null;\n last_message_preview: string | null;\n message_count: number | null;\n is_unread: boolean | null;\n /**\n * Canonical status_v2 planes, present once the publishing agora reports them\n * (absent from snapshots replicated by an older pod during a rollout).\n */\n session_status?: string | null;\n run_status?: string | null;\n /**\n * The viewer's attention state and its one-line next action, present once\n * the publishing agora derives them (absent from snapshots replicated by\n * an older pod). Pull-request state is never pushed — it rides the list\n * fetch only (`include_pull_requests`).\n */\n attention?: ConversationAttention | null;\n next_action?: string | null;\n attention_source?: ConversationAttentionSource | null;\n is_favorited?: boolean | null;\n}\n\ninterface ConversationIndexState {\n conversations?: ConversationIndexEntry[];\n has_more?: boolean;\n total_count?: number;\n}\n\ninterface ConversationIndexCommands {\n [key: string]: (...args: never[]) => unknown;\n refresh(): void;\n load_more(): void;\n}\n\nexport interface UseConversationIndexOptions {\n /** Base URL of the conversation-index host (the `…/v2/conversation-index` mount). */\n baseUrl: string;\n /** The workspace being viewed — half of the instance id. Callers gate mounting on it. */\n workspaceId: string;\n /** The signed-in user's id — the other half. Callers gate mounting on it. */\n userId: string;\n /** Transport selection: SSE when true, WebSocket otherwise. */\n sse?: boolean;\n headers: DeepAgentHeadersResolver;\n /** Park the transport until the caller has a resolved principal. */\n enabled?: boolean;\n}\n\nexport interface UseConversationIndexResult {\n /** Newest-page entries, or `null` until the attach snapshot applies. */\n entries: ConversationIndexEntry[] | null;\n hasNextPage: boolean;\n totalCount: number | null;\n connection: StatewireClient.Connection;\n refresh: () => Promise<void>;\n loadMore: () => Promise<void>;\n}\n\n/** The conversation-index host is mounted beside the threads host. */\nexport function conversationIndexUrlFromStatewireUrl(statewireUrl: string): string {\n return statewireUrl.replace(/\\/threads\\/?$/, '/conversation-index');\n}\n\n/** Instance id of one viewer's index; mirrors agora's `conversation_index_id`. */\nexport function conversationIndexId({\n workspaceId,\n userId,\n}: {\n workspaceId: string;\n userId: string;\n}): string {\n return `${workspaceId}-${userId}`;\n}\n\n/**\n * Attach to the live conversation index of one `(workspace, user)` viewer.\n */\nexport function useConversationIndex({\n baseUrl,\n workspaceId,\n userId,\n sse = false,\n headers,\n enabled = true,\n}: UseConversationIndexOptions): UseConversationIndexResult {\n const headersRef = useRef(headers);\n headersRef.current = headers;\n const indexId = conversationIndexId({ workspaceId, userId });\n // Auth-denial park (same policy as the thread transport): the index is a\n // pure push signal, so after a streak of `unauthorized` denials the retry\n // loop stops instead of hammering the attach endpoint every 30s for as long\n // as the tab lives. A remount or the parked connection's `reconnect()`\n // re-arms it.\n const [parked, setParked] = useState<{ indexId: string; message: string | undefined } | null>(\n null\n );\n const denialRef = useRef({ indexId, state: initialAuthDenialTrackerState() });\n if (denialRef.current.indexId !== indexId) {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n }\n const isParked = parked !== null && parked.indexId === indexId;\n const client = useStatewire<ConversationIndexState | undefined, ConversationIndexCommands>({\n transport: withKey(\n indexId,\n !enabled || isParked\n ? StatewireSuspended<ConversationIndexCommands>({\n message:\n parked?.message ??\n (enabled\n ? 'Conversation index authorization was refused.'\n : 'Conversation index is waiting for a signed-in user and workspace.'),\n ...(enabled\n ? {\n onReconnectRequested: () => {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n setParked(null);\n },\n }\n : {}),\n })\n : statewireTransport<ConversationIndexState, ConversationIndexCommands>(\n {\n url: `${baseUrl.replace(/\\/+$/, '')}/${encodeURIComponent(indexId)}`,\n headers: (ctx: { staleAuth: boolean }) => headersRef.current(ctx),\n },\n { sse }\n )\n ),\n initialState: undefined,\n });\n // Observing during render is idempotent (the tracker dedupes by attempt\n // number), so a re-render of the same connection state cannot double-count.\n // The tracker consumes the projected vocabulary, never the raw connection.\n const denial = observeAuthDenial(\n denialRef.current.state,\n projectDeepAgentConnection(client.connection)\n );\n denialRef.current.state = denial.state;\n const shouldPark = denial.park;\n const parkMessage = denial.state.message;\n useEffect(() => {\n if (!enabled || !shouldPark) return;\n setParked((prev) =>\n prev?.indexId === indexId ? prev : { indexId, message: parkMessage }\n );\n }, [enabled, shouldPark, parkMessage, indexId]);\n const commandsRef = useRef(client.commands);\n commandsRef.current = client.commands;\n const refresh = useCallback(() => commandsRef.current.refresh(), []);\n const loadMore = useCallback(() => commandsRef.current.load_more(), []);\n return {\n entries: client.state?.conversations ?? null,\n hasNextPage: client.state?.has_more ?? false,\n totalCount: client.state?.total_count ?? null,\n connection: client.connection,\n refresh,\n loadMore,\n };\n}\n\n/**\n * Stable change fingerprint over the entries a list surface reacts to. An\n * empty string means \"no snapshot yet\" — effects keyed on the fingerprint\n * should treat it as a no-op rather than an empty list. An applied-but-empty\n * snapshot serializes to `'[]'`, so deleting the last conversation still\n * changes the fingerprint. JSON-encoding keeps arbitrary titles from\n * colliding across field or entry boundaries.\n */\nexport function conversationIndexFingerprint(\n entries: ConversationIndexEntry[] | null\n): string {\n if (entries === null) return '';\n return JSON.stringify(\n entries.map((entry) => [\n entry.thread_id,\n entry.updated_at,\n entry.state,\n entry.title,\n entry.run_status ?? null,\n entry.is_unread ?? null,\n entry.attention ?? null,\n entry.next_action ?? null,\n entry.attention_source ?? null,\n entry.is_favorited ?? null,\n ])\n );\n}\n"],"names":[],"mappings":";;;;;;;AA6FO,SAAS,qCAAqC,cAA8B;AACjF,SAAO,aAAa,QAAQ,iBAAiB,qBAAqB;AACpE;AAGO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AACF,GAGW;AACT,SAAO,GAAG,WAAW,IAAI,MAAM;AACjC;AAKO,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA,UAAU;AACZ,GAA4D;;AAC1D,QAAM,aAAa,OAAO,OAAO;AACjC,aAAW,UAAU;AACrB,QAAM,UAAU,oBAAoB,EAAE,aAAa,QAAQ;AAM3D,QAAM,CAAC,QAAQ,SAAS,IAAI;AAAA,IAC1B;AAAA,EAAA;AAEF,QAAM,YAAY,OAAO,EAAE,SAAS,OAAO,8BAAA,GAAiC;AAC5E,MAAI,UAAU,QAAQ,YAAY,SAAS;AACzC,cAAU,UAAU,EAAE,SAAS,OAAO,gCAA8B;AAAA,EACtE;AACA,QAAM,WAAW,WAAW,QAAQ,OAAO,YAAY;AACvD,QAAM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AAe;AAAA,IACzC,YAAY,OAAO;AAAA,IACnB;AAAA,IACA;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"conversation-index.js","sources":["../../../../../agent-runtime/src/conversation-index.ts"],"sourcesContent":["import { withKey } from '@assistant-ui/tap';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { useStatewire, type StatewireClient } from 'statewire';\nimport { initialAuthDenialTrackerState, observeAuthDenial } from './auth-denial';\nimport type { ConversationAttention, ConversationAttentionSource } from './conversation-list';\nimport { projectDeepAgentConnection } from './errors';\nimport { StatewireSuspended } from './statewire-suspended';\nimport { statewireTransport } from './statewire-transport';\nimport type { DeepAgentHeadersResolver } from './use-deep-agent-thread';\n\n/**\n * Client side of the conversation-index statewire (issue #29088): agora\n * replicates the newest page of one viewer's conversation list as one state\n * object, so thread creation / lifecycle / title changes arrive as ops\n * instead of newest-page polling. The replicated rows are renderable and the\n * typed commands extend or refresh the inclusive window; reconnects are free\n * because the protocol's snapshot-first attach IS the newest-page reconcile.\n *\n * A viewer is a `(workspaceId, userId)` pair and every pair is its own\n * instance (`/conversation-index/<workspaceId>-<userId>`): workspaces are\n * tenants, so a tab in one workspace never shares a window with a tab in\n * another, and switching workspaces attaches to a different instance instead\n * of retagging the one other tabs are still reading.\n */\nexport interface ConversationIndexEntry {\n thread_id: string;\n title: string;\n updated_at: string;\n state: string | null;\n runtime: string | null;\n start_channel: string | null;\n asset_type: string;\n asset_id: string | null;\n app_id: string | null;\n trigger_type: string | null;\n last_message_preview: string | null;\n message_count: number | null;\n is_unread: boolean | null;\n /**\n * Canonical status_v2 planes, present once the publishing agora reports them\n * (absent from snapshots replicated by an older pod during a rollout).\n */\n session_status?: string | null;\n run_status?: string | null;\n /**\n * The viewer's attention state and its one-line next action, present once\n * the publishing agora derives them (absent from snapshots replicated by\n * an older pod). Pull-request state is never pushed — it rides the list\n * fetch only (`include_pull_requests`).\n */\n attention?: ConversationAttention | null;\n next_action?: string | null;\n attention_source?: ConversationAttentionSource | null;\n is_favorited?: boolean | null;\n}\n\n/**\n * When one of this viewer's own asset subscriptions on a thread last queued or\n * settled an event: thread id → ISO instant. A contentless \"re-read now\" for\n * Olympus's Watching card, which reads what changed through its own gated\n * query; it never says what changed, who changed it, or where. Absent from an\n * older agora's snapshot.\n */\nexport type ConversationWatchActivity = Readonly<Record<string, string>>;\n\ninterface ConversationIndexState {\n conversations?: ConversationIndexEntry[];\n has_more?: boolean;\n total_count?: number;\n watch_activity?: ConversationWatchActivity;\n}\n\ninterface ConversationIndexCommands {\n [key: string]: (...args: never[]) => unknown;\n refresh(): void;\n load_more(): void;\n}\n\nexport interface UseConversationIndexOptions {\n /** Base URL of the conversation-index host (the `…/v2/conversation-index` mount). */\n baseUrl: string;\n /** The workspace being viewed — half of the instance id. Callers gate mounting on it. */\n workspaceId: string;\n /** The signed-in user's id — the other half. Callers gate mounting on it. */\n userId: string;\n /** Transport selection: SSE when true, WebSocket otherwise. */\n sse?: boolean;\n headers: DeepAgentHeadersResolver;\n /** Park the transport until the caller has a resolved principal. */\n enabled?: boolean;\n}\n\nexport interface UseConversationIndexResult {\n /** Newest-page entries, or `null` until the attach snapshot applies. */\n entries: ConversationIndexEntry[] | null;\n hasNextPage: boolean;\n totalCount: number | null;\n /**\n * The viewer's watch-activity stamps (see {@link ConversationWatchActivity});\n * `null` until the snapshot applies or when the host does not send them.\n */\n watchActivity: ConversationWatchActivity | null;\n connection: StatewireClient.Connection;\n refresh: () => Promise<void>;\n loadMore: () => Promise<void>;\n}\n\n/** The conversation-index host is mounted beside the threads host. */\nexport function conversationIndexUrlFromStatewireUrl(statewireUrl: string): string {\n return statewireUrl.replace(/\\/threads\\/?$/, '/conversation-index');\n}\n\n/** Instance id of one viewer's index; mirrors agora's `conversation_index_id`. */\nexport function conversationIndexId({\n workspaceId,\n userId,\n}: {\n workspaceId: string;\n userId: string;\n}): string {\n return `${workspaceId}-${userId}`;\n}\n\n/**\n * Attach to the live conversation index of one `(workspace, user)` viewer.\n */\nexport function useConversationIndex({\n baseUrl,\n workspaceId,\n userId,\n sse = false,\n headers,\n enabled = true,\n}: UseConversationIndexOptions): UseConversationIndexResult {\n const headersRef = useRef(headers);\n headersRef.current = headers;\n const indexId = conversationIndexId({ workspaceId, userId });\n // Auth-denial park (same policy as the thread transport): the index is a\n // pure push signal, so after a streak of `unauthorized` denials the retry\n // loop stops instead of hammering the attach endpoint every 30s for as long\n // as the tab lives. A remount or the parked connection's `reconnect()`\n // re-arms it.\n const [parked, setParked] = useState<{ indexId: string; message: string | undefined } | null>(\n null\n );\n const denialRef = useRef({ indexId, state: initialAuthDenialTrackerState() });\n if (denialRef.current.indexId !== indexId) {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n }\n const isParked = parked !== null && parked.indexId === indexId;\n const client = useStatewire<ConversationIndexState | undefined, ConversationIndexCommands>({\n transport: withKey(\n indexId,\n !enabled || isParked\n ? StatewireSuspended<ConversationIndexCommands>({\n message:\n parked?.message ??\n (enabled\n ? 'Conversation index authorization was refused.'\n : 'Conversation index is waiting for a signed-in user and workspace.'),\n ...(enabled\n ? {\n onReconnectRequested: () => {\n denialRef.current = { indexId, state: initialAuthDenialTrackerState() };\n setParked(null);\n },\n }\n : {}),\n })\n : statewireTransport<ConversationIndexState, ConversationIndexCommands>(\n {\n url: `${baseUrl.replace(/\\/+$/, '')}/${encodeURIComponent(indexId)}`,\n headers: (ctx: { staleAuth: boolean }) => headersRef.current(ctx),\n },\n { sse }\n )\n ),\n initialState: undefined,\n });\n // Observing during render is idempotent (the tracker dedupes by attempt\n // number), so a re-render of the same connection state cannot double-count.\n // The tracker consumes the projected vocabulary, never the raw connection.\n const denial = observeAuthDenial(\n denialRef.current.state,\n projectDeepAgentConnection(client.connection)\n );\n denialRef.current.state = denial.state;\n const shouldPark = denial.park;\n const parkMessage = denial.state.message;\n useEffect(() => {\n if (!enabled || !shouldPark) return;\n setParked((prev) =>\n prev?.indexId === indexId ? prev : { indexId, message: parkMessage }\n );\n }, [enabled, shouldPark, parkMessage, indexId]);\n const commandsRef = useRef(client.commands);\n commandsRef.current = client.commands;\n const refresh = useCallback(() => commandsRef.current.refresh(), []);\n const loadMore = useCallback(() => commandsRef.current.load_more(), []);\n return {\n entries: client.state?.conversations ?? null,\n hasNextPage: client.state?.has_more ?? false,\n totalCount: client.state?.total_count ?? null,\n watchActivity: client.state?.watch_activity ?? null,\n connection: client.connection,\n refresh,\n loadMore,\n };\n}\n\n/**\n * Stable change fingerprint over a snapshot's watch-activity stamps: the\n * well-formed `[threadId, instant]` pairs, sorted by thread. An empty string\n * means \"nothing sent yet\" (no snapshot, or a host that predates the stamps),\n * so an effect keyed on it skips; an applied-but-empty map is `'[]'`.\n */\nexport function watchActivityFingerprint(activity: unknown): string {\n if (activity === null || typeof activity !== 'object' || Array.isArray(activity)) return '';\n return JSON.stringify(\n Object.entries(activity)\n .filter((entry): entry is [string, string] => typeof entry[1] === 'string')\n .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))\n );\n}\n\n/**\n * Stable change fingerprint over the entries a list surface reacts to. An\n * empty string means \"no snapshot yet\" — effects keyed on the fingerprint\n * should treat it as a no-op rather than an empty list. An applied-but-empty\n * snapshot serializes to `'[]'`, so deleting the last conversation still\n * changes the fingerprint. JSON-encoding keeps arbitrary titles from\n * colliding across field or entry boundaries.\n */\nexport function conversationIndexFingerprint(\n entries: ConversationIndexEntry[] | null\n): string {\n if (entries === null) return '';\n return JSON.stringify(\n entries.map((entry) => [\n entry.thread_id,\n entry.updated_at,\n entry.state,\n entry.title,\n entry.run_status ?? null,\n entry.is_unread ?? null,\n entry.attention ?? null,\n entry.next_action ?? null,\n entry.attention_source ?? null,\n entry.is_favorited ?? null,\n ])\n );\n}\n"],"names":[],"mappings":";;;;;;;AA4GO,SAAS,qCAAqC,cAA8B;AACjF,SAAO,aAAa,QAAQ,iBAAiB,qBAAqB;AACpE;AAGO,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AACF,GAGW;AACT,SAAO,G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,QAAI,CAAC,WAAW,CAAC,WAAY;AAC7B;AAAA,MAAU,CAAC,UACT,6BAAM,aAAY,UAAU,OAAO,EAAE,SAAS,SAAS,YAAA;AAAA,IAAY;AAAA,EAEvE,GAAG,CAAC,SAAS,YAAY,aAAa,OAAO,CAAC;AAC9C,QAAM,cAAc,OAAO,OAAO,QAAQ;AAC1C,cAAY,UAAU,OAAO;AAC7B,QAAM,UAAU,YAAY,MAAM,YAAY,QAAQ,QAAA,GAAW,EAAE;AACnE,QAAM,WAAW,YAAY,MAAM,YAAY,QAAQ,UAAA,GAAa,EAAE;AACtE,SAAO;AAAA,IACL,WAAS,YAAO,UAAP,mBAAc,kBAAiB;AAAA,IACxC,eAAa,YAAO,UAAP,mBAAc,aAAY;AAAA,IACvC,cAAY,YAAO,UAAP,mBAAc,gBAAe;AAAA,IACzC,iBAAe,YAAO,UAAP,mBAAc,mBAAkB;AAAA,IAC/C,YAAY,OAAO;AAAA,IACnB;AAAA,IACA;AAAA,EAAA;AAEJ;"}
@@ -181,7 +181,9 @@ new Set(
181
181
  THREAD_CONFIG_CUSTOM_KEYS
182
182
  );
183
183
  const KNOWN_START_CHANNELS = [
184
+ "agent_orchestration",
184
185
  "api",
186
+ "automation",
185
187
  "chrome_extension",
186
188
  "cli",
187
189
  "comment_agent",
@@ -1 +1 @@
1
- {"version":3,"file":"runconfig-contract.cjs","sources":["../../../../../../agent-runtime/src/generated/runconfig-contract.ts"],"sourcesContent":["// GENERATED FILE — DO NOT EDIT BY HAND.\n//\n// Source of truth (agora):\n// agora/agora/graphs/athena_deep_agent/run_config.py (_PARSED_CUSTOM_KEYS / _COMPANION_CUSTOM_KEYS / PER_SEND_CUSTOM_KEYS)\n// agora/agora/graphs/athena_deep_agent/thread_config.py (server config lane + config/* command names)\n// agora/agora/graphs/athena_deep_agent/session_asset.py (KNOWN_START_CHANNELS / DEEP_AGENT_RUNTIME_MARKER)\n// agora/agora/graphs/athena_deep_agent/client_tools.py (client-tool interrupt + result-envelope literals)\n// agora/agora/graphs/athena_deep_agent/protocol_version.py (wire-contract version negotiation)\n// agora/agora/graphs/athena_deep_agent/message_window.py (interest windows + history commands)\n// agora/agora/type_definitions/collab_agent.py (CAPABILITIES ladder: absent mode + new-agent default)\n//\n// Regenerate:\n// cd agora && mise exec -- infisical run --command 'uv run python scripts/export_runconfig_contract.py'\n//\n// CI verifies this file matches the Python source (agora-check runs the\n// exporter with --check), so hand edits and un-regenerated key changes fail.\n\n/** `runConfig.custom` keys parsed by agora's `parse_deep_agent_run_config`. */\nexport const RUN_CONFIG_PARSED_CUSTOM_KEYS = [\n \"agent_catalog_asset_ids\",\n \"approve_changes\",\n \"async_subagents\",\n \"catalog_asset_ids\",\n \"coding_worker_asset_id\",\n \"coding_workers\",\n \"compiled_subagents\",\n \"declined_toolkit_ids\",\n \"drive_mounts\",\n \"enable_interpreter\",\n \"enable_persistent_fs\",\n \"enable_sandbox\",\n \"enable_skills\",\n \"enabled_tools\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"include_citation_instructions\",\n \"interpreter_max_ptc_calls\",\n \"interpreter_mode\",\n \"interpreter_ptc\",\n \"interpreter_ptc_exclusive\",\n \"interpreter_runtime\",\n \"interpreter_subagents\",\n \"interpreter_timeout_seconds\",\n \"interrupt_on\",\n \"knowledge_base\",\n \"mcp_server_configs\",\n \"mcp_servers\",\n \"memory\",\n \"outbound_approval_allowlist\",\n \"permissions\",\n \"project_id\",\n \"recursion_limit\",\n \"run_label\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_machine\",\n \"session_vm_retention\",\n \"skill_asset_ids\",\n \"skills\",\n \"subagents\",\n \"system_prompt\",\n \"tool_description_overrides\",\n \"voice_update_handle\",\n \"workbench\",\n] as const;\n\n/** `runConfig.custom` keys consumed by the surrounding deep-agent request machinery rather than the capability parser. */\nexport const RUN_CONFIG_COMPANION_CUSTOM_KEYS = [\n \"agent\",\n \"allowed_tab_ids\",\n \"app_id\",\n \"channel\",\n \"client_tools\",\n \"collab_agent_id\",\n \"collab_channel_id\",\n \"custom_tool_configs\",\n \"deterministic\",\n \"device_id\",\n \"dry_run\",\n \"enabled_toolkits\",\n \"frontend_available\",\n \"github_identity\",\n \"max_tokens\",\n \"middleware\",\n \"model\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"panel_config\",\n \"run_budget\",\n \"runtime\",\n \"session_id\",\n \"session_origin_kind\",\n \"session_tab_id\",\n \"skip_title_generation\",\n \"source_aop_id\",\n \"start_channel\",\n \"structured_output\",\n \"temperature\",\n \"tool_limit_override\",\n \"trigger_type\",\n \"workspace_id\",\n] as const;\n\n/** Every `runConfig.custom` key some deep-agent request consumer reads. A key outside this set is invisible to the run and trips agora's unknown-key telemetry. */\nexport const RUN_CONFIG_CUSTOM_KEYS = [\n \"agent\",\n \"agent_catalog_asset_ids\",\n \"allowed_tab_ids\",\n \"app_id\",\n \"approve_changes\",\n \"async_subagents\",\n \"catalog_asset_ids\",\n \"channel\",\n \"client_tools\",\n \"coding_worker_asset_id\",\n \"coding_workers\",\n \"collab_agent_id\",\n \"collab_channel_id\",\n \"compiled_subagents\",\n \"custom_tool_configs\",\n \"declined_toolkit_ids\",\n \"deterministic\",\n \"device_id\",\n \"drive_mounts\",\n \"dry_run\",\n \"enable_interpreter\",\n \"enable_persistent_fs\",\n \"enable_sandbox\",\n \"enable_skills\",\n \"enabled_toolkits\",\n \"enabled_tools\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"frontend_available\",\n \"github_identity\",\n \"include_citation_instructions\",\n \"interpreter_max_ptc_calls\",\n \"interpreter_mode\",\n \"interpreter_ptc\",\n \"interpreter_ptc_exclusive\",\n \"interpreter_runtime\",\n \"interpreter_subagents\",\n \"interpreter_timeout_seconds\",\n \"interrupt_on\",\n \"knowledge_base\",\n \"max_tokens\",\n \"mcp_server_configs\",\n \"mcp_servers\",\n \"memory\",\n \"middleware\",\n \"model\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"outbound_approval_allowlist\",\n \"panel_config\",\n \"permissions\",\n \"project_id\",\n \"recursion_limit\",\n \"run_budget\",\n \"run_label\",\n \"runtime\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_id\",\n \"session_machine\",\n \"session_origin_kind\",\n \"session_tab_id\",\n \"session_vm_retention\",\n \"skill_asset_ids\",\n \"skills\",\n \"skip_title_generation\",\n \"source_aop_id\",\n \"start_channel\",\n \"structured_output\",\n \"subagents\",\n \"system_prompt\",\n \"temperature\",\n \"tool_description_overrides\",\n \"tool_limit_override\",\n \"trigger_type\",\n \"voice_update_handle\",\n \"workbench\",\n \"workspace_id\",\n] as const;\n\nexport type RunConfigCustomKey = (typeof RUN_CONFIG_CUSTOM_KEYS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const RUN_CONFIG_CUSTOM_KEY_SET: ReadonlySet<string> = new Set(\n RUN_CONFIG_CUSTOM_KEYS,\n);\n\n/** `runConfig.custom` keys a client still carries per send on a thread with server config; every other key is dropped at dispatch. */\nexport const RUN_CONFIG_PER_SEND_CUSTOM_KEYS = [\n \"agent\",\n \"allowed_tab_ids\",\n \"app_id\",\n \"channel\",\n \"client_tools\",\n \"collab_channel_id\",\n \"deterministic\",\n \"device_id\",\n \"dry_run\",\n \"frontend_available\",\n \"github_identity\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"project_id\",\n \"run_budget\",\n \"runtime\",\n \"session_id\",\n \"session_origin_kind\",\n \"session_tab_id\",\n \"skip_title_generation\",\n \"source_aop_id\",\n \"start_channel\",\n \"structured_output\",\n \"tool_limit_override\",\n \"trigger_type\",\n \"voice_update_handle\",\n \"workspace_id\",\n] as const;\n\nexport type RunConfigPerSendCustomKey =\n (typeof RUN_CONFIG_PER_SEND_CUSTOM_KEYS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const RUN_CONFIG_PER_SEND_CUSTOM_KEY_SET: ReadonlySet<string> = new Set(\n RUN_CONFIG_PER_SEND_CUSTOM_KEYS,\n);\n\n/** Keys the thread's server config lane owns — changed only through the `config/*` commands, never per send. */\nexport const THREAD_CONFIG_CUSTOM_KEYS = [\n \"agent_catalog_asset_ids\",\n \"approve_changes\",\n \"async_subagents\",\n \"catalog_asset_ids\",\n \"coding_worker_asset_id\",\n \"coding_workers\",\n \"collab_agent_id\",\n \"compiled_subagents\",\n \"custom_tool_configs\",\n \"declined_toolkit_ids\",\n \"drive_mounts\",\n \"enable_interpreter\",\n \"enable_persistent_fs\",\n \"enable_sandbox\",\n \"enable_skills\",\n \"enabled_toolkits\",\n \"enabled_tools\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"include_citation_instructions\",\n \"interpreter_max_ptc_calls\",\n \"interpreter_mode\",\n \"interpreter_ptc\",\n \"interpreter_ptc_exclusive\",\n \"interpreter_runtime\",\n \"interpreter_subagents\",\n \"interpreter_timeout_seconds\",\n \"interrupt_on\",\n \"knowledge_base\",\n \"max_tokens\",\n \"mcp_server_configs\",\n \"mcp_servers\",\n \"memory\",\n \"middleware\",\n \"model\",\n \"outbound_approval_allowlist\",\n \"permissions\",\n \"recursion_limit\",\n \"run_label\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_machine\",\n \"session_vm_retention\",\n \"skill_asset_ids\",\n \"skills\",\n \"subagents\",\n \"system_prompt\",\n \"temperature\",\n \"tool_description_overrides\",\n \"workbench\",\n] as const;\n\nexport type ThreadConfigCustomKey = (typeof THREAD_CONFIG_CUSTOM_KEYS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const THREAD_CONFIG_CUSTOM_KEY_SET: ReadonlySet<string> = new Set(\n THREAD_CONFIG_CUSTOM_KEYS,\n);\n\n/** Replicated-state key of the server config lane (`{ version, custom }`). */\nexport const DEEP_AGENT_CONFIG_STATE_KEY = \"config\";\n\n/** The statewire commands that mutate the server config lane. */\nexport const DEEP_AGENT_CONFIG_COMMANDS = {\n patch: \"config/patch\",\n toolsEnable: \"config/tools/enable\",\n toolsDisable: \"config/tools/disable\",\n} as const;\n\n/** `start_channel` values the session substrate stamps as provenance; anything else clamps to \"web\". */\nexport const KNOWN_START_CHANNELS = [\n \"api\",\n \"chrome_extension\",\n \"cli\",\n \"comment_agent\",\n \"default_voice\",\n \"desktop_app\",\n \"email\",\n \"mobile_app\",\n \"office_addin\",\n \"orchestration\",\n \"programmatic\",\n \"slack\",\n \"sms\",\n \"task\",\n \"teams\",\n \"voice\",\n \"voice_memo\",\n \"web\",\n] as const;\n\nexport type KnownStartChannel = (typeof KNOWN_START_CHANNELS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const KNOWN_START_CHANNEL_SET: ReadonlySet<string> = new Set(\n KNOWN_START_CHANNELS,\n);\n\n/** `runConfig.custom.runtime` marker selecting the deep-agent runtime. */\nexport const DEEP_AGENT_RUNTIME_MARKER = \"athena_deep_agent\";\n\n/**\n * Collab-agent capability ladder (agent schema v3): per explicit\n * capability field, what an ABSENT value means and the value stamped on\n * a new agent. Resolved by agora's `capability_decoder` and the one agent\n * compiler on every run: `passthrough` — explicit only, absent means off;\n * `off` — absent means off under every `runtime` marker; `runtime` —\n * absent derives from the `runtime` marker (`athena_deep_agent` on, any\n * other or missing marker off).\n */\nexport const COLLAB_AGENT_CAPABILITIES = {\n deepAgentBuiltinsEnabled: { absent: \"runtime\", default: true },\n interpreterEnabled: { absent: \"off\", default: false },\n sandboxEnabled: { absent: \"passthrough\", default: false },\n skillsEnabled: { absent: \"runtime\", default: true },\n} as const;\n\nexport type CollabAgentCapabilityField = keyof typeof COLLAB_AGENT_CAPABILITIES;\n\nexport type CollabAgentCapabilityAbsentMode =\n (typeof COLLAB_AGENT_CAPABILITIES)[CollabAgentCapabilityField][\"absent\"];\n\n/** `source`/`type` stamped on client-tool interrupt payloads by agora. */\nexport const CLIENT_TOOL_INTERRUPT_SOURCE = \"client_tool\";\n\n/** `status` literals of the result envelope a client resumes a parked client-tool call with. */\nexport const CLIENT_TOOL_RESULT_STATUSES = [\"error\", \"success\"] as const;\n\nexport type ClientToolResultStatus =\n (typeof CLIENT_TOOL_RESULT_STATUSES)[number];\n\nexport const CLIENT_TOOL_RESULT_STATUS_SUCCESS = \"success\";\n\nexport const CLIENT_TOOL_RESULT_STATUS_ERROR = \"error\";\n\n/**\n * Result envelope a client resumes a parked client-tool call with,\n * keyed by interrupt id:\n * `{ client_tool_results: { <interrupt_id>: <envelope> } }`.\n * Agora relays the envelope to the model verbatim.\n */\nexport type ClientToolResultEnvelopeContract =\n | { status: typeof CLIENT_TOOL_RESULT_STATUS_SUCCESS; result: unknown }\n | { status: typeof CLIENT_TOOL_RESULT_STATUS_ERROR; error: string };\n\n/**\n * The deep-agent wire-contract version this client build speaks,\n * declared on every attach. The host records it for attach telemetry\n * and per-version behaviour; it has no minimum client version, so no\n * build is refused for the version it declares (the `protocol` state\n * lane's `minClientVersion` is the constant 1).\n */\nexport const DEEP_AGENT_PROTOCOL_VERSION = 1;\n\n/** Attach header carrying the client's declared contract version. */\nexport const DEEP_AGENT_PROTOCOL_VERSION_HEADER =\n \"x-athena-deep-agent-protocol-version\";\n\n/** Attach header declaring the head window a fresh client wants in its hello (host-clamped). */\nexport const DEEP_AGENT_MESSAGE_WINDOW_HEADER = \"x-athena-deep-agent-window\";\n\n/** Replicated-state key of the server-advertised version lane. */\nexport const DEEP_AGENT_PROTOCOL_STATE_KEY = \"protocol\";\n\n/** Ephemeral subprotocol carrying a client's message-window interests. */\nexport const DEEP_AGENT_INTEREST_PROTOCOL = \"athena/interest\";\n\n/** Ephemeral subprotocol carrying a client's synced context document. */\nexport const DEEP_AGENT_CONTEXT_PROTOCOL = \"athena/context\";\n\n/** The only interest namespace the host resolves (the linear transcript). */\nexport const DEEP_AGENT_MAIN_NS = \"main\";\n\n/** Window size (interest `before`) a client asks for by default. */\nexport const DEEP_AGENT_DEFAULT_MESSAGE_WINDOW = 40;\n\n/** Bounds on a window size. */\nexport const DEEP_AGENT_MIN_MESSAGE_WINDOW = 8;\n\nexport const DEEP_AGENT_MAX_MESSAGE_WINDOW = 200;\n\n/** Interests one attach may hold at once (the head plus its pages). */\nexport const DEEP_AGENT_MAX_INTERESTS = 16;\n\n/** Command returning a truncated tool output whole. */\nexport const DEEP_AGENT_HISTORY_TOOL_OUTPUT_COMMAND = \"history/tool_output\";\n\n/** Command returning one stored message whole (provenance and full tool output included). */\nexport const DEEP_AGENT_HISTORY_MESSAGE_COMMAND = \"history/message\";\n\n/** Wire key marking a tool message whose content was truncated. */\nexport const DEEP_AGENT_TRUNCATED_CONTENT_KEY = \"athena_content_truncated\";\n\n/** Most inline-image payload characters one message carries whole on the wire. */\nexport const DEEP_AGENT_INLINE_IMAGE_WIRE_BUDGET = 4194304;\n\n/** Wire key on an image block left off the wire: `{ index, chars, mediaType }`. */\nexport const DEEP_AGENT_OMITTED_IMAGE_KEY = \"athena_image_omitted\";\n\n/** The image an omitted block carries instead of its own (a neutral PNG tile). */\nexport const DEEP_AGENT_OMITTED_IMAGE_PLACEHOLDER_URL =\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4AQMAAABPbGssAAAABlBMVEXi6PCUo7jao11HAAAA6ElEQVR42u2UyW3DMBBF3wxogEd2EJbCElKQDRCwC3MpSRc5eLuYokgNLEUxctK/CHyanQts2vRO3QdlALVsXsBvecqxxr1ob0A5GlDJU+hICxN54p/qXAx/+FpoeeE8hTerzfvByn7ifzpaBtWCOwv6bMVMBgzRgNGKmUL9McDs4XOSyEHuoKCI76AiqOugg+y0gx6SN+YQg3QwALGk19pQSKV/reOocyoww27oU5sxhAbKUNgIqrVxrvnovJ80MFgxYy23wtTss44tmL+bAuOE2p2o0fJa3iW/6iR/lEfx8kv3TZtW6AFk5Sf3k+GTswAAAABJRU5ErkJggg==\";\n\n/**\n * Command returning one inline image of a stored message in chunks:\n * `{ messageId, index, offset? }` answers\n * `{ messageId, index, mediaType, offset, total, chunk, next }`; the\n * chunks joined in order are the image's `data:` URL, and `next` is\n * the offset to ask for next (`null` after the last chunk).\n */\nexport const DEEP_AGENT_HISTORY_IMAGE_COMMAND = \"history/image\";\n"],"names":[],"mappings":";;AA6GO,MAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAK8D,IAAI;AAAA,EAChE;AACF;AAGO,MAAM,kCAAkC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAMuE,IAAI;AAAA,EACzE;AACF;AAGO,MAAM,4BAA4B;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAKiE,IAAI;AAAA,EACnE;AACF;AAaO,MAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAK4D,IAAI;AAAA,EAC9D;AACF;AA2BO,MAAM,+BAA+B;AAQrC,MAAM,oCAAoC;AAE1C,MAAM,kCAAkC;AAmBxC,MAAM,8BAA8B;AAGpC,MAAM,qCACX;AAGK,MAAM,mCAAmC;AAGzC,MAAM,gCAAgC;AAGtC,MAAM,+BAA+B;AAMrC,MAAM,qBAAqB;AAG3B,MAAM,oCAAoC;AAG1C,MAAM,gCAAgC;AAEtC,MAAM,gCAAgC;AAGtC,MAAM,2BAA2B;AAGjC,MAAM,yCAAyC;AAM/C,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"runconfig-contract.cjs","sources":["../../../../../../agent-runtime/src/generated/runconfig-contract.ts"],"sourcesContent":["// GENERATED FILE — DO NOT EDIT BY HAND.\n//\n// Source of truth (agora):\n// agora/agora/graphs/athena_deep_agent/run_config.py (_PARSED_CUSTOM_KEYS / _COMPANION_CUSTOM_KEYS / PER_SEND_CUSTOM_KEYS)\n// agora/agora/graphs/athena_deep_agent/thread_config.py (server config lane + config/* command names)\n// agora/agora/graphs/athena_deep_agent/session_asset.py (KNOWN_START_CHANNELS / DEEP_AGENT_RUNTIME_MARKER)\n// agora/agora/graphs/athena_deep_agent/client_tools.py (client-tool interrupt + result-envelope literals)\n// agora/agora/graphs/athena_deep_agent/protocol_version.py (wire-contract version negotiation)\n// agora/agora/graphs/athena_deep_agent/message_window.py (interest windows + history commands)\n// agora/agora/type_definitions/collab_agent.py (CAPABILITIES ladder: absent mode + new-agent default)\n//\n// Regenerate:\n// cd agora && mise exec -- infisical run --command 'uv run python scripts/export_runconfig_contract.py'\n//\n// CI verifies this file matches the Python source (agora-check runs the\n// exporter with --check), so hand edits and un-regenerated key changes fail.\n\n/** `runConfig.custom` keys parsed by agora's `parse_deep_agent_run_config`. */\nexport const RUN_CONFIG_PARSED_CUSTOM_KEYS = [\n \"agent_catalog_asset_ids\",\n \"approve_changes\",\n \"async_subagents\",\n \"catalog_asset_ids\",\n \"coding_worker_asset_id\",\n \"coding_workers\",\n \"compiled_subagents\",\n \"declined_toolkit_ids\",\n \"drive_mounts\",\n \"enable_interpreter\",\n \"enable_persistent_fs\",\n \"enable_sandbox\",\n \"enable_skills\",\n \"enabled_tools\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"include_citation_instructions\",\n \"interpreter_max_ptc_calls\",\n \"interpreter_mode\",\n \"interpreter_ptc\",\n \"interpreter_ptc_exclusive\",\n \"interpreter_runtime\",\n \"interpreter_subagents\",\n \"interpreter_timeout_seconds\",\n \"interrupt_on\",\n \"knowledge_base\",\n \"mcp_server_configs\",\n \"mcp_servers\",\n \"memory\",\n \"outbound_approval_allowlist\",\n \"permissions\",\n \"project_id\",\n \"recursion_limit\",\n \"run_label\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_machine\",\n \"session_vm_retention\",\n \"skill_asset_ids\",\n \"skills\",\n \"subagents\",\n \"system_prompt\",\n \"tool_description_overrides\",\n \"voice_update_handle\",\n \"workbench\",\n] as const;\n\n/** `runConfig.custom` keys consumed by the surrounding deep-agent request machinery rather than the capability parser. */\nexport const RUN_CONFIG_COMPANION_CUSTOM_KEYS = [\n \"agent\",\n \"allowed_tab_ids\",\n \"app_id\",\n \"channel\",\n \"client_tools\",\n \"collab_agent_id\",\n \"collab_channel_id\",\n \"custom_tool_configs\",\n \"deterministic\",\n \"device_id\",\n \"dry_run\",\n \"enabled_toolkits\",\n \"frontend_available\",\n \"github_identity\",\n \"max_tokens\",\n \"middleware\",\n \"model\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"panel_config\",\n \"run_budget\",\n \"runtime\",\n \"session_id\",\n \"session_origin_kind\",\n \"session_tab_id\",\n \"skip_title_generation\",\n \"source_aop_id\",\n \"start_channel\",\n \"structured_output\",\n \"temperature\",\n \"tool_limit_override\",\n \"trigger_type\",\n \"workspace_id\",\n] as const;\n\n/** Every `runConfig.custom` key some deep-agent request consumer reads. A key outside this set is invisible to the run and trips agora's unknown-key telemetry. */\nexport const RUN_CONFIG_CUSTOM_KEYS = [\n \"agent\",\n \"agent_catalog_asset_ids\",\n \"allowed_tab_ids\",\n \"app_id\",\n \"approve_changes\",\n \"async_subagents\",\n \"catalog_asset_ids\",\n \"channel\",\n \"client_tools\",\n \"coding_worker_asset_id\",\n \"coding_workers\",\n \"collab_agent_id\",\n \"collab_channel_id\",\n \"compiled_subagents\",\n \"custom_tool_configs\",\n \"declined_toolkit_ids\",\n \"deterministic\",\n \"device_id\",\n \"drive_mounts\",\n \"dry_run\",\n \"enable_interpreter\",\n \"enable_persistent_fs\",\n \"enable_sandbox\",\n \"enable_skills\",\n \"enabled_toolkits\",\n \"enabled_tools\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"frontend_available\",\n \"github_identity\",\n \"include_citation_instructions\",\n \"interpreter_max_ptc_calls\",\n \"interpreter_mode\",\n \"interpreter_ptc\",\n \"interpreter_ptc_exclusive\",\n \"interpreter_runtime\",\n \"interpreter_subagents\",\n \"interpreter_timeout_seconds\",\n \"interrupt_on\",\n \"knowledge_base\",\n \"max_tokens\",\n \"mcp_server_configs\",\n \"mcp_servers\",\n \"memory\",\n \"middleware\",\n \"model\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"outbound_approval_allowlist\",\n \"panel_config\",\n \"permissions\",\n \"project_id\",\n \"recursion_limit\",\n \"run_budget\",\n \"run_label\",\n \"runtime\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_id\",\n \"session_machine\",\n \"session_origin_kind\",\n \"session_tab_id\",\n \"session_vm_retention\",\n \"skill_asset_ids\",\n \"skills\",\n \"skip_title_generation\",\n \"source_aop_id\",\n \"start_channel\",\n \"structured_output\",\n \"subagents\",\n \"system_prompt\",\n \"temperature\",\n \"tool_description_overrides\",\n \"tool_limit_override\",\n \"trigger_type\",\n \"voice_update_handle\",\n \"workbench\",\n \"workspace_id\",\n] as const;\n\nexport type RunConfigCustomKey = (typeof RUN_CONFIG_CUSTOM_KEYS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const RUN_CONFIG_CUSTOM_KEY_SET: ReadonlySet<string> = new Set(\n RUN_CONFIG_CUSTOM_KEYS,\n);\n\n/** `runConfig.custom` keys a client still carries per send on a thread with server config; every other key is dropped at dispatch. */\nexport const RUN_CONFIG_PER_SEND_CUSTOM_KEYS = [\n \"agent\",\n \"allowed_tab_ids\",\n \"app_id\",\n \"channel\",\n \"client_tools\",\n \"collab_channel_id\",\n \"deterministic\",\n \"device_id\",\n \"dry_run\",\n \"frontend_available\",\n \"github_identity\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"project_id\",\n \"run_budget\",\n \"runtime\",\n \"session_id\",\n \"session_origin_kind\",\n \"session_tab_id\",\n \"skip_title_generation\",\n \"source_aop_id\",\n \"start_channel\",\n \"structured_output\",\n \"tool_limit_override\",\n \"trigger_type\",\n \"voice_update_handle\",\n \"workspace_id\",\n] as const;\n\nexport type RunConfigPerSendCustomKey =\n (typeof RUN_CONFIG_PER_SEND_CUSTOM_KEYS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const RUN_CONFIG_PER_SEND_CUSTOM_KEY_SET: ReadonlySet<string> = new Set(\n RUN_CONFIG_PER_SEND_CUSTOM_KEYS,\n);\n\n/** Keys the thread's server config lane owns — changed only through the `config/*` commands, never per send. */\nexport const THREAD_CONFIG_CUSTOM_KEYS = [\n \"agent_catalog_asset_ids\",\n \"approve_changes\",\n \"async_subagents\",\n \"catalog_asset_ids\",\n \"coding_worker_asset_id\",\n \"coding_workers\",\n \"collab_agent_id\",\n \"compiled_subagents\",\n \"custom_tool_configs\",\n \"declined_toolkit_ids\",\n \"drive_mounts\",\n \"enable_interpreter\",\n \"enable_persistent_fs\",\n \"enable_sandbox\",\n \"enable_skills\",\n \"enabled_toolkits\",\n \"enabled_tools\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"include_citation_instructions\",\n \"interpreter_max_ptc_calls\",\n \"interpreter_mode\",\n \"interpreter_ptc\",\n \"interpreter_ptc_exclusive\",\n \"interpreter_runtime\",\n \"interpreter_subagents\",\n \"interpreter_timeout_seconds\",\n \"interrupt_on\",\n \"knowledge_base\",\n \"max_tokens\",\n \"mcp_server_configs\",\n \"mcp_servers\",\n \"memory\",\n \"middleware\",\n \"model\",\n \"outbound_approval_allowlist\",\n \"permissions\",\n \"recursion_limit\",\n \"run_label\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_machine\",\n \"session_vm_retention\",\n \"skill_asset_ids\",\n \"skills\",\n \"subagents\",\n \"system_prompt\",\n \"temperature\",\n \"tool_description_overrides\",\n \"workbench\",\n] as const;\n\nexport type ThreadConfigCustomKey = (typeof THREAD_CONFIG_CUSTOM_KEYS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const THREAD_CONFIG_CUSTOM_KEY_SET: ReadonlySet<string> = new Set(\n THREAD_CONFIG_CUSTOM_KEYS,\n);\n\n/** Replicated-state key of the server config lane (`{ version, custom }`). */\nexport const DEEP_AGENT_CONFIG_STATE_KEY = \"config\";\n\n/** The statewire commands that mutate the server config lane. */\nexport const DEEP_AGENT_CONFIG_COMMANDS = {\n patch: \"config/patch\",\n toolsEnable: \"config/tools/enable\",\n toolsDisable: \"config/tools/disable\",\n} as const;\n\n/** `start_channel` values the session substrate stamps as provenance; anything else clamps to \"web\". */\nexport const KNOWN_START_CHANNELS = [\n \"agent_orchestration\",\n \"api\",\n \"automation\",\n \"chrome_extension\",\n \"cli\",\n \"comment_agent\",\n \"default_voice\",\n \"desktop_app\",\n \"email\",\n \"mobile_app\",\n \"office_addin\",\n \"orchestration\",\n \"programmatic\",\n \"slack\",\n \"sms\",\n \"task\",\n \"teams\",\n \"voice\",\n \"voice_memo\",\n \"web\",\n] as const;\n\nexport type KnownStartChannel = (typeof KNOWN_START_CHANNELS)[number];\n\n/** Fast membership checks for builder/test assertions. */\nexport const KNOWN_START_CHANNEL_SET: ReadonlySet<string> = new Set(\n KNOWN_START_CHANNELS,\n);\n\n/** `runConfig.custom.runtime` marker selecting the deep-agent runtime. */\nexport const DEEP_AGENT_RUNTIME_MARKER = \"athena_deep_agent\";\n\n/**\n * Collab-agent capability ladder (agent schema v3): per explicit\n * capability field, what an ABSENT value means and the value stamped on\n * a new agent. Resolved by agora's `capability_decoder` and the one agent\n * compiler on every run: `passthrough` — explicit only, absent means off;\n * `off` — absent means off under every `runtime` marker; `runtime` —\n * absent derives from the `runtime` marker (`athena_deep_agent` on, any\n * other or missing marker off).\n */\nexport const COLLAB_AGENT_CAPABILITIES = {\n deepAgentBuiltinsEnabled: { absent: \"runtime\", default: true },\n interpreterEnabled: { absent: \"off\", default: false },\n sandboxEnabled: { absent: \"passthrough\", default: false },\n skillsEnabled: { absent: \"runtime\", default: true },\n} as const;\n\nexport type CollabAgentCapabilityField = keyof typeof COLLAB_AGENT_CAPABILITIES;\n\nexport type CollabAgentCapabilityAbsentMode =\n (typeof COLLAB_AGENT_CAPABILITIES)[CollabAgentCapabilityField][\"absent\"];\n\n/** `source`/`type` stamped on client-tool interrupt payloads by agora. */\nexport const CLIENT_TOOL_INTERRUPT_SOURCE = \"client_tool\";\n\n/** `status` literals of the result envelope a client resumes a parked client-tool call with. */\nexport const CLIENT_TOOL_RESULT_STATUSES = [\"error\", \"success\"] as const;\n\nexport type ClientToolResultStatus =\n (typeof CLIENT_TOOL_RESULT_STATUSES)[number];\n\nexport const CLIENT_TOOL_RESULT_STATUS_SUCCESS = \"success\";\n\nexport const CLIENT_TOOL_RESULT_STATUS_ERROR = \"error\";\n\n/**\n * Result envelope a client resumes a parked client-tool call with,\n * keyed by interrupt id:\n * `{ client_tool_results: { <interrupt_id>: <envelope> } }`.\n * Agora relays the envelope to the model verbatim.\n */\nexport type ClientToolResultEnvelopeContract =\n | { status: typeof CLIENT_TOOL_RESULT_STATUS_SUCCESS; result: unknown }\n | { status: typeof CLIENT_TOOL_RESULT_STATUS_ERROR; error: string };\n\n/**\n * The deep-agent wire-contract version this client build speaks,\n * declared on every attach. The host records it for attach telemetry\n * and per-version behaviour; it has no minimum client version, so no\n * build is refused for the version it declares (the `protocol` state\n * lane's `minClientVersion` is the constant 1).\n */\nexport const DEEP_AGENT_PROTOCOL_VERSION = 1;\n\n/** Attach header carrying the client's declared contract version. */\nexport const DEEP_AGENT_PROTOCOL_VERSION_HEADER =\n \"x-athena-deep-agent-protocol-version\";\n\n/** Attach header declaring the head window a fresh client wants in its hello (host-clamped). */\nexport const DEEP_AGENT_MESSAGE_WINDOW_HEADER = \"x-athena-deep-agent-window\";\n\n/** Replicated-state key of the server-advertised version lane. */\nexport const DEEP_AGENT_PROTOCOL_STATE_KEY = \"protocol\";\n\n/** Ephemeral subprotocol carrying a client's message-window interests. */\nexport const DEEP_AGENT_INTEREST_PROTOCOL = \"athena/interest\";\n\n/** Ephemeral subprotocol carrying a client's synced context document. */\nexport const DEEP_AGENT_CONTEXT_PROTOCOL = \"athena/context\";\n\n/** The only interest namespace the host resolves (the linear transcript). */\nexport const DEEP_AGENT_MAIN_NS = \"main\";\n\n/** Window size (interest `before`) a client asks for by default. */\nexport const DEEP_AGENT_DEFAULT_MESSAGE_WINDOW = 40;\n\n/** Bounds on a window size. */\nexport const DEEP_AGENT_MIN_MESSAGE_WINDOW = 8;\n\nexport const DEEP_AGENT_MAX_MESSAGE_WINDOW = 200;\n\n/** Interests one attach may hold at once (the head plus its pages). */\nexport const DEEP_AGENT_MAX_INTERESTS = 16;\n\n/** Command returning a truncated tool output whole. */\nexport const DEEP_AGENT_HISTORY_TOOL_OUTPUT_COMMAND = \"history/tool_output\";\n\n/** Command returning one stored message whole (provenance and full tool output included). */\nexport const DEEP_AGENT_HISTORY_MESSAGE_COMMAND = \"history/message\";\n\n/** Wire key marking a tool message whose content was truncated. */\nexport const DEEP_AGENT_TRUNCATED_CONTENT_KEY = \"athena_content_truncated\";\n\n/** Most inline-image payload characters one message carries whole on the wire. */\nexport const DEEP_AGENT_INLINE_IMAGE_WIRE_BUDGET = 4194304;\n\n/** Wire key on an image block left off the wire: `{ index, chars, mediaType }`. */\nexport const DEEP_AGENT_OMITTED_IMAGE_KEY = \"athena_image_omitted\";\n\n/** The image an omitted block carries instead of its own (a neutral PNG tile). */\nexport const DEEP_AGENT_OMITTED_IMAGE_PLACEHOLDER_URL =\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4AQMAAABPbGssAAAABlBMVEXi6PCUo7jao11HAAAA6ElEQVR42u2UyW3DMBBF3wxogEd2EJbCElKQDRCwC3MpSRc5eLuYokgNLEUxctK/CHyanQts2vRO3QdlALVsXsBvecqxxr1ob0A5GlDJU+hICxN54p/qXAx/+FpoeeE8hTerzfvByn7ifzpaBtWCOwv6bMVMBgzRgNGKmUL9McDs4XOSyEHuoKCI76AiqOugg+y0gx6SN+YQg3QwALGk19pQSKV/reOocyoww27oU5sxhAbKUNgIqrVxrvnovJ80MFgxYy23wtTss44tmL+bAuOE2p2o0fJa3iW/6iR/lEfx8kv3TZtW6AFk5Sf3k+GTswAAAABJRU5ErkJggg==\";\n\n/**\n * Command returning one inline image of a stored message in chunks:\n * `{ messageId, index, offset? }` answers\n * `{ messageId, index, mediaType, offset, total, chunk, next }`; the\n * chunks joined in order are the image's `data:` URL, and `next` is\n * the offset to ask for next (`null` after the last chunk).\n */\nexport const DEEP_AGENT_HISTORY_IMAGE_COMMAND = \"history/image\";\n"],"names":[],"mappings":";;AA6GO,MAAM,yBAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAK8D,IAAI;AAAA,EAChE;AACF;AAGO,MAAM,kCAAkC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAMuE,IAAI;AAAA,EACzE;AACF;AAGO,MAAM,4BAA4B;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAKiE,IAAI;AAAA,EACnE;AACF;AAaO,MAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAK4D,IAAI;AAAA,EAC9D;AACF;AA2BO,MAAM,+BAA+B;AAQrC,MAAM,oCAAoC;AAE1C,MAAM,kCAAkC;AAmBxC,MAAM,8BAA8B;AAGpC,MAAM,qCACX;AAGK,MAAM,mCAAmC;AAGzC,MAAM,gCAAgC;AAGtC,MAAM,+BAA+B;AAMrC,MAAM,qBAAqB;AAG3B,MAAM,oCAAoC;AAG1C,MAAM,gCAAgC;AAEtC,MAAM,gCAAgC;AAGtC,MAAM,2BAA2B;AAGjC,MAAM,yCAAyC;AAM/C,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;"}
@@ -179,7 +179,9 @@ new Set(
179
179
  THREAD_CONFIG_CUSTOM_KEYS
180
180
  );
181
181
  const KNOWN_START_CHANNELS = [
182
+ "agent_orchestration",
182
183
  "api",
184
+ "automation",
183
185
  "chrome_extension",
184
186
  "cli",
185
187
  "comment_agent",