niceeval 0.14.2 → 0.14.3-canary.53

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 (94) hide show
  1. package/INDEX.md +13 -6
  2. package/dist/agents/sdk-streams.cjs +6 -1
  3. package/dist/agents/sdk-streams.cjs.map +1 -1
  4. package/dist/agents/sdk-streams.d.cts +3 -2
  5. package/dist/agents/sdk-streams.d.mts +3 -2
  6. package/dist/agents/sdk-streams.d.ts +3 -2
  7. package/dist/agents/ui-message-stream.cjs +3 -1
  8. package/dist/agents/ui-message-stream.cjs.map +1 -1
  9. package/dist/experiment/host/cli/debug-protocol.cjs +257 -0
  10. package/dist/experiment/host/cli/debug-protocol.cjs.map +1 -0
  11. package/dist/experiment/host/cli/debug-protocol.d.cts +13 -0
  12. package/dist/experiment/host/cli/debug-protocol.d.mts +13 -0
  13. package/dist/experiment/host/cli/debug-protocol.d.ts +13 -0
  14. package/dist/experiment/host/cli/debug-protocol.js +8 -0
  15. package/dist/experiment/host/cli/debug-protocol.js.map +1 -0
  16. package/dist/experiment/host/cli/session-protocol.cjs +78 -0
  17. package/dist/experiment/host/cli/session-protocol.cjs.map +1 -0
  18. package/dist/experiment/host/cli/session-protocol.d.cts +10 -0
  19. package/dist/experiment/host/cli/session-protocol.d.mts +10 -0
  20. package/dist/experiment/host/cli/session-protocol.d.ts +10 -0
  21. package/dist/experiment/host/cli/session-protocol.js +12 -0
  22. package/dist/experiment/host/cli/session-protocol.js.map +1 -0
  23. package/dist/experiment/host/index.cjs +9 -1
  24. package/dist/experiment/host/index.cjs.map +1 -1
  25. package/dist/experiment/host/index.d.cts +2 -0
  26. package/dist/experiment/host/index.d.mts +2 -0
  27. package/dist/experiment/host/index.d.ts +2 -0
  28. package/dist/experiment/host/index.js +28 -16
  29. package/dist/experiment/host/index.mjs +28 -16
  30. package/dist/run/cli/contribution.cjs +5 -5
  31. package/dist/run/cli/contribution.cjs.map +1 -1
  32. package/dist/run/host/index.cjs +14 -3
  33. package/dist/run/host/index.cjs.map +1 -1
  34. package/dist/run/host/index.d.cts +2 -2
  35. package/dist/run/host/index.d.mts +2 -2
  36. package/dist/run/host/index.d.ts +2 -2
  37. package/dist/run/host/lifecycle-adapter.cjs +12 -12
  38. package/dist/run/host/lifecycle-adapter.cjs.map +1 -1
  39. package/dist/run/host/runtime.cjs +22 -22
  40. package/dist/run/host/runtime.cjs.map +1 -1
  41. package/dist/run/host/runtime.d.cts +11 -2
  42. package/dist/run/host/runtime.d.mts +11 -2
  43. package/dist/run/host/runtime.d.ts +11 -2
  44. package/dist/run/host/runtime.js +2 -2
  45. package/dist/run/host/types.cjs.map +1 -1
  46. package/dist/run/host/types.d.cts +4 -5
  47. package/dist/run/host/types.d.mts +4 -5
  48. package/dist/run/host/types.d.ts +4 -5
  49. package/dist/runner/assert-first-bridge.cjs +78 -3
  50. package/dist/runner/assert-first-bridge.cjs.map +1 -1
  51. package/dist/runner/assert-first-bridge.d.cts +11 -1
  52. package/dist/runner/assert-first-bridge.d.mts +11 -1
  53. package/dist/runner/assert-first-bridge.d.ts +11 -1
  54. package/dist/runner/attempt.cjs +77 -67
  55. package/dist/runner/attempt.cjs.map +1 -1
  56. package/dist/sandbox/backend.cjs.map +1 -1
  57. package/dist/sandbox/backend.d.cts +2 -2
  58. package/dist/sandbox/backend.d.mts +2 -2
  59. package/dist/sandbox/backend.d.ts +2 -2
  60. package/dist/sandbox/index.cjs.map +1 -1
  61. package/dist/sandbox/index.d.cts +1 -0
  62. package/dist/sandbox/index.d.mts +1 -0
  63. package/dist/sandbox/index.d.ts +1 -0
  64. package/dist/sandbox/layer.cjs.map +1 -1
  65. package/dist/sandbox/layer.d.cts +3 -3
  66. package/dist/sandbox/layer.d.mts +3 -3
  67. package/dist/sandbox/layer.d.ts +3 -3
  68. package/dist/sandbox/runtime.cjs.map +1 -1
  69. package/dist/sandbox/types.cjs.map +1 -1
  70. package/dist/sandbox/types.d.cts +2 -0
  71. package/dist/sandbox/types.d.mts +2 -0
  72. package/dist/sandbox/types.d.ts +2 -0
  73. package/dist/show/render.cjs +1 -0
  74. package/dist/show/render.cjs.map +1 -1
  75. package/dist/terminal/blocks.cjs +3 -5
  76. package/dist/terminal/blocks.cjs.map +1 -1
  77. package/dist/view/app-dist/.vite/manifest.json +3 -76
  78. package/dist/view/app-dist/assets/index-C6GQwHEF.js +63 -0
  79. package/dist/view/app-dist/assets/{quality-cost-scatter-B5wDa_F1.js → quality-cost-scatter-CSiMLelf.js} +5 -5
  80. package/dist/view/app-dist/index.html +1 -2
  81. package/dist/view/server.cjs +4 -3
  82. package/dist/view/server.cjs.map +1 -1
  83. package/docs-site/zh/README.md +2 -2
  84. package/docs-site/zh/tutorials/agent-feedback-loop.mdx +8 -5
  85. package/docs-site/zh/tutorials/agent-onboarding.mdx +5 -3
  86. package/package.json +1 -1
  87. package/dist/view/app-dist/assets/AttemptDialog-76dX1VQq.js +0 -41
  88. package/dist/view/app-dist/assets/AttemptRoute-DRHVh2JA.js +0 -4
  89. package/dist/view/app-dist/assets/ResultsPage-9CSI8dvZ.js +0 -2
  90. package/dist/view/app-dist/assets/RunPage-BUF0REv7.js +0 -1
  91. package/dist/view/app-dist/assets/TableContentView-_Sbg5wDr.js +0 -3
  92. package/dist/view/app-dist/assets/index-BGr_6pGY.js +0 -19
  93. package/dist/view/app-dist/assets/jsx-runtime-BnHLaUks.js +0 -1
  94. package/dist/view/app-dist/assets/useSuspenseQuery-D3W8Uy33.js +0 -1
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SessionShowDocumentSchema = exports.SessionListDocumentSchema = void 0;
4
+ exports.decodeSessionListDocument = decodeSessionListDocument;
5
+ exports.decodeSessionShowDocument = decodeSessionShowDocument;
6
+ const effect_1 = require("effect");
7
+ const NonNegativeIntegerSchema = effect_1.Schema.Number.pipe(effect_1.Schema.check(effect_1.Schema.makeFilter((value) => Number.isSafeInteger(value) && value >= 0)));
8
+ const PositiveIntegerSchema = effect_1.Schema.Number.pipe(effect_1.Schema.check(effect_1.Schema.makeFilter((value) => Number.isSafeInteger(value) && value > 0)));
9
+ const TimestampSchema = effect_1.Schema.String.pipe(effect_1.Schema.check(effect_1.Schema.makeFilter((value) => Number.isFinite(Date.parse(value)))));
10
+ const InvocationCompletionSchema = effect_1.Schema.Struct({
11
+ status: effect_1.Schema.Literals(["complete", "incomplete", "interrupted"]),
12
+ unstarted: NonNegativeIntegerSchema,
13
+ earlyExitUnstarted: NonNegativeIntegerSchema,
14
+ reporterErrors: effect_1.Schema.mutable(effect_1.Schema.Array(effect_1.Schema.Struct({
15
+ reporter: effect_1.Schema.String,
16
+ required: effect_1.Schema.Boolean,
17
+ message: effect_1.Schema.String,
18
+ }))),
19
+ });
20
+ const SessionQueuedAttemptSchema = effect_1.Schema.Struct({
21
+ evalId: effect_1.Schema.String,
22
+ attempt: NonNegativeIntegerSchema,
23
+ state: effect_1.Schema.Literal("queued"),
24
+ reason: effect_1.Schema.Literal("provider-capacity"),
25
+ });
26
+ const SessionExperimentSchema = effect_1.Schema.Struct({
27
+ experimentId: effect_1.Schema.String,
28
+ runId: effect_1.Schema.String,
29
+ published: effect_1.Schema.optional(effect_1.Schema.Boolean),
30
+ state: effect_1.Schema.optional(effect_1.Schema.Literals(["setup", "running", "waiting", "teardown"])),
31
+ running: effect_1.Schema.optional(NonNegativeIntegerSchema),
32
+ queued: effect_1.Schema.optional(NonNegativeIntegerSchema),
33
+ elsewhere: effect_1.Schema.optional(NonNegativeIntegerSchema),
34
+ attempts: effect_1.Schema.optional(effect_1.Schema.mutable(effect_1.Schema.Array(SessionQueuedAttemptSchema))),
35
+ });
36
+ const SessionRecordSchema = effect_1.Schema.Struct({
37
+ sessionId: effect_1.Schema.String,
38
+ pid: PositiveIntegerSchema,
39
+ startedAt: TimestampSchema,
40
+ status: effect_1.Schema.Literals(["active", "completed", "incomplete", "interrupted"]),
41
+ experiments: effect_1.Schema.mutable(effect_1.Schema.Array(SessionExperimentSchema)),
42
+ heartbeatAt: effect_1.Schema.optional(TimestampSchema),
43
+ completedAt: effect_1.Schema.optional(TimestampSchema),
44
+ completion: effect_1.Schema.optional(InvocationCompletionSchema),
45
+ });
46
+ const ExpiredSessionRecordSchema = effect_1.Schema.Struct({
47
+ sessionId: effect_1.Schema.String,
48
+ pid: PositiveIntegerSchema,
49
+ startedAt: TimestampSchema,
50
+ heartbeatAt: effect_1.Schema.optional(TimestampSchema),
51
+ });
52
+ /** The existing, unversioned `niceeval session list --json` document. */
53
+ exports.SessionListDocumentSchema = effect_1.Schema.Struct({
54
+ format: effect_1.Schema.Literal("niceeval.sessions"),
55
+ sessions: effect_1.Schema.mutable(effect_1.Schema.Array(SessionRecordSchema)),
56
+ expired: effect_1.Schema.mutable(effect_1.Schema.Array(ExpiredSessionRecordSchema)),
57
+ });
58
+ /** The existing, unversioned `niceeval session show --json` document. */
59
+ exports.SessionShowDocumentSchema = effect_1.Schema.Struct({
60
+ format: effect_1.Schema.Literal("niceeval.session"),
61
+ session: effect_1.Schema.Union([SessionRecordSchema, ExpiredSessionRecordSchema]),
62
+ expired: effect_1.Schema.optional(effect_1.Schema.Boolean),
63
+ });
64
+ /** Strictly decode the sole document written by `niceeval session list --json`. */
65
+ function decodeSessionListDocument(input) {
66
+ return effect_1.Schema.decodeUnknownSync(exports.SessionListDocumentSchema, {
67
+ errors: "all",
68
+ onExcessProperty: "error",
69
+ })(input);
70
+ }
71
+ /** Strictly decode the sole document written by `niceeval session show --json`. */
72
+ function decodeSessionShowDocument(input) {
73
+ return effect_1.Schema.decodeUnknownSync(exports.SessionShowDocumentSchema, {
74
+ errors: "all",
75
+ onExcessProperty: "error",
76
+ })(input);
77
+ }
78
+ //# sourceMappingURL=session-protocol.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-protocol.js","sourceRoot":"","sources":["session-protocol.ts"],"names":[],"mappings":";;;AA6DA,8DAKC;AAED,8DAKC;AAzED,mCAAgC;AA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O;KAC5B,CAAC,CAAC,KAAK,CAAC,CAAC;AACd,CAAC","sourcesContent":["import { Schema } from \"effect\";\nimport type { ExpiredSessionRecord, SessionExperimentRecord, SessionListDocument, SessionQueuedAttemptRecord, SessionRecord, SessionShowDocument, } from \"../../../runner/session.ts\";\nimport type { InvocationCompletion } from \"../../../runner/types.ts\";\nconst NonNegativeIntegerSchema = Schema.Number.pipe(Schema.check(Schema.makeFilter((value) => Number.isSafeInteger(value) && value >= 0)));\nconst PositiveIntegerSchema = Schema.Number.pipe(Schema.check(Schema.makeFilter((value) => Number.isSafeInteger(value) && value > 0)));\nconst TimestampSchema = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => Number.isFinite(Date.parse(value)))));\nconst InvocationCompletionSchema: Schema.Codec<InvocationCompletion> = Schema.Struct({\n status: Schema.Literals([\"complete\", \"incomplete\", \"interrupted\"]),\n unstarted: NonNegativeIntegerSchema,\n earlyExitUnstarted: NonNegativeIntegerSchema,\n reporterErrors: Schema.mutable(Schema.Array(Schema.Struct({\n reporter: Schema.String,\n required: Schema.Boolean,\n message: Schema.String,\n }))),\n});\nconst SessionQueuedAttemptSchema: Schema.Codec<SessionQueuedAttemptRecord> = Schema.Struct({\n evalId: Schema.String,\n attempt: NonNegativeIntegerSchema,\n state: Schema.Literal(\"queued\"),\n reason: Schema.Literal(\"provider-capacity\"),\n});\nconst SessionExperimentSchema: Schema.Codec<SessionExperimentRecord> = Schema.Struct({\n experimentId: Schema.String,\n runId: Schema.String,\n published: Schema.optional(Schema.Boolean),\n state: Schema.optional(Schema.Literals([\"setup\", \"running\", \"waiting\", \"teardown\"])),\n running: Schema.optional(NonNegativeIntegerSchema),\n queued: Schema.optional(NonNegativeIntegerSchema),\n elsewhere: Schema.optional(NonNegativeIntegerSchema),\n attempts: Schema.optional(Schema.mutable(Schema.Array(SessionQueuedAttemptSchema))),\n});\nconst SessionRecordSchema: Schema.Codec<SessionRecord> = Schema.Struct({\n sessionId: Schema.String,\n pid: PositiveIntegerSchema,\n startedAt: TimestampSchema,\n status: Schema.Literals([\"active\", \"completed\", \"incomplete\", \"interrupted\"]),\n experiments: Schema.mutable(Schema.Array(SessionExperimentSchema)),\n heartbeatAt: Schema.optional(TimestampSchema),\n completedAt: Schema.optional(TimestampSchema),\n completion: Schema.optional(InvocationCompletionSchema),\n});\nconst ExpiredSessionRecordSchema: Schema.Codec<ExpiredSessionRecord> = Schema.Struct({\n sessionId: Schema.String,\n pid: PositiveIntegerSchema,\n startedAt: TimestampSchema,\n heartbeatAt: Schema.optional(TimestampSchema),\n});\n/** The existing, unversioned `niceeval session list --json` document. */\nexport const SessionListDocumentSchema: Schema.Codec<SessionListDocument> = Schema.Struct({\n format: Schema.Literal(\"niceeval.sessions\"),\n sessions: Schema.mutable(Schema.Array(SessionRecordSchema)),\n expired: Schema.mutable(Schema.Array(ExpiredSessionRecordSchema)),\n});\n/** The existing, unversioned `niceeval session show --json` document. */\nexport const SessionShowDocumentSchema: Schema.Codec<SessionShowDocument> = Schema.Struct({\n format: Schema.Literal(\"niceeval.session\"),\n session: Schema.Union([SessionRecordSchema, ExpiredSessionRecordSchema]),\n expired: Schema.optional(Schema.Boolean),\n});\n/** Strictly decode the sole document written by `niceeval session list --json`. */\nexport function decodeSessionListDocument(input: unknown): SessionListDocument {\n return Schema.decodeUnknownSync(SessionListDocumentSchema, {\n errors: \"all\",\n onExcessProperty: \"error\",\n })(input);\n}\n/** Strictly decode the sole document written by `niceeval session show --json`. */\nexport function decodeSessionShowDocument(input: unknown): SessionShowDocument {\n return Schema.decodeUnknownSync(SessionShowDocumentSchema, {\n errors: \"all\",\n onExcessProperty: \"error\",\n })(input);\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { Schema } from "effect";
2
+ import type { SessionListDocument, SessionShowDocument } from "../../../runner/session.cjs";
3
+ /** The existing, unversioned `niceeval session list --json` document. */
4
+ export declare const SessionListDocumentSchema: Schema.Codec<SessionListDocument>;
5
+ /** The existing, unversioned `niceeval session show --json` document. */
6
+ export declare const SessionShowDocumentSchema: Schema.Codec<SessionShowDocument>;
7
+ /** Strictly decode the sole document written by `niceeval session list --json`. */
8
+ export declare function decodeSessionListDocument(input: unknown): SessionListDocument;
9
+ /** Strictly decode the sole document written by `niceeval session show --json`. */
10
+ export declare function decodeSessionShowDocument(input: unknown): SessionShowDocument;
@@ -0,0 +1,10 @@
1
+ import { Schema } from "effect";
2
+ import type { SessionListDocument, SessionShowDocument } from "../../../runner/session.mjs";
3
+ /** The existing, unversioned `niceeval session list --json` document. */
4
+ export declare const SessionListDocumentSchema: Schema.Codec<SessionListDocument>;
5
+ /** The existing, unversioned `niceeval session show --json` document. */
6
+ export declare const SessionShowDocumentSchema: Schema.Codec<SessionShowDocument>;
7
+ /** Strictly decode the sole document written by `niceeval session list --json`. */
8
+ export declare function decodeSessionListDocument(input: unknown): SessionListDocument;
9
+ /** Strictly decode the sole document written by `niceeval session show --json`. */
10
+ export declare function decodeSessionShowDocument(input: unknown): SessionShowDocument;
@@ -0,0 +1,10 @@
1
+ import { Schema } from "effect";
2
+ import type { SessionListDocument, SessionShowDocument } from "../../../runner/session.js";
3
+ /** The existing, unversioned `niceeval session list --json` document. */
4
+ export declare const SessionListDocumentSchema: Schema.Codec<SessionListDocument>;
5
+ /** The existing, unversioned `niceeval session show --json` document. */
6
+ export declare const SessionShowDocumentSchema: Schema.Codec<SessionShowDocument>;
7
+ /** Strictly decode the sole document written by `niceeval session list --json`. */
8
+ export declare function decodeSessionListDocument(input: unknown): SessionListDocument;
9
+ /** Strictly decode the sole document written by `niceeval session show --json`. */
10
+ export declare function decodeSessionShowDocument(input: unknown): SessionShowDocument;
@@ -0,0 +1,12 @@
1
+ import { createRequire as __niceevalCreateRequire } from "node:module";
2
+ const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
3
+ const __niceevalCanonical = __niceevalRequire("./session-protocol.cjs");
4
+ const __niceevalExport0 = __niceevalCanonical["SessionListDocumentSchema"];
5
+ export { __niceevalExport0 as SessionListDocumentSchema };
6
+ const __niceevalExport1 = __niceevalCanonical["SessionShowDocumentSchema"];
7
+ export { __niceevalExport1 as SessionShowDocumentSchema };
8
+ const __niceevalExport2 = __niceevalCanonical["decodeSessionListDocument"];
9
+ export { __niceevalExport2 as decodeSessionListDocument };
10
+ const __niceevalExport3 = __niceevalCanonical["decodeSessionShowDocument"];
11
+ export { __niceevalExport3 as decodeSessionShowDocument };
12
+ //# sourceMappingURL=session-protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-protocol.js","sources":[],"names":[],"mappings":""}
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.experimentHost = exports.ExpTerminalSummarySchema = exports.ExpTerminalEventSchema = exports.ExpInvocationReceiptSchema = exports.decodeExpTerminalEvent = exports.ExpPlanDocumentSchema = exports.decodeExpPlanDocument = void 0;
17
+ exports.experimentHost = exports.ExpTerminalSummarySchema = exports.ExpTerminalEventSchema = exports.ExpInvocationReceiptSchema = exports.decodeExpTerminalEvent = exports.ExpPlanDocumentSchema = exports.decodeExpPlanDocument = exports.SessionShowDocumentSchema = exports.SessionListDocumentSchema = exports.decodeSessionShowDocument = exports.decodeSessionListDocument = exports.DebugPlanDocumentSchema = exports.decodeDebugPlanDocument = void 0;
18
18
  const effect_1 = require("effect");
