@openscout/protocol 0.2.38 → 0.2.40
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/agent-identity.d.ts +2 -0
- package/dist/agent-identity.js +11 -0
- package/dist/common.d.ts +2 -1
- package/dist/events.d.ts +5 -1
- package/package.json +1 -1
- package/src/agent-identity.ts +12 -0
- package/src/common.ts +18 -2
- package/src/events.ts +6 -0
package/dist/agent-identity.d.ts
CHANGED
|
@@ -32,6 +32,8 @@ export interface AgentIdentityAlias {
|
|
|
32
32
|
export declare function normalizeAgentIdentitySegment(value: string): string;
|
|
33
33
|
export declare const normalizeAgentSelectorSegment: typeof normalizeAgentIdentitySegment;
|
|
34
34
|
export declare const SCOUT_DISPATCHER_AGENT_ID = "scout";
|
|
35
|
+
export declare const BUILT_IN_AGENT_DEFINITION_IDS: ReadonlySet<string>;
|
|
36
|
+
export declare function isBuiltInAgentDefinitionId(value: string | null | undefined): boolean;
|
|
35
37
|
export declare function isReservedAgentDefinitionId(value: string | null | undefined): boolean;
|
|
36
38
|
export declare function parseAgentIdentity(value: string): AgentIdentity | null;
|
|
37
39
|
export declare function formatAgentIdentity(input: AgentIdentityInput, options?: {
|
package/dist/agent-identity.js
CHANGED
|
@@ -25,6 +25,17 @@ export function normalizeAgentIdentitySegment(value) {
|
|
|
25
25
|
}
|
|
26
26
|
export const normalizeAgentSelectorSegment = normalizeAgentIdentitySegment;
|
|
27
27
|
export const SCOUT_DISPATCHER_AGENT_ID = "scout";
|
|
28
|
+
export const BUILT_IN_AGENT_DEFINITION_IDS = new Set([
|
|
29
|
+
SCOUT_DISPATCHER_AGENT_ID,
|
|
30
|
+
"builder",
|
|
31
|
+
"reviewer",
|
|
32
|
+
"research",
|
|
33
|
+
]);
|
|
34
|
+
export function isBuiltInAgentDefinitionId(value) {
|
|
35
|
+
if (!value)
|
|
36
|
+
return false;
|
|
37
|
+
return BUILT_IN_AGENT_DEFINITION_IDS.has(normalizeAgentIdentitySegment(value));
|
|
38
|
+
}
|
|
28
39
|
const RESERVED_AGENT_DEFINITION_IDS = new Set([
|
|
29
40
|
SCOUT_DISPATCHER_AGENT_ID,
|
|
30
41
|
]);
|
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/agent-identity.ts
CHANGED
|
@@ -67,6 +67,18 @@ export const normalizeAgentSelectorSegment = normalizeAgentIdentitySegment;
|
|
|
67
67
|
|
|
68
68
|
export const SCOUT_DISPATCHER_AGENT_ID = "scout";
|
|
69
69
|
|
|
70
|
+
export const BUILT_IN_AGENT_DEFINITION_IDS: ReadonlySet<string> = new Set([
|
|
71
|
+
SCOUT_DISPATCHER_AGENT_ID,
|
|
72
|
+
"builder",
|
|
73
|
+
"reviewer",
|
|
74
|
+
"research",
|
|
75
|
+
]);
|
|
76
|
+
|
|
77
|
+
export function isBuiltInAgentDefinitionId(value: string | null | undefined): boolean {
|
|
78
|
+
if (!value) return false;
|
|
79
|
+
return BUILT_IN_AGENT_DEFINITION_IDS.has(normalizeAgentIdentitySegment(value));
|
|
80
|
+
}
|
|
81
|
+
|
|
70
82
|
const RESERVED_AGENT_DEFINITION_IDS: ReadonlySet<string> = new Set([
|
|
71
83
|
SCOUT_DISPATCHER_AGENT_ID,
|
|
72
84
|
]);
|
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;
|