@tutti-os/agent-gui 0.0.66 → 0.0.68
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/dist/agent-conversation/index.d.ts +2 -2
- package/dist/agent-conversation/index.js +8 -8
- package/dist/agent-env/index.js +2 -1
- package/dist/agent-env/index.js.map +1 -1
- package/dist/agent-message-center/index.js +10 -10
- package/dist/{agentGuiNodeTypes-B9Aq3UEU.d.ts → agentGuiNodeTypes-BTHu_g4m.d.ts} +2 -1
- package/dist/app/renderer/agentactivity.css +132 -5
- package/dist/app/renderer/assets/icons/agents/opencode-rounded.png +0 -0
- package/dist/app/renderer/assets/icons/agents/provider-rail-opencode-colorful.png +0 -0
- package/dist/app/renderer/assets/icons/agents/tutti-flat-filled.svg +12 -0
- package/dist/{chunk-KRJF7WLJ.js → chunk-3QPN2Y7R.js} +53 -7
- package/dist/chunk-3QPN2Y7R.js.map +1 -0
- package/dist/{chunk-R2NGSPQS.js → chunk-4I2VCAMW.js} +16 -1
- package/dist/chunk-4I2VCAMW.js.map +1 -0
- package/dist/chunk-4US2YHBY.js +195 -0
- package/dist/chunk-4US2YHBY.js.map +1 -0
- package/dist/{chunk-DXVMRZHH.js → chunk-A2KZVRUO.js} +2 -2
- package/dist/{chunk-6ULTMCKP.js → chunk-AIR6A4NP.js} +2 -2
- package/dist/{chunk-2IMBPRKV.js → chunk-ATEZXUHK.js} +1 -1
- package/dist/chunk-ATEZXUHK.js.map +1 -0
- package/dist/{chunk-CKCUEHBW.js → chunk-BHNJN2TR.js} +13 -9
- package/dist/chunk-BHNJN2TR.js.map +1 -0
- package/dist/{chunk-NOTZW5WH.js → chunk-C2M2ELXF.js} +3 -3
- package/dist/{chunk-HNODQVG2.js → chunk-D22A3KGQ.js} +10 -2
- package/dist/chunk-D22A3KGQ.js.map +1 -0
- package/dist/{chunk-JTFWT6DK.js → chunk-DYX6466P.js} +4 -4
- package/dist/{chunk-VBTPXEFH.js → chunk-GOEL3BO7.js} +2 -2
- package/dist/{chunk-Z26P2QNT.js → chunk-GXHZNIWT.js} +4 -166
- package/dist/chunk-GXHZNIWT.js.map +1 -0
- package/dist/{chunk-UBBHWDMP.js → chunk-J335PQ5H.js} +9 -9
- package/dist/chunk-J335PQ5H.js.map +1 -0
- package/dist/{chunk-T3KGZV35.js → chunk-KJLSZETD.js} +3 -3
- package/dist/{chunk-DL6BMEHI.js → chunk-LQRD4X6R.js} +12 -3
- package/dist/chunk-LQRD4X6R.js.map +1 -0
- package/dist/{chunk-CTJQTUQ3.js → chunk-QGKK6FHC.js} +5 -5
- package/dist/{chunk-LQHYHF36.js → chunk-TB7PKP6F.js} +75 -18
- package/dist/chunk-TB7PKP6F.js.map +1 -0
- package/dist/{chunk-P5C3ED3V.js → chunk-UAAXRSW2.js} +3 -3
- package/dist/{chunk-LJE2W4EM.js → chunk-VRV6GBF5.js} +33 -5
- package/dist/chunk-VRV6GBF5.js.map +1 -0
- package/dist/{chunk-UI3YDJTC.js → chunk-YE5JSME7.js} +10 -4
- package/dist/chunk-YE5JSME7.js.map +1 -0
- package/dist/{chunk-N4I3TD4G.js → chunk-ZZBLWZJR.js} +79 -5
- package/dist/chunk-ZZBLWZJR.js.map +1 -0
- package/dist/context-mention-palette/index.js +9 -9
- package/dist/cursor-flat-filled-CL7N3BTZ.svg +3 -0
- package/dist/i18n/index.d.ts +52 -6
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +61 -6
- package/dist/index.js +2164 -1069
- package/dist/index.js.map +1 -1
- package/dist/queued-prompt-runtime.d.ts +2 -2
- package/dist/tutti-flat-filled-K32QBTZE.svg +12 -0
- package/dist/{types-Bxn8bLEp.d.ts → types-BwDrG654.d.ts} +3 -3
- package/dist/workbench/contribution.d.ts +1 -1
- package/dist/workbench/contribution.js +8 -8
- package/dist/workbench/index.d.ts +3 -2
- package/dist/workbench/index.js +11 -11
- package/dist/workbench/launch.d.ts +1 -1
- package/dist/workbench/launch.js +3 -3
- package/dist/workbench/providerCatalog.d.ts +5 -5
- package/dist/workbench/providerCatalog.js +1 -1
- package/dist/workbench/sessionTitle.d.ts +1 -1
- package/dist/workbench/sessionTitle.js +3 -3
- package/dist/workbench/state.d.ts +11 -2
- package/dist/workbench/state.js +5 -3
- package/dist/workbench/types.d.ts +2 -2
- package/dist/workbench/types.js +1 -1
- package/dist/workspace-agent-generated-files.js +4 -4
- package/package.json +12 -12
- package/dist/chunk-2IMBPRKV.js.map +0 -1
- package/dist/chunk-CKCUEHBW.js.map +0 -1
- package/dist/chunk-DL6BMEHI.js.map +0 -1
- package/dist/chunk-HNODQVG2.js.map +0 -1
- package/dist/chunk-KRJF7WLJ.js.map +0 -1
- package/dist/chunk-LJE2W4EM.js.map +0 -1
- package/dist/chunk-LQHYHF36.js.map +0 -1
- package/dist/chunk-N4I3TD4G.js.map +0 -1
- package/dist/chunk-R2NGSPQS.js.map +0 -1
- package/dist/chunk-TYGL25EL.js +0 -30
- package/dist/chunk-TYGL25EL.js.map +0 -1
- package/dist/chunk-UBBHWDMP.js.map +0 -1
- package/dist/chunk-UI3YDJTC.js.map +0 -1
- package/dist/chunk-Z26P2QNT.js.map +0 -1
- /package/dist/{chunk-DXVMRZHH.js.map → chunk-A2KZVRUO.js.map} +0 -0
- /package/dist/{chunk-6ULTMCKP.js.map → chunk-AIR6A4NP.js.map} +0 -0
- /package/dist/{chunk-NOTZW5WH.js.map → chunk-C2M2ELXF.js.map} +0 -0
- /package/dist/{chunk-JTFWT6DK.js.map → chunk-DYX6466P.js.map} +0 -0
- /package/dist/{chunk-VBTPXEFH.js.map → chunk-GOEL3BO7.js.map} +0 -0
- /package/dist/{chunk-T3KGZV35.js.map → chunk-KJLSZETD.js.map} +0 -0
- /package/dist/{chunk-CTJQTUQ3.js.map → chunk-QGKK6FHC.js.map} +0 -0
- /package/dist/{chunk-P5C3ED3V.js.map → chunk-UAAXRSW2.js.map} +0 -0
|
@@ -6,18 +6,20 @@ var agentGUIProviderTargetStaticLabels = {
|
|
|
6
6
|
gemini: "Gemini",
|
|
7
7
|
hermes: "Hermes",
|
|
8
8
|
nexight: "Tutti Agent",
|
|
9
|
-
openclaw: "OpenClaw"
|
|
9
|
+
openclaw: "OpenClaw",
|
|
10
|
+
opencode: "OpenCode",
|
|
11
|
+
"tutti-agent": "Tutti Agent"
|
|
10
12
|
};
|
|
11
13
|
var agentGUIDefaultTargetProviders = [
|
|
12
14
|
"codex",
|
|
13
15
|
"claude-code",
|
|
14
16
|
"cursor",
|
|
15
|
-
"
|
|
17
|
+
"tutti-agent",
|
|
18
|
+
"opencode",
|
|
16
19
|
"hermes",
|
|
17
20
|
"openclaw"
|
|
18
21
|
];
|
|
19
22
|
var agentGUIDisabledPlaceholderProviders = [
|
|
20
|
-
"nexight",
|
|
21
23
|
"hermes",
|
|
22
24
|
"openclaw"
|
|
23
25
|
];
|
|
@@ -83,6 +85,8 @@ function localAgentGUIAgentTargetId(provider) {
|
|
|
83
85
|
return "local:codex";
|
|
84
86
|
case "claude-code":
|
|
85
87
|
return "local:claude-code";
|
|
88
|
+
case "tutti-agent":
|
|
89
|
+
return "local:tutti-agent";
|
|
86
90
|
case "cursor":
|
|
87
91
|
return "local:cursor";
|
|
88
92
|
case "hermes":
|
|
@@ -91,6 +95,8 @@ function localAgentGUIAgentTargetId(provider) {
|
|
|
91
95
|
return "local:nexight";
|
|
92
96
|
case "openclaw":
|
|
93
97
|
return "local:openclaw";
|
|
98
|
+
case "opencode":
|
|
99
|
+
return "local:opencode";
|
|
94
100
|
default:
|
|
95
101
|
return null;
|
|
96
102
|
}
|
|
@@ -225,4 +231,4 @@ export {
|
|
|
225
231
|
resolveAgentGUIProviderTarget,
|
|
226
232
|
agentGUIProviderTargetRefsEqual
|
|
227
233
|
};
|
|
228
|
-
//# sourceMappingURL=chunk-
|
|
234
|
+
//# sourceMappingURL=chunk-YE5JSME7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../providerTargets.ts"],"sourcesContent":["import type {\n AgentGUIProvider,\n AgentGUIProviderTarget,\n AgentGUIProviderTargetRef\n} from \"./types.ts\";\n\nconst agentGUIProviderTargetStaticLabels: Record<AgentGUIProvider, string> = {\n \"claude-code\": \"Claude Code\",\n codex: \"Codex\",\n cursor: \"Cursor\",\n gemini: \"Gemini\",\n hermes: \"Hermes\",\n nexight: \"Tutti Agent\",\n openclaw: \"OpenClaw\",\n opencode: \"OpenCode\",\n \"tutti-agent\": \"Tutti Agent\"\n};\n\nexport const agentGUIDefaultTargetProviders = [\n \"codex\",\n \"claude-code\",\n \"cursor\",\n \"tutti-agent\",\n \"opencode\",\n \"hermes\",\n \"openclaw\"\n] as const satisfies readonly AgentGUIProvider[];\n\nconst agentGUIDisabledPlaceholderProviders = [\n \"hermes\",\n \"openclaw\"\n] as const satisfies readonly AgentGUIProvider[];\n\nexport function createLocalAgentGUIProviderTarget(\n provider: AgentGUIProvider\n): AgentGUIProviderTarget {\n const targetId = localAgentGUIProviderTargetId(provider);\n const agentTargetId = localAgentGUIAgentTargetId(provider);\n return {\n targetId,\n ...(agentTargetId ? { agentTargetId } : {}),\n provider,\n ref: {\n kind: \"local\",\n provider\n },\n label: agentGUIProviderTargetStaticLabels[provider] ?? provider\n };\n}\n\nexport function createDisabledPlaceholderAgentGUIProviderTarget(\n provider: AgentGUIProvider\n): AgentGUIProviderTarget {\n return {\n ...createLocalAgentGUIProviderTarget(provider),\n disabled: true\n };\n}\n\nexport function createSharedAgentGUIProviderTarget(input: {\n provider: AgentGUIProvider;\n sharedAgentId: string;\n label: string;\n agentTargetId?: string | null;\n ownerLabel?: string | null;\n iconUrl?: string | null;\n unavailableReason?: string | null;\n disabled?: boolean;\n ref?: Record<string, unknown> | null;\n}): AgentGUIProviderTarget {\n const sharedAgentId = input.sharedAgentId.trim();\n const targetId = `shared-agent:${sharedAgentId}`;\n return {\n targetId,\n ...(input.agentTargetId?.trim()\n ? { agentTargetId: input.agentTargetId.trim() }\n : {}),\n provider: input.provider,\n ref: {\n ...(input.ref ?? {}),\n kind: \"shared-agent\",\n provider: input.provider,\n sharedAgentId\n },\n label: input.label,\n ...(input.ownerLabel?.trim()\n ? { ownerLabel: input.ownerLabel.trim() }\n : {}),\n ...(input.iconUrl?.trim() ? { iconUrl: input.iconUrl.trim() } : {}),\n ...(input.unavailableReason?.trim()\n ? { unavailableReason: input.unavailableReason.trim() }\n : {}),\n ...(input.disabled === true ? { disabled: true } : {})\n };\n}\n\nexport function createLocalAgentGUIProviderTargets(\n providers: readonly AgentGUIProvider[] = agentGUIDefaultTargetProviders\n): AgentGUIProviderTarget[] {\n return providers.map((provider) =>\n createLocalAgentGUIProviderTarget(provider)\n );\n}\n\nfunction createStaticAgentGUIProviderTargets(\n providers: readonly AgentGUIProvider[] = agentGUIDefaultTargetProviders,\n options?: { includeDisabledPlaceholders?: boolean }\n): AgentGUIProviderTarget[] {\n const disabledProviders = new Set<AgentGUIProvider>(\n options?.includeDisabledPlaceholders === true\n ? agentGUIDisabledPlaceholderProviders\n : []\n );\n return providers.map((provider) =>\n disabledProviders.has(provider)\n ? createDisabledPlaceholderAgentGUIProviderTarget(provider)\n : createLocalAgentGUIProviderTarget(provider)\n );\n}\n\nexport function localAgentGUIProviderTargetId(\n provider: AgentGUIProvider\n): string {\n return `local:${provider}`;\n}\n\nexport function localAgentGUIAgentTargetId(\n provider: AgentGUIProvider\n): string | null {\n switch (provider) {\n case \"codex\":\n return \"local:codex\";\n case \"claude-code\":\n return \"local:claude-code\";\n case \"tutti-agent\":\n return \"local:tutti-agent\";\n case \"cursor\":\n return \"local:cursor\";\n case \"hermes\":\n return \"local:hermes\";\n case \"nexight\":\n return \"local:nexight\";\n case \"openclaw\":\n return \"local:openclaw\";\n case \"opencode\":\n return \"local:opencode\";\n default:\n return null;\n }\n}\n\nexport function normalizeAgentGUIProviderTargets(\n targets: readonly AgentGUIProviderTarget[] | null | undefined,\n options?: {\n includeDisabledPlaceholders?: boolean;\n useStaticCatalog?: boolean;\n }\n): AgentGUIProviderTarget[] {\n const includeDisabledPlaceholders =\n options?.includeDisabledPlaceholders === true;\n const useStaticCatalog = options?.useStaticCatalog !== false;\n const source = targets && targets.length > 0 ? targets : [];\n const normalizedTargets: AgentGUIProviderTarget[] = [];\n const seenTargetKeys = new Set<string>();\n const seenProviders = new Set<AgentGUIProvider>();\n for (const target of source) {\n const normalized = normalizeAgentGUIProviderTarget(target);\n if (!normalized) {\n continue;\n }\n const dedupeKey = `${normalized.provider}\\u0000${normalized.targetId}`;\n if (seenTargetKeys.has(dedupeKey)) {\n continue;\n }\n seenTargetKeys.add(dedupeKey);\n seenProviders.add(normalized.provider);\n normalizedTargets.push(normalized);\n }\n if (includeDisabledPlaceholders && normalizedTargets.length > 0) {\n for (const provider of agentGUIDisabledPlaceholderProviders) {\n if (seenProviders.has(provider)) {\n continue;\n }\n normalizedTargets.push(\n createDisabledPlaceholderAgentGUIProviderTarget(provider)\n );\n }\n }\n return normalizedTargets.length > 0 || !useStaticCatalog\n ? normalizedTargets\n : createStaticAgentGUIProviderTargets(undefined, {\n includeDisabledPlaceholders\n });\n}\n\nexport function resolveAgentGUIProviderTarget(input: {\n agentTargetId?: string | null;\n defaultProviderTargetId?: string | null;\n provider: AgentGUIProvider;\n providerTargetId?: string | null;\n providerTargets: readonly AgentGUIProviderTarget[];\n useStaticCatalog?: boolean;\n}): AgentGUIProviderTarget | null {\n const targetByAgentTargetId = new Map(\n input.providerTargets.flatMap((target) =>\n target.agentTargetId ? [[target.agentTargetId, target] as const] : []\n )\n );\n const agentTarget = targetByAgentTargetId.get(\n input.agentTargetId?.trim() ?? \"\"\n );\n if (agentTarget) {\n return agentTarget;\n }\n const providerTargets = input.providerTargets.filter(\n (target) => target.provider === input.provider\n );\n const targetById = new Map(\n providerTargets.map((target) => [target.targetId, target])\n );\n return (\n targetById.get(input.providerTargetId?.trim() ?? \"\") ??\n targetById.get(input.defaultProviderTargetId?.trim() ?? \"\") ??\n targetById.get(localAgentGUIProviderTargetId(input.provider)) ??\n providerTargets.find((target) => target.disabled !== true) ??\n providerTargets[0] ??\n (input.useStaticCatalog === false\n ? null\n : createLocalAgentGUIProviderTarget(input.provider))\n );\n}\n\nexport function agentGUIProviderTargetRefsEqual(\n left: AgentGUIProviderTargetRef | null | undefined,\n right: AgentGUIProviderTargetRef | null | undefined\n): boolean {\n if (left === right) {\n return true;\n }\n if (!left && !right) {\n return true;\n }\n if (!left || !right) {\n return false;\n }\n return stableProviderTargetRefKey(left) === stableProviderTargetRefKey(right);\n}\n\nfunction normalizeAgentGUIProviderTarget(\n target: AgentGUIProviderTarget\n): AgentGUIProviderTarget | null {\n const {\n targetId: _targetId,\n agentTargetId: _agentTargetId,\n provider: _provider,\n ref: _ref,\n label: _label,\n description,\n iconUrl,\n ownerLabel,\n unavailableReason,\n ...rest\n } = target;\n const targetId = target.targetId.trim();\n const agentTargetId = target.agentTargetId?.trim();\n const label = target.label.trim();\n const kind =\n typeof target.ref.kind === \"string\" ? target.ref.kind.trim() : \"\";\n if (!targetId || !label || !kind || target.ref.provider !== target.provider) {\n return null;\n }\n return {\n ...rest,\n targetId,\n ...(agentTargetId ? { agentTargetId } : {}),\n provider: target.provider,\n ref: {\n ...target.ref,\n kind,\n provider: target.provider\n },\n label,\n ...(description?.trim() ? { description: description.trim() } : {}),\n ...(iconUrl?.trim() ? { iconUrl: iconUrl.trim() } : {}),\n ...(ownerLabel?.trim() ? { ownerLabel: ownerLabel.trim() } : {}),\n ...(unavailableReason?.trim()\n ? { unavailableReason: unavailableReason.trim() }\n : {})\n };\n}\n\nfunction stableProviderTargetRefKey(ref: AgentGUIProviderTargetRef): string {\n return JSON.stringify(sortProviderTargetRefValue(ref));\n}\n\nfunction sortProviderTargetRefValue(value: unknown): unknown {\n if (Array.isArray(value)) {\n return value.map(sortProviderTargetRefValue);\n }\n if (!value || typeof value !== \"object\") {\n return value;\n }\n return Object.fromEntries(\n Object.entries(value)\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([key, entryValue]) => [key, sortProviderTargetR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KAAK,EAAE,IAAI,CAAC;AAAA,IACrD,GAAI,YAAY,KAAK,IAAI,EAAE,YAAY,WAAW,KAAK,EAAE,IAAI,CAAC;AAAA,IAC9D,GAAI,mBAAmB,KAAK,IACxB,EAAE,mBAAmB,kBAAkB,KAAK,EAAE,IAC9C,CAAC;AAAA,EACP;AACF;AAEA,SAAS,2BAA2B,KAAwC;AAC1E,SAAO,KAAK,UAAU,2BAA2B,GAAG,CAAC;AACvD;AAEA,SAAS,2BAA2B,OAAyB;AAC3D,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,WAAO,MAAM,IAAI,0BAA0B;AAAA,EAC7C;AACA,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,WAAO;AAAA,EACT;AACA,SAAO,OAAO;AAAA,IACZ,OAAO,QAAQ,KAAK,EACjB,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,MAAM,KAAK,cAAc,KAAK,CAAC,EACnD,IAAI,CAAC,CAAC,KAAK,UAAU,MAAM,CAAC,KAAK,2BAA2B,UAAU,CAAC,CAAC;AAAA,EAC7E;AACF;","names":[]}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN
|
|
3
|
+
} from "./chunk-4US2YHBY.js";
|
|
1
4
|
import {
|
|
2
5
|
claudeRoundedUrl,
|
|
3
6
|
codexRoundedUrl,
|
|
@@ -9,16 +12,19 @@ import {
|
|
|
9
12
|
manageAgentCodexUrl,
|
|
10
13
|
manageAgentGeminiUrl,
|
|
11
14
|
manageAgentHermesUrl,
|
|
15
|
+
manageAgentOpenCodeUrl,
|
|
12
16
|
manageAgentOpenclawUrl,
|
|
13
17
|
manageAgentTuttiUrl,
|
|
14
18
|
normalizeManagedAgentProvider,
|
|
15
19
|
openclawRoundedUrl,
|
|
20
|
+
opencodeRoundedUrl,
|
|
16
21
|
providerRailClaudeCodeColorfulUrl,
|
|
17
22
|
providerRailCodexColorfulUrl,
|
|
18
23
|
providerRailHermesColorfulUrl,
|
|
24
|
+
providerRailOpenCodeColorfulUrl,
|
|
19
25
|
providerRailTuttiUrl,
|
|
20
26
|
tuttiDocRoundedUrl
|
|
21
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-4I2VCAMW.js";
|
|
22
28
|
|
|
23
29
|
// shared/agentCustomMentionKinds.ts
|
|
24
30
|
var registry = /* @__PURE__ */ new Map();
|
|
@@ -60,6 +66,7 @@ function resetAgentCustomMentionKindsForTests() {
|
|
|
60
66
|
import {
|
|
61
67
|
createContext,
|
|
62
68
|
useContext,
|
|
69
|
+
useEffect,
|
|
63
70
|
useSyncExternalStore
|
|
64
71
|
} from "react";
|
|
65
72
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -67,11 +74,30 @@ var AgentActivityRuntimeContext = createContext(
|
|
|
67
74
|
null
|
|
68
75
|
);
|
|
69
76
|
var currentAgentActivityRuntime = null;
|
|
77
|
+
var runtimesByOrigin = /* @__PURE__ */ new Map();
|
|
78
|
+
function normalizeRuntimeOrigin(origin) {
|
|
79
|
+
return origin?.trim() || WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN;
|
|
80
|
+
}
|
|
70
81
|
function AgentActivityRuntimeProvider({
|
|
71
82
|
children,
|
|
72
83
|
runtime
|
|
73
84
|
}) {
|
|
74
85
|
currentAgentActivityRuntime = runtime ?? null;
|
|
86
|
+
const origin = normalizeRuntimeOrigin(runtime?.origin);
|
|
87
|
+
if (origin && runtime) {
|
|
88
|
+
runtimesByOrigin.set(origin, runtime);
|
|
89
|
+
}
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (!origin || !runtime) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
runtimesByOrigin.set(origin, runtime);
|
|
95
|
+
return () => {
|
|
96
|
+
if (runtimesByOrigin.get(origin) === runtime) {
|
|
97
|
+
runtimesByOrigin.delete(origin);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}, [origin, runtime]);
|
|
75
101
|
return /* @__PURE__ */ jsx(AgentActivityRuntimeContext.Provider, { value: runtime ?? null, children });
|
|
76
102
|
}
|
|
77
103
|
function useAgentActivityRuntime() {
|
|
@@ -107,9 +133,21 @@ function getAgentActivityRuntime() {
|
|
|
107
133
|
function getOptionalAgentActivityRuntime() {
|
|
108
134
|
return getExplicitWindowTestAgentActivityRuntime() ?? currentAgentActivityRuntime ?? getTestAgentActivityRuntime();
|
|
109
135
|
}
|
|
136
|
+
function getAgentActivityRuntimeByOrigin(origin) {
|
|
137
|
+
const normalizedOrigin = normalizeRuntimeOrigin(origin);
|
|
138
|
+
const runtime = runtimesByOrigin.get(normalizedOrigin);
|
|
139
|
+
if (runtime) {
|
|
140
|
+
return runtime;
|
|
141
|
+
}
|
|
142
|
+
if (normalizedOrigin === WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN) {
|
|
143
|
+
return getOptionalAgentActivityRuntime();
|
|
144
|
+
}
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
110
147
|
function resetAgentActivityRuntimeForTests() {
|
|
111
148
|
if (process.env.NODE_ENV === "test") {
|
|
112
149
|
currentAgentActivityRuntime = null;
|
|
150
|
+
runtimesByOrigin.clear();
|
|
113
151
|
}
|
|
114
152
|
}
|
|
115
153
|
function setAgentActivityRuntimeForTests(runtime) {
|
|
@@ -152,6 +190,7 @@ function getExplicitWindowTestAgentActivityRuntime() {
|
|
|
152
190
|
import {
|
|
153
191
|
createContext as createContext2,
|
|
154
192
|
useContext as useContext2,
|
|
193
|
+
useEffect as useEffect2,
|
|
155
194
|
useMemo
|
|
156
195
|
} from "react";
|
|
157
196
|
|
|
@@ -180,6 +219,10 @@ var AgentActivityHostContext = createContext2(
|
|
|
180
219
|
null
|
|
181
220
|
);
|
|
182
221
|
var currentAgentHostApi = null;
|
|
222
|
+
var hostApiByOrigin = /* @__PURE__ */ new Map();
|
|
223
|
+
function resolveHostOrigin(runtime) {
|
|
224
|
+
return runtime?.origin?.trim() || WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN;
|
|
225
|
+
}
|
|
183
226
|
function AgentActivityHostProvider({
|
|
184
227
|
agentActivityRuntime,
|
|
185
228
|
agentHostApi,
|
|
@@ -190,6 +233,21 @@ function AgentActivityHostProvider({
|
|
|
190
233
|
[agentHostApi]
|
|
191
234
|
);
|
|
192
235
|
currentAgentHostApi = resolvedAgentHostApi;
|
|
236
|
+
const origin = resolveHostOrigin(agentActivityRuntime);
|
|
237
|
+
if (resolvedAgentHostApi) {
|
|
238
|
+
hostApiByOrigin.set(origin, resolvedAgentHostApi);
|
|
239
|
+
}
|
|
240
|
+
useEffect2(() => {
|
|
241
|
+
if (!resolvedAgentHostApi) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
hostApiByOrigin.set(origin, resolvedAgentHostApi);
|
|
245
|
+
return () => {
|
|
246
|
+
if (hostApiByOrigin.get(origin) === resolvedAgentHostApi) {
|
|
247
|
+
hostApiByOrigin.delete(origin);
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
}, [origin, resolvedAgentHostApi]);
|
|
193
251
|
return /* @__PURE__ */ jsx2(AgentActivityRuntimeProvider, { runtime: agentActivityRuntime, children: /* @__PURE__ */ jsx2(AgentActivityHostContext.Provider, { value: resolvedAgentHostApi, children }) });
|
|
194
252
|
}
|
|
195
253
|
function useAgentHostApi() {
|
|
@@ -207,6 +265,17 @@ function useOptionalAgentHostApi() {
|
|
|
207
265
|
function getOptionalAgentHostApi() {
|
|
208
266
|
return getExplicitWindowTestAgentHostApi() ?? currentAgentHostApi ?? getTestAgentHostApi();
|
|
209
267
|
}
|
|
268
|
+
function getAgentHostApiByOrigin(origin) {
|
|
269
|
+
const normalizedOrigin = origin?.trim() || WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN;
|
|
270
|
+
const hostApi = hostApiByOrigin.get(normalizedOrigin);
|
|
271
|
+
if (hostApi) {
|
|
272
|
+
return hostApi;
|
|
273
|
+
}
|
|
274
|
+
if (normalizedOrigin === WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN) {
|
|
275
|
+
return getOptionalAgentHostApi();
|
|
276
|
+
}
|
|
277
|
+
return null;
|
|
278
|
+
}
|
|
210
279
|
function getTestAgentHostApi() {
|
|
211
280
|
if (process.env.NODE_ENV !== "test") {
|
|
212
281
|
return null;
|
|
@@ -247,14 +316,16 @@ var MANAGED_AGENT_ICON_URLS = {
|
|
|
247
316
|
gemini: manageAgentGeminiUrl,
|
|
248
317
|
hermes: manageAgentHermesUrl,
|
|
249
318
|
tutti: manageAgentTuttiUrl,
|
|
250
|
-
openclaw: manageAgentOpenclawUrl
|
|
319
|
+
openclaw: manageAgentOpenclawUrl,
|
|
320
|
+
opencode: manageAgentOpenCodeUrl
|
|
251
321
|
};
|
|
252
322
|
var MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS = {
|
|
253
323
|
"claude-code": providerRailClaudeCodeColorfulUrl,
|
|
254
324
|
codex: providerRailCodexColorfulUrl,
|
|
255
325
|
cursor: cursorColorfulUrl,
|
|
256
326
|
hermes: providerRailHermesColorfulUrl,
|
|
257
|
-
tutti: providerRailTuttiUrl
|
|
327
|
+
tutti: providerRailTuttiUrl,
|
|
328
|
+
opencode: providerRailOpenCodeColorfulUrl
|
|
258
329
|
};
|
|
259
330
|
var MANAGED_AGENT_ICON_ROUNDED_URLS = {
|
|
260
331
|
"claude-code": claudeRoundedUrl,
|
|
@@ -263,7 +334,8 @@ var MANAGED_AGENT_ICON_ROUNDED_URLS = {
|
|
|
263
334
|
gemini: geminiRoundedUrl,
|
|
264
335
|
hermes: hermesRoundedUrl,
|
|
265
336
|
tutti: tuttiDocRoundedUrl,
|
|
266
|
-
openclaw: openclawRoundedUrl
|
|
337
|
+
openclaw: openclawRoundedUrl,
|
|
338
|
+
opencode: opencodeRoundedUrl
|
|
267
339
|
};
|
|
268
340
|
var MANAGED_AGENT_ROUNDED_ICON_FALLBACK_URL = tuttiDocRoundedUrl;
|
|
269
341
|
var MANAGED_AGENT_ICON_FALLBACK_URL = manageAgentTuttiUrl;
|
|
@@ -281,15 +353,17 @@ export {
|
|
|
281
353
|
useAgentActivitySnapshot,
|
|
282
354
|
getAgentActivityRuntime,
|
|
283
355
|
getOptionalAgentActivityRuntime,
|
|
356
|
+
getAgentActivityRuntimeByOrigin,
|
|
284
357
|
resetAgentActivityRuntimeForTests,
|
|
285
358
|
setAgentActivityRuntimeForTests,
|
|
286
359
|
AgentActivityHostProvider,
|
|
287
360
|
useAgentHostApi,
|
|
288
361
|
useOptionalAgentHostApi,
|
|
289
362
|
getOptionalAgentHostApi,
|
|
363
|
+
getAgentHostApiByOrigin,
|
|
290
364
|
MANAGED_AGENT_ICON_URLS,
|
|
291
365
|
MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS,
|
|
292
366
|
MANAGED_AGENT_ICON_FALLBACK_URL,
|
|
293
367
|
managedAgentRoundedIconUrl
|
|
294
368
|
};
|
|
295
|
-
//# sourceMappingURL=chunk-
|
|
369
|
+
//# sourceMappingURL=chunk-ZZBLWZJR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../shared/agentCustomMentionKinds.ts","../agentActivityRuntime.tsx","../agentActivityHost.tsx","../host/agentHostApi.ts","../shared/managedAgentIcons.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\n// 自定义 mention kind 注册表:让宿主(如 tsh)从外部注册 mention://<kind>/... 链接的\n// 解析与 composer 内 chip 渲染,包内不内置任何具体业务 kind。\n//\n// 管线接点:\n// - 解析:agentFileMentionExtension.parseMentionItemFromHref 命中注册 kind 时产出\n// AgentMentionCustomItem(展示字段由 present() 提取;href 是完整信息源,round-trip 无损)\n// - 渲染:AgentMentionNodeView 对 kind===\"custom\" 调 renderChip(),缺省用包内通用双行卡\n// - 点击:clickable 的 kind 经 resolveWorkspaceMentionLinkAction 上抛\n// open-custom-mention 链接动作(携带原始 href,宿主自行二次解析)\n//\n// 注册时机:宿主渲染进程 bootstrap(早于首个 composer 挂载);模块级单例,重复注册以\n// 后者为准(HMR 友好)。\n\nexport interface AgentCustomMentionIdentity {\n entityId: string;\n label: string;\n scope?: Readonly<Record<string, string>>;\n}\n\nexport interface AgentCustomMentionPresentation {\n /** chip 第一行(缺省用链接 label)。 */\n name: string;\n /** chip 第二行(可选,通用双行卡的次要文案)。 */\n summary?: string;\n /** 所属 workspace(可选;custom kind 的 scope 键由注册方约定)。 */\n workspaceId?: string;\n}\n\nexport interface AgentCustomMentionChipContext {\n href: string;\n name: string;\n summary?: string;\n isEditable: boolean;\n /** 可编辑态的移除按钮,由 NodeView 注入;自定义渲染需自行摆放。 */\n removeAction?: ReactNode;\n}\n\nexport interface AgentCustomMentionKindDefinition {\n /** mention://<kind>/... 的 providerId(URL hostname,小写)。 */\n kind: string;\n /**\n * 从 canonical mention 链接提取展示字段;返回 null 表示链接无效,\n * 退化为普通链接/字面文本。\n */\n present(\n mention: AgentCustomMentionIdentity,\n href: string\n ): AgentCustomMentionPresentation | null;\n /** 自定义 chip 渲染;缺省用包内通用双行卡(name + summary)。 */\n renderChip?(context: AgentCustomMentionChipContext): ReactNode;\n /** 点击是否上抛 open-custom-mention 链接动作;缺省 false(chip 只展示)。 */\n clickable?: boolean;\n}\n\nconst registry = new Map<string, AgentCustomMentionKindDefinition>();\n\n// 包内管线已内置处理的 providerId(agentFileMentionExtension /\n// resolveWorkspaceMentionLinkAction),以及宿主侧沿用的 legacy 短名与内部 kind。\n// 注册表查找在部分链路先于内置分支执行,若放行同名注册会静默劫持内置 mention\n// 的解析——注册发生在宿主 bootstrap,直接抛错 fail-fast。\nconst RESERVED_AGENT_MENTION_PROVIDER_IDS = new Set([\n \"agent-session\",\n \"agent-target\",\n \"custom\",\n \"file\",\n \"issue\",\n \"session\",\n \"task\",\n \"workspace-app\",\n \"workspace-app-factory\",\n \"workspace-issue\",\n \"workspace-reference\"\n]);\n\nexport function registerAgentCustomMentionKind(\n definition: AgentCustomMentionKindDefinition\n): void {\n const kind = definition.kind.trim().toLowerCase();\n if (!kind) {\n throw new Error(\n \"[agent-gui] custom mention kind must be a non-empty provider id\"\n );\n }\n if (RESERVED_AGENT_MENTION_PROVIDER_IDS.has(kind)) {\n throw new Error(\n `[agent-gui] custom mention kind \"${kind}\" collides with a built-in provider id`\n );\n }\n registry.set(kind, definition);\n}\n\nexport function getAgentCustomMentionKind(\n kind: string\n): AgentCustomMentionKindDefinition | undefined {\n return registry.get(kind.trim().toLowerCase());\n}\n\nexport function resetAgentCustomMentionKindsForTests(): void {\n registry.clear();\n}\n","import {\n createContext,\n useContext,\n useEffect,\n useSyncExternalStore,\n type JSX,\n type PropsWithChildren\n} from \"react\";\nimport type {\n AgentActivityCancelSessionInput,\n AgentActivityCancelSessionResult,\n AgentActivityGoalControlInput,\n AgentActivityGoalControlResult,\n AgentActivityCreateSessionInput,\n AgentActivityDeleteSessionInput,\n AgentActivityDeleteSessionResult,\n AgentActivityMessageOrder,\n AgentActivityMessagePage,\n AgentActivitySendInput,\n AgentActivitySendInputResult,\n AgentActivitySession,\n AgentActivitySnapshot,\n AgentActivitySnapshotListener,\n AgentActivitySubmitInteractiveInput\n} from \"@tutti-os/agent-activity-core\";\nimport type {\n AgentHostAgentSessionComposerSettings,\n AgentHostActivateAgentSessionResult,\n AgentHostRuntimeOpenclawGatewayWarmupResult,\n AgentHostUpdateAgentSessionSettingsResult,\n AgentHostUnactivateAgentSessionResult,\n AgentHostAgentSessionState\n} from \"./shared/contracts/dto\";\nimport type { AgentGUIProviderTargetRef } from \"./types\";\nimport { WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN } from \"./shared/workspaceAgentActivityTypes\";\n\nexport interface AgentActivityRuntimeListSessionMessagesInput {\n afterVersion?: number;\n beforeVersion?: number;\n cache?: boolean;\n agentSessionId: string;\n limit?: number;\n order?: AgentActivityMessageOrder;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListGeneratedFilesInput {\n limit?: number;\n query?: string;\n sessionCwd?: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListSessionsPageInput {\n limit?: number;\n searchQuery?: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeSessionPageResult {\n hasMore: boolean;\n nextCursor?: string;\n sessions: AgentActivitySession[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListSessionSectionsInput {\n agentTargetId?: string | null;\n limitPerSection?: number;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeListSessionSectionPageInput {\n agentTargetId?: string | null;\n cursor?: string;\n limit?: number;\n sectionKey: string;\n signal?: AbortSignal;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUserProject {\n createdAtUnixMs: number;\n id: string;\n label: string;\n lastUsedAtUnixMs?: number;\n path: string;\n sectionKey: string;\n updatedAtUnixMs: number;\n}\n\nexport interface AgentActivityRuntimeSessionSection {\n kind: \"conversations\" | \"project\";\n sectionKey: string;\n userProject?: AgentActivityRuntimeUserProject;\n sessions: AgentActivitySession[];\n hasMore: boolean;\n nextCursor?: string;\n}\n\nexport interface AgentActivityRuntimeSessionSectionsResult {\n sections: AgentActivityRuntimeSessionSection[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeGeneratedFile {\n label: string;\n path: string;\n}\n\nexport interface AgentActivityRuntimeGeneratedFileList {\n entries: AgentActivityRuntimeGeneratedFile[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeEnsureSessionSynchronizedInput {\n afterVersion?: number;\n agentSessionId: string;\n onError?: (error: unknown) => void;\n workspaceId: string;\n}\n\nexport type AgentActivityRuntimeRetainSessionEventsInput =\n AgentActivityRuntimeEnsureSessionSynchronizedInput;\n\nexport interface AgentActivityRuntimeSetSessionPinnedInput {\n agentSessionId: string;\n pinned: boolean;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeTrackSettingsProjectChangeInput {\n action: \"clear\" | \"create_new\" | \"select_existing\";\n agentSessionId: string;\n provider?: string | null;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeGetSessionControlStateInput {\n agentSessionId: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeGetComposerOptionsInput {\n agentTargetId?: string | null;\n cwd?: string | null;\n force?: boolean;\n provider?: string;\n settings?: AgentHostAgentSessionComposerSettings | null;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUpdateSessionSettingsInput {\n agentSessionId: string;\n settings: AgentHostAgentSessionComposerSettings;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeTrackDraftComposerSettingsChangeInput {\n nextSettings: AgentHostAgentSessionComposerSettings;\n previousSettings: AgentHostAgentSessionComposerSettings;\n provider: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeWarmupOpenclawGatewayInput {\n workspaceId?: string | null;\n}\n\nexport interface AgentActivityRuntimeDiagnosticInput {\n details?: Record<string, unknown>;\n event: string;\n level?: \"debug\" | \"info\" | \"warn\" | \"error\";\n source?: string;\n workspaceId?: string | null;\n}\n\nexport interface AgentActivityRuntimeActivateSessionInput {\n agentSessionId: string;\n agentTargetId?: string | null;\n cwd?: string;\n initialContent?: AgentActivitySendInput[\"content\"];\n /** 仅展示用首轮文本(bundle 折叠成一个 chip);initialContent 仍带展开后的文件。 */\n initialDisplayPrompt?: string | null;\n metadata?: Record<string, unknown>;\n mode: \"existing\" | \"new\";\n openclawGatewayReady?: boolean;\n provider?: string;\n /**\n * Opaque host-owned target reference. AgentGUI passes this through only; hosts\n * must not treat it as authority and must re-authenticate before launch.\n */\n providerTargetRef?: AgentGUIProviderTargetRef | null;\n settings?: AgentHostAgentSessionComposerSettings;\n title?: string;\n visible?: boolean;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUnactivateSessionInput {\n agentSessionId: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeReadSessionAttachmentInput {\n agentSessionId: string;\n attachmentId: string;\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeReadPromptAssetInput {\n agentSessionId?: string | null;\n assetId?: string | null;\n hostPath?: string | null;\n kind?: string | null;\n mimeType: string;\n name?: string | null;\n path?: string | null;\n sha256?: string | null;\n uploadStatus?: string | null;\n uri?: string | null;\n workspaceId: string;\n}\n\nexport type AgentActivityRuntimePromptContentBlock =\n AgentActivitySendInput[\"content\"][number] & {\n assetId?: string;\n hostPath?: string;\n kind?: string;\n path?: string;\n sizeBytes?: number;\n uploadStatus?: string;\n uri?: string;\n };\n\nexport interface AgentActivityRuntimeUploadPromptContentInput {\n content: AgentActivityRuntimePromptContentBlock[];\n workspaceId: string;\n}\n\nexport interface AgentActivityRuntimeUploadPromptContentResult {\n content: AgentActivityRuntimePromptContentBlock[];\n}\n\nexport interface AgentActivityRuntimeSessionAttachment {\n attachmentId: string;\n mimeType: string;\n name?: string;\n data: string;\n}\n\nexport interface AgentActivityRuntimePromptAsset {\n assetId?: string;\n hostPath?: string;\n kind?: string;\n mimeType: string;\n name?: string;\n path: string;\n uploadStatus?: string;\n uri?: string;\n data: string;\n}\n\nexport interface AgentActivityRuntime {\n /**\n * Stable identity of this runtime instance (e.g. a local origin vs a\n * shared/room origin). When present, the conversation-list and session-view\n * stores key their query state, runtime resolution, and subscriptions by this\n * value, so multiple runtimes can coexist for the same workspace without\n * fighting over a single module-global slot. Absent => legacy single-runtime\n * behaviour resolved via the module-global.\n */\n origin?: string;\n /**\n * The session cwd is not resolvable on the local filesystem (e.g. a\n * shared/cloud sandbox not mounted locally), so AgentGUI must not run its\n * local stat-based \"working directory missing\" existence check — it would\n * always false-positive. Absent/false (default) => local, legacy behaviour.\n * Only that one guard is gated; project selection/listing is unaffected.\n */\n projectPathIsRemote?: boolean;\n promptContentUploadSupport?: {\n file?: boolean;\n image?: boolean;\n };\n cancelSession(\n input: AgentActivityCancelSessionInput\n ): Promise<AgentActivityCancelSessionResult>;\n goalControl(\n input: AgentActivityGoalControlInput\n ): Promise<AgentActivityGoalControlResult>;\n createSession(\n input: AgentActivityCreateSessionInput\n ): Promise<AgentActivitySession>;\n deleteSession(\n input: AgentActivityDeleteSessionInput\n ): Promise<AgentActivityDeleteSessionResult>;\n activateSession(\n input: AgentActivityRuntimeActivateSessionInput\n ): Promise<AgentHostActivateAgentSessionResult>;\n getSession(\n workspaceId: string,\n agentSessionId: string\n ): Promise<AgentActivitySession>;\n getComposerOptions(\n input: AgentActivityRuntimeGetComposerOptionsInput\n ): Promise<unknown>;\n updateSessionSettings(\n input: AgentActivityRuntimeUpdateSessionSettingsInput\n ): Promise<AgentHostUpdateAgentSessionSettingsResult>;\n warmupOpenclawGateway?(\n input?: AgentActivityRuntimeWarmupOpenclawGatewayInput\n ): Promise<AgentHostRuntimeOpenclawGatewayWarmupResult>;\n getSessionControlState(\n input: AgentActivityRuntimeGetSessionControlStateInput\n ): Promise<AgentHostAgentSessionState>;\n getSnapshot(workspaceId: string): AgentActivitySnapshot;\n listSessionMessages(\n input: AgentActivityRuntimeListSessionMessagesInput\n ): Promise<AgentActivityMessagePage>;\n listAgentGeneratedFiles?(\n input: AgentActivityRuntimeListGeneratedFilesInput\n ): Promise<AgentActivityRuntimeGeneratedFileList>;\n listSessionsPage?(\n input: AgentActivityRuntimeListSessionsPageInput\n ): Promise<AgentActivityRuntimeSessionPageResult>;\n listSessionSections?(\n input: AgentActivityRuntimeListSessionSectionsInput\n ): Promise<AgentActivityRuntimeSessionSectionsResult>;\n listSessionSectionPage?(\n input: AgentActivityRuntimeListSessionSectionPageInput\n ): Promise<AgentActivityRuntimeSessionSection>;\n load(\n workspaceId: string,\n signal?: AbortSignal\n ): Promise<AgentActivitySnapshot>;\n ensureSessionSynchronized?(\n input: AgentActivityRuntimeEnsureSessionSynchronizedInput\n ): () => void;\n /** @deprecated Use ensureSessionSynchronized. */\n retainSessionEvents(\n input: AgentActivityRuntimeRetainSessionEventsInput\n ): () => void;\n sendInput(\n input: AgentActivitySendInput\n ): Promise<AgentActivitySendInputResult>;\n uploadPromptContent?(\n input: AgentActivityRuntimeUploadPromptContentInput\n ): Promise<AgentActivityRuntimeUploadPromptContentResult>;\n readSessionAttachment?(\n input: AgentActivityRuntimeReadSessionAttachmentInput\n ): Promise<AgentActivityRuntimeSessionAttachment>;\n readPromptAsset?(\n input: AgentActivityRuntimeReadPromptAssetInput\n ): Promise<AgentActivityRuntimePromptAsset>;\n setSessionPinned(\n input: AgentActivityRuntimeSetSessionPinnedInput\n ): Promise<AgentActivitySession>;\n trackSettingsProjectChange?(\n input: AgentActivityRuntimeTrackSettingsProjectChangeInput\n ): Promise<void>;\n trackDraftComposerSettingsChange?(\n input: AgentActivityRuntimeTrackDraftComposerSettingsChangeInput\n ): Promise<void>;\n reportDiagnostic?(\n input: AgentActivityRuntimeDiagnosticInput\n ): Promise<void> | void;\n unactivateSession(\n input: AgentActivityRuntimeUnactivateSessionInput\n ): Promise<AgentHostUnactivateAgentSessionResult>;\n submitInteractive(\n input: AgentActivitySubmitInteractiveInput\n ): Promise<unknown>;\n subscribeSessionEvents(\n workspaceId: string,\n listener: (event: unknown) => void\n ): () => void;\n subscribe(\n workspaceId: string,\n listener: AgentActivitySnapshotListener\n ): () => void;\n}\n\nconst AgentActivityRuntimeContext = createContext<AgentActivityRuntime | null>(\n null\n);\n\nlet currentAgentActivityRuntime: AgentActivityRuntime | null = null;\n\n// Registry of runtimes indexed by their stable `origin`. Non-React module\n// singletons (the conversation-list and session-view stores) resolve the\n// correct runtime for a query's origin from here instead of reading the\n// last-mounted module-global — the single slot two runtimes used to fight over.\nconst runtimesByOrigin = new Map<string, AgentActivityRuntime>();\n\n// A runtime without an explicit origin is the default (local) runtime. It\n// registers under this canonical origin — the same value the conversation-list\n// query and session-view refs fall back to — so the local window resolves to it\n// by origin instead of depending on the last-mounted module-global. A shared/\n// room runtime opts in by setting a distinct `origin`; no host wiring needed for\n// the local case.\nfunction normalizeRuntimeOrigin(origin: string | null | undefined): string {\n return origin?.trim() || WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN;\n}\n\nexport interface AgentActivityRuntimeProviderProps extends PropsWithChildren {\n runtime?: AgentActivityRuntime | null;\n}\n\nexport function AgentActivityRuntimeProvider({\n children,\n runtime\n}: AgentActivityRuntimeProviderProps): JSX.Element {\n currentAgentActivityRuntime = runtime ?? null;\n const origin = normalizeRuntimeOrigin(runtime?.origin);\n // Register during render to close the gap before the effect runs (parity with\n // the module-global write above); the effect owns cleanup on unmount.\n if (origin && runtime) {\n runtimesByOrigin.set(origin, runtime);\n }\n useEffect(() => {\n if (!origin || !runtime) {\n return;\n }\n runtimesByOrigin.set(origin, runtime);\n return () => {\n // Only clear if a newer provider hasn't already re-registered this origin.\n if (runtimesByOrigin.get(origin) === runtime) {\n runtimesByOrigin.delete(origin);\n }\n };\n }, [origin, runtime]);\n return (\n <AgentActivityRuntimeContext.Provider value={runtime ?? null}>\n {children}\n </AgentActivityRuntimeContext.Provider>\n );\n}\n\nexport function useAgentActivityRuntime(): AgentActivityRuntime {\n const runtime =\n useContext(AgentActivityRuntimeContext) ?? getTestAgentActivityRuntime();\n if (!runtime) {\n throw new Error(\n \"AgentActivityRuntimeProvider is missing an AgentActivityRuntime instance.\"\n );\n }\n return runtime;\n}\n\nexport function useOptionalAgentActivityRuntime(): AgentActivityRuntime | null {\n return (\n useContext(AgentActivityRuntimeContext) ?? getTestAgentActivityRuntime()\n );\n}\n\nexport function useAgentActivitySnapshot(\n workspaceId: string\n): AgentActivitySnapshot {\n const runtime = useAgentActivityRuntime();\n const normalizedWorkspaceId = workspaceId.trim();\n return useSyncExternalStore(\n (listener) => runtime.subscribe(normalizedWorkspaceId, listener),\n () => runtime.getSnapshot(normalizedWorkspaceId),\n () => runtime.getSnapshot(normalizedWorkspaceId)\n );\n}\n\nexport function getAgentActivityRuntime(): AgentActivityRuntime {\n const runtime =\n getExplicitWindowTestAgentActivityRuntime() ??\n currentAgentActivityRuntime ??\n getTestAgentActivityRuntime();\n if (!runtime) {\n throw new Error(\n \"AgentActivityRuntimeProvider is missing an AgentActivityRuntime instance.\"\n );\n }\n return runtime;\n}\n\nexport function getOptionalAgentActivityRuntime(): AgentActivityRuntime | null {\n return (\n getExplicitWindowTestAgentActivityRuntime() ??\n currentAgentActivityRuntime ??\n getTestAgentActivityRuntime()\n );\n}\n\n/**\n * Resolve the runtime for a given origin. When the origin is registered (two\n * runtimes coexisting for one workspace), returns that exact instance.\n *\n * Only the default (local) origin falls back to legacy single-runtime\n * resolution. An explicit non-default origin that is not registered returns null\n * rather than cross-routing to a different runtime via the module-global slot —\n * e.g. a shared query must never silently load from the local runtime.\n */\nexport function getAgentActivityRuntimeByOrigin(\n origin: string | null | undefined\n): AgentActivityRuntime | null {\n const normalizedOrigin = normalizeRuntimeOrigin(origin);\n const runtime = runtimesByOrigin.get(normalizedOrigin);\n if (runtime) {\n return runtime;\n }\n if (normalizedOrigin === WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN) {\n return getOptionalAgentActivityRuntime();\n }\n return null;\n}\n\nexport function resetAgentActivityRuntimeForTests(): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentActivityRuntime = null;\n runtimesByOrigin.clear();\n }\n}\n\nexport function setAgentActivityRuntimeForTests(\n runtime: AgentActivityRuntime | null\n): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentActivityRuntime = runtime;\n }\n}\n\nfunction getTestAgentActivityRuntime(): AgentActivityRuntime | null {\n if (process.env.NODE_ENV !== \"test\") {\n return null;\n }\n if (typeof window === \"undefined\") {\n return null;\n }\n const explicitRuntime = getExplicitWindowTestAgentActivityRuntime();\n if (explicitRuntime) {\n return explicitRuntime;\n }\n if (currentAgentActivityRuntime) {\n return currentAgentActivityRuntime;\n }\n const testRuntime = (\n window as unknown as Window & {\n agentActivityRuntime?: AgentActivityRuntime;\n }\n ).agentActivityRuntime;\n return testRuntime ?? null;\n}\n\nfunction getExplicitWindowTestAgentActivityRuntime(): AgentActivityRuntime | null {\n if (process.env.NODE_ENV !== \"test\" || typeof window === \"undefined\") {\n return null;\n }\n const testDescriptor = Object.getOwnPropertyDescriptor(\n window,\n \"agentActivityRuntime\"\n );\n if (!testDescriptor || !(\"value\" in testDescriptor)) {\n return null;\n }\n return (testDescriptor.value as AgentActivityRuntime | undefined) ?? null;\n}\n","import {\n createContext,\n useContext,\n useEffect,\n useMemo,\n type JSX,\n type PropsWithChildren\n} from \"react\";\nimport {\n toAgentHostRuntimeApi,\n type AgentHostInputApi,\n type AgentHostRuntimeApi\n} from \"./host/agentHostApi\";\nimport {\n AgentActivityRuntimeProvider,\n type AgentActivityRuntime\n} from \"./agentActivityRuntime\";\nimport { WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN } from \"./shared/workspaceAgentActivityTypes\";\n\nconst AgentActivityHostContext = createContext<AgentHostRuntimeApi | null>(\n null\n);\n\nlet currentAgentHostApi: AgentHostRuntimeApi | null = null;\n\n// Host APIs indexed by their runtime origin, mirroring the runtime registry.\n// Read-state persistence resolves the host API by the query's origin so a\n// local window persists to the local host and a shared/cloud window persists to\n// its own cloud host — each backend keyed by (roomId, userId) with no origin\n// needed on the record itself.\nconst hostApiByOrigin = new Map<string, AgentHostRuntimeApi>();\n\nfunction resolveHostOrigin(\n runtime: AgentActivityRuntime | null | undefined\n): string {\n return (\n runtime?.origin?.trim() || WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN\n );\n}\n\nexport interface AgentActivityHostProviderProps extends PropsWithChildren {\n agentActivityRuntime?: AgentActivityRuntime | null;\n agentHostApi?: AgentHostInputApi | null;\n}\n\nexport function AgentActivityHostProvider({\n agentActivityRuntime,\n agentHostApi,\n children\n}: AgentActivityHostProviderProps): JSX.Element {\n const resolvedAgentHostApi = useMemo(\n () => (agentHostApi ? toAgentHostRuntimeApi(agentHostApi) : null),\n [agentHostApi]\n );\n currentAgentHostApi = resolvedAgentHostApi;\n const origin = resolveHostOrigin(agentActivityRuntime);\n // Register during render to close the gap before the effect runs; the effect\n // owns cleanup on unmount.\n if (resolvedAgentHostApi) {\n hostApiByOrigin.set(origin, resolvedAgentHostApi);\n }\n useEffect(() => {\n if (!resolvedAgentHostApi) {\n return;\n }\n hostApiByOrigin.set(origin, resolvedAgentHostApi);\n return () => {\n if (hostApiByOrigin.get(origin) === resolvedAgentHostApi) {\n hostApiByOrigin.delete(origin);\n }\n };\n }, [origin, resolvedAgentHostApi]);\n return (\n <AgentActivityRuntimeProvider runtime={agentActivityRuntime}>\n <AgentActivityHostContext.Provider value={resolvedAgentHostApi}>\n {children}\n </AgentActivityHostContext.Provider>\n </AgentActivityRuntimeProvider>\n );\n}\n\nexport function useAgentHostApi(): AgentHostRuntimeApi {\n const agentHostApi =\n useContext(AgentActivityHostContext) ?? getTestAgentHostApi();\n if (!agentHostApi) {\n throw new Error(\n \"AgentActivityHostProvider is missing an agentHostApi instance.\"\n );\n }\n return agentHostApi;\n}\n\nexport function useOptionalAgentHostApi(): AgentHostRuntimeApi | null {\n return useContext(AgentActivityHostContext) ?? getTestAgentHostApi();\n}\n\nexport function getOptionalAgentHostApi(): AgentHostRuntimeApi | null {\n return (\n getExplicitWindowTestAgentHostApi() ??\n currentAgentHostApi ??\n getTestAgentHostApi()\n );\n}\n\n/**\n * Resolve the host API for a given runtime origin. When the origin is registered\n * (local vs shared/cloud host), returns that exact host API so its persistence\n * (read-state, etc.) targets the matching backend; otherwise falls back to\n * legacy single-host resolution.\n */\nexport function getAgentHostApiByOrigin(\n origin: string | null | undefined\n): AgentHostRuntimeApi | null {\n const normalizedOrigin =\n origin?.trim() || WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN;\n const hostApi = hostApiByOrigin.get(normalizedOrigin);\n if (hostApi) {\n return hostApi;\n }\n // Only the default (local) origin falls back to the legacy single-host slot.\n // An explicit non-default origin that is not registered returns null so its\n // persistence never lands in a different host's store (e.g. shared read-state\n // must not be written to the local backend).\n if (normalizedOrigin === WORKSPACE_AGENT_ACTIVITY_RUNTIME_SESSION_ORIGIN) {\n return getOptionalAgentHostApi();\n }\n return null;\n}\n\nexport function resetAgentHostApiForTests(): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentHostApi = null;\n hostApiByOrigin.clear();\n }\n}\n\nexport function setAgentHostApiForTests(\n agentHostApi: AgentHostInputApi | AgentHostRuntimeApi | null\n): void {\n if (process.env.NODE_ENV === \"test\") {\n currentAgentHostApi = agentHostApi\n ? toAgentHostRuntimeApi(agentHostApi)\n : null;\n }\n}\n\nfunction getTestAgentHostApi(): AgentHostRuntimeApi | null {\n if (process.env.NODE_ENV !== \"test\") {\n return null;\n }\n if (typeof window === \"undefined\") {\n return null;\n }\n const explicitAgentHostApi = getExplicitWindowTestAgentHostApi();\n if (explicitAgentHostApi) {\n return explicitAgentHostApi;\n }\n if (currentAgentHostApi) {\n return currentAgentHostApi;\n }\n const testAgentHostApi = (\n window as unknown as Window & {\n agentHostApi?: AgentHostInputApi | AgentHostRuntimeApi;\n }\n ).agentHostApi;\n return testAgentHostApi ? toAgentHostRuntimeApi(testAgentHostApi) : null;\n}\n\nfunction getExplicitWindowTestAgentHostApi(): AgentHostRuntimeApi | null {\n if (process.env.NODE_ENV !== \"test\" || typeof window === \"undefined\") {\n return null;\n }\n const testDescriptor = Object.getOwnPropertyDescriptor(\n window,\n \"agentHostApi\"\n );\n if (!testDescriptor || !(\"value\" in testDescriptor)) {\n return null;\n }\n const testAgentHostApi = testDescriptor.value as\n | AgentHostInputApi\n | AgentHostRuntimeApi\n | undefined;\n return testAgentHostApi ? toAgentHostRuntimeApi(testAgentHostApi) : null;\n}\n","import type {\n AgentHostBatchUserInfoInput,\n AgentHostBatchUserInfoResult,\n AgentHostDeleteWorkspaceAgentSessionInput,\n AgentHostWorkspaceAgentListInput as AgentHostListWorkspaceAgentsInput,\n AgentHostListWorkspaceAgentProbesInput,\n AgentHostWorkspaceAgentSessionMessages,\n AgentHostWorkspaceAgentSessionMessagesInput,\n AgentHostWorkspaceAgentSessionSummary,\n AgentHostWorkspaceAgentSessionSummaryInput,\n AgentHostWorkspaceAgentProbesResult,\n AgentHostWorkspaceAgentSnapshot,\n PersistWriteResult,\n ReadWorkspaceAgentReadStateInput,\n ReadWorkspaceFileResult as AgentHostReadWorkspaceFileResult,\n WorkspaceAgentReadStateSnapshot,\n WriteWorkspaceAgentReadStateInput\n} from \"../shared/contracts/dto\";\nimport type { WorkspaceUserProjectService } from \"@tutti-os/workspace-user-project/contracts\";\n\ntype AgentHostAsyncResult<T = any> = Promise<T>;\ntype AgentHostRecord = Record<string, unknown>;\ntype AgentHostUnsubscribe = () => void;\ntype AgentHostWorkspaceScopedInput<\n T extends {\n workspaceId?: string | null;\n }\n> = Omit<T, \"workspaceId\"> & {\n workspaceId: string;\n};\ntype AgentHostWorkspaceAgentsListInput =\n AgentHostWorkspaceScopedInput<AgentHostListWorkspaceAgentsInput>;\ntype AgentHostWorkspaceAgentSessionMessagesRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostWorkspaceAgentSessionMessagesInput>;\ntype AgentHostWorkspaceAgentSessionSummaryRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostWorkspaceAgentSessionSummaryInput>;\ntype AgentHostDeleteWorkspaceAgentSessionRuntimeInput =\n AgentHostWorkspaceScopedInput<AgentHostDeleteWorkspaceAgentSessionInput>;\n\nexport type AgentHostClipboardApi = {\n writeImage?: (input: {\n data: string;\n mimeType: \"image/png\";\n }) => AgentHostAsyncResult<void>;\n writeText: (text: string) => AgentHostAsyncResult<void>;\n};\n\nexport type AgentHostDebugApi = {\n logRuntimeDiagnostics: (\n payload: unknown\n ) => AgentHostAsyncResult<void> | void;\n logTerminalDiagnostics?: (\n payload: unknown\n ) => AgentHostAsyncResult<void> | void;\n};\n\nexport type AgentHostFilesystemApi = AgentHostRecord & {\n readFileText: (payload: {\n path?: string;\n uri?: string;\n }) => AgentHostAsyncResult<{\n content: string;\n name?: string;\n path?: string;\n }>;\n};\n\nexport type AgentHostMetaApi = AgentHostRecord & {\n appVersion?: string | null;\n isPackaged?: boolean;\n isTest?: boolean;\n mainPid?: number | null;\n platform?: string;\n workspaceId?: string;\n};\n\nexport type AgentHostEnvironmentApi = AgentHostRecord & {\n getBaseUrl?: () => AgentHostAsyncResult<string>;\n warmupOpenclawGateway?: (input?: unknown) => AgentHostAsyncResult<unknown>;\n};\n\nexport type AgentHostPersistenceApi = AgentHostRecord & {\n readWorkspaceAgentReadState: (\n input: ReadWorkspaceAgentReadStateInput\n ) => AgentHostAsyncResult<WorkspaceAgentReadStateSnapshot>;\n writeWorkspaceAgentReadState: (\n input: WriteWorkspaceAgentReadStateInput\n ) => AgentHostAsyncResult<PersistWriteResult>;\n};\n\nexport type AgentHostToastApi = AgentHostRecord & {\n error: (title: string, description?: string) => void;\n info?: (title: string, description?: string) => void;\n success?: (title: string, description?: string) => void;\n};\n\nexport interface AgentHostSelectedFile {\n name?: string;\n path: string;\n}\n\nexport interface AgentHostSelectFilesInput {\n allowDirectories?: boolean;\n}\n\nexport interface AgentHostApplyWorkspaceGitPatchInput {\n allowBinary?: boolean;\n atomic?: boolean;\n cwd: string;\n diff: string;\n revert?: boolean;\n target?: \"unstaged\" | \"staged\" | \"staged-and-unstaged\";\n}\n\nexport interface AgentHostApplyWorkspaceGitPatchResult {\n status: \"success\" | \"partial-success\" | \"error\";\n appliedPaths: string[];\n skippedPaths: string[];\n conflictedPaths: string[];\n errorCode?: \"not-git-repo\" | string;\n execOutput?: {\n command: string;\n stdout: string;\n stderr: string;\n };\n}\n\nexport interface AgentHostResolveWorkspaceGitPatchSupportInput {\n cwd: string;\n}\n\nexport interface AgentHostResolveWorkspaceGitPatchSupportResult {\n supported: boolean;\n root?: string;\n errorCode?: \"not-git-repo\" | string;\n}\n\nexport type AgentHostWorkspaceApi = AgentHostRecord & {\n applyGitPatch?: (\n input: AgentHostApplyWorkspaceGitPatchInput\n ) => AgentHostAsyncResult<AgentHostApplyWorkspaceGitPatchResult>;\n resolveGitPatchSupport?: (\n input: AgentHostResolveWorkspaceGitPatchSupportInput\n ) => AgentHostAsyncResult<AgentHostResolveWorkspaceGitPatchSupportResult>;\n copyPath?: (input: { path: string }) => AgentHostAsyncResult<void>;\n ensureDirectory: (input: { path: string }) => AgentHostAsyncResult<void>;\n getReferenceForFile?: (file: File) => {\n kind: \"file\" | \"folder\";\n path: string;\n };\n readFile: (input: {\n path: string;\n }) => AgentHostAsyncResult<AgentHostReadWorkspaceFileResult>;\n selectContextEntries?: () => AgentHostAsyncResult<{ entries: unknown[] }>;\n selectDirectory: () => AgentHostAsyncResult<{ path: string } | null>;\n selectFiles: (\n input?: AgentHostSelectFilesInput\n ) => AgentHostAsyncResult<AgentHostSelectedFile[]>;\n writeFileText: (input: {\n content: string;\n path: string;\n }) => AgentHostAsyncResult<unknown>;\n};\n\nexport interface AgentHostInputApi {\n account?: AgentHostAccountApi;\n agentGuiBatch?: AgentHostAgentGuiBatchApi;\n agentSessions?: AgentHostAgentSessionsApi;\n clipboard: AgentHostClipboardApi;\n debug?: AgentHostDebugApi;\n filesystem: AgentHostFilesystemApi;\n meta?: AgentHostMetaApi;\n onHostEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n persistence?: AgentHostPersistenceApi;\n runtime?: AgentHostEnvironmentApi;\n toast?: AgentHostToastApi;\n userProjects?: AgentHostUserProjectsApi;\n workspace: AgentHostWorkspaceApi;\n workspaceAgentProbes?: AgentHostWorkspaceAgentProbesApi;\n workspaceAgents?: AgentHostWorkspaceAgentsApi;\n}\n\nexport type AgentHostApi = AgentHostInputApi;\n\nexport type AgentHostAccountApi = AgentHostRecord & {\n batchGetUserInfo: (\n input: AgentHostBatchUserInfoInput\n ) => AgentHostAsyncResult<AgentHostBatchUserInfoResult>;\n ensureProfiles?: (input: any) => AgentHostAsyncResult<any>;\n};\n\nexport type AgentHostAgentGuiBatchApi = AgentHostRecord & {\n exportRun: (input: any) => AgentHostAsyncResult<any>;\n};\n\nexport type AgentHostWorkspaceAgentProbesApi = AgentHostRecord & {\n list: (\n input: AgentHostListWorkspaceAgentProbesInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentProbesResult>;\n};\n\nexport type AgentProviderProbeListInput =\n AgentHostListWorkspaceAgentProbesInput;\nexport type AgentProviderProbeListResult = AgentHostWorkspaceAgentProbesResult;\n\nexport interface AgentHostUserProject {\n id: string;\n path: string;\n label: string;\n createdAtUnixMs?: number;\n updatedAtUnixMs?: number;\n lastUsedAtUnixMs?: number;\n}\n\nexport type AgentHostUserProjectsApi = AgentHostRecord & {\n service?: WorkspaceUserProjectService;\n checkPath?: (input: { path: string }) => AgentHostAsyncResult<{\n exists: boolean;\n isDirectory: boolean;\n path: string;\n }>;\n create?: (input: {\n name: string;\n }) => AgentHostAsyncResult<AgentHostUserProject>;\n getDefaultSelection?: () => AgentHostAsyncResult<{\n path: string | null;\n } | null>;\n list: () => AgentHostAsyncResult<{\n projects: AgentHostUserProject[];\n }>;\n subscribe?: (listener: () => void) => AgentHostUnsubscribe;\n prepareSelection?: (input: {\n projectLocked: boolean;\n selectedPath: string | null;\n }) => AgentHostAsyncResult<{\n isSelectedPathMissing: boolean;\n projects: AgentHostUserProject[];\n selection:\n | {\n kind: \"clear\";\n suppressedPath: string;\n }\n | {\n kind: \"none\";\n }\n | {\n kind: \"select\";\n path: string;\n };\n }>;\n remove?: (input: { path: string }) => AgentHostAsyncResult<void>;\n isNoProjectPath?: (input: { path: string }) => boolean;\n rememberDefaultSelection?: (input: {\n path: string | null;\n }) => AgentHostAsyncResult<void>;\n use: (input: { path: string }) => AgentHostAsyncResult<AgentHostUserProject>;\n};\n\nexport type AgentHostAgentSessionsApi = AgentHostRecord & {\n activate: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.cancelSession.\n */\n cancel: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.sendInput.\n */\n exec: (input: any) => AgentHostAsyncResult<any>;\n getComposerOptions?: (input: any) => AgentHostAsyncResult<any>;\n getState: (input: any) => AgentHostAsyncResult<any>;\n onEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.setSessionPinned.\n */\n pinSession?: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production sync must use AgentActivityRuntime.ensureSessionSynchronized.\n */\n releaseEventStream?: (input?: any) => AgentHostAsyncResult;\n /**\n * @deprecated AgentGUI production sync must use AgentActivityRuntime.ensureSessionSynchronized.\n */\n retainEventStream?: (input: any) => AgentHostAsyncResult;\n /**\n * @deprecated AgentGUI production writes must use AgentActivityRuntime.submitInteractive.\n */\n submitInteractive: (input: any) => AgentHostAsyncResult<any>;\n /**\n * @deprecated AgentGUI production UI must derive events from AgentActivityRuntime snapshots.\n */\n trackSettingsProjectChange?: (input: {\n action: \"clear\" | \"create_new\" | \"select_existing\";\n agentSessionId: string;\n provider?: string | null;\n }) => AgentHostAsyncResult<void>;\n subscribeEvents: (\n input: any,\n listener: (event: any) => void\n ) => AgentHostUnsubscribe;\n unactivate: (input: any) => AgentHostAsyncResult<any>;\n updateSettings: (input: any) => AgentHostAsyncResult<any>;\n};\n\n/**\n * @deprecated Legacy host DTO projection. AgentGUI production reads and writes\n * must use AgentActivityRuntime and AgentActivity* models.\n */\nexport type AgentHostWorkspaceAgentsApi = AgentHostRecord & {\n /**\n * @deprecated Use AgentActivityRuntime.deleteSession.\n */\n deleteSession: (\n input: AgentHostDeleteWorkspaceAgentSessionRuntimeInput\n ) => AgentHostAsyncResult<any>;\n /**\n * @deprecated Derive summaries from AgentActivitySnapshot/session messages.\n */\n getSessionSummary: (\n input: AgentHostWorkspaceAgentSessionSummaryRuntimeInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSessionSummary>;\n /**\n * @deprecated Use AgentActivityRuntime.load/getSnapshot.\n */\n list: (\n input: string | AgentHostWorkspaceAgentsListInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSnapshot>;\n /**\n * @deprecated Use AgentActivityRuntime.listSessionMessages.\n */\n listSessionMessages: (\n input: AgentHostWorkspaceAgentSessionMessagesRuntimeInput\n ) => AgentHostAsyncResult<AgentHostWorkspaceAgentSessionMessages>;\n};\n\nexport interface AgentHostRuntimeApi {\n account?: AgentHostAccountApi;\n agentGuiBatch: AgentHostAgentGuiBatchApi;\n clipboard: AgentHostClipboardApi;\n debug?: AgentHostDebugApi;\n filesystem: AgentHostFilesystemApi;\n meta?: AgentHostMetaApi;\n onHostEvent?: (listener: (event: any) => void) => AgentHostUnsubscribe;\n persistence?: AgentHostPersistenceApi;\n runtime?: AgentHostEnvironmentApi;\n toast?: AgentHostToastApi;\n userProjects?: AgentHostUserProjectsApi;\n workspace: AgentHostWorkspaceApi;\n workspaceAgentProbes?: AgentHostWorkspaceAgentProbesApi;\n}\n\nexport function toAgentHostRuntimeApi(\n hostApi: AgentHostInputApi | AgentHostRuntimeApi\n): AgentHostRuntimeApi {\n return {\n account: hostApi.account,\n agentGuiBatch: hostApi.agentGuiBatch ?? ({} as AgentHostAgentGuiBatchApi),\n clipboard: hostApi.clipboard,\n debug: hostApi.debug,\n filesystem: hostApi.filesystem,\n meta: hostApi.meta,\n onHostEvent: hostApi.onHostEvent,\n persistence: hostApi.persistence,\n runtime: hostApi.runtime,\n toast: hostApi.toast,\n userProjects: hostApi.userProjects,\n workspace: hostApi.workspace,\n workspaceAgentProbes: hostApi.workspaceAgentProbes\n };\n}\n","import { normalizeManagedAgentProvider } from \"./managedAgentProviders\";\nimport {\n claudeRoundedUrl,\n codexRoundedUrl,\n cursorColorfulUrl,\n cursorRoundedUrl,\n geminiRoundedUrl,\n hermesRoundedUrl,\n manageAgentClaudeCodeUrl,\n manageAgentCodexUrl,\n manageAgentGeminiUrl,\n manageAgentHermesUrl,\n manageAgentOpenCodeUrl,\n manageAgentTuttiUrl,\n manageAgentOpenclawUrl,\n providerRailClaudeCodeColorfulUrl,\n providerRailCodexColorfulUrl,\n providerRailHermesColorfulUrl,\n providerRailOpenCodeColorfulUrl,\n providerRailTuttiUrl,\n tuttiDocRoundedUrl,\n opencodeRoundedUrl,\n openclawRoundedUrl\n} from \"../managedAgentIconAssets\";\n\n/** Square avatar art for the managed toolchain agents (used by Manage Agents and Launch home Agents floor). */\nexport const MANAGED_AGENT_ICON_URLS: Record<string, string> = {\n \"claude-code\": manageAgentClaudeCodeUrl,\n codex: manageAgentCodexUrl,\n cursor: cursorRoundedUrl,\n gemini: manageAgentGeminiUrl,\n hermes: manageAgentHermesUrl,\n tutti: manageAgentTuttiUrl,\n openclaw: manageAgentOpenclawUrl,\n opencode: manageAgentOpenCodeUrl\n};\n\n/** Colorful provider rail icons used by AgentGUI's left provider filter. */\nexport const MANAGED_AGENT_PROVIDER_RAIL_ICON_URLS: Record<string, string> = {\n \"claude-code\": providerRailClaudeCodeColorfulUrl,\n codex: providerRailCodexColorfulUrl,\n cursor: cursorColorfulUrl,\n hermes: providerRailHermesColorfulUrl,\n tutti: providerRailTuttiUrl,\n opencode: providerRailOpenCodeColorfulUrl\n};\n\n/** Rounded avatars for Room status / room activity panel only. */\nexport const MANAGED_AGENT_ICON_ROUNDED_URLS: Record<string, string> = {\n \"claude-code\": claudeRoundedUrl,\n codex: codexRoundedUrl,\n cursor: cursorColorfulUrl,\n gemini: geminiRoundedUrl,\n hermes: hermesRoundedUrl,\n tutti: tuttiDocRoundedUrl,\n openclaw: openclawRoundedUrl,\n opencode: opencodeRoundedUrl\n};\n\n/** 与 Manage Agents 列表用的方图区分;房间预览弹幕条等仅用圆图 */\nconst MANAGED_AGENT_ROUNDED_ICON_FALLBACK_URL = tuttiDocRoundedUrl;\n\nexport const MANAGED_AGENT_ICON_FALLBACK_URL = manageAgentTuttiUrl;\n\nexport function managedAgentRoundedIconUrl(\n provider: string | undefined\n): string {\n return (\n MANAGED_AGENT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AM,kCAAkC;AAExC,SAAS,2BACd,UACQ;AACR,SACE,gCAAgC,8BAA8B,QAAQ,CAAC,KACvE;AAEJ;","names":["createContext","useContext","useEffect","jsx","createContext","useEffect","useContext"]}
|
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
AgentMentionSearchController,
|
|
5
5
|
flattenAgentMentionPaletteEntries,
|
|
6
6
|
groupStartKeys
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-QGKK6FHC.js";
|
|
8
|
+
import "../chunk-GXHZNIWT.js";
|
|
9
|
+
import "../chunk-A2KZVRUO.js";
|
|
10
10
|
import "../chunk-IBIMGLCD.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-C2M2ELXF.js";
|
|
12
12
|
import "../chunk-Y35GDLP2.js";
|
|
13
13
|
import "../chunk-LUGELG5V.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-ZZBLWZJR.js";
|
|
15
|
+
import "../chunk-4US2YHBY.js";
|
|
16
|
+
import "../chunk-AIR6A4NP.js";
|
|
17
17
|
import "../chunk-PJP5BUU6.js";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-4I2VCAMW.js";
|
|
19
|
+
import "../chunk-3QPN2Y7R.js";
|
|
20
20
|
import {
|
|
21
21
|
AGENT_CONTEXT_MENTION_PROVIDER_IDS
|
|
22
22
|
} from "../chunk-JM24HADP.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M11.6938 1.10116C11.8436 1.07739 12.2047 1.20319 12.3256 1.27792C13.6093 2.07185 20.4975 5.75063 21.2211 6.50644C21.4804 7.31389 21.5087 16.4896 21.2211 17.3853C21.1677 17.5512 21.0501 17.6349 20.9145 17.732C19.9505 18.4215 18.8218 18.9741 17.7914 19.568C15.9244 20.6441 14.0655 21.7399 12.182 22.7867C12.0256 22.8329 11.8387 22.8879 11.6752 22.8844C11.2559 22.8754 2.71449 17.9184 2.24259 17.4273C2.22213 16.8742 2.2107 16.3135 2.21818 15.7603C2.25977 12.6902 2.14029 9.57721 2.24161 6.51132C2.69694 6.095 5.27095 4.64421 6.00528 4.23593C7.77292 3.25319 9.70198 2.02797 11.4799 1.108C11.5237 1.1053 11.6696 1.10474 11.6938 1.10116ZM8.39298 6.82577C7.44715 6.82998 3.72595 6.75303 3.08341 6.87167C3.377 7.20472 4.6331 7.88441 5.07657 8.13925L9.35196 10.5934C9.98708 10.9578 11.1863 11.6042 11.7455 12.0318L11.7436 18.5055C11.7436 19.6583 11.7074 21.0779 11.7729 22.2096C12.851 20.5502 14.0633 18.3 15.0707 16.5514L18.3627 10.8658C18.7576 10.1857 20.2944 7.64865 20.4311 7.06894C20.1775 6.80839 19.7582 6.81209 19.3949 6.81503C15.7403 6.84455 12.0423 6.80939 8.39298 6.82577Z" fill="black"/>
|
|
3
|
+
</svg>
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -342,9 +342,9 @@ declare const agentGuiI18nResources: {
|
|
|
342
342
|
readonly providerGateInstallTitle: "Install {{provider}} first";
|
|
343
343
|
readonly providerGateInstallDescription: "{{provider}} needs to be installed before you can start a new chat here.";
|
|
344
344
|
readonly providerGateInstallAction: "Install";
|
|
345
|
-
readonly providerGateLoginTitle: "
|
|
346
|
-
readonly providerGateLoginDescription: "
|
|
347
|
-
readonly providerGateLoginAction: "
|
|
345
|
+
readonly providerGateLoginTitle: "Log in to {{provider}}";
|
|
346
|
+
readonly providerGateLoginDescription: "Log in with your account to start chatting with {{provider}}.";
|
|
347
|
+
readonly providerGateLoginAction: "Log in";
|
|
348
348
|
readonly providerGateComingSoonTitle: "{{provider}} is coming soon";
|
|
349
349
|
readonly providerGateComingSoonDescription: "{{provider}} is not available yet. We will enable this agent when it is ready.";
|
|
350
350
|
readonly providerGateComingSoonAction: "coming soon";
|
|
@@ -514,6 +514,12 @@ declare const agentGuiI18nResources: {
|
|
|
514
514
|
readonly slashStatusContextValue: "{{percentLeft}}% left ({{usedTokens}} used / {{totalTokens}})";
|
|
515
515
|
readonly slashStatusContextUnavailable: "Context usage unavailable";
|
|
516
516
|
readonly slashStatusLimitsUnavailable: "Rate limits unavailable from this agent";
|
|
517
|
+
readonly slashStatusUsageJustUpdated: "Updated just now";
|
|
518
|
+
readonly slashStatusUsageMinutesAgo: "Updated {{count}}m ago";
|
|
519
|
+
readonly slashStatusUsageHoursAgo: "Updated {{count}}h ago";
|
|
520
|
+
readonly slashStatusUsageUpdating: "Updating…";
|
|
521
|
+
readonly slashStatusUsageRefreshFailed: "Refresh failed";
|
|
522
|
+
readonly slashStatusUsageRefreshAria: "Refresh usage";
|
|
517
523
|
readonly usageChipLabel: "Context {{percent}}%";
|
|
518
524
|
readonly usageTooltipLabel: "Context usage";
|
|
519
525
|
readonly usagePopoverTitle: "Context Usage";
|
|
@@ -584,6 +590,22 @@ declare const agentGuiI18nResources: {
|
|
|
584
590
|
readonly empty: "What can {{provider}} help you with?";
|
|
585
591
|
readonly conversations: "Sessions";
|
|
586
592
|
readonly newConversation: "New session";
|
|
593
|
+
readonly accountMenuTitle: "Tutti Agent";
|
|
594
|
+
readonly accountMenuMember: "Membership";
|
|
595
|
+
readonly accountMenuUpgrade: "Upgrade";
|
|
596
|
+
readonly accountMenuCreditsBalance: "Credits";
|
|
597
|
+
readonly accountMenuAccountCenter: "Account center";
|
|
598
|
+
readonly accountMenuSettings: "Settings";
|
|
599
|
+
readonly accountMenuFree: "Free";
|
|
600
|
+
readonly accountMenuSignIn: "Sign in";
|
|
601
|
+
readonly accountMenuSignOut: "Sign out";
|
|
602
|
+
readonly accountMenuLoading: "Loading";
|
|
603
|
+
readonly accountMenuUnavailable: "--";
|
|
604
|
+
readonly accountMenuDataUnavailable: "Some account data is unavailable";
|
|
605
|
+
readonly accountRewardToastTitle: "New user credits";
|
|
606
|
+
readonly accountRewardToastCreditsUnit: "credits";
|
|
607
|
+
readonly accountRewardToastDescription: "Added to account balance";
|
|
608
|
+
readonly accountRewardToastClose: "Close credits reward notification";
|
|
587
609
|
readonly agentConfig: "Check & Settings";
|
|
588
610
|
readonly agentSettingsMenu: "Settings";
|
|
589
611
|
readonly agentEnvSetup: "Environment Check";
|
|
@@ -608,6 +630,7 @@ declare const agentGuiI18nResources: {
|
|
|
608
630
|
readonly batchRunnerProviderHermes: "Hermes";
|
|
609
631
|
readonly batchRunnerProviderNexight: "Nexight";
|
|
610
632
|
readonly batchRunnerProviderOpenClaw: "OpenClaw";
|
|
633
|
+
readonly batchRunnerProviderTuttiAgent: "Tutti Agent";
|
|
611
634
|
readonly batchRunnerRun: "Run";
|
|
612
635
|
readonly batchRunnerRunning: "Running...";
|
|
613
636
|
readonly batchRunnerExport: "Export";
|
|
@@ -2857,9 +2880,9 @@ declare const agentGuiI18nResources: {
|
|
|
2857
2880
|
readonly providerGateInstallTitle: "先安装 {{provider}}";
|
|
2858
2881
|
readonly providerGateInstallDescription: "需要先安装 {{provider}},才能在这里开始新的对话。";
|
|
2859
2882
|
readonly providerGateInstallAction: "安装";
|
|
2860
|
-
readonly providerGateLoginTitle: "
|
|
2861
|
-
readonly providerGateLoginDescription: "{{provider}}
|
|
2862
|
-
readonly providerGateLoginAction: "
|
|
2883
|
+
readonly providerGateLoginTitle: "登录 {{provider}}";
|
|
2884
|
+
readonly providerGateLoginDescription: "使用账号登录后即可开始使用 {{provider}} 对话。";
|
|
2885
|
+
readonly providerGateLoginAction: "登录";
|
|
2863
2886
|
readonly providerGateComingSoonTitle: "{{provider}} 即将上线";
|
|
2864
2887
|
readonly providerGateComingSoonDescription: "{{provider}} 暂未开放。准备好后即可在这里使用这个 Agent。";
|
|
2865
2888
|
readonly providerGateComingSoonAction: "coming soon";
|
|
@@ -3029,6 +3052,12 @@ declare const agentGuiI18nResources: {
|
|
|
3029
3052
|
readonly slashStatusContextValue: "{{percentLeft}}% 剩余(已用 {{usedTokens}} / {{totalTokens}})";
|
|
3030
3053
|
readonly slashStatusContextUnavailable: "上下文用量不可用";
|
|
3031
3054
|
readonly slashStatusLimitsUnavailable: "当前 Agent 未提供额度限制";
|
|
3055
|
+
readonly slashStatusUsageJustUpdated: "刚刚更新";
|
|
3056
|
+
readonly slashStatusUsageMinutesAgo: "{{count}} 分钟前更新";
|
|
3057
|
+
readonly slashStatusUsageHoursAgo: "{{count}} 小时前更新";
|
|
3058
|
+
readonly slashStatusUsageUpdating: "更新中…";
|
|
3059
|
+
readonly slashStatusUsageRefreshFailed: "刷新失败";
|
|
3060
|
+
readonly slashStatusUsageRefreshAria: "刷新额度用量";
|
|
3032
3061
|
readonly usageChipLabel: "上下文 {{percent}}%";
|
|
3033
3062
|
readonly usageTooltipLabel: "上下文用量";
|
|
3034
3063
|
readonly usagePopoverTitle: "上下文用量";
|
|
@@ -3099,6 +3128,22 @@ declare const agentGuiI18nResources: {
|
|
|
3099
3128
|
readonly empty: "需要 {{provider}} 帮你做些什么?";
|
|
3100
3129
|
readonly conversations: "会话";
|
|
3101
3130
|
readonly newConversation: "新建会话";
|
|
3131
|
+
readonly accountMenuTitle: "Tutti Agent";
|
|
3132
|
+
readonly accountMenuMember: "会员";
|
|
3133
|
+
readonly accountMenuUpgrade: "升级";
|
|
3134
|
+
readonly accountMenuCreditsBalance: "积分余额";
|
|
3135
|
+
readonly accountMenuAccountCenter: "账号中心";
|
|
3136
|
+
readonly accountMenuSettings: "设置";
|
|
3137
|
+
readonly accountMenuFree: "Free";
|
|
3138
|
+
readonly accountMenuSignIn: "登录";
|
|
3139
|
+
readonly accountMenuSignOut: "退出登录";
|
|
3140
|
+
readonly accountMenuLoading: "加载中";
|
|
3141
|
+
readonly accountMenuUnavailable: "--";
|
|
3142
|
+
readonly accountMenuDataUnavailable: "部分账号数据暂不可用";
|
|
3143
|
+
readonly accountRewardToastTitle: "新用户积分到账";
|
|
3144
|
+
readonly accountRewardToastCreditsUnit: "积分";
|
|
3145
|
+
readonly accountRewardToastDescription: "已加入账户余额";
|
|
3146
|
+
readonly accountRewardToastClose: "关闭积分到账提示";
|
|
3102
3147
|
readonly agentConfig: "检测与设置";
|
|
3103
3148
|
readonly agentSettingsMenu: "设置";
|
|
3104
3149
|
readonly agentEnvSetup: "环境检测";
|
|
@@ -3123,6 +3168,7 @@ declare const agentGuiI18nResources: {
|
|
|
3123
3168
|
readonly batchRunnerProviderHermes: "Hermes";
|
|
3124
3169
|
readonly batchRunnerProviderNexight: "Nexight";
|
|
3125
3170
|
readonly batchRunnerProviderOpenClaw: "OpenClaw";
|
|
3171
|
+
readonly batchRunnerProviderTuttiAgent: "Tutti Agent";
|
|
3126
3172
|
readonly batchRunnerRun: "执行";
|
|
3127
3173
|
readonly batchRunnerRunning: "执行中...";
|
|
3128
3174
|
readonly batchRunnerExport: "导出";
|
package/dist/i18n/index.js
CHANGED