@openscout/protocol 0.2.60 → 0.2.62

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/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export * from "./collaboration.js";
11
11
  export * from "./messages.js";
12
12
  export * from "./invocations.js";
13
13
  export * from "./scout-dispatch.js";
14
+ export * from "./scout-delivery.js";
14
15
  export * from "./deliveries.js";
15
16
  export * from "./transports.js";
16
17
  export * from "./events.js";
package/dist/index.js CHANGED
@@ -11,6 +11,7 @@ export * from "./collaboration.js";
11
11
  export * from "./messages.js";
12
12
  export * from "./invocations.js";
13
13
  export * from "./scout-dispatch.js";
14
+ export * from "./scout-delivery.js";
14
15
  export * from "./deliveries.js";
15
16
  export * from "./transports.js";
16
17
  export * from "./events.js";
@@ -0,0 +1,47 @@
1
+ import type { ConversationDefinition } from "./conversations.js";
2
+ import type { MetadataMap, ScoutId } from "./common.js";
3
+ import type { FlightRecord, InvocationExecutionPreference } from "./invocations.js";
4
+ import type { MessageRecord } from "./messages.js";
5
+ import type { ScoutDispatchRecord } from "./scout-dispatch.js";
6
+ export type ScoutDeliverIntent = "tell" | "consult";
7
+ export type ScoutDeliverRouteKind = "dm" | "channel" | "broadcast";
8
+ export type ScoutDeliverRejectReason = "unknown_target" | "ambiguous_target" | "invalid_target" | "missing_target";
9
+ export interface ScoutDeliverRequest {
10
+ id: ScoutId;
11
+ requesterId: ScoutId;
12
+ requesterNodeId: ScoutId;
13
+ body: string;
14
+ intent: ScoutDeliverIntent;
15
+ targetLabel?: string;
16
+ targetAgentId?: ScoutId;
17
+ channel?: string;
18
+ replyToMessageId?: ScoutId;
19
+ speechText?: string;
20
+ ensureAwake?: boolean;
21
+ execution?: InvocationExecutionPreference;
22
+ createdAt: number;
23
+ collaborationRecordId?: ScoutId;
24
+ messageMetadata?: MetadataMap;
25
+ invocationMetadata?: MetadataMap;
26
+ }
27
+ export interface ScoutDeliverAcceptedResponse {
28
+ kind: "delivery";
29
+ accepted: true;
30
+ routeKind: ScoutDeliverRouteKind;
31
+ conversation: ConversationDefinition;
32
+ message: MessageRecord;
33
+ targetAgentId?: ScoutId;
34
+ flight?: FlightRecord;
35
+ }
36
+ export interface ScoutDeliverQuestionResponse {
37
+ kind: "question";
38
+ accepted: false;
39
+ question: ScoutDispatchRecord;
40
+ }
41
+ export interface ScoutDeliverRejectedResponse {
42
+ kind: "rejected";
43
+ accepted: false;
44
+ reason: ScoutDeliverRejectReason;
45
+ rejection: ScoutDispatchRecord;
46
+ }
47
+ export type ScoutDeliverResponse = ScoutDeliverAcceptedResponse | ScoutDeliverQuestionResponse | ScoutDeliverRejectedResponse;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,9 +1,12 @@
1
+ import type { WakePolicy } from "./actors.js";
1
2
  import type { AdvertiseScope, DeliveryTransport, ScoutId } from "./common.js";
2
- export type ScoutDispatchKind = "ambiguous" | "unknown" | "unparseable";
3
+ export type ScoutDispatchKind = "ambiguous" | "unknown" | "unparseable" | "unavailable";
3
4
  export type ScoutCandidateEndpointState = "online" | "offline" | "unknown";
