@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
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { ScoutId } from "./common.js";
|
|
2
|
+
|
|
3
|
+
export const SCOUT_RENDEZVOUS_GENERATED_CODENAME_LENGTH = 6;
|
|
4
|
+
export const SCOUT_RENDEZVOUS_CODENAME_MAX_LENGTH = 32;
|
|
5
|
+
// Rooms stay joinable for hours so a human can relay the codename to the
|
|
6
|
+
// second session at their own pace; per-call long-polls stay short.
|
|
7
|
+
export const SCOUT_RENDEZVOUS_INVITE_TTL_MS = 4 * 60 * 60_000;
|
|
8
|
+
export const SCOUT_RENDEZVOUS_MAX_WAIT_MS = 10 * 60_000;
|
|
9
|
+
|
|
10
|
+
export type ScoutRendezvousCreateRequest = {
|
|
11
|
+
action: "create";
|
|
12
|
+
codename?: string;
|
|
13
|
+
projectRoot: string;
|
|
14
|
+
participantId: ScoutId;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type ScoutRendezvousJoinRequest = {
|
|
18
|
+
action: "join";
|
|
19
|
+
codename: string;
|
|
20
|
+
projectRoot: string;
|
|
21
|
+
participantId: ScoutId;
|
|
22
|
+
waitMs?: number;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type ScoutRendezvousRequest =
|
|
26
|
+
| ScoutRendezvousCreateRequest
|
|
27
|
+
| ScoutRendezvousJoinRequest;
|
|
28
|
+
|
|
29
|
+
export type ScoutRendezvousCreatedResponse = {
|
|
30
|
+
status: "created";
|
|
31
|
+
codename: string;
|
|
32
|
+
projectRoot: string;
|
|
33
|
+
participantId: ScoutId;
|
|
34
|
+
createdAt: number;
|
|
35
|
+
expiresAt: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type ScoutRendezvousWaitingResponse = {
|
|
39
|
+
status: "waiting";
|
|
40
|
+
codename: string;
|
|
41
|
+
projectRoot: string;
|
|
42
|
+
participantId: ScoutId;
|
|
43
|
+
joinedAt: number;
|
|
44
|
+
expiresAt: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type ScoutRendezvousMatchedResponse = {
|
|
48
|
+
status: "matched";
|
|
49
|
+
matchId: ScoutId;
|
|
50
|
+
codename: string;
|
|
51
|
+
projectRoot: string;
|
|
52
|
+
participantId: ScoutId;
|
|
53
|
+
participantIds: [ScoutId, ScoutId];
|
|
54
|
+
peerParticipantIds: ScoutId[];
|
|
55
|
+
createdAt: number;
|
|
56
|
+
expiresAt: number;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type ScoutRendezvousCodenameBusyResponse = {
|
|
60
|
+
status: "codename_busy";
|
|
61
|
+
codename: string;
|
|
62
|
+
projectRoot: string;
|
|
63
|
+
participantId: ScoutId;
|
|
64
|
+
participantCount: number;
|
|
65
|
+
expiresAt: number;
|
|
66
|
+
suggestion: "choose_another_codename";
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export type ScoutRendezvousNotFoundResponse = {
|
|
70
|
+
status: "not_found";
|
|
71
|
+
codename: string;
|
|
72
|
+
projectRoot: string;
|
|
73
|
+
participantId: ScoutId;
|
|
74
|
+
suggestion: "check_codename_or_create";
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export type ScoutRendezvousExpiredResponse = {
|
|
78
|
+
status: "expired";
|
|
79
|
+
codename: string;
|
|
80
|
+
projectRoot: string;
|
|
81
|
+
participantId: ScoutId;
|
|
82
|
+
expiresAt: number;
|
|
83
|
+
suggestion: "choose_another_codename";
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export type ScoutRendezvousConsumedResponse = {
|
|
87
|
+
status: "consumed";
|
|
88
|
+
codename: string;
|
|
89
|
+
projectRoot: string;
|
|
90
|
+
participantId: ScoutId;
|
|
91
|
+
expiresAt: number;
|
|
92
|
+
suggestion: "choose_another_codename";
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export type ScoutRendezvousProjectMismatchResponse = {
|
|
96
|
+
status: "project_mismatch";
|
|
97
|
+
codename: string;
|
|
98
|
+
projectRoot: string;
|
|
99
|
+
participantId: ScoutId;
|
|
100
|
+
suggestion: "run_in_invitation_project";
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export type ScoutRendezvousResponse =
|
|
104
|
+
| ScoutRendezvousCreatedResponse
|
|
105
|
+
| ScoutRendezvousWaitingResponse
|
|
106
|
+
| ScoutRendezvousMatchedResponse
|
|
107
|
+
| ScoutRendezvousCodenameBusyResponse
|
|
108
|
+
| ScoutRendezvousNotFoundResponse
|
|
109
|
+
| ScoutRendezvousExpiredResponse
|
|
110
|
+
| ScoutRendezvousConsumedResponse
|
|
111
|
+
| ScoutRendezvousProjectMismatchResponse;
|
|
112
|
+
|
|
113
|
+
export type ScoutRendezvousFailureResponse = Extract<
|
|
114
|
+
ScoutRendezvousResponse,
|
|
115
|
+
{ status: "codename_busy" | "not_found" | "expired" | "consumed" | "project_mismatch" }
|
|
116
|
+
>;
|
|
117
|
+
|
|
118
|
+
export function isScoutRendezvousFailureResponse(
|
|
119
|
+
response: ScoutRendezvousResponse,
|
|
120
|
+
): response is ScoutRendezvousFailureResponse {
|
|
121
|
+
return response.status === "codename_busy"
|
|
122
|
+
|| response.status === "not_found"
|
|
123
|
+
|| response.status === "expired"
|
|
124
|
+
|| response.status === "consumed"
|
|
125
|
+
|| response.status === "project_mismatch";
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function normalizeScoutRendezvousCodename(codename: string): string {
|
|
129
|
+
return codename.normalize("NFKC").trim().toLocaleUpperCase("en-US");
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Validates a human-chosen codename while retaining its display capitalization.
|
|
134
|
+
* Case folding is only for broker lookup keys.
|
|
135
|
+
*/
|
|
136
|
+
export function validateScoutRendezvousCodename(codename: unknown): string {
|
|
137
|
+
if (typeof codename !== "string") {
|
|
138
|
+
throw new Error("codename must be a string");
|
|
139
|
+
}
|
|
140
|
+
const displayCodename = codename.normalize("NFKC").trim();
|
|
141
|
+
if (!displayCodename) {
|
|
142
|
+
throw new Error("codename must not be blank");
|
|
143
|
+
}
|
|
144
|
+
const normalized = normalizeScoutRendezvousCodename(displayCodename);
|
|
145
|
+
if (
|
|
146
|
+
normalized.length > SCOUT_RENDEZVOUS_CODENAME_MAX_LENGTH
|
|
147
|
+
|| !/^[A-Z0-9]+$/u.test(normalized)
|
|
148
|
+
) {
|
|
149
|
+
throw new Error(
|
|
150
|
+
`codename must be 1 to ${SCOUT_RENDEZVOUS_CODENAME_MAX_LENGTH} ASCII letters or digits`,
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
return displayCodename;
|
|
154
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BUILT_IN_AGENT_DEFINITION_IDS,
|
|
3
|
+
OPENSCOUT_COORDINATOR_AGENT_ID,
|
|
4
|
+
SCOUT_DISPATCHER_AGENT_ID,
|
|
5
|
+
normalizeAgentSelectorSegment,
|
|
6
|
+
} from "./agent-identity.js";
|
|
7
|
+
import {
|
|
8
|
+
SCOUT_LAUNCHABLE_HARNESSES,
|
|
9
|
+
SCOUT_REASONING_EFFORTS,
|
|
10
|
+
} from "./runtime-execution.js";
|
|
11
|
+
import { SCOUT_RESERVED_RUNTIME_PROFILE_IDS } from "./runtime-profiles.js";
|
|
12
|
+
|
|
13
|
+
export const SCOUT_RESERVED_ROUTE_WORDS = [
|
|
14
|
+
"scout",
|
|
15
|
+
"openscout",
|
|
16
|
+
"scoutbot",
|
|
17
|
+
"operator",
|
|
18
|
+
"shared",
|
|
19
|
+
"broadcast",
|
|
20
|
+
"agent",
|
|
21
|
+
"alias",
|
|
22
|
+
"target",
|
|
23
|
+
"session",
|
|
24
|
+
"ref",
|
|
25
|
+
"id",
|
|
26
|
+
"project",
|
|
27
|
+
"channel",
|
|
28
|
+
] as const;
|
|
29
|
+
|
|
30
|
+
export const SCOUT_RESERVED_DIMENSION_WORDS = [
|
|
31
|
+
"harness",
|
|
32
|
+
"model",
|
|
33
|
+
"profile",
|
|
34
|
+
"node",
|
|
35
|
+
"workspace",
|
|
36
|
+
"effort",
|
|
37
|
+
] as const;
|
|
38
|
+
|
|
39
|
+
export type ScoutReservedVocabularyKind =
|
|
40
|
+
| "harness"
|
|
41
|
+
| "profile"
|
|
42
|
+
| "effort"
|
|
43
|
+
| "route"
|
|
44
|
+
| "dimension"
|
|
45
|
+
| "product"
|
|
46
|
+
| "built_in";
|
|
47
|
+
|
|
48
|
+
const PRODUCT_IDENTITIES = new Set([
|
|
49
|
+
SCOUT_DISPATCHER_AGENT_ID,
|
|
50
|
+
OPENSCOUT_COORDINATOR_AGENT_ID,
|
|
51
|
+
"scoutbot",
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
const RESERVED_BY_KIND: ReadonlyArray<readonly [ScoutReservedVocabularyKind, ReadonlySet<string>]> = [
|
|
55
|
+
["profile", new Set(SCOUT_RESERVED_RUNTIME_PROFILE_IDS)],
|
|
56
|
+
["harness", new Set(SCOUT_LAUNCHABLE_HARNESSES)],
|
|
57
|
+
["effort", new Set(SCOUT_REASONING_EFFORTS)],
|
|
58
|
+
["dimension", new Set(SCOUT_RESERVED_DIMENSION_WORDS)],
|
|
59
|
+
["product", PRODUCT_IDENTITIES],
|
|
60
|
+
["built_in", BUILT_IN_AGENT_DEFINITION_IDS],
|
|
61
|
+
["route", new Set(SCOUT_RESERVED_ROUTE_WORDS)],
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
export const SCOUT_RESERVED_AGENT_NAMES: ReadonlySet<string> = new Set(
|
|
65
|
+
RESERVED_BY_KIND.flatMap(([, values]) => [...values]),
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
export const SCOUT_AGENT_NAME_PATTERN = /^[a-z][a-z0-9-]{0,62}$/;
|
|
69
|
+
export const SCOUT_SESSION_HANDLE_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:@/+\-]{0,127}$/;
|
|
70
|
+
|
|
71
|
+
export function scoutReservedVocabularyKind(
|
|
72
|
+
value: string | null | undefined,
|
|
73
|
+
): ScoutReservedVocabularyKind | null {
|
|
74
|
+
const normalized = normalizeAgentSelectorSegment(value ?? "");
|
|
75
|
+
if (!normalized) return null;
|
|
76
|
+
return RESERVED_BY_KIND.find(([, values]) => values.has(normalized))?.[0] ?? null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function isScoutReservedAgentName(value: string | null | undefined): boolean {
|
|
80
|
+
return scoutReservedVocabularyKind(value) !== null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type ScoutNameValidation =
|
|
84
|
+
| { ok: true; value: string }
|
|
85
|
+
| { ok: false; code: "invalid_name" | "reserved_name"; message: string };
|
|
86
|
+
|
|
87
|
+
export function validateScoutAgentNameForWrite(value: string): ScoutNameValidation {
|
|
88
|
+
const raw = value.trim().replace(/^@+/, "");
|
|
89
|
+
if (!SCOUT_AGENT_NAME_PATTERN.test(raw)) {
|
|
90
|
+
return {
|
|
91
|
+
ok: false,
|
|
92
|
+
code: "invalid_name",
|
|
93
|
+
message: `invalid_name: agent name "${value}" must match ^[a-z][a-z0-9-]{0,62}$; names are not silently rewritten`,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const kind = scoutReservedVocabularyKind(raw);
|
|
97
|
+
if (kind) {
|
|
98
|
+
const teaching = kind === "harness" || kind === "profile"
|
|
99
|
+
? ` To target a runtime, use --harness ${raw} or ${raw}/<model>/<effort>.`
|
|
100
|
+
: " Pick a non-runtime word to name an agent.";
|
|
101
|
+
return {
|
|
102
|
+
ok: false,
|
|
103
|
+
code: "reserved_name",
|
|
104
|
+
message: `reserved_name: name "${raw}" is reserved — it names a ${kind}.${teaching}`,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return { ok: true, value: raw };
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function assertScoutAgentNameForWrite(value: string): string {
|
|
111
|
+
const result = validateScoutAgentNameForWrite(value);
|
|
112
|
+
if (!result.ok) throw new Error(result.message);
|
|
113
|
+
return result.value;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Session handles are opaque but still cannot claim bare runtime grammar. */
|
|
117
|
+
export function validateScoutSessionHandleForWrite(value: string): ScoutNameValidation {
|
|
118
|
+
const raw = value.trim().replace(/^@+/, "");
|
|
119
|
+
if (!SCOUT_SESSION_HANDLE_PATTERN.test(raw)) {
|
|
120
|
+
return {
|
|
121
|
+
ok: false,
|
|
122
|
+
code: "invalid_name",
|
|
123
|
+
message: `invalid_name: session handle "${value}" contains unsupported characters`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const kind = scoutReservedVocabularyKind(raw);
|
|
127
|
+
if (kind) {
|
|
128
|
+
return {
|
|
129
|
+
ok: false,
|
|
130
|
+
code: "reserved_name",
|
|
131
|
+
message: `reserved_name: session handle "${raw}" is reserved — it names a ${kind}`,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
return { ok: true, value: raw };
|
|
135
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { AgentHarness } from "./actors.js";
|
|
2
|
+
import type { MetadataMap, ScoutId } from "./common.js";
|
|
3
|
+
|
|
4
|
+
export interface RouteAliasScope {
|
|
5
|
+
projectKey?: string;
|
|
6
|
+
projectRoot?: string;
|
|
7
|
+
nodeId?: ScoutId;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type RouteAliasTarget =
|
|
11
|
+
| { kind: "agent"; agentId: ScoutId; nodeId: ScoutId }
|
|
12
|
+
| {
|
|
13
|
+
kind: "session";
|
|
14
|
+
sessionId: ScoutId;
|
|
15
|
+
agentId: ScoutId;
|
|
16
|
+
endpointId: ScoutId;
|
|
17
|
+
nodeId: ScoutId;
|
|
18
|
+
harness: AgentHarness;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type RouteAliasState = "active" | "unset" | "expired";
|
|
22
|
+
|
|
23
|
+
export interface RouteAliasBinding {
|
|
24
|
+
id: ScoutId;
|
|
25
|
+
alias: string;
|
|
26
|
+
displayAlias?: string;
|
|
27
|
+
ownerRealmId: ScoutId;
|
|
28
|
+
scopeProjectKey: string;
|
|
29
|
+
scopeProjectRoot?: string;
|
|
30
|
+
scopeNodeId: ScoutId;
|
|
31
|
+
target: RouteAliasTarget;
|
|
32
|
+
targetSnapshot: MetadataMap;
|
|
33
|
+
state: RouteAliasState;
|
|
34
|
+
revision: number;
|
|
35
|
+
createdByActorId: ScoutId;
|
|
36
|
+
updatedByActorId: ScoutId;
|
|
37
|
+
createdAt: number;
|
|
38
|
+
updatedAt: number;
|
|
39
|
+
expiresAt?: number;
|
|
40
|
+
revokedAt?: number;
|
|
41
|
+
metadata?: MetadataMap;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type RouteAliasRevisionOperation = "set" | "repoint" | "unset" | "expire" | "repair";
|
|
45
|
+
|
|
46
|
+
export interface RouteAliasRevision {
|
|
47
|
+
id: ScoutId;
|
|
48
|
+
bindingId: ScoutId;
|
|
49
|
+
revision: number;
|
|
50
|
+
operation: RouteAliasRevisionOperation;
|
|
51
|
+
oldTarget?: RouteAliasTarget;
|
|
52
|
+
newTarget?: RouteAliasTarget;
|
|
53
|
+
oldTargetSnapshot?: MetadataMap;
|
|
54
|
+
newTargetSnapshot?: MetadataMap;
|
|
55
|
+
actorId: ScoutId;
|
|
56
|
+
authorityNodeId: ScoutId;
|
|
57
|
+
createdAt: number;
|
|
58
|
+
reason?: string;
|
|
59
|
+
requestId?: ScoutId;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface RouteAliasResolutionProof {
|
|
63
|
+
bindingId: ScoutId;
|
|
64
|
+
revision: number;
|
|
65
|
+
requestedAlias: string;
|
|
66
|
+
scope: Required<Pick<RouteAliasScope, "projectKey" | "nodeId">> & Pick<RouteAliasScope, "projectRoot">;
|
|
67
|
+
target: RouteAliasTarget;
|
|
68
|
+
resolvedAt: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export type RouteAliasDiagnosticCode =
|
|
72
|
+
| "invalid_alias"
|
|
73
|
+
| "alias_exists"
|
|
74
|
+
| "unknown_alias"
|
|
75
|
+
| "ambiguous_alias_scope"
|
|
76
|
+
| "alias_inactive"
|
|
77
|
+
| "alias_shadowed"
|
|
78
|
+
| "alias_target_unavailable"
|
|
79
|
+
| "alias_session_not_reachable"
|
|
80
|
+
| "alias_session_terminal"
|
|
81
|
+
| "not_authorized"
|
|
82
|
+
| "revision_conflict";
|
|
83
|
+
|
|
84
|
+
export interface RouteAliasSetRequest {
|
|
85
|
+
alias: string;
|
|
86
|
+
scope?: RouteAliasScope;
|
|
87
|
+
target?: import("./scout-dispatch.js").ScoutRouteTarget;
|
|
88
|
+
self?: "session" | "agent";
|
|
89
|
+
replace?: boolean;
|
|
90
|
+
expectedRevision?: number;
|
|
91
|
+
expiresAt?: number;
|
|
92
|
+
caller?: import("./scout-dispatch.js").ScoutCallerContext;
|
|
93
|
+
metadata?: MetadataMap;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface RouteAliasListRequest {
|
|
97
|
+
scope?: RouteAliasScope;
|
|
98
|
+
targetAgentId?: ScoutId;
|
|
99
|
+
targetSessionId?: ScoutId;
|
|
100
|
+
includeInactive?: boolean;
|
|
101
|
+
limit?: number;
|
|
102
|
+
caller?: import("./scout-dispatch.js").ScoutCallerContext;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface RouteAliasResolveRequest {
|
|
106
|
+
alias?: string;
|
|
107
|
+
bindingId?: ScoutId;
|
|
108
|
+
scope?: RouteAliasScope;
|
|
109
|
+
caller?: import("./scout-dispatch.js").ScoutCallerContext;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface RouteAliasResolveResult {
|
|
113
|
+
resolved: boolean;
|
|
114
|
+
available: boolean;
|
|
115
|
+
binding?: RouteAliasBinding;
|
|
116
|
+
proof?: RouteAliasResolutionProof;
|
|
117
|
+
status?: "active" | "shadowed" | "unreachable" | "terminal" | "expired" | "unset";
|
|
118
|
+
diagnostic?: { code: RouteAliasDiagnosticCode; detail: string };
|
|
119
|
+
fullyQualifiedSelector?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface RouteAliasMutationRequest {
|
|
123
|
+
target?: import("./scout-dispatch.js").ScoutRouteTarget;
|
|
124
|
+
/** Included by front doors so a non-authoritative broker can forward the mutation. */
|
|
125
|
+
scope?: RouteAliasScope;
|
|
126
|
+
expectedRevision?: number;
|
|
127
|
+
expiresAt?: number | null;
|
|
128
|
+
caller?: import("./scout-dispatch.js").ScoutCallerContext;
|
|
129
|
+
reason?: string;
|
|
130
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { AgentHarness } from "./actors.js";
|
|
2
|
+
|
|
3
|
+
/** Harness ids Scout can select for a new execution session. */
|
|
4
|
+
export const SCOUT_LAUNCHABLE_HARNESSES = [
|
|
5
|
+
"claude", "codex", "grok", "grok-acp", "kimi", "flue", "cursor", "opencode", "pi",
|
|
6
|
+
] as const satisfies readonly AgentHarness[];
|
|
7
|
+
|
|
8
|
+
export type ScoutLaunchableHarness = typeof SCOUT_LAUNCHABLE_HARNESSES[number];
|
|
9
|
+
|
|
10
|
+
export const SCOUT_REASONING_EFFORTS = [
|
|
11
|
+
"none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra",
|
|
12
|
+
] as const;
|
|
13
|
+
|
|
14
|
+
export type ScoutReasoningEffort = typeof SCOUT_REASONING_EFFORTS[number];
|
|
15
|
+
|
|
16
|
+
export const SCOUT_REASONING_EFFORT_LABELS: Readonly<Record<ScoutReasoningEffort, string>> = {
|
|
17
|
+
none: "None",
|
|
18
|
+
minimal: "Minimal",
|
|
19
|
+
low: "Light",
|
|
20
|
+
medium: "Medium",
|
|
21
|
+
high: "High",
|
|
22
|
+
xhigh: "Extra High",
|
|
23
|
+
max: "Max",
|
|
24
|
+
ultra: "Ultra",
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export interface ScoutOwnedRuntimeModel {
|
|
28
|
+
id: string;
|
|
29
|
+
label: string;
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
default?: boolean;
|
|
32
|
+
description?: string;
|
|
33
|
+
family?: string;
|
|
34
|
+
version?: string;
|
|
35
|
+
contextWindowTokens?: number;
|
|
36
|
+
reasoningEfforts?: readonly ScoutReasoningEffort[] | null;
|
|
37
|
+
defaultReasoningEffort?: ScoutReasoningEffort | null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ScoutOwnedRuntimeHarness {
|
|
41
|
+
id: ScoutLaunchableHarness;
|
|
42
|
+
label: string;
|
|
43
|
+
enabled: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Whether pickers offer this harness. Defaults to `true`; `false` keeps the
|
|
46
|
+
* harness launchable and resumable without presenting a duplicate transport
|
|
47
|
+
* as a separate operator choice.
|
|
48
|
+
*/
|
|
49
|
+
listed?: boolean;
|
|
50
|
+
default?: boolean;
|
|
51
|
+
reasoningEfforts: readonly ScoutReasoningEffort[] | null;
|
|
52
|
+
defaultReasoningEffort?: ScoutReasoningEffort | null;
|
|
53
|
+
models: readonly ScoutOwnedRuntimeModel[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface ScoutOwnedRuntimeCatalog {
|
|
57
|
+
schemaVersion: "openscout.runtime-catalog.v1";
|
|
58
|
+
revision: string;
|
|
59
|
+
harnesses: readonly ScoutOwnedRuntimeHarness[];
|
|
60
|
+
}
|