@leitwerk-dev/protocol 0.2.0 → 0.2.1
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/api-token-contracts.d.ts +20 -0
- package/dist/api-token-contracts.d.ts.map +1 -1
- package/dist/{chunk-J4VMD5ST.js → chunk-4AKWRRFS.js} +98 -4
- package/dist/chunk-4AKWRRFS.js.map +1 -0
- package/dist/{chunk-Z4IU6KEN.js → chunk-LTIDCJFK.js} +146 -1
- package/dist/chunk-LTIDCJFK.js.map +1 -0
- package/dist/{chunk-IWVU76M5.js → chunk-RUPDB3WZ.js} +1 -1
- package/dist/chunk-RUPDB3WZ.js.map +1 -0
- package/dist/compact-turn-summary.d.ts +21 -3
- package/dist/compact-turn-summary.d.ts.map +1 -1
- package/dist/config-snapshot-public.d.ts +2 -0
- package/dist/config-snapshot-public.d.ts.map +1 -0
- package/dist/config-snapshot-public.js +1 -0
- package/dist/config-snapshot.d.ts +109 -16
- package/dist/config-snapshot.d.ts.map +1 -1
- package/dist/config-snapshot.js +0 -1
- package/dist/extension-ui-contracts.d.ts +22 -0
- package/dist/extension-ui-contracts.d.ts.map +1 -1
- package/dist/external-review.d.ts +5 -1
- package/dist/external-review.d.ts.map +1 -1
- package/dist/form-contract-public.d.ts +2 -0
- package/dist/form-contract-public.d.ts.map +1 -0
- package/dist/form-contract-public.js +1 -0
- package/dist/form-contract.d.ts +29 -5
- package/dist/form-contract.d.ts.map +1 -1
- package/dist/form-contract.js +0 -1
- package/dist/{http-contracts-ht8DDU4J.d.ts → http-contracts-public-rL4HFcxz.d.ts} +971 -45
- package/dist/http-contracts-public.d.ts +4 -0
- package/dist/http-contracts-public.d.ts.map +1 -0
- package/dist/http-contracts-public.js +10 -0
- package/dist/http-contracts.d.ts +819 -12
- package/dist/http-contracts.d.ts.map +1 -1
- package/dist/http-contracts.js +2 -2
- package/dist/index.d.ts +30 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -75
- package/dist/index.js.map +1 -1
- package/dist/initial-prompt.d.ts +6 -0
- package/dist/initial-prompt.d.ts.map +1 -1
- package/dist/launcher-contract-public.d.ts +2 -0
- package/dist/launcher-contract-public.d.ts.map +1 -0
- package/dist/launcher-contract-public.js +1 -0
- package/dist/launcher-contract-public.js.map +1 -0
- package/dist/launcher-contract.d.ts +26 -1
- package/dist/launcher-contract.d.ts.map +1 -1
- package/dist/launcher-contract.js +0 -1
- package/dist/live-turn-projection.d.ts +29 -0
- package/dist/live-turn-projection.d.ts.map +1 -1
- package/dist/pi-session-message.d.ts +16 -0
- package/dist/pi-session-message.d.ts.map +1 -1
- package/dist/primary-path-snapshot.d.ts +64 -0
- package/dist/primary-path-snapshot.d.ts.map +1 -1
- package/dist/protocol.d.ts +387 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +1 -1
- package/dist/session-entry-tree.d.ts +12 -0
- package/dist/session-entry-tree.d.ts.map +1 -1
- package/dist/streamable-events.d.ts +3 -0
- package/dist/streamable-events.d.ts.map +1 -1
- package/dist/text-preview.d.ts +5 -0
- package/dist/text-preview.d.ts.map +1 -1
- package/dist/ticket-creation-contracts.d.ts +23 -1
- package/dist/ticket-creation-contracts.d.ts.map +1 -1
- package/dist/timeline-projection.d.ts +5 -0
- package/dist/timeline-projection.d.ts.map +1 -1
- package/dist/timestamp-ordering.d.ts +2 -0
- package/dist/timestamp-ordering.d.ts.map +1 -1
- package/dist/tool-renderer-contract-public.d.ts +3 -0
- package/dist/tool-renderer-contract-public.d.ts.map +1 -0
- package/dist/tool-renderer-contract-public.js +9 -0
- package/dist/tool-renderer-contract-public.js.map +1 -0
- package/dist/tool-renderer-contract.d.ts +15 -0
- package/dist/tool-renderer-contract.d.ts.map +1 -1
- package/dist/tool-renderer-contract.js +1 -1
- package/dist/tool-result-truncation.d.ts +4 -0
- package/dist/tool-result-truncation.d.ts.map +1 -1
- package/dist/turn-continuation.d.ts +28 -0
- package/dist/turn-continuation.d.ts.map +1 -1
- package/dist/turn-trace-projection.d.ts +1 -1
- package/dist/turn-trace-projection.d.ts.map +1 -1
- package/dist/usage-by-turn-record.d.ts +2 -0
- package/dist/usage-by-turn-record.d.ts.map +1 -1
- package/dist/usage-snapshot.d.ts +20 -3
- package/dist/usage-snapshot.d.ts.map +1 -1
- package/dist/ws-event-payloads.d.ts +14 -0
- package/dist/ws-event-payloads.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/api-token-contracts.ts +20 -0
- package/src/compact-turn-summary.ts +26 -4
- package/src/config-snapshot-public.ts +12 -0
- package/src/config-snapshot.ts +109 -16
- package/src/extension-ui-contracts.ts +22 -0
- package/src/external-review.ts +5 -1
- package/src/form-contract-public.ts +6 -0
- package/src/form-contract.ts +29 -5
- package/src/http-contracts-public.ts +86 -0
- package/src/http-contracts.ts +926 -40
- package/src/index.ts +184 -25
- package/src/initial-prompt.ts +6 -0
- package/src/launcher-contract-public.ts +8 -0
- package/src/launcher-contract.ts +26 -1
- package/src/live-turn-projection.ts +29 -0
- package/src/pi-session-message.ts +21 -3
- package/src/primary-path-snapshot.ts +64 -0
- package/src/protocol.ts +412 -17
- package/src/session-entry-tree.ts +12 -0
- package/src/streamable-events.ts +3 -0
- package/src/text-preview.ts +5 -0
- package/src/ticket-creation-contracts.ts +31 -3
- package/src/timeline-projection.ts +5 -0
- package/src/timestamp-ordering.ts +2 -0
- package/src/tool-renderer-contract-public.ts +10 -0
- package/src/tool-renderer-contract.ts +15 -0
- package/src/tool-result-truncation.ts +4 -0
- package/src/turn-continuation.ts +28 -0
- package/src/turn-trace-projection.ts +1 -1
- package/src/usage-by-turn-record.ts +2 -0
- package/src/usage-snapshot.ts +20 -3
- package/src/ws-event-payloads.ts +14 -0
- package/dist/chunk-6L4W7WPV.js +0 -1
- package/dist/chunk-AAV3AAOF.js +0 -1
- package/dist/chunk-IEMT3JG4.js +0 -1
- package/dist/chunk-IWVU76M5.js.map +0 -1
- package/dist/chunk-J4VMD5ST.js.map +0 -1
- package/dist/chunk-Z4IU6KEN.js.map +0 -1
- /package/dist/{chunk-6L4W7WPV.js.map → config-snapshot-public.js.map} +0 -0
- /package/dist/{chunk-AAV3AAOF.js.map → form-contract-public.js.map} +0 -0
- /package/dist/{chunk-IEMT3JG4.js.map → http-contracts-public.js.map} +0 -0
|
@@ -1,24 +1,44 @@
|
|
|
1
|
+
/** @internal */
|
|
1
2
|
export interface ApiTokenMetadata {
|
|
3
|
+
/** @internal */
|
|
2
4
|
id: string;
|
|
5
|
+
/** @internal */
|
|
3
6
|
prefix: string;
|
|
7
|
+
/** @internal */
|
|
4
8
|
name: string;
|
|
9
|
+
/** @internal */
|
|
5
10
|
createdAt: string;
|
|
11
|
+
/** @internal */
|
|
6
12
|
expiresAt: string | null;
|
|
13
|
+
/** @internal */
|
|
7
14
|
revokedAt: string | null;
|
|
15
|
+
/** @internal */
|
|
8
16
|
lastUsedAt: string | null;
|
|
9
17
|
}
|
|
18
|
+
/** @internal */
|
|
10
19
|
export interface ApiTokenPolicy {
|
|
20
|
+
/** @internal */
|
|
11
21
|
enabled: boolean;
|
|
22
|
+
/** @internal */
|
|
12
23
|
defaultTtlMs: number;
|
|
24
|
+
/** @internal */
|
|
13
25
|
maxTtlMs: number;
|
|
26
|
+
/** @internal */
|
|
14
27
|
allowNoExpiry: boolean;
|
|
15
28
|
}
|
|
29
|
+
/** @internal */
|
|
16
30
|
export interface ApiTokensResponseBody {
|
|
31
|
+
/** @internal */
|
|
17
32
|
tokens: ApiTokenMetadata[];
|
|
33
|
+
/** @internal */
|
|
18
34
|
policy: ApiTokenPolicy;
|
|
35
|
+
/** @internal */
|
|
19
36
|
csrfToken: string;
|
|
20
37
|
}
|
|
38
|
+
/** @internal */
|
|
21
39
|
export interface CreateApiTokenResponseBody {
|
|
40
|
+
/** @internal */
|
|
22
41
|
token: ApiTokenMetadata;
|
|
42
|
+
/** @internal */
|
|
23
43
|
secret: string;
|
|
24
44
|
}
|
|
@@ -14,32 +14,49 @@ import {
|
|
|
14
14
|
readWsEventToolName,
|
|
15
15
|
} from "./ws-event-payloads.js";
|
|
16
16
|
|
|
17
|
+
/** @internal */
|
|
17
18
|
export const REASONING_PREVIEW_MAX_CHARS = 1_024;
|
|
18
19
|
|
|
20
|
+
/** @internal */
|
|
19
21
|
export interface CompactTurnSummary {
|
|
20
|
-
|
|
22
|
+
/** @internal */
|
|
23
|
+
assistant: {
|
|
24
|
+
/** @internal */
|
|
25
|
+
text: string;
|
|
26
|
+
/** @internal */
|
|
27
|
+
thinking: string;
|
|
28
|
+
/** @internal */
|
|
29
|
+
lastUpdatedAt: string | null;
|
|
30
|
+
};
|
|
31
|
+
/** @internal */
|
|
21
32
|
currentTool: Pick<
|
|
22
33
|
PrimaryPathToolCallSnapshot,
|
|
23
34
|
"toolCallId" | "toolName" | "status" | "isError"
|
|
24
35
|
> | null;
|
|
36
|
+
/** @internal */
|
|
25
37
|
usage: UsageSnapshot | null;
|
|
38
|
+
/** @internal */
|
|
26
39
|
toolCallCount: number;
|
|
40
|
+
/** @internal */
|
|
27
41
|
traceItemCount: number;
|
|
28
|
-
/** The last persisted event incorporated into this projection. */
|
|
42
|
+
/** The last persisted event incorporated into this projection. @internal */
|
|
29
43
|
throughEventSequence: number;
|
|
44
|
+
/** @internal */
|
|
30
45
|
lastTraceKind: "thinking" | "tool_call" | "operational_event" | null;
|
|
31
46
|
}
|
|
32
47
|
|
|
33
|
-
/** Initial-page state. It never contains trace items, tool arguments or results. */
|
|
48
|
+
/** Initial-page state. It never contains trace items, tool arguments or results. @internal */
|
|
34
49
|
export interface CompactActiveTurnSnapshot
|
|
35
50
|
extends CompactTurnSummary,
|
|
36
51
|
Pick<
|
|
37
52
|
PrimaryPathActiveTurnSnapshot,
|
|
38
53
|
"turnRecordId" | "turnId" | "turnType" | "pathType" | "startedAt"
|
|
39
54
|
> {
|
|
55
|
+
/** @internal */
|
|
40
56
|
summaryPending: boolean;
|
|
41
57
|
}
|
|
42
58
|
|
|
59
|
+
/** @internal */
|
|
43
60
|
export function emptyCompactTurnSummary(): CompactTurnSummary {
|
|
44
61
|
return {
|
|
45
62
|
assistant: { text: "", thinking: "", lastUpdatedAt: null },
|
|
@@ -52,7 +69,7 @@ export function emptyCompactTurnSummary(): CompactTurnSummary {
|
|
|
52
69
|
};
|
|
53
70
|
}
|
|
54
71
|
|
|
55
|
-
/** Retain paragraph context; wrapping and blank-line removal belong to the preview viewport. */
|
|
72
|
+
/** Retain paragraph context; wrapping and blank-line removal belong to the preview viewport. @internal */
|
|
56
73
|
export function reasoningPreviewTail(text: string): string {
|
|
57
74
|
const normalized = text.replace(/\r\n?/g, "\n");
|
|
58
75
|
const lines = normalized.split("\n").filter((line) => line.trim() !== "");
|
|
@@ -60,12 +77,17 @@ export function reasoningPreviewTail(text: string): string {
|
|
|
60
77
|
return (lines.join("\n") + separator).slice(-REASONING_PREVIEW_MAX_CHARS);
|
|
61
78
|
}
|
|
62
79
|
|
|
80
|
+
/** @internal */
|
|
63
81
|
export function applyEventToCompactTurnSummary(
|
|
64
82
|
previous: CompactTurnSummary,
|
|
65
83
|
event: {
|
|
84
|
+
/** @internal */
|
|
66
85
|
eventType: string;
|
|
86
|
+
/** @internal */
|
|
67
87
|
data: Record<string, unknown>;
|
|
88
|
+
/** @internal */
|
|
68
89
|
createdAt: string;
|
|
90
|
+
/** @internal */
|
|
69
91
|
eventSequence: number;
|
|
70
92
|
},
|
|
71
93
|
): CompactTurnSummary {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
ComponentConfigSnapshot,
|
|
3
|
+
ConfigSnapshot,
|
|
4
|
+
ExtensionLoadingConfigSnapshot,
|
|
5
|
+
ModelProfileSnapshot,
|
|
6
|
+
NotificationsConfigSnapshot,
|
|
7
|
+
ProcessConfigSnapshot,
|
|
8
|
+
SandboxConfigSnapshot,
|
|
9
|
+
ServerConfigSnapshot,
|
|
10
|
+
StorageConfigSnapshot,
|
|
11
|
+
WorkersConfigSnapshot,
|
|
12
|
+
} from "./config-snapshot.js";
|
package/src/config-snapshot.ts
CHANGED
|
@@ -1,186 +1,275 @@
|
|
|
1
|
+
/** @public */
|
|
1
2
|
export interface ExtensionLoadingConfigSnapshot {
|
|
3
|
+
/** @public */
|
|
2
4
|
sources: string[];
|
|
3
5
|
}
|
|
4
6
|
|
|
7
|
+
/** @internal */
|
|
5
8
|
export interface ServerWebsocketConfigSnapshot {
|
|
9
|
+
/** @internal */
|
|
6
10
|
heartbeat_interval: string;
|
|
11
|
+
/** @internal */
|
|
7
12
|
client_timeout: string;
|
|
13
|
+
/** @internal */
|
|
8
14
|
toast_ttl: string;
|
|
9
15
|
}
|
|
10
16
|
|
|
17
|
+
/** @public */
|
|
11
18
|
export interface ServerConfigSnapshot {
|
|
19
|
+
/** @public */
|
|
12
20
|
host: string;
|
|
21
|
+
/** @public */
|
|
13
22
|
port: number;
|
|
23
|
+
/** @public */
|
|
14
24
|
base_url: string;
|
|
25
|
+
/** @internal */
|
|
15
26
|
websocket: ServerWebsocketConfigSnapshot;
|
|
16
27
|
}
|
|
17
28
|
|
|
29
|
+
/** @public */
|
|
18
30
|
export interface StorageConfigSnapshot {
|
|
31
|
+
/** @public */
|
|
19
32
|
sqlite_path: string;
|
|
33
|
+
/** @public */
|
|
20
34
|
process_workspaces_dir: string;
|
|
35
|
+
/** @public */
|
|
21
36
|
tree_files_dir: string;
|
|
22
37
|
}
|
|
23
38
|
|
|
39
|
+
/** @internal */
|
|
24
40
|
export interface ComponentConfigSnapshot {
|
|
41
|
+
/** @internal */
|
|
25
42
|
repo: string;
|
|
43
|
+
/** @internal */
|
|
26
44
|
default_branch: string;
|
|
27
45
|
/**
|
|
28
46
|
* Worker runtime profile this component requires. Selection precedence is
|
|
29
47
|
* process override → component → default; conflicting component profiles on
|
|
30
48
|
* a single process are rejected before the worker starts.
|
|
31
49
|
*/
|
|
50
|
+
/** @internal */
|
|
32
51
|
worker_runtime_profile?: string;
|
|
33
52
|
}
|
|
34
53
|
|
|
54
|
+
/** @internal */
|
|
35
55
|
export interface WorkersCleanupConfigSnapshot {
|
|
56
|
+
/** @internal */
|
|
36
57
|
transient_ttl: string;
|
|
58
|
+
/** @internal */
|
|
37
59
|
completed_process_retention: string;
|
|
60
|
+
/** @internal */
|
|
38
61
|
error_process_retention: string;
|
|
39
62
|
}
|
|
40
63
|
|
|
64
|
+
/** @public */
|
|
41
65
|
export interface WorkersConfigSnapshot {
|
|
42
|
-
/** Worker execution run mode. Docker/Kubernetes are production; local is test/development only. */
|
|
66
|
+
/** Worker execution run mode. Docker/Kubernetes are production; local is test/development only. @public */
|
|
43
67
|
runner: "docker" | "kubernetes" | "local";
|
|
44
68
|
/**
|
|
45
69
|
* Fallback worker runtime profile id used when neither the process nor any
|
|
46
70
|
* component selects one. Must reference a configured `worker_runtime_profiles`
|
|
47
71
|
* entry when set.
|
|
48
72
|
*/
|
|
73
|
+
/** @internal */
|
|
49
74
|
default_runtime_profile?: string;
|
|
75
|
+
/** @internal */
|
|
50
76
|
max_parallel_processes: number;
|
|
77
|
+
/** @internal */
|
|
51
78
|
startup_timeout: string;
|
|
79
|
+
/** @public */
|
|
52
80
|
shutdown_grace_period: string;
|
|
81
|
+
/** @internal */
|
|
53
82
|
heartbeat_interval: string;
|
|
83
|
+
/** @internal */
|
|
54
84
|
turn_max_duration: string;
|
|
85
|
+
/** @internal */
|
|
55
86
|
turn_inactivity_timeout: string;
|
|
87
|
+
/** @internal */
|
|
56
88
|
turn_abort_grace_period: string;
|
|
89
|
+
/** @internal */
|
|
57
90
|
stale_heartbeat_timeout: string;
|
|
91
|
+
/** @internal */
|
|
58
92
|
resume_on_boot: boolean;
|
|
93
|
+
/** @internal */
|
|
59
94
|
idle_worker_ttl: string;
|
|
60
|
-
/** Server-enforced maximum HTTP session snapshot upload size in bytes. */
|
|
95
|
+
/** Server-enforced maximum HTTP session snapshot upload size in bytes. @internal */
|
|
61
96
|
session_snapshot_max_size_bytes: number;
|
|
62
|
-
/** Server-owned debug mirror for raw worker.event payloads. Workers ignore this switch. */
|
|
97
|
+
/** Server-owned debug mirror for raw worker.event payloads. Workers ignore this switch. @internal */
|
|
63
98
|
log_worker_events_to_stdout: boolean;
|
|
99
|
+
/** @internal */
|
|
64
100
|
cleanup: WorkersCleanupConfigSnapshot;
|
|
65
101
|
}
|
|
66
102
|
|
|
103
|
+
/** @internal */
|
|
67
104
|
export interface WorkerRuntimeConfigSnapshot {
|
|
105
|
+
/** @internal */
|
|
68
106
|
heartbeat_interval: string;
|
|
107
|
+
/** @internal */
|
|
69
108
|
turn_max_duration: string;
|
|
109
|
+
/** @internal */
|
|
70
110
|
turn_inactivity_timeout: string;
|
|
111
|
+
/** @internal */
|
|
71
112
|
turn_abort_grace_period: string;
|
|
72
113
|
}
|
|
73
114
|
|
|
115
|
+
/** @public */
|
|
74
116
|
export interface ModelProfileSnapshot {
|
|
117
|
+
/** @public */
|
|
75
118
|
id: string;
|
|
119
|
+
/** @public */
|
|
76
120
|
provider: string;
|
|
121
|
+
/** @public */
|
|
77
122
|
model_id: string;
|
|
123
|
+
/** @public */
|
|
78
124
|
thinking_level?: string;
|
|
79
|
-
/** Non-secret provider-owned defaults applied to each new LLM start. */
|
|
125
|
+
/** Non-secret provider-owned defaults applied to each new LLM start. @internal */
|
|
80
126
|
provider_options?: Record<string, string>;
|
|
81
127
|
}
|
|
82
128
|
|
|
129
|
+
/** @internal */
|
|
83
130
|
export interface PiProviderRetryConfigSnapshot {
|
|
84
|
-
/** Optional provider/SDK request timeout. Null defers to the provider SDK default. */
|
|
131
|
+
/** Optional provider/SDK request timeout. Null defers to the provider SDK default. @internal */
|
|
85
132
|
timeout: string | null;
|
|
86
|
-
/** Optional provider/SDK retry attempts. Null defers to the provider SDK default. */
|
|
133
|
+
/** Optional provider/SDK retry attempts. Null defers to the provider SDK default. @internal */
|
|
87
134
|
max_retries: number | null;
|
|
88
|
-
/** Maximum provider-requested retry delay before failing fast. */
|
|
135
|
+
/** Maximum provider-requested retry delay before failing fast. @internal */
|
|
89
136
|
max_retry_delay: string;
|
|
90
137
|
}
|
|
91
138
|
|
|
139
|
+
/** @internal */
|
|
92
140
|
export interface PiRetryConfigSnapshot {
|
|
141
|
+
/** @internal */
|
|
93
142
|
enabled: boolean;
|
|
143
|
+
/** @internal */
|
|
94
144
|
max_retries: number;
|
|
145
|
+
/** @internal */
|
|
95
146
|
base_delay: string;
|
|
147
|
+
/** @internal */
|
|
96
148
|
provider: PiProviderRetryConfigSnapshot;
|
|
97
149
|
}
|
|
98
150
|
|
|
151
|
+
/** @internal */
|
|
99
152
|
export interface PiProcessTitleGenerationRetryConfigSnapshot {
|
|
100
|
-
/** Total title-generation attempts including the first immediate try. */
|
|
153
|
+
/** Total title-generation attempts including the first immediate try. @internal */
|
|
101
154
|
max_attempts: number;
|
|
102
|
-
/** Base outer retry delay after a failed server-side title request. */
|
|
155
|
+
/** Base outer retry delay after a failed server-side title request. @internal */
|
|
103
156
|
base_delay: string;
|
|
104
|
-
/** Maximum outer retry delay for failed title-generation jobs. */
|
|
157
|
+
/** Maximum outer retry delay for failed title-generation jobs. @internal */
|
|
105
158
|
max_delay: string;
|
|
106
159
|
}
|
|
107
160
|
|
|
161
|
+
/** @public */
|
|
108
162
|
export interface PiProcessTitleGenerationConfigSnapshot {
|
|
163
|
+
/** @public */
|
|
109
164
|
model_profile: string | null;
|
|
165
|
+
/** @internal */
|
|
110
166
|
retry: PiProcessTitleGenerationRetryConfigSnapshot;
|
|
111
167
|
}
|
|
112
168
|
|
|
169
|
+
/** @public */
|
|
113
170
|
export interface PiConfigSnapshot {
|
|
114
|
-
/** Leitwerk-managed Pi agent directory. Local workers use it as PI_CODING_AGENT_DIR. */
|
|
171
|
+
/** Leitwerk-managed Pi agent directory. Local workers use it as PI_CODING_AGENT_DIR. @public */
|
|
115
172
|
agent_dir: string;
|
|
173
|
+
/** @public */
|
|
116
174
|
model_profiles: ModelProfileSnapshot[];
|
|
117
|
-
/** Global default system prompt template for all processes. Rendered with Mustache against runtime context. When omitted, the worker uses its built-in default. */
|
|
175
|
+
/** Global default system prompt template for all processes. Rendered with Mustache against runtime context. When omitted, the worker uses its built-in default. @internal */
|
|
118
176
|
system_prompt_template?: string;
|
|
119
|
-
/** Server-side pre-start process title generation settings. */
|
|
177
|
+
/** Server-side pre-start process title generation settings. @public */
|
|
120
178
|
process_title_generation: PiProcessTitleGenerationConfigSnapshot;
|
|
121
|
-
/** Leitwerk-managed Pi retry/runtime settings for newly created worker sessions. */
|
|
179
|
+
/** Leitwerk-managed Pi retry/runtime settings for newly created worker sessions. @internal */
|
|
122
180
|
retry: PiRetryConfigSnapshot;
|
|
123
181
|
}
|
|
124
182
|
|
|
183
|
+
/** @internal */
|
|
125
184
|
export interface ProcessPiConfigSnapshot {
|
|
185
|
+
/** @internal */
|
|
126
186
|
system_prompt_template?: string;
|
|
187
|
+
/** @internal */
|
|
127
188
|
append_system_prompt_template?: string;
|
|
128
189
|
}
|
|
129
190
|
|
|
191
|
+
/** @public */
|
|
130
192
|
export interface ProcessTurnConfigSnapshot {
|
|
193
|
+
/** @internal */
|
|
131
194
|
model_profile?: string;
|
|
132
195
|
}
|
|
133
196
|
|
|
197
|
+
/** @public */
|
|
134
198
|
export interface ProcessConfigSnapshot {
|
|
199
|
+
/** @public */
|
|
135
200
|
default_model_profile?: string;
|
|
136
201
|
/**
|
|
137
202
|
* Restricts which model profiles this process may use.
|
|
138
203
|
* When set, only listed profile IDs are valid for default, turn, and override selections.
|
|
139
204
|
* When omitted, all configured model profiles are allowed.
|
|
140
205
|
*/
|
|
206
|
+
/** @internal */
|
|
141
207
|
allowed_model_profiles?: string[];
|
|
142
208
|
/**
|
|
143
209
|
* Process-level worker runtime profile override. Wins over per-component
|
|
144
210
|
* selection. Must reference a configured `worker_runtime_profiles` entry.
|
|
145
211
|
*/
|
|
212
|
+
/** @internal */
|
|
146
213
|
worker_runtime_profile?: string;
|
|
147
|
-
/** Server-only process-volume capacity override, for example 128Mi or 1Gi. */
|
|
214
|
+
/** Server-only process-volume capacity override, for example 128Mi or 1Gi. @internal */
|
|
148
215
|
storage_size?: string;
|
|
216
|
+
/** @internal */
|
|
149
217
|
pi?: ProcessPiConfigSnapshot;
|
|
218
|
+
/** @public */
|
|
150
219
|
turn_configs: Record<string, ProcessTurnConfigSnapshot>;
|
|
151
|
-
/** Extension-owned watcher configuration, keyed by code-defined watcher id. */
|
|
220
|
+
/** Extension-owned watcher configuration, keyed by code-defined watcher id. @public */
|
|
152
221
|
watchers?: Record<string, unknown>;
|
|
153
222
|
}
|
|
154
223
|
|
|
224
|
+
/** @internal */
|
|
155
225
|
export interface WorkerProcessConfigSnapshot {
|
|
226
|
+
/** @internal */
|
|
156
227
|
pi?: ProcessPiConfigSnapshot;
|
|
157
228
|
}
|
|
158
229
|
|
|
230
|
+
/** @internal */
|
|
159
231
|
export interface NotificationChannelConfigSnapshot {
|
|
232
|
+
/** @internal */
|
|
160
233
|
enabled: boolean;
|
|
234
|
+
/** @internal */
|
|
161
235
|
type: string;
|
|
236
|
+
/** @internal */
|
|
162
237
|
url: string;
|
|
163
238
|
}
|
|
164
239
|
|
|
240
|
+
/** @internal */
|
|
165
241
|
export interface SquadNotificationRouteSnapshot {
|
|
242
|
+
/** @internal */
|
|
166
243
|
url: string;
|
|
167
244
|
}
|
|
168
245
|
|
|
246
|
+
/** @internal */
|
|
169
247
|
export interface SquadNotificationConfigSnapshot {
|
|
248
|
+
/** @internal */
|
|
170
249
|
enabled: boolean;
|
|
250
|
+
/** @internal */
|
|
171
251
|
type: string;
|
|
252
|
+
/** @internal */
|
|
172
253
|
routing_field: string;
|
|
254
|
+
/** @internal */
|
|
173
255
|
routes: Record<string, SquadNotificationRouteSnapshot>;
|
|
174
256
|
}
|
|
175
257
|
|
|
258
|
+
/** @internal */
|
|
176
259
|
export interface NotificationsConfigSnapshot {
|
|
260
|
+
/** @internal */
|
|
177
261
|
all: NotificationChannelConfigSnapshot;
|
|
262
|
+
/** @internal */
|
|
178
263
|
debug: NotificationChannelConfigSnapshot;
|
|
264
|
+
/** @internal */
|
|
179
265
|
squad: SquadNotificationConfigSnapshot;
|
|
180
266
|
}
|
|
181
267
|
|
|
268
|
+
/** @internal */
|
|
182
269
|
export interface SandboxConfigSnapshot {
|
|
270
|
+
/** @internal */
|
|
183
271
|
enabled: boolean;
|
|
272
|
+
/** @internal */
|
|
184
273
|
profile: string;
|
|
185
274
|
}
|
|
186
275
|
|
|
@@ -189,8 +278,12 @@ export interface SandboxConfigSnapshot {
|
|
|
189
278
|
* time. Server-only wiring and unused operator/server config are intentionally
|
|
190
279
|
* excluded.
|
|
191
280
|
*/
|
|
281
|
+
/** @public */
|
|
192
282
|
export interface ConfigSnapshot {
|
|
283
|
+
/** @internal */
|
|
193
284
|
workers: WorkerRuntimeConfigSnapshot;
|
|
285
|
+
/** @public */
|
|
194
286
|
pi: PiConfigSnapshot;
|
|
287
|
+
/** @internal */
|
|
195
288
|
process_configs?: Record<string, WorkerProcessConfigSnapshot>;
|
|
196
289
|
}
|
|
@@ -5,41 +5,63 @@ import * as v from "valibot";
|
|
|
5
5
|
const recordSchema = v.custom<Record<string, unknown>>(isUnknownRecord);
|
|
6
6
|
const versionSchema = v.custom<number>((value) => typeof value === "number");
|
|
7
7
|
|
|
8
|
+
/** @internal */
|
|
8
9
|
export const leafOutcomeRendererDescriptorSchema = v.pipe(
|
|
9
10
|
recordSchema,
|
|
10
11
|
v.object({
|
|
12
|
+
/** @internal */
|
|
11
13
|
ok: v.literal(true),
|
|
14
|
+
/** @internal */
|
|
12
15
|
rendererId: v.string(),
|
|
16
|
+
/** @internal */
|
|
13
17
|
kind: v.literal("custom_element"),
|
|
18
|
+
/** @internal */
|
|
14
19
|
tagName: v.string(),
|
|
20
|
+
/** @internal */
|
|
15
21
|
modulePath: v.string(),
|
|
22
|
+
/** @internal */
|
|
16
23
|
rendererApiVersion: versionSchema,
|
|
24
|
+
/** @internal */
|
|
17
25
|
extensionManifestId: v.string(),
|
|
26
|
+
/** @internal */
|
|
18
27
|
moduleUrl: v.string(),
|
|
19
28
|
}),
|
|
20
29
|
);
|
|
30
|
+
/** @internal */
|
|
21
31
|
export type LeafOutcomeRendererDescriptor = v.InferOutput<
|
|
22
32
|
typeof leafOutcomeRendererDescriptorSchema
|
|
23
33
|
>;
|
|
24
34
|
|
|
35
|
+
/** @internal */
|
|
25
36
|
export const leafOutcomeRendererFailureSchema = v.pipe(
|
|
26
37
|
recordSchema,
|
|
27
38
|
v.object({
|
|
39
|
+
/** @internal */
|
|
28
40
|
ok: v.literal(false),
|
|
41
|
+
/** @internal */
|
|
29
42
|
rendererId: v.string(),
|
|
43
|
+
/** @internal */
|
|
30
44
|
code: v.string(),
|
|
45
|
+
/** @internal */
|
|
31
46
|
message: v.string(),
|
|
32
47
|
}),
|
|
33
48
|
);
|
|
49
|
+
/** @internal */
|
|
34
50
|
export type LeafOutcomeRendererFailure = v.InferOutput<typeof leafOutcomeRendererFailureSchema>;
|
|
35
51
|
|
|
52
|
+
/** @internal */
|
|
36
53
|
export const browserUiExtensionDescriptorSchema = v.pipe(
|
|
37
54
|
recordSchema,
|
|
38
55
|
v.object({
|
|
56
|
+
/** @internal */
|
|
39
57
|
extensionManifestId: v.string(),
|
|
58
|
+
/** @internal */
|
|
40
59
|
modulePath: v.string(),
|
|
60
|
+
/** @internal */
|
|
41
61
|
moduleUrl: v.string(),
|
|
62
|
+
/** @internal */
|
|
42
63
|
browserApiVersion: versionSchema,
|
|
43
64
|
}),
|
|
44
65
|
);
|
|
66
|
+
/** @internal */
|
|
45
67
|
export type BrowserUiExtensionDescriptor = v.InferOutput<typeof browserUiExtensionDescriptorSchema>;
|
package/src/external-review.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
/** Repository review created by a worker-side handoff and persisted by the server. */
|
|
1
|
+
/** Repository review created by a worker-side handoff and persisted by the server. @internal */
|
|
2
2
|
export interface CreatedExternalReview {
|
|
3
|
+
/** @internal */
|
|
3
4
|
projectKey: string;
|
|
5
|
+
/** @internal */
|
|
4
6
|
externalId: string;
|
|
7
|
+
/** @internal */
|
|
5
8
|
externalUrl: string;
|
|
9
|
+
/** @internal */
|
|
6
10
|
baseBranch: string;
|
|
7
11
|
}
|
package/src/form-contract.ts
CHANGED
|
@@ -1,50 +1,74 @@
|
|
|
1
|
+
/** @public */
|
|
1
2
|
export type FormFieldKind = "text" | "textarea" | "number" | "boolean" | "select";
|
|
2
3
|
|
|
4
|
+
/** @public */
|
|
3
5
|
export interface FormFieldOptionDefinition {
|
|
6
|
+
/** @internal */
|
|
4
7
|
value: string;
|
|
8
|
+
/** @internal */
|
|
5
9
|
label: string;
|
|
10
|
+
/** @internal */
|
|
6
11
|
description?: string;
|
|
7
12
|
}
|
|
8
13
|
|
|
14
|
+
/** @internal */
|
|
9
15
|
export interface FormFieldPublishDefinition {
|
|
10
|
-
/** Product name to publish. Defaults to the field id. */
|
|
16
|
+
/** Product name to publish. Defaults to the field id. @internal */
|
|
11
17
|
product?: string;
|
|
12
18
|
}
|
|
13
19
|
|
|
20
|
+
/** @internal */
|
|
14
21
|
export interface FormFieldStateDefinition {
|
|
15
|
-
/** Dot-separated path in process state to write the submitted field value to. */
|
|
22
|
+
/** Dot-separated path in process state to write the submitted field value to. @internal */
|
|
16
23
|
path: string;
|
|
17
24
|
}
|
|
18
25
|
|
|
26
|
+
/** @public */
|
|
19
27
|
export interface FormFieldDefinition<TKind extends FormFieldKind = FormFieldKind> {
|
|
28
|
+
/** @public */
|
|
20
29
|
id: string;
|
|
30
|
+
/** @public */
|
|
21
31
|
label: string;
|
|
32
|
+
/** @public */
|
|
22
33
|
kind: TKind;
|
|
34
|
+
/** @public */
|
|
23
35
|
required?: boolean;
|
|
36
|
+
/** @public */
|
|
24
37
|
placeholder?: string;
|
|
38
|
+
/** @public */
|
|
25
39
|
description?: string;
|
|
40
|
+
/** @internal */
|
|
26
41
|
options?: readonly FormFieldOptionDefinition[];
|
|
42
|
+
/** @internal */
|
|
27
43
|
rememberRecentValues?: boolean;
|
|
28
|
-
/** Publish this field as transition-scoped product/input data. */
|
|
44
|
+
/** Publish this field as transition-scoped product/input data. @internal */
|
|
29
45
|
publish?: true | FormFieldPublishDefinition;
|
|
30
|
-
/** Persist this field value into process state. */
|
|
46
|
+
/** Persist this field value into process state. @internal */
|
|
31
47
|
state?: FormFieldStateDefinition;
|
|
32
48
|
}
|
|
33
49
|
|
|
50
|
+
/** @public */
|
|
34
51
|
export type ActionFormFieldKind = Exclude<FormFieldKind, "select">;
|
|
52
|
+
/** @public */
|
|
35
53
|
export type ActionFormFieldDefinition = Omit<
|
|
36
54
|
FormFieldDefinition<ActionFormFieldKind>,
|
|
37
55
|
"options" | "rememberRecentValues"
|
|
38
56
|
> & {
|
|
39
|
-
/** Share this textual value across compatible action forms as their primary prompt. */
|
|
57
|
+
/** Share this textual value across compatible action forms as their primary prompt. @internal */
|
|
40
58
|
primaryPrompt?: true;
|
|
41
59
|
};
|
|
42
60
|
|
|
61
|
+
/** @public */
|
|
43
62
|
export interface FormDefinition<TField extends FormFieldDefinition = FormFieldDefinition> {
|
|
63
|
+
/** @public */
|
|
44
64
|
id: string;
|
|
65
|
+
/** @public */
|
|
45
66
|
title: string;
|
|
67
|
+
/** @public */
|
|
46
68
|
fields: readonly TField[];
|
|
69
|
+
/** @public */
|
|
47
70
|
submitLabel?: string;
|
|
48
71
|
}
|
|
49
72
|
|
|
73
|
+
/** @public */
|
|
50
74
|
export type ActionFormDefinition = FormDefinition<ActionFormFieldDefinition>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
ApiTokenMetadata,
|
|
3
|
+
ApiTokenPolicy,
|
|
4
|
+
ApiTokensResponseBody,
|
|
5
|
+
CreateApiTokenResponseBody,
|
|
6
|
+
} from "./api-token-contracts.js";
|
|
7
|
+
export type {
|
|
8
|
+
AuthMeResponseBody,
|
|
9
|
+
CronPreviewResponseBody,
|
|
10
|
+
CurrentErrorSummary,
|
|
11
|
+
CurrentTurnRecoverySummary,
|
|
12
|
+
ErrorResponseBody,
|
|
13
|
+
FutureActionSummary,
|
|
14
|
+
FutureExecutionDetailResponseBody,
|
|
15
|
+
FutureExecutionOverviewItem,
|
|
16
|
+
FutureExecutionSummary,
|
|
17
|
+
FutureLaunchMutationResponseBody,
|
|
18
|
+
FutureLaunchSummary,
|
|
19
|
+
InstalledSkillCatalogDetail,
|
|
20
|
+
InstalledSkillCatalogDetailResponseBody,
|
|
21
|
+
InstalledSkillCatalogItem,
|
|
22
|
+
InstanceTreeEdgeSummary,
|
|
23
|
+
InstanceTreeNodeSummary,
|
|
24
|
+
LauncherDefaultModelPreview,
|
|
25
|
+
LauncherDefaultsResponseBody,
|
|
26
|
+
LauncherModelConfigDefaults,
|
|
27
|
+
LauncherModelConfigPreview,
|
|
28
|
+
LauncherModelConfigPreviewResponseBody,
|
|
29
|
+
LauncherModelConfigSchema,
|
|
30
|
+
LauncherMutationResponseBody,
|
|
31
|
+
LauncherOptionsResponseBody,
|
|
32
|
+
LauncherRecentValuesResponseBody,
|
|
33
|
+
LaunchersResponseBody,
|
|
34
|
+
LauncherTurnModelConfigPreview,
|
|
35
|
+
LaunchRunResponseBody,
|
|
36
|
+
ModelProfileOptionSummary,
|
|
37
|
+
ModelProviderOptionsResponseBody,
|
|
38
|
+
PrimaryPathSnapshotResponseBody,
|
|
39
|
+
ProcessActionFieldDefinition,
|
|
40
|
+
ProcessActionModelPreview,
|
|
41
|
+
ProcessActionModelPreviewResponseBody,
|
|
42
|
+
ProcessActionModelResolutionPreview,
|
|
43
|
+
ProcessActionPreviewSummary,
|
|
44
|
+
ProcessActionSummary,
|
|
45
|
+
ProcessActionWarmPromptCacheContext,
|
|
46
|
+
ProcessBrowseFacets,
|
|
47
|
+
ProcessBrowseItem,
|
|
48
|
+
ProcessBrowsePagination,
|
|
49
|
+
ProcessBrowseResponseBody,
|
|
50
|
+
ProcessDetailUiSnapshotResponseBody,
|
|
51
|
+
ProcessDiagnosticsData,
|
|
52
|
+
ProcessDiagnosticsResponseBody,
|
|
53
|
+
ProcessExternalSourceSummary,
|
|
54
|
+
ProcessExternalTriggerSummary,
|
|
55
|
+
ProcessesListResponseBody,
|
|
56
|
+
ProcessesOverviewResponseBody,
|
|
57
|
+
ProcessInstanceTreeResponseBody,
|
|
58
|
+
ProcessLaunchConfigurationView,
|
|
59
|
+
ProcessLaunchRunsResponseBody,
|
|
60
|
+
ProcessListItem,
|
|
61
|
+
ProcessModelConfigurationView,
|
|
62
|
+
ProcessOverviewItem,
|
|
63
|
+
ProcessRetryConfig,
|
|
64
|
+
ProcessRetryConfigResponseBody,
|
|
65
|
+
ProcessRunDetailsView,
|
|
66
|
+
ProcessRunTurnView,
|
|
67
|
+
ProcessSelectedTurnSummary,
|
|
68
|
+
QuestionRequestMutationResponseBody,
|
|
69
|
+
ScheduleConfigInput,
|
|
70
|
+
ScheduledActionDetail,
|
|
71
|
+
ScheduledActionMutationResponseBody,
|
|
72
|
+
SessionTransferOperationView,
|
|
73
|
+
SkillCatalogDetail,
|
|
74
|
+
SkillCatalogDetailResponseBody,
|
|
75
|
+
SkillCatalogItem,
|
|
76
|
+
SkillRepositorySummary,
|
|
77
|
+
SkillsCatalogResponseBody,
|
|
78
|
+
StartLaunchRunResponseBody,
|
|
79
|
+
SubmitQuestionAnswersRequestBody,
|
|
80
|
+
TurnReasoningDetailResponseBody,
|
|
81
|
+
UiLauncherSummary,
|
|
82
|
+
WatcherLaunchModelSummary,
|
|
83
|
+
WatcherSummary,
|
|
84
|
+
WatchersResponseBody,
|
|
85
|
+
} from "./http-contracts.js";
|
|
86
|
+
export { parseScheduleRequestInput, resolvePromptCacheSwitch } from "./http-contracts.js";
|