@segmentstream/agent 0.83.0 → 0.84.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 (85) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +31 -16
  3. package/dist/_chunks/{build-metadata-Bo-QTQbc.mjs → build-metadata-CFe-5i6d.mjs} +1 -1
  4. package/dist/_chunks/{chat-archive-D4HRgOSo.mjs → chat-archive-By3MnPEC.mjs} +1 -1
  5. package/dist/_chunks/{principal-dEQyjF1n.mjs → principal-C1g8wCIg.mjs} +12 -3
  6. package/dist/extension/connections/ontology.mjs +1 -1
  7. package/dist/extension/hooks/authorization.mjs +1 -1
  8. package/dist/extension/instructions/persona.mjs +1 -1
  9. package/dist/extension/lib/actor.mjs +1 -1
  10. package/dist/extension/lib/agent-task.mjs +2 -1
  11. package/dist/extension/lib/attachment-tools.mjs +1 -1
  12. package/dist/extension/lib/attachments-send.mjs +1 -1
  13. package/dist/extension/lib/attachments.mjs +1 -1
  14. package/dist/extension/lib/build-metadata.mjs +1 -1
  15. package/dist/extension/lib/chat-address.mjs +1 -1
  16. package/dist/extension/lib/chat-context.mjs +1 -1
  17. package/dist/extension/lib/chat-recorder.mjs +1 -1
  18. package/dist/extension/lib/chat-store.mjs +3 -1
  19. package/dist/extension/lib/confirmations.mjs +1 -1
  20. package/dist/extension/lib/email/attachments-send.mjs +1 -1
  21. package/dist/extension/lib/email/channel.mjs +1 -1
  22. package/dist/extension/lib/environment.d.ts +16 -1
  23. package/dist/extension/lib/environment.mjs +12 -2
  24. package/dist/extension/lib/guest-usage.mjs +3 -2
  25. package/dist/extension/lib/identities.mjs +2 -0
  26. package/dist/extension/lib/inbound-media/files.mjs +1 -1
  27. package/dist/extension/lib/inbound-media/index.mjs +1 -1
  28. package/dist/extension/lib/ontology-connection.mjs +1 -1
  29. package/dist/extension/lib/ontology-file-call.mjs +1 -1
  30. package/dist/extension/lib/ontology-recall.mjs +1 -1
  31. package/dist/extension/lib/ontology-tools.mjs +1 -1
  32. package/dist/extension/lib/review/client.mjs +3 -0
  33. package/dist/extension/lib/review/hold.mjs +1 -1
  34. package/dist/extension/lib/review/reply.mjs +1 -1
  35. package/dist/extension/lib/review/revision.mjs +2 -0
  36. package/dist/extension/lib/role-skill.mjs +1 -1
  37. package/dist/extension/lib/runtime-envelope.mjs +1 -1
  38. package/dist/extension/lib/sent-files.mjs +3 -1
  39. package/dist/extension/lib/slack/adapter.mjs +1 -1
  40. package/dist/extension/lib/slack/attachments-send.mjs +1 -1
  41. package/dist/extension/lib/slack/callbacks.mjs +1 -1
  42. package/dist/extension/lib/stored-files.mjs +1 -1
  43. package/dist/extension/lib/telegram/adapter.mjs +3 -3
  44. package/dist/extension/lib/telegram/attachment-description.mjs +1 -1
  45. package/dist/extension/lib/telegram/attachments-send.mjs +1 -1
  46. package/dist/extension/lib/telegram/callbacks.mjs +1 -1
  47. package/dist/extension/lib/telegram/chat-archive.mjs +1 -1
  48. package/dist/extension/lib/telegram/confirmations.mjs +1 -1
  49. package/dist/extension/lib/telegram/customer-text.mjs +1 -1
  50. package/dist/extension/lib/telegram/files.mjs +1 -1
  51. package/dist/extension/lib/telegram/health.mjs +1 -1
  52. package/dist/extension/lib/telegram/held-approvals.mjs +1 -1
  53. package/dist/extension/lib/telegram/inbound-request.mjs +1 -1
  54. package/dist/extension/lib/telegram/inbound.mjs +2 -2
  55. package/dist/extension/lib/telegram/lifecycle.mjs +2 -2
  56. package/dist/extension/lib/telegram/principal.mjs +1 -1
  57. package/dist/extension/lib/telegram/session-recovery.mjs +1 -1
  58. package/dist/extension/lib/telegram/silent.mjs +1 -1
  59. package/dist/extension/lib/telegram/store-capture.mjs +1 -1
  60. package/dist/extension/lib/telegram/structured.mjs +1 -1
  61. package/dist/extension/lib/telegram/turn-errors.mjs +2 -2
  62. package/dist/extension/lib/web/auth.d.ts +13 -3
  63. package/dist/extension/lib/web/auth.mjs +1 -1
  64. package/dist/extension/lib/web/channel.mjs +1 -1
  65. package/dist/extension/lib/whatsapp/adapter.mjs +1 -1
  66. package/dist/extension/lib/whatsapp/attachments-send.mjs +1 -1
  67. package/dist/extension/lib/whatsapp/callbacks.mjs +1 -1
  68. package/dist/extension/lib/whatsapp/files.mjs +1 -1
  69. package/dist/extension/lib/workspace-action.mjs +1 -1
  70. package/dist/extension/lib/workspace-channel/attachments-send.d.ts +1 -1
  71. package/dist/extension/lib/workspace-channel/attachments-send.mjs +3 -1
  72. package/dist/extension/lib/workspace-channel/channel.mjs +1 -1
  73. package/dist/extension/lib/workspace-source.mjs +1 -1
  74. package/dist/extension/model.mjs +1 -1
  75. package/dist/extension/tools/attachments_discard.mjs +1 -1
  76. package/dist/extension/tools/attachments_list.mjs +1 -1
  77. package/dist/extension/tools/attachments_promote.mjs +1 -1
  78. package/dist/extension/tools/attachments_read.mjs +1 -1
  79. package/dist/extension/tools/attachments_send.mjs +1 -1
  80. package/dist/extension/tools/attachments_stage.mjs +1 -1
  81. package/dist/extension/tools/attachments_table.mjs +1 -1
  82. package/dist/extension/tools/handoff.mjs +1 -1
  83. package/dist/extension/tools/questions_ask.mjs +1 -1
  84. package/dist/extension/tools/workspace_source.mjs +1 -1
  85. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.84.0
