niceeval 0.19.0 → 0.19.1-canary.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INDEX.md +1 -1
- package/dist/assertions/record/codec.cjs +19 -13
- package/dist/assertions/record/codec.cjs.map +1 -1
- package/dist/assertions/record/codec.d.cts +2 -0
- package/dist/assertions/record/codec.d.mts +2 -0
- package/dist/assertions/record/codec.d.ts +2 -0
- package/dist/assertions/record/codec.js +16 -14
- package/dist/inspection/assertion-projection.cjs +4 -1
- package/dist/inspection/assertion-projection.cjs.map +1 -1
- package/dist/inspection/cli/contribution.cjs +18 -14
- package/dist/inspection/cli/contribution.cjs.map +1 -1
- package/dist/inspection/cli/contribution.d.cts +7 -0
- package/dist/inspection/cli/contribution.d.mts +7 -0
- package/dist/inspection/cli/contribution.d.ts +7 -0
- package/dist/inspection/overview.cjs +28 -14
- package/dist/inspection/overview.cjs.map +1 -1
- package/dist/inspection/overview.d.cts +151 -18
- package/dist/inspection/overview.d.mts +151 -18
- package/dist/inspection/overview.d.ts +151 -18
- package/dist/inspection/overview.js +4 -2
- package/dist/inspection/project-result.d.cts +148 -148
- package/dist/inspection/project-result.d.mts +148 -148
- package/dist/inspection/project-result.d.ts +148 -148
- package/dist/inspection/protocol-values.cjs +1 -1
- package/dist/inspection/protocol-values.cjs.map +1 -1
- package/dist/inspection/protocol-values.d.cts +1 -1
- package/dist/inspection/protocol-values.d.mts +1 -1
- package/dist/inspection/protocol-values.d.ts +1 -1
- package/dist/inspection/protocol.d.cts +611 -479
- package/dist/inspection/protocol.d.mts +611 -479
- package/dist/inspection/protocol.d.ts +611 -479
- package/dist/inspection/public.cjs +3 -1
- package/dist/inspection/public.cjs.map +1 -1
- package/dist/inspection/public.d.cts +1 -0
- package/dist/inspection/public.d.mts +1 -0
- package/dist/inspection/public.d.ts +1 -0
- package/dist/inspection/public.js +18 -16
- package/dist/inspection/public.mjs +54 -52
- package/dist/inspection/results.cjs +11 -15
- package/dist/inspection/results.cjs.map +1 -1
- package/dist/inspection/results.d.cts +769 -324
- package/dist/inspection/results.d.mts +769 -324
- package/dist/inspection/results.d.ts +769 -324
- package/dist/inspection/results.js +4 -0
- package/dist/inspection/select.cjs +12 -72
- package/dist/inspection/select.cjs.map +1 -1
- package/dist/inspection/verdict.cjs +61 -0
- package/dist/inspection/verdict.cjs.map +1 -0
- package/dist/inspection/verdict.d.cts +3 -0
- package/dist/inspection/verdict.d.mts +3 -0
- package/dist/inspection/verdict.d.ts +3 -0
- package/dist/inspection/verdict.js +6 -0
- package/dist/inspection/verdict.js.map +1 -0
- package/dist/runner/discover.cjs +5 -4
- package/dist/runner/discover.cjs.map +1 -1
- package/dist/sandbox/index.cjs +4 -2
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.d.cts +2 -0
- package/dist/sandbox/index.d.mts +2 -0
- package/dist/sandbox/index.d.ts +2 -0
- package/dist/sandbox/index.js +34 -32
- package/dist/sandbox/index.mjs +34 -32
- package/dist/sandbox/opensandbox/managed-process.cjs +224 -0
- package/dist/sandbox/opensandbox/managed-process.cjs.map +1 -0
- package/dist/sandbox/opensandbox/managed-process.d.cts +9 -0
- package/dist/sandbox/opensandbox/managed-process.d.mts +9 -0
- package/dist/sandbox/opensandbox/managed-process.d.ts +9 -0
- package/dist/sandbox/opensandbox/managed-process.js +6 -0
- package/dist/sandbox/opensandbox/managed-process.js.map +1 -0
- package/dist/sandbox/opensandbox/materialize.cjs +25 -0
- package/dist/sandbox/opensandbox/materialize.cjs.map +1 -0
- package/dist/sandbox/opensandbox/materialize.d.cts +4 -0
- package/dist/sandbox/opensandbox/materialize.d.mts +4 -0
- package/dist/sandbox/opensandbox/materialize.d.ts +4 -0
- package/dist/sandbox/opensandbox/materialize.js +6 -0
- package/dist/sandbox/opensandbox/materialize.js.map +1 -0
- package/dist/sandbox/opensandbox/process-bridge.cjs +89 -0
- package/dist/sandbox/opensandbox/process-bridge.cjs.map +1 -0
- package/dist/sandbox/opensandbox/process-bridge.d.cts +2 -0
- package/dist/sandbox/opensandbox/process-bridge.d.mts +2 -0
- package/dist/sandbox/opensandbox/process-bridge.d.ts +2 -0
- package/dist/sandbox/opensandbox/process-bridge.js +6 -0
- package/dist/sandbox/opensandbox/process-bridge.js.map +1 -0
- package/dist/sandbox/opensandbox/sandbox.cjs +253 -0
- package/dist/sandbox/opensandbox/sandbox.cjs.map +1 -0
- package/dist/sandbox/opensandbox/sandbox.d.cts +51 -0
- package/dist/sandbox/opensandbox/sandbox.d.mts +51 -0
- package/dist/sandbox/opensandbox/sandbox.d.ts +51 -0
- package/dist/sandbox/opensandbox/sandbox.js +6 -0
- package/dist/sandbox/opensandbox/sandbox.js.map +1 -0
- package/dist/sandbox/opensandbox.cjs +88 -0
- package/dist/sandbox/opensandbox.cjs.map +1 -0
- package/dist/sandbox/opensandbox.d.cts +17 -0
- package/dist/sandbox/opensandbox.d.mts +17 -0
- package/dist/sandbox/opensandbox.d.ts +17 -0
- package/dist/sandbox/opensandbox.js +6 -0
- package/dist/sandbox/opensandbox.js.map +1 -0
- package/dist/sandbox/runtime.cjs +1 -0
- package/dist/sandbox/runtime.cjs.map +1 -1
- package/dist/sandbox/runtime.d.cts +2 -0
- package/dist/sandbox/runtime.d.mts +2 -0
- package/dist/sandbox/runtime.d.ts +2 -0
- package/dist/sandbox/runtime.js +2 -0
- package/dist/sandbox/types.cjs.map +1 -1
- package/dist/sandbox/types.d.cts +1 -1
- package/dist/sandbox/types.d.mts +1 -1
- package/dist/sandbox/types.d.ts +1 -1
- package/dist/show/model.cjs +6 -5
- package/dist/show/model.cjs.map +1 -1
- package/dist/show/model.d.cts +1 -1
- package/dist/show/model.d.mts +1 -1
- package/dist/show/model.d.ts +1 -1
- package/dist/show/render.cjs +2 -2
- package/dist/show/render.cjs.map +1 -1
- package/dist/view/app-dist/.vite/manifest.json +2 -2
- package/dist/view/app-dist/assets/{index-CxrOUvHC.js → index-f9ZKc4km.js} +16 -16
- package/dist/view/app-dist/assets/{quality-cost-scatter-B6Aiss7x.js → quality-cost-scatter-C6lsrigr.js} +1 -1
- package/dist/view/app-dist/index.html +1 -1
- package/dist/view/function-runtime.mjs +126 -118
- package/dist/view/http-protocol.d.cts +1 -1
- package/dist/view/http-protocol.d.mts +1 -1
- package/dist/view/http-protocol.d.ts +1 -1
- package/dist/view/inspection-host.d.cts +625 -493
- package/dist/view/inspection-host.d.mts +625 -493
- package/dist/view/inspection-host.d.ts +625 -493
- package/docs-site/zh/explanation/evals.mdx +4 -0
- package/docs-site/zh/reference/cli.mdx +45 -4
- package/docs-site/zh/tutorials/compare-runs.mdx +1 -1
- package/docs-site/zh/tutorials/niceeval-taste.mdx +34 -1
- package/docs-site/zh/tutorials/sandbox-providers.mdx +35 -4
- package/docs-site/zh/tutorials/upgrade-0-19.mdx +1 -1
- package/docs-site/zh/tutorials/viewing-results.mdx +36 -3
- package/package.json +6 -1
|
@@ -75,18 +75,20 @@ const __niceevalExport35 = __niceevalCanonical["SealedAssertionResultSchema"];
|
|
|
75
75
|
export { __niceevalExport35 as SealedAssertionResultSchema };
|
|
76
76
|
const __niceevalExport36 = __niceevalCanonical["ThirdPartyCriterionSchema"];
|
|
77
77
|
export { __niceevalExport36 as ThirdPartyCriterionSchema };
|
|
78
|
-
const __niceevalExport37 = __niceevalCanonical["
|
|
79
|
-
export { __niceevalExport37 as
|
|
80
|
-
const __niceevalExport38 = __niceevalCanonical["
|
|
81
|
-
export { __niceevalExport38 as
|
|
82
|
-
const __niceevalExport39 = __niceevalCanonical["
|
|
83
|
-
export { __niceevalExport39 as
|
|
84
|
-
const __niceevalExport40 = __niceevalCanonical["
|
|
85
|
-
export { __niceevalExport40 as
|
|
86
|
-
const __niceevalExport41 = __niceevalCanonical["
|
|
87
|
-
export { __niceevalExport41 as
|
|
88
|
-
const __niceevalExport42 = __niceevalCanonical["
|
|
89
|
-
export { __niceevalExport42 as
|
|
90
|
-
const __niceevalExport43 = __niceevalCanonical["
|
|
91
|
-
export { __niceevalExport43 as
|
|
78
|
+
const __niceevalExport37 = __niceevalCanonical["createAssertionFactValueSchema"];
|
|
79
|
+
export { __niceevalExport37 as createAssertionFactValueSchema };
|
|
80
|
+
const __niceevalExport38 = __niceevalCanonical["createAssertionsRecordSchemas"];
|
|
81
|
+
export { __niceevalExport38 as createAssertionsRecordSchemas };
|
|
82
|
+
const __niceevalExport39 = __niceevalCanonical["decodeAssertionsDocument"];
|
|
83
|
+
export { __niceevalExport39 as decodeAssertionsDocument };
|
|
84
|
+
const __niceevalExport40 = __niceevalCanonical["decodeAssertionsDocumentOuter"];
|
|
85
|
+
export { __niceevalExport40 as decodeAssertionsDocumentOuter };
|
|
86
|
+
const __niceevalExport41 = __niceevalCanonical["isAssertionsRawDataGraph"];
|
|
87
|
+
export { __niceevalExport41 as isAssertionsRawDataGraph };
|
|
88
|
+
const __niceevalExport42 = __niceevalCanonical["isBoundedJsonObject"];
|
|
89
|
+
export { __niceevalExport42 as isBoundedJsonObject };
|
|
90
|
+
const __niceevalExport43 = __niceevalCanonical["makeThirdPartyCriterionRegistry"];
|
|
91
|
+
export { __niceevalExport43 as makeThirdPartyCriterionRegistry };
|
|
92
|
+
const __niceevalExport44 = __niceevalCanonical["projectAssertionsDocument"];
|
|
93
|
+
export { __niceevalExport44 as projectAssertionsDocument };
|
|
92
94
|
//# sourceMappingURL=codec.js.map
|
|
@@ -166,10 +166,13 @@ const ProjectedLocatorSchema = effect_1.Schema.Union([
|
|
|
166
166
|
effect_1.Schema.Struct({ kind: effect_1.Schema.Literal("tool-occurrence"), toolOccurrenceId: effect_1.Schema.String }),
|
|
167
167
|
effect_1.Schema.Struct({ kind: effect_1.Schema.Literal("event"), eventId: effect_1.Schema.String }),
|
|
168
168
|
]);
|
|
169
|
+
// Agent Turns source text is already captured under its own limits. It is not a
|
|
170
|
+
// persisted assertion fact; the Inspection operation owns the response budget.
|
|
171
|
+
const SourceRowFactValueSchema = (0, codec_ts_1.createAssertionFactValueSchema)(effect_1.Schema.String);
|
|
169
172
|
const MatcherRowSchema = effect_1.Schema.Struct({
|
|
170
173
|
kind: effect_1.Schema.Literals(["tool", "event", "legacy-source-row"]), rowId: effect_1.Schema.String,
|
|
171
174
|
number: effect_1.Schema.String, phase: effect_1.Schema.Literals(["at-evaluation", "outside-evaluation-snapshot", "historical"]),
|
|
172
|
-
summary: effect_1.Schema.String, detail:
|
|
175
|
+
summary: effect_1.Schema.String, detail: SourceRowFactValueSchema,
|
|
173
176
|
locator: effect_1.Schema.optional(ProjectedLocatorSchema),
|
|
174
177
|
evaluation: effect_1.Schema.Struct({
|
|
175
178
|
result: effect_1.Schema.Literals(["matched", "mismatched", "unavailable", "not-evaluated", "not-retained", "outside-snapshot", "legacy"]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertion-projection.js","sourceRoot":"","sources":["assertion-projection.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,4DAAiV;AACjV,8DAAiF;AAEjF,2DAAsD;AAEtD,MAAM,qBAAqB,GAAG,eAAM,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,eAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,eAAM,CAAC,MAAM;IAC7D,MAAM,EAAE,eAAM,CAAC,MAAM,EAAE,MAAM,EAAE,eAAM,CAAC,MAAM;CAC/C,CAAC,CAAC;AACH,MAAM,qBAAqB,GAAG,eAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,eAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,eAAM,CAAC,MAAM,EAAE,MAAM,EAAE,eAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AACtI,MAAM,uBAAuB,GAAG,eAAM,CAAC,KAAK,CAAC;IACzC,eAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,eAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,MAAM,EAAE,eAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE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C,CAAC;AACU,QAAA,2BAA2B,GAAG,eAAM,CAAC,MAAM,CAAC,eAAM,CAAC,KAAK,CAAC;IAClE,eAAM,CAAC,MAAM,CAAC;QACV,OAAO,EAAE,eAAM,CAAC,MAAM;QACtB,KAAK,EAAE,eAAM,CAAC,QAAQ,CAAC,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;QACnD,MAAM,EAAE,eAAM,CAAC,QAAQ,CAAC,eAAM,CAAC,KAAK,CAAC,eAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,2CAA+B,EAAE,IAAI,EAAE,eAAM,CAAC,KAAK,CAAC,eAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAClI,WAAW,EAAE,eAAM,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,oBAAoB;KAC5F,CAAC;IACF,eAAM,CAAC,MAAM,CAAC;QACV,OAAO,EAAE,iCAAsB;QAC/B,OAAO,EAAE,eAAM,CAAC,MAAM,CAAC,iCAAsB,CAAC,EAAE,KAAK,EAAE,eAAM,CAAC,MAAM,CAAC,6BAA6B,CAAC;QACnG,WAAW,EAAE,eAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,uBAAuB;KACtH,CAAC;CACL,CAAC,CAAC,CAAC","sourcesContent":["import { Schema } from \"effect\";\nimport { AssertionCollectionReceiptSchema, AssertionConditionValueSchema, AssertionDisplaySchema, AssertionEntryIdSchema, AssertionFactValueSchema, createAssertionsRecordSchemas, MatcherOrderedSequenceResultSchema, MatcherQueryStepSchema, MatcherSourceSnapshotSchema, OrderEvaluationReceiptSchema, } from \"../assertions/record/codec.ts\";\nimport { RecordAttachmentIssueCodeSchema } from \"../record/attachment/errors.ts\";\nimport type { ScoreMatchAudit, ScoreMatchAuditReadResult, ScoreMatchAuditV2, ScoreMatchAuditV3 } from \"../assertions/score-match-audit.ts\";\nimport { isJsonValue } from \"../shared/json-value.ts\";\nimport type { JsonValue } from \"../shared/types.ts\";\nconst ExpandedContentSchema = Schema.Struct({\n state: Schema.Literal(\"available\"), byteLength: Schema.Number,\n sha256: Schema.String, base64: Schema.String,\n});\nconst DeferredContentSchema = Schema.Struct({ state: Schema.Literal(\"available\"), byteLength: Schema.Number, sha256: Schema.String });\nconst ProjectedMaterialSchema = Schema.Union([\n Schema.Struct({ kind: Schema.Literal(\"unavailable\"), reason: Schema.Literal(\"not-recorded\") }),\n Schema.Struct({\n kind: Schema.Literal(\"content\"), content: Schema.Union([ExpandedContentSchema, DeferredContentSchema]),\n encoding: Schema.Literals([\"json\", \"utf-8\", \"binary\"]),\n byteLength: Schema.Number, preview: Schema.NullOr(Schema.String),\n }),\n]);\nconst JudgeMaterialReadResultSchema = Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"available\"), request: Schema.String }),\n Schema.Struct({ state: Schema.Literal(\"invalid\") }),\n Schema.Struct({ state: Schema.Literal(\"unsupported\"), schemaVersion: Schema.Number }),\n]);\nconst AuditFailureSchema = Schema.Struct({ state: Schema.Literals([\"unavailable\", \"errored\"]), code: Schema.String, message: Schema.String });\nconst AuditAttemptSchema = Schema.Struct({\n ordinal: Schema.Number,\n transport: Schema.Literal(\"attempted\"),\n result: Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"returned\"), response: Schema.String }),\n Schema.Struct({ state: Schema.Literal(\"failed\"), code: Schema.String, message: Schema.String }),\n Schema.Struct({ state: Schema.Literal(\"interrupted\") }),\n ]),\n});\nconst JsonValueSchema = Schema.declare<JsonValue>(isJsonValue);\nconst AuditCallSchema = Schema.Union([\n Schema.Struct({\n ordinal: Schema.Number, operation: Schema.Literals([\"score\", \"classify\", \"extract\", \"batchClassify\"]),\n state: Schema.Literal(\"rejected\"), transport: Schema.Literal(\"not-sent\"), failure: AuditFailureSchema,\n }),\n Schema.Struct({\n ordinal: Schema.Number, operation: Schema.Literals([\"score\", \"classify\", \"extract\", \"batchClassify\"]),\n state: Schema.Literal(\"admitted\"), request: Schema.String, attempts: Schema.Array(AuditAttemptSchema),\n result: Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"completed\"), output: Schema.String }),\n AuditFailureSchema,\n Schema.Struct({ state: Schema.Literal(\"interrupted\") }),\n ]),\n }),\n]);\nconst ScoreMatchAuditSchema: Schema.Schema<ScoreMatchAudit> = Schema.Struct({\n schemaVersion: Schema.Literal(1), protocol: Schema.Literal(\"niceeval.score-match-audit/v1\"),\n definition: Schema.Struct({\n name: Schema.String, version: Schema.String, config: Schema.String, digest: Schema.String,\n limits: Schema.Struct({ maxCalls: Schema.Number, maxMaterialBytes: Schema.Number, maxAuditBytes: Schema.Number }),\n }),\n input: Schema.String, calls: Schema.Array(AuditCallSchema),\n result: Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"measured\"), value: Schema.Number }),\n AuditFailureSchema,\n Schema.Struct({ state: Schema.Literal(\"interrupted\") }),\n ]),\n});\nconst ScoreInputSchema = Schema.Struct({\n rubric: Schema.String,\n anchors: Schema.Array(Schema.Struct({ measurement: Schema.Number, description: Schema.String })),\n material: JsonValueSchema,\n});\nconst ClassifyInputSchema = Schema.Struct({ rubric: Schema.String, choices: Schema.Array(Schema.String), material: JsonValueSchema });\nconst BatchClassifyInputSchema = Schema.Struct({\n rubric: Schema.String,\n choices: Schema.Array(Schema.String),\n items: Schema.Array(Schema.Struct({ id: Schema.String, text: Schema.String })),\n material: JsonValueSchema,\n});\nconst TypeSafeMappingSchema = Schema.Union([\n Schema.Struct({ operation: Schema.Literal(\"score\"), input: ScoreInputSchema }),\n Schema.Struct({ operation: Schema.Literal(\"classify\"), input: ClassifyInputSchema }),\n Schema.Struct({ operation: Schema.Literal(\"batchClassify\"), input: BatchClassifyInputSchema }),\n]);\nconst TypeSafeAuditCallSchema = Schema.Union([\n Schema.Struct({\n ordinal: Schema.Number, operation: Schema.Literals([\"score\", \"classify\", \"extract\", \"batchClassify\"]),\n state: Schema.Literal(\"rejected\"), transport: Schema.Literal(\"not-sent\"), failure: AuditFailureSchema,\n }),\n Schema.Struct({\n ordinal: Schema.Number, operation: Schema.Literals([\"score\", \"classify\", \"batchClassify\"]),\n state: Schema.Literal(\"admitted\"), request: Schema.String, attempts: Schema.Array(AuditAttemptSchema),\n mapping: TypeSafeMappingSchema,\n result: Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"completed\"), output: Schema.String }),\n AuditFailureSchema,\n Schema.Struct({ state: Schema.Literal(\"interrupted\") }),\n ]),\n }),\n]);\nconst ScoreMatchAuditV2Schema: Schema.Schema<ScoreMatchAuditV2> = Schema.Struct({\n schemaVersion: Schema.Literal(2), protocol: Schema.Literal(\"niceeval.score-match-audit/v2\"),\n definition: Schema.Struct({\n name: Schema.String, version: Schema.String, config: Schema.String, digest: Schema.String,\n limits: Schema.Struct({ maxCalls: Schema.Number, maxMaterialBytes: Schema.Number, maxAuditBytes: Schema.Number }),\n }),\n input: Schema.String, calls: Schema.Array(TypeSafeAuditCallSchema),\n result: Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"measured\"), value: Schema.Number }),\n AuditFailureSchema,\n Schema.Struct({ state: Schema.Literal(\"interrupted\") }),\n ]),\n});\nconst ScoreMatchAuditV3Schema: Schema.Schema<ScoreMatchAuditV3> = Schema.Struct({\n schemaVersion: Schema.Literal(3), protocol: Schema.Literal(\"niceeval.score-match-audit/v3\"),\n definition: Schema.Struct({ name: Schema.String, version: Schema.String, config: Schema.String, digest: Schema.String,\n limits: Schema.Struct({ maxCalls: Schema.Number, maxMaterialBytes: Schema.Number, maxAuditBytes: Schema.Number }) }),\n input: Schema.String,\n images: Schema.Array(Schema.Struct({ imageId: Schema.String, evidenceIndex: Schema.Number,\n mediaType: Schema.Literals([\"image/png\", \"image/jpeg\"]), byteLength: Schema.Number, sha256: Schema.String,\n paths: Schema.Array(Schema.String) })),\n calls: Schema.Array(Schema.Union([\n Schema.Struct({ ordinal: Schema.Number, operation: Schema.Literals([\"score\", \"classify\", \"extract\", \"batchClassify\"]),\n state: Schema.Literal(\"rejected\"), transport: Schema.Literal(\"not-sent\"), failure: AuditFailureSchema }),\n Schema.Struct({ ordinal: Schema.Number, operation: Schema.Literals([\"score\", \"classify\", \"extract\", \"batchClassify\"]),\n state: Schema.Literal(\"admitted\"), requestTemplate: Schema.String,\n wireBody: Schema.Struct({ byteLength: Schema.Number, sha256: Schema.String }), attempts: Schema.Array(AuditAttemptSchema),\n result: AuditCallSchema.members[1]!.fields.result }),\n ])),\n result: Schema.Union([Schema.Struct({ state: Schema.Literal(\"measured\"), value: Schema.Number }), AuditFailureSchema,\n Schema.Struct({ state: Schema.Literal(\"interrupted\") })]),\n});\nconst ScoreMatchAuditReadResultSchema: Schema.Schema<ScoreMatchAuditReadResult> = Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"available\"), audit: Schema.Union([ScoreMatchAuditSchema, ScoreMatchAuditV2Schema, ScoreMatchAuditV3Schema]) }),\n Schema.Struct({ state: Schema.Literal(\"invalid\") }),\n Schema.Struct({ state: Schema.Literal(\"unsupported\"), schemaVersion: Schema.Number }),\n]);\nconst BaseProjectedAssertionEntrySchema = createAssertionsRecordSchemas(ProjectedMaterialSchema).entry;\nconst ProjectedAssertionEntrySchema = Schema.Struct({\n ...BaseProjectedAssertionEntrySchema.fields,\n judgeMaterial: Schema.optional(JudgeMaterialReadResultSchema),\n scoreMatchAudit: Schema.optional(ScoreMatchAuditReadResultSchema),\n});\nconst ProjectedSourceSiteSchema = Schema.Struct({\n entryId: AssertionEntryIdSchema, sourceOrder: Schema.Number,\n role: Schema.Literals([\"declaration\", \"threshold\", \"score\", \"gate\", \"optional\", \"stop\"]),\n source: Schema.Struct({ sourceItemId: Schema.String, sha256: Schema.String }),\n start: Schema.Struct({ line: Schema.Number, column: Schema.Number }),\n end: Schema.Struct({ line: Schema.Number, column: Schema.Number }),\n});\nconst DiagnosticValueSchema = Schema.Union([AssertionFactValueSchema, AssertionConditionValueSchema]);\nconst DiagnosticReasonSchema = Schema.Literals([\n \"condition-not-met\", \"evidence-unavailable\", \"source-unavailable\", \"redacted\",\n \"evaluator-failed\", \"producer-interrupted\", \"invalid-subject\", \"coverage-not-applicable\",\n \"not-recorded\", \"not-declared\",\n]);\nconst DiagnosticNodeSchema: Schema.Schema<{\n readonly label: string;\n readonly state: string;\n readonly expected: typeof DiagnosticValueSchema.Type | null;\n readonly observed: typeof AssertionFactValueSchema.Type | null;\n readonly reason: typeof DiagnosticReasonSchema.Type | null;\n readonly anchor: typeof AssertionFactValueSchema.Type | null;\n readonly children: readonly DiagnosticNode[];\n}> = Schema.suspend(() => Schema.Struct({\n label: Schema.String, state: Schema.String,\n expected: Schema.NullOr(DiagnosticValueSchema), observed: Schema.NullOr(AssertionFactValueSchema),\n reason: Schema.NullOr(DiagnosticReasonSchema), anchor: Schema.NullOr(AssertionFactValueSchema),\n children: Schema.Array(DiagnosticNodeSchema),\n}));\ntype DiagnosticNode = typeof DiagnosticNodeSchema.Type;\nconst UnavailableReasonSchema = Schema.Literals([\"historical-not-recorded\", \"source-unavailable\", \"ambiguous\"]);\nconst ConversationTargetSchema = Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"exact\"), turnId: Schema.String, eventId: Schema.String, anchor: Schema.String }),\n Schema.Struct({ state: Schema.Literal(\"unavailable\"), reason: UnavailableReasonSchema }),\n]);\nconst ProjectedLocatorSchema = Schema.Union([\n Schema.Struct({ kind: Schema.Literal(\"tool-occurrence\"), toolOccurrenceId: Schema.String }),\n Schema.Struct({ kind: Schema.Literal(\"event\"), eventId: Schema.String }),\n]);\nconst MatcherRowSchema = Schema.Struct({\n kind: Schema.Literals([\"tool\", \"event\", \"legacy-source-row\"]), rowId: Schema.String,\n number: Schema.String, phase: Schema.Literals([\"at-evaluation\", \"outside-evaluation-snapshot\", \"historical\"]),\n summary: Schema.String, detail: AssertionFactValueSchema,\n locator: Schema.optional(ProjectedLocatorSchema),\n evaluation: Schema.Struct({\n result: Schema.Literals([\"matched\", \"mismatched\", \"unavailable\", \"not-evaluated\", \"not-retained\", \"outside-snapshot\", \"legacy\"]),\n difference: Schema.optional(AssertionFactValueSchema),\n }),\n conversationTarget: ConversationTargetSchema,\n});\nconst MatcherSourceCollectionSchema = Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"unavailable\"), reason: UnavailableReasonSchema, rows: Schema.Tuple([]), limitations: Schema.Tuple([]) }),\n Schema.Struct({ state: Schema.Literals([\"complete\", \"partial\"]), rows: Schema.Array(MatcherRowSchema), limitations: Schema.Array(AssertionFactValueSchema) }),\n]);\nconst ProjectedQuerySchema = Schema.Union([\n Schema.Struct({ kind: Schema.Literal(\"collection-filter\"), summary: AssertionFactValueSchema }),\n Schema.Struct({ kind: Schema.Literal(\"ordered-sequence\"), summaries: Schema.Array(AssertionFactValueSchema) }),\n]);\nconst ProjectedOrderStepSchema = Schema.Struct({\n step: Schema.Number, summary: AssertionFactValueSchema,\n state: Schema.Literals([\"matched\", \"possible\", \"blocked\", \"not-reached\"]),\n sourceRow: Schema.optional(Schema.String), conversationTarget: Schema.optional(ConversationTargetSchema),\n});\nconst MatcherDebuggerSchema = Schema.Union([\n Schema.Struct({\n state: Schema.Literal(\"legacy\"), subject: Schema.Literals([\"tool\", \"event\", \"source-row\"]),\n query: Schema.Struct({ state: Schema.Literal(\"unavailable\"), reason: Schema.Literal(\"historical-not-recorded\") }),\n source: Schema.Struct({ final: MatcherSourceCollectionSchema, atEvaluation: MatcherSourceCollectionSchema }),\n identityRelation: Schema.Struct({ state: Schema.Literal(\"unavailable\"), reason: Schema.Literal(\"historical-not-recorded\") }),\n overlayRetention: Schema.Literal(\"unavailable\"), steps: Schema.Tuple([]),\n legacyDiagnostic: Schema.optional(AssertionFactValueSchema),\n }),\n Schema.Struct({\n state: Schema.Literal(\"current\"), subject: Schema.Literals([\"tool\", \"event\", \"source-row\"]),\n query: ProjectedQuerySchema,\n receipt: Schema.Union([AssertionCollectionReceiptSchema, OrderEvaluationReceiptSchema]),\n source: Schema.Struct({ final: MatcherSourceCollectionSchema, atEvaluation: MatcherSourceCollectionSchema }),\n identityRelation: Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"exact\") }),\n Schema.Struct({ state: Schema.Literal(\"unavailable\"), reason: Schema.Literals([\"source-unavailable\", \"ambiguous\"]) }),\n ]),\n overlayRetention: Schema.Literals([\"complete\", \"partial\", \"unavailable\"]),\n steps: Schema.Array(ProjectedOrderStepSchema),\n }),\n]);\nconst SandboxCommandJoinSchema = Schema.Struct({ state: Schema.Literal(\"unavailable\"), reason: Schema.Literal(\"not-recorded\") });\nconst MissingMatcherSchema = Schema.Struct({\n state: Schema.Literal(\"missing\"), sourceState: Schema.Literals([\"not-recorded\", \"invalid\"]),\n comparator: Schema.Null, sourceLedger: Schema.Null, receipt: Schema.Null, result: Schema.Null,\n targets: Schema.Tuple([]), debugger: Schema.Null, sandboxCommandJoin: SandboxCommandJoinSchema,\n});\nconst MatcherProjectionSchema = Schema.Union([\n MissingMatcherSchema,\n Schema.Struct({\n state: Schema.Literal(\"ordinary\"), sourceState: Schema.Null, comparator: Schema.Null,\n sourceLedger: Schema.NullOr(AssertionCollectionReceiptSchema), receipt: Schema.NullOr(AssertionCollectionReceiptSchema),\n result: Schema.Null, targets: Schema.Tuple([]), debugger: Schema.Null,\n sandboxCommandJoin: SandboxCommandJoinSchema,\n }),\n Schema.Struct({\n state: Schema.Literal(\"legacy\"), sourceState: Schema.Literal(\"unavailable\"), comparator: Schema.Null,\n sourceLedger: Schema.Null, receipt: Schema.Null, result: Schema.Null, targets: Schema.Tuple([]),\n reason: Schema.Literal(\"historical-not-recorded\"), debugger: MatcherDebuggerSchema,\n sandboxCommandJoin: SandboxCommandJoinSchema,\n }),\n Schema.Struct({\n state: Schema.Literal(\"available\"), sourceState: Schema.Literals([\"complete\", \"partial\", \"unavailable\"]),\n comparator: Schema.NullOr(Schema.Union([MatcherQueryStepSchema, Schema.Array(MatcherQueryStepSchema)])),\n sourceLedger: Schema.Struct({\n sourceSnapshot: MatcherSourceSnapshotSchema,\n receipt: Schema.Union([AssertionCollectionReceiptSchema, OrderEvaluationReceiptSchema]),\n }),\n receipt: Schema.Union([AssertionCollectionReceiptSchema, OrderEvaluationReceiptSchema]),\n result: Schema.NullOr(MatcherOrderedSequenceResultSchema),\n targets: Schema.Array(Schema.Struct({\n state: Schema.Literals([\"matched\", \"mismatched\", \"unavailable\", \"not-evaluated\"]),\n anchor: ProjectedLocatorSchema, difference: Schema.NullOr(AssertionFactValueSchema),\n })),\n debugger: MatcherDebuggerSchema, sandboxCommandJoin: SandboxCommandJoinSchema,\n }),\n]);\nexport const AssertionDetailResultSchema = Schema.toType(Schema.Union([\n Schema.Struct({\n entryId: Schema.String,\n state: Schema.Literals([\"not-recorded\", \"invalid\"]),\n issues: Schema.optional(Schema.Array(Schema.Struct({ code: RecordAttachmentIssueCodeSchema, path: Schema.Array(Schema.String) }))),\n sourceSites: Schema.Tuple([]), check: DiagnosticNodeSchema, matcher: MissingMatcherSchema,\n }),\n Schema.Struct({\n entryId: AssertionEntryIdSchema,\n display: Schema.toType(AssertionDisplaySchema), entry: Schema.toType(ProjectedAssertionEntrySchema),\n sourceSites: Schema.Array(ProjectedSourceSiteSchema), check: DiagnosticNodeSchema, matcher: MatcherProjectionSchema,\n }),\n]));\nexport type AssertionDetailResult = typeof AssertionDetailResultSchema.Type;\n"]}
|
|
1
|
+
{"version":3,"file":"assertion-projection.js","sourceRoot":"","sources":["assertion-projection.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,4DAAiX;AACjX,8DAAiF;AAEjF,2DAAsD;AAEtD,MAAM,qBAAqB,GAAG,eAAM,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,eAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,eAAM,CAAC,MAAM;IAC7D,MAAM,EAAE,eAAM,CAAC,MAAM,EAAE,MAAM,EAAE,eAAM,CAAC,MAAM;CAC/C,CAAC,CAAC;AACH,MAAM,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CAAC,KAAK,CAAC,yBAAyB,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,uBAAuB;KACtH,CAAC;CACL,CAAC,CAAC,CAAC","sourcesContent":["import { Schema } from \"effect\";\nimport { AssertionCollectionReceiptSchema, AssertionConditionValueSchema, AssertionDisplaySchema, AssertionEntryIdSchema, AssertionFactValueSchema, createAssertionFactValueSchema, createAssertionsRecordSchemas, MatcherOrderedSequenceResultSchema, MatcherQueryStepSchema, MatcherSourceSnapshotSchema, OrderEvaluationReceiptSchema, } from \"../assertions/record/codec.ts\";\nimport { RecordAttachmentIssueCodeSchema } from \"../record/attachment/errors.ts\";\nimport type { ScoreMatchAudit, ScoreMatchAuditReadResult, ScoreMatchAuditV2, ScoreMatchAuditV3 } from \"../assertions/score-match-audit.ts\";\nimport { isJsonValue } from \"../shared/json-value.ts\";\nimport type { JsonValue } from \"../shared/types.ts\";\nconst ExpandedContentSchema = Schema.Struct({\n state: Schema.Literal(\"available\"), byteLength: Schema.Number,\n sha256: Schema.String, base64: Schema.String,\n});\nconst DeferredContentSchema = Schema.Struct({ state: Schema.Literal(\"available\"), byteLength: Schema.Number, sha256: Schema.String });\nconst ProjectedMaterialSchema = Schema.Union([\n Schema.Struct({ kind: Schema.Literal(\"unavailable\"), reason: Schema.Literal(\"not-recorded\") }),\n Schema.Struct({\n kind: Schema.Literal(\"content\"), content: Schema.Union([ExpandedContentSchema, DeferredContentSchema]),\n encoding: Schema.Literals([\"json\", \"utf-8\", \"binary\"]),\n byteLength: Schema.Number, preview: Schema.NullOr(Schema.String),\n }),\n]);\nconst JudgeMaterialReadResultSchema = Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"available\"), request: Schema.String }),\n Schema.Struct({ state: Schema.Literal(\"invalid\") }),\n Schema.Struct({ state: Schema.Literal(\"unsupported\"), schemaVersion: Schema.Number }),\n]);\nconst AuditFailureSchema = Schema.Struct({ state: Schema.Literals([\"unavailable\", \"errored\"]), code: Schema.String, message: Schema.String });\nconst AuditAttemptSchema = Schema.Struct({\n ordinal: Schema.Number,\n transport: Schema.Literal(\"attempted\"),\n result: Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"returned\"), response: Schema.String }),\n Schema.Struct({ state: Schema.Literal(\"failed\"), code: Schema.String, message: Schema.String }),\n Schema.Struct({ state: Schema.Literal(\"interrupted\") }),\n ]),\n});\nconst JsonValueSchema = Schema.declare<JsonValue>(isJsonValue);\nconst AuditCallSchema = Schema.Union([\n Schema.Struct({\n ordinal: Schema.Number, operation: Schema.Literals([\"score\", \"classify\", \"extract\", \"batchClassify\"]),\n state: Schema.Literal(\"rejected\"), transport: Schema.Literal(\"not-sent\"), failure: AuditFailureSchema,\n }),\n Schema.Struct({\n ordinal: Schema.Number, operation: Schema.Literals([\"score\", \"classify\", \"extract\", \"batchClassify\"]),\n state: Schema.Literal(\"admitted\"), request: Schema.String, attempts: Schema.Array(AuditAttemptSchema),\n result: Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"completed\"), output: Schema.String }),\n AuditFailureSchema,\n Schema.Struct({ state: Schema.Literal(\"interrupted\") }),\n ]),\n }),\n]);\nconst ScoreMatchAuditSchema: Schema.Schema<ScoreMatchAudit> = Schema.Struct({\n schemaVersion: Schema.Literal(1), protocol: Schema.Literal(\"niceeval.score-match-audit/v1\"),\n definition: Schema.Struct({\n name: Schema.String, version: Schema.String, config: Schema.String, digest: Schema.String,\n limits: Schema.Struct({ maxCalls: Schema.Number, maxMaterialBytes: Schema.Number, maxAuditBytes: Schema.Number }),\n }),\n input: Schema.String, calls: Schema.Array(AuditCallSchema),\n result: Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"measured\"), value: Schema.Number }),\n AuditFailureSchema,\n Schema.Struct({ state: Schema.Literal(\"interrupted\") }),\n ]),\n});\nconst ScoreInputSchema = Schema.Struct({\n rubric: Schema.String,\n anchors: Schema.Array(Schema.Struct({ measurement: Schema.Number, description: Schema.String })),\n material: JsonValueSchema,\n});\nconst ClassifyInputSchema = Schema.Struct({ rubric: Schema.String, choices: Schema.Array(Schema.String), material: JsonValueSchema });\nconst BatchClassifyInputSchema = Schema.Struct({\n rubric: Schema.String,\n choices: Schema.Array(Schema.String),\n items: Schema.Array(Schema.Struct({ id: Schema.String, text: Schema.String })),\n material: JsonValueSchema,\n});\nconst TypeSafeMappingSchema = Schema.Union([\n Schema.Struct({ operation: Schema.Literal(\"score\"), input: ScoreInputSchema }),\n Schema.Struct({ operation: Schema.Literal(\"classify\"), input: ClassifyInputSchema }),\n Schema.Struct({ operation: Schema.Literal(\"batchClassify\"), input: BatchClassifyInputSchema }),\n]);\nconst TypeSafeAuditCallSchema = Schema.Union([\n Schema.Struct({\n ordinal: Schema.Number, operation: Schema.Literals([\"score\", \"classify\", \"extract\", \"batchClassify\"]),\n state: Schema.Literal(\"rejected\"), transport: Schema.Literal(\"not-sent\"), failure: AuditFailureSchema,\n }),\n Schema.Struct({\n ordinal: Schema.Number, operation: Schema.Literals([\"score\", \"classify\", \"batchClassify\"]),\n state: Schema.Literal(\"admitted\"), request: Schema.String, attempts: Schema.Array(AuditAttemptSchema),\n mapping: TypeSafeMappingSchema,\n result: Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"completed\"), output: Schema.String }),\n AuditFailureSchema,\n Schema.Struct({ state: Schema.Literal(\"interrupted\") }),\n ]),\n }),\n]);\nconst ScoreMatchAuditV2Schema: Schema.Schema<ScoreMatchAuditV2> = Schema.Struct({\n schemaVersion: Schema.Literal(2), protocol: Schema.Literal(\"niceeval.score-match-audit/v2\"),\n definition: Schema.Struct({\n name: Schema.String, version: Schema.String, config: Schema.String, digest: Schema.String,\n limits: Schema.Struct({ maxCalls: Schema.Number, maxMaterialBytes: Schema.Number, maxAuditBytes: Schema.Number }),\n }),\n input: Schema.String, calls: Schema.Array(TypeSafeAuditCallSchema),\n result: Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"measured\"), value: Schema.Number }),\n AuditFailureSchema,\n Schema.Struct({ state: Schema.Literal(\"interrupted\") }),\n ]),\n});\nconst ScoreMatchAuditV3Schema: Schema.Schema<ScoreMatchAuditV3> = Schema.Struct({\n schemaVersion: Schema.Literal(3), protocol: Schema.Literal(\"niceeval.score-match-audit/v3\"),\n definition: Schema.Struct({ name: Schema.String, version: Schema.String, config: Schema.String, digest: Schema.String,\n limits: Schema.Struct({ maxCalls: Schema.Number, maxMaterialBytes: Schema.Number, maxAuditBytes: Schema.Number }) }),\n input: Schema.String,\n images: Schema.Array(Schema.Struct({ imageId: Schema.String, evidenceIndex: Schema.Number,\n mediaType: Schema.Literals([\"image/png\", \"image/jpeg\"]), byteLength: Schema.Number, sha256: Schema.String,\n paths: Schema.Array(Schema.String) })),\n calls: Schema.Array(Schema.Union([\n Schema.Struct({ ordinal: Schema.Number, operation: Schema.Literals([\"score\", \"classify\", \"extract\", \"batchClassify\"]),\n state: Schema.Literal(\"rejected\"), transport: Schema.Literal(\"not-sent\"), failure: AuditFailureSchema }),\n Schema.Struct({ ordinal: Schema.Number, operation: Schema.Literals([\"score\", \"classify\", \"extract\", \"batchClassify\"]),\n state: Schema.Literal(\"admitted\"), requestTemplate: Schema.String,\n wireBody: Schema.Struct({ byteLength: Schema.Number, sha256: Schema.String }), attempts: Schema.Array(AuditAttemptSchema),\n result: AuditCallSchema.members[1]!.fields.result }),\n ])),\n result: Schema.Union([Schema.Struct({ state: Schema.Literal(\"measured\"), value: Schema.Number }), AuditFailureSchema,\n Schema.Struct({ state: Schema.Literal(\"interrupted\") })]),\n});\nconst ScoreMatchAuditReadResultSchema: Schema.Schema<ScoreMatchAuditReadResult> = Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"available\"), audit: Schema.Union([ScoreMatchAuditSchema, ScoreMatchAuditV2Schema, ScoreMatchAuditV3Schema]) }),\n Schema.Struct({ state: Schema.Literal(\"invalid\") }),\n Schema.Struct({ state: Schema.Literal(\"unsupported\"), schemaVersion: Schema.Number }),\n]);\nconst BaseProjectedAssertionEntrySchema = createAssertionsRecordSchemas(ProjectedMaterialSchema).entry;\nconst ProjectedAssertionEntrySchema = Schema.Struct({\n ...BaseProjectedAssertionEntrySchema.fields,\n judgeMaterial: Schema.optional(JudgeMaterialReadResultSchema),\n scoreMatchAudit: Schema.optional(ScoreMatchAuditReadResultSchema),\n});\nconst ProjectedSourceSiteSchema = Schema.Struct({\n entryId: AssertionEntryIdSchema, sourceOrder: Schema.Number,\n role: Schema.Literals([\"declaration\", \"threshold\", \"score\", \"gate\", \"optional\", \"stop\"]),\n source: Schema.Struct({ sourceItemId: Schema.String, sha256: Schema.String }),\n start: Schema.Struct({ line: Schema.Number, column: Schema.Number }),\n end: Schema.Struct({ line: Schema.Number, column: Schema.Number }),\n});\nconst DiagnosticValueSchema = Schema.Union([AssertionFactValueSchema, AssertionConditionValueSchema]);\nconst DiagnosticReasonSchema = Schema.Literals([\n \"condition-not-met\", \"evidence-unavailable\", \"source-unavailable\", \"redacted\",\n \"evaluator-failed\", \"producer-interrupted\", \"invalid-subject\", \"coverage-not-applicable\",\n \"not-recorded\", \"not-declared\",\n]);\nconst DiagnosticNodeSchema: Schema.Schema<{\n readonly label: string;\n readonly state: string;\n readonly expected: typeof DiagnosticValueSchema.Type | null;\n readonly observed: typeof AssertionFactValueSchema.Type | null;\n readonly reason: typeof DiagnosticReasonSchema.Type | null;\n readonly anchor: typeof AssertionFactValueSchema.Type | null;\n readonly children: readonly DiagnosticNode[];\n}> = Schema.suspend(() => Schema.Struct({\n label: Schema.String, state: Schema.String,\n expected: Schema.NullOr(DiagnosticValueSchema), observed: Schema.NullOr(AssertionFactValueSchema),\n reason: Schema.NullOr(DiagnosticReasonSchema), anchor: Schema.NullOr(AssertionFactValueSchema),\n children: Schema.Array(DiagnosticNodeSchema),\n}));\ntype DiagnosticNode = typeof DiagnosticNodeSchema.Type;\nconst UnavailableReasonSchema = Schema.Literals([\"historical-not-recorded\", \"source-unavailable\", \"ambiguous\"]);\nconst ConversationTargetSchema = Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"exact\"), turnId: Schema.String, eventId: Schema.String, anchor: Schema.String }),\n Schema.Struct({ state: Schema.Literal(\"unavailable\"), reason: UnavailableReasonSchema }),\n]);\nconst ProjectedLocatorSchema = Schema.Union([\n Schema.Struct({ kind: Schema.Literal(\"tool-occurrence\"), toolOccurrenceId: Schema.String }),\n Schema.Struct({ kind: Schema.Literal(\"event\"), eventId: Schema.String }),\n]);\n// Agent Turns source text is already captured under its own limits. It is not a\n// persisted assertion fact; the Inspection operation owns the response budget.\nconst SourceRowFactValueSchema = createAssertionFactValueSchema(Schema.String);\nconst MatcherRowSchema = Schema.Struct({\n kind: Schema.Literals([\"tool\", \"event\", \"legacy-source-row\"]), rowId: Schema.String,\n number: Schema.String, phase: Schema.Literals([\"at-evaluation\", \"outside-evaluation-snapshot\", \"historical\"]),\n summary: Schema.String, detail: SourceRowFactValueSchema,\n locator: Schema.optional(ProjectedLocatorSchema),\n evaluation: Schema.Struct({\n result: Schema.Literals([\"matched\", \"mismatched\", \"unavailable\", \"not-evaluated\", \"not-retained\", \"outside-snapshot\", \"legacy\"]),\n difference: Schema.optional(AssertionFactValueSchema),\n }),\n conversationTarget: ConversationTargetSchema,\n});\nconst MatcherSourceCollectionSchema = Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"unavailable\"), reason: UnavailableReasonSchema, rows: Schema.Tuple([]), limitations: Schema.Tuple([]) }),\n Schema.Struct({ state: Schema.Literals([\"complete\", \"partial\"]), rows: Schema.Array(MatcherRowSchema), limitations: Schema.Array(AssertionFactValueSchema) }),\n]);\nconst ProjectedQuerySchema = Schema.Union([\n Schema.Struct({ kind: Schema.Literal(\"collection-filter\"), summary: AssertionFactValueSchema }),\n Schema.Struct({ kind: Schema.Literal(\"ordered-sequence\"), summaries: Schema.Array(AssertionFactValueSchema) }),\n]);\nconst ProjectedOrderStepSchema = Schema.Struct({\n step: Schema.Number, summary: AssertionFactValueSchema,\n state: Schema.Literals([\"matched\", \"possible\", \"blocked\", \"not-reached\"]),\n sourceRow: Schema.optional(Schema.String), conversationTarget: Schema.optional(ConversationTargetSchema),\n});\nconst MatcherDebuggerSchema = Schema.Union([\n Schema.Struct({\n state: Schema.Literal(\"legacy\"), subject: Schema.Literals([\"tool\", \"event\", \"source-row\"]),\n query: Schema.Struct({ state: Schema.Literal(\"unavailable\"), reason: Schema.Literal(\"historical-not-recorded\") }),\n source: Schema.Struct({ final: MatcherSourceCollectionSchema, atEvaluation: MatcherSourceCollectionSchema }),\n identityRelation: Schema.Struct({ state: Schema.Literal(\"unavailable\"), reason: Schema.Literal(\"historical-not-recorded\") }),\n overlayRetention: Schema.Literal(\"unavailable\"), steps: Schema.Tuple([]),\n legacyDiagnostic: Schema.optional(AssertionFactValueSchema),\n }),\n Schema.Struct({\n state: Schema.Literal(\"current\"), subject: Schema.Literals([\"tool\", \"event\", \"source-row\"]),\n query: ProjectedQuerySchema,\n receipt: Schema.Union([AssertionCollectionReceiptSchema, OrderEvaluationReceiptSchema]),\n source: Schema.Struct({ final: MatcherSourceCollectionSchema, atEvaluation: MatcherSourceCollectionSchema }),\n identityRelation: Schema.Union([\n Schema.Struct({ state: Schema.Literal(\"exact\") }),\n Schema.Struct({ state: Schema.Literal(\"unavailable\"), reason: Schema.Literals([\"source-unavailable\", \"ambiguous\"]) }),\n ]),\n overlayRetention: Schema.Literals([\"complete\", \"partial\", \"unavailable\"]),\n steps: Schema.Array(ProjectedOrderStepSchema),\n }),\n]);\nconst SandboxCommandJoinSchema = Schema.Struct({ state: Schema.Literal(\"unavailable\"), reason: Schema.Literal(\"not-recorded\") });\nconst MissingMatcherSchema = Schema.Struct({\n state: Schema.Literal(\"missing\"), sourceState: Schema.Literals([\"not-recorded\", \"invalid\"]),\n comparator: Schema.Null, sourceLedger: Schema.Null, receipt: Schema.Null, result: Schema.Null,\n targets: Schema.Tuple([]), debugger: Schema.Null, sandboxCommandJoin: SandboxCommandJoinSchema,\n});\nconst MatcherProjectionSchema = Schema.Union([\n MissingMatcherSchema,\n Schema.Struct({\n state: Schema.Literal(\"ordinary\"), sourceState: Schema.Null, comparator: Schema.Null,\n sourceLedger: Schema.NullOr(AssertionCollectionReceiptSchema), receipt: Schema.NullOr(AssertionCollectionReceiptSchema),\n result: Schema.Null, targets: Schema.Tuple([]), debugger: Schema.Null,\n sandboxCommandJoin: SandboxCommandJoinSchema,\n }),\n Schema.Struct({\n state: Schema.Literal(\"legacy\"), sourceState: Schema.Literal(\"unavailable\"), comparator: Schema.Null,\n sourceLedger: Schema.Null, receipt: Schema.Null, result: Schema.Null, targets: Schema.Tuple([]),\n reason: Schema.Literal(\"historical-not-recorded\"), debugger: MatcherDebuggerSchema,\n sandboxCommandJoin: SandboxCommandJoinSchema,\n }),\n Schema.Struct({\n state: Schema.Literal(\"available\"), sourceState: Schema.Literals([\"complete\", \"partial\", \"unavailable\"]),\n comparator: Schema.NullOr(Schema.Union([MatcherQueryStepSchema, Schema.Array(MatcherQueryStepSchema)])),\n sourceLedger: Schema.Struct({\n sourceSnapshot: MatcherSourceSnapshotSchema,\n receipt: Schema.Union([AssertionCollectionReceiptSchema, OrderEvaluationReceiptSchema]),\n }),\n receipt: Schema.Union([AssertionCollectionReceiptSchema, OrderEvaluationReceiptSchema]),\n result: Schema.NullOr(MatcherOrderedSequenceResultSchema),\n targets: Schema.Array(Schema.Struct({\n state: Schema.Literals([\"matched\", \"mismatched\", \"unavailable\", \"not-evaluated\"]),\n anchor: ProjectedLocatorSchema, difference: Schema.NullOr(AssertionFactValueSchema),\n })),\n debugger: MatcherDebuggerSchema, sandboxCommandJoin: SandboxCommandJoinSchema,\n }),\n]);\nexport const AssertionDetailResultSchema = Schema.toType(Schema.Union([\n Schema.Struct({\n entryId: Schema.String,\n state: Schema.Literals([\"not-recorded\", \"invalid\"]),\n issues: Schema.optional(Schema.Array(Schema.Struct({ code: RecordAttachmentIssueCodeSchema, path: Schema.Array(Schema.String) }))),\n sourceSites: Schema.Tuple([]), check: DiagnosticNodeSchema, matcher: MissingMatcherSchema,\n }),\n Schema.Struct({\n entryId: AssertionEntryIdSchema,\n display: Schema.toType(AssertionDisplaySchema), entry: Schema.toType(ProjectedAssertionEntrySchema),\n sourceSites: Schema.Array(ProjectedSourceSiteSchema), check: DiagnosticNodeSchema, matcher: MatcherProjectionSchema,\n }),\n]));\nexport type AssertionDetailResult = typeof AssertionDetailResultSchema.Type;\n"]}
|
|
@@ -16,7 +16,8 @@ const project_source_ts_1 = require("../project-source.cjs");
|
|
|
16
16
|
const help = (summary) => Object.freeze({ summary, visibility: "public" });
|
|
17
17
|
const option = (value) => Object.freeze(value);
|
|
18
18
|
exports.QUERY_CLI_OPTIONS = Object.freeze({
|
|
19
|
-
request: option({ type: "string", help: help("Read one niceeval.query/
|
|
19
|
+
request: option({ type: "string", help: help("Read one niceeval.query/v3 request from a file or -.") }),
|
|
20
|
+
"request-json": option({ type: "string", help: help("Read one complete niceeval.query/v3 request from an argv value.") }),
|
|
20
21
|
record: option({ type: "string", help: help("Read an external canonical SQLite Record.") }),
|
|
21
22
|
help: option({ type: "boolean", short: "h", help: help("Print query help.") }),
|
|
22
23
|
});
|
|
@@ -24,8 +25,8 @@ const QUERY_HELP = `niceeval query — execute one fixed Inspection operation
|
|
|
24
25
|
|
|
25
26
|
Usage:
|
|
26
27
|
niceeval query discover
|
|
27
|
-
niceeval query explain [--record <file>] --request <file|->
|
|
28
|
-
niceeval query run [--record <file>] --request <file|->
|
|
28
|
+
niceeval query explain [--record <file>] (--request <file|-> | --request-json <document>)
|
|
29
|
+
niceeval query run [--record <file>] (--request <file|-> | --request-json <document>)
|
|
29
30
|
`;
|
|
30
31
|
const QUERY_FAILURE_EXIT_CODE = 2;
|
|
31
32
|
function failure(operation, cause) {
|
|
@@ -56,8 +57,8 @@ function runQuery(argv) {
|
|
|
56
57
|
return yield* usage("niceeval query expects exactly one of discover, explain, or run.");
|
|
57
58
|
}
|
|
58
59
|
if (action === "discover") {
|
|
59
|
-
if (parsed.values.request !== undefined)
|
|
60
|
-
return yield* usage("query discover does not accept
|
|
60
|
+
if (parsed.values.request !== undefined || parsed.values["request-json"] !== undefined)
|
|
61
|
+
return yield* usage("query discover does not accept request options.");
|
|
61
62
|
if (parsed.values.record !== undefined)
|
|
62
63
|
return yield* usage("query discover does not accept --record.");
|
|
63
64
|
const encoded = (0, canonical_ts_1.canonicalJsonValue)(Object.freeze({
|
|
@@ -70,12 +71,15 @@ function runQuery(argv) {
|
|
|
70
71
|
yield* write("stdout", encoded.success);
|
|
71
72
|
return 0;
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
-
|
|
74
|
+
const requestFile = parsed.values.request;
|
|
75
|
+
const requestJson = parsed.values["request-json"];
|
|
76
|
+
if ((requestFile === undefined) === (requestJson === undefined)) {
|
|
77
|
+
return yield* usage(`query ${action} requires exactly one of --request <file|-> or --request-json <document>.`);
|
|
78
|
+
}
|
|
75
79
|
let operation;
|
|
76
80
|
const result = yield* effect_1.Effect.gen(function* () {
|
|
77
81
|
const facts = yield* invocationFacts();
|
|
78
|
-
const request = yield* readQueryRequest(
|
|
82
|
+
const request = yield* readQueryRequest(requestFile, requestJson, facts.cwd);
|
|
79
83
|
operation = request.operation.kind;
|
|
80
84
|
const source = typeof parsed.values.record === "string"
|
|
81
85
|
? (0, index_ts_1.externalInspectionSource)(facts.cwd, parsed.values.record)
|
|
@@ -107,12 +111,12 @@ function runQuery(argv) {
|
|
|
107
111
|
function invocationFacts() {
|
|
108
112
|
return effect_1.Effect.flatMap(application_ts_1.CliInvocationFacts, ({ facts }) => facts).pipe(effect_1.Effect.mapError((cause) => failure("read invocation facts", cause)));
|
|
109
113
|
}
|
|
110
|
-
function readQueryRequest(pathname, cwd) {
|
|
114
|
+
function readQueryRequest(pathname, inline, cwd) {
|
|
111
115
|
return effect_1.Effect.gen(function* () {
|
|
112
|
-
const text = yield* effect_1.Effect.tryPromise({
|
|
116
|
+
const text = inline ?? (yield* effect_1.Effect.tryPromise({
|
|
113
117
|
try: () => pathname === "-" ? readStandardInput() : (0, promises_1.readFile)((0, node_path_1.resolve)(cwd, pathname), "utf8"),
|
|
114
118
|
catch: (cause) => failure("read request", cause),
|
|
115
|
-
});
|
|
119
|
+
}));
|
|
116
120
|
if (Buffer.byteLength(text, "utf8") > 1048576)
|
|
117
121
|
return yield* effect_1.Effect.fail(failure("read request", "request exceeds 1 MiB"));
|
|
118
122
|
const value = yield* effect_1.Effect.try({ try: () => JSON.parse(text), catch: (cause) => failure("parse request JSON", cause) });
|
|
@@ -165,7 +169,7 @@ function writeQueryFailure(error, operation) {
|
|
|
165
169
|
function queryFailureDocument(error, operation) {
|
|
166
170
|
const detail = queryFailureDetail(error);
|
|
167
171
|
return Object.freeze({
|
|
168
|
-
protocol: "niceeval.query/
|
|
172
|
+
protocol: "niceeval.query/v3",
|
|
169
173
|
outcome: "failure",
|
|
170
174
|
operation: operation ?? null,
|
|
171
175
|
failure: Object.freeze(detail),
|
|
@@ -247,7 +251,7 @@ function queryFailureDetail(error) {
|
|
|
247
251
|
return Object.freeze({
|
|
248
252
|
code: cause.code,
|
|
249
253
|
reason: cause.code === "inspection-request-invalid"
|
|
250
|
-
? "The query request does not match niceeval.query/
|
|
254
|
+
? "The query request does not match niceeval.query/v3."
|
|
251
255
|
: "NiceEval could not encode the fixed Inspection result.",
|
|
252
256
|
correction: cause.code === "inspection-request-invalid"
|
|
253
257
|
? "fix-request"
|
|
@@ -258,7 +262,7 @@ function queryFailureDetail(error) {
|
|
|
258
262
|
return requestFailure
|
|
259
263
|
? Object.freeze({
|
|
260
264
|
code: "inspection-request-invalid",
|
|
261
|
-
reason: "The query request could not be read as niceeval.query/
|
|
265
|
+
reason: "The query request could not be read as niceeval.query/v3.",
|
|
262
266
|
correction: "fix-request",
|
|
263
267
|
})
|
|
264
268
|
: Object.freeze({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,yCAAoC;AACpC,mCAAwC;AACxC,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,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7H,OAAO,cAAc;QACjB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;YACZ,IAAI,EAAE,4BAAqC;YAC3C,MAAM,EAAE,2DAA2D;YACnE,UAAU,EAAE,aAAsB;SACrC,CAAC;QACF,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;YACZ,IAAI,EAAE,6BAAsC;YAC5C,MAAM,EAAE,wDAAwD;YAChE,UAAU,EAAE,OAAgB;SAC/B,CAAC,CAAC;AACX,CAAC;AACD,SAAS,wBAAwB,CAAC,KAAc;IAG5C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAC9C,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,4BAA4B;YACxD,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,2BAA2B,CAAC,CAAC;AACxE,CAAC;AACY,QAAA,yBAAyB,GAAgD,MAAM,CAAC,MAAM,CAAC;IAChG,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,4CAA4C;IACrD,OAAO,EAAE,yBAAiB;IAC1B,GAAG,EAAE,QAAQ;CAChB,CAAC,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport { Effect, Result } from \"effect\";\nimport { CliArguments, CliInvocationFacts, CliOutput, type CliOptionDefinition } from \"../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution } from \"../../cli/contribution.ts\";\nimport { decodeInspectionRequest, INSPECTION_OPERATION_IDS, InspectionIntegrityError, InspectionOperationError, InspectionSourceError, QUERY_PROTOCOL, externalInspectionSource, openInspectionSource, operationalInspectionSource, selectInspectionOperation, type InspectionDocument, type InspectionFailureDocument, type InspectionOperationId, type InspectionRequest, } from \"../index.ts\";\nimport { canonicalInspectionJson, canonicalJsonValue } from \"../canonical.ts\";\nimport { explainInspectionOperation } from \"../select.ts\";\nimport { SqliteRecordError } from \"../../record/sqlite/errors.ts\";\nimport { ProjectConfiguration } from \"../../cli/project-configuration.ts\";\nimport { CurrentTargetUnavailable } from \"../../experiment/host/current.ts\";\nimport { openCurrentProjectSource } from \"../project-source.ts\";\nconst help = (summary: string) => Object.freeze({ summary, visibility: \"public\" as const });\nconst option = (value: CliOptionDefinition): CliOptionDefinition => Object.freeze(value);\nexport const QUERY_CLI_OPTIONS = Object.freeze({\n request: option({ type: \"string\", help: help(\"Read one niceeval.query/v2 request from a file or -.\") }),\n record: option({ type: \"string\", help: help(\"Read an external canonical SQLite Record.\") }),\n help: option({ type: \"boolean\", short: \"h\", help: help(\"Print query help.\") }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\nconst QUERY_HELP = `niceeval query — execute one fixed Inspection operation\n\nUsage:\n niceeval query discover\n niceeval query explain [--record <file>] --request <file|->\n niceeval query run [--record <file>] --request <file|->\n`;\ntype Requirements = CliArguments | CliInvocationFacts | CliOutput | ProjectConfiguration;\ntype Error = CliFeatureError;\nconst QUERY_FAILURE_EXIT_CODE = 2;\nfunction failure(operation: string, cause: unknown): Error {\n return new CliFeatureError({ feature: \"inspection query\", operation, cause, exitCode: 1 });\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 usage(message: string) {\n return writeQueryFailure(failure(\"parse arguments\", new Error(message)));\n}\nfunction runQuery(argv: readonly string[]): Effect.Effect<number, Error, Requirements> {\n return Effect.gen(function* () {\n const parser = yield* CliArguments;\n const parsedResult = yield* Effect.try({\n try: () => parser.parse(argv, QUERY_CLI_OPTIONS),\n catch: (cause) => failure(\"parse arguments\", cause),\n }).pipe(Effect.result);\n if (Result.isFailure(parsedResult))\n return yield* writeQueryFailure(parsedResult.failure);\n const parsed = parsedResult.success;\n if (parsed.values.help === true) {\n yield* write(\"stdout\", QUERY_HELP);\n return 0;\n }\n const action = parsed.positionals[0];\n if (parsed.positionals.length !== 1 || (action !== \"discover\" && action !== \"explain\" && action !== \"run\")) {\n return yield* usage(\"niceeval query expects exactly one of discover, explain, or run.\");\n }\n if (action === \"discover\") {\n if (parsed.values.request !== undefined)\n return yield* usage(\"query discover does not accept --request.\");\n if (parsed.values.record !== undefined)\n return yield* usage(\"query discover does not accept --record.\");\n const encoded = canonicalJsonValue(Object.freeze({\n protocol: QUERY_PROTOCOL,\n outcome: \"discovery\" as const,\n operations: INSPECTION_OPERATION_IDS.map((id) => Object.freeze({ id })),\n }));\n if (Result.isFailure(encoded))\n return yield* writeQueryFailure(failure(\"encode discovery\", encoded.failure));\n yield* write(\"stdout\", encoded.success);\n return 0;\n }\n if (typeof parsed.values.request !== \"string\")\n return yield* usage(`query ${action} requires --request <file|->.`);\n let operation: InspectionOperationId | undefined;\n const result = yield* Effect.gen(function* () {\n const facts = yield* invocationFacts();\n const request = yield* readQueryRequest(parsed.values.request as string, facts.cwd);\n operation = request.operation.kind;\n const source = typeof parsed.values.record === \"string\"\n ? externalInspectionSource(facts.cwd, parsed.values.record)\n : operationalInspectionSource(facts.cwd);\n const document = yield* Effect.scoped(Effect.gen(function* () {\n const prepare = request.operation.kind === \"project.get\" && source.kind === \"project-record\"\n ? Effect.gen(function* () {\n const project = yield* ProjectConfiguration;\n const config = yield* project.load(facts.cwd).pipe(Effect.mapError((cause) => new CurrentTargetUnavailable({ code: \"current-target-unavailable\", reason: String(cause), cause })));\n return yield* openCurrentProjectSource({ cwd: facts.cwd, config });\n })\n : openInspectionSource(source);\n const inspectionFacts = yield* prepare.pipe(Effect.mapError((cause) => failure(\"open Record source\", cause)));\n return yield* Effect.try({\n try: () => action === \"explain\"\n ? explainInspectionOperation(inspectionFacts, request.operation)\n : selectInspectionOperation(inspectionFacts, request.operation),\n catch: (cause) => failure(`${action} Inspection operation`, cause),\n });\n }));\n yield* writeDocument(document);\n return 0;\n }).pipe(Effect.result);\n return Result.isSuccess(result)\n ? result.success\n : yield* writeQueryFailure(result.failure, operation);\n });\n}\nfunction invocationFacts() {\n return Effect.flatMap(CliInvocationFacts, ({ facts }) => facts).pipe(Effect.mapError((cause) => failure(\"read invocation facts\", cause)));\n}\nfunction readQueryRequest(pathname: string, cwd: string): Effect.Effect<InspectionRequest, Error> {\n return Effect.gen(function* () {\n const text = yield* Effect.tryPromise({\n try: () => pathname === \"-\" ? readStandardInput() : readFile(resolve(cwd, pathname), \"utf8\"),\n catch: (cause) => failure(\"read request\", cause),\n });\n if (Buffer.byteLength(text, \"utf8\") > 1048576)\n return yield* Effect.fail(failure(\"read request\", \"request exceeds 1 MiB\"));\n const value = yield* Effect.try({ try: () => JSON.parse(text) as unknown, catch: (cause) => failure(\"parse request JSON\", cause) });\n const decoded = decodeInspectionRequest(value);\n return Result.isFailure(decoded) ? yield* Effect.fail(failure(\"decode request\", decoded.failure)) : decoded.success;\n });\n}\nfunction readStandardInput(): Promise<string> {\n return new Promise((resolveInput, rejectInput) => {\n const chunks: Buffer[] = [];\n let byteLength = 0;\n const cleanup = (): void => {\n process.stdin.off(\"data\", onData);\n process.stdin.off(\"end\", onEnd);\n process.stdin.off(\"error\", onError);\n };\n const onData = (chunk: Buffer | string): void => {\n const bytes = typeof chunk === \"string\" ? Buffer.from(chunk) : chunk;\n byteLength += bytes.byteLength;\n if (byteLength > 1048576) {\n cleanup();\n rejectInput(new Error(\"request exceeds 1 MiB\"));\n }\n else\n chunks.push(bytes);\n };\n const onEnd = (): void => { cleanup(); resolveInput(Buffer.concat(chunks).toString(\"utf8\")); };\n const onError = (cause: Error): void => { cleanup(); rejectInput(cause); };\n process.stdin.on(\"data\", onData);\n process.stdin.once(\"end\", onEnd);\n process.stdin.once(\"error\", onError);\n process.stdin.resume();\n });\n}\nfunction writeDocument(document: InspectionDocument) {\n const encoded = canonicalInspectionJson(document);\n return Result.isFailure(encoded) ? Effect.fail(failure(\"encode result\", encoded.failure)) : write(\"stdout\", encoded.success);\n}\nfunction writeQueryFailure(error: Error, operation?: InspectionOperationId): Effect.Effect<number, Error, CliOutput> {\n const document = queryFailureDocument(error, operation);\n const encoded = canonicalJsonValue(document);\n if (Result.isFailure(encoded))\n return Effect.fail(failure(\"encode failure document\", encoded.failure));\n return Effect.gen(function* () {\n yield* write(\"stdout\", encoded.success);\n yield* write(\"stderr\", `niceeval query failed: ${document.failure.code}\\n`);\n return QUERY_FAILURE_EXIT_CODE;\n });\n}\nfunction queryFailureDocument(error: Error, operation?: InspectionOperationId): InspectionFailureDocument {\n const detail = queryFailureDetail(error);\n return Object.freeze({\n protocol: \"niceeval.query/v2\" as const,\n outcome: \"failure\" as const,\n operation: operation ?? null,\n failure: Object.freeze(detail),\n });\n}\nfunction queryFailureDetail(error: Error): InspectionFailureDocument[\"failure\"] {\n const cause = error.cause;\n if (cause instanceof CurrentTargetUnavailable || cause instanceof InspectionOperationError && cause.code === \"current-target-unavailable\")\n return {\n code: \"current-target-unavailable\", reason: `${cause.reason} Use overview.get or an exact run.get to read recorded results.`, correction: \"fix-request\",\n };\n if (cause instanceof InspectionOperationError) {\n if (cause.code === \"inspection-selection-missing\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"choose-existing-selection\" as const,\n });\n }\n if (cause.code === \"inspection-result-invalid\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"upgrade-or-report\" as const,\n });\n }\n if (cause.code === \"inspection-record-integrity-failure\") {\n return Object.freeze({\n code: cause.code,\n reason: \"The selected sealed Run does not form a closed Record publication.\",\n identity: cause.identity,\n correction: \"fix-record-source\" as const,\n });\n }\n if (cause.code === \"restart-required\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"restart\" as const,\n });\n }\n if (cause.code === \"evidence-budget-exceeded\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"retry\" as const,\n });\n }\n return Object.freeze({\n code: cause.code,\n reason: \"The fixed Inspection operation could not be completed.\",\n correction: \"retry\" as const,\n });\n }\n if (cause instanceof InspectionIntegrityError) {\n return Object.freeze({\n code: cause.code,\n reason: \"The selected sealed Run does not form a closed Record publication.\",\n identity: Object.freeze({ runId: cause.runId }),\n correction: \"fix-record-source\" as const,\n });\n }\n if (cause instanceof InspectionSourceError) {\n const recordError = cause.cause instanceof SqliteRecordError ? cause.cause : undefined;\n const operationalFailure = recordError?.code === \"record-write-busy\" || recordError?.code === \"record-resource-limit-exceeded\";\n const migrationRequired = recordError?.code === \"record-schema-migration-required\";\n const diagnostic = recordError === undefined ? cause.reason : `[${recordError.code}; ${recordError.operation}] ${cause.reason}`;\n return Object.freeze({\n code: operationalFailure ? \"inspection-operation-failed\" as const : \"inspection-source-invalid\" as const,\n reason: `The selected Record source could not be opened: ${diagnostic}${migrationRequired\n ? \" Stop old NiceEval processes and run a normal experiment in the original project to upgrade this supported format. External Records are never migrated in place.\"\n : \"\"}`,\n correction: recordError?.code === \"record-write-busy\" ? \"retry\" as const\n : recordError?.code === \"record-resource-limit-exceeded\" || recordError?.code === \"record-runtime-unsupported\"\n ? \"upgrade-or-report\" as const : \"fix-record-source\" as const,\n });\n }\n if (isInspectionCodecFailure(cause)) {\n return Object.freeze({\n code: cause.code,\n reason: cause.code === \"inspection-request-invalid\"\n ? \"The query request does not match niceeval.query/v2.\"\n : \"NiceEval could not encode the fixed Inspection result.\",\n correction: cause.code === \"inspection-request-invalid\"\n ? \"fix-request\" as const\n : \"upgrade-or-report\" as const,\n });\n }\n const requestFailure = [\"parse arguments\", \"read request\", \"parse request JSON\", \"decode request\"].includes(error.operation);\n return requestFailure\n ? Object.freeze({\n code: \"inspection-request-invalid\" as const,\n reason: \"The query request could not be read as niceeval.query/v2.\",\n correction: \"fix-request\" as const,\n })\n : Object.freeze({\n code: \"inspection-operation-failed\" as const,\n reason: \"The fixed Inspection operation could not be completed.\",\n correction: \"retry\" as const,\n });\n}\nfunction isInspectionCodecFailure(value: unknown): value is {\n readonly code: \"inspection-request-invalid\" | \"inspection-result-invalid\";\n} {\n return typeof value === \"object\" && value !== null &&\n (Reflect.get(value, \"code\") === \"inspection-request-invalid\" ||\n Reflect.get(value, \"code\") === \"inspection-result-invalid\");\n}\nexport const inspectionQueryCliCommand: CliCommandContribution<Requirements, Error> = Object.freeze({\n name: \"query\",\n summary: \"run one fixed machine Inspection operation\",\n options: QUERY_CLI_OPTIONS,\n run: runQuery,\n});\n"]}
|
|
1
|
+
{"version":3,"file":"contribution.js","sourceRoot":"","sources":["contribution.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,yCAAoC;AACpC,mCAAwC;AACxC,6DAAiH;AACjH,+DAAyF;AACzF,0CAAiY;AACjY,kDAA8E;AAC9E,4CAA0D;AAC1D,6DAAkE;AAClE,iFAA0E;AAC1E,iEAA4E;AAC5E,4DAAgE;AAChE,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,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,sDAAsD,CAAC,EAAE,CAAC;IACvG,cAAc,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,iEAAiE,CAAC,EAAE,CAAC;IACzH,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,2CAA2C,CAAC,EAAE,CAAC;IAC3F,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GA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AAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,4BAA4B;YACxD,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,2BAA2B,CAAC,CAAC;AACxE,CAAC;AACY,QAAA,yBAAyB,GAAgD,MAAM,CAAC,MAAM,CAAC;IAChG,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,4CAA4C;IACrD,OAAO,EAAE,yBAAiB;IAC1B,GAAG,EAAE,QAAQ;CAChB,CAAC,CAAC","sourcesContent":["import { readFile } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport { Effect, Result } from \"effect\";\nimport { CliArguments, CliInvocationFacts, CliOutput, type CliOptionDefinition } from \"../../cli/application.ts\";\nimport { CliFeatureError, type CliCommandContribution } from \"../../cli/contribution.ts\";\nimport { decodeInspectionRequest, INSPECTION_OPERATION_IDS, InspectionIntegrityError, InspectionOperationError, InspectionSourceError, QUERY_PROTOCOL, externalInspectionSource, openInspectionSource, operationalInspectionSource, selectInspectionOperation, type InspectionDocument, type InspectionFailureDocument, type InspectionOperationId, type InspectionRequest, } from \"../index.ts\";\nimport { canonicalInspectionJson, canonicalJsonValue } from \"../canonical.ts\";\nimport { explainInspectionOperation } from \"../select.ts\";\nimport { SqliteRecordError } from \"../../record/sqlite/errors.ts\";\nimport { ProjectConfiguration } from \"../../cli/project-configuration.ts\";\nimport { CurrentTargetUnavailable } from \"../../experiment/host/current.ts\";\nimport { openCurrentProjectSource } from \"../project-source.ts\";\nconst help = (summary: string) => Object.freeze({ summary, visibility: \"public\" as const });\nconst option = (value: CliOptionDefinition): CliOptionDefinition => Object.freeze(value);\nexport const QUERY_CLI_OPTIONS = Object.freeze({\n request: option({ type: \"string\", help: help(\"Read one niceeval.query/v3 request from a file or -.\") }),\n \"request-json\": option({ type: \"string\", help: help(\"Read one complete niceeval.query/v3 request from an argv value.\") }),\n record: option({ type: \"string\", help: help(\"Read an external canonical SQLite Record.\") }),\n help: option({ type: \"boolean\", short: \"h\", help: help(\"Print query help.\") }),\n} satisfies Readonly<Record<string, CliOptionDefinition>>);\nconst QUERY_HELP = `niceeval query — execute one fixed Inspection operation\n\nUsage:\n niceeval query discover\n niceeval query explain [--record <file>] (--request <file|-> | --request-json <document>)\n niceeval query run [--record <file>] (--request <file|-> | --request-json <document>)\n`;\ntype Requirements = CliArguments | CliInvocationFacts | CliOutput | ProjectConfiguration;\ntype Error = CliFeatureError;\nconst QUERY_FAILURE_EXIT_CODE = 2;\nfunction failure(operation: string, cause: unknown): Error {\n return new CliFeatureError({ feature: \"inspection query\", operation, cause, exitCode: 1 });\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 usage(message: string) {\n return writeQueryFailure(failure(\"parse arguments\", new Error(message)));\n}\nfunction runQuery(argv: readonly string[]): Effect.Effect<number, Error, Requirements> {\n return Effect.gen(function* () {\n const parser = yield* CliArguments;\n const parsedResult = yield* Effect.try({\n try: () => parser.parse(argv, QUERY_CLI_OPTIONS),\n catch: (cause) => failure(\"parse arguments\", cause),\n }).pipe(Effect.result);\n if (Result.isFailure(parsedResult))\n return yield* writeQueryFailure(parsedResult.failure);\n const parsed = parsedResult.success;\n if (parsed.values.help === true) {\n yield* write(\"stdout\", QUERY_HELP);\n return 0;\n }\n const action = parsed.positionals[0];\n if (parsed.positionals.length !== 1 || (action !== \"discover\" && action !== \"explain\" && action !== \"run\")) {\n return yield* usage(\"niceeval query expects exactly one of discover, explain, or run.\");\n }\n if (action === \"discover\") {\n if (parsed.values.request !== undefined || parsed.values[\"request-json\"] !== undefined)\n return yield* usage(\"query discover does not accept request options.\");\n if (parsed.values.record !== undefined)\n return yield* usage(\"query discover does not accept --record.\");\n const encoded = canonicalJsonValue(Object.freeze({\n protocol: QUERY_PROTOCOL,\n outcome: \"discovery\" as const,\n operations: INSPECTION_OPERATION_IDS.map((id) => Object.freeze({ id })),\n }));\n if (Result.isFailure(encoded))\n return yield* writeQueryFailure(failure(\"encode discovery\", encoded.failure));\n yield* write(\"stdout\", encoded.success);\n return 0;\n }\n const requestFile = parsed.values.request;\n const requestJson = parsed.values[\"request-json\"];\n if ((requestFile === undefined) === (requestJson === undefined)) {\n return yield* usage(`query ${action} requires exactly one of --request <file|-> or --request-json <document>.`);\n }\n let operation: InspectionOperationId | undefined;\n const result = yield* Effect.gen(function* () {\n const facts = yield* invocationFacts();\n const request = yield* readQueryRequest(requestFile as string | undefined, requestJson as string | undefined, facts.cwd);\n operation = request.operation.kind;\n const source = typeof parsed.values.record === \"string\"\n ? externalInspectionSource(facts.cwd, parsed.values.record)\n : operationalInspectionSource(facts.cwd);\n const document = yield* Effect.scoped(Effect.gen(function* () {\n const prepare = request.operation.kind === \"project.get\" && source.kind === \"project-record\"\n ? Effect.gen(function* () {\n const project = yield* ProjectConfiguration;\n const config = yield* project.load(facts.cwd).pipe(Effect.mapError((cause) => new CurrentTargetUnavailable({ code: \"current-target-unavailable\", reason: String(cause), cause })));\n return yield* openCurrentProjectSource({ cwd: facts.cwd, config });\n })\n : openInspectionSource(source);\n const inspectionFacts = yield* prepare.pipe(Effect.mapError((cause) => failure(\"open Record source\", cause)));\n return yield* Effect.try({\n try: () => action === \"explain\"\n ? explainInspectionOperation(inspectionFacts, request.operation)\n : selectInspectionOperation(inspectionFacts, request.operation),\n catch: (cause) => failure(`${action} Inspection operation`, cause),\n });\n }));\n yield* writeDocument(document);\n return 0;\n }).pipe(Effect.result);\n return Result.isSuccess(result)\n ? result.success\n : yield* writeQueryFailure(result.failure, operation);\n });\n}\nfunction invocationFacts() {\n return Effect.flatMap(CliInvocationFacts, ({ facts }) => facts).pipe(Effect.mapError((cause) => failure(\"read invocation facts\", cause)));\n}\nfunction readQueryRequest(pathname: string | undefined, inline: string | undefined, cwd: string): Effect.Effect<InspectionRequest, Error> {\n return Effect.gen(function* () {\n const text = inline ?? (yield* Effect.tryPromise({\n try: () => pathname === \"-\" ? readStandardInput() : readFile(resolve(cwd, pathname!), \"utf8\"),\n catch: (cause) => failure(\"read request\", cause),\n }));\n if (Buffer.byteLength(text, \"utf8\") > 1048576)\n return yield* Effect.fail(failure(\"read request\", \"request exceeds 1 MiB\"));\n const value = yield* Effect.try({ try: () => JSON.parse(text) as unknown, catch: (cause) => failure(\"parse request JSON\", cause) });\n const decoded = decodeInspectionRequest(value);\n return Result.isFailure(decoded) ? yield* Effect.fail(failure(\"decode request\", decoded.failure)) : decoded.success;\n });\n}\nfunction readStandardInput(): Promise<string> {\n return new Promise((resolveInput, rejectInput) => {\n const chunks: Buffer[] = [];\n let byteLength = 0;\n const cleanup = (): void => {\n process.stdin.off(\"data\", onData);\n process.stdin.off(\"end\", onEnd);\n process.stdin.off(\"error\", onError);\n };\n const onData = (chunk: Buffer | string): void => {\n const bytes = typeof chunk === \"string\" ? Buffer.from(chunk) : chunk;\n byteLength += bytes.byteLength;\n if (byteLength > 1048576) {\n cleanup();\n rejectInput(new Error(\"request exceeds 1 MiB\"));\n }\n else\n chunks.push(bytes);\n };\n const onEnd = (): void => { cleanup(); resolveInput(Buffer.concat(chunks).toString(\"utf8\")); };\n const onError = (cause: Error): void => { cleanup(); rejectInput(cause); };\n process.stdin.on(\"data\", onData);\n process.stdin.once(\"end\", onEnd);\n process.stdin.once(\"error\", onError);\n process.stdin.resume();\n });\n}\nfunction writeDocument(document: InspectionDocument) {\n const encoded = canonicalInspectionJson(document);\n return Result.isFailure(encoded) ? Effect.fail(failure(\"encode result\", encoded.failure)) : write(\"stdout\", encoded.success);\n}\nfunction writeQueryFailure(error: Error, operation?: InspectionOperationId): Effect.Effect<number, Error, CliOutput> {\n const document = queryFailureDocument(error, operation);\n const encoded = canonicalJsonValue(document);\n if (Result.isFailure(encoded))\n return Effect.fail(failure(\"encode failure document\", encoded.failure));\n return Effect.gen(function* () {\n yield* write(\"stdout\", encoded.success);\n yield* write(\"stderr\", `niceeval query failed: ${document.failure.code}\\n`);\n return QUERY_FAILURE_EXIT_CODE;\n });\n}\nfunction queryFailureDocument(error: Error, operation?: InspectionOperationId): InspectionFailureDocument {\n const detail = queryFailureDetail(error);\n return Object.freeze({\n protocol: \"niceeval.query/v3\" as const,\n outcome: \"failure\" as const,\n operation: operation ?? null,\n failure: Object.freeze(detail),\n });\n}\nfunction queryFailureDetail(error: Error): InspectionFailureDocument[\"failure\"] {\n const cause = error.cause;\n if (cause instanceof CurrentTargetUnavailable || cause instanceof InspectionOperationError && cause.code === \"current-target-unavailable\")\n return {\n code: \"current-target-unavailable\", reason: `${cause.reason} Use overview.get or an exact run.get to read recorded results.`, correction: \"fix-request\",\n };\n if (cause instanceof InspectionOperationError) {\n if (cause.code === \"inspection-selection-missing\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"choose-existing-selection\" as const,\n });\n }\n if (cause.code === \"inspection-result-invalid\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"upgrade-or-report\" as const,\n });\n }\n if (cause.code === \"inspection-record-integrity-failure\") {\n return Object.freeze({\n code: cause.code,\n reason: \"The selected sealed Run does not form a closed Record publication.\",\n identity: cause.identity,\n correction: \"fix-record-source\" as const,\n });\n }\n if (cause.code === \"restart-required\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"restart\" as const,\n });\n }\n if (cause.code === \"evidence-budget-exceeded\") {\n return Object.freeze({\n code: cause.code,\n reason: cause.reason,\n correction: \"retry\" as const,\n });\n }\n return Object.freeze({\n code: cause.code,\n reason: \"The fixed Inspection operation could not be completed.\",\n correction: \"retry\" as const,\n });\n }\n if (cause instanceof InspectionIntegrityError) {\n return Object.freeze({\n code: cause.code,\n reason: \"The selected sealed Run does not form a closed Record publication.\",\n identity: Object.freeze({ runId: cause.runId }),\n correction: \"fix-record-source\" as const,\n });\n }\n if (cause instanceof InspectionSourceError) {\n const recordError = cause.cause instanceof SqliteRecordError ? cause.cause : undefined;\n const operationalFailure = recordError?.code === \"record-write-busy\" || recordError?.code === \"record-resource-limit-exceeded\";\n const migrationRequired = recordError?.code === \"record-schema-migration-required\";\n const diagnostic = recordError === undefined ? cause.reason : `[${recordError.code}; ${recordError.operation}] ${cause.reason}`;\n return Object.freeze({\n code: operationalFailure ? \"inspection-operation-failed\" as const : \"inspection-source-invalid\" as const,\n reason: `The selected Record source could not be opened: ${diagnostic}${migrationRequired\n ? \" Stop old NiceEval processes and run a normal experiment in the original project to upgrade this supported format. External Records are never migrated in place.\"\n : \"\"}`,\n correction: recordError?.code === \"record-write-busy\" ? \"retry\" as const\n : recordError?.code === \"record-resource-limit-exceeded\" || recordError?.code === \"record-runtime-unsupported\"\n ? \"upgrade-or-report\" as const : \"fix-record-source\" as const,\n });\n }\n if (isInspectionCodecFailure(cause)) {\n return Object.freeze({\n code: cause.code,\n reason: cause.code === \"inspection-request-invalid\"\n ? \"The query request does not match niceeval.query/v3.\"\n : \"NiceEval could not encode the fixed Inspection result.\",\n correction: cause.code === \"inspection-request-invalid\"\n ? \"fix-request\" as const\n : \"upgrade-or-report\" as const,\n });\n }\n const requestFailure = [\"parse arguments\", \"read request\", \"parse request JSON\", \"decode request\"].includes(error.operation);\n return requestFailure\n ? Object.freeze({\n code: \"inspection-request-invalid\" as const,\n reason: \"The query request could not be read as niceeval.query/v3.\",\n correction: \"fix-request\" as const,\n })\n : Object.freeze({\n code: \"inspection-operation-failed\" as const,\n reason: \"The fixed Inspection operation could not be completed.\",\n correction: \"retry\" as const,\n });\n}\nfunction isInspectionCodecFailure(value: unknown): value is {\n readonly code: \"inspection-request-invalid\" | \"inspection-result-invalid\";\n} {\n return typeof value === \"object\" && value !== null &&\n (Reflect.get(value, \"code\") === \"inspection-request-invalid\" ||\n Reflect.get(value, \"code\") === \"inspection-result-invalid\");\n}\nexport const inspectionQueryCliCommand: CliCommandContribution<Requirements, Error> = Object.freeze({\n name: \"query\",\n summary: \"run one fixed machine Inspection operation\",\n options: QUERY_CLI_OPTIONS,\n run: runQuery,\n});\n"]}
|
|
@@ -9,6 +9,13 @@ export declare const QUERY_CLI_OPTIONS: Readonly<{
|
|
|
9
9
|
readonly optionalValue?: import("../../cli/application.cjs").CliOptionalOptionValue;
|
|
10
10
|
readonly help?: import("../../cli/application.cjs").CliOptionHelp;
|
|
11
11
|
}>;
|
|
12
|
+
"request-json": Readonly<{
|
|
13
|
+
readonly type: "string" | "boolean";
|
|
14
|
+
readonly multiple?: true;
|
|
15
|
+
readonly short?: string;
|
|
16
|
+
readonly optionalValue?: import("../../cli/application.cjs").CliOptionalOptionValue;
|
|
17
|
+
readonly help?: import("../../cli/application.cjs").CliOptionHelp;
|
|
18
|
+
}>;
|
|
12
19
|
record: Readonly<{
|
|
13
20
|
readonly type: "string" | "boolean";
|
|
14
21
|
readonly multiple?: true;
|
|
@@ -9,6 +9,13 @@ export declare const QUERY_CLI_OPTIONS: Readonly<{
|
|
|
9
9
|
readonly optionalValue?: import("../../cli/application.mjs").CliOptionalOptionValue;
|
|
10
10
|
readonly help?: import("../../cli/application.mjs").CliOptionHelp;
|
|
11
11
|
}>;
|
|
12
|
+
"request-json": Readonly<{
|
|
13
|
+
readonly type: "string" | "boolean";
|
|
14
|
+
readonly multiple?: true;
|
|
15
|
+
readonly short?: string;
|
|
16
|
+
readonly optionalValue?: import("../../cli/application.mjs").CliOptionalOptionValue;
|
|
17
|
+
readonly help?: import("../../cli/application.mjs").CliOptionHelp;
|
|
18
|
+
}>;
|
|
12
19
|
record: Readonly<{
|
|
13
20
|
readonly type: "string" | "boolean";
|
|
14
21
|
readonly multiple?: true;
|
|
@@ -9,6 +9,13 @@ export declare const QUERY_CLI_OPTIONS: Readonly<{
|
|
|
9
9
|
readonly optionalValue?: import("../../cli/application.js").CliOptionalOptionValue;
|
|
10
10
|
readonly help?: import("../../cli/application.js").CliOptionHelp;
|
|
11
11
|
}>;
|
|
12
|
+
"request-json": Readonly<{
|
|
13
|
+
readonly type: "string" | "boolean";
|
|
14
|
+
readonly multiple?: true;
|
|
15
|
+
readonly short?: string;
|
|
16
|
+
readonly optionalValue?: import("../../cli/application.js").CliOptionalOptionValue;
|
|
17
|
+
readonly help?: import("../../cli/application.js").CliOptionHelp;
|
|
18
|
+
}>;
|
|
12
19
|
record: Readonly<{
|
|
13
20
|
readonly type: "string" | "boolean";
|
|
14
21
|
readonly multiple?: true;
|