@openscout/protocol 0.2.63 → 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.
Files changed (216) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +103 -52
  3. package/dist/a2a.d.ts +224 -0
  4. package/dist/a2a.d.ts.map +1 -0
  5. package/dist/a2a.js +225 -0
  6. package/dist/activity.d.ts +70 -0
  7. package/dist/activity.d.ts.map +1 -0
  8. package/dist/activity.js +1 -0
  9. package/dist/actors.d.ts +7 -3
  10. package/dist/actors.d.ts.map +1 -0
  11. package/dist/actors.js +15 -1
  12. package/dist/agent-broker-feed.d.ts +84 -0
  13. package/dist/agent-broker-feed.d.ts.map +1 -0
  14. package/dist/agent-broker-feed.js +1 -0
  15. package/dist/agent-identity.d.ts +23 -0
  16. package/dist/agent-identity.d.ts.map +1 -0
  17. package/dist/agent-identity.js +122 -8
  18. package/dist/agent-runs.d.ts +191 -0
  19. package/dist/agent-runs.d.ts.map +1 -0
  20. package/dist/agent-runs.js +365 -0
  21. package/dist/assigned-roles.d.ts +205 -0
  22. package/dist/assigned-roles.d.ts.map +1 -0
  23. package/dist/assigned-roles.js +228 -0
  24. package/dist/broker-routes.d.ts +40 -0
  25. package/dist/broker-routes.d.ts.map +1 -0
  26. package/dist/broker-routes.js +56 -0
  27. package/dist/budget.d.ts +65 -0
  28. package/dist/budget.d.ts.map +1 -0
  29. package/dist/budget.js +19 -0
  30. package/dist/capability-matrix.d.ts +230 -0
  31. package/dist/capability-matrix.d.ts.map +1 -0
  32. package/dist/capability-matrix.js +304 -0
  33. package/dist/channel-identity.d.ts +40 -0
  34. package/dist/channel-identity.d.ts.map +1 -0
  35. package/dist/channel-identity.js +108 -0
  36. package/dist/collaboration.d.ts +45 -16
  37. package/dist/collaboration.d.ts.map +1 -0
  38. package/dist/collaboration.js +39 -23
  39. package/dist/common.d.ts +4 -3
  40. package/dist/common.d.ts.map +1 -0
  41. package/dist/conversations.d.ts +1 -0
  42. package/dist/conversations.d.ts.map +1 -0
  43. package/dist/cursor-transport.d.ts +22 -0
  44. package/dist/cursor-transport.d.ts.map +1 -0
  45. package/dist/cursor-transport.js +10 -0
  46. package/dist/debug-attach.d.ts +29 -0
  47. package/dist/debug-attach.d.ts.map +1 -0
  48. package/dist/debug-attach.js +6 -0
  49. package/dist/deliveries.d.ts +16 -2
  50. package/dist/deliveries.d.ts.map +1 -0
  51. package/dist/durable-actions.d.ts +94 -0
  52. package/dist/durable-actions.d.ts.map +1 -0
  53. package/dist/durable-actions.js +1 -0
  54. package/dist/events.d.ts +27 -1
  55. package/dist/events.d.ts.map +1 -0
  56. package/dist/events.js +14 -1
  57. package/dist/harness-feature-support.d.ts +76 -0
  58. package/dist/harness-feature-support.d.ts.map +1 -0
  59. package/dist/harness-feature-support.js +29 -0
  60. package/dist/host-integrations.d.ts +22 -0
  61. package/dist/host-integrations.d.ts.map +1 -0
  62. package/dist/host-integrations.js +64 -0
  63. package/dist/inbox.d.ts +50 -0
  64. package/dist/inbox.d.ts.map +1 -0
  65. package/dist/inbox.js +9 -0
  66. package/dist/index.d.ts +36 -2
  67. package/dist/index.d.ts.map +1 -0
  68. package/dist/index.js +35 -2
  69. package/dist/invocations.d.ts +121 -0
  70. package/dist/invocations.d.ts.map +1 -0
  71. package/dist/invocations.js +201 -1
  72. package/dist/mesh.d.ts +98 -0
  73. package/dist/mesh.d.ts.map +1 -0
  74. package/dist/mesh.js +18 -1
  75. package/dist/messages.d.ts +3 -0
  76. package/dist/messages.d.ts.map +1 -0
  77. package/dist/native-interactions.d.ts +30 -0
  78. package/dist/native-interactions.d.ts.map +1 -0
  79. package/dist/native-interactions.js +51 -0
  80. package/dist/observed-status.d.ts +33 -0
  81. package/dist/observed-status.d.ts.map +1 -0
  82. package/dist/observed-status.js +6 -0
  83. package/dist/orchestrator-prompt.d.ts +10 -0
  84. package/dist/orchestrator-prompt.d.ts.map +1 -0
  85. package/dist/orchestrator-prompt.js +36 -0
  86. package/dist/permission-policy.d.ts +5 -0
  87. package/dist/permission-policy.d.ts.map +1 -0
  88. package/dist/permission-policy.js +15 -0
  89. package/dist/provisional-agent-names.d.ts +30 -0
  90. package/dist/provisional-agent-names.d.ts.map +1 -0
  91. package/dist/provisional-agent-names.js +224 -0
  92. package/dist/read-receipts.d.ts +12 -0
  93. package/dist/read-receipts.d.ts.map +1 -0
  94. package/dist/read-receipts.js +1 -0
  95. package/dist/relay-agent-card.d.ts +10 -0
  96. package/dist/relay-agent-card.d.ts.map +1 -0
  97. package/dist/rendezvous.d.ts +97 -0
  98. package/dist/rendezvous.d.ts.map +1 -0
  99. package/dist/rendezvous.js +35 -0
  100. package/dist/reserved-vocabulary.d.ts +21 -0
  101. package/dist/reserved-vocabulary.d.ts.map +1 -0
  102. package/dist/reserved-vocabulary.js +101 -0
  103. package/dist/route-aliases.d.ts +112 -0
  104. package/dist/route-aliases.d.ts.map +1 -0
  105. package/dist/route-aliases.js +1 -0
  106. package/dist/runtime-catalog-contract.d.ts +39 -0
  107. package/dist/runtime-catalog-contract.d.ts.map +1 -0
  108. package/dist/runtime-catalog-contract.js +17 -0
  109. package/dist/runtime-catalog.d.ts +11 -0
  110. package/dist/runtime-catalog.d.ts.map +1 -0
  111. package/dist/runtime-catalog.generated.d.ts +230 -0
  112. package/dist/runtime-catalog.generated.d.ts.map +1 -0
  113. package/dist/runtime-catalog.generated.js +299 -0
  114. package/dist/runtime-catalog.js +192 -0
  115. package/dist/runtime-execution.d.ts +161 -0
  116. package/dist/runtime-execution.d.ts.map +1 -0
  117. package/dist/runtime-execution.js +327 -0
  118. package/dist/runtime-profiles.d.ts +12 -0
  119. package/dist/runtime-profiles.d.ts.map +1 -0
  120. package/dist/runtime-profiles.js +20 -0
  121. package/dist/scout-agent-card.d.ts +10 -0
  122. package/dist/scout-agent-card.d.ts.map +1 -0
  123. package/dist/scout-composer.d.ts +27 -0
  124. package/dist/scout-composer.d.ts.map +1 -0
  125. package/dist/scout-composer.js +192 -0
  126. package/dist/scout-delivery.d.ts +101 -4
  127. package/dist/scout-delivery.d.ts.map +1 -0
  128. package/dist/scout-dispatch.d.ts +44 -3
  129. package/dist/scout-dispatch.d.ts.map +1 -0
  130. package/dist/scout-reply-context.d.ts +14 -0
  131. package/dist/scout-reply-context.d.ts.map +1 -0
  132. package/dist/scout-reply-context.js +1 -0
  133. package/dist/session-display-state.d.ts +132 -0
  134. package/dist/session-display-state.d.ts.map +1 -0
  135. package/dist/session-display-state.js +94 -0
  136. package/dist/terminal-host-topology.d.ts +119 -0
  137. package/dist/terminal-host-topology.d.ts.map +1 -0
  138. package/dist/terminal-host-topology.js +21 -0
  139. package/dist/terminal-sessions.d.ts +142 -0
  140. package/dist/terminal-sessions.d.ts.map +1 -0
  141. package/dist/terminal-sessions.js +81 -0
  142. package/dist/terminal-surface-id.d.ts +73 -0
  143. package/dist/terminal-surface-id.d.ts.map +1 -0
  144. package/dist/terminal-surface-id.js +162 -0
  145. package/dist/terminal-workspaces.d.ts +199 -0
  146. package/dist/terminal-workspaces.d.ts.map +1 -0
  147. package/dist/terminal-workspaces.js +287 -0
  148. package/dist/thread-events.d.ts +1 -0
  149. package/dist/thread-events.d.ts.map +1 -0
  150. package/dist/time.d.ts +16 -0
  151. package/dist/time.d.ts.map +1 -0
  152. package/dist/time.js +33 -0
  153. package/dist/transports.d.ts +1 -0
  154. package/dist/transports.d.ts.map +1 -0
  155. package/package.json +37 -9
  156. package/src/a2a.ts +471 -0
  157. package/src/activity.ts +113 -0
  158. package/src/actors.ts +42 -8
  159. package/src/agent-broker-feed.ts +102 -0
  160. package/src/agent-identity.ts +143 -8
  161. package/src/agent-runs.ts +675 -0
  162. package/src/assigned-roles.ts +437 -0
  163. package/src/broker-routes.ts +62 -0
  164. package/src/budget.ts +88 -0
  165. package/src/capability-matrix.ts +648 -0
  166. package/src/channel-identity.ts +147 -0
  167. package/src/collaboration.ts +78 -48
  168. package/src/common.ts +24 -5
  169. package/src/cursor-transport.ts +34 -0
  170. package/src/debug-attach.ts +38 -0
  171. package/src/deliveries.ts +16 -1
  172. package/src/durable-actions.ts +125 -0
  173. package/src/events.ts +31 -0
  174. package/src/harness-feature-support.ts +116 -0
  175. package/src/host-integrations.ts +104 -0
  176. package/src/inbox.ts +68 -0
  177. package/src/index.ts +35 -2
  178. package/src/invocations.ts +353 -0
  179. package/src/mesh.ts +130 -0
  180. package/src/messages.ts +2 -0
  181. package/src/native-interactions.ts +100 -0
  182. package/src/observed-status.ts +90 -0
  183. package/src/orchestrator-prompt.ts +47 -0
  184. package/src/permission-policy.ts +21 -0
  185. package/src/provisional-agent-names.ts +272 -0
  186. package/src/read-receipts.ts +12 -0
  187. package/src/relay-agent-card.ts +73 -63
  188. package/src/rendezvous.ts +154 -0
  189. package/src/reserved-vocabulary.ts +135 -0
  190. package/src/route-aliases.ts +130 -0
  191. package/src/runtime-catalog-contract.ts +60 -0
  192. package/src/runtime-catalog.generated.ts +300 -0
  193. package/src/runtime-catalog.md +21 -0
  194. package/src/runtime-catalog.ts +193 -0
  195. package/src/runtime-catalog.v1.json +81 -0
  196. package/src/runtime-execution.ts +545 -0
  197. package/src/runtime-profiles.ts +37 -0
  198. package/src/scout-agent-card.ts +10 -0
  199. package/src/scout-composer.ts +249 -0
  200. package/src/scout-delivery.ts +117 -4
  201. package/src/scout-dispatch.ts +34 -2
  202. package/src/scout-reply-context.ts +15 -0
  203. package/src/session-display-state.ts +202 -0
  204. package/src/terminal-host-topology.ts +132 -0
  205. package/src/terminal-sessions.ts +187 -0
  206. package/src/terminal-surface-id.ts +189 -0
  207. package/src/terminal-workspaces.ts +455 -0
  208. package/src/time.ts +49 -0
  209. package/dist/agent-address.d.ts +0 -1
  210. package/dist/agent-address.js +0 -1
  211. package/dist/agent-selectors.d.ts +0 -1
  212. package/dist/agent-selectors.js +0 -1
  213. package/src/agent-address.ts +0 -1
  214. package/src/agent-identity.test.ts +0 -435
  215. package/src/agent-selectors.ts +0 -1
  216. package/src/scout-agent-card.test.ts +0 -54
