@kitman-sh/cli 0.6.0 → 0.7.0
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/{chunk-tfr74ays.js → chunk-226sychh.js} +142 -33
- package/dist/{chunk-brp7cekg.js → chunk-6f4anyec.js} +1 -1
- package/dist/{chunk-fc0v325q.js → chunk-6kdj8psf.js} +9 -10
- package/dist/{chunk-txyq8r41.js → chunk-704ws2q7.js} +1230 -442
- package/dist/chunk-ae7gx971.js +78 -0
- package/dist/{chunk-hw7qkap1.js → chunk-dwgta18y.js} +22 -361
- package/dist/{chunk-dsefng1v.js → chunk-epdajq63.js} +5 -6
- package/dist/{chunk-6h8ghah0.js → chunk-gzhxsb25.js} +3 -4
- package/dist/{chunk-h8ctzn91.js → chunk-hrd7xmax.js} +9 -12
- package/dist/{chunk-3j7sewn0.js → chunk-vjnae06n.js} +780 -613
- package/dist/{chunk-n32jhswz.js → chunk-ztmwmk8t.js} +21 -23
- package/dist/index.js +341 -95
- package/package.json +1 -1
- package/dist/chunk-hrvcz0m4.js +0 -211
- package/dist/chunk-xdk488qp.js +0 -364
package/package.json
CHANGED
package/dist/chunk-hrvcz0m4.js
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
declare,
|
|
4
|
-
optionalKey,
|
|
5
|
-
Literal,
|
|
6
|
-
Null,
|
|
7
|
-
String2,
|
|
8
|
-
Boolean2,
|
|
9
|
-
Struct,
|
|
10
|
-
Record,
|
|
11
|
-
ArraySchema,
|
|
12
|
-
Union,
|
|
13
|
-
Literals,
|
|
14
|
-
makeFilter,
|
|
15
|
-
isPattern,
|
|
16
|
-
Finite,
|
|
17
|
-
isGreaterThanOrEqualTo,
|
|
18
|
-
isLessThanOrEqualTo2,
|
|
19
|
-
Int,
|
|
20
|
-
isMinLength,
|
|
21
|
-
isMaxLength,
|
|
22
|
-
toEquivalence,
|
|
23
|
-
Json,
|
|
24
|
-
guard,
|
|
25
|
-
relativePathPattern,
|
|
26
|
-
skillNamePattern,
|
|
27
|
-
SafeJson,
|
|
28
|
-
AgentEfforts,
|
|
29
|
-
LoopDataSchemaRef,
|
|
30
|
-
KitKinds
|
|
31
|
-
} from "./chunk-txyq8r41.js";
|
|
32
|
-
|
|
33
|
-
// packages/core/src/schedule.ts
|
|
34
|
-
var ScheduleFrequency = ["daily", "weekly"];
|
|
35
|
-
var ScheduleMisfirePolicies = ["skip", "fire_once", "catch_up"];
|
|
36
|
-
var ScheduleOverlapPolicies = ["allow", "skip", "coalesce"];
|
|
37
|
-
var ScheduleVersionStatuses = ["draft", "published", "disabled", "archived"];
|
|
38
|
-
var ScheduleCalendarRule = Struct({
|
|
39
|
-
frequency: Literals(ScheduleFrequency),
|
|
40
|
-
hour: Int.check(isGreaterThanOrEqualTo(0), isLessThanOrEqualTo2(23)),
|
|
41
|
-
minute: Int.check(isGreaterThanOrEqualTo(0), isLessThanOrEqualTo2(59)),
|
|
42
|
-
second: optionalKey(Int.check(isGreaterThanOrEqualTo(0), isLessThanOrEqualTo2(59))),
|
|
43
|
-
daysOfWeek: optionalKey(ArraySchema(Int.check(isGreaterThanOrEqualTo(0), isLessThanOrEqualTo2(6))).check(isMinLength(1), isMaxLength(7)))
|
|
44
|
-
});
|
|
45
|
-
var ScheduleCronRule = Struct({
|
|
46
|
-
cron: String2.check(isMinLength(9), isMaxLength(200), isPattern(new RegExp("^[0-9*,/-]+( [0-9*,/-]+){4}$", "u")))
|
|
47
|
-
});
|
|
48
|
-
var ScheduleRule = Union([ScheduleCalendarRule, ScheduleCronRule]);
|
|
49
|
-
var cronBounds = [
|
|
50
|
-
[0, 59],
|
|
51
|
-
[0, 23],
|
|
52
|
-
[1, 31],
|
|
53
|
-
[1, 12],
|
|
54
|
-
[0, 7]
|
|
55
|
-
];
|
|
56
|
-
function cronField(field, [min, max]) {
|
|
57
|
-
const values = new Set;
|
|
58
|
-
for (const part of field.split(",")) {
|
|
59
|
-
const match = /^(\*|(\d+)(?:-(\d+))?)(?:\/(\d+))?$/.exec(part);
|
|
60
|
-
if (match === null)
|
|
61
|
-
return;
|
|
62
|
-
const from = match[1] === "*" ? min : Number(match[2]);
|
|
63
|
-
const to = match[1] === "*" ? max : match[3] === undefined ? match[4] === undefined ? from : max : Number(match[3]);
|
|
64
|
-
const step = match[4] === undefined ? 1 : Number(match[4]);
|
|
65
|
-
if (from < min || to > max || from > to || step < 1)
|
|
66
|
-
return;
|
|
67
|
-
for (let value = from;value <= to; value += step)
|
|
68
|
-
values.add(value);
|
|
69
|
-
}
|
|
70
|
-
return values;
|
|
71
|
-
}
|
|
72
|
-
function parseCron(cron) {
|
|
73
|
-
const fields = cron.split(" ");
|
|
74
|
-
const [minutes, hours, days, months, weekdays] = fields.map((field, index) => cronField(field, cronBounds[index] ?? [0, 0]));
|
|
75
|
-
if (fields.length !== 5 || !minutes || !hours || !days || !months || !weekdays)
|
|
76
|
-
return;
|
|
77
|
-
return {
|
|
78
|
-
minutes,
|
|
79
|
-
hours,
|
|
80
|
-
days,
|
|
81
|
-
months,
|
|
82
|
-
weekdays: new Set([...weekdays].map((value) => value % 7)),
|
|
83
|
-
dayRestricted: !(fields[2] ?? "").startsWith("*"),
|
|
84
|
-
weekdayRestricted: !(fields[4] ?? "").startsWith("*")
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
function isScheduleRule(value) {
|
|
88
|
-
return guard(ScheduleRule)(value) && (!("cron" in value) || parseCron(value.cron) !== undefined);
|
|
89
|
-
}
|
|
90
|
-
var ScheduleVersion = Struct({
|
|
91
|
-
contractVersion: Literal("schedule.v1"),
|
|
92
|
-
id: String2.check(isMinLength(1)),
|
|
93
|
-
scheduleId: String2.check(isMinLength(1)),
|
|
94
|
-
workspaceId: String2.check(isMinLength(1)),
|
|
95
|
-
projectId: optionalKey(String2.check(isMinLength(1))),
|
|
96
|
-
loopId: optionalKey(String2.check(isMinLength(1))),
|
|
97
|
-
name: optionalKey(String2.check(isMinLength(1), isMaxLength(200))),
|
|
98
|
-
version: Int.check(isGreaterThanOrEqualTo(1)),
|
|
99
|
-
status: Literals(ScheduleVersionStatuses),
|
|
100
|
-
timezone: String2.check(isMinLength(1), isMaxLength(80)),
|
|
101
|
-
rule: ScheduleRule,
|
|
102
|
-
misfirePolicy: Literals(ScheduleMisfirePolicies),
|
|
103
|
-
overlapPolicy: Literals(ScheduleOverlapPolicies),
|
|
104
|
-
maxCatchUp: Int.check(isGreaterThanOrEqualTo(0), isLessThanOrEqualTo2(200)),
|
|
105
|
-
misfireGraceSeconds: optionalKey(Int.check(isGreaterThanOrEqualTo(0), isLessThanOrEqualTo2(604800))),
|
|
106
|
-
inputSchemaRef: optionalKey(LoopDataSchemaRef),
|
|
107
|
-
input: optionalKey(SafeJson),
|
|
108
|
-
createdAt: String2.check(isMinLength(1))
|
|
109
|
-
});
|
|
110
|
-
var zones = new Map;
|
|
111
|
-
var resolvedLocalDateTimes = new Map;
|
|
112
|
-
|
|
113
|
-
// packages/core/src/package-declarations.ts
|
|
114
|
-
var LoopCapabilities = [
|
|
115
|
-
"agent_work",
|
|
116
|
-
"ask",
|
|
117
|
-
"call",
|
|
118
|
-
"verify",
|
|
119
|
-
"change_request",
|
|
120
|
-
"write_back",
|
|
121
|
-
"post_comment",
|
|
122
|
-
"create_tasks",
|
|
123
|
-
"merge_change_request",
|
|
124
|
-
"publish_release"
|
|
125
|
-
];
|
|
126
|
-
var JsonObject = Record(String2, Json);
|
|
127
|
-
var recordKeyedBy = (pattern, value) => Record(String2, value).check(makeFilter((record) => {
|
|
128
|
-
const bad = Object.keys(record).find((key) => !new RegExp(pattern).test(key));
|
|
129
|
-
return bad === undefined ? true : `${JSON.stringify(bad)} is not a valid name or relative path`;
|
|
130
|
-
}));
|
|
131
|
-
var SecretName = String2.check(isPattern(/^[A-Za-z_][A-Za-z0-9_]{0,127}$/));
|
|
132
|
-
var EventFilterValue = Union([String2, Finite, Boolean2, Null]);
|
|
133
|
-
var LoopManifest = Struct({
|
|
134
|
-
id: String2,
|
|
135
|
-
title: String2,
|
|
136
|
-
input: JsonObject,
|
|
137
|
-
output: JsonObject,
|
|
138
|
-
outcome: optionalKey(Literals(["feature", "bug", "refactor", "investigation", "docs", "migration"])),
|
|
139
|
-
agents: Record(String2, String2),
|
|
140
|
-
checkout: Literals(["none", "read", "write"]),
|
|
141
|
-
when: ArraySchema(Struct({
|
|
142
|
-
event: String2,
|
|
143
|
-
filter: optionalKey(Record(String2, Union([EventFilterValue, ArraySchema(EventFilterValue)]))),
|
|
144
|
-
input: Record(String2, String2)
|
|
145
|
-
})),
|
|
146
|
-
offers: ArraySchema(Struct({ id: String2, title: String2, loop: String2 })),
|
|
147
|
-
capabilities: ArraySchema(Literals(LoopCapabilities)),
|
|
148
|
-
secrets: optionalKey(ArraySchema(SecretName))
|
|
149
|
-
});
|
|
150
|
-
var AgentDeclaration = Struct({
|
|
151
|
-
extends: optionalKey(String2),
|
|
152
|
-
instructions: optionalKey(String2),
|
|
153
|
-
harness: optionalKey(String2),
|
|
154
|
-
model: optionalKey(String2),
|
|
155
|
-
effort: optionalKey(Literals(AgentEfforts)),
|
|
156
|
-
kits: optionalKey(ArraySchema(String2)),
|
|
157
|
-
network: optionalKey(Union([Struct({ hosts: ArraySchema(String2) }), Literal("open")])),
|
|
158
|
-
sandbox: optionalKey(Literal("docker"))
|
|
159
|
-
});
|
|
160
|
-
var scheduleFields = {
|
|
161
|
-
name: String2.check(isMinLength(1)),
|
|
162
|
-
loop: String2,
|
|
163
|
-
project: optionalKey(String2),
|
|
164
|
-
input: optionalKey(JsonObject),
|
|
165
|
-
timezone: String2,
|
|
166
|
-
misfire: optionalKey(Literals(ScheduleMisfirePolicies)),
|
|
167
|
-
overlap: optionalKey(Literals(ScheduleOverlapPolicies))
|
|
168
|
-
};
|
|
169
|
-
var ScheduleDeclaration = Union([
|
|
170
|
-
Struct({
|
|
171
|
-
...scheduleFields,
|
|
172
|
-
cron: String2.check(makeFilter((cron) => isScheduleRule({ cron }) || "five cron fields, each within its range"))
|
|
173
|
-
}),
|
|
174
|
-
Struct({
|
|
175
|
-
...scheduleFields,
|
|
176
|
-
rule: declare((value) => isScheduleRule(value), {
|
|
177
|
-
expected: "a Schedule rule: frequency daily or weekly, hour, minute, and optionally second and daysOfWeek"
|
|
178
|
-
})
|
|
179
|
-
})
|
|
180
|
-
]);
|
|
181
|
-
var AuthoredKitDeclaration = Struct({
|
|
182
|
-
name: String2.check(isMinLength(1)),
|
|
183
|
-
kind: optionalKey(Literals(KitKinds)),
|
|
184
|
-
description: optionalKey(String2),
|
|
185
|
-
context: String2,
|
|
186
|
-
skills: optionalKey(recordKeyedBy(skillNamePattern, recordKeyedBy(relativePathPattern, String2)))
|
|
187
|
-
});
|
|
188
|
-
var KitInstallationDeclaration = Struct({
|
|
189
|
-
source: String2.check(isMinLength(1)),
|
|
190
|
-
version: optionalKey(String2)
|
|
191
|
-
});
|
|
192
|
-
var KitAssignmentDeclaration = Struct({
|
|
193
|
-
kit: String2.check(isMinLength(1)),
|
|
194
|
-
workspace: optionalKey(Literals(["default", "mandatory"])),
|
|
195
|
-
projects: optionalKey(ArraySchema(String2))
|
|
196
|
-
});
|
|
197
|
-
var KitDeclaration = Union([
|
|
198
|
-
KitInstallationDeclaration,
|
|
199
|
-
KitAssignmentDeclaration,
|
|
200
|
-
AuthoredKitDeclaration
|
|
201
|
-
]);
|
|
202
|
-
var PackageDeclarations = Struct({
|
|
203
|
-
loops: ArraySchema(LoopManifest),
|
|
204
|
-
agents: Record(String2, AgentDeclaration),
|
|
205
|
-
schedules: optionalKey(Record(String2, ScheduleDeclaration)),
|
|
206
|
-
kits: optionalKey(Record(String2, KitDeclaration))
|
|
207
|
-
});
|
|
208
|
-
var sameLoop = toEquivalence(LoopManifest);
|
|
209
|
-
var sameAgent = toEquivalence(AgentDeclaration);
|
|
210
|
-
|
|
211
|
-
export { LoopCapabilities, LoopManifest, AgentDeclaration, KitInstallationDeclaration, KitAssignmentDeclaration, PackageDeclarations };
|
package/dist/chunk-xdk488qp.js
DELETED
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
build2,
|
|
4
|
-
provide2,
|
|
5
|
-
gen,
|
|
6
|
-
flatMap,
|
|
7
|
-
provideContext,
|
|
8
|
-
runForEach,
|
|
9
|
-
optionalKey,
|
|
10
|
-
optional,
|
|
11
|
-
Literal,
|
|
12
|
-
Null,
|
|
13
|
-
String2,
|
|
14
|
-
Boolean2,
|
|
15
|
-
Void,
|
|
16
|
-
Struct,
|
|
17
|
-
Record,
|
|
18
|
-
ArraySchema,
|
|
19
|
-
Union,
|
|
20
|
-
Literals,
|
|
21
|
-
UndefinedOr,
|
|
22
|
-
TaggedStruct,
|
|
23
|
-
Finite,
|
|
24
|
-
Int,
|
|
25
|
-
Uint8ArrayFromBase64,
|
|
26
|
-
TaggedError2,
|
|
27
|
-
Json,
|
|
28
|
-
WorkUnitRepoBinding,
|
|
29
|
-
WorkUnitClaimResult,
|
|
30
|
-
WorkUnitClaimInput,
|
|
31
|
-
WorkUnitHeartbeatInput,
|
|
32
|
-
WorkUnitHeartbeatResult,
|
|
33
|
-
WorkUnitReleaseInput,
|
|
34
|
-
WorkUnitCompletion
|
|
35
|
-
} from "./chunk-txyq8r41.js";
|
|
36
|
-
import {
|
|
37
|
-
layerWebSocketConstructorGlobal,
|
|
38
|
-
layerWebSocket,
|
|
39
|
-
make5,
|
|
40
|
-
make6,
|
|
41
|
-
layerJson,
|
|
42
|
-
make7,
|
|
43
|
-
withHeaders,
|
|
44
|
-
layerProtocolSocket,
|
|
45
|
-
Service
|
|
46
|
-
} from "./chunk-hw7qkap1.js";
|
|
47
|
-
|
|
48
|
-
// packages/live/src/rpc/runner-group.ts
|
|
49
|
-
var RunnerHeaders = { runnerId: "x-kitman-runner-id", protocolVersion: "x-kitman-rpc-protocol" };
|
|
50
|
-
var RunnerRpcProtocolVersion = 1;
|
|
51
|
-
|
|
52
|
-
class RunnerRpcError extends TaggedError2()("RunnerRpcError", {
|
|
53
|
-
code: String2,
|
|
54
|
-
message: String2,
|
|
55
|
-
status: Finite
|
|
56
|
-
}) {
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
class RunnerAuthentication extends Service()("RunnerAuthentication", {
|
|
60
|
-
error: RunnerRpcError
|
|
61
|
-
}) {
|
|
62
|
-
}
|
|
63
|
-
var EventFilterValue = Union([String2, Finite, Boolean2, Null]);
|
|
64
|
-
var WorkAvailable = TaggedStruct("WorkAvailable", {});
|
|
65
|
-
var LeaseRevoked = TaggedStruct("LeaseRevoked", { workUnitId: String2 });
|
|
66
|
-
var Settled = TaggedStruct("Settled", { workUnitId: String2 });
|
|
67
|
-
var Canceled = TaggedStruct("Canceled", { workUnitId: String2 });
|
|
68
|
-
var RunSettled = TaggedStruct("RunSettled", { runId: String2 });
|
|
69
|
-
var Steer = TaggedStruct("Steer", {
|
|
70
|
-
workUnitId: String2,
|
|
71
|
-
messageId: String2,
|
|
72
|
-
text: String2
|
|
73
|
-
});
|
|
74
|
-
var SessionUpdated = TaggedStruct("SessionUpdated", { workUnitId: String2 });
|
|
75
|
-
var RunnerSignal = Union([
|
|
76
|
-
WorkAvailable,
|
|
77
|
-
LeaseRevoked,
|
|
78
|
-
Settled,
|
|
79
|
-
Canceled,
|
|
80
|
-
RunSettled,
|
|
81
|
-
Steer,
|
|
82
|
-
SessionUpdated
|
|
83
|
-
]);
|
|
84
|
-
var ProgramLease = Struct({
|
|
85
|
-
workUnitId: String2,
|
|
86
|
-
leaseOwnerId: String2,
|
|
87
|
-
runnerReplicaId: String2,
|
|
88
|
-
leaseId: String2,
|
|
89
|
-
attempt: Int,
|
|
90
|
-
fencingToken: String2,
|
|
91
|
-
capacitySlot: String2
|
|
92
|
-
});
|
|
93
|
-
var CheckpointSession = Struct({
|
|
94
|
-
harness: String2,
|
|
95
|
-
id: String2,
|
|
96
|
-
name: String2,
|
|
97
|
-
content: Uint8ArrayFromBase64
|
|
98
|
-
});
|
|
99
|
-
var StepCheckpoint = Struct({
|
|
100
|
-
ref: optionalKey(String2),
|
|
101
|
-
revision: optionalKey(String2),
|
|
102
|
-
session: optionalKey(CheckpointSession)
|
|
103
|
-
});
|
|
104
|
-
var SuggestedVerification = Struct({
|
|
105
|
-
name: String2,
|
|
106
|
-
command: String2,
|
|
107
|
-
workingDirectory: optional(String2)
|
|
108
|
-
});
|
|
109
|
-
var ProgramOutcome = Union([
|
|
110
|
-
Struct({ status: Literal("completed"), output: Json }),
|
|
111
|
-
Struct({ status: Literal("failed"), failureSummary: String2 })
|
|
112
|
-
]);
|
|
113
|
-
|
|
114
|
-
class RunnerRpcs extends make6(make5("Claim", {
|
|
115
|
-
payload: WorkUnitClaimInput,
|
|
116
|
-
success: WorkUnitClaimResult,
|
|
117
|
-
error: RunnerRpcError
|
|
118
|
-
}), make5("Heartbeat", {
|
|
119
|
-
payload: WorkUnitHeartbeatInput,
|
|
120
|
-
success: WorkUnitHeartbeatResult,
|
|
121
|
-
error: RunnerRpcError
|
|
122
|
-
}), make5("Complete", {
|
|
123
|
-
payload: WorkUnitCompletion,
|
|
124
|
-
error: RunnerRpcError
|
|
125
|
-
}), make5("Release", {
|
|
126
|
-
payload: WorkUnitReleaseInput,
|
|
127
|
-
error: RunnerRpcError
|
|
128
|
-
}), make5("RecordActivity", {
|
|
129
|
-
payload: { lease: ProgramLease, name: String2, attempt: Int, exit: Json },
|
|
130
|
-
error: RunnerRpcError
|
|
131
|
-
}), make5("DeferredDone", {
|
|
132
|
-
payload: { lease: ProgramLease, name: String2, exit: Json },
|
|
133
|
-
error: RunnerRpcError
|
|
134
|
-
}), make5("ScheduleClock", {
|
|
135
|
-
payload: { lease: ProgramLease, name: String2, deferredName: String2, durationMillis: Int },
|
|
136
|
-
error: RunnerRpcError
|
|
137
|
-
}), make5("PutQuestion", {
|
|
138
|
-
payload: {
|
|
139
|
-
lease: ProgramLease,
|
|
140
|
-
step: String2,
|
|
141
|
-
prompt: String2,
|
|
142
|
-
options: optional(ArraySchema(String2)),
|
|
143
|
-
verification: optional(SuggestedVerification),
|
|
144
|
-
deferredName: String2
|
|
145
|
-
},
|
|
146
|
-
success: Struct({ questionId: String2 }),
|
|
147
|
-
error: RunnerRpcError
|
|
148
|
-
}), make5("StartAgentStep", {
|
|
149
|
-
payload: {
|
|
150
|
-
lease: ProgramLease,
|
|
151
|
-
step: String2,
|
|
152
|
-
deferredName: String2,
|
|
153
|
-
role: String2,
|
|
154
|
-
agentId: String2,
|
|
155
|
-
prompt: String2,
|
|
156
|
-
outputSchema: Json,
|
|
157
|
-
secrets: optionalKey(ArraySchema(String2))
|
|
158
|
-
},
|
|
159
|
-
success: Struct({ stepAttemptId: String2 }),
|
|
160
|
-
error: RunnerRpcError
|
|
161
|
-
}), make5("StartVerification", {
|
|
162
|
-
payload: {
|
|
163
|
-
lease: ProgramLease,
|
|
164
|
-
step: String2,
|
|
165
|
-
deferredName: String2,
|
|
166
|
-
revision: optionalKey(String2),
|
|
167
|
-
checks: optional(ArraySchema(String2))
|
|
168
|
-
},
|
|
169
|
-
success: Struct({ verificationId: String2 }),
|
|
170
|
-
error: RunnerRpcError
|
|
171
|
-
}), make5("KnownEvidence", {
|
|
172
|
-
payload: { lease: ProgramLease, trees: ArraySchema(String2) },
|
|
173
|
-
success: ArraySchema(Struct({ tree: String2, name: String2, command: String2 })),
|
|
174
|
-
error: RunnerRpcError
|
|
175
|
-
}), make5("AwaitEvent", {
|
|
176
|
-
payload: {
|
|
177
|
-
lease: ProgramLease,
|
|
178
|
-
step: String2,
|
|
179
|
-
deferredName: String2,
|
|
180
|
-
event: String2,
|
|
181
|
-
filter: optional(Record(String2, Union([EventFilterValue, ArraySchema(EventFilterValue)]))),
|
|
182
|
-
timeoutMillis: Int
|
|
183
|
-
},
|
|
184
|
-
error: RunnerRpcError
|
|
185
|
-
}), make5("AdmitChild", {
|
|
186
|
-
payload: {
|
|
187
|
-
lease: ProgramLease,
|
|
188
|
-
step: String2,
|
|
189
|
-
loop: String2,
|
|
190
|
-
input: Json,
|
|
191
|
-
deferredName: String2
|
|
192
|
-
},
|
|
193
|
-
success: Struct({ runId: String2 }),
|
|
194
|
-
error: RunnerRpcError
|
|
195
|
-
}), make5("StoreArtifact", {
|
|
196
|
-
payload: {
|
|
197
|
-
lease: ProgramLease,
|
|
198
|
-
step: String2,
|
|
199
|
-
kind: String2,
|
|
200
|
-
title: String2,
|
|
201
|
-
text: String2,
|
|
202
|
-
data: optional(Json)
|
|
203
|
-
},
|
|
204
|
-
success: Struct({ artifactId: String2 }),
|
|
205
|
-
error: RunnerRpcError
|
|
206
|
-
}), make5("RecordNote", {
|
|
207
|
-
payload: {
|
|
208
|
-
lease: ProgramLease,
|
|
209
|
-
step: String2,
|
|
210
|
-
text: String2,
|
|
211
|
-
artifactId: optional(String2)
|
|
212
|
-
},
|
|
213
|
-
error: RunnerRpcError
|
|
214
|
-
}), make5("PerformHostEffect", {
|
|
215
|
-
payload: {
|
|
216
|
-
lease: ProgramLease,
|
|
217
|
-
step: String2,
|
|
218
|
-
effect: Union([
|
|
219
|
-
Struct({ kind: Literal("post_comment"), changeRequestId: String2, body: String2 }),
|
|
220
|
-
Struct({
|
|
221
|
-
kind: Literal("change_request"),
|
|
222
|
-
title: String2,
|
|
223
|
-
body: String2,
|
|
224
|
-
integration: optionalKey(String2)
|
|
225
|
-
}),
|
|
226
|
-
Struct({
|
|
227
|
-
kind: Literal("write_back"),
|
|
228
|
-
milestone: optionalKey(Literals(["started", "change_request_opened", "merged", "failed"])),
|
|
229
|
-
changeRequestUrl: optionalKey(String2)
|
|
230
|
-
})
|
|
231
|
-
])
|
|
232
|
-
},
|
|
233
|
-
success: UndefinedOr(Struct({ id: String2, number: String2, url: String2 })),
|
|
234
|
-
error: RunnerRpcError
|
|
235
|
-
}), make5("CreatePlanTasks", {
|
|
236
|
-
payload: {
|
|
237
|
-
lease: ProgramLease,
|
|
238
|
-
tickets: ArraySchema(Struct({
|
|
239
|
-
key: String2,
|
|
240
|
-
title: String2,
|
|
241
|
-
body: String2,
|
|
242
|
-
acceptanceCriteria: ArraySchema(String2),
|
|
243
|
-
blockedBy: ArraySchema(String2),
|
|
244
|
-
outcome: optionalKey(Literals(["feature", "bug", "refactor", "investigation", "docs", "migration"]))
|
|
245
|
-
}))
|
|
246
|
-
},
|
|
247
|
-
success: ArraySchema(Struct({ key: String2, taskId: String2 })),
|
|
248
|
-
error: RunnerRpcError
|
|
249
|
-
}), make5("IntegrationBranch", {
|
|
250
|
-
payload: { lease: ProgramLease, repoBindingId: optionalKey(String2) },
|
|
251
|
-
success: Struct({ repoBindingId: String2, branch: String2, revision: String2 }),
|
|
252
|
-
error: RunnerRpcError
|
|
253
|
-
}), make5("MergeChangeRequest", {
|
|
254
|
-
payload: { lease: ProgramLease, step: String2, changeRequestId: String2 },
|
|
255
|
-
success: Union([
|
|
256
|
-
Struct({ status: Literal("merged"), revision: String2 }),
|
|
257
|
-
Struct({ status: Literal("conflict") })
|
|
258
|
-
]),
|
|
259
|
-
error: RunnerRpcError
|
|
260
|
-
}), make5("PublishRelease", {
|
|
261
|
-
payload: {
|
|
262
|
-
lease: ProgramLease,
|
|
263
|
-
step: String2,
|
|
264
|
-
tag: String2,
|
|
265
|
-
revision: optionalKey(String2),
|
|
266
|
-
title: String2,
|
|
267
|
-
notes: String2
|
|
268
|
-
},
|
|
269
|
-
success: Struct({ tag: String2, revision: String2, url: String2 }),
|
|
270
|
-
error: RunnerRpcError
|
|
271
|
-
}), make5("ReportSteer", {
|
|
272
|
-
payload: { workUnitId: String2, messageId: String2, delivered: Boolean2 },
|
|
273
|
-
success: Void,
|
|
274
|
-
error: RunnerRpcError
|
|
275
|
-
}), make5("SaveCheckpoint", {
|
|
276
|
-
payload: { lease: ProgramLease, checkpoint: StepCheckpoint },
|
|
277
|
-
success: Void,
|
|
278
|
-
error: RunnerRpcError
|
|
279
|
-
}), make5("ResumeCheckpoint", {
|
|
280
|
-
payload: { lease: ProgramLease },
|
|
281
|
-
success: UndefinedOr(StepCheckpoint),
|
|
282
|
-
error: RunnerRpcError
|
|
283
|
-
}), make5("SettledCheckpoints", {
|
|
284
|
-
success: ArraySchema(Struct({
|
|
285
|
-
stepAttemptId: String2,
|
|
286
|
-
ref: optionalKey(String2),
|
|
287
|
-
repoBinding: optionalKey(WorkUnitRepoBinding)
|
|
288
|
-
})),
|
|
289
|
-
error: RunnerRpcError
|
|
290
|
-
}), make5("ForgetCheckpoints", {
|
|
291
|
-
payload: { stepAttemptIds: ArraySchema(String2) },
|
|
292
|
-
success: Void,
|
|
293
|
-
error: RunnerRpcError
|
|
294
|
-
}), make5("Bundle", {
|
|
295
|
-
payload: { digest: String2 },
|
|
296
|
-
success: Struct({ bundle: String2 }),
|
|
297
|
-
error: RunnerRpcError
|
|
298
|
-
}), make5("SettledRuns", {
|
|
299
|
-
payload: { runIds: ArraySchema(String2) },
|
|
300
|
-
success: ArraySchema(String2),
|
|
301
|
-
error: RunnerRpcError
|
|
302
|
-
}), make5("ProgramSecrets", {
|
|
303
|
-
payload: { lease: ProgramLease },
|
|
304
|
-
success: Record(String2, String2),
|
|
305
|
-
error: RunnerRpcError
|
|
306
|
-
}), make5("Suspend", { payload: { lease: ProgramLease }, error: RunnerRpcError }), make5("FinishProgram", { payload: { lease: ProgramLease, outcome: ProgramOutcome }, error: RunnerRpcError }), make5("Signals", {
|
|
307
|
-
payload: { runnerReplicaId: String2 },
|
|
308
|
-
success: RunnerSignal,
|
|
309
|
-
error: RunnerRpcError,
|
|
310
|
-
stream: true
|
|
311
|
-
})).middleware(RunnerAuthentication) {
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// packages/live/src/rpc/runner-client.ts
|
|
315
|
-
var runnerWebSocketProtocol2 = (url) => layerProtocolSocket({ retryTransientErrors: true }).pipe(provide2(layerWebSocket(url)), provide2(layerWebSocketConstructorGlobal), provide2(layerJson));
|
|
316
|
-
function runnerRpcUrl2(apiUrl) {
|
|
317
|
-
const url = new URL("/v1/runners/rpc", apiUrl);
|
|
318
|
-
url.protocol = url.protocol === "https:" ? "wss:" : "ws:";
|
|
319
|
-
return url.toString();
|
|
320
|
-
}
|
|
321
|
-
var makeRunnerRpcClient2 = (options) => gen(function* () {
|
|
322
|
-
const protocol = yield* build2(options.protocol);
|
|
323
|
-
const client = yield* make7(RunnerRpcs).pipe(provideContext(protocol));
|
|
324
|
-
const authorized = (call) => flatMap(options.bearer, (token) => withHeaders(call, {
|
|
325
|
-
authorization: `Bearer ${token}`,
|
|
326
|
-
[RunnerHeaders.runnerId]: options.runnerId,
|
|
327
|
-
[RunnerHeaders.protocolVersion]: String(RunnerRpcProtocolVersion)
|
|
328
|
-
}));
|
|
329
|
-
return {
|
|
330
|
-
claim: (input) => authorized(client.Claim(input)),
|
|
331
|
-
heartbeat: (input) => authorized(client.Heartbeat(input)),
|
|
332
|
-
complete: (input) => authorized(client.Complete(input)),
|
|
333
|
-
release: (input) => authorized(client.Release(input)),
|
|
334
|
-
recordActivity: (input) => authorized(client.RecordActivity(input)),
|
|
335
|
-
deferredDone: (input) => authorized(client.DeferredDone(input)),
|
|
336
|
-
scheduleClock: (input) => authorized(client.ScheduleClock(input)),
|
|
337
|
-
putQuestion: (input) => authorized(client.PutQuestion(input)),
|
|
338
|
-
programSecrets: (input) => authorized(client.ProgramSecrets(input)),
|
|
339
|
-
suspend: (input) => authorized(client.Suspend(input)),
|
|
340
|
-
finishProgram: (input) => authorized(client.FinishProgram(input)),
|
|
341
|
-
startAgentStep: (input) => authorized(client.StartAgentStep(input)),
|
|
342
|
-
startVerification: (input) => authorized(client.StartVerification(input)),
|
|
343
|
-
knownEvidence: (input) => authorized(client.KnownEvidence(input)),
|
|
344
|
-
awaitEvent: (input) => authorized(client.AwaitEvent(input)),
|
|
345
|
-
admitChild: (input) => authorized(client.AdmitChild(input)),
|
|
346
|
-
storeArtifact: (input) => authorized(client.StoreArtifact(input)),
|
|
347
|
-
recordNote: (input) => authorized(client.RecordNote(input)),
|
|
348
|
-
performHostEffect: (input) => authorized(client.PerformHostEffect(input)),
|
|
349
|
-
createPlanTasks: (input) => authorized(client.CreatePlanTasks(input)),
|
|
350
|
-
integrationBranch: (input) => authorized(client.IntegrationBranch(input)),
|
|
351
|
-
mergeChangeRequest: (input) => authorized(client.MergeChangeRequest(input)),
|
|
352
|
-
publishRelease: (input) => authorized(client.PublishRelease(input)),
|
|
353
|
-
bundle: (digest) => authorized(client.Bundle({ digest })),
|
|
354
|
-
settledRuns: (runIds) => authorized(client.SettledRuns({ runIds })),
|
|
355
|
-
reportSteer: (input) => authorized(client.ReportSteer(input)),
|
|
356
|
-
saveCheckpoint: (input) => authorized(client.SaveCheckpoint(input)),
|
|
357
|
-
resumeCheckpoint: (input) => authorized(client.ResumeCheckpoint(input)),
|
|
358
|
-
settledCheckpoints: authorized(client.SettledCheckpoints()),
|
|
359
|
-
forgetCheckpoints: (stepAttemptIds) => authorized(client.ForgetCheckpoints({ stepAttemptIds })),
|
|
360
|
-
listen: (runnerReplicaId, onSignal) => authorized(runForEach(client.Signals({ runnerReplicaId }), onSignal))
|
|
361
|
-
};
|
|
362
|
-
});
|
|
363
|
-
|
|
364
|
-
export { RunnerRpcProtocolVersion, RunnerRpcError, RunSettled, runnerWebSocketProtocol2, runnerRpcUrl2, makeRunnerRpcClient2 };
|