@openscout/protocol 0.2.38 → 0.2.39
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/common.d.ts +2 -1
- package/dist/events.d.ts +5 -1
- package/package.json +1 -1
- package/src/common.ts +18 -2
- package/src/events.ts +6 -0
package/dist/common.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ export type ScoutId = string;
|
|
|
2
2
|
export type ActorKind = "person" | "helper" | "agent" | "system" | "bridge" | "device";
|
|
3
3
|
export type AgentState = "offline" | "idle" | "active" | "waiting";
|
|
4
4
|
export type VisibilityScope = "private" | "workspace" | "public" | "system";
|
|
5
|
-
export type DeliveryStatus = "
|
|
5
|
+
export type DeliveryStatus = "accepted" | "peer_acked" | "running" | "completed" | "deferred" | "failed" | "cancelled" | "pending" | "leased" | "sent" | "acknowledged";
|
|
6
|
+
export type DeliveryFailureReason = "peer_unreachable" | "peer_rejected" | "agent_offline" | "timeout" | "harness_error" | "dispatch" | "cancelled";
|
|
6
7
|
export type DeliveryPolicy = "best_effort" | "must_ack" | "durable" | "ephemeral";
|
|
7
8
|
export type DeliveryTargetKind = "participant" | "agent" | "bridge" | "device" | "voice_session" | "webhook";
|
|
8
9
|
export type DeliveryTransport = "local_socket" | "websocket" | "peer_broker" | "http" | "webhook" | "telegram" | "discord" | "sms" | "email" | "tts" | "native_voice" | "claude_stream_json" | "codex_app_server" | "codex_exec" | "claude_resume" | "tmux";
|
package/dist/events.d.ts
CHANGED
|
@@ -48,6 +48,10 @@ export type DeliveryPlannedEvent = ControlEventBase<"delivery.planned", {
|
|
|
48
48
|
export type DeliveryAttemptedEvent = ControlEventBase<"delivery.attempted", {
|
|
49
49
|
attempt: DeliveryAttempt;
|
|
50
50
|
}>;
|
|
51
|
+
export type DeliveryStateChangedEvent = ControlEventBase<"delivery.state.changed", {
|
|
52
|
+
delivery: DeliveryIntent;
|
|
53
|
+
previousStatus?: DeliveryIntent["status"];
|
|
54
|
+
}>;
|
|
51
55
|
export type CollaborationUpsertedEvent = ControlEventBase<"collaboration.upserted", {
|
|
52
56
|
record: CollaborationRecord;
|
|
53
57
|
}>;
|
|
@@ -57,4 +61,4 @@ export type CollaborationEventAppendedEvent = ControlEventBase<"collaboration.ev
|
|
|
57
61
|
export type ScoutDispatchedEvent = ControlEventBase<"scout.dispatched", {
|
|
58
62
|
dispatch: ScoutDispatchRecord;
|
|
59
63
|
}>;
|
|
60
|
-
export type ControlEvent = NodeUpsertedEvent | ActorRegisteredEvent | AgentRegisteredEvent | AgentEndpointUpsertedEvent | ConversationUpsertedEvent | BindingUpsertedEvent | MessagePostedEvent | InvocationRequestedEvent | FlightUpdatedEvent | DeliveryPlannedEvent | DeliveryAttemptedEvent | CollaborationUpsertedEvent | CollaborationEventAppendedEvent | ScoutDispatchedEvent;
|
|
64
|
+
export type ControlEvent = NodeUpsertedEvent | ActorRegisteredEvent | AgentRegisteredEvent | AgentEndpointUpsertedEvent | ConversationUpsertedEvent | BindingUpsertedEvent | MessagePostedEvent | InvocationRequestedEvent | FlightUpdatedEvent | DeliveryPlannedEvent | DeliveryAttemptedEvent | DeliveryStateChangedEvent | CollaborationUpsertedEvent | CollaborationEventAppendedEvent | ScoutDispatchedEvent;
|
package/package.json
CHANGED
package/src/common.ts
CHANGED
|
@@ -17,11 +17,27 @@ export type AgentState =
|
|
|
17
17
|
export type VisibilityScope = "private" | "workspace" | "public" | "system";
|
|
18
18
|
|
|
19
19
|
export type DeliveryStatus =
|
|
20
|
+
// Outbox lifecycle (Issue 3 of broker-three-contracts)
|
|
21
|
+
| "accepted" // local journal write done, awaiting forward
|
|
22
|
+
| "peer_acked" // peer broker journaled the envelope
|
|
23
|
+
| "running" // target agent claimed the flight
|
|
24
|
+
| "completed" // terminal success
|
|
25
|
+
| "deferred" // within retry window — see metadata.nextAttemptAt
|
|
26
|
+
| "failed" // terminal failure — see metadata.failureReason
|
|
27
|
+
| "cancelled"
|
|
28
|
+
// Legacy values kept for backwards-compatible journal replay
|
|
20
29
|
| "pending"
|
|
21
30
|
| "leased"
|
|
22
31
|
| "sent"
|
|
23
|
-
| "acknowledged"
|
|
24
|
-
|
|
32
|
+
| "acknowledged";
|
|
33
|
+
|
|
34
|
+
export type DeliveryFailureReason =
|
|
35
|
+
| "peer_unreachable" // TCP/network failure — retry-able
|
|
36
|
+
| "peer_rejected" // peer broker explicitly refused — not retried
|
|
37
|
+
| "agent_offline" // peer ACK'd but target agent never claimed
|
|
38
|
+
| "timeout"
|
|
39
|
+
| "harness_error"
|
|
40
|
+
| "dispatch" // ambiguous label — see metadata.scoutDispatch
|
|
25
41
|
| "cancelled";
|
|
26
42
|
|
|
27
43
|
export type DeliveryPolicy = "best_effort" | "must_ack" | "durable" | "ephemeral";
|
package/src/events.ts
CHANGED
|
@@ -61,6 +61,11 @@ export type DeliveryAttemptedEvent = ControlEventBase<"delivery.attempted", {
|
|
|
61
61
|
attempt: DeliveryAttempt;
|
|
62
62
|
}>;
|
|
63
63
|
|
|
64
|
+
export type DeliveryStateChangedEvent = ControlEventBase<"delivery.state.changed", {
|
|
65
|
+
delivery: DeliveryIntent;
|
|
66
|
+
previousStatus?: DeliveryIntent["status"];
|
|
67
|
+
}>;
|
|
68
|
+
|
|
64
69
|
export type CollaborationUpsertedEvent = ControlEventBase<"collaboration.upserted", {
|
|
65
70
|
record: CollaborationRecord;
|
|
66
71
|
}>;
|
|
@@ -85,6 +90,7 @@ export type ControlEvent =
|
|
|
85
90
|
| FlightUpdatedEvent
|
|
86
91
|
| DeliveryPlannedEvent
|
|
87
92
|
| DeliveryAttemptedEvent
|
|
93
|
+
| DeliveryStateChangedEvent
|
|
88
94
|
| CollaborationUpsertedEvent
|
|
89
95
|
| CollaborationEventAppendedEvent
|
|
90
96
|
| ScoutDispatchedEvent;
|