package/src/events.ts CHANGED
@@ -4,16 +4,26 @@ import type { ConversationBinding, ConversationDefinition } from "./conversation
4
4
  import type { DeliveryAttempt, DeliveryIntent } from "./deliveries.js";
5
5
  import type { FlightRecord, InvocationRequest } from "./invocations.js";
6
6
  import type { MessageRecord } from "./messages.js";
7
+ import type { ConversationReadCursor } from "./read-receipts.js";
7
8
  import type { AgentDefinition, AgentEndpoint, ActorIdentity } from "./actors.js";
8
9
  import type { CollaborationEvent, CollaborationRecord } from "./collaboration.js";
9
10
  import type { ScoutDispatchRecord } from "./scout-dispatch.js";
10
11
 
12
+ export const OPENSCOUT_CONTROL_EVENT_VERSION = 1 as const;
13
+
11
14
  export interface ControlEventBase<K extends string, P> {
12
15
  id: ScoutId;
13
16
  kind: K;
14
17
  ts: number;
15
18
  actorId: ScoutId;
16
19
  nodeId?: ScoutId;
20
+ /**
21
+ * Schema version of the control-event envelope. Optional by design: legacy
22
+ * persisted events pre-date the version field and carry no `v`, yet must
23
+ * still satisfy this type so they can be replayed. After
24
+ * {@link normalizeControlEvent}, `v` is always present.
25
+ */
26
+ readonly v?: typeof OPENSCOUT_CONTROL_EVENT_VERSION;
17
27
  payload: P;
18
28
  }
