@kitman-sh/sdk 0.10.68 → 0.10.69
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/build/index.js +2 -2
- package/dist/{chunk-x37rn3aw.js → chunk-8z4xvm69.js} +4 -1
- package/dist/{chunk-dnmb9dw9.js → chunk-abjq7rp4.js} +12 -3
- package/dist/loop/index.js +1 -1
- package/dist/program/index.js +2 -2
- package/package.json +1 -1
- package/types/packages/live/src/rpc/runner-client.d.ts +1 -0
- package/types/packages/live/src/rpc/runner-group.d.ts +6 -0
- package/types/packages/sdk/src/loop/steps.d.ts +4 -0
- package/types/packages/sdk/src/loop/test-loop.d.ts +4 -1
- package/types/packages/sdk/src/program/engine.d.ts +1 -0
package/dist/build/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
KitDigest,
|
|
5
5
|
AgentDeclaration,
|
|
6
6
|
KitDeclarations
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-abjq7rp4.js";
|
|
8
8
|
import {
|
|
9
9
|
digestSha256,
|
|
10
10
|
digestSha512,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
RunnerRpcProtocolVersion,
|
|
14
14
|
describeFlag2,
|
|
15
15
|
Described2
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-8z4xvm69.js";
|
|
17
17
|
|
|
18
18
|
// packages/core/src/json.ts
|
|
19
19
|
import * as Schema from "effect/Schema";
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
executeLoop2,
|
|
34
34
|
LoopCheckError2,
|
|
35
35
|
checkLoop2
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-abjq7rp4.js";
|
|
37
37
|
// packages/core/src/agent-environment.ts
|
|
38
38
|
import * as Schema from "effect/Schema";
|
|
39
39
|
var AgentEnvironmentPolicy = Schema.Union([Schema.Literal("recommended"), Schema.Literal("required")]);
|
|
@@ -909,6 +909,7 @@ class RunnerCapabilityRpcs extends RpcGroup.make(Rpc.make("PutQuestion", {
|
|
|
909
909
|
revision: Schema7.optionalKey(Schema7.String),
|
|
910
910
|
checks: Schema7.optional(Schema7.Array(Schema7.String)),
|
|
911
911
|
suggested: Schema7.optionalKey(Schema7.Array(ApprovedCheck)),
|
|
912
|
+
rerunFailed: Schema7.optionalKey(Schema7.Boolean),
|
|
912
913
|
measure: Schema7.optionalKey(Schema7.Struct({
|
|
913
914
|
base: Schema7.optionalKey(Schema7.String),
|
|
914
915
|
plan: MeasurePlan2,
|
|
@@ -1402,6 +1403,7 @@ var runnerHost = (capabilities) => ({
|
|
|
1402
1403
|
...launch.revision === undefined ? undefined : { revision: launch.revision },
|
|
1403
1404
|
...launch.checks === undefined ? undefined : { checks: launch.checks },
|
|
1404
1405
|
...launch.suggested === undefined ? undefined : { suggested: launch.suggested },
|
|
1406
|
+
...launch.rerunFailed === undefined ? undefined : { rerunFailed: launch.rerunFailed },
|
|
1405
1407
|
...launch.measure === undefined ? undefined : { measure: launch.measure }
|
|
1406
1408
|
})).pipe(Effect2.asVoid),
|
|
1407
1409
|
startAgentWork: (launch) => requested2(launch.step, capabilities.startAgentStep({
|
|
@@ -1625,6 +1627,7 @@ var rpcProgramPorts2 = (rpc, work) => {
|
|
|
1625
1627
|
...verification.revision === undefined ? undefined : { revision: verification.revision },
|
|
1626
1628
|
...verification.checks === undefined ? undefined : { checks: [...verification.checks] },
|
|
1627
1629
|
...verification.suggested === undefined ? undefined : { suggested: [...verification.suggested] },
|
|
1630
|
+
...verification.rerunFailed === undefined ? undefined : { rerunFailed: verification.rerunFailed },
|
|
1628
1631
|
...verification.measure === undefined ? undefined : { measure: verification.measure }
|
|
1629
1632
|
}),
|
|
1630
1633
|
startAgentStep: ({ secrets, ...step }) => rpc.startAgentStep({ lease, ...step, ...secrets === undefined ? undefined : { secrets: [...secrets] } }),
|
|
@@ -3034,6 +3034,7 @@ var verify2 = (name, request) => takeStep2(name, "verify", "verify", Effect3.gen
|
|
|
3034
3034
|
...request.revision === undefined ? undefined : { revision: request.revision },
|
|
3035
3035
|
...request.checks === undefined ? undefined : { checks: request.checks },
|
|
3036
3036
|
...request.suggested === undefined || request.suggested.length === 0 ? undefined : { suggested: request.suggested },
|
|
3037
|
+
...request.rerunFailed === true ? { rerunFailed: true } : undefined,
|
|
3037
3038
|
token
|
|
3038
3039
|
}));
|
|
3039
3040
|
return yield* DurableDeferred.await(deferred);
|
|
@@ -4129,7 +4130,7 @@ var journaled = (engine, journal, ran) => ({
|
|
|
4129
4130
|
})
|
|
4130
4131
|
});
|
|
4131
4132
|
var scriptedExit = (scripted, failure) => scripted === undefined ? Exit3.fail(failure("nothing was scripted for this Step")) : scripted instanceof ScriptedFailure2 ? Exit3.fail(failure(scripted.reason)) : Exit3.succeed(scripted);
|
|
4132
|
-
var scriptedHost = (script, engine, agentLaunches, childLaunches, waits) => {
|
|
4133
|
+
var scriptedHost = (script, engine, agentLaunches, childLaunches, waits, verifyLaunches) => {
|
|
4133
4134
|
const resolve = (deferred, token, exit) => DurableDeferred4.done(deferred, { token, exit }).pipe(Effect8.provideService(WorkflowEngine.WorkflowEngine, engine));
|
|
4134
4135
|
return {
|
|
4135
4136
|
startAgentWork: (launch) => Effect8.andThen(Effect8.sync(() => agentLaunches.push({
|
|
@@ -4159,6 +4160,13 @@ var scriptedHost = (script, engine, agentLaunches, childLaunches, waits) => {
|
|
|
4159
4160
|
claimResource: (launch) => launch.action === "let_go" ? resolve(letGoDeferred2(launch.step), launch.token, Exit3.succeed(null)) : resolve(claimDeferred2(launch.step), launch.token, Exit3.succeed(script.claims?.[launch.step] ?? { status: "granted", resource: launch.resource })),
|
|
4160
4161
|
startVerification: (launch) => {
|
|
4161
4162
|
const scripted = script.verifications?.[launch.step];
|
|
4163
|
+
if (launch.measure === undefined)
|
|
4164
|
+
verifyLaunches.push({
|
|
4165
|
+
step: launch.step,
|
|
4166
|
+
...launch.revision === undefined ? undefined : { revision: launch.revision },
|
|
4167
|
+
...launch.checks === undefined ? undefined : { checks: launch.checks },
|
|
4168
|
+
...launch.rerunFailed === undefined ? undefined : { rerunFailed: launch.rerunFailed }
|
|
4169
|
+
});
|
|
4162
4170
|
if (launch.measure !== undefined) {
|
|
4163
4171
|
const measured = script.measurements?.[launch.step];
|
|
4164
4172
|
const flat = Array.from({ length: launch.measure.samples }, () => Object.fromEntries(launch.measure?.plan.metrics.map((metric) => [metric.name, 100]) ?? []));
|
|
@@ -4209,6 +4217,7 @@ var testLoop2 = (loop, script) => {
|
|
|
4209
4217
|
const agentLaunches = [];
|
|
4210
4218
|
const childLaunches = [];
|
|
4211
4219
|
const waits = [];
|
|
4220
|
+
const verifyLaunches = [];
|
|
4212
4221
|
let latestSteps = [];
|
|
4213
4222
|
const declared = capabilitiesOf2(loop);
|
|
4214
4223
|
const granted = new Set((script.grant ?? declared).filter((capability) => declared.includes(capability)));
|
|
@@ -4221,7 +4230,7 @@ var testLoop2 = (loop, script) => {
|
|
|
4221
4230
|
const execute = (payload) => Effect8.gen(function* () {
|
|
4222
4231
|
const engine = yield* WorkflowEngine.WorkflowEngine;
|
|
4223
4232
|
return yield* executeLoop2(loop, {
|
|
4224
|
-
host: scriptedHost(script, engine, agentLaunches, childLaunches, waits),
|
|
4233
|
+
host: scriptedHost(script, engine, agentLaunches, childLaunches, waits, verifyLaunches),
|
|
4225
4234
|
activities,
|
|
4226
4235
|
granted,
|
|
4227
4236
|
onRun: (run) => {
|
|
@@ -4231,7 +4240,7 @@ var testLoop2 = (loop, script) => {
|
|
|
4231
4240
|
});
|
|
4232
4241
|
return Effect8.gen(function* () {
|
|
4233
4242
|
const result = yield* Effect8.exit(workflow.execute({ input: script.input }).pipe(Effect8.provideService(ConfigProvider.ConfigProvider, ConfigProvider.fromUnknown(script.secrets ?? {}))));
|
|
4234
|
-
return { result, steps: latestSteps, journal, activities: ran, agentLaunches, childLaunches, waits };
|
|
4243
|
+
return { result, steps: latestSteps, journal, activities: ran, agentLaunches, childLaunches, waits, verifyLaunches };
|
|
4235
4244
|
}).pipe(Effect8.provide(workflow.toLayer(execute).pipe(Layer.provideMerge(WorkflowEngine.layerMemory))));
|
|
4236
4245
|
};
|
|
4237
4246
|
// packages/sdk/src/loop/review.ts
|
package/dist/loop/index.js
CHANGED
package/dist/program/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"../chunk-
|
|
2
|
+
import"../chunk-abjq7rp4.js";
|
|
3
3
|
import {
|
|
4
4
|
JournalWriteFailed2,
|
|
5
5
|
refusedStep2,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
networkGuard2,
|
|
18
18
|
carriedKits2,
|
|
19
19
|
runKit2
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-8z4xvm69.js";
|
|
21
21
|
export {
|
|
22
22
|
Described2 as Described,
|
|
23
23
|
JournalWriteFailed2 as JournalWriteFailed,
|
package/package.json
CHANGED
|
@@ -1219,6 +1219,7 @@ export declare const makeProgramRpcClient: (options: ConnectionOptions) => Effec
|
|
|
1219
1219
|
readonly workingDirectory?: string;
|
|
1220
1220
|
readonly suggested?: boolean;
|
|
1221
1221
|
}[];
|
|
1222
|
+
readonly rerunFailed?: boolean;
|
|
1222
1223
|
readonly measure?: {
|
|
1223
1224
|
readonly base?: string;
|
|
1224
1225
|
readonly plan: {
|
|
@@ -1300,6 +1300,8 @@ declare const RunnerCapabilityRpcs_base: RpcGroup.RpcGroup<Rpc.Rpc<"AdmitChild",
|
|
|
1300
1300
|
readonly workingDirectory: Schema.optionalKey<Schema.String>;
|
|
1301
1301
|
readonly suggested: Schema.optionalKey<Schema.Boolean>;
|
|
1302
1302
|
}>>>;
|
|
1303
|
+
/** Runs a check again whose evidence at the tree failed, rather than reusing that failure; passed evidence is still reused. */
|
|
1304
|
+
rerunFailed: Schema.optionalKey<Schema.Boolean>;
|
|
1303
1305
|
/** A benchmark against `base` (the Run's base branch head when left out) in place of checks. */
|
|
1304
1306
|
measure: Schema.optionalKey<Schema.Struct<{
|
|
1305
1307
|
readonly base: Schema.optionalKey<Schema.String>;
|
|
@@ -2155,6 +2157,8 @@ export declare const ProgramRpcs: RpcGroup.RpcGroup<Rpc.Rpc<"AdmitChild", Schema
|
|
|
2155
2157
|
readonly workingDirectory: Schema.optionalKey<Schema.String>;
|
|
2156
2158
|
readonly suggested: Schema.optionalKey<Schema.Boolean>;
|
|
2157
2159
|
}>>>;
|
|
2160
|
+
/** Runs a check again whose evidence at the tree failed, rather than reusing that failure; passed evidence is still reused. */
|
|
2161
|
+
rerunFailed: Schema.optionalKey<Schema.Boolean>;
|
|
2158
2162
|
/** A benchmark against `base` (the Run's base branch head when left out) in place of checks. */
|
|
2159
2163
|
measure: Schema.optionalKey<Schema.Struct<{
|
|
2160
2164
|
readonly base: Schema.optionalKey<Schema.String>;
|
|
@@ -3453,6 +3457,8 @@ export declare const RunnerRpcs: RpcGroup.RpcGroup<Rpc.Rpc<"AdmitChild", Schema.
|
|
|
3453
3457
|
readonly workingDirectory: Schema.optionalKey<Schema.String>;
|
|
3454
3458
|
readonly suggested: Schema.optionalKey<Schema.Boolean>;
|
|
3455
3459
|
}>>>;
|
|
3460
|
+
/** Runs a check again whose evidence at the tree failed, rather than reusing that failure; passed evidence is still reused. */
|
|
3461
|
+
rerunFailed: Schema.optionalKey<Schema.Boolean>;
|
|
3456
3462
|
/** A benchmark against `base` (the Run's base branch head when left out) in place of checks. */
|
|
3457
3463
|
measure: Schema.optionalKey<Schema.Struct<{
|
|
3458
3464
|
readonly base: Schema.optionalKey<Schema.String>;
|
|
@@ -145,6 +145,8 @@ export type VerificationLaunch = Launch & {
|
|
|
145
145
|
readonly checks?: readonly string[];
|
|
146
146
|
/** Run in place of approved checks when the repository has none approved, labelled as suggested. */
|
|
147
147
|
readonly suggested?: readonly SuggestedVerification[];
|
|
148
|
+
/** Runs a check again whose evidence at the tree failed, rather than reusing that failure; passed evidence is still reused. */
|
|
149
|
+
readonly rerunFailed?: boolean;
|
|
148
150
|
/** Benchmarks the revision against `base` (the Run's base branch head when left out) in place of checks. */
|
|
149
151
|
readonly measure?: MeasureLaunch;
|
|
150
152
|
};
|
|
@@ -320,6 +322,8 @@ export declare const verify: (name: string, request: {
|
|
|
320
322
|
* up still gets evidence; ignored once any check is approved.
|
|
321
323
|
*/
|
|
322
324
|
readonly suggested?: readonly SuggestedVerification[];
|
|
325
|
+
/** Runs a check again whose evidence at the tree failed, rather than reusing that failure; passed evidence is still reused. */
|
|
326
|
+
readonly rerunFailed?: boolean;
|
|
323
327
|
}) => Effect.Effect<{
|
|
324
328
|
readonly revision: string;
|
|
325
329
|
readonly tree: string;
|
|
@@ -7,7 +7,7 @@ import { type LoopCapability, type LoopDefinition } from './define';
|
|
|
7
7
|
import type { MeasureEvidence } from '../../../core/src/work-unit';
|
|
8
8
|
import type { VerifyResult } from './evidence';
|
|
9
9
|
import { type ClaimResult } from './claims';
|
|
10
|
-
import { InputInvalid, LoopHost, LoopRun, type EventWaitLaunch, type LoopEvent, type StepRecord } from './steps';
|
|
10
|
+
import { InputInvalid, LoopHost, LoopRun, type EventWaitLaunch, type LoopEvent, type StepRecord, type VerificationLaunch } from './steps';
|
|
11
11
|
/** Activity and deferred results, encoded as JSON; replaying from it runs no Activity again. */
|
|
12
12
|
export declare const LoopJournal: Schema.Struct<{
|
|
13
13
|
readonly activities: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
@@ -101,8 +101,11 @@ export type TestLoopResult<Out, E> = {
|
|
|
101
101
|
readonly childLaunches: readonly ChildLaunchRecord[];
|
|
102
102
|
/** Every `waitFor` started, in order. */
|
|
103
103
|
readonly waits: readonly WaitRecord[];
|
|
104
|
+
/** Every `verify` started, in order. */
|
|
105
|
+
readonly verifyLaunches: readonly VerifyRecord[];
|
|
104
106
|
};
|
|
105
107
|
type WaitRecord = Pick<EventWaitLaunch, 'step' | 'event' | 'filter' | 'since' | 'or'>;
|
|
108
|
+
type VerifyRecord = Pick<VerificationLaunch, 'step' | 'revision' | 'checks' | 'rerunFailed'>;
|
|
106
109
|
type AgentLaunchRecord = {
|
|
107
110
|
readonly step: string;
|
|
108
111
|
readonly agent: string;
|
|
@@ -54,6 +54,7 @@ export type ProgramCapabilities = {
|
|
|
54
54
|
readonly revision?: string;
|
|
55
55
|
readonly checks?: readonly string[];
|
|
56
56
|
readonly suggested?: readonly SuggestedVerification[];
|
|
57
|
+
readonly rerunFailed?: boolean;
|
|
57
58
|
readonly measure?: MeasureLaunch;
|
|
58
59
|
}) => Effect.Effect<{
|
|
59
60
|
readonly verificationId: string;
|