@zelari/core 1.49.0 → 2.0.0-alpha.3

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 (105) hide show
  1. package/dist/experimental.d.ts +17 -0
  2. package/dist/experimental.d.ts.map +1 -0
  3. package/dist/experimental.js +31 -0
  4. package/dist/experimental.js.map +1 -0
  5. package/dist/index.d.ts +5 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +10 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/mission/index.d.ts +5 -0
  10. package/dist/mission/index.d.ts.map +1 -0
  11. package/dist/mission/index.js +5 -0
  12. package/dist/mission/index.js.map +1 -0
  13. package/dist/mission/missionState.d.ts +37 -0
  14. package/dist/mission/missionState.d.ts.map +1 -0
  15. package/dist/mission/missionState.js +61 -0
  16. package/dist/mission/missionState.js.map +1 -0
  17. package/dist/runtime/executionContext.d.ts +46 -0
  18. package/dist/runtime/executionContext.d.ts.map +1 -0
  19. package/dist/runtime/executionContext.js +63 -0
  20. package/dist/runtime/executionContext.js.map +1 -0
  21. package/dist/runtime/index.d.ts +10 -0
  22. package/dist/runtime/index.d.ts.map +1 -0
  23. package/dist/runtime/index.js +10 -0
  24. package/dist/runtime/index.js.map +1 -0
  25. package/dist/runtime/memoryProviders.d.ts +27 -0
  26. package/dist/runtime/memoryProviders.d.ts.map +1 -0
  27. package/dist/runtime/memoryProviders.js +64 -0
  28. package/dist/runtime/memoryProviders.js.map +1 -0
  29. package/dist/runtime/nodeProviders.d.ts +21 -0
  30. package/dist/runtime/nodeProviders.d.ts.map +1 -0
  31. package/dist/runtime/nodeProviders.js +138 -0
  32. package/dist/runtime/nodeProviders.js.map +1 -0
  33. package/dist/runtime/profiles.d.ts +44 -0
  34. package/dist/runtime/profiles.d.ts.map +1 -0
  35. package/dist/runtime/profiles.js +91 -0
  36. package/dist/runtime/profiles.js.map +1 -0
  37. package/dist/runtime/providers.d.ts +85 -0
  38. package/dist/runtime/providers.d.ts.map +1 -0
  39. package/dist/runtime/providers.js +58 -0
  40. package/dist/runtime/providers.js.map +1 -0
  41. package/dist/runtime/worktreeWorkspace.d.ts +38 -0
  42. package/dist/runtime/worktreeWorkspace.d.ts.map +1 -0
  43. package/dist/runtime/worktreeWorkspace.js +80 -0
  44. package/dist/runtime/worktreeWorkspace.js.map +1 -0
  45. package/dist/session/exportSession.d.ts +31 -0
  46. package/dist/session/exportSession.d.ts.map +1 -0
  47. package/dist/session/exportSession.js +37 -0
  48. package/dist/session/exportSession.js.map +1 -0
  49. package/dist/session/index.d.ts +15 -0
  50. package/dist/session/index.d.ts.map +1 -0
  51. package/dist/session/index.js +15 -0
  52. package/dist/session/index.js.map +1 -0
  53. package/dist/session/lineage.d.ts +38 -0
  54. package/dist/session/lineage.d.ts.map +1 -0
  55. package/dist/session/lineage.js +69 -0
  56. package/dist/session/lineage.js.map +1 -0
  57. package/dist/session/modelSurface.d.ts +43 -0
  58. package/dist/session/modelSurface.d.ts.map +1 -0
  59. package/dist/session/modelSurface.js +96 -0
  60. package/dist/session/modelSurface.js.map +1 -0
  61. package/dist/session/replay.d.ts +61 -0
  62. package/dist/session/replay.d.ts.map +1 -0
  63. package/dist/session/replay.js +137 -0
  64. package/dist/session/replay.js.map +1 -0
  65. package/dist/session/store.d.ts +60 -0
  66. package/dist/session/store.d.ts.map +1 -0
  67. package/dist/session/store.js +117 -0
  68. package/dist/session/store.js.map +1 -0
  69. package/dist/session/types.d.ts +85 -0
  70. package/dist/session/types.d.ts.map +1 -0
  71. package/dist/session/types.js +62 -0
  72. package/dist/session/types.js.map +1 -0
  73. package/dist/session/writer.d.ts +44 -0
  74. package/dist/session/writer.d.ts.map +1 -0
  75. package/dist/session/writer.js +114 -0
  76. package/dist/session/writer.js.map +1 -0
  77. package/dist/verification/completionPolicy.d.ts +33 -0
  78. package/dist/verification/completionPolicy.d.ts.map +1 -0
  79. package/dist/verification/completionPolicy.js +68 -0
  80. package/dist/verification/completionPolicy.js.map +1 -0
  81. package/dist/verification/criteriaPack.v1.d.ts +27 -0
  82. package/dist/verification/criteriaPack.v1.d.ts.map +1 -0
  83. package/dist/verification/criteriaPack.v1.js +58 -0
  84. package/dist/verification/criteriaPack.v1.js.map +1 -0
  85. package/dist/verification/engine.d.ts +38 -0
  86. package/dist/verification/engine.d.ts.map +1 -0
  87. package/dist/verification/engine.js +163 -0
  88. package/dist/verification/engine.js.map +1 -0
  89. package/dist/verification/index.d.ts +11 -0
  90. package/dist/verification/index.d.ts.map +1 -0
  91. package/dist/verification/index.js +11 -0
  92. package/dist/verification/index.js.map +1 -0
  93. package/dist/verification/metrics.d.ts +26 -0
  94. package/dist/verification/metrics.d.ts.map +1 -0
  95. package/dist/verification/metrics.js +29 -0
  96. package/dist/verification/metrics.js.map +1 -0
  97. package/dist/verification/types.d.ts +161 -0
  98. package/dist/verification/types.d.ts.map +1 -0
  99. package/dist/verification/types.js +92 -0
  100. package/dist/verification/types.js.map +1 -0
  101. package/dist/verification/verifier.d.ts +133 -0
  102. package/dist/verification/verifier.d.ts.map +1 -0
  103. package/dist/verification/verifier.js +215 -0
  104. package/dist/verification/verifier.js.map +1 -0
  105. package/package.json +17 -1