19
19
  const command_plan_ts_1 = require("../../runner/command-plan.cjs");
20
20
  const discover_ts_1 = require("../../runner/discover.cjs");
@@ -27,6 +27,14 @@ const operations_ts_1 = require("./operations.cjs");
27
27
  const teardown_ts_1 = require("./teardown.cjs");
28
28
  const types_ts_2 = require("./types.cjs");
29
29
  __exportStar(require("./types.cjs"), exports);
30
+ var debug_protocol_ts_1 = require("./cli/debug-protocol.cjs");
31
+ Object.defineProperty(exports, "decodeDebugPlanDocument", { enumerable: true, get: function () { return debug_protocol_ts_1.decodeDebugPlanDocument; } });
32
+ Object.defineProperty(exports, "DebugPlanDocumentSchema", { enumerable: true, get: function () { return debug_protocol_ts_1.DebugPlanDocumentSchema; } });
33
+ var session_protocol_ts_1 = require("./cli/session-protocol.cjs");
34
+ Object.defineProperty(exports, "decodeSessionListDocument", { enumerable: true, get: function () { return session_protocol_ts_1.decodeSessionListDocument; } });
35
+ Object.defineProperty(exports, "decodeSessionShowDocument", { enumerable: true, get: function () { return session_protocol_ts_1.decodeSessionShowDocument; } });
36
+ Object.defineProperty(exports, "SessionListDocumentSchema", { enumerable: true, get: function () { return session_protocol_ts_1.SessionListDocumentSchema; } });
37
+ Object.defineProperty(exports, "SessionShowDocumentSchema", { enumerable: true, get: function () { return session_protocol_ts_1.SessionShowDocumentSchema; } });
30
38
  var plan_protocol_ts_1 = require("./cli/plan-protocol.cjs");
