@saturn-universe/protocol 0.1.2-dev.5 → 0.1.2-dev.7
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/host-results.d.ts +10 -0
- package/dist/host-results.js +6 -1
- package/dist/host-status.d.ts +6 -1
- package/dist/host-status.js +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +5 -0
- package/dist/session-results.d.ts +2 -1
- package/dist/session-results.js +1 -0
- package/dist/team-results.d.ts +6 -0
- package/dist/team-results.js +2 -1
- package/package.json +2 -2
package/dist/host-results.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export interface HostCommandResults {
|
|
|
23
23
|
readonly 'team.query': TeamQueryResult;
|
|
24
24
|
readonly 'team.inbox': TeamInboxResult;
|
|
25
25
|
readonly 'session.query': SessionSummary;
|
|
26
|
+
readonly 'session.mode.select': Readonly<z.output<typeof sessionModeSelection>>;
|
|
26
27
|
readonly 'session.btw': Readonly<z.output<typeof sideQuestion>>;
|
|
27
28
|
readonly 'session.usage': SessionUsageResult;
|
|
28
29
|
readonly 'session.history': SessionHistoryPage;
|
|
@@ -56,6 +57,15 @@ declare const sessionCreation: z.ZodObject<{
|
|
|
56
57
|
sessionId: z.ZodCustom<import("@saturn-universe/core").SessionId, import("@saturn-universe/core").SessionId>;
|
|
57
58
|
cursor: z.ZodOptional<z.ZodPipe<z.ZodCustom<string, string>, z.ZodTransform<EventPosition, string>>>;
|
|
58
59
|
}, z.core.$strip>;
|
|
60
|
+
declare const sessionModeSelection: z.ZodObject<{
|
|
61
|
+
sessionId: z.ZodCustom<import("@saturn-universe/core").SessionId, import("@saturn-universe/core").SessionId>;
|
|
62
|
+
mode: z.ZodObject<{
|
|
63
|
+
ref: z.ZodString;
|
|
64
|
+
displayName: z.ZodString;
|
|
65
|
+
description: z.ZodString;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
cursor: z.ZodPipe<z.ZodCustom<string, string>, z.ZodTransform<EventPosition, string>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
59
69
|
declare const runSubmission: z.ZodObject<{
|
|
60
70
|
runId: z.ZodCustom<RunId, RunId>;
|
|
61
71
|
turnId: z.ZodCustom<TurnId, TurnId>;
|
package/dist/host-results.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_SESSION_LIST_LIMIT } from '@saturn-universe/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { validContextQueryResult, validSurfaceQueryResult } from './diagnostic-results.js';
|
|
4
|
-
import { parseHostStatusResult } from './host-status.js';
|
|
4
|
+
import { modeSummary, parseHostStatusResult } from './host-status.js';
|
|
5
5
|
import { parseRunProgressResult, validRunTimelineResult } from './run-event-results.js';
|
|
6
6
|
import { validRunQueryResult } from './run-query-result.js';
|
|
7
7
|
import { parseSessionExportResult, parseSessionListResult, parseSessionSummaryResult, parseSessionUsageResult, validSessionHistoryResult, } from './session-results.js';
|
|
@@ -14,6 +14,7 @@ const workspaceList = z.array(z.object({ id: workspaceId }));
|
|
|
14
14
|
const cursor = eventPosition.optional();
|
|
15
15
|
const workspaceCreation = z.object({ workspaceId, cursor });
|
|
16
16
|
const sessionCreation = z.object({ sessionId: z.custom(hasIdentifier), cursor });
|
|
17
|
+
const sessionModeSelection = sessionCreation.extend({ mode: modeSummary, cursor: eventPosition });
|
|
17
18
|
const runId = z.custom(hasIdentifier);
|
|
18
19
|
const runSubmission = z.object({ runId, turnId: z.custom(hasIdentifier), cursor });
|
|
19
20
|
const runResume = z.object({ runId, cursor: eventPosition });
|
|
@@ -67,6 +68,10 @@ export function validHostCommandResult(command, result) {
|
|
|
67
68
|
return validTeamInboxResult(command, result);
|
|
68
69
|
case 'session.query':
|
|
69
70
|
return parseSessionSummaryResult(result, command.sessionId) !== undefined;
|
|
71
|
+
case 'session.mode.select': {
|
|
72
|
+
const receipt = sessionModeSelection.safeParse(result);
|
|
73
|
+
return receipt.success && receipt.data.sessionId === command.sessionId;
|
|
74
|
+
}
|
|
70
75
|
case 'session.btw':
|
|
71
76
|
return sideQuestion.safeParse(result).success;
|
|
72
77
|
case 'session.usage':
|
package/dist/host-status.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export interface HostMcpServerSummary {
|
|
|
25
25
|
readonly toolCount: number;
|
|
26
26
|
readonly error?: string;
|
|
27
27
|
}
|
|
28
|
-
interface HostStatusFields extends HostModelDisplay {
|
|
28
|
+
export interface HostStatusFields extends HostModelDisplay {
|
|
29
29
|
readonly epoch: number;
|
|
30
30
|
readonly cursor: string;
|
|
31
31
|
readonly configSource?: string;
|
|
@@ -51,6 +51,11 @@ interface HostStatusFields extends HostModelDisplay {
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
export type HostStatusSnapshot = HostStatusFields & Readonly<Record<string, unknown>>;
|
|
54
|
+
export declare const modeSummary: z.ZodObject<{
|
|
55
|
+
ref: z.ZodString;
|
|
56
|
+
displayName: z.ZodString;
|
|
57
|
+
description: z.ZodString;
|
|
58
|
+
}, z.core.$strip>;
|
|
54
59
|
declare const hostStatus: z.ZodObject<{
|
|
55
60
|
profiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
56
61
|
defaultReasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
package/dist/host-status.js
CHANGED
|
@@ -8,7 +8,7 @@ const modelDisplay = {
|
|
|
8
8
|
reasoningEfforts: strings.optional(),
|
|
9
9
|
contextWindow: z.number().optional(),
|
|
10
10
|
};
|
|
11
|
-
const modeSummary = z.object({
|
|
11
|
+
export const modeSummary = z.object({
|
|
12
12
|
ref: z.string().regex(contextExtensionRefPattern),
|
|
13
13
|
displayName: z.string(),
|
|
14
14
|
description: z.string(),
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type { RunQueryResult } from './run-query-result.js';
|
|
|
9
9
|
export { parseHostStatusResult } from './host-status.js';
|
|
10
10
|
export { validHostCommandResult, type HostCommandResults } from './host-results.js';
|
|
11
11
|
export type { TeamInboxResult, TeamQueryResult } from './team-results.js';
|
|
12
|
-
export type { HostMcpServerSummary, HostProfileSummary, HostStatusSnapshot } from './host-status.js';
|
|
12
|
+
export type { HostMcpServerSummary, HostProfileSummary, HostStatusFields, HostStatusSnapshot, } from './host-status.js';
|
|
13
13
|
export type { ModelDisplay } from './wire-shapes.js';
|
|
14
14
|
export * from './endpoint.js';
|
|
15
15
|
export type { AgentContextMetrics, BranchWorkspaceHandleLike, HostSandboxStatus, LiveAgentTelemetry, ModeSummary, PermissionMode, PlannerConfig, ProtocolReply, ProtocolRequest, RunCompletionContext, RunCompletionDecision, RunCompletionDecisionKind, RunContinuationConfig, RunProgressApproval, RunProgressLiveAgent, RunProgressPage, RunTimelinePage, RuntimeCommand, SandboxBackendKind, SandboxConfig, SandboxFallbackPolicy, SandboxNetworkMode, SandboxReadonlyMount, SandboxResourceLimits, SandboxRetentionMode, SandboxRetentionPolicy, SandboxScopeKind, SearchBranchState, SearchHypothesisSeed, SearchTreeState, SearchWorkspaceKind, SessionDetails, SessionExportPage, SessionExportRecord, SessionHistoryMessage, SessionHistoryPage, SessionListItem, SessionUsageBucket, SessionUsageCounts, TeamHintConfig, TeamPlanState, TeamState, TerminalRunStatus, TodoItem, TodoStatus, TreeSearchConfig, TreeSearchTrigger, WorkerSandboxProfile, WorkspaceSnapshotPort, } from '@saturn-universe/core';
|
|
@@ -89,6 +89,10 @@ declare const commandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
89
89
|
}, z.core.$strict>, z.ZodObject<{
|
|
90
90
|
type: z.ZodLiteral<"session.query">;
|
|
91
91
|
sessionId: z.ZodPipe<z.ZodString, z.ZodTransform<Id<"session">, string>>;
|
|
92
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
93
|
+
type: z.ZodLiteral<"session.mode.select">;
|
|
94
|
+
sessionId: z.ZodPipe<z.ZodString, z.ZodTransform<Id<"session">, string>>;
|
|
95
|
+
modeRef: z.ZodString;
|
|
92
96
|
}, z.core.$strict>, z.ZodObject<{
|
|
93
97
|
type: z.ZodLiteral<"session.btw">;
|
|
94
98
|
sessionId: z.ZodPipe<z.ZodString, z.ZodTransform<Id<"session">, string>>;
|
|
@@ -469,6 +473,10 @@ declare const requestSchema: z.ZodObject<{
|
|
|
469
473
|
}, z.core.$strict>, z.ZodObject<{
|
|
470
474
|
type: z.ZodLiteral<"session.query">;
|
|
471
475
|
sessionId: z.ZodPipe<z.ZodString, z.ZodTransform<Id<"session">, string>>;
|
|
476
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
477
|
+
type: z.ZodLiteral<"session.mode.select">;
|
|
478
|
+
sessionId: z.ZodPipe<z.ZodString, z.ZodTransform<Id<"session">, string>>;
|
|
479
|
+
modeRef: z.ZodString;
|
|
472
480
|
}, z.core.$strict>, z.ZodObject<{
|
|
473
481
|
type: z.ZodLiteral<"session.btw">;
|
|
474
482
|
sessionId: z.ZodPipe<z.ZodString, z.ZodTransform<Id<"session">, string>>;
|
package/dist/index.js
CHANGED
|
@@ -181,6 +181,11 @@ const commandSchema = z.discriminatedUnion('type', [
|
|
|
181
181
|
}),
|
|
182
182
|
z.strictObject({ type: z.literal('workspace.query') }),
|
|
183
183
|
z.strictObject({ type: z.literal('session.query'), sessionId: brandedId() }),
|
|
184
|
+
z.strictObject({
|
|
185
|
+
type: z.literal('session.mode.select'),
|
|
186
|
+
sessionId: brandedId(),
|
|
187
|
+
modeRef: z.string().trim().min(1).max(129),
|
|
188
|
+
}),
|
|
184
189
|
z.strictObject({
|
|
185
190
|
type: z.literal('session.btw'),
|
|
186
191
|
sessionId: brandedId(),
|
|
@@ -8,7 +8,7 @@ export type SessionSummary = {
|
|
|
8
8
|
readonly ordinal: number;
|
|
9
9
|
readonly status: string;
|
|
10
10
|
};
|
|
11
|
-
} & Partial<Pick<SessionDetails, 'member' | 'runCount' | 'turnCount' | 'stepCount' | 'cursor' | 'latestRun' | 'todos'>>;
|
|
11
|
+
} & Partial<Pick<SessionDetails, 'member' | 'runCount' | 'turnCount' | 'stepCount' | 'cursor' | 'latestRun' | 'todos' | 'modeRef'>>;
|
|
12
12
|
export interface SessionUsageReport extends SessionUsageSummary {
|
|
13
13
|
readonly modelId?: string;
|
|
14
14
|
readonly contextWindow?: number;
|
|
@@ -73,6 +73,7 @@ export declare function parseSessionUsageResult(value: unknown): SessionUsageRes
|
|
|
73
73
|
declare const sessionSummary: z.ZodObject<{
|
|
74
74
|
id: z.ZodString;
|
|
75
75
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
76
|
+
modeRef: z.ZodOptional<z.ZodString>;
|
|
76
77
|
member: z.ZodOptional<z.ZodObject<{
|
|
77
78
|
id: z.ZodString;
|
|
78
79
|
agentSessionId: z.ZodString;
|
package/dist/session-results.js
CHANGED
|
@@ -33,6 +33,7 @@ export function parseSessionUsageResult(value) {
|
|
|
33
33
|
const sessionSummary = z.object({
|
|
34
34
|
id,
|
|
35
35
|
workspaceId: id.optional(),
|
|
36
|
+
modeRef: id.optional(),
|
|
36
37
|
member: z.object({ id, agentSessionId: id, parentSessionId: id }).optional(),
|
|
37
38
|
runCount: count.optional(),
|
|
38
39
|
turnCount: count.optional(),
|
package/dist/team-results.d.ts
CHANGED
|
@@ -27,12 +27,17 @@ declare const teamQuery: z.ZodObject<{
|
|
|
27
27
|
status: z.ZodEnum<{
|
|
28
28
|
completed: "completed";
|
|
29
29
|
waiting: "waiting";
|
|
30
|
+
stopped: "stopped";
|
|
30
31
|
queued: "queued";
|
|
31
32
|
running: "running";
|
|
32
33
|
paused: "paused";
|
|
33
34
|
failed: "failed";
|
|
34
35
|
interrupted: "interrupted";
|
|
35
36
|
}>;
|
|
37
|
+
stopRequest: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
requestedBy: z.ZodLiteral<"main">;
|
|
39
|
+
reason: z.ZodString;
|
|
40
|
+
}, z.core.$strip>>;
|
|
36
41
|
}, z.core.$strip>>;
|
|
37
42
|
tasks: z.ZodArray<z.ZodObject<{
|
|
38
43
|
memberId: z.ZodString;
|
|
@@ -41,6 +46,7 @@ declare const teamQuery: z.ZodObject<{
|
|
|
41
46
|
status: z.ZodEnum<{
|
|
42
47
|
completed: "completed";
|
|
43
48
|
waiting: "waiting";
|
|
49
|
+
stopped: "stopped";
|
|
44
50
|
queued: "queued";
|
|
45
51
|
running: "running";
|
|
46
52
|
paused: "paused";
|
package/dist/team-results.js
CHANGED
|
@@ -3,13 +3,14 @@ import { z } from 'zod';
|
|
|
3
3
|
const id = z.string().min(1);
|
|
4
4
|
const brandedId = () => id.transform((value) => value);
|
|
5
5
|
const runId = brandedId();
|
|
6
|
-
const workStatus = z.enum(['waiting', ...turnStatuses]);
|
|
6
|
+
const workStatus = z.enum(['waiting', 'stopped', ...turnStatuses]);
|
|
7
7
|
const member = z.object({
|
|
8
8
|
id,
|
|
9
9
|
parent: id.nullable(),
|
|
10
10
|
agentSessionId: brandedId(),
|
|
11
11
|
turnId: brandedId().optional(),
|
|
12
12
|
status: workStatus,
|
|
13
|
+
stopRequest: z.object({ requestedBy: z.literal('main'), reason: z.string() }).optional(),
|
|
13
14
|
});
|
|
14
15
|
const task = z.object({
|
|
15
16
|
memberId: id,
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saturn-universe/protocol",
|
|
3
|
-
"version": "0.1.2-dev.
|
|
3
|
+
"version": "0.1.2-dev.7",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@saturn-universe/core": "0.1.2-dev.
|
|
10
|
+
"@saturn-universe/core": "0.1.2-dev.7",
|
|
11
11
|
"smol-toml": "1.9.1",
|
|
12
12
|
"zod": "4.6.0"
|
|
13
13
|
},
|