@@ -0,0 +1,17 @@
1
+ /**
2
+ * experimental.ts — registry of experimental flags (2.0 Phase 5).
3
+ *
4
+ * Every experimental capability is OFF unless explicitly enabled via the
5
+ * `ZELARI_EXPERIMENTAL` env var (comma-separated flag list). BoN, remote
6
+ * sandbox, E2B-like providers, generated orchestration and nested delegation
7
+ * all live behind this gate; none may become default without a benchmark
8
+ * case (plan §23-24).
9
+ */
10
+ export declare const EXPERIMENTAL_FLAGS: readonly ["bon", "remote-sandbox", "e2b-provider", "generated-orchestration", "nested-delegation"];
11
+ export type ExperimentalFlag = (typeof EXPERIMENTAL_FLAGS)[number];
12
+ /**
13
+ * True when `flag` appears in `ZELARI_EXPERIMENTAL` (case-insensitive CSV).
14
+ * Unknown values in the env var are ignored silently — flags are opt-in.
15
+ */
16
+ export declare function isExperimentalEnabled(flag: ExperimentalFlag, env?: Record<string, string | undefined>): boolean;
17
+ //# sourceMappingURL=experimental.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experimental.d.ts","sourceRoot":"","sources":["../src/experimental.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,kBAAkB,oGAMrB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,gBAAgB,EACtB,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,OAAO,CAUT"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * experimental.ts — registry of experimental flags (2.0 Phase 5).
3
+ *
4
+ * Every experimental capability is OFF unless explicitly enabled via the
5
+ * `ZELARI_EXPERIMENTAL` env var (comma-separated flag list). BoN, remote
6
+ * sandbox, E2B-like providers, generated orchestration and nested delegation
7
+ * all live behind this gate; none may become default without a benchmark
8
+ * case (plan §23-24).
9
+ */
10
+ export const EXPERIMENTAL_FLAGS = [
11
+ 'bon',
12
+ 'remote-sandbox',
13
+ 'e2b-provider',
14
+ 'generated-orchestration',
15
+ 'nested-delegation',
16
+ ];
17
+ /**
18
+ * True when `flag` appears in `ZELARI_EXPERIMENTAL` (case-insensitive CSV).
19
+ * Unknown values in the env var are ignored silently — flags are opt-in.
20
+ */
21
+ export function isExperimentalEnabled(flag, env = process.env) {
22
+ const raw = env.ZELARI_EXPERIMENTAL;
23
+ if (!raw)
24
+ return false;
25
+ const enabled = new Set(raw
26
+ .split(',')
27
+ .map((value) => value.trim().toLowerCase())
28
+ .filter(Boolean));
29
+ return enabled.has(flag);
30
+ }
31
+ //# sourceMappingURL=experimental.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experimental.js","sourceRoot":"","sources":["../src/experimental.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,KAAK;IACL,gBAAgB;IAChB,cAAc;IACd,yBAAyB;IACzB,mBAAmB;CACX,CAAC;AAIX;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAsB,EACtB,MAA0C,OAAO,CAAC,GAAG;IAErD,MAAM,GAAG,GAAG,GAAG,CAAC,mBAAmB,CAAC;IACpC,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,MAAM,OAAO,GAAG,IAAI,GAAG,CACrB,GAAG;SACA,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;SAC1C,MAAM,CAAC,OAAO,CAAC,CACnB,CAAC;IACF,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -13,4 +13,9 @@ export * from './skills/index.js';
13
13
  export * from './memory/types.js';