31
39
  Object.defineProperty(exports, "decodeExpPlanDocument", { enumerable: true, get: function () { return plan_protocol_ts_1.decodeExpPlanDocument; } });
32
40
  Object.defineProperty(exports, "ExpPlanDocumentSchema", { enumerable: true, get: function () { return plan_protocol_ts_1.ExpPlanDocumentSchema; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mCAAgC;AAChC,kEAA8H;AAC9H,0DAA8E;AAC9E,gEAAgE;AAChE,sEAAwE;AACxE,wDAA4D;AAE5D,oDAAiE;AACjE,4DAAoE;AACpE,mDAA6L;AAC7L,+CAA6D;AAC7D,yCAAkF;AAClF,6CAA2B;AAC3B,2DAA4G;AAAnG,yHAAA,qBAAqB,OAAA;AAAE,yHAAA,qBAAqB,OAAA;AACrD,+DAA4N;AAAnN,4HAAA,sBAAsB,OAAA;AAAE,gIAAA,0BAA0B,OAAA;AAAE,4HAAA,sBAAsB,OAAA;AAAE,8HAAA,wBAAwB,OAAA;AAmB7G;;;GAGG;AACH,SAAS,iBAAiB,CAAC,K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M,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,6BAAe,EAAE,GAAG,EAAE,yBAAW,EAAE,CAAC;IACvE,KAAK;IACL,MAAM,EAAN,sBAAM;IACN,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,6BAAa,EAAE,KAAK,EAAE,8BAAc,EAAE,CAAC;CAC3E,CAAC,CAAC","sourcesContent":["import { Effect } from \"effect\";\nimport { assembleCommandPlan, setupPrefixPlanOf, type CommandPlan, type SetupPrefixPlan } from \"../../runner/command-plan.ts\";\nimport { discoverEvals, discoverExperiments } from \"../../runner/discover.ts\";\nimport { planProjectTarget } from \"../../runner/fingerprint.ts\";\nimport { resolveExperimentEvals } from \"../../runner/eval-selection.ts\";\nimport { resolveRunTimeout } from \"../../runner/timeout.ts\";\nimport type { AgentRun, Config, DiscoveredEval, DiscoveredExperiment, } from \"../../runner/types.ts\";\nimport { resolveSandboxSetupCache } from \"../../runner/types.ts\";\nimport { matchExperimentSelector } from \"../../shared/aggregate.ts\";\nimport { accept, applyRunAccept, applyRename, catalog, check, listInvocationStatus, planInvocation, planRename, planRunAccept, runInvocation, showInvocationStatus, } from \"./operations.ts\";\nimport { inspectTeardown, runTeardown } from \"./teardown.ts\";\nimport { ExperimentHostError, type ExperimentHostHighLevelSDK } from \"./types.ts\";\nexport * from \"./types.ts\";\nexport { decodeExpPlanDocument, ExpPlanDocumentSchema, type ExpPlanDocument } from \"./cli/plan-protocol.ts\";\nexport { decodeExpTerminalEvent, ExpInvocationReceiptSchema, ExpTerminalEventSchema, ExpTerminalSummarySchema, type ExpInvocationReceipt, type ExpTerminalEvent, type ExpTerminalSummary, } from \"./cli/output-protocol.ts\";\n/**\n * Public, supported high-level Host composition SDK for the NiceEval CLI,\n * replacement CLI/Web hosts, and deep application integrations. Eval authors\n * use `defineExperiment`; this entry deliberately exposes no Runner internals.\n */\n/** One discovered Experiment after its author selector and CLI prefixes close. */\ninterface ExperimentHostSelection {\n readonly experiment: DiscoveredExperiment;\n readonly selectedEvalIds: readonly string[];\n /** The Experiment-owned set before CLI eval-prefix narrowing. */\n readonly selectorEvalIds: readonly string[];\n}\n/** Discovery result used by both `exp list` and execution planning. */\ninterface ExperimentHostListResult {\n readonly evals: readonly DiscoveredEval[];\n readonly experimentIds: readonly string[];\n readonly selections: readonly ExperimentHostSelection[];\n}\n/**\n * Discovery and selection are owned here so consumers cannot invoke an\n * Experiment's predicate a second time while reconstructing an AgentRun.\n */\nfunction discoverSelection(input: {\n readonly cwd: string;\n /** Keep the CLI's public `--tag` selection inside the Experiment boundary. */\n readonly tag?: string;\n readonly selector?: string;\n readonly evalPatterns?: readonly string[];\n}): Effect.Effect<ExperimentHostListResult, unknown> {\n return Effect.gen(function* () {\n const discoveredEvals = yield* discoverEvals(input.cwd);\n const evals = input.tag === undefined\n ? discoveredEvals\n : discoveredEvals.filter((evalDefinition) => evalDefinition.tags?.includes(input.tag!));\n const experiments = yield* discoverExperiments(input.cwd);\n const experimentIds = Object.freeze(experiments.map((experiment) => experiment.id));\n const selectedIds = input.selector === undefined\n ? undefined\n : new Set(matchExperimentSelector(experimentIds, input.selector));\n const selections = experiments\n .filter((experiment) => selectedIds === undefined || selectedIds.has(experiment.id))\n .map((experiment): ExperimentHostSelection => {\n const selected = resolveExperimentEvals({\n experimentId: experiment.id,\n selector: experiment.evals,\n cliPatterns: input.evalPatterns ?? [],\n evals,\n });\n return Object.freeze({\n experiment,\n selectedEvalIds: Object.freeze([...selected.selectedEvalIds]),\n selectorEvalIds: Object.freeze(selected.selectorEvals.map((evalDefinition) => evalDefinition.id)),\n });\n });\n return Object.freeze({\n evals: Object.freeze([...evals]),\n experimentIds,\n selections: Object.freeze(selections),\n });\n });\n}\nexport interface ExperimentHostDebugPlanRequest {\n readonly cwd: string;\n readonly config: Config;\n readonly experimentSelector: string;\n readonly evalSelector?: string;\n}\n/** A fully closed, read-only lifecycle plan for exactly one Experiment × Eval pair. */\nexport interface ExperimentHostDebugPlan {\n readonly status: \"planned\";\n readonly experimentId: string;\n /** Retained for the existing single-pair response. */\n readonly evalId?: string;\n readonly evalIds: readonly string[];\n readonly commandPlan: CommandPlan;\n readonly setupPrefixPlan: SetupPrefixPlan;\n}\n/**\n * Selector outcomes are data, rather than CLI-owned selection logic or a\n * partially constructed plan. The caller can render them in its own surface.\n */\nexport type ExperimentHostDebugPlanResult = ExperimentHostDebugPlan | {\n readonly status: \"experiment-no-match\";\n readonly selector: string;\n readonly candidates: readonly string[];\n} | {\n readonly status: \"experiment-ambiguous\";\n readonly selector: string;\n readonly candidates: readonly string[];\n} | {\n readonly status: \"eval-no-match\";\n readonly selector: string;\n readonly experimentId: string;\n readonly candidates: readonly string[];\n} | {\n readonly status: \"eval-ambiguous\";\n readonly selector: string;\n readonly experimentId: string;\n readonly candidates: readonly string[];\n};\nfunction uniqueExactOrPrefix<T>(candidates: readonly T[], selector: string, id: (candidate: T) => string): readonly T[] {\n const exact = candidates.find((candidate) => id(candidate) === selector);\n return exact === undefined\n ? candidates.filter((candidate) => id(candidate).startsWith(selector))\n : [exact];\n}\nfunction debugAgentRun(experiment: DiscoveredExperiment, evalId: string, config: Config): AgentRun {\n return {\n agent: experiment.agent,\n model: experiment.model,\n reasoningEffort: experiment.reasoningEffort,\n flags: experiment.flags ?? {},\n plugins: experiment.plugins,\n attempts: experiment.attempts ?? 1,\n earlyExit: experiment.earlyExit ?? false,\n sandboxSetupCache: resolveSandboxSetupCache(undefined, experiment.sandboxCache, config.sandboxCache),\n sandbox: experiment.sandbox,\n sandboxReuse: experiment.sandboxReuse,\n ...(experiment.sharedState === undefined ? {} : { sharedState: experiment.sharedState }),\n judge: experiment.judge,\n ...resolveRunTimeout(undefined, experiment.timeoutMs),\n budget: experiment.budget,\n selectedEvalIds: [evalId],\n experimentId: experiment.id,\n experimentBaseDir: experiment.baseDir,\n experimentSourcePath: experiment.sourcePath,\n description: experiment.description,\n labels: experiment.labels,\n maxConcurrency: experiment.maxConcurrency,\n setup: experiment.setup,\n teardown: experiment.teardown,\n classifyFailure: experiment.classifyFailure,\n };\n}\n/**\n * Closes selector resolution, physical planning, and command-plan projection\n * inside the Experiment Host. It deliberately does not construct a Record\n * root, enter a lease, read history, or invoke an author callback.\n */\nfunction debug(input: ExperimentHostDebugPlanRequest): Effect.Effect<ExperimentHostDebugPlanResult, ExperimentHostError> {\n return Effect.gen(function* () {\n const listed = yield* discoverSelection({ cwd: input.cwd });\n const selectedExperiments = uniqueExactOrPrefix(listed.selections, input.experimentSelector, ({ experiment }) => experiment.id).slice().sort((left, right) => left.experiment.id.localeCompare(right.experiment.id));\n if (selectedExperiments.length === 0) {\n return Object.freeze({\n status: \"experiment-no-match\" as const,\n selector: input.experimentSelector,\n candidates: Object.freeze([...listed.experimentIds].sort()),\n });\n }\n if (selectedExperiments.length > 1) {\n return Object.freeze({\n status: \"experiment-ambiguous\" as const,\n selector: input.experimentSelector,\n candidates: Object.freeze(selectedExperiments.map(({ experiment }) => experiment.id)),\n });\n }\n const selection = selectedExperiments[0]!;\n const experiment = selection.experiment;\n const selectorEvalIds = new Set(selection.selectorEvalIds);\n const selectorEvals = listed.evals.filter((evalDef) => selectorEvalIds.has(evalDef.id));\n const selectedEvals = (input.evalSelector === undefined\n ? selectorEvals\n : uniqueExactOrPrefix(selectorEvals, input.evalSelector, (evalDef) => evalDef.id))\n .slice().sort((left, right) => left.id.localeCompare(right.id));\n if (selectedEvals.length === 0) {\n return Object.freeze({\n status: \"eval-no-match\" as const,\n selector: input.evalSelector ?? \"\",\n experimentId: experiment.id,\n candidates: Object.freeze(selectorEvals.map((evalDef) => evalDef.id).sort()),\n });\n }\n if (input.evalSelector !== undefined && selectedEvals.length > 1) {\n return Object.freeze({\n status: \"eval-ambiguous\" as const,\n selector: input.evalSelector,\n experimentId: experiment.id,\n candidates: Object.freeze(selectedEvals.map((evalDef) => evalDef.id)),\n });\n }\n const runs = selectedEvals.map((evalDef) => debugAgentRun(experiment, evalDef.id, input.config));\n const target = yield* planProjectTarget(listed.evals, runs, input.config.timeoutMs, { configJudge: input.config.judge });\n const commandPlan = assembleCommandPlan({\n rows: selectedEvals.map((evalDef) => {\n const run = runs.find((candidate) => candidate.selectedEvalIds.includes(evalDef.id))!;\n return {\n experimentId: experiment.id,\n evalId: evalDef.id,\n ...(evalDef.evalGroup === undefined ? {} : { evalGroupId: evalDef.evalGroup.id }),\n attempts: run.attempts,\n dispatch: [{ attempts: Array.from({ length: run.attempts }, (_, attempt) => attempt) }],\n };\n }),\n preparedPairsByKey: target.preparedPairsByKey,\n });\n return Object.freeze({\n status: \"planned\" as const,\n experimentId: experiment.id,\n ...(selectedEvals.length === 1 ? { evalId: selectedEvals[0]!.id } : {}),\n evalIds: Object.freeze(selectedEvals.map((evalDef) => evalDef.id)),\n commandPlan,\n setupPrefixPlan: setupPrefixPlanOf(commandPlan),\n });\n }).pipe(Effect.mapError((cause) => new ExperimentHostError({\n operation: \"debug\",\n code: typeof cause === \"object\" && cause !== null && typeof Reflect.get(cause, \"code\") === \"string\"\n ? String(Reflect.get(cause, \"code\"))\n : \"experiment-host-operation-failed\",\n message: cause instanceof Error ? cause.message : String(cause),\n cause,\n })));\n}\nexport interface ExperimentHostSDK extends ExperimentHostHighLevelSDK {\n readonly debug: typeof debug;\n}\n/** The fixed public Host surface; discovery, Runner, and adoption internals stay private. */\nexport const experimentHost: ExperimentHostSDK = Object.freeze({\n catalog,\n check,\n invocation: Object.freeze({ plan: planInvocation, run: runInvocation }),\n invocationStatus: Object.freeze({ list: listInvocationStatus, show: showInvocationStatus }),\n rename: Object.freeze({ plan: planRename, apply: applyRename }),\n teardown: Object.freeze({ inspect: inspectTeardown, run: runTeardown }),\n debug,\n accept,\n acceptRun: Object.freeze({ plan: planRunAccept, apply: applyRunAccept }),\n});\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mCAAgC;AAChC,kEAA8H;AAC9H,0DAA8E;AAC9E,gEAAgE;AACh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AAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/D,KAAK;KACR,CAAC,CAAC,CAAC,CAAC;AACT,CAAC;AAID,6FAA6F;AAChF,QAAA,cAAc,GAAsB,MAAM,CAAC,MAAM,CAAC;IAC3D,OAAO,EAAP,uBAAO;IACP,KAAK,EAAL,qBAAK;IACL,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,8BAAc,EAAE,GAAG,EAAE,6BAAa,EAAE,CAAC;IACvE,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,oCAAoB,EAAE,IAAI,EAAE,oCAAoB,EAAE,CAAC;IAC3F,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,0BAAU,EAAE,KAAK,EAAE,2BAAW,EAAE,CAAC;IAC/D,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,6BAAe,EAAE,GAAG,EAAE,yBAAW,EAAE,CAAC;IACvE,KAAK;IACL,MAAM,EAAN,sBAAM;IACN,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,6BAAa,EAAE,KAAK,EAAE,8BAAc,EAAE,CAAC;CAC3E,CAAC,CAAC","sourcesContent":["import { Effect } from \"effect\";\nimport { assembleCommandPlan, setupPrefixPlanOf, type CommandPlan, type SetupPrefixPlan } from \"../../runner/command-plan.ts\";\nimport { discoverEvals, discoverExperiments } from \"../../runner/discover.ts\";\nimport { planProjectTarget } from \"../../runner/fingerprint.ts\";\nimport { resolveExperimentEvals } from \"../../runner/eval-selection.ts\";\nimport { resolveRunTimeout } from \"../../runner/timeout.ts\";\nimport type { AgentRun, Config, DiscoveredEval, DiscoveredExperiment, } from \"../../runner/types.ts\";\nimport { resolveSandboxSetupCache } from \"../../runner/types.ts\";\nimport { matchExperimentSelector } from \"../../shared/aggregate.ts\";\nimport { accept, applyRunAccept, applyRename, catalog, check, listInvocationStatus, planInvocation, planRename, planRunAccept, runInvocation, showInvocationStatus, } from \"./operations.ts\";\nimport { inspectTeardown, runTeardown } from \"./teardown.ts\";\nimport { ExperimentHostError, type ExperimentHostHighLevelSDK } from \"./types.ts\";\nexport * from \"./types.ts\";\nexport { decodeDebugPlanDocument, DebugPlanDocumentSchema, type DebugPlanDocument, } from \"./cli/debug-protocol.ts\";\nexport { decodeSessionListDocument, decodeSessionShowDocument, SessionListDocumentSchema, SessionShowDocumentSchema, } from \"./cli/session-protocol.ts\";\nexport { decodeExpPlanDocument, ExpPlanDocumentSchema, type ExpPlanDocument } from \"./cli/plan-protocol.ts\";\nexport { decodeExpTerminalEvent, ExpInvocationReceiptSchema, ExpTerminalEventSchema, ExpTerminalSummarySchema, type ExpInvocationReceipt, type ExpTerminalEvent, type ExpTerminalSummary, } from \"./cli/output-protocol.ts\";\n/**\n * Public, supported high-level Host composition SDK for the NiceEval CLI,\n * replacement CLI/Web hosts, and deep application integrations. Eval authors\n * use `defineExperiment`; this entry deliberately exposes no Runner internals.\n */\n/** One discovered Experiment after its author selector and CLI prefixes close. */\ninterface ExperimentHostSelection {\n readonly experiment: DiscoveredExperiment;\n readonly selectedEvalIds: readonly string[];\n /** The Experiment-owned set before CLI eval-prefix narrowing. */\n readonly selectorEvalIds: readonly string[];\n}\n/** Discovery result used by both `exp list` and execution planning. */\ninterface ExperimentHostListResult {\n readonly evals: readonly DiscoveredEval[];\n readonly experimentIds: readonly string[];\n readonly selections: readonly ExperimentHostSelection[];\n}\n/**\n * Discovery and selection are owned here so consumers cannot invoke an\n * Experiment's predicate a second time while reconstructing an AgentRun.\n */\nfunction discoverSelection(input: {\n readonly cwd: string;\n /** Keep the CLI's public `--tag` selection inside the Experiment boundary. */\n readonly tag?: string;\n readonly selector?: string;\n readonly evalPatterns?: readonly string[];\n}): Effect.Effect<ExperimentHostListResult, unknown> {\n return Effect.gen(function* () {\n const discoveredEvals = yield* discoverEvals(input.cwd);\n const evals = input.tag === undefined\n ? discoveredEvals\n : discoveredEvals.filter((evalDefinition) => evalDefinition.tags?.includes(input.tag!));\n const experiments = yield* discoverExperiments(input.cwd);\n const experimentIds = Object.freeze(experiments.map((experiment) => experiment.id));\n const selectedIds = input.selector === undefined\n ? undefined\n : new Set(matchExperimentSelector(experimentIds, input.selector));\n const selections = experiments\n .filter((experiment) => selectedIds === undefined || selectedIds.has(experiment.id))\n .map((experiment): ExperimentHostSelection => {\n const selected = resolveExperimentEvals({\n experimentId: experiment.id,\n selector: experiment.evals,\n cliPatterns: input.evalPatterns ?? [],\n evals,\n });\n return Object.freeze({\n experiment,\n selectedEvalIds: Object.freeze([...selected.selectedEvalIds]),\n selectorEvalIds: Object.freeze(selected.selectorEvals.map((evalDefinition) => evalDefinition.id)),\n });\n });\n return Object.freeze({\n evals: Object.freeze([...evals]),\n experimentIds,\n selections: Object.freeze(selections),\n });\n });\n}\nexport interface ExperimentHostDebugPlanRequest {\n readonly cwd: string;\n readonly config: Config;\n readonly experimentSelector: string;\n readonly evalSelector?: string;\n}\n/** A fully closed, read-only lifecycle plan for exactly one Experiment × Eval pair. */\nexport interface ExperimentHostDebugPlan {\n readonly status: \"planned\";\n readonly experimentId: string;\n /** Retained for the existing single-pair response. */\n readonly evalId?: string;\n readonly evalIds: readonly string[];\n readonly commandPlan: CommandPlan;\n readonly setupPrefixPlan: SetupPrefixPlan;\n}\n/**\n * Selector outcomes are data, rather than CLI-owned selection logic or a\n * partially constructed plan. The caller can render them in its own surface.\n */\nexport type ExperimentHostDebugPlanResult = ExperimentHostDebugPlan | {\n readonly status: \"experiment-no-match\";\n readonly selector: string;\n readonly candidates: readonly string[];\n} | {\n readonly status: \"experiment-ambiguous\";\n readonly selector: string;\n readonly candidates: readonly string[];\n} | {\n readonly status: \"eval-no-match\";\n readonly selector: string;\n readonly experimentId: string;\n readonly candidates: readonly string[];\n} | {\n readonly status: \"eval-ambiguous\";\n readonly selector: string;\n readonly experimentId: string;\n readonly candidates: readonly string[];\n};\nfunction uniqueExactOrPrefix<T>(candidates: readonly T[], selector: string, id: (candidate: T) => string): readonly T[] {\n const exact = candidates.find((candidate) => id(candidate) === selector);\n return exact === undefined\n ? candidates.filter((candidate) => id(candidate).startsWith(selector))\n : [exact];\n}\nfunction debugAgentRun(experiment: DiscoveredExperiment, evalId: string, config: Config): AgentRun {\n return {\n agent: experiment.agent,\n model: experiment.model,\n reasoningEffort: experiment.reasoningEffort,\n flags: experiment.flags ?? {},\n plugins: experiment.plugins,\n attempts: experiment.attempts ?? 1,\n earlyExit: experiment.earlyExit ?? false,\n sandboxSetupCache: resolveSandboxSetupCache(undefined, experiment.sandboxCache, config.sandboxCache),\n sandbox: experiment.sandbox,\n sandboxReuse: experiment.sandboxReuse,\n ...(experiment.sharedState === undefined ? {} : { sharedState: experiment.sharedState }),\n judge: experiment.judge,\n ...resolveRunTimeout(undefined, experiment.timeoutMs),\n budget: experiment.budget,\n selectedEvalIds: [evalId],\n experimentId: experiment.id,\n experimentBaseDir: experiment.baseDir,\n experimentSourcePath: experiment.sourcePath,\n description: experiment.description,\n labels: experiment.labels,\n maxConcurrency: experiment.maxConcurrency,\n setup: experiment.setup,\n teardown: experiment.teardown,\n classifyFailure: experiment.classifyFailure,\n };\n}\n/**\n * Closes selector resolution, physical planning, and command-plan projection\n * inside the Experiment Host. It deliberately does not construct a Record\n * root, enter a lease, read history, or invoke an author callback.\n */\nfunction debug(input: ExperimentHostDebugPlanRequest): Effect.Effect<ExperimentHostDebugPlanResult, ExperimentHostError> {\n return Effect.gen(function* () {\n const listed = yield* discoverSelection({ cwd: input.cwd });\n const selectedExperiments = uniqueExactOrPrefix(listed.selections, input.experimentSelector, ({ experiment }) => experiment.id).slice().sort((left, right) => left.experiment.id.localeCompare(right.experiment.id));\n if (selectedExperiments.length === 0) {\n return Object.freeze({\n status: \"experiment-no-match\" as const,\n selector: input.experimentSelector,\n candidates: Object.freeze([...listed.experimentIds].sort()),\n });\n }\n if (selectedExperiments.length > 1) {\n return Object.freeze({\n status: \"experiment-ambiguous\" as const,\n selector: input.experimentSelector,\n candidates: Object.freeze(selectedExperiments.map(({ experiment }) => experiment.id)),\n });\n }\n const selection = selectedExperiments[0]!;\n const experiment = selection.experiment;\n const selectorEvalIds = new Set(selection.selectorEvalIds);\n const selectorEvals = listed.evals.filter((evalDef) => selectorEvalIds.has(evalDef.id));\n const selectedEvals = (input.evalSelector === undefined\n ? selectorEvals\n : uniqueExactOrPrefix(selectorEvals, input.evalSelector, (evalDef) => evalDef.id))\n .slice().sort((left, right) => left.id.localeCompare(right.id));\n if (selectedEvals.length === 0) {\n return Object.freeze({\n status: \"eval-no-match\" as const,\n selector: input.evalSelector ?? \"\",\n experimentId: experiment.id,\n candidates: Object.freeze(selectorEvals.map((evalDef) => evalDef.id).sort()),\n });\n }\n if (input.evalSelector !== undefined && selectedEvals.length > 1) {\n return Object.freeze({\n status: \"eval-ambiguous\" as const,\n selector: input.evalSelector,\n experimentId: experiment.id,\n candidates: Object.freeze(selectedEvals.map((evalDef) => evalDef.id)),\n });\n }\n const runs = selectedEvals.map((evalDef) => debugAgentRun(experiment, evalDef.id, input.config));\n const target = yield* planProjectTarget(listed.evals, runs, input.config.timeoutMs, { configJudge: input.config.judge });\n const commandPlan = assembleCommandPlan({\n rows: selectedEvals.map((evalDef) => {\n const run = runs.find((candidate) => candidate.selectedEvalIds.includes(evalDef.id))!;\n return {\n experimentId: experiment.id,\n evalId: evalDef.id,\n ...(evalDef.evalGroup === undefined ? {} : { evalGroupId: evalDef.evalGroup.id }),\n attempts: run.attempts,\n dispatch: [{ attempts: Array.from({ length: run.attempts }, (_, attempt) => attempt) }],\n };\n }),\n preparedPairsByKey: target.preparedPairsByKey,\n });\n return Object.freeze({\n status: \"planned\" as const,\n experimentId: experiment.id,\n ...(selectedEvals.length === 1 ? { evalId: selectedEvals[0]!.id } : {}),\n evalIds: Object.freeze(selectedEvals.map((evalDef) => evalDef.id)),\n commandPlan,\n setupPrefixPlan: setupPrefixPlanOf(commandPlan),\n });\n }).pipe(Effect.mapError((cause) => new ExperimentHostError({\n operation: \"debug\",\n code: typeof cause === \"object\" && cause !== null && typeof Reflect.get(cause, \"code\") === \"string\"\n ? String(Reflect.get(cause, \"code\"))\n : \"experiment-host-operation-failed\",\n message: cause instanceof Error ? cause.message : String(cause),\n cause,\n })));\n}\nexport interface ExperimentHostSDK extends ExperimentHostHighLevelSDK {\n readonly debug: typeof debug;\n}\n/** The fixed public Host surface; discovery, Runner, and adoption internals stay private. */\nexport const experimentHost: ExperimentHostSDK = Object.freeze({\n catalog,\n check,\n invocation: Object.freeze({ plan: planInvocation, run: runInvocation }),\n invocationStatus: Object.freeze({ list: listInvocationStatus, show: showInvocationStatus }),\n rename: Object.freeze({ plan: planRename, apply: applyRename }),\n teardown: Object.freeze({ inspect: inspectTeardown, run: runTeardown }),\n debug,\n accept,\n acceptRun: Object.freeze({ plan: planRunAccept, apply: applyRunAccept }),\n});\n"]}
@@ -3,6 +3,8 @@ import { type CommandPlan, type SetupPrefixPlan } from "../../runner/command-pla
3
3
  import type { Config } from "../../runner/types.cjs";
4
4
  import { ExperimentHostError, type ExperimentHostHighLevelSDK } from "./types.cjs";
5
5
  export * from "./types.cjs";
6
+ export { decodeDebugPlanDocument, DebugPlanDocumentSchema, type DebugPlanDocument, } from "./cli/debug-protocol.cjs";
7
+ export { decodeSessionListDocument, decodeSessionShowDocument, SessionListDocumentSchema, SessionShowDocumentSchema, } from "./cli/session-protocol.cjs";
6
8
  export { decodeExpPlanDocument, ExpPlanDocumentSchema, type ExpPlanDocument } from "./cli/plan-protocol.cjs";
7
9
  export { decodeExpTerminalEvent, ExpInvocationReceiptSchema, ExpTerminalEventSchema, ExpTerminalSummarySchema, type ExpInvocationReceipt, type ExpTerminalEvent, type ExpTerminalSummary, } from "./cli/output-protocol.cjs";
8
10
  export interface ExperimentHostDebugPlanRequest {
@@ -3,6 +3,8 @@ import { type CommandPlan, type SetupPrefixPlan } from "../../runner/command-pla
3
3
  import type { Config } from "../../runner/types.mjs";
4
4
  import { ExperimentHostError, type ExperimentHostHighLevelSDK } from "./types.mjs";
5
5
  export * from "./types.mjs";
6
+ export { decodeDebugPlanDocument, DebugPlanDocumentSchema, type DebugPlanDocument, } from "./cli/debug-protocol.mjs";
7
+ export { decodeSessionListDocument, decodeSessionShowDocument, SessionListDocumentSchema, SessionShowDocumentSchema, } from "./cli/session-protocol.mjs";
6
8
  export { decodeExpPlanDocument, ExpPlanDocumentSchema, type ExpPlanDocument } from "./cli/plan-protocol.mjs";
7
9
  export { decodeExpTerminalEvent, ExpInvocationReceiptSchema, ExpTerminalEventSchema, ExpTerminalSummarySchema, type ExpInvocationReceipt, type ExpTerminalEvent, type ExpTerminalSummary, } from "./cli/output-protocol.mjs";
8
10
  export interface ExperimentHostDebugPlanRequest {
@@ -3,6 +3,8 @@ import { type CommandPlan, type SetupPrefixPlan } from "../../runner/command-pla
3
3
  import type { Config } from "../../runner/types.js";
4
4
  import { ExperimentHostError, type ExperimentHostHighLevelSDK } from "./types.js";
5
5
  export * from "./types.js";
6
+ export { decodeDebugPlanDocument, DebugPlanDocumentSchema, type DebugPlanDocument, } from "./cli/debug-protocol.js";
7
+ export { decodeSessionListDocument, decodeSessionShowDocument, SessionListDocumentSchema, SessionShowDocumentSchema, } from "./cli/session-protocol.js";
6
8
  export { decodeExpPlanDocument, ExpPlanDocumentSchema, type ExpPlanDocument } from "./cli/plan-protocol.js";
7
9
  export { decodeExpTerminalEvent, ExpInvocationReceiptSchema, ExpTerminalEventSchema, ExpTerminalSummarySchema, type ExpInvocationReceipt, type ExpTerminalEvent, type ExpTerminalSummary, } from "./cli/output-protocol.js";
8
10
  export interface ExperimentHostDebugPlanRequest {
@@ -1,20 +1,32 @@
1
1
  import { createRequire as __niceevalCreateRequire } from "node:module";
2
2
  const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
3
3
  const __niceevalCanonical = __niceevalRequire("./index.cjs");
4
- const __niceevalExport0 = __niceevalCanonical["ExpInvocationReceiptSchema"];
5
- export { __niceevalExport0 as ExpInvocationReceiptSchema };
6
- const __niceevalExport1 = __niceevalCanonical["ExpPlanDocumentSchema"];
7
- export { __niceevalExport1 as ExpPlanDocumentSchema };
8
- const __niceevalExport2 = __niceevalCanonical["ExpTerminalEventSchema"];
9
- export { __niceevalExport2 as ExpTerminalEventSchema };
10
- const __niceevalExport3 = __niceevalCanonical["ExpTerminalSummarySchema"];
11
- export { __niceevalExport3 as ExpTerminalSummarySchema };
12
- const __niceevalExport4 = __niceevalCanonical["ExperimentHostError"];
13
- export { __niceevalExport4 as ExperimentHostError };
14
- const __niceevalExport5 = __niceevalCanonical["decodeExpPlanDocument"];
15
- export { __niceevalExport5 as decodeExpPlanDocument };
16
- const __niceevalExport6 = __niceevalCanonical["decodeExpTerminalEvent"];
17
- export { __niceevalExport6 as decodeExpTerminalEvent };
18
- const __niceevalExport7 = __niceevalCanonical["experimentHost"];
19
- export { __niceevalExport7 as experimentHost };
4
+ const __niceevalExport0 = __niceevalCanonical["DebugPlanDocumentSchema"];
5
+ export { __niceevalExport0 as DebugPlanDocumentSchema };
6
+ const __niceevalExport1 = __niceevalCanonical["ExpInvocationReceiptSchema"];
7
+ export { __niceevalExport1 as ExpInvocationReceiptSchema };
8
+ const __niceevalExport2 = __niceevalCanonical["ExpPlanDocumentSchema"];
9
+ export { __niceevalExport2 as ExpPlanDocumentSchema };
10
+ const __niceevalExport3 = __niceevalCanonical["ExpTerminalEventSchema"];
11
+ export { __niceevalExport3 as ExpTerminalEventSchema };
12
+ const __niceevalExport4 = __niceevalCanonical["ExpTerminalSummarySchema"];
13
+ export { __niceevalExport4 as ExpTerminalSummarySchema };
14
+ const __niceevalExport5 = __niceevalCanonical["ExperimentHostError"];
15
+ export { __niceevalExport5 as ExperimentHostError };
16
+ const __niceevalExport6 = __niceevalCanonical["SessionListDocumentSchema"];
17
+ export { __niceevalExport6 as SessionListDocumentSchema };
18
+ const __niceevalExport7 = __niceevalCanonical["SessionShowDocumentSchema"];
19
+ export { __niceevalExport7 as SessionShowDocumentSchema };
20
+ const __niceevalExport8 = __niceevalCanonical["decodeDebugPlanDocument"];
21
+ export { __niceevalExport8 as decodeDebugPlanDocument };
22
+ const __niceevalExport9 = __niceevalCanonical["decodeExpPlanDocument"];
23
+ export { __niceevalExport9 as decodeExpPlanDocument };
24
+ const __niceevalExport10 = __niceevalCanonical["decodeExpTerminalEvent"];
25
+ export { __niceevalExport10 as decodeExpTerminalEvent };
26
+ const __niceevalExport11 = __niceevalCanonical["decodeSessionListDocument"];
27
+ export { __niceevalExport11 as decodeSessionListDocument };
28
+ const __niceevalExport12 = __niceevalCanonical["decodeSessionShowDocument"];
29
+ export { __niceevalExport12 as decodeSessionShowDocument };
30
+ const __niceevalExport13 = __niceevalCanonical["experimentHost"];
31
+ export { __niceevalExport13 as experimentHost };
20
32
  //# sourceMappingURL=index.js.map
@@ -1,20 +1,32 @@
1
1
  import { createRequire as __niceevalCreateRequire } from "node:module";
2
2
  const __niceevalRequire = __niceevalCreateRequire(import.meta.url);
3
3
  const __niceevalCanonical = __niceevalRequire("./index.cjs");
4
- const __niceevalExport0 = __niceevalCanonical["ExpInvocationReceiptSchema"];
5
- export { __niceevalExport0 as ExpInvocationReceiptSchema };
6
- const __niceevalExport1 = __niceevalCanonical["ExpPlanDocumentSchema"];
7
- export { __niceevalExport1 as ExpPlanDocumentSchema };
8
- const __niceevalExport2 = __niceevalCanonical["ExpTerminalEventSchema"];
9
- export { __niceevalExport2 as ExpTerminalEventSchema };
10
- const __niceevalExport3 = __niceevalCanonical["ExpTerminalSummarySchema"];
11
- export { __niceevalExport3 as ExpTerminalSummarySchema };
12
- const __niceevalExport4 = __niceevalCanonical["ExperimentHostError"];
13
- export { __niceevalExport4 as ExperimentHostError };
14
- const __niceevalExport5 = __niceevalCanonical["decodeExpPlanDocument"];
15
- export { __niceevalExport5 as decodeExpPlanDocument };
16
- const __niceevalExport6 = __niceevalCanonical["decodeExpTerminalEvent"];
17
- export { __niceevalExport6 as decodeExpTerminalEvent };
18
- const __niceevalExport7 = __niceevalCanonical["experimentHost"];
19
- export { __niceevalExport7 as experimentHost };
4
+ const __niceevalExport0 = __niceevalCanonical["DebugPlanDocumentSchema"];
5
+ export { __niceevalExport0 as DebugPlanDocumentSchema };
6
+ const __niceevalExport1 = __niceevalCanonical["ExpInvocationReceiptSchema"];
7
+ export { __niceevalExport1 as ExpInvocationReceiptSchema };
8
+ const __niceevalExport2 = __niceevalCanonical["ExpPlanDocumentSchema"];
9
+ export { __niceevalExport2 as ExpPlanDocumentSchema };
10
+ const __niceevalExport3 = __niceevalCanonical["ExpTerminalEventSchema"];
11
+ export { __niceevalExport3 as ExpTerminalEventSchema };
12
+ const __niceevalExport4 = __niceevalCanonical["ExpTerminalSummarySchema"];
13
+ export { __niceevalExport4 as ExpTerminalSummarySchema };
14
+ const __niceevalExport5 = __niceevalCanonical["ExperimentHostError"];
15
+ export { __niceevalExport5 as ExperimentHostError };
16
+ const __niceevalExport6 = __niceevalCanonical["SessionListDocumentSchema"];
17
+ export { __niceevalExport6 as SessionListDocumentSchema };
18
+ const __niceevalExport7 = __niceevalCanonical["SessionShowDocumentSchema"];
19
+ export { __niceevalExport7 as SessionShowDocumentSchema };
20
+ const __niceevalExport8 = __niceevalCanonical["decodeDebugPlanDocument"];
21
+ export { __niceevalExport8 as decodeDebugPlanDocument };
22
+ const __niceevalExport9 = __niceevalCanonical["decodeExpPlanDocument"];
23
+ export { __niceevalExport9 as decodeExpPlanDocument };
24
+ const __niceevalExport10 = __niceevalCanonical["decodeExpTerminalEvent"];
25
+ export { __niceevalExport10 as decodeExpTerminalEvent };
26
+ const __niceevalExport11 = __niceevalCanonical["decodeSessionListDocument"];
27
+ export { __niceevalExport11 as decodeSessionListDocument };
28
+ const __niceevalExport12 = __niceevalCanonical["decodeSessionShowDocument"];
29
+ export { __niceevalExport12 as decodeSessionShowDocument };
30
+ const __niceevalExport13 = __niceevalCanonical["experimentHost"];
31
+ export { __niceevalExport13 as experimentHost };
20
32
  //# sourceMappingURL=index.mjs.map
@@ -5,7 +5,7 @@ const effect_1 = require("effect");
5
5
  const application_ts_1 = require("../../cli/application.cjs");
6
6
  const contribution_ts_1 = require("../../cli/contribution.cjs");
7
7
  const index_ts_1 = require("../../inspection/index.cjs");
8
- const index_ts_2 = require("../host/index.cjs");
8
+ const runtime_ts_1 = require("../host/runtime.cjs");
9
9
  const protocol_ts_1 = require("../protocol.cjs");
10
10
  const help = (summary) => Object.freeze({ summary, visibility: "public" });
11
11
  const option = (value) => Object.freeze(value);
@@ -85,7 +85,7 @@ Usage:
85
85
  const unsupported = unsupportedOption(parsed, ["invocation", "json"]);
86
86
  if (unsupported !== undefined)
87
87
  return yield* usage(`--${unsupported} is not valid with niceeval run list.`);
88
- const listed = yield* index_ts_2.runHost.list({
88
+ const listed = yield* runtime_ts_1.rawRunHost.list({
89
89
  cwd: facts.cwd,
90
90
  ...(typeof parsed.values.invocation === "string"
91
91
  ? { invocationId: parsed.values.invocation }
@@ -118,7 +118,7 @@ Usage:
118
118
  const unsupported = unsupportedOption(parsed, ["json"]);
119
119
  if (unsupported !== undefined)
120
120
  return yield* usage(`--${unsupported} is not valid with niceeval run show.`);
121
- const shown = yield* index_ts_2.runHost.get({ cwd: facts.cwd, runId }).pipe(effect_1.Effect.mapError((cause) => failure("show", cause)));
121
+ const shown = yield* runtime_ts_1.rawRunHost.get({ cwd: facts.cwd, runId }).pipe(effect_1.Effect.mapError((cause) => failure("show", cause)));
122
122
  if (json) {
123
123
  yield* writeJson(Object.freeze({
124
124
  protocol: protocol_ts_1.RUN_PROTOCOL,
@@ -155,7 +155,7 @@ Usage:
155
155
  return 1;
156
156
  }
157
157
  if (action === "delete") {
158
- const receipt = yield* index_ts_2.runHost.delete({ cwd: facts.cwd, runId }).pipe(effect_1.Effect.mapError((cause) => failure("delete", cause)));
158
+ const receipt = yield* runtime_ts_1.rawRunHost.delete({ cwd: facts.cwd, runId }).pipe(effect_1.Effect.mapError((cause) => failure("delete", cause)));
159
159
  if (json)
160
160
  yield* writeJson(Object.freeze({ protocol: protocol_ts_1.RUN_PROTOCOL, operation: "run.delete", ...receipt }));
161
161
  else
@@ -163,7 +163,7 @@ Usage:
163
163
  `);
164
164
  return 0;
165
165
  }
166
- const receipt = yield* index_ts_2.runHost.recover({ cwd: facts.cwd, runId }).pipe(effect_1.Effect.mapError((cause) => failure("recover", cause)));
166
+ const receipt = yield* runtime_ts_1.rawRunHost.recover({ cwd: facts.cwd, runId }).pipe(effect_1.Effect.mapError((cause) => failure("recover", cause)));
167
167
  if (json)
168
168
  yield* writeJson(Object.freeze({ protocol: protocol_ts_1.RUN_PROTOCOL, operation: "run.recover", ...receipt }));
169
169
  else
@@ -1 +1 @@
1
- {"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC,6DAAwI;AACxI,+DAA0F;AAC1F,wDAA+D;AAC/D,+CAA2C;AAC3C,gDAA0F;AAE1F,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAiB,EAAE,CAAC,CAAC;AAC5F,MAAM,MAAM,GAAG,CAAC,KAA0B,EAAuB,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5E,QAAA,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,IAAI,CAAC,kDAAkD,CAAC;KACjE,CAAC;IACF,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,8BAA8B,CAAC,EAAE,CAAC;IAC7E,GAAG,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,4BAA4B,CAAC,EAAE,CAAC;IAC1E,IAAI,EAAE,MAAM,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AK;IACX,OAAO,EAAE,kCAAkC;IAC3C,OAAO,EAAE,uBAAe;IACxB,GAAG,EAAE,UAAU;CAClB,CAAC,CAAC","sourcesContent":["import { Effect, Result } from \"effect\";\nimport type { ProjectStateDatabase } from \"../../record/sqlite/project-state-database.ts\";\nimport { CliArguments, CliInvocationFacts, CliOutput, type CliOptionDefinition, type CliParsedTokens, } from \"../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution, } from \"../../cli/contribution.ts\";\nimport { canonicalJsonValue } from \"../../inspection/index.ts\";\nimport { runHost } from \"../host/index.ts\";\nimport { RUN_PROTOCOL, type RunGetDocument, type RunListDocument, } from \"../protocol.ts\";\nimport type { RunDeleteError, RunReadError, RunRecoverError, } from \"../host/index.ts\";\nconst help = (summary: string) => Object.freeze({ summary, visibility: \"public\" as const });\nconst option = (value: CliOptionDefinition): CliOptionDefinition => Object.freeze(value);\nexport const RUN_CLI_OPTIONS = Object.freeze({\n invocation: option({\n type: \"string\",\n help: help(\"Filter Run discovery by one exact Invocation ID.\"),\n }),\n json: option({ type: \"boolean\", help: help(\"Print machine-readable JSON.\") }),\n yes: option({ type: \"boolean\", help: help(\"Confirm delete or recover.\") }),\n help: option({ type: \"boolean\", short: \"h\", help: help(\"Print Run help.\") }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\ntype Requirements = CliArguments | CliInvocationFacts | CliOutput | ProjectStateDatabase;\ntype Error = CliFeatureError;\ntype HostFailure = RunReadError | RunDeleteError | RunRecoverError;\nfunction failure(operation: string, cause: unknown): Error {\n const hostFailure = isHostFailure(cause) ? cause : undefined;\n return new CliFeatureError({\n feature: \"run\",\n operation,\n cause,\n exitCode: 1,\n ...(hostFailure === undefined\n ? {}\n : { display: `${hostFailure.code}: ${hostFailure.message}\\n` }),\n });\n}\nfunction isHostFailure(value: unknown): value is HostFailure {\n return typeof value === \"object\" && value !== null &&\n [\"RunReadError\", \"RunDeleteError\", \"RunRecoverError\"].includes(String(Reflect.get(value, \"_tag\")));\n}\nfunction write(channel: \"stdout\" | \"stderr\", text: string) {\n return Effect.flatMap(CliOutput, (output) => channel === \"stdout\" ? output.writeStdout(text) : output.writeStderr(text)).pipe(Effect.mapError((cause) => failure(`write ${channel}`, cause)));\n}\nfunction invocationFacts() {\n return Effect.flatMap(CliInvocationFacts, ({ facts }) => facts).pipe(Effect.mapError((cause) => failure(\"read invocation facts\", cause)));\n}\nfunction writeJson(value: unknown) {\n const encoded = canonicalJsonValue(value);\n return Result.isFailure(encoded)\n ? Effect.fail(failure(\"encode JSON\", encoded.failure))\n : write(\"stdout\", encoded.success);\n}\nfunction usage(message: string) {\n return write(\"stderr\", `${message}\\n`).pipe(Effect.as(1));\n}\nfunction unsupportedOption(parsed: CliParsedTokens, allowed: readonly string[]): string | undefined {\n const permitted = new Set([...allowed, \"help\"]);\n return Object.entries(parsed.values).find(([name, value]) => value !== undefined && !permitted.has(name))?.[0];\n}\nfunction runCommand(argv: readonly string[]): Effect.Effect<number, Error, Requirements> {\n return Effect.gen(function* () {\n const parser = yield* CliArguments;\n const parsed = yield* Effect.try({\n try: () => parser.parse(argv, RUN_CLI_OPTIONS),\n catch: (cause) => failure(\"parse arguments\", cause),\n });\n if (parsed.values.help === true) {\n yield* write(\"stdout\", `niceeval run — inspect and manage Run lifecycle\n\nUsage:\n niceeval run list [--invocation <invocation-id>] [--json]\n niceeval run show <run-id> [--json]\n niceeval run delete <run-id> [--yes] [--json]\n niceeval run recover <run-id> [--yes] [--json]\n`);\n return 0;\n }\n const action = parsed.positionals[0];\n if (action === undefined || ![\"list\", \"show\", \"delete\", \"recover\"].includes(action)) {\n return yield* usage(`niceeval run expects exactly one of list, show, delete, or recover.\n`.trimEnd());\n }\n const facts = yield* invocationFacts();\n const json = parsed.values.json === true;\n if (action === \"list\") {\n if (parsed.positionals.length !== 1) {\n return yield* usage(\"niceeval run list does not accept positional selectors.\");\n }\n const unsupported = unsupportedOption(parsed, [\"invocation\", \"json\"]);\n if (unsupported !== undefined)\n return yield* usage(`--${unsupported} is not valid with niceeval run list.`);\n const listed = yield* runHost.list({\n cwd: facts.cwd,\n ...(typeof parsed.values.invocation === \"string\"\n ? { invocationId: parsed.values.invocation }\n : {}),\n }).pipe(Effect.mapError((cause) => failure(\"list\", cause)));\n if (json) {\n yield* writeJson(Object.freeze({\n protocol: RUN_PROTOCOL,\n operation: \"run.list\",\n runs: listed.runs,\n ...(listed.continuation === undefined\n ? {}\n : { continuation: listed.continuation }),\n }) satisfies RunListDocument);\n return 0;\n }\n if (listed.runs.length === 0) {\n yield* write(\"stdout\", `No Runs found.\n`);\n return 0;\n }\n yield* write(\"stdout\", `${listed.runs.map((run) => `${run.runId} ${run.state} ${run.experimentId} ${run.coverage.published}/${run.coverage.expected} ${new Date(run.startedAt).toISOString()}`).join(\"\\n\")}\\n`);\n return 0;\n }\n if (parsed.positionals.length !== 2) {\n return yield* usage(`niceeval run ${action} requires one exact Run ID.`);\n }\n const runId = parsed.positionals[1]!;\n if (action === \"show\") {\n const unsupported = unsupportedOption(parsed, [\"json\"]);\n if (unsupported !== undefined)\n return yield* usage(`--${unsupported} is not valid with niceeval run show.`);\n const shown = yield* runHost.get({ cwd: facts.cwd, runId }).pipe(Effect.mapError((cause) => failure(\"show\", cause)));\n if (json) {\n yield* writeJson(Object.freeze({\n protocol: RUN_PROTOCOL,\n operation: \"run.get\",\n run: shown.run,\n }) satisfies RunGetDocument);\n }\n else {\n yield* write(\"stdout\", `${shown.run.runId} ${shown.run.state} ${shown.run.experimentId}\\n` +\n `started: ${new Date(shown.run.startedAt).toISOString()}\\n` +\n (shown.run.completedAt === undefined\n ? \"\"\n : `completed: ${new Date(shown.run.completedAt).toISOString()}\\n`) +\n `coverage: ${shown.run.coverage.published}/${shown.run.coverage.expected}\\n`);\n }\n return 0;\n }\n const unsupported = unsupportedOption(parsed, [\"json\", \"yes\"]);\n if (unsupported !== undefined)\n return yield* usage(`--${unsupported} is not valid with niceeval run ${action}.`);\n if (parsed.values.yes !== true) {\n if (json) {\n yield* writeJson(Object.freeze({\n protocol: RUN_PROTOCOL,\n operation: `run.${action}`,\n outcome: \"confirmation-required\",\n runId,\n }));\n }\n else {\n yield* write(\"stderr\", `Run ${runId} is selected for ${action}. Review it, then rerun with --yes.\n`);\n }\n return 1;\n }\n if (action === \"delete\") {\n const receipt = yield* runHost.delete({ cwd: facts.cwd, runId }).pipe(Effect.mapError((cause) => failure(\"delete\", cause)));\n if (json)\n yield* writeJson(Object.freeze({ protocol: RUN_PROTOCOL, operation: \"run.delete\", ...receipt }));\n else\n yield* write(\"stdout\", `Deleted Run ${receipt.runId}.\n`);\n return 0;\n }\n const receipt = yield* runHost.recover({ cwd: facts.cwd, runId }).pipe(Effect.mapError((cause) => failure(\"recover\", cause)));\n if (json)\n yield* writeJson(Object.freeze({ protocol: RUN_PROTOCOL, operation: \"run.recover\", ...receipt }));\n else\n yield* write(\"stdout\", `Recovered Run ${receipt.runId} as interrupted.\n`);\n return 0;\n });\n}\nexport const runCliCommand: CliCommandContribution<Requirements, Error> = Object.freeze({\n name: \"run\",\n summary: \"inspect and manage Run lifecycle\",\n options: RUN_CLI_OPTIONS,\n run: runCommand,\n});\n"]}
1
+ {"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC,6DAAwI;AACxI,+DAA0F;AAC1F,wDAA+D;AAC/D,mDAAgD;AAChD,gDAA0F;AAE1F,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAiB,EAAE,CAAC,CAAC;AAC5F,MAAM,MAAM,GAAG,CAAC,KAA0B,EAAuB,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5E,QAAA,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,IA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SAAS,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC;;YAElG,KAAK,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,iBAAiB,OAAO,CAAC,KAAK;CAChE,CAAC,CAAC;QACK,OAAO,CAAC,CAAC;IACb,CAAC,CAAC,CAAC;AACP,CAAC;AACY,QAAA,aAAa,GAAgD,MAAM,CAAC,MAAM,CAAC;IACpF,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,kCAAkC;IAC3C,OAAO,EAAE,uBAAe;IACxB,GAAG,EAAE,UAAU;CAClB,CAAC,CAAC","sourcesContent":["import { Effect, Result } from \"effect\";\nimport type { ProjectStateDatabase } from \"../../record/sqlite/project-state-database.ts\";\nimport { CliArguments, CliInvocationFacts, CliOutput, type CliOptionDefinition, type CliParsedTokens, } from \"../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution, } from \"../../cli/contribution.ts\";\nimport { canonicalJsonValue } from \"../../inspection/index.ts\";\nimport { rawRunHost } from \"../host/runtime.ts\";\nimport { RUN_PROTOCOL, type RunGetDocument, type RunListDocument, } from \"../protocol.ts\";\nimport type { RunDeleteError, RunReadError, RunRecoverError, } from \"../host/index.ts\";\nconst help = (summary: string) => Object.freeze({ summary, visibility: \"public\" as const });\nconst option = (value: CliOptionDefinition): CliOptionDefinition => Object.freeze(value);\nexport const RUN_CLI_OPTIONS = Object.freeze({\n invocation: option({\n type: \"string\",\n help: help(\"Filter Run discovery by one exact Invocation ID.\"),\n }),\n json: option({ type: \"boolean\", help: help(\"Print machine-readable JSON.\") }),\n yes: option({ type: \"boolean\", help: help(\"Confirm delete or recover.\") }),\n help: option({ type: \"boolean\", short: \"h\", help: help(\"Print Run help.\") }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\ntype Requirements = CliArguments | CliInvocationFacts | CliOutput | ProjectStateDatabase;\ntype Error = CliFeatureError;\ntype HostFailure = RunReadError | RunDeleteError | RunRecoverError;\nfunction failure(operation: string, cause: unknown): Error {\n const hostFailure = isHostFailure(cause) ? cause : undefined;\n return new CliFeatureError({\n feature: \"run\",\n operation,\n cause,\n exitCode: 1,\n ...(hostFailure === undefined\n ? {}\n : { display: `${hostFailure.code}: ${hostFailure.message}\\n` }),\n });\n}\nfunction isHostFailure(value: unknown): value is HostFailure {\n return typeof value === \"object\" && value !== null &&\n [\"RunReadError\", \"RunDeleteError\", \"RunRecoverError\"].includes(String(Reflect.get(value, \"_tag\")));\n}\nfunction write(channel: \"stdout\" | \"stderr\", text: string) {\n return Effect.flatMap(CliOutput, (output) => channel === \"stdout\" ? output.writeStdout(text) : output.writeStderr(text)).pipe(Effect.mapError((cause) => failure(`write ${channel}`, cause)));\n}\nfunction invocationFacts() {\n return Effect.flatMap(CliInvocationFacts, ({ facts }) => facts).pipe(Effect.mapError((cause) => failure(\"read invocation facts\", cause)));\n}\nfunction writeJson(value: unknown) {\n const encoded = canonicalJsonValue(value);\n return Result.isFailure(encoded)\n ? Effect.fail(failure(\"encode JSON\", encoded.failure))\n : write(\"stdout\", encoded.success);\n}\nfunction usage(message: string) {\n return write(\"stderr\", `${message}\\n`).pipe(Effect.as(1));\n}\nfunction unsupportedOption(parsed: CliParsedTokens, allowed: readonly string[]): string | undefined {\n const permitted = new Set([...allowed, \"help\"]);\n return Object.entries(parsed.values).find(([name, value]) => value !== undefined && !permitted.has(name))?.[0];\n}\nfunction runCommand(argv: readonly string[]): Effect.Effect<number, Error, Requirements> {\n return Effect.gen(function* () {\n const parser = yield* CliArguments;\n const parsed = yield* Effect.try({\n try: () => parser.parse(argv, RUN_CLI_OPTIONS),\n catch: (cause) => failure(\"parse arguments\", cause),\n });\n if (parsed.values.help === true) {\n yield* write(\"stdout\", `niceeval run — inspect and manage Run lifecycle\n\nUsage:\n niceeval run list [--invocation <invocation-id>] [--json]\n niceeval run show <run-id> [--json]\n niceeval run delete <run-id> [--yes] [--json]\n niceeval run recover <run-id> [--yes] [--json]\n`);\n return 0;\n }\n const action = parsed.positionals[0];\n if (action === undefined || ![\"list\", \"show\", \"delete\", \"recover\"].includes(action)) {\n return yield* usage(`niceeval run expects exactly one of list, show, delete, or recover.\n`.trimEnd());\n }\n const facts = yield* invocationFacts();\n const json = parsed.values.json === true;\n if (action === \"list\") {\n if (parsed.positionals.length !== 1) {\n return yield* usage(\"niceeval run list does not accept positional selectors.\");\n }\n const unsupported = unsupportedOption(parsed, [\"invocation\", \"json\"]);\n if (unsupported !== undefined)\n return yield* usage(`--${unsupported} is not valid with niceeval run list.`);\n const listed = yield* rawRunHost.list({\n cwd: facts.cwd,\n ...(typeof parsed.values.invocation === \"string\"\n ? { invocationId: parsed.values.invocation }\n : {}),\n }).pipe(Effect.mapError((cause) => failure(\"list\", cause)));\n if (json) {\n yield* writeJson(Object.freeze({\n protocol: RUN_PROTOCOL,\n operation: \"run.list\",\n runs: listed.runs,\n ...(listed.continuation === undefined\n ? {}\n : { continuation: listed.continuation }),\n }) satisfies RunListDocument);\n return 0;\n }\n if (listed.runs.length === 0) {\n yield* write(\"stdout\", `No Runs found.\n`);\n return 0;\n }\n yield* write(\"stdout\", `${listed.runs.map((run) => `${run.runId} ${run.state} ${run.experimentId} ${run.coverage.published}/${run.coverage.expected} ${new Date(run.startedAt).toISOString()}`).join(\"\\n\")}\\n`);\n return 0;\n }\n if (parsed.positionals.length !== 2) {\n return yield* usage(`niceeval run ${action} requires one exact Run ID.`);\n }\n const runId = parsed.positionals[1]!;\n if (action === \"show\") {\n const unsupported = unsupportedOption(parsed, [\"json\"]);\n if (unsupported !== undefined)\n return yield* usage(`--${unsupported} is not valid with niceeval run show.`);\n const shown = yield* rawRunHost.get({ cwd: facts.cwd, runId }).pipe(Effect.mapError((cause) => failure(\"show\", cause)));\n if (json) {\n yield* writeJson(Object.freeze({\n protocol: RUN_PROTOCOL,\n operation: \"run.get\",\n run: shown.run,\n }) satisfies RunGetDocument);\n }\n else {\n yield* write(\"stdout\", `${shown.run.runId} ${shown.run.state} ${shown.run.experimentId}\\n` +\n `started: ${new Date(shown.run.startedAt).toISOString()}\\n` +\n (shown.run.completedAt === undefined\n ? \"\"\n : `completed: ${new Date(shown.run.completedAt).toISOString()}\\n`) +\n `coverage: ${shown.run.coverage.published}/${shown.run.coverage.expected}\\n`);\n }\n return 0;\n }\n const unsupported = unsupportedOption(parsed, [\"json\", \"yes\"]);\n if (unsupported !== undefined)\n return yield* usage(`--${unsupported} is not valid with niceeval run ${action}.`);\n if (parsed.values.yes !== true) {\n if (json) {\n yield* writeJson(Object.freeze({\n protocol: RUN_PROTOCOL,\n operation: `run.${action}`,\n outcome: \"confirmation-required\",\n runId,\n }));\n }\n else {\n yield* write(\"stderr\", `Run ${runId} is selected for ${action}. Review it, then rerun with --yes.\n`);\n }\n return 1;\n }\n if (action === \"delete\") {\n const receipt = yield* rawRunHost.delete({ cwd: facts.cwd, runId }).pipe(Effect.mapError((cause) => failure(\"delete\", cause)));\n if (json)\n yield* writeJson(Object.freeze({ protocol: RUN_PROTOCOL, operation: \"run.delete\", ...receipt }));\n else\n yield* write(\"stdout\", `Deleted Run ${receipt.runId}.\n`);\n return 0;\n }\n const receipt = yield* rawRunHost.recover({ cwd: facts.cwd, runId }).pipe(Effect.mapError((cause) => failure(\"recover\", cause)));\n if (json)\n yield* writeJson(Object.freeze({ protocol: RUN_PROTOCOL, operation: \"run.recover\", ...receipt }));\n else\n yield* write(\"stdout\", `Recovered Run ${receipt.runId} as interrupted.\n`);\n return 0;\n });\n}\nexport const runCliCommand: CliCommandContribution<Requirements, Error> = Object.freeze({\n name: \"run\",\n summary: \"inspect and manage Run lifecycle\",\n options: RUN_CLI_OPTIONS,\n run: runCommand,\n});\n"]}
@@ -1,9 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RunRecoverError = exports.RunReadError = exports.RunDeleteError = exports.runHost = void 0;
4
- /** Public high-level Run lifecycle Host. SQLite and writer capabilities stay internal. */
5
- var runtime_ts_1 = require("./runtime.cjs");
6
- Object.defineProperty(exports, "runHost", { enumerable: true, get: function () { return runtime_ts_1.runHost; } });
4
+ /** Public Node composition edge for the high-level Run lifecycle Host. SQLite and writer capabilities stay internal. */
5
+ const effect_1 = require("effect");
6
+ const project_state_database_ts_1 = require("../../record/sqlite/project-state-database.cjs");
7
+ const runtime_ts_1 = require("./runtime.cjs");
8
+ const list = (request) => effect_1.Effect.suspend(() => runtime_ts_1.rawRunHost.list(request)).pipe(effect_1.Effect.provide(project_state_database_ts_1.ProjectStateDatabaseLive, { local: true }));
9
+ const get = (request) => effect_1.Effect.suspend(() => runtime_ts_1.rawRunHost.get(request)).pipe(effect_1.Effect.provide(project_state_database_ts_1.ProjectStateDatabaseLive, { local: true }));
10
+ const deleteRun = (request) => effect_1.Effect.suspend(() => runtime_ts_1.rawRunHost.delete(request)).pipe(effect_1.Effect.provide(project_state_database_ts_1.ProjectStateDatabaseLive, { local: true }));
11
+ const recover = (request) => effect_1.Effect.suspend(() => runtime_ts_1.rawRunHost.recover(request)).pipe(effect_1.Effect.provide(project_state_database_ts_1.ProjectStateDatabaseLive, { local: true }));
12
+ exports.runHost = Object.freeze({
13
+ list,
14
+ get,
15
+ delete: deleteRun,
16
+ recover,
17
+ });
7
18
  var types_ts_1 = require("./types.cjs");
8
19
  Object.defineProperty(exports, "RunDeleteError", { enumerable: true, get: function () { return types_ts_1.RunDeleteError; } });
9
20
  Object.defineProperty(exports, "RunReadError", { enumerable: true, get: function () { return types_ts_1.RunReadError; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,0FAA0F;AAC1F,2CAAuC;AAA9B,qGAAA,OAAO,OAAA;AAChB,uCAAmU;AAA1T,0GAAA,cAAc,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,2GAAA,eAAe,OAAA","sourcesContent":["/** Public high-level Run lifecycle Host. SQLite and writer capabilities stay internal. */\nexport { runHost } from \"./runtime.ts\";\nexport { RunDeleteError, RunReadError, RunRecoverError, type RunDeleteReceipt, type RunDeleteRequest, type RunGetRequest, type RunHost, type RunDetail, type RunListRequest, type RunListResult, type RunSlot, type RunState, type RunSummary, type RunRecoverReceipt, type RunRecoverRequest, type RunResult, } from \"./types.ts\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,wHAAwH;AACxH,mCAAgC;AAChC,6FAAyF;AACzF,6CAA0C;AAE1C,MAAM,IAAI,GAAoB,CAAC,OAAO,EAAE,EAAE,CAAC,eAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,uBAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,OAAO,CAAC,oDAAwB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAC1J,MAAM,GAAG,GAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,eAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,uBAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,OAAO,CAAC,oDAAwB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACvJ,MAAM,SAAS,GAAsB,CAAC,OAAO,EAAE,EAAE,CAAC,eAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,uBAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,OAAO,CAAC,oDAAwB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACnK,MAAM,OAAO,GAAuB,CAAC,OAAO,EAAE,EAAE,CAAC,eAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,uBAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,OAAO,CAAC,oDAAwB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACtJ,QAAA,OAAO,GAAY,MAAM,CAAC,MAAM,CAAC;IAC1C,IAAI;IACJ,GAAG;IACH,MAAM,EAAE,SAAS;IACjB,OAAO;CACV,CAAC,CAAC;AACH,uCAAmU;AAA1T,0GAAA,cAAc,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,2GAAA,eAAe,OAAA","sourcesContent":["/** Public Node composition edge for the high-level Run lifecycle Host. SQLite and writer capabilities stay internal. */\nimport { Effect } from \"effect\";\nimport { ProjectStateDatabaseLive } from \"../../record/sqlite/project-state-database.ts\";\nimport { rawRunHost } from \"./runtime.ts\";\nimport type { RunHost } from \"./types.ts\";\nconst list: RunHost[\"list\"] = (request) => Effect.suspend(() => rawRunHost.list(request)).pipe(Effect.provide(ProjectStateDatabaseLive, { local: true }));\nconst get: RunHost[\"get\"] = (request) => Effect.suspend(() => rawRunHost.get(request)).pipe(Effect.provide(ProjectStateDatabaseLive, { local: true }));\nconst deleteRun: RunHost[\"delete\"] = (request) => Effect.suspend(() => rawRunHost.delete(request)).pipe(Effect.provide(ProjectStateDatabaseLive, { local: true }));\nconst recover: RunHost[\"recover\"] = (request) => Effect.suspend(() => rawRunHost.recover(request)).pipe(Effect.provide(ProjectStateDatabaseLive, { local: true }));\nexport const runHost: RunHost = Object.freeze({\n list,\n get,\n delete: deleteRun,\n recover,\n});\nexport { RunDeleteError, RunReadError, RunRecoverError, type RunDeleteReceipt, type RunDeleteRequest, type RunGetRequest, type RunHost, type RunDetail, type RunListRequest, type RunListResult, type RunSlot, type RunState, type RunSummary, type RunRecoverReceipt, type RunRecoverRequest, type RunResult, } from \"./types.ts\";\n"]}
@@ -1,3 +1,3 @@
1
- /** Public high-level Run lifecycle Host. SQLite and writer capabilities stay internal. */
2
- export { runHost } from "./runtime.cjs";
1
+ import type { RunHost } from "./types.cjs";
2
+ export declare const runHost: RunHost;
3
3
  export { RunDeleteError, RunReadError, RunRecoverError, type RunDeleteReceipt, type RunDeleteRequest, type RunGetRequest, type RunHost, type RunDetail, type RunListRequest, type RunListResult, type RunSlot, type RunState, type RunSummary, type RunRecoverReceipt, type RunRecoverRequest, type RunResult, } from "./types.cjs";
@@ -1,3 +1,3 @@
1
- /** Public high-level Run lifecycle Host. SQLite and writer capabilities stay internal. */
2
- export { runHost } from "./runtime.mjs";
1
+ import type { RunHost } from "./types.mjs";
2
+ export declare const runHost: RunHost;
3
3
  export { RunDeleteError, RunReadError, RunRecoverError, type RunDeleteReceipt, type RunDeleteRequest, type RunGetRequest, type RunHost, type RunDetail, type RunListRequest, type RunListResult, type RunSlot, type RunState, type RunSummary, type RunRecoverReceipt, type RunRecoverRequest, type RunResult, } from "./types.mjs";