@kitman-sh/sdk 0.7.4 → 0.7.5

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.
@@ -4,12 +4,12 @@ import {
4
4
  KitInstallationDeclaration,
5
5
  KitAssignmentDeclaration,
6
6
  PackageDeclarations
7
- } from "../chunk-7jc5y0mj.js";
7
+ } from "../chunk-8byx9rx2.js";
8
8
  import {
9
9
  RunnerRpcProtocolVersion,
10
10
  describeFlag2,
11
11
  Described2
12
- } from "../chunk-p8v1smcg.js";
12
+ } from "../chunk-72z6zbfz.js";
13
13
 
14
14
  // packages/core/src/crypto.ts
15
15
  import { createHash, createHmac, createSign, randomBytes, timingSafeEqual } from "crypto";
@@ -19,7 +19,7 @@ import {
19
19
  executeLoop2,
20
20
  LoopCheckError2,
21
21
  checkLoop2
22
- } from "./chunk-7jc5y0mj.js";
22
+ } from "./chunk-8byx9rx2.js";
23
23
  // packages/core/src/repo-binding.ts
24
24
  import * as Schema from "effect/Schema";
25
25
  var RepoBindingPathPrefixPattern = "^(?!/)(?!.*\\\\)(?!.*(?:^|/)\\.\\.?(?:/|$))(?!.*//)\\S+$";
