@openscout/protocol 0.2.64 → 0.2.82
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
package/dist/scout-delivery.d.ts
CHANGED
|
@@ -1,11 +1,65 @@
|
|
|
1
1
|
import type { ConversationDefinition } from "./conversations.js";
|
|
2
2
|
import type { MetadataMap, ScoutId } from "./common.js";
|
|
3
|
+
import type { CollaborationAcceptanceState, CollaborationPriority, WorkItemRecord } from "./collaboration.js";
|
|
3
4
|
import type { FlightRecord, InvocationExecutionPreference } from "./invocations.js";
|
|
4
|
-
import type { MessageRecord } from "./messages.js";
|
|
5
|
+
import type { MessageAttachment, MessageRecord } from "./messages.js";
|
|
5
6
|
import type { ScoutCallerContext, ScoutDispatchRecord, ScoutRoutePolicy, ScoutRouteTarget } from "./scout-dispatch.js";
|
|
7
|
+
import type { RouteAliasResolutionProof } from "./route-aliases.js";
|
|
8
|
+
import type { ScoutExecutionResolution, ScoutRuntimeResolutionSource } from "./runtime-execution.js";
|
|
6
9
|
export type ScoutDeliverIntent = "tell" | "consult";
|
|
10
|
+
export type ScoutOperatorSignalKind = "notify" | "consult" | "need";
|
|
11
|
+
/**
|
|
12
|
+
* An agent-authored signal for its human operator.
|
|
13
|
+
*
|
|
14
|
+
* The three kinds are separated by what the agent does next, which is the only
|
|
15
|
+
* distinction the operator actually acts on:
|
|
16
|
+
*
|
|
17
|
+
* notify — FYI. The agent keeps going and expects nothing back.
|
|
18
|
+
* consult — input would help, and the agent has already decided what it will
|
|
19
|
+
* do without it (`defaultAction`). Silence is a valid answer.
|
|
20
|
+
* need — the agent cannot proceed. Silence is NOT an answer, so this is
|
|
21
|
+
* the only kind that is blocking, and the only one that raises the
|
|
22
|
+
* operator's needs-you surface.
|
|
23
|
+
*
|
|
24
|
+
* `notify` and `consult` stay conversational side effects: they never create a
|
|
25
|
+
* flight and never imply the agent is waiting. `need` is the exception on
|
|
26
|
+
* purpose — it is the agent declaring that the next move is yours.
|
|
27
|
+
*
|
|
28
|
+
* This is the declared counterpart to harness-level attention inference. An
|
|
29
|
+
* inferred stall says "something looks stuck"; a `need` says "here is exactly
|
|
30
|
+
* what I want from you", authored by the agent, and cannot be created without
|
|
31
|
+
* a question (enforced at the CLI boundary, not filtered downstream).
|
|
32
|
+
*/
|
|
33
|
+
export type ScoutOperatorSignal = {
|
|
34
|
+
kind: "notify";
|
|
35
|
+
blocking: false;
|
|
36
|
+
replyExpectation: "none";
|
|
37
|
+
} | {
|
|
38
|
+
kind: "consult";
|
|
39
|
+
blocking: false;
|
|
40
|
+
replyExpectation: "optional";
|
|
41
|
+
defaultAction: string;
|
|
42
|
+
} | {
|
|
43
|
+
kind: "need";
|
|
44
|
+
blocking: true;
|
|
45
|
+
replyExpectation: "required";
|
|
46
|
+
/** What the agent is asking for. Never empty — that is the whole point. */
|
|
47
|
+
question: string;
|
|
48
|
+
/** Optional discrete choices, when the answer is a selection. */
|
|
49
|
+
options?: string[];
|
|
50
|
+
/** Why the agent cannot continue without it. */
|
|
51
|
+
blockedReason?: string;
|
|
52
|
+
};
|
|
7
53
|
export type ScoutDeliverRouteKind = "dm" | "channel" | "broadcast";
|
|
8
|
-
export type
|
|
54
|
+
export type ScoutProjectAgentPersistence = "one_time" | "sticky";
|
|
55
|
+
export interface ScoutProjectAgentSpec {
|
|
56
|
+
persistence?: ScoutProjectAgentPersistence;
|
|
57
|
+
/** Human-addressable handle, without requiring the caller to include "@". */
|
|
58
|
+
handle?: string;
|
|
59
|
+
}
|
|
60
|
+
export type ScoutDeliveryRemediationKind = "choose_target" | "register_target" | "wake_target" | "retry_later" | "use_current_registration" | "session_reference_not_attachable"
|
|
61
|
+
/** @deprecated use use_current_registration or session_reference_not_attachable */
|
|
62
|
+
| "stale_reference";
|
|
9
63
|
export type ScoutDeliverRejectReason = "unknown_target" | "ambiguous_target" | "invalid_target" | "missing_target";
|
|
10
64
|
export interface ScoutDeliverRequest {
|
|
11
65
|
id?: ScoutId;
|
|
@@ -13,20 +67,37 @@ export interface ScoutDeliverRequest {
|
|
|
13
67
|
requesterId?: ScoutId;
|
|
14
68
|
requesterNodeId?: ScoutId;
|
|
15
69
|
body: string;
|
|
70
|
+
attachments?: MessageAttachment[];
|
|
16
71
|
intent: ScoutDeliverIntent;
|
|
17
72
|
target?: ScoutRouteTarget;
|
|
18
73
|
targetLabel?: string;
|
|
19
74
|
targetAgentId?: ScoutId;
|
|
75
|
+
targetSessionId?: ScoutId;
|
|
20
76
|
routePolicy?: ScoutRoutePolicy;
|
|
21
77
|
channel?: string;
|
|
22
78
|
replyToMessageId?: ScoutId;
|
|
79
|
+
replyToSessionId?: ScoutId;
|
|
23
80
|
speechText?: string;
|
|
24
81
|
ensureAwake?: boolean;
|
|
25
82
|
execution?: InvocationExecutionPreference;
|
|
83
|
+
executionSource?: Partial<Record<"harness" | "model" | "reasoningEffort", ScoutRuntimeResolutionSource>>;
|
|
84
|
+
projectAgent?: ScoutProjectAgentSpec;
|
|
85
|
+
labels?: string[];
|
|
26
86
|
createdAt?: number;
|
|
27
87
|
collaborationRecordId?: ScoutId;
|
|
88
|
+
workItem?: {
|
|
89
|
+
id?: ScoutId;
|
|
90
|
+
title: string;
|
|
91
|
+
summary?: string;
|
|
92
|
+
priority?: CollaborationPriority;
|
|
93
|
+
labels?: string[];
|
|
94
|
+
parentId?: ScoutId;
|
|
95
|
+
acceptanceState?: CollaborationAcceptanceState;
|
|
96
|
+
metadata?: MetadataMap;
|
|
97
|
+
};
|
|
28
98
|
messageMetadata?: MetadataMap;
|
|
29
99
|
invocationMetadata?: MetadataMap;
|
|
100
|
+
operatorSignal?: ScoutOperatorSignal;
|
|
30
101
|
}
|
|
31
102
|
export interface ScoutDeliveryReceipt {
|
|
32
103
|
requestId: ScoutId;
|
|
@@ -34,12 +105,18 @@ export interface ScoutDeliveryReceipt {
|
|
|
34
105
|
requesterId: ScoutId;
|
|
35
106
|
requesterNodeId: ScoutId;
|
|
36
107
|
targetAgentId?: ScoutId;
|
|
108
|
+
targetSessionId?: ScoutId;
|
|
37
109
|
targetLabel?: string;
|
|
110
|
+
/** Provisional routable pointer (e.g. project-chopin) when target is cardless. */
|
|
111
|
+
sessionAlias?: string;
|
|
38
112
|
bindingRef?: string;
|
|
39
113
|
conversationId: ScoutId;
|
|
40
114
|
messageId: ScoutId;
|
|
41
115
|
flightId?: ScoutId;
|
|
116
|
+
/** Per-dimension requested/resolved launch truth available at acceptance. */
|
|
117
|
+
executionResolution?: ScoutExecutionResolution;
|
|
42
118
|
acceptedAt: number;
|
|
119
|
+
aliasResolution?: RouteAliasResolutionProof;
|
|
43
120
|
}
|
|
44
121
|
export interface ScoutDeliveryRemediationAction {
|
|
45
122
|
kind: ScoutDeliveryRemediationKind;
|
|
@@ -56,15 +133,32 @@ export interface ScoutDeliverAcceptedResponse {
|
|
|
56
133
|
conversation: ConversationDefinition;
|
|
57
134
|
message: MessageRecord;
|
|
58
135
|
targetAgentId?: ScoutId;
|
|
136
|
+
targetSessionId?: ScoutId;
|
|
137
|
+
sessionAlias?: string;
|
|
59
138
|
bindingRef?: string;
|
|
139
|
+
aliasResolution?: RouteAliasResolutionProof;
|
|
60
140
|
flight?: FlightRecord;
|
|
141
|
+
workItem?: WorkItemRecord;
|
|
61
142
|
}
|
|
62
|
-
|
|
143
|
+
/**
|
|
144
|
+
* A routing clarification: delivery was not accepted and the caller is asked to
|
|
145
|
+
* clarify or re-route the carried {@link ScoutDispatchRecord}. This is unrelated to
|
|
146
|
+
* the collaboration `question` kind ({@link QuestionRecord}) — the `question` field
|
|
147
|
+
* here carries the dispatch, and the wire `kind` discriminant stays `"question"` for
|
|
148
|
+
* backward compatibility.
|
|
149
|
+
*/
|
|
150
|
+
export interface ScoutDeliverClarificationResponse {
|
|
63
151
|
kind: "question";
|
|
64
152
|
accepted: false;
|
|
65
153
|
question: ScoutDispatchRecord;
|
|
66
154
|
remediation?: ScoutDeliveryRemediationAction;
|
|
67
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* @deprecated Renamed to {@link ScoutDeliverClarificationResponse}. This routing
|
|
158
|
+
* clarification is distinct from the collaboration `question` kind. Retained as an
|
|
159
|
+
* alias for backward compatibility.
|
|
160
|
+
*/
|
|
161
|
+
export type ScoutDeliverQuestionResponse = ScoutDeliverClarificationResponse;
|
|
68
162
|
export interface ScoutDeliverRejectedResponse {
|
|
69
163
|
kind: "rejected";
|
|
70
164
|
accepted: false;
|
|
@@ -72,4 +166,5 @@ export interface ScoutDeliverRejectedResponse {
|
|
|
72
166
|
rejection: ScoutDispatchRecord;
|
|
73
167
|
remediation?: ScoutDeliveryRemediationAction;
|
|
74
168
|
}
|
|
75
|
-
export type ScoutDeliverResponse = ScoutDeliverAcceptedResponse |
|
|
169
|
+
export type ScoutDeliverResponse = ScoutDeliverAcceptedResponse | ScoutDeliverClarificationResponse | ScoutDeliverRejectedResponse;
|
|
170
|
+
//# sourceMappingURL=scout-delivery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scout-delivery.d.ts","sourceRoot":"","sources":["../src/scout-delivery.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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jC,4BAA4B,CAAC"}
|
package/dist/scout-dispatch.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { WakePolicy } from "./actors.js";
|
|
1
|
+
import type { AgentHarness, WakePolicy } from "./actors.js";
|
|
2
2
|
import type { AdvertiseScope, DeliveryTransport, MetadataMap, ScoutId } from "./common.js";
|
|
3
|
+
import type { RouteAliasDiagnosticCode, RouteAliasResolutionProof, RouteAliasScope } from "./route-aliases.js";
|
|
3
4
|
export type ScoutDispatchKind = "ambiguous" | "unknown" | "unparseable" | "unavailable";
|
|
4
5
|
export type ScoutCandidateEndpointState = "online" | "offline" | "unknown";
|
|
5
|
-
export type ScoutRouteTargetKind = "agent_id" | "agent_label" | "binding_ref" | "channel" | "broadcast";
|
|
6
|
+
export type ScoutRouteTargetKind = "agent_id" | "agent_label" | "existing_handle" | "runtime_profile" | "route_alias" | "target_handle" | "session_id" | "binding_ref" | "project_path" | "channel" | "broadcast";
|
|
6
7
|
export type ScoutRouteAmbiguousPolicy = "reject" | "ask";
|
|
7
8
|
export interface ScoutCallerContext {
|
|
8
9
|
actorId?: ScoutId;
|
|
@@ -20,10 +21,39 @@ export type ScoutRouteTarget = {
|
|
|
20
21
|
kind: "agent_label";
|
|
21
22
|
label: string;
|
|
22
23
|
value?: string;
|
|
24
|
+
} | {
|
|
25
|
+
kind: "existing_handle";
|
|
26
|
+
handle: string;
|
|
27
|
+
value?: string;
|
|
28
|
+
} | {
|
|
29
|
+
kind: "runtime_profile";
|
|
30
|
+
profile: string;
|
|
31
|
+
projectPath: string;
|
|
32
|
+
reasoningEffort?: string;
|
|
33
|
+
value?: string;
|
|
34
|
+
} | {
|
|
35
|
+
kind: "route_alias";
|
|
36
|
+
alias: string;
|
|
37
|
+
scope?: RouteAliasScope;
|
|
38
|
+
bindingId?: ScoutId;
|
|
39
|
+
value?: string;
|
|
40
|
+
} | {
|
|
41
|
+
kind: "target_handle";
|
|
42
|
+
handle: string;
|
|
43
|
+
value?: string;
|
|
44
|
+
} | {
|
|
45
|
+
kind: "session_id";
|
|
46
|
+
sessionId: ScoutId;
|
|
47
|
+
harness?: AgentHarness;
|
|
48
|
+
value?: string;
|
|
23
49
|
} | {
|
|
24
50
|
kind: "binding_ref";
|
|
25
51
|
ref: string;
|
|
26
52
|
value?: string;
|
|
53
|
+
} | {
|
|
54
|
+
kind: "project_path";
|
|
55
|
+
projectPath: string;
|
|
56
|
+
value?: string;
|
|
27
57
|
} | {
|
|
28
58
|
kind: "channel";
|
|
29
59
|
channel: string;
|
|
@@ -35,9 +65,13 @@ export type ScoutRouteTarget = {
|
|
|
35
65
|
export interface ScoutRoutePolicy {
|
|
36
66
|
preferLocalNodeId?: ScoutId;
|
|
37
67
|
ambiguous?: ScoutRouteAmbiguousPolicy;
|
|
68
|
+
allowHistoricalDirectId?: boolean;
|
|
69
|
+
/** @deprecated use allowHistoricalDirectId */
|
|
38
70
|
allowStaleDirectId?: boolean;
|
|
39
71
|
}
|
|
40
|
-
export type ScoutDispatchUnavailableReason = "manual_wake_required" | "retired" | "
|
|
72
|
+
export type ScoutDispatchUnavailableReason = "manual_wake_required" | "retired" | "superseded_registration" | "session_reference_not_attachable"
|
|
73
|
+
/** @deprecated use superseded_registration or session_reference_not_attachable */
|
|
74
|
+
| "stale_registration" | "unknown";
|
|
41
75
|
export interface ScoutDispatchCandidate {
|
|
42
76
|
agentId: ScoutId;
|
|
43
77
|
displayName: string;
|
|
@@ -71,6 +105,8 @@ export interface ScoutDispatchEnvelope {
|
|
|
71
105
|
target?: ScoutDispatchUnavailableTarget;
|
|
72
106
|
dispatchedAt: number;
|
|
73
107
|
dispatcherNodeId: ScoutId;
|
|
108
|
+
diagnosticCode?: RouteAliasDiagnosticCode;
|
|
109
|
+
aliasResolution?: RouteAliasResolutionProof;
|
|
74
110
|
}
|
|
75
111
|
export interface ScoutDispatchRecord extends ScoutDispatchEnvelope {
|
|
76
112
|
id: ScoutId;
|
|
@@ -78,3 +114,4 @@ export interface ScoutDispatchRecord extends ScoutDispatchEnvelope {
|
|
|
78
114
|
conversationId?: ScoutId;
|
|
79
115
|
requesterId?: ScoutId;
|
|
80
116
|
}
|
|
117
|
+
//# sourceMappingURL=scout-dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scout-dispatch.d.ts","sourceRoot":"","sources":["../src/scout-dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3F,OAAO,KAAK,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE/G,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,aAAa,CAAC;AAExF,MAAM,MAAM,2BAA2B,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAE3E,MAAM,MAAM,oBAAoB,GAC5B,UAAU,GACV,aAAa,GACb,iBAAiB,GACjB,iBAAiB,GACjB,aAAa,GACb,eAAe,GACf,YAAY,GACZ,aAAa,GACb,cAAc,GACd,SAAS,GACT,WAAW,CAAC;AAEhB,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEzD,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,WAAW,CAAC;CACxB;AAED,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CA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MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,sBAAsB,EAAE,CAAC;IACrC,MAAM,CAAC,EAAE,8BAA8B,CAAC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,wBAAwB,CAAC;IAC1C,eAAe,CAAC,EAAE,yBAAyB,CAAC;CAC7C;AAED,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;IAChE,EAAE,EAAE,OAAO,CAAC;IACZ,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scout-reply-context.d.ts","sourceRoot":"","sources":["../src/scout-reply-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,MAAM,cAAc,GAAG,gBAAgB,GAAG,WAAW,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,cAAc,CAAC;IAC1B,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { MetadataMap, ScoutId } from "./common.js";
|
|
2
|
+
export type ScoutSessionDisplayPhase = "idle" | "running" | "waiting" | "failed" | "completed";
|
|
3
|
+
export interface ScoutDisplayMessage {
|
|
4
|
+
id: ScoutId;
|
|
5
|
+
role: "user" | "assistant" | "system";
|
|
6
|
+
text?: string;
|
|
7
|
+
updatedAt: number;
|
|
8
|
+
metadata?: MetadataMap;
|
|
9
|
+
}
|
|
10
|
+
export interface ScoutDisplayTool {
|
|
11
|
+
id: ScoutId;
|
|
12
|
+
name: string;
|
|
13
|
+
status: "running" | "completed" | "failed";
|
|
14
|
+
summary?: string;
|
|
15
|
+
updatedAt: number;
|
|
16
|
+
metadata?: MetadataMap;
|
|
17
|
+
}
|
|
18
|
+
export interface ScoutDisplayAttentionItem {
|
|
19
|
+
id: ScoutId;
|
|
20
|
+
kind: "question" | "approval" | "permission" | "waiting";
|
|
21
|
+
title: string;
|
|
22
|
+
summary?: string;
|
|
23
|
+
sourceRef?: string;
|
|
24
|
+
updatedAt: number;
|
|
25
|
+
metadata?: MetadataMap;
|
|
26
|
+
}
|
|
27
|
+
export interface ScoutDisplaySubagent {
|
|
28
|
+
id: ScoutId;
|
|
29
|
+
agentType?: string;
|
|
30
|
+
title: string;
|
|
31
|
+
status: "running" | "completed" | "failed";
|
|
32
|
+
summary?: string;
|
|
33
|
+
updatedAt: number;
|
|
34
|
+
metadata?: MetadataMap;
|
|
35
|
+
}
|
|
36
|
+
export interface ScoutDisplayTask {
|
|
37
|
+
id: ScoutId;
|
|
38
|
+
title: string;
|
|
39
|
+
status: "pending" | "in_progress" | "completed";
|
|
40
|
+
updatedAt: number;
|
|
41
|
+
metadata?: MetadataMap;
|
|
42
|
+
}
|
|
43
|
+
export interface ScoutDisplayUsage {
|
|
44
|
+
inputTokens?: number;
|
|
45
|
+
outputTokens?: number;
|
|
46
|
+
totalTokens?: number;
|
|
47
|
+
source?: "provider_exact" | "tokenizer_estimate" | "char_heuristic" | "manual_estimate";
|
|
48
|
+
}
|
|
49
|
+
export interface ScoutDisplayTurn {
|
|
50
|
+
id: ScoutId;
|
|
51
|
+
status: "streaming" | "completed" | "interrupted" | "error";
|
|
52
|
+
startedAt: number;
|
|
53
|
+
endedAt?: number;
|
|
54
|
+
blockCount: number;
|
|
55
|
+
messageCount: number;
|
|
56
|
+
toolCount: number;
|
|
57
|
+
attentionCount: number;
|
|
58
|
+
summary?: string;
|
|
59
|
+
updatedAt: number;
|
|
60
|
+
metadata?: MetadataMap;
|
|
61
|
+
}
|
|
62
|
+
export interface ScoutSessionDisplayState {
|
|
63
|
+
sessionId: ScoutId;
|
|
64
|
+
phase: ScoutSessionDisplayPhase;
|
|
65
|
+
currentMessage: ScoutDisplayMessage | null;
|
|
66
|
+
activeTools: Record<ScoutId, ScoutDisplayTool>;
|
|
67
|
+
attention: Record<ScoutId, ScoutDisplayAttentionItem>;
|
|
68
|
+
activeSubagents: Record<ScoutId, ScoutDisplaySubagent>;
|
|
69
|
+
turns: ScoutDisplayTurn[];
|
|
70
|
+
tasks: ScoutDisplayTask[];
|
|
71
|
+
usage?: ScoutDisplayUsage;
|
|
72
|
+
updatedAt: number;
|
|
73
|
+
metadata?: MetadataMap;
|
|
74
|
+
}
|
|
75
|
+
export type ScoutSessionDisplayEvent = {
|
|
76
|
+
type: "phase_changed";
|
|
77
|
+
phase: ScoutSessionDisplayPhase;
|
|
78
|
+
at: number;
|
|
79
|
+
} | {
|
|
80
|
+
type: "message_updated";
|
|
81
|
+
message: ScoutDisplayMessage;
|
|
82
|
+
at?: number;
|
|
83
|
+
} | {
|
|
84
|
+
type: "tool_started";
|
|
85
|
+
tool: ScoutDisplayTool;
|
|
86
|
+
at?: number;
|
|
87
|
+
} | {
|
|
88
|
+
type: "tool_finished";
|
|
89
|
+
toolId: ScoutId;
|
|
90
|
+
failed?: boolean;
|
|
91
|
+
summary?: string;
|
|
92
|
+
at: number;
|
|
93
|
+
} | {
|
|
94
|
+
type: "attention_opened";
|
|
95
|
+
item: ScoutDisplayAttentionItem;
|
|
96
|
+
at?: number;
|
|
97
|
+
} | {
|
|
98
|
+
type: "attention_closed";
|
|
99
|
+
itemId: ScoutId;
|
|
100
|
+
at: number;
|
|
101
|
+
} | {
|
|
102
|
+
type: "subagent_started";
|
|
103
|
+
subagent: ScoutDisplaySubagent;
|
|
104
|
+
at?: number;
|
|
105
|
+
} | {
|
|
106
|
+
type: "subagent_finished";
|
|
107
|
+
subagentId: ScoutId;
|
|
108
|
+
failed?: boolean;
|
|
109
|
+
summary?: string;
|
|
110
|
+
at: number;
|
|
111
|
+
} | {
|
|
112
|
+
type: "turns_snapshot";
|
|
113
|
+
turns: ScoutDisplayTurn[];
|
|
114
|
+
at: number;
|
|
115
|
+
} | {
|
|
116
|
+
type: "tasks_snapshot";
|
|
117
|
+
tasks: ScoutDisplayTask[];
|
|
118
|
+
at: number;
|
|
119
|
+
} | {
|
|
120
|
+
type: "usage_updated";
|
|
121
|
+
usage: ScoutDisplayUsage;
|
|
122
|
+
at: number;
|
|
123
|
+
} | {
|
|
124
|
+
type: "reset_thread";
|
|
125
|
+
at: number;
|
|
126
|
+
};
|
|
127
|
+
export declare function createScoutSessionDisplayState(input: {
|
|
128
|
+
sessionId: ScoutId;
|
|
129
|
+
now?: number;
|
|
130
|
+
}): ScoutSessionDisplayState;
|
|
131
|
+
export declare function reduceScoutSessionDisplayState(state: ScoutSessionDisplayState, event: ScoutSessionDisplayEvent): ScoutSessionDisplayState;
|
|
132
|
+
//# sourceMappingURL=session-display-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-display-state.d.ts","sourceRoot":"","sources":["../src/session-display-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,wBAAwB,GAChC,MAAM,GACN,SAAS,GACT,SAAS,GACT,QAAQ,GACR,WAAW,CAAC;AAEhB,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,WAAW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;CAAE,GAC/D;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC,wBAAgB,8BAA8B,CAAC,KAAK,EAAE;IACpD,SAAS,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,wBAAwB,CAY3B;AAED,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,wBAAwB,EAC/B,KAAK,EAAE,wBAAwB,GAC9B,wBAAwB,CA8E1B"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export function createScoutSessionDisplayState(input) {
|
|
2
|
+
return {
|
|
3
|
+
sessionId: input.sessionId,
|
|
4
|
+
phase: "idle",
|
|
5
|
+
currentMessage: null,
|
|
6
|
+
activeTools: {},
|
|
7
|
+
attention: {},
|
|
8
|
+
activeSubagents: {},
|
|
9
|
+
turns: [],
|
|
10
|
+
tasks: [],
|
|
11
|
+
updatedAt: input.now ?? 0,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export function reduceScoutSessionDisplayState(state, event) {
|
|
15
|
+
switch (event.type) {
|
|
16
|
+
case "phase_changed":
|
|
17
|
+
return { ...state, phase: event.phase, updatedAt: event.at };
|
|
18
|
+
case "message_updated":
|
|
19
|
+
return { ...state, currentMessage: event.message, updatedAt: event.at ?? event.message.updatedAt };
|
|
20
|
+
case "tool_started":
|
|
21
|
+
return {
|
|
22
|
+
...state,
|
|
23
|
+
activeTools: { ...state.activeTools, [event.tool.id]: event.tool },
|
|
24
|
+
updatedAt: event.at ?? event.tool.updatedAt,
|
|
25
|
+
};
|
|
26
|
+
case "tool_finished": {
|
|
27
|
+
const current = state.activeTools[event.toolId];
|
|
28
|
+
if (!current)
|
|
29
|
+
return { ...state, updatedAt: event.at };
|
|
30
|
+
return {
|
|
31
|
+
...state,
|
|
32
|
+
activeTools: {
|
|
33
|
+
...state.activeTools,
|
|
34
|
+
[event.toolId]: {
|
|
35
|
+
...current,
|
|
36
|
+
status: event.failed ? "failed" : "completed",
|
|
37
|
+
summary: event.summary ?? current.summary,
|
|
38
|
+
updatedAt: event.at,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
updatedAt: event.at,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
case "attention_opened":
|
|
45
|
+
return {
|
|
46
|
+
...state,
|
|
47
|
+
phase: state.phase === "idle" ? "waiting" : state.phase,
|
|
48
|
+
attention: { ...state.attention, [event.item.id]: event.item },
|
|
49
|
+
updatedAt: event.at ?? event.item.updatedAt,
|
|
50
|
+
};
|
|
51
|
+
case "attention_closed": {
|
|
52
|
+
const next = { ...state.attention };
|
|
53
|
+
delete next[event.itemId];
|
|
54
|
+
return {
|
|
55
|
+
...state,
|
|
56
|
+
attention: next,
|
|
57
|
+
phase: state.phase === "waiting" && Object.keys(next).length === 0 ? "idle" : state.phase,
|
|
58
|
+
updatedAt: event.at,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
case "subagent_started":
|
|
62
|
+
return {
|
|
63
|
+
...state,
|
|
64
|
+
activeSubagents: { ...state.activeSubagents, [event.subagent.id]: event.subagent },
|
|
65
|
+
updatedAt: event.at ?? event.subagent.updatedAt,
|
|
66
|
+
};
|
|
67
|
+
case "subagent_finished": {
|
|
68
|
+
const current = state.activeSubagents[event.subagentId];
|
|
69
|
+
if (!current)
|
|
70
|
+
return { ...state, updatedAt: event.at };
|
|
71
|
+
return {
|
|
72
|
+
...state,
|
|
73
|
+
activeSubagents: {
|
|
74
|
+
...state.activeSubagents,
|
|
75
|
+
[event.subagentId]: {
|
|
76
|
+
...current,
|
|
77
|
+
status: event.failed ? "failed" : "completed",
|
|
78
|
+
summary: event.summary ?? current.summary,
|
|
79
|
+
updatedAt: event.at,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
updatedAt: event.at,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
case "turns_snapshot":
|
|
86
|
+
return { ...state, turns: [...event.turns], updatedAt: event.at };
|
|
87
|
+
case "tasks_snapshot":
|
|
88
|
+
return { ...state, tasks: [...event.tasks], updatedAt: event.at };
|
|
89
|
+
case "usage_updated":
|
|
90
|
+
return { ...state, usage: event.usage, updatedAt: event.at };
|
|
91
|
+
case "reset_thread":
|
|
92
|
+
return createScoutSessionDisplayState({ sessionId: state.sessionId, now: event.at });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Herdr session topology, projected for Scout clients.
|
|
3
|
+
*
|
|
4
|
+
* Herdr owns the real thing: workspaces, tabs, panes, layouts, and the agent
|
|
5
|
+
* records inside them. This type is a READ-ONLY PROJECTION of that topology —
|
|
6
|
+
* what Scout's terminals view needs to represent a herdr session faithfully
|
|
7
|
+
* without becoming a second layout manager. Layout coordinates and split
|
|
8
|
+
* ratios are included read-only so a client can render the arrangement
|
|
9
|
+
* faithfully; there are deliberately no mutation verbs here: if a client wants
|
|
10
|
+
* to change the topology, the handoff is the herdr client itself (`herdr
|
|
11
|
+
* session attach`, `herdr agent focus`), not a Scout control.
|
|
12
|
+
*
|
|
13
|
+
* The server builds this from `herdr --session <n> workspace list`,
|
|
14
|
+
* `tab list`, and `pane list` JSON, plus the per-tab layout geometry from
|
|
15
|
+
* `herdr --session <n> api snapshot`. A session whose server is stopped
|
|
16
|
+
* projects as `{ running: false, workspaces: [] }` — an ordinary state, not
|
|
17
|
+
* an error.
|
|
18
|
+
*/
|
|
19
|
+
/** Agent state as herdr reports it, never as Scout infers it. */
|
|
20
|
+
export type HerdrAgentStatus = "idle" | "working" | "blocked" | "done" | "unknown";
|
|
21
|
+
/**
|
|
22
|
+
* The harness-native session reference herdr reports for a pane (e.g. a Claude
|
|
23
|
+
* session id). Opaque to Scout: carried so clients can correlate, never parsed.
|
|
24
|
+
*/
|
|
25
|
+
export type HerdrAgentSessionRef = {
|
|
26
|
+
agent: string;
|
|
27
|
+
kind: string;
|
|
28
|
+
source: string;
|
|
29
|
+
value: string;
|
|
30
|
+
};
|
|
31
|
+
export type HerdrPaneProjection = {
|
|
32
|
+
paneId: string;
|
|
33
|
+
/** Herdr's stable terminal id; `herdr agent <verb>` accepts it as a target. */
|
|
34
|
+
terminalId: string | null;
|
|
35
|
+
tabId: string;
|
|
36
|
+
workspaceId: string;
|
|
37
|
+
label: string | null;
|
|
38
|
+
/** Detected/reported agent label, e.g. "claude". Null for plain shells. */
|
|
39
|
+
agent: string | null;
|
|
40
|
+
agentStatus: HerdrAgentStatus;
|
|
41
|
+
agentSession: HerdrAgentSessionRef | null;
|
|
42
|
+
cwd: string | null;
|
|
43
|
+
foregroundCwd: string | null;
|
|
44
|
+
focused: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Scrollback position as herdr reports it. `maxOffsetFromBottom` is the
|
|
47
|
+
* pane's backlog depth — the cheapest activity signal the projection has.
|
|
48
|
+
* Null when the host does not report scroll state (older herdr).
|
|
49
|
+
*/
|
|
50
|
+
scroll: HerdrPaneScroll | null;
|
|
51
|
+
};
|
|
52
|
+
export type HerdrPaneScroll = {
|
|
53
|
+
maxOffsetFromBottom: number;
|
|
54
|
+
offsetFromBottom: number;
|
|
55
|
+
viewportRows: number;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Layout geometry for one tab, read from `herdr api snapshot`. Rects are
|
|
59
|
+
* absolute terminal cell coordinates as herdr reports them (the area includes
|
|
60
|
+
* herdr's chrome offset); clients normalize against `area` to render a
|
|
61
|
+
* proportional replica.
|
|
62
|
+
*/
|
|
63
|
+
export type HerdrLayoutRect = {
|
|
64
|
+
x: number;
|
|
65
|
+
y: number;
|
|
66
|
+
width: number;
|
|
67
|
+
height: number;
|
|
68
|
+
};
|
|
69
|
+
export type HerdrLayoutPane = {
|
|
70
|
+
paneId: string;
|
|
71
|
+
focused: boolean;
|
|
72
|
+
rect: HerdrLayoutRect;
|
|
73
|
+
};
|
|
74
|
+
export type HerdrLayoutSplit = {
|
|
75
|
+
id: string | null;
|
|
76
|
+
direction: "right" | "down" | null;
|
|
77
|
+
ratio: number | null;
|
|
78
|
+
rect: HerdrLayoutRect | null;
|
|
79
|
+
};
|
|
80
|
+
export type HerdrTabLayout = {
|
|
81
|
+
tabId: string;
|
|
82
|
+
workspaceId: string;
|
|
83
|
+
area: HerdrLayoutRect;
|
|
84
|
+
focusedPaneId: string | null;
|
|
85
|
+
zoomed: boolean;
|
|
86
|
+
panes: HerdrLayoutPane[];
|
|
87
|
+
splits: HerdrLayoutSplit[];
|
|
88
|
+
};
|
|
89
|
+
export type HerdrTabProjection = {
|
|
90
|
+
tabId: string;
|
|
91
|
+
workspaceId: string;
|
|
92
|
+
label: string | null;
|
|
93
|
+
number: number | null;
|
|
94
|
+
focused: boolean;
|
|
95
|
+
agentStatus: HerdrAgentStatus;
|
|
96
|
+
panes: HerdrPaneProjection[];
|
|
97
|
+
/** Per-tab pane geometry; null when the snapshot did not cover this tab. */
|
|
98
|
+
layout: HerdrTabLayout | null;
|
|
99
|
+
};
|
|
100
|
+
export type HerdrWorkspaceProjection = {
|
|
101
|
+
workspaceId: string;
|
|
102
|
+
label: string | null;
|
|
103
|
+
number: number | null;
|
|
104
|
+
focused: boolean;
|
|
105
|
+
activeTabId: string | null;
|
|
106
|
+
agentStatus: HerdrAgentStatus;
|
|
107
|
+
tabs: HerdrTabProjection[];
|
|
108
|
+
};
|
|
109
|
+
export type HerdrSessionTopology = {
|
|
110
|
+
/** Herdr session name, e.g. "openscout". */
|
|
111
|
+
session: string;
|
|
112
|
+
/** Whether the session's herdr server answered. */
|
|
113
|
+
running: boolean;
|
|
114
|
+
workspaces: HerdrWorkspaceProjection[];
|
|
115
|
+
/** Server wall-clock when the projection was observed. */
|
|
116
|
+
observedAt: number;
|
|
117
|
+
};
|
|
118
|
+
export declare function emptyHerdrSessionTopology(session: string, running: boolean): HerdrSessionTopology;
|
|
119
|
+
//# sourceMappingURL=terminal-host-topology.d.ts.map
|
|
@@ -0,0 +1 @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,IAAI,CAAC;IAC3B,WAAW,EAAE,gBAAgB,CAAC;IAC9B,IAAI,EAAE,kBAAkB,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,wBAAwB,EAAE,CAAC;IACvC,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,oBAAoB,CAEjG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Herdr session topology, projected for Scout clients.
|
|
3
|
+
*
|
|
4
|
+
* Herdr owns the real thing: workspaces, tabs, panes, layouts, and the agent
|
|
5
|
+
* records inside them. This type is a READ-ONLY PROJECTION of that topology —
|
|
6
|
+
* what Scout's terminals view needs to represent a herdr session faithfully
|
|
7
|
+
* without becoming a second layout manager. Layout coordinates and split
|
|
8
|
+
* ratios are included read-only so a client can render the arrangement
|
|
9
|
+
* faithfully; there are deliberately no mutation verbs here: if a client wants
|
|
10
|
+
* to change the topology, the handoff is the herdr client itself (`herdr
|
|
11
|
+
* session attach`, `herdr agent focus`), not a Scout control.
|
|
12
|
+
*
|
|
13
|
+
* The server builds this from `herdr --session <n> workspace list`,
|
|
14
|
+
* `tab list`, and `pane list` JSON, plus the per-tab layout geometry from
|
|
15
|
+
* `herdr --session <n> api snapshot`. A session whose server is stopped
|
|
16
|
+
* projects as `{ running: false, workspaces: [] }` — an ordinary state, not
|
|
17
|
+
* an error.
|
|
18
|
+
*/
|
|
19
|
+
export function emptyHerdrSessionTopology(session, running) {
|
|
20
|
+
return { session, running, workspaces: [], observedAt: Date.now() };
|
|
21
|
+
}
|