19
29
 
@@ -49,6 +59,10 @@ export type MessagePostedEvent = ControlEventBase<"message.posted", {
49
59
  message: MessageRecord;
50
60
  }>;
51
61
 
62
+ export type ConversationReadCursorUpdatedEvent = ControlEventBase<"conversation.read_cursor.updated", {
63
+ cursor: ConversationReadCursor;
64
+ }>;
65
+
52
66
  export type InvocationRequestedEvent = ControlEventBase<"invocation.requested", {
53
67
  invocation: InvocationRequest;
54
68
  }>;
@@ -91,6 +105,7 @@ export type ControlEvent =
91
105
  | ConversationUpsertedEvent
92
106
  | BindingUpsertedEvent
93
107
  | MessagePostedEvent
108
+ | ConversationReadCursorUpdatedEvent
94
109
  | InvocationRequestedEvent
95
110
  | FlightUpdatedEvent
96
111
  | DeliveryPlannedEvent
@@ -99,3 +114,19 @@ export type ControlEvent =
99
114
  | CollaborationUpsertedEvent
100
115
  | CollaborationEventAppendedEvent
101
116
  | ScoutDispatchedEvent;
117
+
118
+ /**
119
+ * Stamp the current envelope version onto a control event when it is missing.
120
+ *
121
+ * The `v` field is optional on {@link ControlEventBase} so that legacy events
122
+ * persisted before versioning existed still satisfy the type (the package
123
+ * deliberately preserves legacy shapes for replay). This helper is the bridge:
124
+ * use it on the stamp-on-write path so newly produced events carry `v`, and on
125
+ * the normalize-on-read path so replayed legacy events are upgraded to the
126
+ * current version. It is a pure function — the input is never mutated.
127
+ */
128
+ export function normalizeControlEvent<E extends ControlEvent>(
129
+ event: E,
130
+ ): E & { v: typeof OPENSCOUT_CONTROL_EVENT_VERSION } {
131
+ return { ...event, v: event.v ?? OPENSCOUT_CONTROL_EVENT_VERSION };
132
+ }
@@ -0,0 +1,116 @@
1
+ export type HarnessSupportLevel = "yes" | "partial" | "no" | "unknown";
2
+
3
+ export type HarnessFeatureDowngrade =
4
+ | "native"
5
+ | "embedded"
6
+ | "reference_text"
7
+ | "prompt_only"
8
+ | "debug_only"
9
+ | "unsupported";
10
+
11
+ export interface HarnessFeatureEvidence {
12
+ kind: "adapter_spec" | "catalog" | "runtime_check" | "manual" | "upstream";
13
+ ref: string;
14
+ }
15
+
16
+ export interface HarnessFeatureSupport {
17
+ level: HarnessSupportLevel;
18
+ reason?: string;
19
+ evidence?: HarnessFeatureEvidence[];
20
+ downgrade?: HarnessFeatureDowngrade;
21
+ }
22
+
23
+ export interface HarnessFeatureSupportMap {
24
+ prompts?: {
25
+ systemPrompt?: HarnessFeatureSupport;
26
+ agentInstructions?: HarnessFeatureSupport;
27
+ promptFiles?: HarnessFeatureSupport;
28
+ images?: HarnessFeatureSupport;
29
+ };
30
+ session?: {
31
+ start?: HarnessFeatureSupport;
32
+ resume?: HarnessFeatureSupport;
33
+ interrupt?: HarnessFeatureSupport;
34
+ shutdown?: HarnessFeatureSupport;
35
+ concurrentTurns?: HarnessFeatureSupport;
36
+ traceObserve?: HarnessFeatureSupport;
37
+ fork?: HarnessFeatureSupport;
38
+ nativeThreadClone?: HarnessFeatureSupport;
39
+ steer?: HarnessFeatureSupport;
40
+ followUps?: HarnessFeatureSupport;
41
+ };
42
+ interaction?: {
43
+ questions?: HarnessFeatureSupport;
44
+ approvals?: HarnessFeatureSupport;
45
+ serverRequests?: HarnessFeatureSupport;
46
+ toolSuspensions?: HarnessFeatureSupport;
47
+ planApproval?: HarnessFeatureSupport;
48
+ };
49
+ tools?: {
50
+ command?: HarnessFeatureSupport;
51
+ fileChange?: HarnessFeatureSupport;
52
+ subagent?: HarnessFeatureSupport;
53
+ taskProjection?: HarnessFeatureSupport;
54
+ mcpStdio?: HarnessFeatureSupport;
55
+ mcpSse?: HarnessFeatureSupport;
56
+ mcpStreamableHttp?: HarnessFeatureSupport;
57
+ };
58
+ events?: {
59
+ rawStream?: HarnessFeatureSupport;
60
+ normalizedStream?: HarnessFeatureSupport;
61
+ displayState?: HarnessFeatureSupport;
62
+ subagentEvents?: HarnessFeatureSupport;
63
+ taskEvents?: HarnessFeatureSupport;
64
+ usageEvents?: HarnessFeatureSupport;
65
+ };
66
+ limits?: {
67
+ maxTurns?: HarnessFeatureSupport;
68
+ maxModelCalls?: HarnessFeatureSupport;
69
+ maxDuration?: HarnessFeatureSupport;
70
+ };
71
+ auth?: {
72
+ apiKey?: HarnessFeatureSupport;
73
+ authFile?: HarnessFeatureSupport;
74
+ oauthToken?: HarnessFeatureSupport;
75
+ localLogin?: HarnessFeatureSupport;
76
+ };
77
+ debug?: {
78
+ tmuxAttach?: HarnessFeatureSupport;
79
+ logs?: HarnessFeatureSupport;
80
+ rawTranscript?: HarnessFeatureSupport;
81
+ };
82
+ }
83
+
84
+ export function normalizeHarnessSupportLevel(value: string | null | undefined): HarnessSupportLevel {
85
+ switch (value?.trim().toLowerCase()) {
86
+ case "yes":
87
+ case "supported":
88
+ case "true":
89
+ return "yes";
90
+ case "partial":
91
+ case "degraded":
92
+ return "partial";
93
+ case "no":
94
+ case "unsupported":
95
+ case "false":
96
+ return "no";
97
+ case "unknown":
98
+ default:
99
+ return "unknown";
100
+ }
101
+ }
102
+
103
+ export function isHarnessFeatureUsable(
104
+ feature: Pick<HarnessFeatureSupport, "level"> | null | undefined,
105
+ ): boolean {
106
+ return feature?.level === "yes" || feature?.level === "partial";
107
+ }
108
+
109
+ export function unsupportedHarnessFeature(reason: string, evidence: HarnessFeatureEvidence[] = []): HarnessFeatureSupport {
110
+ return {
111
+ level: "no",
112
+ reason,
113
+ evidence,
114
+ downgrade: "unsupported",
115
+ };
116
+ }
@@ -0,0 +1,104 @@
1
+ import type { AgentHarness } from "./actors.js";
2
+
3
+ export type ScoutHostIntegrationRole =
4
+ | "execution_harness"
5
+ | "agent_host"
6
+ | "mcp_host"
7
+ | "terminal_host"
8
+ | "agent_state_surface";
9
+
10
+ export type ScoutHostIntegrationId =
11
+ | "claude-code"
12
+ | "codex"
13
+ | "cursor"
14
+ | "pi"
15
+ | "hermes"
16
+ | "herdr";
17
+
18
+ export interface ScoutHostIntegration {
19
+ id: ScoutHostIntegrationId;
20
+ label: string;
21
+ roles: readonly ScoutHostIntegrationRole[];
22
+ /**
23
+ * Present only when this host is also a Scout execution harness. Hosts such
24
+ * as Hermes and Herdr are first-class integrations without being valid
25
+ * values for `execution.harness` or `--harness`.
26
+ */
27
+ harness?: AgentHarness;
28
+ homepage?: string;
29
+ repositoryUrl?: string;
30
+ installHint?: string;
31
+ summary: string;
32
+ }
33
+
34
+ export const SCOUT_HOST_INTEGRATIONS: readonly ScoutHostIntegration[] = [
35
+ {
36
+ id: "claude-code",
37
+ label: "Claude Code",
38
+ roles: ["execution_harness", "agent_host", "mcp_host"],
39
+ harness: "claude",
40
+ homepage: "https://claude.ai/claude-code",
41
+ repositoryUrl: "https://github.com/arach/claude-scout",
42
+ installHint: "/plugin marketplace add arach/claude-scout",
43
+ summary: "Claude Code can run Scout-routed work as a harness and expose Scout through a host plugin.",
44
+ },
45
+ {
46
+ id: "codex",
47
+ label: "Codex",
48
+ roles: ["execution_harness", "agent_host", "mcp_host"],
49
+ harness: "codex",
50
+ homepage: "https://github.com/openai/codex",
51
+ repositoryUrl: "https://github.com/arach/codex-scout",
52
+ installHint: "/plugin marketplace add arach/codex-scout",
53
+ summary: "Codex can run Scout-routed work as a harness and expose Scout through MCP/plugin surfaces.",
54
+ },
55
+ {
56
+ id: "cursor",
57
+ label: "Cursor",
58
+ roles: ["execution_harness", "agent_host", "mcp_host"],
59
+ harness: "cursor",
60
+ repositoryUrl: "https://github.com/arach/cursor-scout",
61
+ installHint: "See https://github.com/arach/cursor-scout for the host-specific installer.",
62
+ summary: "Cursor is an agent host and execution target when routed through its supported CLI or MCP surfaces.",
63
+ },
64
+ {
65
+ id: "pi",
66
+ label: "pi",
67
+ roles: ["execution_harness", "agent_host"],
68
+ harness: "pi",
69
+ repositoryUrl: "https://github.com/arach/pi-scout",
70
+ installHint: "pi install git:github.com/arach/pi-scout",
71
+ summary: "pi can run Scout-routed work through its native extension model.",
72
+ },
73
+ {
74
+ id: "hermes",
75
+ label: "Hermes Agent",
76
+ roles: ["agent_host", "mcp_host"],
77
+ homepage: "https://hermes-agent.nousresearch.com/docs/",
78
+ repositoryUrl: "https://github.com/arach/hermes-scout",
79
+ installHint: "Install Hermes Scout as a Hermes plugin after Scout is healthy.",
80
+ summary: "Hermes hosts Scout tools through its plugin and MCP system; it is not a Scout harness.",
81
+ },
82
+ {
83
+ id: "herdr",
84
+ label: "Herdr",
85
+ roles: ["terminal_host", "agent_state_surface"],
86
+ homepage: "https://herdr.dev/docs/",
87
+ repositoryUrl: "https://github.com/ogulcancelik/herdr",
88
+ installHint: "Install the Herdr integrations for the agent hosts you use, such as Claude, Codex, Hermes, or Cursor.",
89
+ summary: "Herdr is a terminal host and agent-state surface for sessions Scout can observe or drive; it is not a Scout harness.",
90
+ },
91
+ ] as const;
92
+
93
+ export function scoutHostIntegrationById(
94
+ id: string,
95
+ ): ScoutHostIntegration | undefined {
96
+ return SCOUT_HOST_INTEGRATIONS.find((host) => host.id === id);
97
+ }
98
+
99
+ export function scoutHostIntegrationHasRole(
100
+ host: ScoutHostIntegration,
101
+ role: ScoutHostIntegrationRole,
102
+ ): boolean {
103
+ return host.roles.includes(role);
104
+ }
package/src/inbox.ts ADDED
@@ -0,0 +1,68 @@
1
+ import type { DeliveryIntent } from "./deliveries.js";
2
+ import type { InvocationRequest } from "./invocations.js";
3
+ import type { MessageRecord } from "./messages.js";
4
+ import type { DeliveryReason, DeliveryStatus, MetadataMap, ScoutId } from "./common.js";
5
+
6
+ export type InboxItemKind = "message" | "invocation";
7
+
8
+ export const INBOX_CLAIMABLE_DELIVERY_STATUSES = [
9
+ "pending",
10
+ "accepted",
11
+ "deferred",
12
+ ] as const satisfies readonly DeliveryStatus[];
13
+
14
+ export type InboxClaimableDeliveryStatus =
15
+ (typeof INBOX_CLAIMABLE_DELIVERY_STATUSES)[number];
16
+
17
+ export function isInboxClaimableDeliveryStatus(
18
+ status: DeliveryStatus,
19
+ ): status is InboxClaimableDeliveryStatus {
20
+ return (INBOX_CLAIMABLE_DELIVERY_STATUSES as readonly DeliveryStatus[])
21
+ .includes(status);
22
+ }
23
+
24
+ export interface InboxItem {
25
+ id: ScoutId;
26
+ kind: InboxItemKind;
27
+ targetId: ScoutId;
28
+ targetNodeId?: ScoutId;
29
+ conversationId?: ScoutId;
30
+ messageId?: ScoutId;
31
+ invocationId?: ScoutId;
32
+ reason: DeliveryReason;
33
+ status: DeliveryStatus;
34
+ leaseOwner?: string;
35
+ leaseExpiresAt?: number;
36
+ delivery: DeliveryIntent;
37
+ message?: MessageRecord;
38
+ invocation?: InvocationRequest;
39
+ metadata?: MetadataMap;
40
+ }
41
+
42
+ export interface InboxClaimRequest {
43
+ targetId: ScoutId;
44
+ itemId?: ScoutId;
45
+ messageId?: ScoutId;
46
+ reasons?: DeliveryReason[];
47
+ leaseOwner?: string;
48
+ leaseMs?: number;
49
+ }
50
+
51
+ export interface InboxClaimResponse {
52
+ ok: true;
53
+ claimed: InboxItem | null;
54
+ }
55
+
56
+ export interface InboxAckRequest {
57
+ itemId: ScoutId;
58
+ leaseOwner?: string | null;
59
+ metadata?: MetadataMap;
60
+ }
61
+
62
+ export interface InboxNackRequest {
63
+ itemId: ScoutId;
64
+ leaseOwner?: string | null;
65
+ retryAfterMs?: number;
66
+ reason?: string;
67
+ metadata?: MetadataMap;
68
+ }
package/src/index.ts CHANGED
@@ -1,18 +1,51 @@
1
1
  export * from "./common.js";
