@leitwerk-dev/protocol 0.3.0 → 0.4.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.
Files changed (49) hide show
  1. package/dist/{chunk-LTIDCJFK.js → chunk-GOYGXRLL.js} +5 -1
  2. package/dist/chunk-GOYGXRLL.js.map +1 -0
  3. package/dist/{chunk-4AKWRRFS.js → chunk-JHJ6ACSD.js} +19 -2
  4. package/dist/chunk-JHJ6ACSD.js.map +1 -0
  5. package/dist/config-snapshot.d.ts +4 -0
  6. package/dist/config-snapshot.d.ts.map +1 -1
  7. package/dist/execution-inspection.d.ts +178 -0
  8. package/dist/execution-inspection.d.ts.map +1 -0
  9. package/dist/form-contract.d.ts +10 -0
  10. package/dist/form-contract.d.ts.map +1 -1
  11. package/dist/{http-contracts-public-rL4HFcxz.d.ts → http-contracts-public-BDrsnENx.d.ts} +435 -7
  12. package/dist/http-contracts-public.d.ts +3 -1
  13. package/dist/http-contracts-public.d.ts.map +1 -1
  14. package/dist/http-contracts-public.js +6 -4
  15. package/dist/http-contracts.d.ts +98 -5
  16. package/dist/http-contracts.d.ts.map +1 -1
  17. package/dist/http-contracts.js +4 -2
  18. package/dist/index.d.ts +5 -4
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +255 -249
  21. package/dist/index.js.map +1 -1
  22. package/dist/live-turn-projection.d.ts +30 -37
  23. package/dist/live-turn-projection.d.ts.map +1 -1
  24. package/dist/protocol.d.ts +13 -0
  25. package/dist/protocol.d.ts.map +1 -1
  26. package/dist/protocol.js +1 -1
  27. package/dist/scoped-settings.d.ts +116 -0
  28. package/dist/scoped-settings.d.ts.map +1 -0
  29. package/dist/skill-pack.d.ts +49 -0
  30. package/dist/skill-pack.d.ts.map +1 -0
  31. package/dist/ticket-creation-contracts.d.ts +6 -0
  32. package/dist/ticket-creation-contracts.d.ts.map +1 -1
  33. package/package.json +2 -2
  34. package/src/config-snapshot.ts +4 -0
  35. package/src/execution-inspection.ts +204 -0
  36. package/src/form-contract.ts +10 -0
  37. package/src/http-contracts-public.ts +16 -0
  38. package/src/http-contracts.ts +117 -3
  39. package/src/index.ts +10 -6
  40. package/src/live-turn-projection.ts +177 -173
  41. package/src/protocol.ts +13 -0
  42. package/src/scoped-settings.ts +148 -0
  43. package/src/skill-pack.ts +107 -0
  44. package/src/ticket-creation-contracts.ts +6 -0
  45. package/dist/chunk-4AKWRRFS.js.map +0 -1
  46. package/dist/chunk-LTIDCJFK.js.map +0 -1
  47. package/dist/turn-trace-projection.d.ts +0 -5
  48. package/dist/turn-trace-projection.d.ts.map +0 -1
  49. package/src/turn-trace-projection.ts +0 -42
@@ -51,6 +51,7 @@ import {
51
51
  parseSchema,
52
52
  unknownRecordSchema,
53
53
  } from "./protocol.js";
54
+ import type { SkillRevisionProvenance } from "./skill-pack.js";
54
55
  import type { ToolCallRendererDefinition } from "./tool-renderer-contract.js";
55
56
  import type { UsageCostSnapshot, UsageTokenCounts } from "./usage-snapshot.js";
56
57
 
@@ -363,6 +364,13 @@ export interface ProcessSelectedTurnSummary {
363
364
  commentary: string | null;
364
365
  /** @internal */
365
366
  externalTriggers: ProcessExternalSourceSummary[];
367
+ /** Present while a server-side condition is holding this turn. @internal */
368
+ readiness?: {
369
+ /** @internal */
370
+ message: string | null;
371
+ /** @internal */
372
+ nextCheckAt: string | null;
373
+ };
366
374
  }
367
375
 
368
376
  /** @internal */
@@ -424,8 +432,36 @@ export interface ModelProviderOptionsResponseBody {
424
432
  choicesUnavailableReason: string | null;
425
433
  }
426
434
 