4
+
5
+ The agent runs in app previews. Where the platform sets `SEGMENTSTREAM_DEPLOYMENT_TARGET=preview`,
6
+ the agent calls the ontology of its own deployment (`VERCEL_URL`) instead of the hosting project's
7
+ production domain, names its deployment in `X-SegmentStream-Ontology-Deployment-Id` on every
8
+ runtime request to the ontology, and runs no channels.
9
+
10
+ `webAuth` is now an eve-channel authenticator (`EveAuthFn`). In an app preview, a test member's eval
11
+ session token, which the ontology answers with `eval: true`, may read `GET /eve/v1/info`, so `eve
12
+ eval --url` runs against the preview as that member with `EVE_EVAL_AUTH_TOKEN`. Every other web
13
+ token, and every token in production, stays a member who cannot read it.
14
+
15
+ Pins @segmentstream/ontology 0.163.0.
16
+
17
+ ## 0.83.1
18
+
19
+ Pins @segmentstream/ontology 0.162.0.
20
+
3
21
  ## 0.83.0
4
22
 
5
23
  A held reply names the turn that wrote it (`turn_id`), so the ontology can tell whether the person
package/README.md CHANGED
@@ -757,8 +757,20 @@ this formatter does not rewrite approved posts or their confirmation cards. The
757
757
  `eve dev` in `agent/` runs the agent locally. The Telegram channel stays silent outside production.
758
758
  To reach a local ontology service, set `SEGMENTSTREAM_AGENT_ONTOLOGY_URL=http://localhost:3000`.
759
759
  `vercel env pull` writes a `VERCEL_OIDC_TOKEN` for the token. The ontology service admits only
760
- production tokens of the workspace's project, though, so a local run gets the ontology only from a
761
- local ontology service configured to accept that token.
760
+ production tokens of the workspace's project, or in an app preview its hosting project's preview
761
+ tokens, though, so a local run gets the ontology only from a local ontology service configured to
762
+ accept that token.
763
+
764
+ ## App previews
765
+
766
+ An app preview of an SDK that supports it runs the agent from the preview's commit, in the preview's
767
+ hosting project, beside the preview's own ontology. The platform sets
768
+ `SEGMENTSTREAM_DEPLOYMENT_TARGET=preview` and the preview's `SEGMENTSTREAM_ONTOLOGY_DEPLOYMENT_ID`;
769
+ the agent then calls the ontology on its own deployment (`VERCEL_URL`), names the deployment in
770
+ `X-SegmentStream-Ontology-Deployment-Id` on every runtime request, and runs no channels. A test
771
+ member's eval session token, which the ontology answers with `eval: true` there alone, may read
772
+ `GET /eve/v1/info`, so `eve eval --url` runs against the preview as that member; a production agent
773
+ never lets a member read it.
762
774
 
763
775
  Building the package needs Node.js 24, as eve does: `pnpm run build` runs `eve extension build`,
764
776
  which writes the agent-shaped `dist/extension` tree, its declarations and eve's compatibility
@@ -777,20 +789,23 @@ This guard does not intercept Eve's own workflow streams or third-party tools.
777
789
  The platform sets every variable on the workspace's Vercel project. None of them is a model key or
778
790
  a provider token.
779
791
 
780
- | Variable | Used for |
781
- | ------------------------------------- | ------------------------------------------------------------------------------- |
782
- | `VERCEL_PROJECT_PRODUCTION_URL` | The app's origin: `/mcp`, `/api/ontology/agent/*` and the `/agent/connect` link |
783
- | `SEGMENTSTREAM_AGENT_ONTOLOGY_URL` | Overrides that origin in local development |
784
- | `SEGMENTSTREAM_URL` | backend-next, where the connection proxy answers |
785
- | `SEGMENTSTREAM_WORKSPACE_ID` | The workspace in the proxy's path |
786
- | `SEGMENTSTREAM_ORGANIZATION_ID` | The tenant the proxy selects |
787
- | `SEGMENTSTREAM_AGENT_WEBHOOK_SECRET` | The Telegram webhook secret; the only secret |
788
- | `SEGMENTSTREAM_RUNTIME_OIDC_ISSUER` | The team's OIDC issuer, which signs the tokens the health and task routes take |
789
- | `SEGMENTSTREAM_RUNTIME_OIDC_AUDIENCE` | The audience those tokens must name |
790
- | `VERCEL_PROJECT_ID` | The project those tokens must name |
791
- | `VERCEL_ENV` | Channels run only in `production`; `preview` selects the preview model |
792
- | `VERCEL_OIDC_TOKEN` | The runtime token outside a request; Vercel sends it on each request otherwise |
793
- | `AI_GATEWAY_API_KEY` | Optional. AI Gateway uses the OIDC token when it is unset |
792
+ | Variable | Used for |
793
+ | -------------------------------------- | ------------------------------------------------------------------------------- |
794
+ | `VERCEL_PROJECT_PRODUCTION_URL` | The app's origin: `/mcp`, `/api/ontology/agent/*` and the `/agent/connect` link |
795
+ | `SEGMENTSTREAM_AGENT_ONTOLOGY_URL` | Overrides that origin in local development |
796
+ | `SEGMENTSTREAM_URL` | backend-next, where the connection proxy answers |
797
+ | `SEGMENTSTREAM_WORKSPACE_ID` | The workspace in the proxy's path |
798
+ | `SEGMENTSTREAM_ORGANIZATION_ID` | The tenant the proxy selects |
799
+ | `SEGMENTSTREAM_AGENT_WEBHOOK_SECRET` | The Telegram webhook secret; the only secret |
800
+ | `SEGMENTSTREAM_RUNTIME_OIDC_ISSUER` | The team's OIDC issuer, which signs the tokens the health and task routes take |
801
+ | `SEGMENTSTREAM_RUNTIME_OIDC_AUDIENCE` | The audience those tokens must name |
802
+ | `VERCEL_PROJECT_ID` | The project those tokens must name |
803
+ | `VERCEL_ENV` | Channels run only in `production`; `preview` selects the preview model |
804
+ | `SEGMENTSTREAM_DEPLOYMENT_TARGET` | `preview` in an app preview, which runs no channels |
805
+ | `SEGMENTSTREAM_ONTOLOGY_DEPLOYMENT_ID` | In an app preview, the deployment named to its ontology |
806
+ | `VERCEL_URL` | In an app preview, the deployment's own origin, where its ontology answers |
807
+ | `VERCEL_OIDC_TOKEN` | The runtime token outside a request; Vercel sends it on each request otherwise |
808
+ | `AI_GATEWAY_API_KEY` | Optional. AI Gateway uses the OIDC token when it is unset |
794
809
 