2
+ export * from "./time.js";
2
3
  export * from "./actors.js";
3
4
  export * from "./agent-identity.js";
4
- export * from "./agent-address.js";
5
- export * from "./agent-selectors.js";
5
+ export * from "./provisional-agent-names.js";
6
+ export * from "./a2a.js";
6
7
  export * from "./scout-agent-card.js";
7
8
  export * from "./relay-agent-card.js";
8
9
  export * from "./mesh.js";
9
10
  export * from "./conversations.js";
11
+ export * from "./channel-identity.js";
10
12
  export * from "./collaboration.js";
13
+ export * from "./assigned-roles.js";
14
+ export * from "./orchestrator-prompt.js";
11
15
  export * from "./messages.js";
16
+ export * from "./read-receipts.js";
12
17
  export * from "./invocations.js";
18
+ export * from "./agent-runs.js";
19
+ export * from "./budget.js";
20
+ export * from "./agent-broker-feed.js";
21
+ export * from "./durable-actions.js";
22
+ export * from "./observed-status.js";
23
+ export * from "./activity.js";
24
+ export * from "./harness-feature-support.js";
25
+ export * from "./host-integrations.js";
26
+ export * from "./native-interactions.js";
27
+ export * from "./session-display-state.js";
28
+ export * from "./capability-matrix.js";
29
+ export * from "./debug-attach.js";
13
30
  export * from "./scout-dispatch.js";
31
+ export * from "./runtime-profiles.js";
32
+ export * from "./runtime-execution.js";
33
+ export * from "./runtime-catalog.js";
34
+ export * from "./reserved-vocabulary.js";
35
+ export * from "./route-aliases.js";
14
36
  export * from "./scout-delivery.js";
37
+ export * from "./scout-reply-context.js";
38
+ export * from "./scout-composer.js";
15
39
  export * from "./deliveries.js";
40
+ export * from "./inbox.js";
16
41
  export * from "./transports.js";
17
42
  export * from "./events.js";
18
43
  export * from "./thread-events.js";
44
+ export * from "./permission-policy.js";
45
+ export * from "./cursor-transport.js";
46
+ export * from "./terminal-surface-id.js";
47
+ export * from "./terminal-sessions.js";
48
+ export * from "./terminal-workspaces.js";
49
+ export * from "./terminal-host-topology.js";
50
+ export * from "./broker-routes.js";
51
+ export * from "./rendezvous.js";