435
+ /** @internal */
436
+ export interface ProcessModelConfigPatch {
437
+ /** @internal */
438
+ defaultModelProfileId?: string | null;
439
+ /** @internal */
440
+ turnConfigs?: Record<
441
+ string,
442
+ {
443
+ /** @internal */
444
+ modelProfileId: string | null;
445
+ }
446
+ >;
447
+ }
448
+
449
+ /** @internal */
450
+ export interface ProcessModelConfigResponseBody {
451
+ /** @internal */
452
+ modelConfiguration: ProcessModelConfigurationView;
453
+ }
454
+
427
455
  /** @internal */
428
456
  export interface ProcessTurnModelConfigurationView {
457
+ /** A system-purpose model cannot be overridden per instance. @internal */
458
+ fixedModelProfileId?: string | null;
459
+ /** @internal */
460
+ effectiveModelProfileId?: string | null;
461
+ /** @internal */
462
+ effectiveSource?: ProcessActionModelResolutionSource;
463
+ /** @internal */
464
+ effectiveError?: string;
429
465
  /** @internal */
430
466
  turnId: string;
431
467
  /** @internal */
@@ -518,6 +554,10 @@ export type ProcessRunToolView = {
518
554
 
519
555
  /** @internal */
520
556
  export type ProcessRunTurnView = {
557
+ /** Current definition schema, not an execution snapshot. @internal */
558
+ definitionContract?: unknown;
559
+ /** @internal */
560
+ integrationToolNames?: readonly string[];
521
561
  /** @internal */
522
562
  turnId: string;
523
563
  /** @internal */
@@ -548,6 +588,8 @@ export type ProcessRunDetailsView = {
548
588
 
549
589
  /** @internal */
550
590
  export interface ProcessLaunchConfigurationParameterView {
591
+ /** Presentation-safe original value. @internal */
592
+ rawValue?: unknown;
551
593
  /** @internal */
552
594
  fieldId: string;
553
595
  /** @internal */
@@ -770,6 +812,8 @@ export interface LauncherTurnModelConfigPreview {
770
812
  description: string;
771
813
  /** @internal */
772
814
  effective: {
815
+ /** @internal */
816
+ error?: string;
773
817
  /** @internal */
774
818
  source: ProcessActionModelResolutionSource;
775
819
  /** @internal */
@@ -779,6 +823,10 @@ export interface LauncherTurnModelConfigPreview {
779
823
 
780
824
  /** @internal */
781
825
  export type LauncherModelConfigPreview = {
826
+ /** @internal */
827
+ settingsSubjectId?: string;
828
+ /** @internal */
829
+ settingsExplanations?: readonly string[];
782
830
  /** @internal */
783
831
  defaultModel: LauncherDefaultModelPreview;
784
832
  /** @internal */
@@ -917,10 +965,14 @@ export interface SkillCatalogItem {
917
965
  }
918
966
 
919
967
  /** @internal */
920
- export type SkillRegistrationKind = "configuration" | "catalog";
968
+ export type SkillRegistrationKind = "configuration" | "catalog" | "extension" | "bundled";
921
969
 
922
970
  /** @internal */
923
971
  export interface InstalledSkillCatalogItem {
972
+ /** @internal */
973
+ ownerExtensionId?: string | null;
974
+ /** @internal */
975
+ provenance?: SkillRevisionProvenance | null;
924
976
  /** @internal */
925
977
  id: string;
926
978
  /** @internal */
@@ -933,6 +985,8 @@ export interface InstalledSkillCatalogItem {
933
985
  activeSourceRevision: string | null;
934
986
  /** @internal */
935
987
  registrationKind: SkillRegistrationKind;
988
+ /** Owning extension for automatically available bundled skills. @internal */
989
+ sourceExtensionId?: string;
936
990
  /** @internal */
937
991
  sourceRepositoryId: string | null;
938
992
  /** @internal */
@@ -945,6 +999,8 @@ export interface InstalledSkillCatalogItem {
945
999
 
946
1000
  /** @internal */
947
1001
  export interface SkillRevisionSummary {
1002
+ /** @internal */
1003
+ provenance?: SkillRevisionProvenance | null;
948
1004
  /** @internal */
949
1005
  id: string;
950
1006
  /** @internal */
@@ -1207,6 +1263,20 @@ export type ProcessTimelineTurnPresentation =
1207
1263
  | "operator_decision"
1208
1264
  | "external_trigger";
1209
1265
 
1266
+ /** Item identity of one mapped LLM turn execution. @internal */
1267
+ export interface ProcessTimelineIteration {
1268
+ /** @internal */
1269
+ runId: string;
1270
+ /** @internal */
1271
+ itemKey: string;
1272
+ /** Zero-based position in the frozen order. @internal */
1273
+ index: number;
1274
+ /** @internal */
1275
+ count: number;
1276
+ /** @internal */
1277
+ label: string;
1278
+ }
1279
+
1210
1280
  /** @internal */
1211
1281
  export interface ProcessTimelineTurnSummary {
1212
1282
  /** @internal */
@@ -1264,6 +1334,8 @@ export interface ProcessTimelineTurnSummary {
1264
1334
  progress?: TurnProgressReport | null;
1265
1335
  /** @internal */
1266
1336
  progressRecordedAt?: string;
1337
+ /** Present when this record executed one item of a mapped LLM turn. @internal */
1338
+ iteration?: ProcessTimelineIteration;
1267
1339
  }
1268
1340
 
1269
1341
  /** @internal */
@@ -1306,6 +1378,11 @@ export interface ProcessExternalTriggerSignal {
1306
1378
 
1307
1379
  /** @internal */
1308
1380
  export interface ProcessTimelineSnapshot {
1381
+ /** Older retained turns are read in bounded pages. Missing means an unpaged snapshot. @internal */
1382
+ history?: {
1383
+ /** Cursor for the next older page; null when the beginning is reached. @internal */
1384
+ beforeTurnRecordId: string | null;
1385
+ };
1309
1386
  /** @internal */
1310
1387
  prompt: {
1311
1388
  /** @internal */
@@ -1421,10 +1498,15 @@ export interface ProcessStartupSummary {
1421
1498
  }
1422
1499
 
1423
1500
  /** @internal */
1424
- export type CurrentProcessErrorSummary = CurrentErrorSummary;
1501
+ export interface CurrentProcessErrorSummary extends CurrentErrorSummary {
1502
+ /** Retry the waiting condition before starting an execution. @internal */
1503
+ canRetry?: boolean;
1504
+ }
1425
1505
 
1426
1506
  /** @internal */
1427
1507
  export interface ProcessUsageEstimateSnapshot {
1508
+ /** Totals cover the initial history page only. @internal */
1509
+ historyLimited?: boolean;
1428
1510
  /** @internal */
1429
1511
  usage: TurnUsageSnapshot;
1430
1512
  /** @internal */
@@ -1484,7 +1566,12 @@ export interface ProcessDetailUiSnapshotResponseBody {
1484
1566
  /** @internal */
1485
1567
  process: ProcessUiSnapshotProcess;
1486
1568
  /** Next turn on the declared happy path, including human decisions. @internal */
1487
- plannedNextTurn?: Pick<ProcessSelectedTurnSummary, "turnId" | "description"> | null;
1569
+ plannedNextTurn?:
1570
+ | (Pick<ProcessSelectedTurnSummary, "turnId" | "description"> & {
1571
+ /** Next frozen item when the selected mapped turn has items left. @internal */
1572
+ iteration?: ProcessTimelineIteration;
1573
+ })
1574
+ | null;
1488
1575
  /** Durable requests in Chronicle order; at most one is open for the current turn. @internal */
1489
1576
  questionRequests: ProcessQuestionRequest[];
1490
1577
  /** @internal */
@@ -1543,6 +1630,12 @@ export type InstanceTreeTurnResultState = "succeeded" | "failed" | "aborted" | "
1543
1630
 
1544
1631
  /** Redacted, semantic process history. Pi message/activity categories are never exposed. @internal */
1545
1632
  export interface InstanceTreeNodeSummary {
1633
+ /** @internal */
1634
+ turnId?: string;
1635
+ /** @internal */
1636
+ turnType?: ProcessTurnRecord["turnType"];
1637
+ /** @internal */
1638
+ origin?: import("./execution-inspection.js").ExecutionContextOrigin;
1546
1639
  /** @internal */
1547
1640
  id: string;
1548
1641
  /** @internal */
@@ -1671,6 +1764,12 @@ export type LauncherRecentValuesResponseBody = {
1671
1764
  values: Record<string, readonly string[]>;
1672
1765
  };
1673
1766
 
1767
+ /** @internal */
1768
+ export interface LauncherValidationResponseBody {
1769
+ /** Empty when the current launch request passes validation. @internal */
1770
+ errors: readonly LauncherValidationError[];
1771
+ }
1772
+
1674
1773
  /** @internal */
1675
1774
  export type LauncherModelConfigPreviewResponseBody = {
1676
1775
  /** @internal */
@@ -1842,6 +1941,7 @@ const futureLaunchPayloadInputSchema = v.object({
1842
1941
  "process_config_turn",
1843
1942
  "instance_default",
1844
1943
  "process_config_default",
1944
+ "scoped_purpose_default",
1845
1945
  "catalog_default",
1846
1946
  "legacy_persisted",
1847
1947
  ]),
@@ -2428,3 +2528,17 @@ export type {
2428
2528
  ApiTokensResponseBody,
2429
2529
  CreateApiTokenResponseBody,
2430
2530
  } from "./api-token-contracts.js";
2531
+ export type * from "./execution-inspection.js";
2532
+
2533
+ export type {
2534
+ NamedSelection,
2535
+ SettingChoice,
2536
+ SettingFieldView,
2537
+ SettingMetadata,
2538
+ SettingsOverviewResponse,
2539
+ SettingsPreview,
2540
+ SettingsScopeOverview,
2541
+ SettingsScopesResponse,
2542
+ } from "./scoped-settings.js";
2543
+
2544
+ export { settingSelectionValues } from "./scoped-settings.js";
package/src/index.ts CHANGED
@@ -9,6 +9,7 @@ export type {
9
9
  ConfigSnapshot,
10
10
  ModelProfileSnapshot,
11
11
  } from "./config-snapshot.js";
12
+ export type * from "./execution-inspection.js";
12
13
  export type {
13
14
  BrowserUiExtensionDescriptor,
14
15
  LeafOutcomeRendererDescriptor,
@@ -51,6 +52,7 @@ export type {
51
52
  ProcessSelectedTurnSummary,
52
53
  ProcessStartupSummary,
53
54
  ProcessTimelineInputSummary,
55
+ ProcessTimelineIteration,
54
56
  ProcessTimelineSnapshot,
55
57
  ProcessTimelineTurnSummary,
56
58
  ProcessUiSnapshotProcess,
@@ -95,14 +97,12 @@ export type {
95
97
  SkillOptionSummary,
96
98
  SkillSelection,
97
99
  } from "./launcher-contract.js";
98
- export type { MutableLiveTurnProjection } from "./live-turn-projection.js";
100
+ export type { LiveTurnProjection, TurnTraceProjection } from "./live-turn-projection.js";
99
101
  export {
100
- applyPiEventToLiveTurnProjection,
101
- buildLiveTurnProjectionFromEvents,
102
102
  buildPrimaryPathOperationalTraceItem,
103
- createMutableLiveTurnProjection,
103
+ createLiveTurnProjection,
104
104
  PRIMARY_PATH_OPERATIONAL_PI_EVENT_TYPES,
105
- snapshotLiveTurnProjection,
105
+ restoreTurnTraceProjection,
106
106
  } from "./live-turn-projection.js";
107
107
  export {
108
108
  extractPiSessionMessageText,
@@ -142,6 +142,11 @@ export {
142
142
  } from "./protocol.js";
143
143
  export type { ReadonlyEntryTree } from "./session-entry-tree.js";
144
144
  export { createReadonlyEntryTree } from "./session-entry-tree.js";
145
+ export {
146
+ parseSkillPackManifest,
147
+ type SkillPackManifest,
148
+ type SkillRevisionProvenance,
149
+ } from "./skill-pack.js";
145
150
  export { isStreamableEvent } from "./streamable-events.js";
146
151
  export { truncateTextPreview } from "./text-preview.js";
147
152
  export type {
@@ -164,7 +169,6 @@ export {
164
169
  resolveTurnContinuationLeafEntryId,
165
170
  resolveTurnContinuationUserPrompt,
166
171
  } from "./turn-continuation.js";
167
- export { snapshotTurnTrace } from "./turn-trace-projection.js";
168
172
  export { buildUsageSnapshotsByTurnRecordId } from "./usage-by-turn-record.js";
169
173
  export type { UsageCostSnapshot, UsageTokenCounts } from "./usage-snapshot.js";
170
174
  export {