795
810
  ## License
796
811
 
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- var version = "0.83.0";
7
+ var version = "0.84.0";
8
8
  function agentBuild(environment = process.env) {
9
9
  return {
10
10
  agent: version,
@@ -10,7 +10,7 @@ import { n as contentText, t as CONTENT_CAPS } from "./content-cDtVnr8Y.mjs";
10
10
  import { C as sendFingerprint, S as reasonCode, _ as boundedMeta, a as chatEvent, b as messageInput, f as sessionFailureEventId, p as storeOf, v as cutText, w as storedFiles, x as metaOf } from "./chat-archive-DavfKJDI.mjs";
11
11
  import { applyChatChange } from "../extension/lib/chat-messages.mjs";
12
12
  import { ChatStoreError } from "../extension/lib/chat-store.mjs";
13
- import { c as currentInboundRequest, ht as currentThreadId, xt as reportTelegramError } from "./principal-dEQyjF1n.mjs";
13
+ import { c as currentInboundRequest, ht as currentThreadId, xt as reportTelegramError } from "./principal-C1g8wCIg.mjs";
14
14
  import { telegramReaction } from "../extension/lib/telegram/reactions.mjs";
15
15
  import { currentConfirmationPrompt } from "../extension/lib/group-routing/messages.mjs";
16
16
  import { messageMetadata } from "../extension/lib/telegram/message-metadata.mjs";
@@ -6,11 +6,11 @@ __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { AGENT_TOOLS_ATTRIBUTE, SANDBOX_TOOL, agentToolsAnswer, agentToolsAttribute } from "../extension/lib/agent-tools.mjs";
8
8
  import { redactDiagnostic } from "../extension/lib/diagnostics.mjs";
9
+ import { appOrigin, ontologyDeploymentHeaders, previewDeployment } from "../extension/lib/environment.mjs";
9
10
  import { telegramText, withTelegramTexts } from "../extension/lib/telegram/texts.mjs";
10
11
  import { isTechnicalText, isUnsafeText } from "../extension/lib/customer-text-safety.mjs";
11
12
  import { miniAppLinks, originalLinkPreview, withMiniAppLinks } from "../extension/lib/telegram/app-links.mjs";
12
13
  import { CHANNEL_NAME, admissionLimitsOf } from "../extension/config.mjs";
13
- import { appOrigin } from "../extension/lib/environment.mjs";
14
14
  import { channelAttributes, currentChannel, principalChannel } from "../extension/lib/channel-scope.mjs";
15
15
  import { redactTelegramDiagnostic } from "../extension/lib/telegram/diagnostic-redaction.mjs";
16
16
  import { CONFIRMATION_FACTS, CONFIRMATION_PREVIEW_METHOD, ConfirmationRefused, UnsafeConfirmationTarget, confirmationCard, describeConfirmation, factsConfirmation, object } from "../extension/lib/confirmation-description.mjs";
@@ -531,6 +531,7 @@ function webMemberOf(body) {
531
531
  roles,
532
532
  agentTools,
533
533
  ...typeof answer.name === "string" && answer.name !== "" ? { name: answer.name } : {},
534
+ ...answer.eval === true ? { eval: true } : {},
534
535
  ...limitedOf(answer.limited)
535
536
  };
536
537
  }
@@ -540,6 +541,7 @@ function ontologyIntrospection(options = {}) {
540
541
  method: "POST",
541
542
  headers: {
542
543
  authorization: `Bearer ${await (options.token ?? runtimeToken)()}`,
544
+ ...ontologyDeploymentHeaders(options.environment ?? process.env),
543
545
  "content-type": "application/json"
544
546
  },
545
547
  body: JSON.stringify(body),
@@ -678,7 +680,11 @@ function webAuth(options = {}) {
678
680
  message: "The agent token is invalid or expired."
679
681
  });
680
682
  if (member.limited !== void 0) throw new TurnLimitedError(member.limited.retryAfterSeconds, member.limited.scope);
681
- return withButtonDecision(webPrincipal(member), answersOf(body));
683
+ const principal = withButtonDecision(webPrincipal(member), answersOf(body));
684
+ return member.kind !== "guest" && member.eval === true && previewDeployment(options.environment ?? process.env) !== void 0 ? {
685
+ ...principal,
686
+ allowAgentInfo: true
687
+ } : principal;
682
688
  };