14
14
  export * from './state/index.js';
15
15
  export * from './kraken/index.js';
16
+ export * from './session/index.js';
17
+ export * from './runtime/index.js';
18
+ export * from './verification/index.js';
19
+ export * from './mission/index.js';
20
+ export * from './experimental.js';
16
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,mBAAmB,CAAC;AAGlC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,mBAAmB,CAAC;AAGlC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,oBAAoB,CAAC;AAGnC,cAAc,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -21,4 +21,14 @@ export * from './memory/types.js';
21
21
  export * from './state/index.js';
22
22
  // Kraken graph engine (pure DAG primitives; orchestration lives in the CLI)
23
23
  export * from './kraken/index.js';
24
+ // Session spine — append-only log, replay, fork/resume (ADR-0016/0021)
25
+ export * from './session/index.js';
26
+ // Runtime execution seams + versioned profiles (ADR-0022)
27
+ export * from './runtime/index.js';
28
+ // Deterministic verification + completion policy + optional verifier (ADR-0023)
29
+ export * from './verification/index.js';
30
+ // Mission state derived from the session spine (2.0 Phase 4)
31
+ export * from './mission/index.js';
32
+ // Experimental flags registry (2.0 Phase 5 — all OFF by default)
33
+ export * from './experimental.js';
24
34
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qCAAqC;AACrC,cAAc,mBAAmB,CAAC;AAElC,eAAe;AACf,cAAc,kBAAkB,CAAC;AAEjC,aAAa;AACb,cAAc,oBAAoB,CAAC;AAEnC,sCAAsC;AACtC,cAAc,oBAAoB,CAAC;AAEnC,oBAAoB;AACpB,cAAc,mBAAmB,CAAC;AAElC,4DAA4D;AAC5D,cAAc,mBAAmB,CAAC;AAElC,8DAA8D;AAC9D,cAAc,kBAAkB,CAAC;AAEjC,4EAA4E;AAC5E,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qCAAqC;AACrC,cAAc,mBAAmB,CAAC;AAElC,eAAe;AACf,cAAc,kBAAkB,CAAC;AAEjC,aAAa;AACb,cAAc,oBAAoB,CAAC;AAEnC,sCAAsC;AACtC,cAAc,oBAAoB,CAAC;AAEnC,oBAAoB;AACpB,cAAc,mBAAmB,CAAC;AAElC,4DAA4D;AAC5D,cAAc,mBAAmB,CAAC;AAElC,8DAA8D;AAC9D,cAAc,kBAAkB,CAAC;AAEjC,4EAA4E;AAC5E,cAAc,mBAAmB,CAAC;AAElC,uEAAuE;AACvE,cAAc,oBAAoB,CAAC;AAEnC,0DAA0D;AAC1D,cAAc,oBAAoB,CAAC;AAEnC,gFAAgF;AAChF,cAAc,yBAAyB,CAAC;AAExC,6DAA6D;AAC7D,cAAc,oBAAoB,CAAC;AAEnC,iEAAiE;AACjE,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @zelari/core/mission — mission state derived from the session spine.
3
+ */
4
+ export * from './missionState.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mission/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @zelari/core/mission — mission state derived from the session spine.
3
+ */
4
+ export * from './missionState.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mission/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * mission/missionState.ts — mission state DERIVED from the session spine
3
+ * (2.0 Phase 4). No parallel state writer: phase, progress and replan count
4
+ * are projections of logged events. Interrupt/resume is native — an
5
+ * un-ended log with events is an interrupted, resumable mission.
6
+ */
7
+ import type { SessionProjection } from '../session/replay.js';
8
+ export type MissionPhase = 'design' | 'build' | 'verification' | 'done';
9
+ export interface MissionProgress {
10
+ criteriaTotal: number;
11
+ criteriaPassed: number;
12
+ /** pass/total from the last verification run; null when never verified. */
13
+ ratio: number | null;
14
+ /** True when the last verification passed everything WITH evidence. */
15
+ evidenceComplete: boolean;
16
+ }
17
+ export interface MissionState {
18
+ sessionId: string;
19
+ phase: MissionPhase;
20
+ progress: MissionProgress;
21
+ replans: number;
22
+ verifications: number;
23
+ lastSeq: number;
24
+ /** Events exist but session.ended is absent → resumable interrupt. */
25
+ interrupted: boolean;
26
+ /** Direct fork parent (full chain via lineageOf on the store). */
27
+ forkParent?: string;
28
+ }
29
+ /**
30
+ * Project a session into mission state.
31
+ * Phase precedence: last `complete:true` verification → done; else the last
32
+ * explicit `mission.phase` event; else inferred (verification > build > design).
33
+ */
34
+ export declare function deriveMissionState(projection: SessionProjection): MissionState;
35
+ /** Serializable mission snapshot (headless/Desktop resume payload). */
36
+ export declare function missionSnapshot(state: MissionState): string;
37
+ //# sourceMappingURL=missionState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"missionState.d.ts","sourceRoot":"","sources":["../../src/mission/missionState.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAA0B,MAAM,sBAAsB,CAAC;AAEtF,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,GAAG,cAAc,GAAG,MAAM,CAAC;AAIxE,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,uEAAuE;IACvE,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,eAAe,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,WAAW,EAAE,OAAO,CAAC;IACrB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAkBD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,iBAAiB,GAAG,YAAY,CA2B9E;AAED,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAU3D"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * mission/missionState.ts — mission state DERIVED from the session spine
3
+ * (2.0 Phase 4). No parallel state writer: phase, progress and replan count
4
+ * are projections of logged events. Interrupt/resume is native — an
5
+ * un-ended log with events is an interrupted, resumable mission.
6
+ */
7
+ const VALID_PHASES = ['design', 'build', 'verification', 'done'];
8
+ function progressFrom(lastVerification) {
9
+ const results = lastVerification?.results ?? [];
10
+ const criteriaTotal = results.length;
11
+ const criteriaPassed = results.filter((r) => r.status === 'pass').length;
12
+ const evidenceComplete = criteriaTotal > 0 &&
13
+ criteriaPassed === criteriaTotal &&
14
+ results.every((r) => r.evidenceCount > 0);
15
+ return {
16
+ criteriaTotal,
17
+ criteriaPassed,
18
+ ratio: criteriaTotal === 0 ? null : criteriaPassed / criteriaTotal,
19
+ evidenceComplete,
20
+ };
21
+ }
22
+ /**
23
+ * Project a session into mission state.
24
+ * Phase precedence: last `complete:true` verification → done; else the last
25
+ * explicit `mission.phase` event; else inferred (verification > build > design).
26
+ */
27
+ export function deriveMissionState(projection) {
28
+ const lastVerification = projection.verifications[projection.verifications.length - 1];
29
+ const complete = lastVerification?.complete === true;
30
+ const explicit = [...projection.missionPhases]
31
+ .reverse()
32
+ .find((p) => VALID_PHASES.includes(p.phase));
33
+ const phase = complete
34
+ ? 'done'
35
+ : explicit
36
+ ? explicit.phase
37
+ : projection.verifications.length > 0
38
+ ? 'verification'
39
+ : projection.toolCalls > 0 || projection.toolResults > 0
40
+ ? 'build'
41
+ : 'design';
42
+ return {
43
+ sessionId: projection.sessionId,
44
+ phase,
45
+ progress: progressFrom(lastVerification),
46
+ replans: projection.replans,
47
+ verifications: projection.verifications.length,
48
+ lastSeq: projection.lastSeq,
49
+ interrupted: projection.lastSeq > 0 && projection.endedAt === undefined,
50
+ forkParent: projection.fork?.parentSessionId,
51
+ };
52
+ }
53
+ /** Serializable mission snapshot (headless/Desktop resume payload). */
54
+ export function missionSnapshot(state) {
55
+ return JSON.stringify({
56
+ format: 'zelari-mission-snapshot',
57
+ version: 1,
58
+ ...state,
59
+ }, null, 2);
60
+ }
61
+ //# sourceMappingURL=missionState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"missionState.js","sourceRoot":"","sources":["../../src/mission/missionState.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,YAAY,GAA4B,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;AAwB1F,SAAS,YAAY,CAAC,gBAAoD;IACxE,MAAM,OAAO,GAAG,gBAAgB,EAAE,OAAO,IAAI,EAAE,CAAC;IAChD,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IACrC,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM,CAAC;IACzE,MAAM,gBAAgB,GACpB,aAAa,GAAG,CAAC;QACjB,cAAc,KAAK,aAAa;QAChC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;IAC5C,OAAO;QACL,aAAa;QACb,cAAc;QACd,KAAK,EA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AAE,eAAe;KAC7C,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,eAAe,CAAC,KAAmB;IACjD,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,MAAM,EAAE,yBAAyB;QACjC,OAAO,EAAE,CAAC;QACV,GAAG,KAAK;KACT,EACD,IAAI,EACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * runtime/executionContext.ts — the seam bundle handed to engines and tools.
3
+ *
4
+ * Everything with side effects enters through here: session writer,
5
+ * workspace (jailed), fs/shell/subagent providers, active profile and the
6
+ * experimental flag gate. Built by `createExecutionContext`; the CLI may
7
+ * inject its own providers (e.g. the real task-tool subagent path).
8
+ */
9
+ import type { SessionEventInput, SessionEventEnvelope } from '../session/types.js';
10
+ import type { SessionLogWriter } from '../session/writer.js';
11
+ import { SessionStore } from '../session/store.js';
12
+ import { type ExperimentalFlag } from '../experimental.js';
13
+ import { type FsProvider, type ShellProvider, type SubagentProvider, type WorkspaceProvider } from './providers.js';
14
+ import { type Profile } from './profiles.js';
15
+ export interface ExecutionContext {
16
+ readonly sessionId: string;
17
+ readonly profile: Profile;
18
+ readonly workspace: WorkspaceProvider;
19
+ readonly fs: FsProvider;
20
+ readonly shell: ShellProvider;
21
+ readonly subagent: SubagentProvider;
22
+ /** Append an event to the session spine (verification, notes, tasks…). */
23
+ appendSessionEvent(input: SessionEventInput): Promise<SessionEventEnvelope>;
24
+ experimental(flag: ExperimentalFlag): boolean;
25
+ }
26
+ export interface CreateExecutionContextOptions {
27
+ workspaceRoot?: string;
28
+ sessionsDir?: string;
29
+ profileId?: string;
30
+ workspace?: WorkspaceProvider;
31
+ fs?: FsProvider;
32
+ shell?: ShellProvider;
33
+ subagent?: SubagentProvider;
34
+ env?: Record<string, string | undefined>;
35
+ reason?: string;
36
+ }
37
+ export interface ExecutionContextHandle {
38
+ readonly ctx: ExecutionContext;
39
+ readonly writer: SessionLogWriter;
40
+ readonly store: SessionStore;
41
+ /** End the session cleanly and release the writer lock. */
42
+ close(reason?: string): Promise<void>;
43
+ }
44
+ /** Create a session + providers bundle. `close()` ends the session. */
45
+ export declare function createExecutionContext(options?: CreateExecutionContextOptions): Promise<ExecutionContextHandle>;
46
+ //# sourceMappingURL=executionContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executionContext.d.ts","sourceRoot":"","sources":["../../src/runtime/executionContext.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAyB,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAoC,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAE/E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,0EAA0E;IAC1E,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC5E,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC;CAC/C;AAED,MAAM,WAAW,6BAA6B;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,2DAA2D;IAC3D,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAED,uEAAuE;AACvE,wBAAsB,sBAAsB,CAC1C,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,sBAAsB,CAAC,CA8CjC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * runtime/executionContext.ts — the seam bundle handed to engines and tools.
3
+ *
4
+ * Everything with side effects enters through here: session writer,
5
+ * workspace (jailed), fs/shell/subagent providers, active profile and the
6
+ * experimental flag gate. Built by `createExecutionContext`; the CLI may
7
+ * inject its own providers (e.g. the real task-tool subagent path).
8
+ */
9
+ import path from 'node:path';
10
+ import { SessionStore } from '../session/store.js';
11
+ import { isExperimentalEnabled } from '../experimental.js';
12
+ import { LocalWorkspace, NOOP_SUBAGENT_PROVIDER, } from './providers.js';
13
+ import { NodeFsProvider, NodeShellProvider } from './nodeProviders.js';
14
+ import { resolveProfile, toolManifestHash } from './profiles.js';
15
+ /** Create a session + providers bundle. `close()` ends the session. */
16
+ export async function createExecutionContext(options = {}) {
17
+ const workspace = options.workspace ?? new LocalWorkspace(path.resolve(options.workspaceRoot ?? process.cwd()));
18
+ const profile = resolveProfile(options.profileId ?? 'kraken/v1');
19
+ const store = SessionStore.withDefaults({
20
+ baseDir: options.sessionsDir,
21
+ workspaceRoot: options.workspaceRoot,
22
+ env: options.env,
23
+ });
24
+ const { sessionId, writer } = await store.create({
25
+ reason: options.reason ?? 'execution-context',
26
+ profile: profile.id,
27
+ workspace: workspace.root,
28
+ });
29
+ await writer.append({
30
+ kind: 'note',
31
+ actor: { type: 'system', role: 'profiles' },
32
+ data: {
33
+ note: 'profile manifest',
34
+ profileId: profile.id,
35
+ toolManifestHash: toolManifestHash(profile.tools),
36
+ workspaceKind: workspace.kind,
37
+ },
38
+ });
39
+ const fs = options.fs ?? new NodeFsProvider(workspace);
40
+ const shell = options.shell ?? new NodeShellProvider(workspace);
41
+ const subagent = options.subagent ?? NOOP_SUBAGENT_PROVIDER;
42
+ const env = options.env ?? process.env;
43
+ const ctx = {
44
+ sessionId,
45
+ profile,
46
+ workspace,
47
+ fs,
48
+ shell,
49
+ subagent,
50
+ appendSessionEvent: (input) => writer.append(input),
51
+ experimental: (flag) => isExperimentalEnabled(flag, env),
52
+ };
53
+ return {
54
+ ctx,
55
+ writer,
56
+ store,
57
+ close: async (reason = 'completed') => {
58
+ await writer.append({ kind: 'session.ended', actor: { type: 'system' }, data: { reason } });
59
+ await writer.close();
60
+ },
61
+ };
62
+ }
63
+ //# sourceMappingURL=executionContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executionContext.js","sourceRoot":"","sources":["../../src/runtime/executionContext.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAyB,MAAM,oBAAoB,CAAC;AAClF,OAAO,EACL,cAAc,EACd,sBAAsB,GAKvB,MAAM,gBAAgB,CAAC;AACxB,OAAO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AAC,CAAC;IACvD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAChE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,sBAAsB,CAAC;IAC5D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACvC,MAAM,GAAG,GAAqB;QAC5B,SAAS;QACT,OAAO;QACP,SAAS;QACT,EAAE;QACF,KAAK;QACL,QAAQ;QACR,kBAAkB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;QACnD,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,CAAC,IAAI,EAAE,GAAG,CAAC;KACzD,CAAC;IACF,OAAO;QACL,GAAG;QACH,MAAM;QACN,KAAK;QACL,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,EAAE;YACpC,MAAM,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;YAC5F,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @zelari/core/runtime — execution seams + profiles (ADR-0022).
3
+ */
4
+ export * from './providers.js';
5
+ export * from './nodeProviders.js';
6
+ export * from './memoryProviders.js';
7
+ export * from './worktreeWorkspace.js';
8
+ export * from './profiles.js';
9
+ export * from './executionContext.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @zelari/core/runtime — execution seams + profiles (ADR-0022).
3
+ */
4
+ export * from './providers.js';
5
+ export * from './nodeProviders.js';
6
+ export * from './memoryProviders.js';
7
+ export * from './worktreeWorkspace.js';
8
+ export * from './profiles.js';
9
+ export * from './executionContext.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * runtime/memoryProviders.ts — deterministic in-memory providers for tests
3
+ * and benchmarks (no fs/shell side effects).
4
+ */
5
+ import type { FsProvider, ShellProvider, ShellResult, ShellExecOptions } from './providers.js';
6
+ /** In-memory file map keyed by normalized relative path. */
7
+ export declare class MemoryFsProvider implements FsProvider {
8
+ readonly files: Map<string, string>;
9
+ constructor(seed?: Record<string, string>);
10
+ private norm;
11
+ readFile(rel: string): Promise<string>;
12
+ writeFile(rel: string, data: string): Promise<void>;
13
+ exists(rel: string): Promise<boolean>;
14
+ list(rel?: string): Promise<string[]>;
15
+ }
16
+ export type MemoryShellHandler = {
17
+ /** Substring (or regex source) matched against the command. */
18
+ match: string | RegExp;
19
+ result: Partial<ShellResult> | ((command: string) => Partial<ShellResult>);
20
+ };
21
+ /** Scripted shell: first matching handler wins; unmatched commands fail. */
22
+ export declare class MemoryShellProvider implements ShellProvider {
23
+ private readonly handlers;
24
+ constructor(handlers?: MemoryShellHandler[]);
25
+ exec(command: string, _options?: ShellExecOptions): Promise<ShellResult>;
26
+ }
27
+ //# sourceMappingURL=memoryProviders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoryProviders.d.ts","sourceRoot":"","sources":["../../src/runtime/memoryProviders.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACb,WAAW,EACX,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAExB,4DAA4D;AAC5D,qBAAa,gBAAiB,YAAW,UAAU;IACjD,QAAQ,CAAC,KAAK,sBAA6B;gBAE/B,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;IAI7C,OAAO,CAAC,IAAI;IAIN,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQtC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAInD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIrC,IAAI,CAAC,GAAG,SAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAIzC;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,+DAA+D;IAC/D,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EACF,OAAO,CAAC,WAAW,CAAC,GACpB,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;CACjD,CAAC;AAEF,4EAA4E;AAC5E,qBAAa,mBAAoB,YAAW,aAAa;IAC3C,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,GAAE,kBAAkB,EAAO;IAE1D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC;CAwB/E"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * runtime/memoryProviders.ts — deterministic in-memory providers for tests
3
+ * and benchmarks (no fs/shell side effects).
4
+ */
5
+ /** In-memory file map keyed by normalized relative path. */
6
+ export class MemoryFsProvider {
7
+ files = new Map();
8
+ constructor(seed = {}) {
9
+ for (const [k, v] of Object.entries(seed))
10
+ this.files.set(this.norm(k), v);
11
+ }
12
+ norm(rel) {
13
+ return rel.replace(/^\.?\//, '').replace(/\\/g, '/');
14
+ }
15
+ async readFile(rel) {
16
+ const content = this.files.get(this.norm(rel));
17
+ if (content === undefined) {
18
+ throw new Error(`ENOENT (memory): ${rel}`);
19
+ }
20
+ return content;
21
+ }
22
+ async writeFile(rel, data) {
23
+ this.files.set(this.norm(rel), data);
24
+ }
25
+ async exists(rel) {
26
+ return this.files.has(this.norm(rel));
27
+ }
28
+ async list(rel = '.') {
29
+ const prefix = rel === '.' || rel === '' ? '' : `${this.norm(rel)}/`;
30
+ return [...this.files.keys()].filter((k) => k.startsWith(prefix)).sort();
31
+ }
32
+ }
33
+ /** Scripted shell: first matching handler wins; unmatched commands fail. */
34
+ export class MemoryShellProvider {
35
+ handlers;
36
+ constructor(handlers = []) {
37
+ this.handlers = handlers;
38
+ }
39
+ async exec(command, _options) {
40
+ void _options;
41
+ for (const handler of this.handlers) {
42
+ const hit = typeof handler.match === 'string' ? command.includes(handler.match) : handler.match.test(command);
43
+ if (!hit)
44
+ continue;
45
+ const partial = typeof handler.result === 'function' ? handler.result(command) : handler.result;
46
+ return {
47
+ exitCode: 0,
48
+ stdout: '',
49
+ stderr: '',
50
+ durationMs: 0,
51
+ timedOut: false,
52
+ ...partial,
53
+ };
54
+ }
55
+ return {
56
+ exitCode: 127,
57
+ stdout: '',
58
+ stderr: `MemoryShellProvider: no handler matched command: ${command}`,
59
+ durationMs: 0,
60
+ timedOut: false,
61
+ };
62
+ }
63
+ }
64
+ //# sourceMappingURL=memoryProviders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoryProviders.js","sourceRoot":"","sources":["../../src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AC;YACb,QAAQ,EAAE,KAAK;SAChB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * runtime/nodeProviders.ts — node-backed Fs/Shell providers over a jailed workspace.
3
+ */
4
+ import type { FsProvider, ShellProvider, ShellResult, ShellExecOptions, WorkspaceProvider } from './providers.js';
5
+ export declare class NodeFsProvider implements FsProvider {
6
+ private readonly workspace;
7
+ constructor(workspace: WorkspaceProvider);
8
+ readFile(rel: string): Promise<string>;
9
+ writeFile(rel: string, data: string): Promise<void>;
10
+ exists(rel: string): Promise<boolean>;
11
+ list(rel?: string): Promise<string[]>;
12
+ }
13
+ export declare class NodeShellProvider implements ShellProvider {
14
+ private readonly workspace;
15
+ private readonly defaults;
16
+ constructor(workspace: WorkspaceProvider, defaults?: {
17
+ timeoutMs?: number;
18
+ });
19
+ exec(command: string, options?: ShellExecOptions): Promise<ShellResult>;
20
+ }
21
+ //# sourceMappingURL=nodeProviders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeProviders.d.ts","sourceRoot":"","sources":["../../src/runtime/nodeProviders.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AA4BlH,qBAAa,cAAe,YAAW,UAAU;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,iBAAiB;IAEnD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAItC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMnD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IASrC,IAAI,CAAC,GAAG,SAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAqBzC;AAED,qBAAa,iBAAkB,YAAW,aAAa;IAEnD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADR,SAAS,EAAE,iBAAiB,EAC5B,QAAQ,GAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO;IAGlD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC;CAkDlF"}