@athenaintel/react 0.30.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/dist/agent-runtime/src/athena-asset-drag.cjs +44 -0
- package/dist/agent-runtime/src/athena-asset-drag.cjs.map +1 -0
- package/dist/agent-runtime/src/athena-asset-drag.js +44 -0
- package/dist/agent-runtime/src/athena-asset-drag.js.map +1 -0
- package/dist/agent-runtime/src/config-mutations.cjs +59 -0
- package/dist/agent-runtime/src/config-mutations.cjs.map +1 -0
- package/dist/agent-runtime/src/config-mutations.js +59 -0
- package/dist/agent-runtime/src/config-mutations.js.map +1 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs +6 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.cjs.map +1 -1
- package/dist/agent-runtime/src/generated/runconfig-contract.js +6 -0
- package/dist/agent-runtime/src/generated/runconfig-contract.js.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs +48 -0
- package/dist/agent-runtime/src/quota-safe-local-storage-session.cjs.map +1 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js +49 -1
- package/dist/agent-runtime/src/quota-safe-local-storage-session.js.map +1 -1
- package/dist/agent-runtime/src/tool-metadata.cjs +25 -6
- package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
- package/dist/agent-runtime/src/tool-metadata.js +25 -6
- package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-config.cjs +117 -1
- package/dist/agent-runtime/src/use-deep-agent-config.cjs.map +1 -1
- package/dist/agent-runtime/src/use-deep-agent-config.js +118 -2
- package/dist/agent-runtime/src/use-deep-agent-config.js.map +1 -1
- package/dist/assets/AthenaAssetEmbed.cjs +6 -1
- package/dist/assets/AthenaAssetEmbed.cjs.map +1 -1
- package/dist/assets/AthenaAssetEmbed.d.ts +2 -0
- package/dist/assets/AthenaAssetEmbed.js +7 -2
- package/dist/assets/AthenaAssetEmbed.js.map +1 -1
- package/dist/assets/asset-embed-messages.cjs +6 -0
- package/dist/assets/asset-embed-messages.cjs.map +1 -1
- package/dist/assets/asset-embed-messages.d.ts +7 -0
- package/dist/assets/asset-embed-messages.js +6 -0
- package/dist/assets/asset-embed-messages.js.map +1 -1
- package/dist/chat/AthenaChat.cjs +41 -26
- package/dist/chat/AthenaChat.cjs.map +1 -1
- package/dist/chat/AthenaChat.js +41 -26
- package/dist/chat/AthenaChat.js.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.cjs +31 -11
- package/dist/chat/super-grouping/SuperGroupingCard.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingCard.d.ts +14 -3
- package/dist/chat/super-grouping/SuperGroupingCard.js +32 -12
- package/dist/chat/super-grouping/SuperGroupingCard.js.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingTranscript.cjs +80 -53
- package/dist/chat/super-grouping/SuperGroupingTranscript.cjs.map +1 -1
- package/dist/chat/super-grouping/SuperGroupingTranscript.d.ts +2 -2
- package/dist/chat/super-grouping/SuperGroupingTranscript.js +81 -54
- package/dist/chat/super-grouping/SuperGroupingTranscript.js.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.cjs +19 -4
- package/dist/chat/super-grouping/activity-timeline.cjs.map +1 -1
- package/dist/chat/super-grouping/activity-timeline.d.ts +20 -1
- package/dist/chat/super-grouping/activity-timeline.js +19 -4
- package/dist/chat/super-grouping/activity-timeline.js.map +1 -1
- package/dist/chat/super-grouping/index.cjs +2 -0
- package/dist/chat/super-grouping/index.cjs.map +1 -1
- package/dist/chat/super-grouping/index.d.ts +1 -1
- package/dist/chat/super-grouping/index.js +3 -1
- package/dist/chat/super-grouping/toolkit-map.cjs +1 -0
- package/dist/chat/super-grouping/toolkit-map.cjs.map +1 -1
- package/dist/chat/super-grouping/toolkit-map.js +1 -0
- package/dist/chat/super-grouping/toolkit-map.js.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.cjs +40 -4
- package/dist/chat-ui/composer/tiptap-composer.cjs.map +1 -1
- package/dist/chat-ui/composer/tiptap-composer.js +40 -4
- package/dist/chat-ui/composer/tiptap-composer.js.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.cjs +29 -2
- package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-chip.d.ts +2 -5
- package/dist/chat-ui/mentions/mention-chip.js +30 -3
- package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.cjs +1 -1
- package/dist/chat-ui/mentions/mention-extension.cjs.map +1 -1
- package/dist/chat-ui/mentions/mention-extension.js +1 -1
- package/dist/chat-ui/mentions/mention-extension.js.map +1 -1
- package/dist/chat-ui/mentions/use-account-workspace-id.cjs +61 -0
- package/dist/chat-ui/mentions/use-account-workspace-id.cjs.map +1 -0
- package/dist/chat-ui/mentions/use-account-workspace-id.d.ts +3 -0
- package/dist/chat-ui/mentions/use-account-workspace-id.js +61 -0
- package/dist/chat-ui/mentions/use-account-workspace-id.js.map +1 -0
- package/dist/chat-ui/mentions/use-member-avatar.cjs +75 -0
- package/dist/chat-ui/mentions/use-member-avatar.cjs.map +1 -0
- package/dist/chat-ui/mentions/use-member-avatar.d.ts +2 -0
- package/dist/chat-ui/mentions/use-member-avatar.js +75 -0
- package/dist/chat-ui/mentions/use-member-avatar.js.map +1 -0
- package/dist/collab/client.cjs +80 -19
- package/dist/collab/client.cjs.map +1 -1
- package/dist/collab/client.d.ts +22 -0
- package/dist/collab/client.js +80 -19
- package/dist/collab/client.js.map +1 -1
- package/dist/diagnostics/athena-diagnostics.cjs.map +1 -1
- package/dist/diagnostics/athena-diagnostics.d.ts +3 -1
- package/dist/diagnostics/athena-diagnostics.js.map +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/provider/AthenaProvider.cjs +34 -4
- package/dist/provider/AthenaProvider.cjs.map +1 -1
- package/dist/provider/AthenaProvider.d.ts +7 -1
- package/dist/provider/AthenaProvider.js +36 -6
- package/dist/provider/AthenaProvider.js.map +1 -1
- package/dist/react/package.json.cjs +1 -1
- package/dist/react/package.json.js +1 -1
- package/dist/runtime/StatewireModelLaneSync.cjs +96 -0
- package/dist/runtime/StatewireModelLaneSync.cjs.map +1 -0
- package/dist/runtime/StatewireModelLaneSync.d.ts +45 -0
- package/dist/runtime/StatewireModelLaneSync.js +96 -0
- package/dist/runtime/StatewireModelLaneSync.js.map +1 -0
- package/dist/runtime/statewire-lifecycle.cjs +5 -2
- package/dist/runtime/statewire-lifecycle.cjs.map +1 -1
- package/dist/runtime/statewire-lifecycle.d.ts +5 -0
- package/dist/runtime/statewire-lifecycle.js +5 -2
- package/dist/runtime/statewire-lifecycle.js.map +1 -1
- package/dist/runtime/statewire-model-lane.cjs +28 -0
- package/dist/runtime/statewire-model-lane.cjs.map +1 -0
- package/dist/runtime/statewire-model-lane.d.ts +64 -0
- package/dist/runtime/statewire-model-lane.js +28 -0
- package/dist/runtime/statewire-model-lane.js.map +1 -0
- package/dist/runtime/statewire-run-config.cjs +16 -2
- package/dist/runtime/statewire-run-config.cjs.map +1 -1
- package/dist/runtime/statewire-run-config.d.ts +10 -0
- package/dist/runtime/statewire-run-config.js +16 -2
- package/dist/runtime/statewire-run-config.js.map +1 -1
- package/dist/runtime/statewire-server-lane-context.cjs +24 -0
- package/dist/runtime/statewire-server-lane-context.cjs.map +1 -0
- package/dist/runtime/statewire-server-lane-context.d.ts +30 -0
- package/dist/runtime/statewire-server-lane-context.js +24 -0
- package/dist/runtime/statewire-server-lane-context.js.map +1 -0
- package/dist/runtime/useAthenaStatewireRuntime.cjs +38 -18
- package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
- package/dist/runtime/useAthenaStatewireRuntime.d.ts +8 -1
- package/dist/runtime/useAthenaStatewireRuntime.js +39 -19
- package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/threads/api.cjs +2 -1
- package/dist/threads/api.cjs.map +1 -1
- package/dist/threads/api.d.ts +1 -0
- package/dist/threads/api.js +2 -1
- package/dist/threads/api.js.map +1 -1
- package/dist/threads/use-athena-thread-model.cjs +14 -0
- package/dist/threads/use-athena-thread-model.cjs.map +1 -0
- package/dist/threads/use-athena-thread-model.d.ts +22 -0
- package/dist/threads/use-athena-thread-model.js +14 -0
- package/dist/threads/use-athena-thread-model.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -145,6 +145,49 @@ const [thread] = useState(() => ({ threadId: mintThreadId(), isNew: true }));
|
|
|
145
145
|
embedded frame's text) into the chat the person last focused.
|
|
146
146
|
- `SessionList`'s `onOpenInNewTab` hands the host a session to open in such a chat.
|
|
147
147
|
|
|
148
|
+
### A model picker, and a session's own model
|
|
149
|
+
|
|
150
|
+
Pass the picked model as `model`. Changing it while a session is open applies
|
|
151
|
+
to that session's next turn:
|
|
152
|
+
|
|
153
|
+
- On a session that has not run yet, the next send carries it, and the server
|
|
154
|
+
keeps it as the session's model.
|
|
155
|
+
- On a session that has run, the server runs every turn with the model the
|
|
156
|
+
session's server config holds (another client, such as Athena itself, can
|
|
157
|
+
change it too), so the SDK writes the new model there
|
|
158
|
+
(`config/patch {model}`). Setting `model` back to `undefined` clears it, so
|
|
159
|
+
the collab agent's own model, or the default, applies again.
|
|
160
|
+
- The model a session is opened with is never written: opening a session never
|
|
161
|
+
overrides the model someone chose for it.
|
|
162
|
+
|
|
163
|
+
Show the session's real model when it opens with `useAthenaThreadModel()`
|
|
164
|
+
(inside `<AthenaProvider>`):
|
|
165
|
+
|
|
166
|
+
```tsx
|
|
167
|
+
import { useAthenaThreadModel, useAthenaStatewireThreadId } from '@athenaintel/react';
|
|
168
|
+
import { useEffect, useRef } from 'react';
|
|
169
|
+
|
|
170
|
+
function SessionModelSeed({ onSessionModel }: { onSessionModel: (model: string | null) => void }) {
|
|
171
|
+
const threadId = useAthenaStatewireThreadId();
|
|
172
|
+
const { model, configured, ready } = useAthenaThreadModel();
|
|
173
|
+
const seededFor = useRef<string | null>(null);
|
|
174
|
+
useEffect(() => {
|
|
175
|
+
// Once per session, after its snapshot lands; a session without server
|
|
176
|
+
// config keeps the picker's current value.
|
|
177
|
+
if (!ready || seededFor.current === threadId) return;
|
|
178
|
+
seededFor.current = threadId;
|
|
179
|
+
if (configured) onSessionModel(model); // null: the agent's / default model ("Auto")
|
|
180
|
+
}, [threadId, model, configured, ready, onSessionModel]);
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
`model` is `null` when the session pins no model; `configured` is `false` for
|
|
186
|
+
a session without server config yet; wait for `ready` before reading either. A
|
|
187
|
+
refused write (a view-only collaborator, or a workspace whose sessions cannot
|
|
188
|
+
hold server config) is reported as a `statewire.config` diagnostics event, and
|
|
189
|
+
the session keeps running with its own model.
|
|
190
|
+
|
|
148
191
|
If `config.appUrl` is omitted, the provider resolves it from the parent bridge or from the matching Athena environment defaults. Known Athena staging and production `apiUrl` and `backendUrl` values automatically fall back to the corresponding frontend origin.
|
|
149
192
|
|
|
150
193
|
Use `trustedParentOrigins` when the SDK runs inside an iframe on a private-cloud or custom parent domain and you want to explicitly allow postMessage auth/config from that parent. Only the window that frames the app is heard. By default `athenaintel.com` hosts, localhost and your own origin are trusted, except the hosts that serve customer-written code (`*.app.athenaintel.com`, `*.code-sandpack.athenaintel.com` and friends; see "What's new in 0.28.0").
|
|
@@ -717,6 +760,24 @@ Both use the same bearer / API key as session creation. The full recipe
|
|
|
717
760
|
template skill `voice-session-guide.md`. `createAthenaVoiceSession` is also
|
|
718
761
|
exported if you hold the bridge state yourself.
|
|
719
762
|
|
|
763
|
+
## What's new in 0.32.0
|
|
764
|
+
|
|
765
|
+
**A model picked after mount reaches the server.** The provider registered its run config once per thread attach, so a `model` (or `channel`, `tools`, `systemPrompt`, …) changed after mount never reached the next send unless something else happened to re-sync the context. The registration is now keyed by the built run config's value: a changed value re-syncs before the next send, while fresh array literals per render still change nothing.
|
|
766
|
+
|
|
767
|
+
**A model changed on a session that has run applies.** Once a session has server config, the server runs every turn with the model that config holds and ignores the one a send carries, so a picker change after the first turn used to be dropped. Changing `model` while such a session is open now writes it there (`config/patch {model}`; `undefined` clears it so the collab agent's own model applies). The model a session is opened with is never written. See [A model picker, and a session's own model](#a-model-picker-and-a-sessions-own-model).
|
|
768
|
+
|
|
769
|
+
**`useAthenaThreadModel()`** returns `{ model, configured, ready }`: the model the open session's server config holds, so an app can show a session's real model when it opens. A refused write is reported as the new `statewire.config` diagnostics event.
|
|
770
|
+
|
|
771
|
+
**A collab agent's session no longer records the SDK default as its model.** With `agent` set and no `model`, the run config's `panel_config` (which the server stores on the session's first run and replays to every client) carried `DEFAULT_STATEWIRE_MODEL`, so Athena showed that model for sessions running the agent's own. It now names no model there.
|
|
772
|
+
|
|
773
|
+
## What's new in 0.31.0
|
|
774
|
+
|
|
775
|
+
**Draft tool cards stay in the conversation.** In the grouped view (`groupToolCalls`), a tool flagged `inline` in the shared display registry (`@athenaintel/agent-runtime` `ToolDisplayMeta.inline`; today the email and calendar-event draft tools) renders its card below the activity header, outside the "Used N tools" and "Show tool details" disclosures, and stays mounted whether the card is collapsed or not, so the person can edit and send the draft without opening anything. The call still appears as a step in the timeline, the run does not pause, and the card is not rendered a second time inside the details. The transcript view `AthenaChat` renders (`SuperGroupingTranscript`) does the same per activity segment: the draft card sits under its segment's step row, and a segment whose only step is a draft offers no empty "Show tool details". `SuperGroupingCard` and `SuperGroupingTranscript` take `isInlineTool` to override the registry per host; `excludePartsFromGroups` is exported for hosts that build their own grouped view.
|
|
776
|
+
|
|
777
|
+
## What's new in 0.30.1
|
|
778
|
+
|
|
779
|
+
**Spoken words no longer retype from an empty bubble while a voice turn speaks over a run.** In the grouped (conversational) view, the answer below the card is the text after the last tool call plus the words of every spoken voice turn. `SuperGroupingFinalText` used to join those parts into one string, so when a spoken turn kept streaming while the run's own reply streamed after it, the joined text changed in the middle rather than at its end. `MarkdownText`'s streaming reveal restarts whenever its text stops extending what it showed, so the whole answer was wiped and retyped on every spoken word. Each answer part now renders through its own `TextComponent` (keyed by its content index) inside a `data-slot="super-grouping-final-text"` column, and only the last part carries the running status and caret. `getFinalTextParts` (with `FinalTextSegment`) is exported beside `getFinalText`, which still returns the joined string. Nothing to change in your app.
|
|
780
|
+
|
|
720
781
|
## What's new in 0.30.0
|
|
721
782
|
|
|
722
783
|
**Session workbench, closer to Devin's.** The "+" menu now sits right after the tabs and has a search box (Enter opens the first match). Inside `AthenaLayout`, a maximize button gives the workspace the chat's width; the chat stays mounted, hidden, and collapsing a maximized workspace brings it back. With every tab closed, the column lists each pane centred with a one-line `description`, which is a new optional field on `SessionWorkbenchPane` that the built-in panes now carry. Tabs use 13px labels, and the close control stays quiet until the tab is hovered, focused or selected. Pure helper: `filterWorkbenchPanes`.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const ATHENA_ASSET_DRAG_MIME = "application/x-athena-asset+json";
|
|
4
|
+
const FLEXLAYOUT_TAB_DRAG_MIME = "application/x-flexlayout-tab";
|
|
5
|
+
const FLEXLAYOUT_DRAG_TEXT_SENTINEL = "--flexlayout--";
|
|
6
|
+
const ATHENA_ASSET_DRAG_TYPES = [
|
|
7
|
+
ATHENA_ASSET_DRAG_MIME,
|
|
8
|
+
FLEXLAYOUT_TAB_DRAG_MIME
|
|
9
|
+
];
|
|
10
|
+
function isAthenaAssetDrag(types) {
|
|
11
|
+
return Array.from(types).some((type) => ATHENA_ASSET_DRAG_TYPES.includes(type));
|
|
12
|
+
}
|
|
13
|
+
function parseAthenaAsset(raw) {
|
|
14
|
+
if (!raw) return null;
|
|
15
|
+
try {
|
|
16
|
+
const value = JSON.parse(raw);
|
|
17
|
+
if (typeof value !== "object" || value === null) return null;
|
|
18
|
+
const { id, title, assetType } = value;
|
|
19
|
+
if (typeof id !== "string" || !id) return null;
|
|
20
|
+
return {
|
|
21
|
+
id,
|
|
22
|
+
title: typeof title === "string" && title ? title : "Untitled",
|
|
23
|
+
assetType: typeof assetType === "string" ? assetType : ""
|
|
24
|
+
};
|
|
25
|
+
} catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function readAthenaAssetDrop(dataTransfer) {
|
|
30
|
+
const asset = parseAthenaAsset(dataTransfer.getData(ATHENA_ASSET_DRAG_MIME));
|
|
31
|
+
if (asset) return { kind: "asset", asset };
|
|
32
|
+
const tabAssetId = dataTransfer.getData(FLEXLAYOUT_TAB_DRAG_MIME);
|
|
33
|
+
if (tabAssetId) return { kind: "unresolved", assetId: tabAssetId };
|
|
34
|
+
if (dataTransfer.getData("text/plain") === FLEXLAYOUT_DRAG_TEXT_SENTINEL) {
|
|
35
|
+
return { kind: "unresolved", assetId: null };
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
exports.ATHENA_ASSET_DRAG_MIME = ATHENA_ASSET_DRAG_MIME;
|
|
40
|
+
exports.FLEXLAYOUT_DRAG_TEXT_SENTINEL = FLEXLAYOUT_DRAG_TEXT_SENTINEL;
|
|
41
|
+
exports.FLEXLAYOUT_TAB_DRAG_MIME = FLEXLAYOUT_TAB_DRAG_MIME;
|
|
42
|
+
exports.isAthenaAssetDrag = isAthenaAssetDrag;
|
|
43
|
+
exports.readAthenaAssetDrop = readAthenaAssetDrop;
|
|
44
|
+
//# sourceMappingURL=athena-asset-drag.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"athena-asset-drag.cjs","sources":["../../../../agent-runtime/src/athena-asset-drag.ts"],"sourcesContent":["import type { UploadedChatAsset } from \"./asset-attachment\";\n\n/**\n * Cross-surface drag payload for an Athena asset. Olympus sets it when a\n * Spaces tab or sidebar row starts a native drag so a composer in another\n * document (the Chrome extension side panel, an embedded SDK chat) can insert\n * an asset mention instead of the drag's incidental text.\n */\nexport const ATHENA_ASSET_DRAG_MIME = \"application/x-athena-asset+json\";\n\n/** Olympus's FlexLayout tab drags carry the tab's asset id under this type. */\nexport const FLEXLAYOUT_TAB_DRAG_MIME = \"application/x-flexlayout-tab\";\n\n/** The `text/plain` value FlexLayout writes on every tab drag. */\nexport const FLEXLAYOUT_DRAG_TEXT_SENTINEL = \"--flexlayout--\";\n\nconst ATHENA_ASSET_DRAG_TYPES: readonly string[] = [\n ATHENA_ASSET_DRAG_MIME,\n FLEXLAYOUT_TAB_DRAG_MIME,\n];\n\n/** The `DataTransfer` surface read here (agent-runtime has no DOM lib). */\ninterface DragData {\n getData(format: string): string;\n}\n\nexport function serializeAthenaAssetDrag(asset: UploadedChatAsset): string {\n return JSON.stringify({\n id: asset.id,\n title: asset.title,\n assetType: asset.assetType,\n });\n}\n\n/** Whether a drag carries an Athena asset — readable during `dragover`. */\nexport function isAthenaAssetDrag(types: Iterable<string>): boolean {\n return Array.from(types).some((type) => ATHENA_ASSET_DRAG_TYPES.includes(type));\n}\n\nfunction parseAthenaAsset(raw: string): UploadedChatAsset | null {\n if (!raw) return null;\n try {\n const value: unknown = JSON.parse(raw);\n if (typeof value !== \"object\" || value === null) return null;\n const { id, title, assetType } = value as Record<string, unknown>;\n if (typeof id !== \"string\" || !id) return null;\n return {\n id,\n title: typeof title === \"string\" && title ? title : \"Untitled\",\n assetType: typeof assetType === \"string\" ? assetType : \"\",\n };\n } catch {\n return null;\n }\n}\n\nexport type AthenaAssetDrop =\n | { kind: \"asset\"; asset: UploadedChatAsset }\n /** An Athena asset drag whose metadata did not travel — swallow it rather\n * than let the editor paste the sentinel text. */\n | { kind: \"unresolved\"; assetId: string | null }\n | null;\n\n/** Reads an Athena asset from a drop, or `null` when the drop is not one. */\nexport function readAthenaAssetDrop(dataTransfer: DragData): AthenaAssetDrop {\n const asset = parseAthenaAsset(dataTransfer.getData(ATHENA_ASSET_DRAG_MIME));\n if (asset) return { kind: \"asset\", asset };\n const tabAssetId = dataTransfer.getData(FLEXLAYOUT_TAB_DRAG_MIME);\n if (tabAssetId) return { kind: \"unresolved\", assetId: tabAssetId };\n if (dataTransfer.getData(\"text/plain\") === FLEXLAYOUT_DRAG_TEXT_SENTINEL) {\n return { kind: \"unresolved\", assetId: null };\n }\n return null;\n}\n"],"names":[],"mappings":";;AAQO,MAAM,yBAAyB;AAG/B,MAAM,2BAA2B;AAGjC,MAAM,gCAAgC;AAE7C,MAAM,0BAA6C;AAAA,EACjD;AAAA,EACA;AACF;AAgBO,SAAS,kBAAkB,OAAkC;AAClE,SAAO,MAAM,KAAK,KAAK,EAAE,KAAK,CAAC,SAAS,wBAAwB,SAAS,IAAI,CAAC;AAChF;AAEA,SAAS,iBAAiB,KAAuC;AAC/D,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI;AACF,UAAM,QAAiB,KAAK,MAAM,GAAG;AACrC,QAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,UAAM,EAAE,IAAI,OAAO,UAAA,IAAc;AACjC,QAAI,OAAO,OAAO,YAAY,CAAC,GAAI,QAAO;AAC1C,WAAO;AAAA,MACL;AAAA,MACA,OAAO,OAAO,UAAU,YAAY,QAAQ,QAAQ;AAAA,MACpD,WAAW,OAAO,cAAc,WAAW,YAAY;AAAA,IAAA;AAAA,EAE3D,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAUO,SAAS,oBAAoB,cAAyC;AAC3E,QAAM,QAAQ,iBAAiB,aAAa,QAAQ,sBAAsB,CAAC;AAC3E,MAAI,MAAO,QAAO,EAAE,MAAM,SAAS,MAAA;AACnC,QAAM,aAAa,aAAa,QAAQ,wBAAwB;AAChE,MAAI,WAAY,QAAO,EAAE,MAAM,cAAc,SAAS,WAAA;AACtD,MAAI,aAAa,QAAQ,YAAY,MAAM,+BAA+B;AACxE,WAAO,EAAE,MAAM,cAAc,SAAS,KAAA;AAAA,EACxC;AACA,SAAO;AACT;;;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const ATHENA_ASSET_DRAG_MIME = "application/x-athena-asset+json";
|
|
2
|
+
const FLEXLAYOUT_TAB_DRAG_MIME = "application/x-flexlayout-tab";
|
|
3
|
+
const FLEXLAYOUT_DRAG_TEXT_SENTINEL = "--flexlayout--";
|
|
4
|
+
const ATHENA_ASSET_DRAG_TYPES = [
|
|
5
|
+
ATHENA_ASSET_DRAG_MIME,
|
|
6
|
+
FLEXLAYOUT_TAB_DRAG_MIME
|
|
7
|
+
];
|
|
8
|
+
function isAthenaAssetDrag(types) {
|
|
9
|
+
return Array.from(types).some((type) => ATHENA_ASSET_DRAG_TYPES.includes(type));
|
|
10
|
+
}
|
|
11
|
+
function parseAthenaAsset(raw) {
|
|
12
|
+
if (!raw) return null;
|
|
13
|
+
try {
|
|
14
|
+
const value = JSON.parse(raw);
|
|
15
|
+
if (typeof value !== "object" || value === null) return null;
|
|
16
|
+
const { id, title, assetType } = value;
|
|
17
|
+
if (typeof id !== "string" || !id) return null;
|
|
18
|
+
return {
|
|
19
|
+
id,
|
|
20
|
+
title: typeof title === "string" && title ? title : "Untitled",
|
|
21
|
+
assetType: typeof assetType === "string" ? assetType : ""
|
|
22
|
+
};
|
|
23
|
+
} catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function readAthenaAssetDrop(dataTransfer) {
|
|
28
|
+
const asset = parseAthenaAsset(dataTransfer.getData(ATHENA_ASSET_DRAG_MIME));
|
|
29
|
+
if (asset) return { kind: "asset", asset };
|
|
30
|
+
const tabAssetId = dataTransfer.getData(FLEXLAYOUT_TAB_DRAG_MIME);
|
|
31
|
+
if (tabAssetId) return { kind: "unresolved", assetId: tabAssetId };
|
|
32
|
+
if (dataTransfer.getData("text/plain") === FLEXLAYOUT_DRAG_TEXT_SENTINEL) {
|
|
33
|
+
return { kind: "unresolved", assetId: null };
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
ATHENA_ASSET_DRAG_MIME,
|
|
39
|
+
FLEXLAYOUT_DRAG_TEXT_SENTINEL,
|
|
40
|
+
FLEXLAYOUT_TAB_DRAG_MIME,
|
|
41
|
+
isAthenaAssetDrag,
|
|
42
|
+
readAthenaAssetDrop
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=athena-asset-drag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"athena-asset-drag.js","sources":["../../../../agent-runtime/src/athena-asset-drag.ts"],"sourcesContent":["import type { UploadedChatAsset } from \"./asset-attachment\";\n\n/**\n * Cross-surface drag payload for an Athena asset. Olympus sets it when a\n * Spaces tab or sidebar row starts a native drag so a composer in another\n * document (the Chrome extension side panel, an embedded SDK chat) can insert\n * an asset mention instead of the drag's incidental text.\n */\nexport const ATHENA_ASSET_DRAG_MIME = \"application/x-athena-asset+json\";\n\n/** Olympus's FlexLayout tab drags carry the tab's asset id under this type. */\nexport const FLEXLAYOUT_TAB_DRAG_MIME = \"application/x-flexlayout-tab\";\n\n/** The `text/plain` value FlexLayout writes on every tab drag. */\nexport const FLEXLAYOUT_DRAG_TEXT_SENTINEL = \"--flexlayout--\";\n\nconst ATHENA_ASSET_DRAG_TYPES: readonly string[] = [\n ATHENA_ASSET_DRAG_MIME,\n FLEXLAYOUT_TAB_DRAG_MIME,\n];\n\n/** The `DataTransfer` surface read here (agent-runtime has no DOM lib). */\ninterface DragData {\n getData(format: string): string;\n}\n\nexport function serializeAthenaAssetDrag(asset: UploadedChatAsset): string {\n return JSON.stringify({\n id: asset.id,\n title: asset.title,\n assetType: asset.assetType,\n });\n}\n\n/** Whether a drag carries an Athena asset — readable during `dragover`. */\nexport function isAthenaAssetDrag(types: Iterable<string>): boolean {\n return Array.from(types).some((type) => ATHENA_ASSET_DRAG_TYPES.includes(type));\n}\n\nfunction parseAthenaAsset(raw: string): UploadedChatAsset | null {\n if (!raw) return null;\n try {\n const value: unknown = JSON.parse(raw);\n if (typeof value !== \"object\" || value === null) return null;\n const { id, title, assetType } = value as Record<string, unknown>;\n if (typeof id !== \"string\" || !id) return null;\n return {\n id,\n title: typeof title === \"string\" && title ? title : \"Untitled\",\n assetType: typeof assetType === \"string\" ? assetType : \"\",\n };\n } catch {\n return null;\n }\n}\n\nexport type AthenaAssetDrop =\n | { kind: \"asset\"; asset: UploadedChatAsset }\n /** An Athena asset drag whose metadata did not travel — swallow it rather\n * than let the editor paste the sentinel text. */\n | { kind: \"unresolved\"; assetId: string | null }\n | null;\n\n/** Reads an Athena asset from a drop, or `null` when the drop is not one. */\nexport function readAthenaAssetDrop(dataTransfer: DragData): AthenaAssetDrop {\n const asset = parseAthenaAsset(dataTransfer.getData(ATHENA_ASSET_DRAG_MIME));\n if (asset) return { kind: \"asset\", asset };\n const tabAssetId = dataTransfer.getData(FLEXLAYOUT_TAB_DRAG_MIME);\n if (tabAssetId) return { kind: \"unresolved\", assetId: tabAssetId };\n if (dataTransfer.getData(\"text/plain\") === FLEXLAYOUT_DRAG_TEXT_SENTINEL) {\n return { kind: \"unresolved\", assetId: null };\n }\n return null;\n}\n"],"names":[],"mappings":"AAQO,MAAM,yBAAyB;AAG/B,MAAM,2BAA2B;AAGjC,MAAM,gCAAgC;AAE7C,MAAM,0BAA6C;AAAA,EACjD;AAAA,EACA;AACF;AAgBO,SAAS,kBAAkB,OAAkC;AAClE,SAAO,MAAM,KAAK,KAAK,EAAE,KAAK,CAAC,SAAS,wBAAwB,SAAS,IAAI,CAAC;AAChF;AAEA,SAAS,iBAAiB,KAAuC;AAC/D,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI;AACF,UAAM,QAAiB,KAAK,MAAM,GAAG;AACrC,QAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,UAAM,EAAE,IAAI,OAAO,UAAA,IAAc;AACjC,QAAI,OAAO,OAAO,YAAY,CAAC,GAAI,QAAO;AAC1C,WAAO;AAAA,MACL;AAAA,MACA,OAAO,OAAO,UAAU,YAAY,QAAQ,QAAQ;AAAA,MACpD,WAAW,OAAO,cAAc,WAAW,YAAY;AAAA,IAAA;AAAA,EAE3D,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAUO,SAAS,oBAAoB,cAAyC;AAC3E,QAAM,QAAQ,iBAAiB,aAAa,QAAQ,sBAAsB,CAAC;AAC3E,MAAI,MAAO,QAAO,EAAE,MAAM,SAAS,MAAA;AACnC,QAAM,aAAa,aAAa,QAAQ,wBAAwB;AAChE,MAAI,WAAY,QAAO,EAAE,MAAM,cAAc,SAAS,WAAA;AACtD,MAAI,aAAa,QAAQ,YAAY,MAAM,+BAA+B;AACxE,WAAO,EAAE,MAAM,cAAc,SAAS,KAAA;AAAA,EACxC;AACA,SAAO;AACT;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const ENABLED_TOOLS = "enabled_tools";
|
|
4
|
+
const EXCLUDED_TOOLS = "excluded_tools";
|
|
5
|
+
const DECLINED_TOOLKITS = "declined_toolkit_ids";
|
|
6
|
+
const PANEL_CONFIG = "panel_config";
|
|
7
|
+
const stringList = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
8
|
+
const uniqueIds = (ids) => {
|
|
9
|
+
const seen = /* @__PURE__ */ new Set();
|
|
10
|
+
const out = [];
|
|
11
|
+
for (const id of ids) {
|
|
12
|
+
if (!id || seen.has(id)) continue;
|
|
13
|
+
seen.add(id);
|
|
14
|
+
out.push(id);
|
|
15
|
+
}
|
|
16
|
+
return out;
|
|
17
|
+
};
|
|
18
|
+
function applyConfigPatch(custom, patch) {
|
|
19
|
+
const next = { ...custom };
|
|
20
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
21
|
+
if (key === PANEL_CONFIG) continue;
|
|
22
|
+
if (value === null || value === void 0) delete next[key];
|
|
23
|
+
else next[key] = value;
|
|
24
|
+
}
|
|
25
|
+
return next;
|
|
26
|
+
}
|
|
27
|
+
function applyToolsEnable(custom, toolIds) {
|
|
28
|
+
const ids = uniqueIds(toolIds);
|
|
29
|
+
if (ids.length === 0) return { ...custom };
|
|
30
|
+
const next = { ...custom };
|
|
31
|
+
const adding = new Set(ids);
|
|
32
|
+
next[ENABLED_TOOLS] = uniqueIds([...stringList(custom[ENABLED_TOOLS]), ...ids]);
|
|
33
|
+
for (const key of [EXCLUDED_TOOLS, DECLINED_TOOLKITS]) {
|
|
34
|
+
if (!(key in custom)) continue;
|
|
35
|
+
const kept = stringList(custom[key]).filter((id) => !adding.has(id));
|
|
36
|
+
if (kept.length > 0) next[key] = kept;
|
|
37
|
+
else delete next[key];
|
|
38
|
+
}
|
|
39
|
+
return next;
|
|
40
|
+
}
|
|
41
|
+
function applyToolsDisable(custom, toolIds) {
|
|
42
|
+
const ids = uniqueIds(toolIds);
|
|
43
|
+
if (ids.length === 0) return { ...custom };
|
|
44
|
+
const next = { ...custom };
|
|
45
|
+
const removing = new Set(ids);
|
|
46
|
+
const explicit = Array.isArray(custom[ENABLED_TOOLS]);
|
|
47
|
+
const enabled = stringList(custom[ENABLED_TOOLS]);
|
|
48
|
+
const present = new Set(enabled);
|
|
49
|
+
if (explicit) next[ENABLED_TOOLS] = enabled.filter((id) => !removing.has(id));
|
|
50
|
+
const declined = ids.filter((id) => !present.has(id));
|
|
51
|
+
if (declined.length > 0) {
|
|
52
|
+
next[DECLINED_TOOLKITS] = uniqueIds([...stringList(custom[DECLINED_TOOLKITS]), ...declined]);
|
|
53
|
+
}
|
|
54
|
+
return next;
|
|
55
|
+
}
|
|
56
|
+
exports.applyConfigPatch = applyConfigPatch;
|
|
57
|
+
exports.applyToolsDisable = applyToolsDisable;
|
|
58
|
+
exports.applyToolsEnable = applyToolsEnable;
|
|
59
|
+
//# sourceMappingURL=config-mutations.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-mutations.cjs","sources":["../../../../agent-runtime/src/config-mutations.ts"],"sourcesContent":["import {\n RUN_CONFIG_PER_SEND_CUSTOM_KEY_SET,\n THREAD_CONFIG_CUSTOM_KEY_SET,\n} from './generated/runconfig-contract';\n\n/**\n * Pure transforms behind the `config/*` command family — the client-side\n * mirror of `agora/agora/graphs/athena_deep_agent/thread_config.py`\n * (`apply_config_patch` / `apply_tools_enable` / `apply_tools_disable`).\n *\n * The hook folds these over `state.config.custom` while a command is in\n * flight so the UI reflects the write immediately; the server applies the same\n * transform under the config row's lock, so the optimistic and the durable\n * result agree whenever no other device wrote in between — and compose\n * (rather than conflict) when one did.\n */\n\nexport type ThreadConfigCustom = Record<string, unknown>;\n\n/** A `config/patch` payload: `null` unsets the key. */\nexport type ThreadConfigPatch = Record<string, unknown | null>;\n\nconst ENABLED_TOOLS = 'enabled_tools';\nconst EXCLUDED_TOOLS = 'excluded_tools';\nconst DECLINED_TOOLKITS = 'declined_toolkit_ids';\nconst PANEL_CONFIG = 'panel_config';\n\nconst stringList = (value: unknown): string[] =>\n Array.isArray(value) ? value.filter((item): item is string => typeof item === 'string') : [];\n\nconst uniqueIds = (ids: Iterable<string>): string[] => {\n const seen = new Set<string>();\n const out: string[] = [];\n for (const id of ids) {\n if (!id || seen.has(id)) continue;\n seen.add(id);\n out.push(id);\n }\n return out;\n};\n\n/** Set / unset top-level keys. `panel_config` is never part of the server config. */\nexport function applyConfigPatch(\n custom: ThreadConfigCustom,\n patch: ThreadConfigPatch\n): ThreadConfigCustom {\n const next: ThreadConfigCustom = { ...custom };\n for (const [key, value] of Object.entries(patch)) {\n if (key === PANEL_CONFIG) continue;\n if (value === null || value === undefined) delete next[key];\n else next[key] = value;\n }\n return next;\n}\n\n/**\n * Append ids to `enabled_tools` (deduplicated, order preserved) and lift\n * them out of `excluded_tools` / `declined_toolkit_ids`.\n */\nexport function applyToolsEnable(\n custom: ThreadConfigCustom,\n toolIds: readonly string[]\n): ThreadConfigCustom {\n const ids = uniqueIds(toolIds);\n if (ids.length === 0) return { ...custom };\n const next: ThreadConfigCustom = { ...custom };\n const adding = new Set(ids);\n next[ENABLED_TOOLS] = uniqueIds([...stringList(custom[ENABLED_TOOLS]), ...ids]);\n for (const key of [EXCLUDED_TOOLS, DECLINED_TOOLKITS]) {\n if (!(key in custom)) continue;\n const kept = stringList(custom[key]).filter((id) => !adding.has(id));\n if (kept.length > 0) next[key] = kept;\n else delete next[key];\n }\n return next;\n}\n\n/**\n * Remove ids from an explicit `enabled_tools` list; an id that is not in the\n * list (or a thread without one — running its collab agent's compiled\n * toolkits) is recorded in `declined_toolkit_ids` so the opt-out sticks.\n */\nexport function applyToolsDisable(\n custom: ThreadConfigCustom,\n toolIds: readonly string[]\n): ThreadConfigCustom {\n const ids = uniqueIds(toolIds);\n if (ids.length === 0) return { ...custom };\n const next: ThreadConfigCustom = { ...custom };\n const removing = new Set(ids);\n const explicit = Array.isArray(custom[ENABLED_TOOLS]);\n const enabled = stringList(custom[ENABLED_TOOLS]);\n const present = new Set(enabled);\n if (explicit) next[ENABLED_TOOLS] = enabled.filter((id) => !removing.has(id));\n const declined = ids.filter((id) => !present.has(id));\n if (declined.length > 0) {\n next[DECLINED_TOOLKITS] = uniqueIds([...stringList(custom[DECLINED_TOOLKITS]), ...declined]);\n }\n return next;\n}\n\n/** A thread's currently enabled tool ids — `null` when the thread has no explicit list (defers to its agent). */\nexport function readEnabledTools(custom: ThreadConfigCustom | null | undefined): string[] | null {\n const value = custom?.[ENABLED_TOOLS];\n return Array.isArray(value) ? stringList(value) : null;\n}\n\n/** The `declined_toolkit_ids` advisory list (empty when absent). */\nexport function readDeclinedToolkitIds(custom: ThreadConfigCustom | null | undefined): string[] {\n return stringList(custom?.[DECLINED_TOOLKITS]);\n}\n\n/**\n * The subset of a `runConfig.custom` payload a client is allowed to carry per\n * send on a server-configured thread (`RUN_CONFIG_PER_SEND_CUSTOM_KEYS`).\n * Every other key is owned by the server config lane and would be dropped at\n * dispatch, so sending it only invites drift between what a client thinks it\n * asked for and what ran.\n */\nexport function pickPerSendCustom(custom: ThreadConfigCustom): ThreadConfigCustom {\n const out: ThreadConfigCustom = {};\n for (const [key, value] of Object.entries(custom)) {\n if (value === undefined) continue;\n if (RUN_CONFIG_PER_SEND_CUSTOM_KEY_SET.has(key)) out[key] = value;\n }\n return out;\n}\n\n/**\n * The subset of a `runConfig.custom` payload the thread's server config lane\n * owns (`THREAD_CONFIG_CUSTOM_KEYS`) — what a client seeds a fresh thread with\n * through `config/patch` before its first send.\n */\nexport function pickThreadConfigCustom(custom: ThreadConfigCustom): ThreadConfigCustom {\n const out: ThreadConfigCustom = {};\n for (const [key, value] of Object.entries(custom)) {\n if (value === undefined) continue;\n if (THREAD_CONFIG_CUSTOM_KEY_SET.has(key)) out[key] = value;\n }\n return out;\n}\n\n/**\n * The `config/patch` that turns `current` into `desired` over the thread-config\n * keys: changed keys carry their new value, keys absent from `desired` carry\n * `null` (unset). `null` when nothing differs.\n */\nexport function diffThreadConfig(\n current: ThreadConfigCustom,\n desired: ThreadConfigCustom\n): ThreadConfigPatch | null {\n const patch: ThreadConfigPatch = {};\n const next = pickThreadConfigCustom(desired);\n const prev = pickThreadConfigCustom(current);\n for (const [key, value] of Object.entries(next)) {\n if (!(key in prev) || !deepEqual(prev[key], value)) patch[key] = value;\n }\n for (const key of Object.keys(prev)) {\n if (!(key in next)) patch[key] = null;\n }\n return Object.keys(patch).length > 0 ? patch : null;\n}\n\nfunction deepEqual(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) return true;\n if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) return false;\n if (Array.isArray(a) !== Array.isArray(b)) return false;\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((item, index) => deepEqual(item, b[index]));\n }\n const ra = a as Record<string, unknown>;\n const rb = b as Record<string, unknown>;\n const ka = Object.keys(ra);\n const kb = Object.keys(rb);\n return ka.length === kb.length && ka.every((key) => key in rb && deepEqual(ra[key], rb[key]));\n}\n"],"names":[],"mappings":";;AAsBA,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;AACvB,MAAM,oBAAoB;AAC1B,MAAM,eAAe;AAErB,MAAM,aAAa,CAAC,UAClB,MAAM,QAAQ,KAAK,IAAI,MAAM,OAAO,CAAC,SAAyB,OAAO,SAAS,QAAQ,IAAI,CAAA;AAE5F,MAAM,YAAY,CAAC,QAAoC;AACrD,QAAM,2BAAW,IAAA;AACjB,QAAM,MAAgB,CAAA;AACtB,aAAW,MAAM,KAAK;AACpB,QAAI,CAAC,MAAM,KAAK,IAAI,EAAE,EAAG;AACzB,SAAK,IAAI,EAAE;AACX,QAAI,KAAK,EAAE;AAAA,EACb;AACA,SAAO;AACT;AAGO,SAAS,iBACd,QACA,OACoB;AACpB,QAAM,OAA2B,EAAE,GAAG,OAAA;AACtC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,QAAI,QAAQ,aAAc;AAC1B,QAAI,UAAU,QAAQ,UAAU,OAAW,QAAO,KAAK,GAAG;AAAA,QACrD,MAAK,GAAG,IAAI;AAAA,EACnB;AACA,SAAO;AACT;AAMO,SAAS,iBACd,QACA,SACoB;AACpB,QAAM,MAAM,UAAU,OAAO;AAC7B,MAAI,IAAI,WAAW,EAAG,QAAO,EAAE,GAAG,OAAA;AAClC,QAAM,OAA2B,EAAE,GAAG,OAAA;AACtC,QAAM,SAAS,IAAI,IAAI,GAAG;AAC1B,OAAK,aAAa,IAAI,UAAU,CAAC,GAAG,WAAW,OAAO,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;AAC9E,aAAW,OAAO,CAAC,gBAAgB,iBAAiB,GAAG;AACrD,QAAI,EAAE,OAAO,QAAS;AACtB,UAAM,OAAO,WAAW,OAAO,GAAG,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;AACnE,QAAI,KAAK,SAAS,EAAG,MAAK,GAAG,IAAI;AAAA,QAC5B,QAAO,KAAK,GAAG;AAAA,EACtB;AACA,SAAO;AACT;AAOO,SAAS,kBACd,QACA,SACoB;AACpB,QAAM,MAAM,UAAU,OAAO;AAC7B,MAAI,IAAI,WAAW,EAAG,QAAO,EAAE,GAAG,OAAA;AAClC,QAAM,OAA2B,EAAE,GAAG,OAAA;AACtC,QAAM,WAAW,IAAI,IAAI,GAAG;AAC5B,QAAM,WAAW,MAAM,QAAQ,OAAO,aAAa,CAAC;AACpD,QAAM,UAAU,WAAW,OAAO,aAAa,CAAC;AAChD,QAAM,UAAU,IAAI,IAAI,OAAO;AAC/B,MAAI,SAAU,MAAK,aAAa,IAAI,QAAQ,OAAO,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;AAC5E,QAAM,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;AACpD,MAAI,SAAS,SAAS,GAAG;AACvB,SAAK,iBAAiB,IAAI,UAAU,CAAC,GAAG,WAAW,OAAO,iBAAiB,CAAC,GAAG,GAAG,QAAQ,CAAC;AAAA,EAC7F;AACA,SAAO;AACT;;;;"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const ENABLED_TOOLS = "enabled_tools";
|
|
2
|
+
const EXCLUDED_TOOLS = "excluded_tools";
|
|
3
|
+
const DECLINED_TOOLKITS = "declined_toolkit_ids";
|
|
4
|
+
const PANEL_CONFIG = "panel_config";
|
|
5
|
+
const stringList = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
6
|
+
const uniqueIds = (ids) => {
|
|
7
|
+
const seen = /* @__PURE__ */ new Set();
|
|
8
|
+
const out = [];
|
|
9
|
+
for (const id of ids) {
|
|
10
|
+
if (!id || seen.has(id)) continue;
|
|
11
|
+
seen.add(id);
|
|
12
|
+
out.push(id);
|
|
13
|
+
}
|
|
14
|
+
return out;
|
|
15
|
+
};
|
|
16
|
+
function applyConfigPatch(custom, patch) {
|
|
17
|
+
const next = { ...custom };
|
|
18
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
19
|
+
if (key === PANEL_CONFIG) continue;
|
|
20
|
+
if (value === null || value === void 0) delete next[key];
|
|
21
|
+
else next[key] = value;
|
|
22
|
+
}
|
|
23
|
+
return next;
|
|
24
|
+
}
|
|
25
|
+
function applyToolsEnable(custom, toolIds) {
|
|
26
|
+
const ids = uniqueIds(toolIds);
|
|
27
|
+
if (ids.length === 0) return { ...custom };
|
|
28
|
+
const next = { ...custom };
|
|
29
|
+
const adding = new Set(ids);
|
|
30
|
+
next[ENABLED_TOOLS] = uniqueIds([...stringList(custom[ENABLED_TOOLS]), ...ids]);
|
|
31
|
+
for (const key of [EXCLUDED_TOOLS, DECLINED_TOOLKITS]) {
|
|
32
|
+
if (!(key in custom)) continue;
|
|
33
|
+
const kept = stringList(custom[key]).filter((id) => !adding.has(id));
|
|
34
|
+
if (kept.length > 0) next[key] = kept;
|
|
35
|
+
else delete next[key];
|
|
36
|
+
}
|
|
37
|
+
return next;
|
|
38
|
+
}
|
|
39
|
+
function applyToolsDisable(custom, toolIds) {
|
|
40
|
+
const ids = uniqueIds(toolIds);
|
|
41
|
+
if (ids.length === 0) return { ...custom };
|
|
42
|
+
const next = { ...custom };
|
|
43
|
+
const removing = new Set(ids);
|
|
44
|
+
const explicit = Array.isArray(custom[ENABLED_TOOLS]);
|
|
45
|
+
const enabled = stringList(custom[ENABLED_TOOLS]);
|
|
46
|
+
const present = new Set(enabled);
|
|
47
|
+
if (explicit) next[ENABLED_TOOLS] = enabled.filter((id) => !removing.has(id));
|
|
48
|
+
const declined = ids.filter((id) => !present.has(id));
|
|
49
|
+
if (declined.length > 0) {
|
|
50
|
+
next[DECLINED_TOOLKITS] = uniqueIds([...stringList(custom[DECLINED_TOOLKITS]), ...declined]);
|
|
51
|
+
}
|
|
52
|
+
return next;
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
applyConfigPatch,
|
|
56
|
+
applyToolsDisable,
|
|
57
|
+
applyToolsEnable
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=config-mutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-mutations.js","sources":["../../../../agent-runtime/src/config-mutations.ts"],"sourcesContent":["import {\n RUN_CONFIG_PER_SEND_CUSTOM_KEY_SET,\n THREAD_CONFIG_CUSTOM_KEY_SET,\n} from './generated/runconfig-contract';\n\n/**\n * Pure transforms behind the `config/*` command family — the client-side\n * mirror of `agora/agora/graphs/athena_deep_agent/thread_config.py`\n * (`apply_config_patch` / `apply_tools_enable` / `apply_tools_disable`).\n *\n * The hook folds these over `state.config.custom` while a command is in\n * flight so the UI reflects the write immediately; the server applies the same\n * transform under the config row's lock, so the optimistic and the durable\n * result agree whenever no other device wrote in between — and compose\n * (rather than conflict) when one did.\n */\n\nexport type ThreadConfigCustom = Record<string, unknown>;\n\n/** A `config/patch` payload: `null` unsets the key. */\nexport type ThreadConfigPatch = Record<string, unknown | null>;\n\nconst ENABLED_TOOLS = 'enabled_tools';\nconst EXCLUDED_TOOLS = 'excluded_tools';\nconst DECLINED_TOOLKITS = 'declined_toolkit_ids';\nconst PANEL_CONFIG = 'panel_config';\n\nconst stringList = (value: unknown): string[] =>\n Array.isArray(value) ? value.filter((item): item is string => typeof item === 'string') : [];\n\nconst uniqueIds = (ids: Iterable<string>): string[] => {\n const seen = new Set<string>();\n const out: string[] = [];\n for (const id of ids) {\n if (!id || seen.has(id)) continue;\n seen.add(id);\n out.push(id);\n }\n return out;\n};\n\n/** Set / unset top-level keys. `panel_config` is never part of the server config. */\nexport function applyConfigPatch(\n custom: ThreadConfigCustom,\n patch: ThreadConfigPatch\n): ThreadConfigCustom {\n const next: ThreadConfigCustom = { ...custom };\n for (const [key, value] of Object.entries(patch)) {\n if (key === PANEL_CONFIG) continue;\n if (value === null || value === undefined) delete next[key];\n else next[key] = value;\n }\n return next;\n}\n\n/**\n * Append ids to `enabled_tools` (deduplicated, order preserved) and lift\n * them out of `excluded_tools` / `declined_toolkit_ids`.\n */\nexport function applyToolsEnable(\n custom: ThreadConfigCustom,\n toolIds: readonly string[]\n): ThreadConfigCustom {\n const ids = uniqueIds(toolIds);\n if (ids.length === 0) return { ...custom };\n const next: ThreadConfigCustom = { ...custom };\n const adding = new Set(ids);\n next[ENABLED_TOOLS] = uniqueIds([...stringList(custom[ENABLED_TOOLS]), ...ids]);\n for (const key of [EXCLUDED_TOOLS, DECLINED_TOOLKITS]) {\n if (!(key in custom)) continue;\n const kept = stringList(custom[key]).filter((id) => !adding.has(id));\n if (kept.length > 0) next[key] = kept;\n else delete next[key];\n }\n return next;\n}\n\n/**\n * Remove ids from an explicit `enabled_tools` list; an id that is not in the\n * list (or a thread without one — running its collab agent's compiled\n * toolkits) is recorded in `declined_toolkit_ids` so the opt-out sticks.\n */\nexport function applyToolsDisable(\n custom: ThreadConfigCustom,\n toolIds: readonly string[]\n): ThreadConfigCustom {\n const ids = uniqueIds(toolIds);\n if (ids.length === 0) return { ...custom };\n const next: ThreadConfigCustom = { ...custom };\n const removing = new Set(ids);\n const explicit = Array.isArray(custom[ENABLED_TOOLS]);\n const enabled = stringList(custom[ENABLED_TOOLS]);\n const present = new Set(enabled);\n if (explicit) next[ENABLED_TOOLS] = enabled.filter((id) => !removing.has(id));\n const declined = ids.filter((id) => !present.has(id));\n if (declined.length > 0) {\n next[DECLINED_TOOLKITS] = uniqueIds([...stringList(custom[DECLINED_TOOLKITS]), ...declined]);\n }\n return next;\n}\n\n/** A thread's currently enabled tool ids — `null` when the thread has no explicit list (defers to its agent). */\nexport function readEnabledTools(custom: ThreadConfigCustom | null | undefined): string[] | null {\n const value = custom?.[ENABLED_TOOLS];\n return Array.isArray(value) ? stringList(value) : null;\n}\n\n/** The `declined_toolkit_ids` advisory list (empty when absent). */\nexport function readDeclinedToolkitIds(custom: ThreadConfigCustom | null | undefined): string[] {\n return stringList(custom?.[DECLINED_TOOLKITS]);\n}\n\n/**\n * The subset of a `runConfig.custom` payload a client is allowed to carry per\n * send on a server-configured thread (`RUN_CONFIG_PER_SEND_CUSTOM_KEYS`).\n * Every other key is owned by the server config lane and would be dropped at\n * dispatch, so sending it only invites drift between what a client thinks it\n * asked for and what ran.\n */\nexport function pickPerSendCustom(custom: ThreadConfigCustom): ThreadConfigCustom {\n const out: ThreadConfigCustom = {};\n for (const [key, value] of Object.entries(custom)) {\n if (value === undefined) continue;\n if (RUN_CONFIG_PER_SEND_CUSTOM_KEY_SET.has(key)) out[key] = value;\n }\n return out;\n}\n\n/**\n * The subset of a `runConfig.custom` payload the thread's server config lane\n * owns (`THREAD_CONFIG_CUSTOM_KEYS`) — what a client seeds a fresh thread with\n * through `config/patch` before its first send.\n */\nexport function pickThreadConfigCustom(custom: ThreadConfigCustom): ThreadConfigCustom {\n const out: ThreadConfigCustom = {};\n for (const [key, value] of Object.entries(custom)) {\n if (value === undefined) continue;\n if (THREAD_CONFIG_CUSTOM_KEY_SET.has(key)) out[key] = value;\n }\n return out;\n}\n\n/**\n * The `config/patch` that turns `current` into `desired` over the thread-config\n * keys: changed keys carry their new value, keys absent from `desired` carry\n * `null` (unset). `null` when nothing differs.\n */\nexport function diffThreadConfig(\n current: ThreadConfigCustom,\n desired: ThreadConfigCustom\n): ThreadConfigPatch | null {\n const patch: ThreadConfigPatch = {};\n const next = pickThreadConfigCustom(desired);\n const prev = pickThreadConfigCustom(current);\n for (const [key, value] of Object.entries(next)) {\n if (!(key in prev) || !deepEqual(prev[key], value)) patch[key] = value;\n }\n for (const key of Object.keys(prev)) {\n if (!(key in next)) patch[key] = null;\n }\n return Object.keys(patch).length > 0 ? patch : null;\n}\n\nfunction deepEqual(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) return true;\n if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) return false;\n if (Array.isArray(a) !== Array.isArray(b)) return false;\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((item, index) => deepEqual(item, b[index]));\n }\n const ra = a as Record<string, unknown>;\n const rb = b as Record<string, unknown>;\n const ka = Object.keys(ra);\n const kb = Object.keys(rb);\n return ka.length === kb.length && ka.every((key) => key in rb && deepEqual(ra[key], rb[key]));\n}\n"],"names":[],"mappings":"AAsBA,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;AACvB,MAAM,oBAAoB;AAC1B,MAAM,eAAe;AAErB,MAAM,aAAa,CAAC,UAClB,MAAM,QAAQ,KAAK,IAAI,MAAM,OAAO,CAAC,SAAyB,OAAO,SAAS,QAAQ,IAAI,CAAA;AAE5F,MAAM,YAAY,CAAC,QAAoC;AACrD,QAAM,2BAAW,IAAA;AACjB,QAAM,MAAgB,CAAA;AACtB,aAAW,MAAM,KAAK;AACpB,QAAI,CAAC,MAAM,KAAK,IAAI,EAAE,EAAG;AACzB,SAAK,IAAI,EAAE;AACX,QAAI,KAAK,EAAE;AAAA,EACb;AACA,SAAO;AACT;AAGO,SAAS,iBACd,QACA,OACoB;AACpB,QAAM,OAA2B,EAAE,GAAG,OAAA;AACtC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,QAAI,QAAQ,aAAc;AAC1B,QAAI,UAAU,QAAQ,UAAU,OAAW,QAAO,KAAK,GAAG;AAAA,QACrD,MAAK,GAAG,IAAI;AAAA,EACnB;AACA,SAAO;AACT;AAMO,SAAS,iBACd,QACA,SACoB;AACpB,QAAM,MAAM,UAAU,OAAO;AAC7B,MAAI,IAAI,WAAW,EAAG,QAAO,EAAE,GAAG,OAAA;AAClC,QAAM,OAA2B,EAAE,GAAG,OAAA;AACtC,QAAM,SAAS,IAAI,IAAI,GAAG;AAC1B,OAAK,aAAa,IAAI,UAAU,CAAC,GAAG,WAAW,OAAO,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;AAC9E,aAAW,OAAO,CAAC,gBAAgB,iBAAiB,GAAG;AACrD,QAAI,EAAE,OAAO,QAAS;AACtB,UAAM,OAAO,WAAW,OAAO,GAAG,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;AACnE,QAAI,KAAK,SAAS,EAAG,MAAK,GAAG,IAAI;AAAA,QAC5B,QAAO,KAAK,GAAG;AAAA,EACtB;AACA,SAAO;AACT;AAOO,SAAS,kBACd,QACA,SACoB;AACpB,QAAM,MAAM,UAAU,OAAO;AAC7B,MAAI,IAAI,WAAW,EAAG,QAAO,EAAE,GAAG,OAAA;AAClC,QAAM,OAA2B,EAAE,GAAG,OAAA;AACtC,QAAM,WAAW,IAAI,IAAI,GAAG;AAC5B,QAAM,WAAW,MAAM,QAAQ,OAAO,aAAa,CAAC;AACpD,QAAM,UAAU,WAAW,OAAO,aAAa,CAAC;AAChD,QAAM,UAAU,IAAI,IAAI,OAAO;AAC/B,MAAI,SAAU,MAAK,aAAa,IAAI,QAAQ,OAAO,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;AAC5E,QAAM,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;AACpD,MAAI,SAAS,SAAS,GAAG;AACvB,SAAK,iBAAiB,IAAI,UAAU,CAAC,GAAG,WAAW,OAAO,iBAAiB,CAAC,GAAG,GAAG,QAAQ,CAAC;AAAA,EAC7F;AACA,SAAO;AACT;"}
|
|
@@ -190,6 +190,11 @@ const THREAD_CONFIG_CUSTOM_KEYS = [
|
|
|
190
190
|
new Set(
|
|
191
191
|
THREAD_CONFIG_CUSTOM_KEYS
|
|
192
192
|
);
|
|
193
|
+
const DEEP_AGENT_CONFIG_COMMANDS = {
|
|
194
|
+
patch: "config/patch",
|
|
195
|
+
toolsEnable: "config/tools/enable",
|
|
196
|
+
toolsDisable: "config/tools/disable"
|
|
197
|
+
};
|
|
193
198
|
const KNOWN_START_CHANNELS = [
|
|
194
199
|
"agent_orchestration",
|
|
195
200
|
"api",
|
|
@@ -233,6 +238,7 @@ const DEEP_AGENT_TRUNCATED_CONTENT_KEY = "athena_content_truncated";
|
|
|
233
238
|
exports.CLIENT_TOOL_INTERRUPT_SOURCE = CLIENT_TOOL_INTERRUPT_SOURCE;
|
|
234
239
|
exports.CLIENT_TOOL_RESULT_STATUS_ERROR = CLIENT_TOOL_RESULT_STATUS_ERROR;
|
|
235
240
|
exports.CLIENT_TOOL_RESULT_STATUS_SUCCESS = CLIENT_TOOL_RESULT_STATUS_SUCCESS;
|
|
241
|
+
exports.DEEP_AGENT_CONFIG_COMMANDS = DEEP_AGENT_CONFIG_COMMANDS;
|
|
236
242
|
exports.DEEP_AGENT_DEFAULT_MESSAGE_WINDOW = DEEP_AGENT_DEFAULT_MESSAGE_WINDOW;
|
|
237
243
|
exports.DEEP_AGENT_HISTORY_TOOL_OUTPUT_COMMAND = DEEP_AGENT_HISTORY_TOOL_OUTPUT_COMMAND;
|
|
238
244
|
exports.DEEP_AGENT_INTEREST_PROTOCOL = DEEP_AGENT_INTEREST_PROTOCOL;
|
|
@@ -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 \"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_computer\",\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 \"device_toolkits\",\n \"dry_run\",\n \"enabled_toolkits\",\n \"entry_point\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"max_tokens\",\n \"middleware\",\n \"model\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"panel_config\",\n \"posthog_session_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 \"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 \"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 \"device_toolkits\",\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 \"entry_point\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\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 \"posthog_session_id\",\n \"project_id\",\n \"recursion_limit\",\n \"run_budget\",\n \"run_label\",\n \"runtime\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_computer\",\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 \"device_toolkits\",\n \"dry_run\",\n \"entry_point\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"posthog_session_id\",\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 \"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_computer\",\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":";;AAkHO,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;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;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;;;;;;;;;;;;;;;;;;;;"}
|
|
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 \"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_computer\",\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 \"device_toolkits\",\n \"dry_run\",\n \"enabled_toolkits\",\n \"entry_point\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"max_tokens\",\n \"middleware\",\n \"model\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"panel_config\",\n \"posthog_session_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 \"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 \"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 \"device_toolkits\",\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 \"entry_point\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\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 \"posthog_session_id\",\n \"project_id\",\n \"recursion_limit\",\n \"run_budget\",\n \"run_label\",\n \"runtime\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_computer\",\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 \"device_toolkits\",\n \"dry_run\",\n \"entry_point\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"posthog_session_id\",\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 \"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_computer\",\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":";;AAkHO,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;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;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;AAMO,MAAM,6BAA6B;AAAA,EACxC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,cAAc;AAChB;AAGO,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;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -188,6 +188,11 @@ const THREAD_CONFIG_CUSTOM_KEYS = [
|
|
|
188
188
|
new Set(
|
|
189
189
|
THREAD_CONFIG_CUSTOM_KEYS
|
|
190
190
|
);
|
|
191
|
+
const DEEP_AGENT_CONFIG_COMMANDS = {
|
|
192
|
+
patch: "config/patch",
|
|
193
|
+
toolsEnable: "config/tools/enable",
|
|
194
|
+
toolsDisable: "config/tools/disable"
|
|
195
|
+
};
|
|
191
196
|
const KNOWN_START_CHANNELS = [
|
|
192
197
|
"agent_orchestration",
|
|
193
198
|
"api",
|
|
@@ -232,6 +237,7 @@ export {
|
|
|
232
237
|
CLIENT_TOOL_INTERRUPT_SOURCE,
|
|
233
238
|
CLIENT_TOOL_RESULT_STATUS_ERROR,
|
|
234
239
|
CLIENT_TOOL_RESULT_STATUS_SUCCESS,
|
|
240
|
+
DEEP_AGENT_CONFIG_COMMANDS,
|
|
235
241
|
DEEP_AGENT_DEFAULT_MESSAGE_WINDOW,
|
|
236
242
|
DEEP_AGENT_HISTORY_TOOL_OUTPUT_COMMAND,
|
|
237
243
|
DEEP_AGENT_INTEREST_PROTOCOL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runconfig-contract.js","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 \"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_computer\",\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 \"device_toolkits\",\n \"dry_run\",\n \"enabled_toolkits\",\n \"entry_point\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"max_tokens\",\n \"middleware\",\n \"model\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"panel_config\",\n \"posthog_session_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 \"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 \"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 \"device_toolkits\",\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 \"entry_point\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\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 \"posthog_session_id\",\n \"project_id\",\n \"recursion_limit\",\n \"run_budget\",\n \"run_label\",\n \"runtime\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_computer\",\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 \"device_toolkits\",\n \"dry_run\",\n \"entry_point\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"posthog_session_id\",\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 \"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_computer\",\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":"AAkHO,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;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;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;"}
|
|
1
|
+
{"version":3,"file":"runconfig-contract.js","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 \"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_computer\",\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 \"device_toolkits\",\n \"dry_run\",\n \"enabled_toolkits\",\n \"entry_point\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"max_tokens\",\n \"middleware\",\n \"model\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"panel_config\",\n \"posthog_session_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 \"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 \"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 \"device_toolkits\",\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 \"entry_point\",\n \"environment\",\n \"environment_id\",\n \"environment_name\",\n \"excluded_middleware\",\n \"excluded_tools\",\n \"extra_middleware\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\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 \"posthog_session_id\",\n \"project_id\",\n \"recursion_limit\",\n \"run_budget\",\n \"run_label\",\n \"runtime\",\n \"sandbox_runtime\",\n \"secret_asset_ids\",\n \"session_computer\",\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 \"device_toolkits\",\n \"dry_run\",\n \"entry_point\",\n \"from_stored_config\",\n \"frontend_available\",\n \"generative_frame_inline\",\n \"github_identity\",\n \"muses_enabled\",\n \"muses_recall_enabled\",\n \"office_context\",\n \"posthog_session_id\",\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 \"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_computer\",\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":"AAkHO,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;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;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;AAMO,MAAM,6BAA6B;AAAA,EACxC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,cAAc;AAChB;AAGO,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;"}
|