683
689
  }
684
690
  const ACT_AS_HEADER = "X-SegmentStream-Act-As";
@@ -1004,6 +1010,7 @@ function ontologyTools(options = {}) {
1004
1010
  method: "POST",
1005
1011
  headers: {
1006
1012
  authorization: `Bearer ${credential}`,
1013
+ ...ontologyDeploymentHeaders(options.environment ?? process.env),
1007
1014
  ...acting,
1008
1015
  ...chatHeaders(own, options.sessionId),
1009
1016
  "content-type": "application/json",
@@ -1351,7 +1358,8 @@ function ontologyConnection(input) {
1351
1358
  expected: actor,
1352
1359
  secret: input.secret
1353
1360
  }),
1354
- ...chatHeaders(context.session.auth.current, context.session.id)
1361
+ ...chatHeaders(context.session.auth.current, context.session.id),
1362
+ ...ontologyDeploymentHeaders(input.environment ?? process.env)
1355
1363
  });
1356
1364
  const common = {
1357
1365
  url: `${origin}/mcp`,
@@ -1538,6 +1546,7 @@ function agentAttachments(input) {
1538
1546
  method: body === void 0 ? "GET" : "POST",
1539
1547
  headers: {
1540
1548
  authorization: `Bearer ${token}`,
1549
+ ...ontologyDeploymentHeaders(),
1541
1550
  accept: "application/json",
1542
1551
  [ACT_AS_HEADER]: owner.memberId,
1543
1552
  [CHAT_HEADER]: owner.chat,
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import segmentstream from "../extension.mjs";
8
- import { T as ontologyConnection } from "../../_chunks/principal-dEQyjF1n.mjs";
8
+ import { T as ontologyConnection } from "../../_chunks/principal-C1g8wCIg.mjs";
9
9
  import { defineDynamic } from "eve/connections";
10
10
  var ontology_default = defineDynamic(async (context) => {
11
11
  if (!segmentstream.config.ontology.connection) return null;
@@ -7,7 +7,7 @@ __eveCreateRequire(import.meta.url);
7
7
  import segmentstream from "../extension.mjs";
8
8
  import { localizedText } from "../lib/admission.mjs";
9
9
  import { confirmationLocale } from "../lib/telegram/confirmation-text.mjs";
10
- import "../../_chunks/principal-dEQyjF1n.mjs";
10
+ import "../../_chunks/principal-C1g8wCIg.mjs";
11
11
  import { defineHook } from "eve/hooks";
12
12
  var authorization_default = defineHook({ events: { "interaction.opened": (event, context) => {
13
13
  const principal = context.session.auth.current;
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import segmentstream from "../extension.mjs";
8
- import { a as rolesOf } from "../../_chunks/principal-dEQyjF1n.mjs";
8
+ import { a as rolesOf } from "../../_chunks/principal-C1g8wCIg.mjs";
9
9
  import { personaFor } from "../personas.mjs";
10
10
  import { defineDynamic, defineInstructions } from "eve/instructions";
11
11
  var persona_default = defineDynamic((context) => {
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- export { R as ACT_AS_HEADER, z as ActorRequiredError, B as actorHeaders, V as actorKey, H as actorOf, U as isGuestSession, W as member, G as memberTool, K as notForGuests } from "../../_chunks/principal-dEQyjF1n.mjs";
7
+ export { R as ACT_AS_HEADER, z as ActorRequiredError, B as actorHeaders, V as actorKey, H as actorOf, U as isGuestSession, W as member, G as memberTool, K as notForGuests } from "../../_chunks/principal-C1g8wCIg.mjs";
@@ -6,7 +6,7 @@ __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { agentToolsAnswer, agentToolsAttribute } from "./agent-tools.mjs";
8
8
  import { redactDiagnostic } from "./diagnostics.mjs";
9
- import { appOrigin } from "./environment.mjs";
9
+ import { appOrigin, ontologyDeploymentHeaders } from "./environment.mjs";
10
10
  import { runtimeToken } from "./runtime-token.mjs";
11
11
  import { randomUUID } from "node:crypto";
12
12
  import { defineState } from "eve/context";
@@ -111,6 +111,7 @@ function agentTasks(options = {}) {
111
111
  signal: AbortSignal.timeout(CALL_TIMEOUT_MS),
112
112
  headers: {
113
113
  authorization: `Bearer ${credential}`,
114
+ ...ontologyDeploymentHeaders(),
114
115
  accept: "application/json",
115
116
  ...init.secret === void 0 ? {} : { [AGENT_TASK_HEADER]: init.secret },
116
117
  ...init.body === void 0 ? {} : { "content-type": "application/json" }
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { Ft as chatAddressOf, It as chatChannel, b as agentAttachments, i as memberIdOf } from "../../_chunks/principal-dEQyjF1n.mjs";
7
+ import { Ft as chatAddressOf, It as chatChannel, b as agentAttachments, i as memberIdOf } from "../../_chunks/principal-C1g8wCIg.mjs";
8
8
  import { detectFile, documentText } from "./attachment-formats.mjs";
9
9
  import { readSheets, typedTable } from "./attachment-tables.mjs";
10
10
  import { appOrigin } from "./environment.mjs";
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { attachmentOwner } from "./attachment-tools.mjs";
8
- import { Ft as chatAddressOf, _ as AttachmentError, yt as failureText } from "../../_chunks/principal-dEQyjF1n.mjs";
8
+ import { Ft as chatAddressOf, _ as AttachmentError, yt as failureText } from "../../_chunks/principal-C1g8wCIg.mjs";
9
9
  import { appOrigin, channelsEnabled } from "./environment.mjs";
10
10
  import { transientFileStatus } from "./file-grant.mjs";
11
11
  import { runtimeToken } from "./runtime-token.mjs";
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- export { h as ATTACHMENT_TTL_HOURS, g as ATTACHMENT_URL_PROTOCOL, _ as AttachmentError, jt as CHAT_HEADER, v as EARLIER_CHAT_HEADER, y as MAXIMUM_ATTACHMENT_BYTES, Pt as SESSION_HEADER, b as agentAttachments, x as attachmentUrl, S as fetchStoredAttachment, C as parseAttachmentUrl } from "../../_chunks/principal-dEQyjF1n.mjs";
7
+ export { h as ATTACHMENT_TTL_HOURS, g as ATTACHMENT_URL_PROTOCOL, _ as AttachmentError, jt as CHAT_HEADER, v as EARLIER_CHAT_HEADER, y as MAXIMUM_ATTACHMENT_BYTES, Pt as SESSION_HEADER, b as agentAttachments, x as attachmentUrl, S as fetchStoredAttachment, C as parseAttachmentUrl } from "../../_chunks/principal-C1g8wCIg.mjs";
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- export { t as agentBuild } from "../../_chunks/build-metadata-Bo-QTQbc.mjs";
7
+ export { t as agentBuild } from "../../_chunks/build-metadata-CFe-5i6d.mjs";
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- export { At as CHAT_ATTRIBUTE, jt as CHAT_HEADER, Mt as PARTICIPANTS_ATTRIBUTE, Nt as RUNTIME_SOURCE_ATTRIBUTE, Pt as SESSION_HEADER, Ft as chatAddressOf, It as chatChannel, Lt as chatHeaders, Rt as chatRuntimeSource, zt as isSameChat, Bt as participantsOf, Vt as withChatAddress, Ht as workspaceIdentityProvider } from "../../_chunks/principal-dEQyjF1n.mjs";
7
+ export { At as CHAT_ATTRIBUTE, jt as CHAT_HEADER, Mt as PARTICIPANTS_ATTRIBUTE, Nt as RUNTIME_SOURCE_ATTRIBUTE, Pt as SESSION_HEADER, Ft as chatAddressOf, It as chatChannel, Lt as chatHeaders, Rt as chatRuntimeSource, zt as isSameChat, Bt as participantsOf, Vt as withChatAddress, Ht as workspaceIdentityProvider } from "../../_chunks/principal-C1g8wCIg.mjs";
@@ -7,7 +7,7 @@ __eveCreateRequire(import.meta.url);
7
7
  import { agentTaskIdOf } from "./agent-task.mjs";
8
8
  import { chatCoordinates, sessionKind } from "./chat-recorder.mjs";
9
9
  import { h as topicContext, i as chatAuthor, n as archiveSequence, p as storeOf, r as chatArchive, s as collapseChatEvents } from "../../_chunks/chat-archive-DavfKJDI.mjs";
10
- import { xt as reportTelegramError } from "../../_chunks/principal-dEQyjF1n.mjs";
10
+ import { xt as reportTelegramError } from "../../_chunks/principal-C1g8wCIg.mjs";
11
11
  import { createHash } from "node:crypto";
12
12
  import { deliveries, runs, turns } from "eve/events";
13
13
  import { defineState } from "eve/context";
@@ -8,7 +8,7 @@ import { n as contentText, t as CONTENT_CAPS } from "../../_chunks/content-cDtVn
8
8
  import { a as chatEvent, f as sessionFailureEventId, m as summarizeArguments, p as storeOf, r as chatArchive } from "../../_chunks/chat-archive-DavfKJDI.mjs";
9
9
  import { agentTaskIdOf } from "./agent-task.mjs";
10
10
  import { revisionOf } from "./review/revision.mjs";
11
- import { Bt as participantsOf, Ft as chatAddressOf, It as chatChannel, i as memberIdOf, ot as guestIdOf } from "../../_chunks/principal-dEQyjF1n.mjs";
11
+ import { Bt as participantsOf, Ft as chatAddressOf, It as chatChannel, i as memberIdOf, ot as guestIdOf } from "../../_chunks/principal-C1g8wCIg.mjs";
12
12
  import { keyChannel, principalChannel } from "./channel-scope.mjs";
13
13
  import { parseAddress } from "./telegram/sessions.mjs";
14
14
  import { completionKind } from "./telegram/silent.mjs";
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { AgentEnvironmentError, appOrigin } from "./environment.mjs";
7
+ import { AgentEnvironmentError, appOrigin, ontologyDeploymentHeaders } from "./environment.mjs";
8
8
  import { runtimeToken } from "./runtime-token.mjs";
9
9
  import { r as workflowValue } from "../../_chunks/workflow-serializable-gzv5MZ5P.mjs";
10
10
  var ChatStoreError = class extends Error {
@@ -48,6 +48,7 @@ function chatStore(input = {}) {
48
48
  redirect: "error",
49
49
  headers: {
50
50
  authorization: `Bearer ${await token()}`,
51
+ ...ontologyDeploymentHeaders(),
51
52
  accept: "application/json",
52
53
  "content-type": "application/json"
53
54
  },
@@ -86,6 +87,7 @@ async function storeAvailable(input) {
86
87
  redirect: "error",
87
88
  headers: {
88
89
  authorization: `Bearer ${await input.token()}`,
90
+ ...ontologyDeploymentHeaders(),
89
91
  accept: "application/json",
90
92
  "content-type": "application/json"
91
93
  },
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- export { N as CONFIRMATION_TTL_MS, P as actionApproval, F as confirmations, I as inputHash, L as needsConfirmation } from "../../_chunks/principal-dEQyjF1n.mjs";
7
+ export { N as CONFIRMATION_TTL_MS, P as actionApproval, F as confirmations, I as inputHash, L as needsConfirmation } from "../../_chunks/principal-C1g8wCIg.mjs";
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { _ as AttachmentError } from "../../../_chunks/principal-dEQyjF1n.mjs";
7
+ import { _ as AttachmentError } from "../../../_chunks/principal-C1g8wCIg.mjs";
8
8
  import { sendStoredAttachments } from "../attachments-send.mjs";
9
9
  import { ConnectionProxyError, connectionProxy } from "../connection-proxy.mjs";
10
10
  import { redactDiagnostic } from "../diagnostics.mjs";
@@ -8,7 +8,7 @@ import { PUBSUB_TOPIC } from "../../config.mjs";
8
8
  import { admitMessage, localizedText, reportUnadmittedChat } from "../admission.mjs";
9
9
  import { agentToolsAttribute } from "../agent-tools.mjs";
10
10
  import { providerChat } from "../attachment-tools.mjs";
11
- import { Bt as participantsOf, Ft as chatAddressOf, Mt as PARTICIPANTS_ATTRIBUTE, S as fetchStoredAttachment, Vt as withChatAddress, b as agentAttachments, d as prepareInboundMedia, i as memberIdOf, m as turnContent } from "../../../_chunks/principal-dEQyjF1n.mjs";
11
+ import { Bt as participantsOf, Ft as chatAddressOf, Mt as PARTICIPANTS_ATTRIBUTE, S as fetchStoredAttachment, Vt as withChatAddress, b as agentAttachments, d as prepareInboundMedia, i as memberIdOf, m as turnContent } from "../../../_chunks/principal-C1g8wCIg.mjs";
12
12
  import { channelAttributes, currentChannel, currentKey, inHandlerChannels, withNamedRoutes } from "../channel-scope.mjs";
13
13
  import { a as chatEvent, b as messageInput, d as replyRecipients, g as UNVERIFIED, l as replyEvent, p as storeOf, r as chatArchive, t as AGENT_SENDER } from "../../../_chunks/chat-archive-DavfKJDI.mjs";
14
14
  import { ChatStoreError } from "../chat-store.mjs";
@@ -7,10 +7,25 @@ export type Environment = Readonly<Record<string, string | undefined>>;
7
7
  export declare class AgentEnvironmentError extends Error {
8
8
  readonly name = "AgentEnvironmentError";
9
9
  }
10
+ /**
11
+ * The header the agent of an app preview names its deployment in, on every request to the
12
+ * preview's ontology: the preview's function tokens name no deployment, and every preview of a
13
+ * workspace shares one hosting project, so the ontology refuses a runtime token without it.
14
+ */
15
+ export declare const ONTOLOGY_DEPLOYMENT_HEADER = "x-segmentstream-ontology-deployment-id";
16
+ /**
17
+ * The app preview this agent runs in, as the platform says (`SEGMENTSTREAM_DEPLOYMENT_TARGET` is
18
+ * `preview`, with its deployment in `SEGMENTSTREAM_ONTOLOGY_DEPLOYMENT_ID`); `undefined` anywhere
19
+ * else, production included.
20
+ */
21
+ export declare function previewDeployment(environment?: Environment): string | undefined;
22
+ /** The headers every runtime request to the ontology carries: in a preview, its deployment. */
23
+ export declare function ontologyDeploymentHeaders(environment?: Environment): Record<string, string>;
10
24
  /**
11
25
  * Where the workspace app answers: the ontology service's `/mcp` and `/api/ontology/*`, and the
12
26
  * app's `/agent/connect` page. `SEGMENTSTREAM_AGENT_ONTOLOGY_URL` overrides it in local
13
- * development; deployments use their production domain.
27
+ * development; an app preview uses its own deployment (`VERCEL_URL`), whose ontology was built
28
+ * from the same commit, and production its production domain.
14
29
  */
15
30
  export declare function appOrigin(environment?: Environment): string;
16
31
  /** What the connection proxy needs: backend-next's URL and the tenant it selects. */
@@ -17,6 +17,15 @@ function withoutTrailingSlashes(url) {
17
17
  while (end > 0 && url[end - 1] === "/") end -= 1;
18
18
  return url.slice(0, end);
19
19
  }
20
+ const ONTOLOGY_DEPLOYMENT_HEADER = "x-segmentstream-ontology-deployment-id";
21
+ function previewDeployment(environment = process.env) {
22
+ const deploymentId = environment.SEGMENTSTREAM_ONTOLOGY_DEPLOYMENT_ID?.trim();
23
+ return environment.SEGMENTSTREAM_DEPLOYMENT_TARGET?.trim() === "preview" && deploymentId !== void 0 && deploymentId !== "" ? deploymentId : void 0;
24
+ }
25
+ function ontologyDeploymentHeaders(environment = process.env) {
26
+ const deploymentId = previewDeployment(environment);
27
+ return deploymentId === void 0 ? {} : { [ONTOLOGY_DEPLOYMENT_HEADER]: deploymentId };
28
+ }
20
29
  function appOrigin(environment = process.env) {
21
30
  const override = environment.SEGMENTSTREAM_AGENT_ONTOLOGY_URL;
22
31
  if (override !== void 0 && override.trim() !== "") {
@@ -24,6 +33,7 @@ function appOrigin(environment = process.env) {
24
33
  if (url === void 0 || url.protocol !== "https:" && url.protocol !== "http:") throw new AgentEnvironmentError("SEGMENTSTREAM_AGENT_ONTOLOGY_URL must be an http(s) URL.");
25
34
  return withoutTrailingSlashes(`${url.origin}${url.pathname}`);
26
35
  }
36
+ if (previewDeployment(environment) !== void 0) return `https://${required(environment, "VERCEL_URL")}`;
27
37
  return `https://${required(environment, "VERCEL_PROJECT_PRODUCTION_URL")}`;
28
38
  }
29
39
  function proxyEnvironment(environment = process.env) {
@@ -45,9 +55,9 @@ function webhookSecret(environment = process.env) {
45
55
  return secret === void 0 || secret === "" ? void 0 : secret;
46
56
  }
47
57
  function channelsEnabled(environment = process.env) {
48
- return environment.VERCEL_ENV === "production";
58
+ return environment.VERCEL_ENV === "production" && previewDeployment(environment) === void 0;
49
59
  }
50
60
  function isPreview(environment = process.env) {
51
61
  return environment.VERCEL_ENV === "preview";
52
62
  }
53
- export { AgentEnvironmentError, appOrigin, channelsEnabled, isPreview, proxyEnvironment, runtimeIdentityEnvironment, webhookSecret };
63
+ export { AgentEnvironmentError, ONTOLOGY_DEPLOYMENT_HEADER, appOrigin, channelsEnabled, isPreview, ontologyDeploymentHeaders, previewDeployment, proxyEnvironment, runtimeIdentityEnvironment, webhookSecret };
@@ -4,9 +4,9 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { appOrigin } from "./environment.mjs";
7
+ import { appOrigin, ontologyDeploymentHeaders } from "./environment.mjs";
8
8
  import { runtimeToken } from "./runtime-token.mjs";
9
- import { ot as guestIdOf } from "../../_chunks/principal-dEQyjF1n.mjs";
9
+ import { ot as guestIdOf } from "../../_chunks/principal-C1g8wCIg.mjs";
10
10
  const GUEST_USAGE_PATH = "/api/ontology/agent/guests/usage";
11
11
  const REPORT_TIMEOUT_MS = 5e3;
12
12
  function ontologyGuestUsage(options = {}) {
@@ -15,6 +15,7 @@ function ontologyGuestUsage(options = {}) {
15
15
  method: "POST",
16
16
  headers: {
17
17
  authorization: `Bearer ${await (options.token ?? runtimeToken)()}`,
18
+ ...ontologyDeploymentHeaders(),
18
19
  "content-type": "application/json"
19
20
  },
20
21
  body: JSON.stringify({
@@ -6,6 +6,7 @@ __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { agentToolsAnswer } from "./agent-tools.mjs";
8
8
  import { redactDiagnostic } from "./diagnostics.mjs";
9
+ import { ontologyDeploymentHeaders } from "./environment.mjs";
9
10
  var AgentIdentityError = class extends Error {
10
11
  name = "AgentIdentityError";
11
12
  code;
@@ -166,6 +167,7 @@ function agentIdentities(input) {
166
167
  method: request.body === void 0 ? "GET" : "POST",
167
168
  headers: {
168
169
  authorization: `Bearer ${token}`,
170
+ ...ontologyDeploymentHeaders(),
169
171
  accept: "application/json",
170
172
  ...request.body === void 0 ? {} : { "content-type": "application/json" }
171
173
  },
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- export { f as attachmentsContext, p as storeFiles, m as turnContent } from "../../../_chunks/principal-dEQyjF1n.mjs";
7
+ export { f as attachmentsContext, p as storeFiles, m as turnContent } from "../../../_chunks/principal-C1g8wCIg.mjs";
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- export { f as attachmentsContext, d as prepareInboundMedia, p as storeFiles, m as turnContent } from "../../../_chunks/principal-dEQyjF1n.mjs";
7
+ export { f as attachmentsContext, d as prepareInboundMedia, p as storeFiles, m as turnContent } from "../../../_chunks/principal-C1g8wCIg.mjs";
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- export { R as ACT_AS_HEADER, w as actAsHeaders, T as ontologyConnection } from "../../_chunks/principal-dEQyjF1n.mjs";
7
+ export { R as ACT_AS_HEADER, w as actAsHeaders, T as ontologyConnection } from "../../_chunks/principal-C1g8wCIg.mjs";
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { F as confirmations, H as actorOf, I as inputHash, Ot as runtimeEnvelope, P as actionApproval, V as actorKey, j as ontologyTools } from "../../_chunks/principal-dEQyjF1n.mjs";
7
+ import { F as confirmations, H as actorOf, I as inputHash, Ot as runtimeEnvelope, P as actionApproval, V as actorKey, j as ontologyTools } from "../../_chunks/principal-C1g8wCIg.mjs";
8
8
  import { isChatPost } from "./chat-post-confirmation.mjs";
9
9
  import { sandboxFile } from "./sandbox-session.mjs";
10
10
  import { saveOntologyResult } from "./ontology-result-file.mjs";
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { H as actorOf, a as rolesOf, j as ontologyTools, k as actionToolName } from "../../_chunks/principal-dEQyjF1n.mjs";
7
+ import { H as actorOf, a as rolesOf, j as ontologyTools, k as actionToolName } from "../../_chunks/principal-C1g8wCIg.mjs";
8
8
  import { object } from "./confirmation-description.mjs";
9
9
  import { redactDiagnostic } from "./diagnostics.mjs";
10
10
  import { defineMemoryProvider } from "eve/memory";
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- export { E as OntologyActionNotPermitted, D as OntologyFileUnavailable, O as OntologyToolRejected, k as actionToolName, A as ontologyToolLabels, j as ontologyTools, M as promotionTarget } from "../../_chunks/principal-dEQyjF1n.mjs";
7
+ export { E as OntologyActionNotPermitted, D as OntologyFileUnavailable, O as OntologyToolRejected, k as actionToolName, A as ontologyToolLabels, j as ontologyTools, M as promotionTarget } from "../../_chunks/principal-C1g8wCIg.mjs";
@@ -7,6 +7,7 @@ __eveCreateRequire(import.meta.url);
7
7
  import { redactDiagnostic } from "../diagnostics.mjs";
8
8
  import { AgentIdentityError, refusal } from "../identities.mjs";
9
9
  import { postDraftRoute } from "./routes.mjs";
10
+ import { ontologyDeploymentHeaders } from "../environment.mjs";
10
11
  const CALL_TIMEOUT_MS = 1e4;
11
12
  function agentReviews(input) {
12
13
  const fetchImpl = input.fetch ?? fetch;
@@ -23,6 +24,7 @@ function agentReviews(input) {
23
24
  method: "POST",
24
25
  headers: {
25
26
  authorization: `Bearer ${token}`,
27
+ ...ontologyDeploymentHeaders(),
26
28
  accept: "application/json",
27
29
  "content-type": "application/json"
28
30
  },
@@ -111,6 +113,7 @@ function agentSessionReviews(input) {
111
113
  method: "POST",
112
114
  headers: {
113
115
  authorization: `Bearer ${token}`,
116
+ ...ontologyDeploymentHeaders(),
114
117
  accept: "application/json",
115
118
  "content-type": "application/json"
116
119
  },
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { reviewFor } from "../../review.mjs";
8
- import { Bt as participantsOf, Ft as chatAddressOf, a as rolesOf, i as memberIdOf } from "../../../_chunks/principal-dEQyjF1n.mjs";
8
+ import { Bt as participantsOf, Ft as chatAddressOf, a as rolesOf, i as memberIdOf } from "../../../_chunks/principal-C1g8wCIg.mjs";
9
9
  function reviewOf(settings, principal) {
10
10
  return reviewFor(settings, rolesOf(principal));
11
11
  }
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { Ft as chatAddressOf, It as chatChannel, i as memberIdOf } from "../../../_chunks/principal-dEQyjF1n.mjs";
7
+ import { Ft as chatAddressOf, It as chatChannel, i as memberIdOf } from "../../../_chunks/principal-C1g8wCIg.mjs";
8
8
  import { a as chatEvent, r as chatArchive } from "../../../_chunks/chat-archive-DavfKJDI.mjs";
9
9
  import { stampedChat } from "../chat-recorder.mjs";
10
10
  import { appOrigin } from "../environment.mjs";
@@ -8,6 +8,7 @@ import { redactDiagnostic } from "../diagnostics.mjs";
8
8
  import { AgentIdentityError, refusal } from "../identities.mjs";
9
9
  import { readChat } from "./judge.mjs";
10
10
  import { postDraftRoute } from "./routes.mjs";
11
+ import { ontologyDeploymentHeaders } from "../environment.mjs";
11
12
  const REVISION_AUTHENTICATOR = "segmentstream-review-revision";
12
13
  const REVISION_ROUTE = "/eve/segmentstream/v1/reviews/revise";
13
14
  const REVISION_SCOPE = "ontology:read";
@@ -178,6 +179,7 @@ function agentRevisions(input) {
178
179
  method: "POST",
179
180
  headers: {
180
181
  authorization: `Bearer ${token}`,
182
+ ...ontologyDeploymentHeaders(),
181
183
  accept: "application/json",
182
184
  "content-type": "application/json"
183
185
  },
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { a as rolesOf } from "../../_chunks/principal-dEQyjF1n.mjs";
7
+ import { a as rolesOf } from "../../_chunks/principal-C1g8wCIg.mjs";
8
8
  import { defineDynamic, defineSkill } from "eve/skills";
9
9
  function forRoles(roles, skill) {
10
10
  if (!Array.isArray(roles) || roles.length === 0 || !roles.every((role) => typeof role === "string" && role.trim() !== "")) throw new TypeError("forRoles() needs at least one role name; a skill for everyone is an ordinary skill file.");
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- export { wt as RUNTIME_SOURCE_PROTOCOL, Tt as compatibleRuntimeEnvelope, Et as principalRuntimeSource, Dt as readableRuntimeEnvelope, Ot as runtimeEnvelope, kt as telegramRuntimeSource } from "../../_chunks/principal-dEQyjF1n.mjs";
7
+ export { wt as RUNTIME_SOURCE_PROTOCOL, Tt as compatibleRuntimeEnvelope, Et as principalRuntimeSource, Dt as readableRuntimeEnvelope, Ot as runtimeEnvelope, kt as telegramRuntimeSource } from "../../_chunks/principal-C1g8wCIg.mjs";
@@ -4,8 +4,9 @@ import { createRequire as __eveCreateRequire } from "node:module";
4
4
  const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
- import { Pt as SESSION_HEADER, R as ACT_AS_HEADER, _ as AttachmentError, jt as CHAT_HEADER, v as EARLIER_CHAT_HEADER } from "../../_chunks/principal-dEQyjF1n.mjs";
7
+ import { Pt as SESSION_HEADER, R as ACT_AS_HEADER, _ as AttachmentError, jt as CHAT_HEADER, v as EARLIER_CHAT_HEADER } from "../../_chunks/principal-C1g8wCIg.mjs";
8
8
  import { fetchFileGrant, transientFileStatus } from "./file-grant.mjs";
9
+ import { ontologyDeploymentHeaders } from "./environment.mjs";
9
10
  var StoredFileError = class extends AttachmentError {
10
11
  filename;
11
12
  requestId;
@@ -62,6 +63,7 @@ async function storedFileGrant(input) {
62
63
  const response = await fetchFileGrant(async () => input.fetch(`${input.origin}/api/ontology/agent/files/${path}`, {
63
64
  headers: {
64
65
  authorization: `Bearer ${await input.token()}`,
66
+ ...ontologyDeploymentHeaders(),
65
67
  [ACT_AS_HEADER]: owner.memberId,
66
68
  [CHAT_HEADER]: owner.chat,
67
69
  [EARLIER_CHAT_HEADER]: owner.chat,