@tutti-os/agent-gui 0.0.84 → 0.0.86
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 +49 -44
- package/dist/agent-conversation/index.d.ts +2 -2
- package/dist/agent-conversation/index.js +5 -5
- package/dist/agent-message-center/index.js +7 -7
- package/dist/{agentGuiNodeTypes-CmuJ7VDZ.d.ts → agentGuiNodeTypes-fRobgKiP.d.ts} +1 -5
- package/dist/app/renderer/agentactivity.css +7 -0
- package/dist/{chunk-A2JPL5N6.js → chunk-3HARXLAZ.js} +2 -2
- package/dist/{chunk-BEM3KDOJ.js → chunk-45FF4DQU.js} +17 -281
- package/dist/chunk-45FF4DQU.js.map +1 -0
- package/dist/{chunk-UNLTQUPO.js → chunk-4SQNOOJ3.js} +4 -4
- package/dist/{chunk-FIH7IYLX.js → chunk-7FZT2OYT.js} +4 -4
- package/dist/chunk-7FZT2OYT.js.map +1 -0
- package/dist/{chunk-L2ZMLLYL.js → chunk-7LMJXF4R.js} +2 -2
- package/dist/{chunk-DBIJRSFG.js → chunk-A7RA7ORT.js} +104 -45
- package/dist/chunk-A7RA7ORT.js.map +1 -0
- package/dist/{chunk-CVPWQHQH.js → chunk-AOVPGJBC.js} +2 -2
- package/dist/{chunk-BT2DT2P7.js → chunk-GAPTLVII.js} +1 -1
- package/dist/{chunk-BT2DT2P7.js.map → chunk-GAPTLVII.js.map} +1 -1
- package/dist/{chunk-3355GEBI.js → chunk-HOSX5C5V.js} +2 -2
- package/dist/{chunk-CXJEQQR5.js → chunk-KQE5KV2V.js} +2 -2
- package/dist/{chunk-N7EX6XK3.js → chunk-SXDLSEHO.js} +3 -3
- package/dist/{chunk-MQ6WW3CD.js → chunk-U7D7G3UU.js} +2 -2
- package/dist/{chunk-6YLA7R4S.js → chunk-UNO7CEAF.js} +2 -2
- package/dist/{chunk-AA75BOX3.js → chunk-VWXFFSIM.js} +3 -1
- package/dist/chunk-VWXFFSIM.js.map +1 -0
- package/dist/{chunk-HUNUSBQQ.js → chunk-XQUUELKF.js} +2 -2
- package/dist/context-mention-palette/index.js +6 -6
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +28 -94
- package/dist/index.js +581 -458
- package/dist/index.js.map +1 -1
- package/dist/queued-prompt-runtime.d.ts +2 -2
- package/dist/{types-DUHHejs2.d.ts → types-BvztUbHf.d.ts} +31 -21
- package/dist/workbench/contribution.d.ts +9 -11
- package/dist/workbench/contribution.js +4 -4
- package/dist/workbench/index.d.ts +1 -1
- package/dist/workbench/index.js +7 -7
- package/dist/workbench/launch.d.ts +0 -1
- package/dist/workbench/launch.js +2 -2
- package/dist/workbench/providerCatalog.d.ts +0 -1
- package/dist/workbench/sessionTitle.d.ts +0 -1
- package/dist/workbench/sessionTitle.js +3 -3
- package/dist/workbench/state.d.ts +7 -2
- package/dist/workbench/state.js +3 -1
- package/dist/workbench/types.d.ts +0 -6
- package/dist/workbench/types.js +1 -1
- package/dist/workspace-agent-generated-files.js +3 -3
- package/package.json +14 -14
- package/dist/chunk-AA75BOX3.js.map +0 -1
- package/dist/chunk-BEM3KDOJ.js.map +0 -1
- package/dist/chunk-DBIJRSFG.js.map +0 -1
- package/dist/chunk-FIH7IYLX.js.map +0 -1
- /package/dist/{chunk-A2JPL5N6.js.map → chunk-3HARXLAZ.js.map} +0 -0
- /package/dist/{chunk-UNLTQUPO.js.map → chunk-4SQNOOJ3.js.map} +0 -0
- /package/dist/{chunk-L2ZMLLYL.js.map → chunk-7LMJXF4R.js.map} +0 -0
- /package/dist/{chunk-CVPWQHQH.js.map → chunk-AOVPGJBC.js.map} +0 -0
- /package/dist/{chunk-3355GEBI.js.map → chunk-HOSX5C5V.js.map} +0 -0
- /package/dist/{chunk-CXJEQQR5.js.map → chunk-KQE5KV2V.js.map} +0 -0
- /package/dist/{chunk-N7EX6XK3.js.map → chunk-SXDLSEHO.js.map} +0 -0
- /package/dist/{chunk-MQ6WW3CD.js.map → chunk-U7D7G3UU.js.map} +0 -0
- /package/dist/{chunk-6YLA7R4S.js.map → chunk-UNO7CEAF.js.map} +0 -0
- /package/dist/{chunk-HUNUSBQQ.js.map → chunk-XQUUELKF.js.map} +0 -0
package/README.md
CHANGED
|
@@ -84,54 +84,59 @@ Run this boundary check after changing AgentGUI data flow:
|
|
|
84
84
|
pnpm check:agent-activity-runtime-boundaries
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
##
|
|
87
|
+
## Agent Directory
|
|
88
88
|
|
|
89
|
-
`
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
Hosts may pass `providerTargets` when a real provider has multiple launch
|
|
94
|
-
targets. A target has display metadata plus an opaque `ref`:
|
|
89
|
+
`AgentGUI` requires the host's `/agents` projection through its `agents` prop.
|
|
90
|
+
The array is the complete UI directory and its order is authoritative. AgentGUI
|
|
91
|
+
does not add provider catalog entries when the array is empty.
|
|
95
92
|
|
|
96
93
|
```ts
|
|
97
|
-
export interface
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
94
|
+
export interface AgentGUIAgent {
|
|
95
|
+
agentTargetId: string;
|
|
96
|
+
name: string;
|
|
97
|
+
iconUrl: string;
|
|
98
|
+
description?: string | null;
|
|
99
|
+
owner?: {
|
|
100
|
+
name?: string | null;
|
|
101
|
+
avatarUrl?: string | null;
|
|
102
|
+
} | null;
|
|
103
|
+
availability: {
|
|
104
|
+
status:
|
|
105
|
+
| "ready"
|
|
106
|
+
| "checking"
|
|
107
|
+
| "coming_soon"
|
|
108
|
+
| "not_installed"
|
|
109
|
+
| "auth_required"
|
|
110
|
+
| "unavailable";
|
|
111
|
+
reason?: string | null;
|
|
112
|
+
pendingAction?: "install" | "login" | "refresh" | null;
|
|
113
|
+
};
|
|
105
114
|
provider: AgentGUIProvider;
|
|
106
|
-
ref: AgentGUIProviderTargetRef;
|
|
107
|
-
label: string;
|
|
108
|
-
description?: string;
|
|
109
|
-
ownerLabel?: string;
|
|
110
|
-
disabled?: boolean;
|
|
111
|
-
unavailableReason?: string;
|
|
112
115
|
}
|
|
113
116
|
```
|
|
114
117
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
`
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
118
|
+
`agentTargetId` is the sole entry identity used for selection, filtering,
|
|
119
|
+
composer option lookup, persisted node state, and new-session launch. Two agents
|
|
120
|
+
may share the same `provider` and remain distinct. `provider` is runtime metadata
|
|
121
|
+
for provider-native execution, composer policy, probes, and capabilities; it
|
|
122
|
+
must not be used to group, deduplicate, name, icon, or select agents.
|
|
123
|
+
|
|
124
|
+
Agent names and primary icons always come from `agents[].name` and
|
|
125
|
+
`agents[].iconUrl`. `owner.avatarUrl` is rendered separately as an ownership
|
|
126
|
+
badge. Invalid entries and duplicate `agentTargetId` values are discarded by
|
|
127
|
+
`normalizeAgentGUIAgents`, with the first occurrence preserving host order.
|
|
128
|
+
|
|
129
|
+
With one agent, AgentGUI hides the aggregate `All` entry and renders that agent
|
|
130
|
+
directly. With multiple agents, it shows `All` plus the host-ordered agent rail
|
|
131
|
+
and empty-home carousel. Hosts may customize the aggregate icon with
|
|
132
|
+
`allAgentsPresentation.iconUrl`.
|
|
133
|
+
|
|
134
|
+
Use `agentsLoading` for directory hydration and `renderAgentsEmpty` for a
|
|
135
|
+
host-specific loaded-empty state. Use `renderAgentUnavailableState` or
|
|
136
|
+
`renderAgentReadinessState` for host-specific availability presentation, and
|
|
137
|
+
handle install/login/refresh requests through `onAgentAvailabilityAction`.
|
|
138
|
+
|
|
139
|
+
The old public `providerTargets`, `providerRailMode`, provider-target renderers,
|
|
140
|
+
and `defaultProviderTargetId` contract is intentionally unsupported. Workbench
|
|
141
|
+
state hydration performs a one-time read of legacy `providerTargetId` into
|
|
142
|
+
`agentTargetId`; new state writes contain only `agentTargetId`.
|
|
@@ -4,11 +4,11 @@ import { W as WorkspaceLinkAction } from '../workspaceLinkActions-DS9LWqzI.js';
|
|
|
4
4
|
import { A as AgentMessageMarkdownWorkspaceAppIcon } from '../AgentMessageMarkdown-DeYPURtF.js';
|
|
5
5
|
import { c as AgentConversationVM, W as WorkspaceAgentSessionDetailViewModel } from '../agentConversationVM-BgoqFyE9.js';
|
|
6
6
|
export { B as BuildWorkspaceAgentSessionDetailInput, d as buildWorkspaceAgentSessionDetailViewModel } from '../agentConversationVM-BgoqFyE9.js';
|
|
7
|
-
import { e as AgentGUIProviderSkillOption } from '../agentGuiNodeTypes-
|
|
7
|
+
import { e as AgentGUIProviderSkillOption } from '../agentGuiNodeTypes-fRobgKiP.js';
|
|
8
8
|
export { W as WorkspaceAgentActivityCard, n as WorkspaceAgentActivitySession, q as WorkspaceAgentActivityTimelineItem } from '../workspaceAgentActivityListViewModel-TXH1VXrk.js';
|
|
9
9
|
import '@tutti-os/workspace-issue-manager/core';
|
|
10
10
|
import '@tutti-os/agent-activity-core';
|
|
11
|
-
import '../types-
|
|
11
|
+
import '../types-BvztUbHf.js';
|
|
12
12
|
import '@tutti-os/workspace-user-project/contracts';
|
|
13
13
|
|
|
14
14
|
interface AgentConversationFlowProps {
|
|
@@ -6,20 +6,20 @@ import {
|
|
|
6
6
|
projectAgentConversationVM,
|
|
7
7
|
reconcileProjectedAgentConversationVM,
|
|
8
8
|
useProjectedAgentConversation
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-7FZT2OYT.js";
|
|
10
|
+
import "../chunk-XQUUELKF.js";
|
|
11
11
|
import "../chunk-PSLAWU25.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-KQE5KV2V.js";
|
|
13
13
|
import "../chunk-Y35GDLP2.js";
|
|
14
14
|
import "../chunk-LUGELG5V.js";
|
|
15
15
|
import "../chunk-LR4FA5X6.js";
|
|
16
16
|
import "../chunk-4HP6V2YA.js";
|
|
17
17
|
import {
|
|
18
18
|
translate
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-U7D7G3UU.js";
|
|
20
20
|
import "../chunk-PJP5BUU6.js";
|
|
21
21
|
import "../chunk-XDV4ZRVK.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-VWXFFSIM.js";
|
|
23
23
|
|
|
24
24
|
// shared/WorkspaceAgentSessionDetail.tsx
|
|
25
25
|
import { useMemo } from "react";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatAgentGuiConversationPlainTitle
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-UNO7CEAF.js";
|
|
4
4
|
import {
|
|
5
5
|
AgentInteractivePromptSurface,
|
|
6
6
|
approvalOptionDisplayLabel,
|
|
7
7
|
getPromptToolDetails,
|
|
8
8
|
isPromptRequestIdTitle
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-SXDLSEHO.js";
|
|
10
10
|
import {
|
|
11
11
|
PLAN_IMPLEMENTATION_ACTION_IMPLEMENT,
|
|
12
12
|
PLAN_IMPLEMENTATION_PROMPT,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "../chunk-MKHDRIGN.js";
|
|
16
16
|
import {
|
|
17
17
|
formatAgentSessionMentionText
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-HOSX5C5V.js";
|
|
19
19
|
import {
|
|
20
20
|
AgentMessageMarkdown,
|
|
21
21
|
CustomScrollArea,
|
|
@@ -25,11 +25,11 @@ import {
|
|
|
25
25
|
extractExitPlanModeOptions,
|
|
26
26
|
isExitPlanSwitchModeInput,
|
|
27
27
|
normalizeAskUserQuestions
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-XQUUELKF.js";
|
|
29
29
|
import {
|
|
30
30
|
userAvatarPlaceholderUrl,
|
|
31
31
|
workspaceAgentActivityStatusLabel
|
|
32
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-AOVPGJBC.js";
|
|
33
33
|
import {
|
|
34
34
|
resolveWorkspaceAgentSessionSortTimeUnixMs
|
|
35
35
|
} from "../chunk-IBIMGLCD.js";
|
|
@@ -43,10 +43,10 @@ import {
|
|
|
43
43
|
AgentGuiI18nProvider,
|
|
44
44
|
getActiveUiLanguage,
|
|
45
45
|
useTranslation
|
|
46
|
-
} from "../chunk-
|
|
46
|
+
} from "../chunk-U7D7G3UU.js";
|
|
47
47
|
import "../chunk-PJP5BUU6.js";
|
|
48
48
|
import "../chunk-XDV4ZRVK.js";
|
|
49
|
-
import "../chunk-
|
|
49
|
+
import "../chunk-VWXFFSIM.js";
|
|
50
50
|
import "../chunk-GCBDIQDX.js";
|
|
51
51
|
|
|
52
52
|
// agent-message-center/WorkspaceAgentMessageCenterPanel.tsx
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AgentActivityUsage } from '@tutti-os/agent-activity-core';
|
|
2
|
-
import { k as AgentHostAgentSessionCommand, l as AgentHostAgentSessionComposerSettings, n as AgentHostAgentSessionReasoningEffort, o as AgentHostAgentSessionSpeed, m as AgentHostAgentSessionPermissionConfig, p as AgentHostAgentSessionState,
|
|
2
|
+
import { k as AgentHostAgentSessionCommand, l as AgentHostAgentSessionComposerSettings, n as AgentHostAgentSessionReasoningEffort, o as AgentHostAgentSessionSpeed, m as AgentHostAgentSessionPermissionConfig, p as AgentHostAgentSessionState, g as AgentGUIProvider, s as AgentPromptContentBlock, f as AgentGUINodeData, i as AgentGUIProviderTarget, h as AgentGUIProviderReadinessGate } from './types-BvztUbHf.js';
|
|
3
3
|
import { A as AgentHostBatchUserInfoInput, a as AgentHostBatchUserInfoResult, b as AgentHostDeleteWorkspaceAgentSessionInput, k as AgentHostWorkspaceAgentSessionSummaryInput, j as AgentHostWorkspaceAgentSessionSummary, e as AgentHostWorkspaceAgentListInput, l as AgentHostWorkspaceAgentSnapshot, i as AgentHostWorkspaceAgentSessionMessagesInput, h as AgentHostWorkspaceAgentSessionMessages, p as WorkspaceAgentActivitySyncState } from './workspaceAgentActivityListViewModel-TXH1VXrk.js';
|
|
4
4
|
import { A as AgentApprovalItemVM, a as AgentAskUserQuestionVM, b as AgentConversationPromptVM, c as AgentConversationVM, W as WorkspaceAgentSessionDetailViewModel } from './agentConversationVM-BgoqFyE9.js';
|
|
5
5
|
import { WorkspaceUserProjectService } from '@tutti-os/workspace-user-project/contracts';
|
|
@@ -607,10 +607,6 @@ interface AgentGUINodeViewModel {
|
|
|
607
607
|
providerTargets: readonly AgentGUIProviderTarget[];
|
|
608
608
|
handoffProviderTargets: readonly AgentGUIProviderTarget[];
|
|
609
609
|
providerTargetsLoading: boolean;
|
|
610
|
-
/** How the rail composes its list — "exact" renders targets verbatim with no static injection. */
|
|
611
|
-
providerRailMode: AgentGUIProviderRailMode;
|
|
612
|
-
/** Providers gated by the host (feature-gated) — rail renders coming-soon placeholders. */
|
|
613
|
-
comingSoonProviders: readonly AgentGUIProvider[];
|
|
614
610
|
conversationFilter: AgentGUIConversationFilter;
|
|
615
611
|
conversations: AgentGUIConversationSummary[];
|
|
616
612
|
userProjects: AgentGUIConversationUserProject[];
|
|
@@ -9073,6 +9073,8 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
|
|
|
9073
9073
|
display: block;
|
|
9074
9074
|
width: 100%;
|
|
9075
9075
|
height: 100%;
|
|
9076
|
+
opacity: 0;
|
|
9077
|
+
transition: opacity 120ms ease-out;
|
|
9076
9078
|
|
|
9077
9079
|
/* Fade-out mask: a horizontal band dissolves tiles toward the stage sides
|
|
9078
9080
|
(the fully-transparent stops sit where the outermost tiles ride, not at
|
|
@@ -9090,6 +9092,11 @@ html[data-theme="light"] [data-message-center-item-id].agent-gui-edge-glow {
|
|
|
9090
9092
|
mask-composite: intersect;
|
|
9091
9093
|
}
|
|
9092
9094
|
|
|
9095
|
+
.agent-gui-node__empty-hero-carousel[data-icons-ready="true"]
|
|
9096
|
+
> .agent-gui-node__empty-hero-carousel-canvas {
|
|
9097
|
+
opacity: 1;
|
|
9098
|
+
}
|
|
9099
|
+
|
|
9093
9100
|
.agent-gui-node__empty-hero-carousel-item {
|
|
9094
9101
|
position: absolute;
|
|
9095
9102
|
overflow: hidden;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
translate,
|
|
14
14
|
translateInUiLanguage
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-U7D7G3UU.js";
|
|
16
16
|
import {
|
|
17
17
|
normalizeAgentTitleText
|
|
18
18
|
} from "./chunk-GCBDIQDX.js";
|
|
@@ -826,4 +826,4 @@ export {
|
|
|
826
826
|
resolveWorkspaceAgentActivityStatus,
|
|
827
827
|
resolveWorkspaceAgentActivityTitle
|
|
828
828
|
};
|
|
829
|
-
//# sourceMappingURL=chunk-
|
|
829
|
+
//# sourceMappingURL=chunk-3HARXLAZ.js.map
|
|
@@ -4,242 +4,6 @@ import {
|
|
|
4
4
|
normalizeAgentGuiWorkbenchProvider
|
|
5
5
|
} from "./chunk-XW4CVBUH.js";
|
|
6
6
|
|
|
7
|
-
// providerTargets.ts
|
|
8
|
-
var agentGUIProviderTargetStaticLabels = {
|
|
9
|
-
"claude-code": "Claude Code",
|
|
10
|
-
codex: "Codex",
|
|
11
|
-
cursor: "Cursor",
|
|
12
|
-
hermes: "Hermes",
|
|
13
|
-
nexight: "Tutti Agent",
|
|
14
|
-
openclaw: "OpenClaw",
|
|
15
|
-
opencode: "Open Code",
|
|
16
|
-
"tutti-agent": "Tutti Agent"
|
|
17
|
-
};
|
|
18
|
-
var agentGUIDefaultTargetProviders = [
|
|
19
|
-
"codex",
|
|
20
|
-
"claude-code",
|
|
21
|
-
"cursor",
|
|
22
|
-
"tutti-agent",
|
|
23
|
-
"opencode",
|
|
24
|
-
"hermes",
|
|
25
|
-
"openclaw"
|
|
26
|
-
];
|
|
27
|
-
var agentGUIDisabledPlaceholderProviders = [
|
|
28
|
-
"hermes",
|
|
29
|
-
"openclaw"
|
|
30
|
-
];
|
|
31
|
-
function createLocalAgentGUIProviderTarget(provider) {
|
|
32
|
-
const targetId = localAgentGUIProviderTargetId(provider);
|
|
33
|
-
const agentTargetId = localAgentGUIAgentTargetId(provider);
|
|
34
|
-
return {
|
|
35
|
-
targetId,
|
|
36
|
-
...agentTargetId ? { agentTargetId } : {},
|
|
37
|
-
provider,
|
|
38
|
-
ref: {
|
|
39
|
-
kind: "local",
|
|
40
|
-
provider
|
|
41
|
-
},
|
|
42
|
-
label: agentGUIProviderTargetStaticLabels[provider] ?? provider
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function createDisabledPlaceholderAgentGUIProviderTarget(provider) {
|
|
46
|
-
return {
|
|
47
|
-
...createLocalAgentGUIProviderTarget(provider),
|
|
48
|
-
disabled: true
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function createSharedAgentGUIProviderTarget(input) {
|
|
52
|
-
const sharedAgentId = input.sharedAgentId.trim();
|
|
53
|
-
const targetId = `shared-agent:${sharedAgentId}`;
|
|
54
|
-
const badge = normalizeAgentGUIProviderTargetBadge(input.badge);
|
|
55
|
-
return {
|
|
56
|
-
targetId,
|
|
57
|
-
...input.agentTargetId?.trim() ? { agentTargetId: input.agentTargetId.trim() } : {},
|
|
58
|
-
provider: input.provider,
|
|
59
|
-
ref: {
|
|
60
|
-
...input.ref ?? {},
|
|
61
|
-
kind: "shared-agent",
|
|
62
|
-
provider: input.provider,
|
|
63
|
-
sharedAgentId
|
|
64
|
-
},
|
|
65
|
-
label: input.label,
|
|
66
|
-
...badge ? { badge } : {},
|
|
67
|
-
...input.ownerLabel?.trim() ? { ownerLabel: input.ownerLabel.trim() } : {},
|
|
68
|
-
...input.iconUrl?.trim() ? { iconUrl: input.iconUrl.trim() } : {},
|
|
69
|
-
...input.unavailableReason?.trim() ? { unavailableReason: input.unavailableReason.trim() } : {},
|
|
70
|
-
...input.disabled === true ? { disabled: true } : {}
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
function createLocalAgentGUIProviderTargets(providers = agentGUIDefaultTargetProviders) {
|
|
74
|
-
return providers.map(
|
|
75
|
-
(provider) => createLocalAgentGUIProviderTarget(provider)
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
function createStaticAgentGUIProviderTargets(providers = agentGUIDefaultTargetProviders, options) {
|
|
79
|
-
const disabledProviders = new Set(
|
|
80
|
-
options?.includeDisabledPlaceholders === true ? agentGUIDisabledPlaceholderProviders : []
|
|
81
|
-
);
|
|
82
|
-
return providers.map(
|
|
83
|
-
(provider) => disabledProviders.has(provider) ? createDisabledPlaceholderAgentGUIProviderTarget(provider) : createLocalAgentGUIProviderTarget(provider)
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
function localAgentGUIProviderTargetId(provider) {
|
|
87
|
-
return `local:${provider}`;
|
|
88
|
-
}
|
|
89
|
-
function localAgentGUIAgentTargetId(provider) {
|
|
90
|
-
switch (provider) {
|
|
91
|
-
case "codex":
|
|
92
|
-
return "local:codex";
|
|
93
|
-
case "claude-code":
|
|
94
|
-
return "local:claude-code";
|
|
95
|
-
case "tutti-agent":
|
|
96
|
-
return "local:tutti-agent";
|
|
97
|
-
case "cursor":
|
|
98
|
-
return "local:cursor";
|
|
99
|
-
case "hermes":
|
|
100
|
-
return "local:hermes";
|
|
101
|
-
case "nexight":
|
|
102
|
-
return "local:nexight";
|
|
103
|
-
case "openclaw":
|
|
104
|
-
return "local:openclaw";
|
|
105
|
-
case "opencode":
|
|
106
|
-
return "local:opencode";
|
|
107
|
-
default:
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
function normalizeAgentGUIProviderTargets(targets, options) {
|
|
112
|
-
const includeDisabledPlaceholders = options?.includeDisabledPlaceholders === true;
|
|
113
|
-
const useStaticCatalog = options?.useStaticCatalog !== false;
|
|
114
|
-
const source = targets && targets.length > 0 ? targets : [];
|
|
115
|
-
const normalizedTargets = [];
|
|
116
|
-
const seenTargetKeys = /* @__PURE__ */ new Set();
|
|
117
|
-
const seenProviders = /* @__PURE__ */ new Set();
|
|
118
|
-
for (const target of source) {
|
|
119
|
-
const normalized = normalizeAgentGUIProviderTarget(target);
|
|
120
|
-
if (!normalized) {
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
const dedupeKey = `${normalized.provider}\0${normalized.targetId}`;
|
|
124
|
-
if (seenTargetKeys.has(dedupeKey)) {
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
seenTargetKeys.add(dedupeKey);
|
|
128
|
-
seenProviders.add(normalized.provider);
|
|
129
|
-
normalizedTargets.push(normalized);
|
|
130
|
-
}
|
|
131
|
-
if (includeDisabledPlaceholders && normalizedTargets.length > 0) {
|
|
132
|
-
for (const provider of agentGUIDisabledPlaceholderProviders) {
|
|
133
|
-
if (seenProviders.has(provider)) {
|
|
134
|
-
continue;
|
|
135
|
-
}
|
|
136
|
-
normalizedTargets.push(
|
|
137
|
-
createDisabledPlaceholderAgentGUIProviderTarget(provider)
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return normalizedTargets.length > 0 || !useStaticCatalog ? normalizedTargets : createStaticAgentGUIProviderTargets(void 0, {
|
|
142
|
-
includeDisabledPlaceholders
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
function resolveAgentGUIProviderTarget(input) {
|
|
146
|
-
const targetByAgentTargetId = new Map(
|
|
147
|
-
input.providerTargets.flatMap(
|
|
148
|
-
(target) => target.agentTargetId ? [[target.agentTargetId, target]] : []
|
|
149
|
-
)
|
|
150
|
-
);
|
|
151
|
-
const agentTarget = targetByAgentTargetId.get(
|
|
152
|
-
input.agentTargetId?.trim() ?? ""
|
|
153
|
-
);
|
|
154
|
-
if (agentTarget) {
|
|
155
|
-
return agentTarget;
|
|
156
|
-
}
|
|
157
|
-
const providerTargets = input.providerTargets.filter(
|
|
158
|
-
(target) => target.provider === input.provider
|
|
159
|
-
);
|
|
160
|
-
const targetById = new Map(
|
|
161
|
-
providerTargets.map((target) => [target.targetId, target])
|
|
162
|
-
);
|
|
163
|
-
return targetById.get(input.providerTargetId?.trim() ?? "") ?? targetById.get(input.defaultProviderTargetId?.trim() ?? "") ?? targetById.get(localAgentGUIProviderTargetId(input.provider)) ?? providerTargets.find((target) => target.disabled !== true) ?? providerTargets[0] ?? (input.useStaticCatalog === false ? null : createLocalAgentGUIProviderTarget(input.provider));
|
|
164
|
-
}
|
|
165
|
-
function agentGUIProviderTargetRefsEqual(left, right) {
|
|
166
|
-
if (left === right) {
|
|
167
|
-
return true;
|
|
168
|
-
}
|
|
169
|
-
if (!left && !right) {
|
|
170
|
-
return true;
|
|
171
|
-
}
|
|
172
|
-
if (!left || !right) {
|
|
173
|
-
return false;
|
|
174
|
-
}
|
|
175
|
-
return stableProviderTargetRefKey(left) === stableProviderTargetRefKey(right);
|
|
176
|
-
}
|
|
177
|
-
function normalizeAgentGUIProviderTarget(target) {
|
|
178
|
-
const {
|
|
179
|
-
targetId: _targetId,
|
|
180
|
-
agentTargetId: _agentTargetId,
|
|
181
|
-
provider: _provider,
|
|
182
|
-
ref: _ref,
|
|
183
|
-
label: _label,
|
|
184
|
-
badge,
|
|
185
|
-
description,
|
|
186
|
-
iconUrl,
|
|
187
|
-
ownerLabel,
|
|
188
|
-
unavailableReason,
|
|
189
|
-
...rest
|
|
190
|
-
} = target;
|
|
191
|
-
const targetId = target.targetId.trim();
|
|
192
|
-
const agentTargetId = target.agentTargetId?.trim();
|
|
193
|
-
const label = target.label.trim();
|
|
194
|
-
const kind = typeof target.ref.kind === "string" ? target.ref.kind.trim() : "";
|
|
195
|
-
if (!targetId || !label || !kind || target.ref.provider !== target.provider) {
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
|
-
const normalizedBadge = normalizeAgentGUIProviderTargetBadge(badge);
|
|
199
|
-
return {
|
|
200
|
-
...rest,
|
|
201
|
-
targetId,
|
|
202
|
-
...agentTargetId ? { agentTargetId } : {},
|
|
203
|
-
provider: target.provider,
|
|
204
|
-
ref: {
|
|
205
|
-
...target.ref,
|
|
206
|
-
kind,
|
|
207
|
-
provider: target.provider
|
|
208
|
-
},
|
|
209
|
-
label,
|
|
210
|
-
...normalizedBadge ? { badge: normalizedBadge } : {},
|
|
211
|
-
...description?.trim() ? { description: description.trim() } : {},
|
|
212
|
-
...iconUrl?.trim() ? { iconUrl: iconUrl.trim() } : {},
|
|
213
|
-
...ownerLabel?.trim() ? { ownerLabel: ownerLabel.trim() } : {},
|
|
214
|
-
...unavailableReason?.trim() ? { unavailableReason: unavailableReason.trim() } : {}
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
function normalizeAgentGUIProviderTargetBadge(badge) {
|
|
218
|
-
const iconUrl = badge?.iconUrl?.trim() ?? "";
|
|
219
|
-
if (!iconUrl) {
|
|
220
|
-
return null;
|
|
221
|
-
}
|
|
222
|
-
const label = badge?.label?.trim() ?? "";
|
|
223
|
-
return {
|
|
224
|
-
iconUrl,
|
|
225
|
-
...label ? { label } : {}
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
function stableProviderTargetRefKey(ref) {
|
|
229
|
-
return JSON.stringify(sortProviderTargetRefValue(ref));
|
|
230
|
-
}
|
|
231
|
-
function sortProviderTargetRefValue(value) {
|
|
232
|
-
if (Array.isArray(value)) {
|
|
233
|
-
return value.map(sortProviderTargetRefValue);
|
|
234
|
-
}
|
|
235
|
-
if (!value || typeof value !== "object") {
|
|
236
|
-
return value;
|
|
237
|
-
}
|
|
238
|
-
return Object.fromEntries(
|
|
239
|
-
Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, entryValue]) => [key, sortProviderTargetRefValue(entryValue)])
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
7
|
// workbench/state.ts
|
|
244
8
|
function createDefaultAgentGuiWorkbenchNodeState(provider = "codex") {
|
|
245
9
|
return {
|
|
@@ -252,16 +16,14 @@ function createDefaultAgentGuiWorkbenchNodeState(provider = "codex") {
|
|
|
252
16
|
conversationRailWidthPx: null,
|
|
253
17
|
lastActiveAgentSessionId: null,
|
|
254
18
|
lastActiveConversationTitle: null,
|
|
255
|
-
provider
|
|
256
|
-
providerTargetId: null,
|
|
257
|
-
providerTargetRef: null
|
|
19
|
+
provider
|
|
258
20
|
};
|
|
259
21
|
}
|
|
260
22
|
function normalizeAgentGuiWorkbenchState(state) {
|
|
261
23
|
if (!isRecord(state)) {
|
|
262
24
|
return createDefaultAgentGuiWorkbenchState();
|
|
263
25
|
}
|
|
264
|
-
const agentTargetId = normalizeOptionalNonEmptyString(state.agentTargetId)
|
|
26
|
+
const agentTargetId = normalizeOptionalNonEmptyString(state.agentTargetId);
|
|
265
27
|
return {
|
|
266
28
|
...agentTargetId ? { agentTargetId } : {},
|
|
267
29
|
conversationRailCollapsed: state.conversationRailCollapsed === true,
|
|
@@ -272,8 +34,17 @@ function normalizeAgentGuiWorkbenchState(state) {
|
|
|
272
34
|
...typeof state.lastActiveConversationTitle === "string" ? { lastActiveConversationTitle: state.lastActiveConversationTitle } : {}
|
|
273
35
|
};
|
|
274
36
|
}
|
|
37
|
+
function migrateLegacyAgentGuiWorkbenchState(state) {
|
|
38
|
+
if (!isRecord(state) || normalizeOptionalNonEmptyString(state.agentTargetId)) {
|
|
39
|
+
return state;
|
|
40
|
+
}
|
|
41
|
+
const legacyAgentTargetId = normalizeOptionalNonEmptyString(
|
|
42
|
+
state.providerTargetId
|
|
43
|
+
);
|
|
44
|
+
return legacyAgentTargetId ? { ...state, agentTargetId: legacyAgentTargetId } : state;
|
|
45
|
+
}
|
|
275
46
|
function projectAgentGuiWorkbenchState(state) {
|
|
276
|
-
const agentTargetId = normalizeOptionalNonEmptyString(state.agentTargetId)
|
|
47
|
+
const agentTargetId = normalizeOptionalNonEmptyString(state.agentTargetId);
|
|
277
48
|
return {
|
|
278
49
|
...agentTargetId ? { agentTargetId } : {},
|
|
279
50
|
conversationRailCollapsed: state.conversationRailCollapsed === true,
|
|
@@ -294,7 +65,7 @@ function normalizeAgentGuiWorkbenchNodeState(state, fallbackProvider = "codex")
|
|
|
294
65
|
);
|
|
295
66
|
return {
|
|
296
67
|
...createDefaultAgentGuiWorkbenchNodeState(provider),
|
|
297
|
-
agentTargetId: normalizeOptionalNonEmptyString(state?.agentTargetId)
|
|
68
|
+
agentTargetId: normalizeOptionalNonEmptyString(state?.agentTargetId),
|
|
298
69
|
composerOverrides: normalizeAgentGuiWorkbenchComposerOverrides(
|
|
299
70
|
state?.composerOverrides
|
|
300
71
|
),
|
|
@@ -313,12 +84,7 @@ function normalizeAgentGuiWorkbenchNodeState(state, fallbackProvider = "codex")
|
|
|
313
84
|
),
|
|
314
85
|
lastActiveAgentSessionId: typeof state?.lastActiveAgentSessionId === "string" ? state.lastActiveAgentSessionId : null,
|
|
315
86
|
lastActiveConversationTitle: typeof state?.lastActiveConversationTitle === "string" ? state.lastActiveConversationTitle : null,
|
|
316
|
-
provider
|
|
317
|
-
providerTargetId: normalizeOptionalNonEmptyString(state?.providerTargetId),
|
|
318
|
-
providerTargetRef: normalizeAgentGuiProviderTargetRef(
|
|
319
|
-
state?.providerTargetRef,
|
|
320
|
-
provider
|
|
321
|
-
)
|
|
87
|
+
provider
|
|
322
88
|
};
|
|
323
89
|
}
|
|
324
90
|
function areAgentGuiWorkbenchNodeStatesEqual(left, right) {
|
|
@@ -328,10 +94,7 @@ function areAgentGuiWorkbenchNodeStatesEqual(left, right) {
|
|
|
328
94
|
) && composerOverridesByProviderEqual(
|
|
329
95
|
left.composerOverridesByProvider,
|
|
330
96
|
right.composerOverridesByProvider
|
|
331
|
-
) && left.conversationCount === right.conversationCount && left.conversationRailCollapsed === right.conversationRailCollapsed && left.conversationRailWidthPx === right.conversationRailWidthPx && left.lastActiveAgentSessionId === right.lastActiveAgentSessionId && left.lastActiveConversationTitle === right.lastActiveConversationTitle && left.provider === right.provider && (left.agentTargetId ?? null) === (right.agentTargetId ?? null)
|
|
332
|
-
left.providerTargetRef,
|
|
333
|
-
right.providerTargetRef
|
|
334
|
-
);
|
|
97
|
+
) && left.conversationCount === right.conversationCount && left.conversationRailCollapsed === right.conversationRailCollapsed && left.conversationRailWidthPx === right.conversationRailWidthPx && left.lastActiveAgentSessionId === right.lastActiveAgentSessionId && left.lastActiveConversationTitle === right.lastActiveConversationTitle && left.provider === right.provider && (left.agentTargetId ?? null) === (right.agentTargetId ?? null);
|
|
335
98
|
}
|
|
336
99
|
function agentGuiWorkbenchProviderFromInstanceId(instanceId) {
|
|
337
100
|
const normalized = instanceId?.trim();
|
|
@@ -451,24 +214,6 @@ function createDefaultAgentGuiWorkbenchState() {
|
|
|
451
214
|
function normalizeOptionalNonEmptyString(value) {
|
|
452
215
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
453
216
|
}
|
|
454
|
-
function normalizeAgentGuiProviderTargetRef(value, expectedProvider) {
|
|
455
|
-
if (!isRecord(value)) {
|
|
456
|
-
return null;
|
|
457
|
-
}
|
|
458
|
-
const kind = normalizeOptionalNonEmptyString(value.kind);
|
|
459
|
-
const provider = value.provider;
|
|
460
|
-
if (!kind || !isAgentGuiWorkbenchProvider(provider)) {
|
|
461
|
-
return null;
|
|
462
|
-
}
|
|
463
|
-
if (expectedProvider && provider !== expectedProvider) {
|
|
464
|
-
return null;
|
|
465
|
-
}
|
|
466
|
-
return {
|
|
467
|
-
...value,
|
|
468
|
-
kind,
|
|
469
|
-
provider
|
|
470
|
-
};
|
|
471
|
-
}
|
|
472
217
|
function normalizeAgentGuiWorkbenchComposerOverrides(value) {
|
|
473
218
|
if (!isRecord(value)) {
|
|
474
219
|
return null;
|
|
@@ -552,18 +297,9 @@ function isRecord(value) {
|
|
|
552
297
|
}
|
|
553
298
|
|
|
554
299
|
export {
|
|
555
|
-
agentGUIDefaultTargetProviders,
|
|
556
|
-
createLocalAgentGUIProviderTarget,
|
|
557
|
-
createDisabledPlaceholderAgentGUIProviderTarget,
|
|
558
|
-
createSharedAgentGUIProviderTarget,
|
|
559
|
-
createLocalAgentGUIProviderTargets,
|
|
560
|
-
localAgentGUIProviderTargetId,
|
|
561
|
-
localAgentGUIAgentTargetId,
|
|
562
|
-
normalizeAgentGUIProviderTargets,
|
|
563
|
-
resolveAgentGUIProviderTarget,
|
|
564
|
-
agentGUIProviderTargetRefsEqual,
|
|
565
300
|
createDefaultAgentGuiWorkbenchNodeState,
|
|
566
301
|
normalizeAgentGuiWorkbenchState,
|
|
302
|
+
migrateLegacyAgentGuiWorkbenchState,
|
|
567
303
|
projectAgentGuiWorkbenchState,
|
|
568
304
|
areAgentGuiWorkbenchStatesEqual,
|
|
569
305
|
normalizeAgentGuiWorkbenchNodeState,
|
|
@@ -572,4 +308,4 @@ export {
|
|
|
572
308
|
agentGuiWorkbenchProviderFromInstanceIdOrNull,
|
|
573
309
|
createAgentGuiWorkbenchNodeStateSource
|
|
574
310
|
};
|
|
575
|
-
//# sourceMappingURL=chunk-
|
|
311
|
+
//# sourceMappingURL=chunk-45FF4DQU.js.map
|