@openscout/protocol 0.2.64 → 0.2.83
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/LICENSE +202 -0
- package/README.md +103 -52
- package/dist/a2a.d.ts +224 -0
- package/dist/a2a.d.ts.map +1 -0
- package/dist/a2a.js +225 -0
- package/dist/activity.d.ts +70 -0
- package/dist/activity.d.ts.map +1 -0
- package/dist/activity.js +1 -0
- package/dist/actors.d.ts +7 -3
- package/dist/actors.d.ts.map +1 -0
- package/dist/actors.js +15 -1
- package/dist/agent-broker-feed.d.ts +84 -0
- package/dist/agent-broker-feed.d.ts.map +1 -0
- package/dist/agent-broker-feed.js +1 -0
- package/dist/agent-identity.d.ts +23 -0
- package/dist/agent-identity.d.ts.map +1 -0
- package/dist/agent-identity.js +122 -8
- package/dist/agent-runs.d.ts +191 -0
- package/dist/agent-runs.d.ts.map +1 -0
- package/dist/agent-runs.js +365 -0
- package/dist/assigned-roles.d.ts +205 -0
- package/dist/assigned-roles.d.ts.map +1 -0
- package/dist/assigned-roles.js +228 -0
- package/dist/broker-routes.d.ts +40 -0
- package/dist/broker-routes.d.ts.map +1 -0
- package/dist/broker-routes.js +56 -0
- package/dist/budget.d.ts +65 -0
- package/dist/budget.d.ts.map +1 -0
- package/dist/budget.js +19 -0
- package/dist/capability-matrix.d.ts +230 -0
- package/dist/capability-matrix.d.ts.map +1 -0
- package/dist/capability-matrix.js +304 -0
- package/dist/channel-identity.d.ts +40 -0
- package/dist/channel-identity.d.ts.map +1 -0
- package/dist/channel-identity.js +108 -0
- package/dist/collaboration.d.ts +45 -16
- package/dist/collaboration.d.ts.map +1 -0
- package/dist/collaboration.js +39 -23
- package/dist/common.d.ts +4 -3
- package/dist/common.d.ts.map +1 -0
- package/dist/conversations.d.ts +1 -0
- package/dist/conversations.d.ts.map +1 -0
- package/dist/cursor-transport.d.ts +22 -0
- package/dist/cursor-transport.d.ts.map +1 -0
- package/dist/cursor-transport.js +10 -0
- package/dist/debug-attach.d.ts +29 -0
- package/dist/debug-attach.d.ts.map +1 -0
- package/dist/debug-attach.js +6 -0
- package/dist/deliveries.d.ts +16 -2
- package/dist/deliveries.d.ts.map +1 -0
- package/dist/durable-actions.d.ts +94 -0
- package/dist/durable-actions.d.ts.map +1 -0
- package/dist/durable-actions.js +1 -0
- package/dist/events.d.ts +27 -1
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +14 -1
- package/dist/harness-feature-support.d.ts +76 -0
- package/dist/harness-feature-support.d.ts.map +1 -0
- package/dist/harness-feature-support.js +29 -0
- package/dist/host-integrations.d.ts +22 -0
- package/dist/host-integrations.d.ts.map +1 -0
- package/dist/host-integrations.js +64 -0
- package/dist/inbox.d.ts +50 -0
- package/dist/inbox.d.ts.map +1 -0
- package/dist/inbox.js +9 -0
- package/dist/index.d.ts +35 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -2
- package/dist/invocations.d.ts +119 -4
- package/dist/invocations.d.ts.map +1 -0
- package/dist/invocations.js +201 -1
- package/dist/mesh.d.ts +98 -0
- package/dist/mesh.d.ts.map +1 -0
- package/dist/mesh.js +18 -1
- package/dist/messages.d.ts +3 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/native-interactions.d.ts +30 -0
- package/dist/native-interactions.d.ts.map +1 -0
- package/dist/native-interactions.js +51 -0
- package/dist/observed-status.d.ts +33 -0
- package/dist/observed-status.d.ts.map +1 -0
- package/dist/observed-status.js +6 -0
- package/dist/orchestrator-prompt.d.ts +10 -0
- package/dist/orchestrator-prompt.d.ts.map +1 -0
- package/dist/orchestrator-prompt.js +36 -0
- package/dist/permission-policy.d.ts +5 -0
- package/dist/permission-policy.d.ts.map +1 -0
- package/dist/permission-policy.js +15 -0
- package/dist/provisional-agent-names.d.ts +30 -0
- package/dist/provisional-agent-names.d.ts.map +1 -0
- package/dist/provisional-agent-names.js +224 -0
- package/dist/read-receipts.d.ts +12 -0
- package/dist/read-receipts.d.ts.map +1 -0
- package/dist/read-receipts.js +1 -0
- package/dist/relay-agent-card.d.ts +10 -0
- package/dist/relay-agent-card.d.ts.map +1 -0
- package/dist/rendezvous.d.ts +97 -0
- package/dist/rendezvous.d.ts.map +1 -0
- package/dist/rendezvous.js +35 -0
- package/dist/reserved-vocabulary.d.ts +21 -0
- package/dist/reserved-vocabulary.d.ts.map +1 -0
- package/dist/reserved-vocabulary.js +101 -0
- package/dist/route-aliases.d.ts +112 -0
- package/dist/route-aliases.d.ts.map +1 -0
- package/dist/route-aliases.js +1 -0
- package/dist/runtime-catalog-contract.d.ts +39 -0
- package/dist/runtime-catalog-contract.d.ts.map +1 -0
- package/dist/runtime-catalog-contract.js +17 -0
- package/dist/runtime-catalog.d.ts +11 -0
- package/dist/runtime-catalog.d.ts.map +1 -0
- package/dist/runtime-catalog.generated.d.ts +230 -0
- package/dist/runtime-catalog.generated.d.ts.map +1 -0
- package/dist/runtime-catalog.generated.js +299 -0
- package/dist/runtime-catalog.js +192 -0
- package/dist/runtime-execution.d.ts +161 -0
- package/dist/runtime-execution.d.ts.map +1 -0
- package/dist/runtime-execution.js +327 -0
- package/dist/runtime-profiles.d.ts +12 -0
- package/dist/runtime-profiles.d.ts.map +1 -0
- package/dist/runtime-profiles.js +20 -0
- package/dist/scout-agent-card.d.ts +10 -0
- package/dist/scout-agent-card.d.ts.map +1 -0
- package/dist/scout-composer.d.ts +27 -0
- package/dist/scout-composer.d.ts.map +1 -0
- package/dist/scout-composer.js +192 -0
- package/dist/scout-delivery.d.ts +99 -4
- package/dist/scout-delivery.d.ts.map +1 -0
- package/dist/scout-dispatch.d.ts +40 -3
- package/dist/scout-dispatch.d.ts.map +1 -0
- package/dist/scout-reply-context.d.ts +1 -0
- package/dist/scout-reply-context.d.ts.map +1 -0
- package/dist/session-display-state.d.ts +132 -0
- package/dist/session-display-state.d.ts.map +1 -0
- package/dist/session-display-state.js +94 -0
- package/dist/terminal-host-topology.d.ts +119 -0
- package/dist/terminal-host-topology.d.ts.map +1 -0
- package/dist/terminal-host-topology.js +21 -0
- package/dist/terminal-sessions.d.ts +142 -0
- package/dist/terminal-sessions.d.ts.map +1 -0
- package/dist/terminal-sessions.js +81 -0
- package/dist/terminal-surface-id.d.ts +73 -0
- package/dist/terminal-surface-id.d.ts.map +1 -0
- package/dist/terminal-surface-id.js +162 -0
- package/dist/terminal-workspaces.d.ts +199 -0
- package/dist/terminal-workspaces.d.ts.map +1 -0
- package/dist/terminal-workspaces.js +287 -0
- package/dist/thread-events.d.ts +1 -0
- package/dist/thread-events.d.ts.map +1 -0
- package/dist/time.d.ts +16 -0
- package/dist/time.d.ts.map +1 -0
- package/dist/time.js +33 -0
- package/dist/transports.d.ts +1 -0
- package/dist/transports.d.ts.map +1 -0
- package/package.json +37 -9
- package/src/a2a.ts +471 -0
- package/src/activity.ts +113 -0
- package/src/actors.ts +42 -8
- package/src/agent-broker-feed.ts +102 -0
- package/src/agent-identity.ts +143 -8
- package/src/agent-runs.ts +675 -0
- package/src/assigned-roles.ts +437 -0
- package/src/broker-routes.ts +62 -0
- package/src/budget.ts +88 -0
- package/src/capability-matrix.ts +648 -0
- package/src/channel-identity.ts +147 -0
- package/src/collaboration.ts +78 -48
- package/src/common.ts +24 -5
- package/src/cursor-transport.ts +34 -0
- package/src/debug-attach.ts +38 -0
- package/src/deliveries.ts +16 -1
- package/src/durable-actions.ts +125 -0
- package/src/events.ts +31 -0
- package/src/harness-feature-support.ts +116 -0
- package/src/host-integrations.ts +104 -0
- package/src/inbox.ts +68 -0
- package/src/index.ts +34 -2
- package/src/invocations.ts +351 -4
- package/src/mesh.ts +130 -0
- package/src/messages.ts +2 -0
- package/src/native-interactions.ts +100 -0
- package/src/observed-status.ts +90 -0
- package/src/orchestrator-prompt.ts +47 -0
- package/src/permission-policy.ts +21 -0
- package/src/provisional-agent-names.ts +272 -0
- package/src/read-receipts.ts +12 -0
- package/src/relay-agent-card.ts +73 -63
- package/src/rendezvous.ts +154 -0
- package/src/reserved-vocabulary.ts +135 -0
- package/src/route-aliases.ts +130 -0
- package/src/runtime-catalog-contract.ts +60 -0
- package/src/runtime-catalog.generated.ts +300 -0
- package/src/runtime-catalog.md +21 -0
- package/src/runtime-catalog.ts +193 -0
- package/src/runtime-catalog.v1.json +81 -0
- package/src/runtime-execution.ts +545 -0
- package/src/runtime-profiles.ts +37 -0
- package/src/scout-agent-card.ts +10 -0
- package/src/scout-composer.ts +249 -0
- package/src/scout-delivery.ts +113 -3
- package/src/scout-dispatch.ts +33 -2
- package/src/session-display-state.ts +202 -0
- package/src/terminal-host-topology.ts +132 -0
- package/src/terminal-sessions.ts +187 -0
- package/src/terminal-surface-id.ts +189 -0
- package/src/terminal-workspaces.ts +455 -0
- package/src/time.ts +49 -0
- package/dist/agent-address.d.ts +0 -1
- package/dist/agent-address.js +0 -1
- package/dist/agent-selectors.d.ts +0 -1
- package/dist/agent-selectors.js +0 -1
- package/src/agent-address.ts +0 -1
- package/src/agent-identity.test.ts +0 -435
- package/src/agent-selectors.ts +0 -1
- package/src/scout-agent-card.test.ts +0 -54
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./agent-address.js";
|
package/dist/agent-selectors.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./agent-address.js";
|
package/src/agent-address.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./agent-identity.js";
|
|
@@ -1,435 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
constructAgentAlias,
|
|
5
|
-
constructAgentIdentity,
|
|
6
|
-
diagnoseAgentIdentity,
|
|
7
|
-
extractAgentIdentities,
|
|
8
|
-
formatAgentAlias,
|
|
9
|
-
formatAgentIdentity,
|
|
10
|
-
formatMinimalAgentIdentity,
|
|
11
|
-
isReservedAgentDefinitionId,
|
|
12
|
-
parseAgentIdentity,
|
|
13
|
-
parseAgentSelector,
|
|
14
|
-
resolveAgentAlias,
|
|
15
|
-
resolveAgentIdentity,
|
|
16
|
-
resolveAgentSelector,
|
|
17
|
-
OPENSCOUT_COORDINATOR_AGENT_ID,
|
|
18
|
-
SCOUT_DISPATCHER_AGENT_ID,
|
|
19
|
-
} from "./agent-identity.js";
|
|
20
|
-
|
|
21
|
-
describe("agent identity grammar", () => {
|
|
22
|
-
test("parses bare, positional, and typed identities", () => {
|
|
23
|
-
expect(parseAgentIdentity("@arc")).toEqual({
|
|
24
|
-
raw: "arc",
|
|
25
|
-
label: "@arc",
|
|
26
|
-
definitionId: "arc",
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
expect(parseAgentIdentity("@arc.main")).toEqual({
|
|
30
|
-
raw: "arc.main",
|
|
31
|
-
label: "@arc.main",
|
|
32
|
-
definitionId: "arc",
|
|
33
|
-
workspaceQualifier: "main",
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
expect(parseAgentIdentity("@arc.main.profile:dev-browser.harness:claude")).toEqual({
|
|
37
|
-
raw: "arc.main.profile:dev-browser.harness:claude",
|
|
38
|
-
label: "@arc.main.profile:dev-browser.harness:claude",
|
|
39
|
-
definitionId: "arc",
|
|
40
|
-
workspaceQualifier: "main",
|
|
41
|
-
profile: "dev-browser",
|
|
42
|
-
harness: "claude",
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
expect(parseAgentIdentity("@arc.profile:dev.main")).toEqual({
|
|
46
|
-
raw: "arc.profile:dev.main",
|
|
47
|
-
label: "@arc.main.profile:dev",
|
|
48
|
-
definitionId: "arc",
|
|
49
|
-
workspaceQualifier: "main",
|
|
50
|
-
profile: "dev",
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
expect(parseAgentIdentity("@arc.branch:super/refactor.persona:dev-browser.runtime:codex.node:mini")).toEqual({
|
|
54
|
-
raw: "arc.branch:super/refactor.persona:dev-browser.runtime:codex.node:mini",
|
|
55
|
-
label: "@arc.super-refactor.profile:dev-browser.harness:codex.node:mini",
|
|
56
|
-
definitionId: "arc",
|
|
57
|
-
workspaceQualifier: "super-refactor",
|
|
58
|
-
profile: "dev-browser",
|
|
59
|
-
harness: "codex",
|
|
60
|
-
nodeQualifier: "mini",
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
expect(parseAgentIdentity("@lattices#codex?5.5")).toEqual({
|
|
64
|
-
raw: "lattices#codex?5.5",
|
|
65
|
-
label: "@lattices.harness:codex.model:5-5",
|
|
66
|
-
definitionId: "lattices",
|
|
67
|
-
harness: "codex",
|
|
68
|
-
model: "5-5",
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
expect(parseAgentIdentity("@lattices.main#claude?sonnet")).toEqual({
|
|
72
|
-
raw: "lattices.main#claude?sonnet",
|
|
73
|
-
label: "@lattices.main.harness:claude.model:sonnet",
|
|
74
|
-
definitionId: "lattices",
|
|
75
|
-
workspaceQualifier: "main",
|
|
76
|
-
harness: "claude",
|
|
77
|
-
model: "sonnet",
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
test("parses 3-segment positional as definitionId.workspaceQualifier.nodeQualifier", () => {
|
|
82
|
-
const result = parseAgentIdentity("@arc.dev.mini");
|
|
83
|
-
expect(result).not.toBeNull();
|
|
84
|
-
expect(result!.definitionId).toBe("arc");
|
|
85
|
-
expect(result!.workspaceQualifier).toBe("dev");
|
|
86
|
-
expect(result!.nodeQualifier).toBe("mini");
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
test("rejects invalid and legacy-shaped identities", () => {
|
|
90
|
-
expect(parseAgentIdentity("")).toBeNull();
|
|
91
|
-
expect(parseAgentIdentity("@arc.profile:")).toBeNull();
|
|
92
|
-
expect(parseAgentIdentity("@arc@mini#main")).toBeNull();
|
|
93
|
-
expect(parseAgentIdentity("@arc#")).toBeNull();
|
|
94
|
-
expect(parseAgentIdentity("@arc?sonnet#claude")).toBeNull();
|
|
95
|
-
expect(parseAgentIdentity("@arc.a.b.c")).toBeNull(); // 3+ positionals rejected
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
test("constructs canonical agent identities", () => {
|
|
99
|
-
expect(constructAgentIdentity({
|
|
100
|
-
definitionId: "Arc",
|
|
101
|
-
workspaceQualifier: "Super Refactor",
|
|
102
|
-
profile: "Dev Browser",
|
|
103
|
-
harness: "Claude",
|
|
104
|
-
model: "GPT-5.5",
|
|
105
|
-
nodeQualifier: "Mini.local",
|
|
106
|
-
})).toEqual({
|
|
107
|
-
raw: "arc.super-refactor.profile:dev-browser.harness:claude.model:gpt-5-5.node:mini-local",
|
|
108
|
-
label: "@arc.super-refactor.profile:dev-browser.harness:claude.model:gpt-5-5.node:mini-local",
|
|
109
|
-
definitionId: "arc",
|
|
110
|
-
workspaceQualifier: "super-refactor",
|
|
111
|
-
profile: "dev-browser",
|
|
112
|
-
harness: "claude",
|
|
113
|
-
model: "gpt-5-5",
|
|
114
|
-
nodeQualifier: "mini-local",
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
test("formats canonical identities", () => {
|
|
119
|
-
expect(formatAgentIdentity({
|
|
120
|
-
definitionId: "arc",
|
|
121
|
-
workspaceQualifier: "main",
|
|
122
|
-
profile: "dev-browser",
|
|
123
|
-
harness: "claude",
|
|
124
|
-
model: "sonnet",
|
|
125
|
-
nodeQualifier: "mini",
|
|
126
|
-
})).toBe("@arc.main.profile:dev-browser.harness:claude.model:sonnet.node:mini");
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
test("extracts unique identities from text", () => {
|
|
130
|
-
expect(extractAgentIdentities(
|
|
131
|
-
"Compare @arc.main.profile:dev-browser with @hudson, then ping @arc.main.profile:dev-browser and @lattices#codex?5.5.",
|
|
132
|
-
)).toEqual([
|
|
133
|
-
{
|
|
134
|
-
raw: "arc.main.profile:dev-browser",
|
|
135
|
-
label: "@arc.main.profile:dev-browser",
|
|
136
|
-
definitionId: "arc",
|
|
137
|
-
workspaceQualifier: "main",
|
|
138
|
-
profile: "dev-browser",
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
raw: "hudson",
|
|
142
|
-
label: "@hudson",
|
|
143
|
-
definitionId: "hudson",
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
raw: "lattices#codex?5.5",
|
|
147
|
-
label: "@lattices.harness:codex.model:5-5",
|
|
148
|
-
definitionId: "lattices",
|
|
149
|
-
harness: "codex",
|
|
150
|
-
model: "5-5",
|
|
151
|
-
},
|
|
152
|
-
]);
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
test("keeps selector aliases as thin compatibility exports", () => {
|
|
156
|
-
expect(parseAgentSelector("@arc.main.profile:dev")).toEqual({
|
|
157
|
-
raw: "arc.main.profile:dev",
|
|
158
|
-
label: "@arc.main.profile:dev",
|
|
159
|
-
definitionId: "arc",
|
|
160
|
-
workspaceQualifier: "main",
|
|
161
|
-
profile: "dev",
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
test("constructs and formats explicit aliases", () => {
|
|
166
|
-
const alias = constructAgentAlias({
|
|
167
|
-
alias: "@Huddy",
|
|
168
|
-
target: {
|
|
169
|
-
definitionId: "hudson",
|
|
170
|
-
workspaceQualifier: "main",
|
|
171
|
-
profile: "dev-browser",
|
|
172
|
-
},
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
expect(alias).toEqual({
|
|
176
|
-
alias: "huddy",
|
|
177
|
-
target: {
|
|
178
|
-
definitionId: "hudson",
|
|
179
|
-
workspaceQualifier: "main",
|
|
180
|
-
profile: "dev-browser",
|
|
181
|
-
},
|
|
182
|
-
});
|
|
183
|
-
expect(formatAgentAlias(alias!)).toBe("@huddy");
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
describe("agent identity resolution", () => {
|
|
188
|
-
const candidates = [
|
|
189
|
-
{
|
|
190
|
-
agentId: "arc.default",
|
|
191
|
-
definitionId: "arc",
|
|
192
|
-
workspaceQualifier: "main",
|
|
193
|
-
profile: "base",
|
|
194
|
-
harness: "codex",
|
|
195
|
-
aliases: [formatAgentIdentity({ definitionId: "arc" })],
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
agentId: "arc.browser",
|
|
199
|
-
definitionId: "arc",
|
|
200
|
-
workspaceQualifier: "main",
|
|
201
|
-
profile: "dev-browser",
|
|
202
|
-
harness: "codex",
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
agentId: "arc.claude",
|
|
206
|
-
definitionId: "arc",
|
|
207
|
-
workspaceQualifier: "super-refactor",
|
|
208
|
-
profile: "dev-browser",
|
|
209
|
-
harness: "claude",
|
|
210
|
-
nodeQualifier: "mini",
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
agentId: "hudson.main",
|
|
214
|
-
definitionId: "hudson",
|
|
215
|
-
workspaceQualifier: "hudson-main-8012ac",
|
|
216
|
-
harness: "codex",
|
|
217
|
-
nodeQualifier: "arachs-mac-mini-local",
|
|
218
|
-
aliases: ["@huddy"],
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
agentId: "hudson.browser",
|
|
222
|
-
definitionId: "hudson",
|
|
223
|
-
workspaceQualifier: "hudson-main-8012ac",
|
|
224
|
-
profile: "dev-browser",
|
|
225
|
-
harness: "codex",
|
|
226
|
-
nodeQualifier: "arachs-mac-mini-local",
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
agentId: "hudson.other-node",
|
|
230
|
-
definitionId: "hudson",
|
|
231
|
-
workspaceQualifier: "hudson-main-8012ac",
|
|
232
|
-
harness: "codex",
|
|
233
|
-
nodeQualifier: "backup-mac-mini",
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
agentId: "lattices.codex-55",
|
|
237
|
-
definitionId: "lattices",
|
|
238
|
-
workspaceQualifier: "main",
|
|
239
|
-
harness: "codex",
|
|
240
|
-
model: "gpt-5.5",
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
agentId: "lattices.codex-54",
|
|
244
|
-
definitionId: "lattices",
|
|
245
|
-
workspaceQualifier: "main",
|
|
246
|
-
harness: "codex",
|
|
247
|
-
model: "gpt-5.4",
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
agentId: "lattices.sonnet",
|
|
251
|
-
definitionId: "lattices",
|
|
252
|
-
workspaceQualifier: "main",
|
|
253
|
-
harness: "claude",
|
|
254
|
-
model: "claude-sonnet-4-6",
|
|
255
|
-
},
|
|
256
|
-
];
|
|
257
|
-
|
|
258
|
-
test("prefers explicit default aliases for bare identities", () => {
|
|
259
|
-
const identity = parseAgentIdentity("@arc");
|
|
260
|
-
expect(identity).not.toBeNull();
|
|
261
|
-
expect(resolveAgentIdentity(identity!, candidates)).toEqual(candidates[0]);
|
|
262
|
-
});
|
|
263
|
-
|
|
264
|
-
test("resolves typed qualifiers to the matching concrete agent", () => {
|
|
265
|
-
const identity = parseAgentIdentity("@arc.main.profile:dev-browser");
|
|
266
|
-
expect(identity).not.toBeNull();
|
|
267
|
-
expect(resolveAgentIdentity(identity!, candidates)).toEqual(candidates[1]);
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
test("resolves fully qualified identities including harness and node", () => {
|
|
271
|
-
const identity = parseAgentIdentity("@arc.super-refactor.profile:dev-browser.harness:claude.node:mini");
|
|
272
|
-
expect(identity).not.toBeNull();
|
|
273
|
-
expect(resolveAgentIdentity(identity!, candidates)).toEqual(candidates[2]);
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
test("returns null for ambiguous non-default partial identities", () => {
|
|
277
|
-
const identity = parseAgentIdentity("@arc.profile:dev-browser");
|
|
278
|
-
expect(identity).not.toBeNull();
|
|
279
|
-
expect(resolveAgentIdentity(identity!, candidates)).toBeNull();
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
test("keeps selector resolution aliases as thin compatibility exports", () => {
|
|
283
|
-
const identity = parseAgentSelector("@arc.main.profile:dev-browser");
|
|
284
|
-
expect(identity).not.toBeNull();
|
|
285
|
-
expect(resolveAgentSelector(identity!, candidates)).toEqual(candidates[1]);
|
|
286
|
-
});
|
|
287
|
-
|
|
288
|
-
test("resolves exact human aliases before canonical matching", () => {
|
|
289
|
-
const identity = parseAgentIdentity("@huddy");
|
|
290
|
-
expect(identity).not.toBeNull();
|
|
291
|
-
expect(resolveAgentIdentity(identity!, candidates)).toEqual(candidates[3]);
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
test("resolves shorthand harness and model qualifiers", () => {
|
|
295
|
-
const codex = parseAgentIdentity("@lattices#codex?5.5");
|
|
296
|
-
expect(codex).not.toBeNull();
|
|
297
|
-
expect(resolveAgentIdentity(codex!, candidates)).toEqual(candidates[6]);
|
|
298
|
-
|
|
299
|
-
const sonnet = parseAgentIdentity("@lattices#claude?sonnet");
|
|
300
|
-
expect(sonnet).not.toBeNull();
|
|
301
|
-
expect(resolveAgentIdentity(sonnet!, candidates)).toEqual(candidates[8]);
|
|
302
|
-
});
|
|
303
|
-
|
|
304
|
-
test("resolves aliases through the explicit alias table", () => {
|
|
305
|
-
const identity = resolveAgentAlias("@huddy", [
|
|
306
|
-
{
|
|
307
|
-
alias: "huddy",
|
|
308
|
-
target: {
|
|
309
|
-
definitionId: "hudson",
|
|
310
|
-
workspaceQualifier: "hudson-main-8012ac",
|
|
311
|
-
harness: "codex",
|
|
312
|
-
nodeQualifier: "arachs-mac-mini-local",
|
|
313
|
-
},
|
|
314
|
-
},
|
|
315
|
-
]);
|
|
316
|
-
|
|
317
|
-
expect(identity).toEqual({
|
|
318
|
-
raw: "hudson.hudson-main-8012ac.harness:codex.node:arachs-mac-mini-local",
|
|
319
|
-
label: "@hudson.hudson-main-8012ac.harness:codex.node:arachs-mac-mini-local",
|
|
320
|
-
definitionId: "hudson",
|
|
321
|
-
workspaceQualifier: "hudson-main-8012ac",
|
|
322
|
-
harness: "codex",
|
|
323
|
-
nodeQualifier: "arachs-mac-mini-local",
|
|
324
|
-
});
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
test("formats the shortest unambiguous identity for a candidate", () => {
|
|
328
|
-
expect(formatMinimalAgentIdentity(candidates[0], candidates)).toBe("@arc");
|
|
329
|
-
expect(formatMinimalAgentIdentity(candidates[1], candidates)).toBe("@arc.main.profile:dev-browser");
|
|
330
|
-
expect(formatMinimalAgentIdentity(candidates[2], candidates)).toBe("@arc.super-refactor");
|
|
331
|
-
expect(formatMinimalAgentIdentity(candidates[3], candidates)).toBe("@huddy");
|
|
332
|
-
expect(formatMinimalAgentIdentity(candidates[4], candidates)).toBe(
|
|
333
|
-
"@hudson.profile:dev-browser",
|
|
334
|
-
);
|
|
335
|
-
expect(formatMinimalAgentIdentity(candidates[5], candidates)).toBe("@hudson.node:backup-mac-mini");
|
|
336
|
-
});
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
describe("scout dispatcher reservation", () => {
|
|
340
|
-
test("reserves the scout definition id", () => {
|
|
341
|
-
expect(SCOUT_DISPATCHER_AGENT_ID).toBe("scout");
|
|
342
|
-
expect(OPENSCOUT_COORDINATOR_AGENT_ID).toBe("openscout");
|
|
343
|
-
expect(isReservedAgentDefinitionId("scout")).toBe(true);
|
|
344
|
-
expect(isReservedAgentDefinitionId("Scout")).toBe(true);
|
|
345
|
-
expect(isReservedAgentDefinitionId("SCOUT ")).toBe(true);
|
|
346
|
-
expect(isReservedAgentDefinitionId("scoutie")).toBe(false);
|
|
347
|
-
expect(isReservedAgentDefinitionId("scout-ie")).toBe(false);
|
|
348
|
-
expect(isReservedAgentDefinitionId("")).toBe(false);
|
|
349
|
-
expect(isReservedAgentDefinitionId(null)).toBe(false);
|
|
350
|
-
expect(isReservedAgentDefinitionId(undefined)).toBe(false);
|
|
351
|
-
});
|
|
352
|
-
|
|
353
|
-
test("resolves @scout to the stable OpenScout coordinator", () => {
|
|
354
|
-
const identity = parseAgentIdentity("@scout");
|
|
355
|
-
expect(identity).not.toBeNull();
|
|
356
|
-
const candidates = [
|
|
357
|
-
{
|
|
358
|
-
agentId: "openscout.main.mini",
|
|
359
|
-
definitionId: "openscout",
|
|
360
|
-
nodeQualifier: "mini",
|
|
361
|
-
workspaceQualifier: "main",
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
agentId: "ranger.main.mini",
|
|
365
|
-
definitionId: "ranger",
|
|
366
|
-
nodeQualifier: "mini",
|
|
367
|
-
workspaceQualifier: "main",
|
|
368
|
-
},
|
|
369
|
-
];
|
|
370
|
-
const result = diagnoseAgentIdentity(identity!, candidates);
|
|
371
|
-
expect(result.kind).toBe("resolved");
|
|
372
|
-
if (result.kind === "resolved") {
|
|
373
|
-
expect(result.match.agentId).toBe("openscout.main.mini");
|
|
374
|
-
}
|
|
375
|
-
expect(formatMinimalAgentIdentity(candidates[0]!, candidates)).toBe("@scout");
|
|
376
|
-
});
|
|
377
|
-
});
|
|
378
|
-
|
|
379
|
-
describe("agent identity diagnosis", () => {
|
|
380
|
-
const scoutieMiniMain = {
|
|
381
|
-
agentId: "scoutie.mini.main",
|
|
382
|
-
definitionId: "scoutie",
|
|
383
|
-
nodeQualifier: "mini",
|
|
384
|
-
workspaceQualifier: "main",
|
|
385
|
-
aliases: ["@scoutie.main.node:mini", "@scoutie"],
|
|
386
|
-
};
|
|
387
|
-
const scoutieMainMini = {
|
|
388
|
-
agentId: "scoutie.main.mini",
|
|
389
|
-
definitionId: "scoutie",
|
|
390
|
-
nodeQualifier: "mini",
|
|
391
|
-
workspaceQualifier: "main",
|
|
392
|
-
aliases: ["@scoutie.main.node:mini", "@scoutie"],
|
|
393
|
-
};
|
|
394
|
-
const arachMini = {
|
|
395
|
-
agentId: "arach.mini",
|
|
396
|
-
definitionId: "arach",
|
|
397
|
-
nodeQualifier: "mini",
|
|
398
|
-
aliases: ["@arach.node:mini", "@arach"],
|
|
399
|
-
};
|
|
400
|
-
|
|
401
|
-
test("returns resolved when exactly one candidate matches", () => {
|
|
402
|
-
const identity = parseAgentIdentity("@arach");
|
|
403
|
-
expect(identity).not.toBeNull();
|
|
404
|
-
const result = diagnoseAgentIdentity(identity!, [scoutieMiniMain, arachMini]);
|
|
405
|
-
expect(result.kind).toBe("resolved");
|
|
406
|
-
if (result.kind === "resolved") {
|
|
407
|
-
expect(result.match.agentId).toBe("arach.mini");
|
|
408
|
-
}
|
|
409
|
-
});
|
|
410
|
-
|
|
411
|
-
test("returns ambiguous when multiple exact alias matches exist", () => {
|
|
412
|
-
const identity = parseAgentIdentity("@scoutie");
|
|
413
|
-
expect(identity).not.toBeNull();
|
|
414
|
-
const result = diagnoseAgentIdentity(identity!, [scoutieMiniMain, scoutieMainMini, arachMini]);
|
|
415
|
-
expect(result.kind).toBe("ambiguous");
|
|
416
|
-
if (result.kind === "ambiguous") {
|
|
417
|
-
expect(result.candidates.map((c) => c.agentId).sort()).toEqual([
|
|
418
|
-
"scoutie.main.mini",
|
|
419
|
-
"scoutie.mini.main",
|
|
420
|
-
]);
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
|
|
424
|
-
test("returns unknown when no candidate matches", () => {
|
|
425
|
-
const identity = parseAgentIdentity("@nonexistent");
|
|
426
|
-
expect(identity).not.toBeNull();
|
|
427
|
-
const result = diagnoseAgentIdentity(identity!, [scoutieMiniMain, arachMini]);
|
|
428
|
-
expect(result.kind).toBe("unknown");
|
|
429
|
-
});
|
|
430
|
-
|
|
431
|
-
test("resolveAgentIdentity returns null on ambiguity (back-compat)", () => {
|
|
432
|
-
const identity = parseAgentIdentity("@scoutie");
|
|
433
|
-
expect(resolveAgentIdentity(identity!, [scoutieMiniMain, scoutieMainMini])).toBeNull();
|
|
434
|
-
});
|
|
435
|
-
});
|
package/src/agent-selectors.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./agent-address.js";
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
|
|
3
|
-
import { buildScoutReturnAddress } from "./scout-agent-card";
|
|
4
|
-
|
|
5
|
-
describe("buildScoutReturnAddress", () => {
|
|
6
|
-
test("keeps only meaningful optional fields", () => {
|
|
7
|
-
const address = buildScoutReturnAddress({
|
|
8
|
-
actorId: "dewey.node.workspace",
|
|
9
|
-
handle: "dewey",
|
|
10
|
-
displayName: "Dewey",
|
|
11
|
-
selector: "@dewey.node.workspace",
|
|
12
|
-
defaultSelector: "@dewey",
|
|
13
|
-
conversationId: "dm.dewey.arc",
|
|
14
|
-
replyToMessageId: "msg-1",
|
|
15
|
-
nodeId: "node-1",
|
|
16
|
-
projectRoot: "/Users/arach/dev/dewey",
|
|
17
|
-
sessionId: "relay-dewey-claude",
|
|
18
|
-
metadata: {
|
|
19
|
-
surface: "scout-card",
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
expect(address).toEqual({
|
|
24
|
-
actorId: "dewey.node.workspace",
|
|
25
|
-
handle: "dewey",
|
|
26
|
-
displayName: "Dewey",
|
|
27
|
-
selector: "@dewey.node.workspace",
|
|
28
|
-
defaultSelector: "@dewey",
|
|
29
|
-
conversationId: "dm.dewey.arc",
|
|
30
|
-
replyToMessageId: "msg-1",
|
|
31
|
-
nodeId: "node-1",
|
|
32
|
-
projectRoot: "/Users/arach/dev/dewey",
|
|
33
|
-
sessionId: "relay-dewey-claude",
|
|
34
|
-
metadata: {
|
|
35
|
-
surface: "scout-card",
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
test("drops empty optional fields", () => {
|
|
41
|
-
const address = buildScoutReturnAddress({
|
|
42
|
-
actorId: "arc",
|
|
43
|
-
handle: "arc",
|
|
44
|
-
displayName: " ",
|
|
45
|
-
selector: " ",
|
|
46
|
-
metadata: {},
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
expect(address).toEqual({
|
|
50
|
-
actorId: "arc",
|
|
51
|
-
handle: "arc",
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
});
|