5
+ export type ScoutDispatchUnavailableReason = "manual_wake_required" | "retired" | "stale_registration" | "unknown";
4
6
  export interface ScoutDispatchCandidate {
5
7
  agentId: ScoutId;
6
8
  displayName: string;
9
+ label: string;
7
10
  authorityNodeId?: ScoutId;
8
11
  homeNodeId?: ScoutId;
9
12
  advertiseScope?: AdvertiseScope;
@@ -15,11 +18,22 @@ export interface ScoutDispatchCandidate {
15
18
  endpointState: ScoutCandidateEndpointState;
16
19
  transport?: DeliveryTransport | null;
17
20
  }
21
+ export interface ScoutDispatchUnavailableTarget {
22
+ agentId: ScoutId;
23
+ displayName: string;
24
+ reason: ScoutDispatchUnavailableReason;
25
+ detail: string;
26
+ wakePolicy?: WakePolicy | null;
27
+ endpointState: ScoutCandidateEndpointState;
28
+ transport?: DeliveryTransport | null;
29
+ projectRoot?: string | null;
30
+ }
18
31
  export interface ScoutDispatchEnvelope {
19
32
  kind: ScoutDispatchKind;
20
33
  askedLabel: string;
21
34
  detail: string;
22
35
  candidates: ScoutDispatchCandidate[];
36
+ target?: ScoutDispatchUnavailableTarget;
23
37
  dispatchedAt: number;
24
38
  dispatcherNodeId: ScoutId;
25
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openscout/protocol",
3
- "version": "0.2.60",
3
+ "version": "0.2.62",
4
4
  "description": "Typed protocol for the OpenScout local control plane",
5
5
  "type": "module",
6
6
  "exports": {
package/src/index.ts CHANGED
@@ -11,6 +11,7 @@ export * from "./collaboration.js";
11
11
  export * from "./messages.js";
12
12
  export * from "./invocations.js";
13
13
  export * from "./scout-dispatch.js";
14
+ export * from "./scout-delivery.js";
14
15
  export * from "./deliveries.js";
15
16
  export * from "./transports.js";
16
17
  export * from "./events.js";
@@ -0,0 +1,62 @@
1
+ import type { ConversationDefinition } from "./conversations.js";
2
+ import type { MetadataMap, ScoutId } from "./common.js";
3
+ import type { FlightRecord, InvocationExecutionPreference } from "./invocations.js";
4
+ import type { MessageRecord } from "./messages.js";
5
+ import type { ScoutDispatchRecord } from "./scout-dispatch.js";
6
+
7
+ export type ScoutDeliverIntent = "tell" | "consult";
8
+
9
+ export type ScoutDeliverRouteKind = "dm" | "channel" | "broadcast";
10
+
11
+ export type ScoutDeliverRejectReason =
12
+ | "unknown_target"
13
+ | "ambiguous_target"
14
+ | "invalid_target"
15
+ | "missing_target";
16
+
17
+ export interface ScoutDeliverRequest {
18
+ id: ScoutId;
19
+ requesterId: ScoutId;
20
+ requesterNodeId: ScoutId;
21
+ body: string;
22
+ intent: ScoutDeliverIntent;
23
+ targetLabel?: string;
24
+ targetAgentId?: ScoutId;
25
+ channel?: string;
26
+ replyToMessageId?: ScoutId;
27
+ speechText?: string;
28
+ ensureAwake?: boolean;
29
+ execution?: InvocationExecutionPreference;
30
+ createdAt: number;
31
+ collaborationRecordId?: ScoutId;
32
+ messageMetadata?: MetadataMap;
33
+ invocationMetadata?: MetadataMap;
34
+ }
35
+
36
+ export interface ScoutDeliverAcceptedResponse {
37
+ kind: "delivery";
38
+ accepted: true;
39
+ routeKind: ScoutDeliverRouteKind;
40
+ conversation: ConversationDefinition;
41
+ message: MessageRecord;
42
+ targetAgentId?: ScoutId;
43
+ flight?: FlightRecord;
44
+ }
45
+
46
+ export interface ScoutDeliverQuestionResponse {
47
+ kind: "question";
48
+ accepted: false;
49
+ question: ScoutDispatchRecord;
50
+ }
51
+
52
+ export interface ScoutDeliverRejectedResponse {
53
+ kind: "rejected";
54
+ accepted: false;
55
+ reason: ScoutDeliverRejectReason;
56
+ rejection: ScoutDispatchRecord;
57
+ }
58
+
59
+ export type ScoutDeliverResponse =
60
+ | ScoutDeliverAcceptedResponse
61
+ | ScoutDeliverQuestionResponse
62
+ | ScoutDeliverRejectedResponse;
@@ -1,12 +1,20 @@
1
+ import type { WakePolicy } from "./actors.js";
1
2
  import type { AdvertiseScope, DeliveryTransport, ScoutId } from "./common.js";
2
3
 
3
- export type ScoutDispatchKind = "ambiguous" | "unknown" | "unparseable";
4
+ export type ScoutDispatchKind = "ambiguous" | "unknown" | "unparseable" | "unavailable";
4
5
 
5
6
  export type ScoutCandidateEndpointState = "online" | "offline" | "unknown";
6
7
 
8
+ export type ScoutDispatchUnavailableReason =
9
+ | "manual_wake_required"
10
+ | "retired"
11
+ | "stale_registration"
12
+ | "unknown";
13
+
7
14
  export interface ScoutDispatchCandidate {
8
15
  agentId: ScoutId;
9
16
  displayName: string;
17
+ label: string;
10
18
  authorityNodeId?: ScoutId;
11
19
  homeNodeId?: ScoutId;
12
20
  advertiseScope?: AdvertiseScope;
@@ -19,11 +27,23 @@ export interface ScoutDispatchCandidate {
19
27
  transport?: DeliveryTransport | null;
20
28
  }
21
29
 
30
+ export interface ScoutDispatchUnavailableTarget {
31
+ agentId: ScoutId;
32
+ displayName: string;
33
+ reason: ScoutDispatchUnavailableReason;
34
+ detail: string;
35
+ wakePolicy?: WakePolicy | null;
36
+ endpointState: ScoutCandidateEndpointState;
37
+ transport?: DeliveryTransport | null;
38
+ projectRoot?: string | null;
39
+ }
40
+
22
41
  export interface ScoutDispatchEnvelope {
23
42
  kind: ScoutDispatchKind;
24
43
  askedLabel: string;
25
44
  detail: string;
26
45
  candidates: ScoutDispatchCandidate[];
46
+ target?: ScoutDispatchUnavailableTarget;
27
47
  dispatchedAt: number;
28
48
  dispatcherNodeId: ScoutId;
29
49
  }