@@ -1085,11 +1085,6 @@ var WorkspacePolicyKitBackfillCancelResult = Schema6.Struct({
1085
1085
  var LoopLayers = ["project", "workspace", "shipped"];
1086
1086
  var AgentEfforts = ["low", "medium", "high", "xhigh"];
1087
1087
 
1088
- // packages/core/src/schedule.ts
1089
- import * as Schema13 from "effect/Schema";
1090
- import * as DateTime from "effect/DateTime";
1091
- import * as Option from "effect/Option";
1092
-
1093
1088
  // packages/core/src/loop.ts
1094
1089
  import * as Effect from "effect/Effect";
1095
1090
  import * as Schema12 from "effect/Schema";
@@ -2786,6 +2781,16 @@ var StepSessionUpdate = Schema12.Struct({
2786
2781
  kind: Schema12.String.check(Schema12.isMinLength(1), Schema12.isMaxLength(80)),
2787
2782
  content: Schema12.String.check(Schema12.isMinLength(1), Schema12.isMaxLength(4000))
2788
2783
  });
2784
+ var StepAttemptSessionUpdate = Schema12.Struct({
2785
+ id: Id,
2786
+ kind: Schema12.String,
2787
+ content: Schema12.String,
2788
+ createdAt: Timestamp
2789
+ });
2790
+ var StepAttemptSessionUpdateList = Schema12.Struct({
2791
+ items: Schema12.Array(StepAttemptSessionUpdate),
2792
+ next: Schema12.optionalKey(Schema12.String)
2793
+ });
2789
2794
  var StepOutputSubmissionResult = Schema12.Union([
2790
2795
  Schema12.Struct({ status: Schema12.Literal("accepted") }),
2791
2796
  Schema12.Struct({
@@ -2898,7 +2903,9 @@ var RunStepSummary = Schema12.Struct({
2898
2903
  id: Id,
2899
2904
  attempt: Schema12.Int.check(Schema12.isGreaterThanOrEqualTo(1)),
2900
2905
  status: StepAttemptStatus,
2901
- failureSummary: Schema12.optionalKey(Schema12.String)
2906
+ failureSummary: Schema12.optionalKey(Schema12.String),
2907
+ output: Schema12.optionalKey(Schema12.Unknown),
2908
+ revision: Schema12.optionalKey(Schema12.String)
2902
2909
  }))
2903
2910
  });
2904
2911
  var RunSteerDeliveries = ["queued", "delivered", "failed"];
@@ -2911,14 +2918,73 @@ var RunSteer = Schema12.Struct({
2911
2918
  });
2912
2919
  var RunSteerInput = Schema12.Struct({
2913
2920
  text: LoopSafeText,
2921
+ stepAttemptId: Schema12.optionalKey(Id),
2914
2922
  idempotencyKey: Schema12.String.check(Schema12.isMinLength(1), Schema12.isMaxLength(240))
2915
2923
  });
2916
2924
  var RunSteerSent = Schema12.Struct({
2917
2925
  steer: RunSteer,
2918
2926
  target: Schema12.Literals(["session", "next_step"])
2919
2927
  });
2928
+ var RunDisplayStates = [
2929
+ "queued",
2930
+ "running",
2931
+ "needs_you",
2932
+ "blocked",
2933
+ "failed",
2934
+ "stopped",
2935
+ "succeeded",
2936
+ "partial"
2937
+ ];
2938
+ var RunDisplay = Schema12.Struct({
2939
+ state: Schema12.Literals(RunDisplayStates),
2940
+ retried: Schema12.Boolean,
2941
+ summary: Schema12.optionalKey(Schema12.String)
2942
+ });
2943
+ var RunGraphNodeKinds = ["agent", "check", "question", "child", "wait", "activity"];
2944
+ var RunGraphNode = Schema12.Struct({
2945
+ id: Id,
2946
+ name: Schema12.String,
2947
+ kind: Schema12.Literals(RunGraphNodeKinds),
2948
+ status: Schema12.Literals(RunDisplayStates),
2949
+ startedAt: Timestamp,
2950
+ endedAt: Schema12.optionalKey(Timestamp),
2951
+ attempts: Schema12.Array(Schema12.Struct({
2952
+ id: Id,
2953
+ attempt: Schema12.Int.check(Schema12.isGreaterThanOrEqualTo(1)),
2954
+ status: Schema12.Literals(RunDisplayStates),
2955
+ failureSummary: Schema12.optionalKey(Schema12.String)
2956
+ })),
2957
+ agent: Schema12.optionalKey(Schema12.Struct({
2958
+ id: Id,
2959
+ harness: Schema12.optionalKey(Schema12.String),
2960
+ model: Schema12.optionalKey(Schema12.String),
2961
+ runner: Schema12.optionalKey(Schema12.Struct({ id: Id, name: Schema12.String }))
2962
+ })),
2963
+ child: Schema12.optionalKey(Schema12.Struct({
2964
+ runId: Id,
2965
+ loopTitle: Schema12.String,
2966
+ display: RunDisplay,
2967
+ task: Schema12.optionalKey(Schema12.Struct({ id: Id, key: Schema12.String, title: Schema12.String }))
2968
+ }))
2969
+ });
2970
+ var RunGraph = Schema12.Struct({
2971
+ columns: Schema12.Array(Schema12.Array(RunGraphNode)),
2972
+ needs: Schema12.Array(Schema12.Struct({ from: Id, to: Id }))
2973
+ });
2974
+ var RunHeader = Schema12.Struct({
2975
+ loopTitle: Schema12.String,
2976
+ branch: Schema12.optionalKey(Schema12.String),
2977
+ changeRequest: Schema12.optionalKey(Schema12.Struct({ id: Id, title: Schema12.String, url: Schema12.String })),
2978
+ startedBy: Schema12.optionalKey(Schema12.Union([
2979
+ Schema12.Struct({ kind: Schema12.Literal("person"), name: Schema12.String }),
2980
+ Schema12.Struct({ kind: Schema12.Literal("event"), event: Schema12.String })
2981
+ ]))
2982
+ });
2920
2983
  var RunShow = Schema12.Struct({
2921
2984
  run: Run,
2985
+ header: RunHeader,
2986
+ display: RunDisplay,
2987
+ graph: RunGraph,
2922
2988
  steps: Schema12.Array(RunStepSummary),
2923
2989
  questions: Schema12.Array(Question),
2924
2990
  children: Schema12.Array(Schema12.Struct({ runId: Id, name: Schema12.String, status: RunStatus, createdAt: Timestamp })),
@@ -2929,6 +2995,7 @@ var RunShow = Schema12.Struct({
2929
2995
  recordedAt: Timestamp
2930
2996
  })),
2931
2997
  artifacts: Schema12.Array(RunArtifact),
2998
+ findings: Schema12.Array(RunArtifact),
2932
2999
  events: Schema12.Array(Schema12.Struct({ id: Id, type: Schema12.String, occurredAt: Timestamp })),
2933
3000
  evidence: Schema12.Array(RunEvidence),
2934
3001
  steers: Schema12.Array(RunSteer),
@@ -2959,7 +3026,6 @@ var ProgramLoop = Schema12.Struct({
2959
3026
  publishedAt: Timestamp,
2960
3027
  package: Schema12.String
2961
3028
  });
2962
- var LoopDetail = Schema12.Struct({ id: Schema12.String, resolved: Schema12.optionalKey(ProgramLoop) });
2963
3029
  var AutomaticStart = Schema12.Struct({
2964
3030
  eventId: Schema12.String,
2965
3031
  eventType: Schema12.String,
@@ -2994,7 +3060,17 @@ var ProgramAgent = Schema12.Struct({
2994
3060
  });
2995
3061
  var ProgramAgentList = Schema12.Struct({ items: Schema12.Array(ProgramAgent) });
2996
3062
  var ProgramLoopList = Schema12.Struct({ items: Schema12.Array(ProgramLoop) });
2997
- var RunList = Schema12.Struct({ items: Schema12.Array(Run) });
3063
+ var RunListItem = Schema12.Struct({
3064
+ run: Run,
3065
+ loop: Schema12.Struct({ id: Schema12.String, title: Schema12.String }),
3066
+ task: Schema12.optionalKey(Schema12.Struct({ id: Id, key: Schema12.String, title: Schema12.String })),
3067
+ display: RunDisplay,
3068
+ miniGraph: Schema12.Array(Schema12.Literals(RunDisplayStates))
3069
+ });
3070
+ var RunList = Schema12.Struct({
3071
+ items: Schema12.Array(RunListItem),
3072
+ next: Schema12.optionalKey(Schema12.String)
3073
+ });
2998
3074
  var RunWaitReasons = ["question", "completed", "failed", "stopped", "timeout"];
2999
3075
  var RunWaitResult = Schema12.Struct({
3000
3076
  reason: Schema12.Literals(RunWaitReasons),
@@ -3017,6 +3093,9 @@ var RunActionList = Schema12.Struct({ items: Schema12.Array(RunActionSummary) })
3017
3093
  var RunActionTaken = Schema12.Struct({ action: Schema12.String, run: Run });
3018
3094
 
3019
3095
  // packages/core/src/schedule.ts
3096
+ import * as Schema13 from "effect/Schema";
3097
+ import * as DateTime from "effect/DateTime";
3098
+ import * as Option from "effect/Option";
3020
3099
  var ScheduleFrequency = ["daily", "weekly"];
3021
3100
  var ScheduleMisfirePolicies = ["skip", "fire_once", "catch_up"];
3022
3101
  var ScheduleOverlapPolicies = ["allow", "skip", "coalesce"];
@@ -3134,6 +3213,10 @@ var LoopManifest = Schema14.Struct({
3134
3213
  secrets: Schema14.optionalKey(Schema14.Array(SecretName)),
3135
3214
  network: Schema14.optionalKey(AgentSandboxNetwork)
3136
3215
  });
3216
+ var LoopDetail = Schema14.Struct({
3217
+ id: Schema14.String,
3218
+ resolved: Schema14.optionalKey(Schema14.Struct({ ...ProgramLoop.fields, agents: LoopManifest.fields.agents, when: LoopManifest.fields.when }))
3219
+ });
3137
3220
  var AgentDeclaration = Schema14.Struct({
3138
3221
  extends: Schema14.optionalKey(Schema14.String),
3139
3222
  instructions: Schema14.optionalKey(Schema14.String),
@@ -94,7 +94,7 @@ import {
94
94
  LoopCheckError2,
95
95
  checkLoop2,
96
96
  defineConfig2
97
- } from "../chunk-7jc5y0mj.js";
97
+ } from "../chunk-8byx9rx2.js";
98
98
  export {
99
99
  ArtifactActivity2 as ArtifactActivity,
100
100
  ArtifactRequest2 as ArtifactRequest,
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"../chunk-7jc5y0mj.js";
2
+ import"../chunk-8byx9rx2.js";
3
3
  import {
4
4
  JournalWriteFailed2,
5
5
  refusedStep2,
@@ -13,7 +13,7 @@ import {
13
13
  undeclaredHostsEnv2,
14
14
  networkGuard2,
15
15
  runPackage2
16
- } from "../chunk-p8v1smcg.js";
16
+ } from "../chunk-72z6zbfz.js";
17
17
  export {
18
18
  Described2 as Described,
19
19
  JournalWriteFailed2 as JournalWriteFailed,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitman-sh/sdk",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "exports": {
@@ -66,6 +66,8 @@ export * from './observability';
66
66
  export * from './following';
67
67
  export * from './approval-queue';
68
68
  export * from './data-lifecycle';
69
+ export * from './run-display';
70
+ export * from './run-graph';
69
71
  export * from './run-journal';
70
72
  export * from './loop-layers';
71
73
  export * from './package-declarations';
@@ -205,6 +205,7 @@ export declare const LiveEventPayload: Schema.Union<readonly [Schema.Struct<{
205
205
  readonly loopId: Schema.optionalKey<Schema.String>;
206
206
  readonly status: Schema.optionalKey<Schema.String>;
207
207
  readonly stepKey: Schema.optionalKey<Schema.String>;
208
+ readonly stepAttemptId: Schema.optionalKey<Schema.String>;
208
209
  readonly sequence: Schema.optionalKey<Schema.Int>;
209
210
  }>, Schema.Struct<{
210
211
  readonly operation: Schema.Union<readonly [Schema.Literal<"created">, Schema.Literal<"updated">, Schema.Literal<"deleted">, Schema.Literal<"status_changed">, Schema.Literal<"assignment_changed">, Schema.Literal<"moved">, Schema.Literal<"heartbeat">, Schema.Literal<"access_changed">, Schema.Literal<"resolved">, Schema.Literal<"approved">, Schema.Literal<"rejected">, Schema.Literal<"completed">, Schema.Literal<"claimed">, Schema.Literal<"failed">, Schema.Literal<"invalidated">, Schema.Literal<"opened">, Schema.Literal<"closed">, Schema.Literal<"changed">, Schema.Literal<"promoted">, Schema.Literal<"waived">, Schema.Literal<"available">, Schema.Literal<"removed">, Schema.Literal<"lease_changed">, Schema.Literal<"step_changed">, Schema.Literal<"message_created">, Schema.Literal<"acknowledged">]>;
@@ -484,6 +485,7 @@ export declare const LiveEvent: Schema.Struct<{
484
485
  readonly loopId: Schema.optionalKey<Schema.String>;
485
486
  readonly status: Schema.optionalKey<Schema.String>;
486
487
  readonly stepKey: Schema.optionalKey<Schema.String>;
488
+ readonly stepAttemptId: Schema.optionalKey<Schema.String>;
487
489
  readonly sequence: Schema.optionalKey<Schema.Int>;
488
490
  }>, Schema.Struct<{
489
491
  readonly operation: Schema.Union<readonly [Schema.Literal<"created">, Schema.Literal<"updated">, Schema.Literal<"deleted">, Schema.Literal<"status_changed">, Schema.Literal<"assignment_changed">, Schema.Literal<"moved">, Schema.Literal<"heartbeat">, Schema.Literal<"access_changed">, Schema.Literal<"resolved">, Schema.Literal<"approved">, Schema.Literal<"rejected">, Schema.Literal<"completed">, Schema.Literal<"claimed">, Schema.Literal<"failed">, Schema.Literal<"invalidated">, Schema.Literal<"opened">, Schema.Literal<"closed">, Schema.Literal<"changed">, Schema.Literal<"promoted">, Schema.Literal<"waived">, Schema.Literal<"available">, Schema.Literal<"removed">, Schema.Literal<"lease_changed">, Schema.Literal<"step_changed">, Schema.Literal<"message_created">, Schema.Literal<"acknowledged">]>;
@@ -650,6 +652,7 @@ export declare const LiveEventTypes: {
650
652
  readonly RunCreated: 'dev.kitman.run.created.v1';
651
653
  readonly RunStatusChanged: 'dev.kitman.run.status.changed.v1';
652
654
  readonly RunStepChanged: 'dev.kitman.run.step.changed.v1';
655
+ readonly RunSessionUpdateCreated: 'dev.kitman.run.session_update.created.v1';
653
656
  readonly LoopChangeCreated: 'dev.kitman.loop_change.created.v1';
654
657
  readonly LoopChangeUpdated: 'dev.kitman.loop_change.updated.v1';
655
658
  readonly ApprovalRequested: 'dev.kitman.approval.requested.v1';
@@ -1041,6 +1044,7 @@ export declare const LiveWebEvent: Schema.Union<readonly [...(Schema.Struct<{
1041
1044
  readonly loopId: Schema.optionalKey<Schema.String>;
1042
1045
  readonly status: Schema.optionalKey<Schema.String>;
1043
1046
  readonly stepKey: Schema.optionalKey<Schema.String>;
1047
+ readonly stepAttemptId: Schema.optionalKey<Schema.String>;
1044
1048
  readonly sequence: Schema.optionalKey<Schema.Int>;
1045
1049
  }>;
1046
1050
  }> | Schema.Struct<{
@@ -1809,6 +1813,7 @@ export declare const LiveMutationOutcome: Schema.Union<readonly [Schema.Struct<{
1809
1813
  readonly loopId: Schema.optionalKey<Schema.String>;
1810
1814
  readonly status: Schema.optionalKey<Schema.String>;
1811
1815
  readonly stepKey: Schema.optionalKey<Schema.String>;
1816
+ readonly stepAttemptId: Schema.optionalKey<Schema.String>;
1812
1817
  readonly sequence: Schema.optionalKey<Schema.Int>;
1813
1818
  }>;
1814
1819
  }> | Schema.Struct<{
@@ -2577,6 +2582,7 @@ export declare const LiveMutationOutcome: Schema.Union<readonly [Schema.Struct<{
2577
2582
  readonly loopId: Schema.optionalKey<Schema.String>;
2578
2583
  readonly status: Schema.optionalKey<Schema.String>;
2579
2584
  readonly stepKey: Schema.optionalKey<Schema.String>;
2585
+ readonly stepAttemptId: Schema.optionalKey<Schema.String>;
2580
2586
  readonly sequence: Schema.optionalKey<Schema.Int>;
2581
2587
  }>;
2582
2588
  }> | Schema.Struct<{
@@ -3364,6 +3370,7 @@ export declare const LiveFrame: Schema.Union<readonly [Schema.Struct<{
3364
3370
  readonly loopId: Schema.optionalKey<Schema.String>;
3365
3371
  readonly status: Schema.optionalKey<Schema.String>;
3366
3372
  readonly stepKey: Schema.optionalKey<Schema.String>;
3373
+ readonly stepAttemptId: Schema.optionalKey<Schema.String>;
3367
3374
  readonly sequence: Schema.optionalKey<Schema.Int>;
3368
3375
  }>;
3369
3376
  }> | Schema.Struct<{
@@ -4136,6 +4143,7 @@ export declare const LiveFrame: Schema.Union<readonly [Schema.Struct<{
4136
4143
  readonly loopId: Schema.optionalKey<Schema.String>;
4137
4144
  readonly status: Schema.optionalKey<Schema.String>;
4138
4145
  readonly stepKey: Schema.optionalKey<Schema.String>;
4146
+ readonly stepAttemptId: Schema.optionalKey<Schema.String>;
4139
4147
  readonly sequence: Schema.optionalKey<Schema.Int>;
4140
4148
  }>;
4141
4149
  }> | Schema.Struct<{
@@ -4978,6 +4986,7 @@ export declare const LiveSubscribeResult: Schema.Struct<{
4978
4986
  readonly loopId: Schema.optionalKey<Schema.String>;
4979
4987
  readonly status: Schema.optionalKey<Schema.String>;
4980
4988
  readonly stepKey: Schema.optionalKey<Schema.String>;
4989
+ readonly stepAttemptId: Schema.optionalKey<Schema.String>;
4981
4990
  readonly sequence: Schema.optionalKey<Schema.Int>;
4982
4991
  }>, Schema.Struct<{
4983
4992
  readonly operation: Schema.Union<readonly [Schema.Literal<"created">, Schema.Literal<"updated">, Schema.Literal<"deleted">, Schema.Literal<"status_changed">, Schema.Literal<"assignment_changed">, Schema.Literal<"moved">, Schema.Literal<"heartbeat">, Schema.Literal<"access_changed">, Schema.Literal<"resolved">, Schema.Literal<"approved">, Schema.Literal<"rejected">, Schema.Literal<"completed">, Schema.Literal<"claimed">, Schema.Literal<"failed">, Schema.Literal<"invalidated">, Schema.Literal<"opened">, Schema.Literal<"closed">, Schema.Literal<"changed">, Schema.Literal<"promoted">, Schema.Literal<"waived">, Schema.Literal<"available">, Schema.Literal<"removed">, Schema.Literal<"lease_changed">, Schema.Literal<"step_changed">, Schema.Literal<"message_created">, Schema.Literal<"acknowledged">]>;
@@ -5757,6 +5766,7 @@ export declare const LiveWebReplayResult: Schema.Struct<{
5757
5766
  readonly loopId: Schema.optionalKey<Schema.String>;
5758
5767
  readonly status: Schema.optionalKey<Schema.String>;
5759
5768
  readonly stepKey: Schema.optionalKey<Schema.String>;
5769
+ readonly stepAttemptId: Schema.optionalKey<Schema.String>;
5760
5770
  readonly sequence: Schema.optionalKey<Schema.Int>;
5761
5771
  }>;
5762
5772
  }> | Schema.Struct<{