@executioncontrolprotocol/core 0.14.0 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -36
- package/dist/bindings/extension.d.ts +15 -1
- package/dist/bindings/extension.d.ts.map +1 -1
- package/dist/bindings/extension.js +23 -0
- package/dist/bindings/extension.js.map +1 -1
- package/dist/bindings/policy.d.ts +15 -1
- package/dist/bindings/policy.d.ts.map +1 -1
- package/dist/bindings/policy.js +23 -0
- package/dist/bindings/policy.js.map +1 -1
- package/dist/bindings/step.d.ts +3 -3
- package/dist/bindings/step.d.ts.map +1 -1
- package/dist/compile/extract-workflow-module.d.ts +18 -2
- package/dist/compile/extract-workflow-module.d.ts.map +1 -1
- package/dist/compile/extract-workflow-module.js +39 -10
- package/dist/compile/extract-workflow-module.js.map +1 -1
- package/dist/compile/index.d.ts +4 -13
- package/dist/compile/index.d.ts.map +1 -1
- package/dist/compile/index.js +1 -48
- package/dist/compile/index.js.map +1 -1
- package/dist/compile/types.d.ts +1 -1
- package/dist/compile/types.d.ts.map +1 -1
- package/dist/config/builder.d.ts +39 -0
- package/dist/config/builder.d.ts.map +1 -0
- package/dist/config/builder.js +50 -0
- package/dist/config/builder.js.map +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +2 -0
- package/dist/config/index.js.map +1 -0
- package/dist/definitions/capability.d.ts +3 -2
- package/dist/definitions/capability.d.ts.map +1 -1
- package/dist/definitions/capability.js +4 -3
- package/dist/definitions/capability.js.map +1 -1
- package/dist/definitions/environment.d.ts +38 -0
- package/dist/definitions/environment.d.ts.map +1 -0
- package/dist/definitions/environment.js +77 -0
- package/dist/definitions/environment.js.map +1 -0
- package/dist/definitions/extension.d.ts +16 -4
- package/dist/definitions/extension.d.ts.map +1 -1
- package/dist/definitions/extension.js +27 -6
- package/dist/definitions/extension.js.map +1 -1
- package/dist/definitions/hook.d.ts +1 -1
- package/dist/definitions/hook.d.ts.map +1 -1
- package/dist/definitions/index.d.ts +2 -2
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/index.js +1 -1
- package/dist/definitions/index.js.map +1 -1
- package/dist/definitions/policy.d.ts +8 -0
- package/dist/definitions/policy.d.ts.map +1 -1
- package/dist/definitions/policy.js +16 -0
- package/dist/definitions/policy.js.map +1 -1
- package/dist/definitions/types.d.ts +23 -5
- package/dist/definitions/types.d.ts.map +1 -1
- package/dist/encoding/contracts.js +1 -1
- package/dist/encoding/contracts.js.map +1 -1
- package/dist/encoding/decode-builder.d.ts +1 -1
- package/dist/encoding/decode-builder.d.ts.map +1 -1
- package/dist/encoding/decode-builder.js +1 -9
- package/dist/encoding/decode-builder.js.map +1 -1
- package/dist/encoding/encode-builder.d.ts +1 -1
- package/dist/encoding/encode-builder.d.ts.map +1 -1
- package/dist/encoding/encode-builder.js +1 -1
- package/dist/encoding/encode-builder.js.map +1 -1
- package/dist/encoding/errors.d.ts +2 -2
- package/dist/encoding/errors.d.ts.map +1 -1
- package/dist/encoding/invoke-utility.d.ts +1 -1
- package/dist/encoding/invoke-utility.d.ts.map +1 -1
- package/dist/encoding/invoke-utility.js +1 -1
- package/dist/encoding/invoke-utility.js.map +1 -1
- package/dist/encoding/json-codec.d.ts +1 -1
- package/dist/encoding/json-codec.d.ts.map +1 -1
- package/dist/encoding/json-codec.js +1 -1
- package/dist/encoding/json-codec.js.map +1 -1
- package/dist/encoding/normalize-workflow.d.ts +1 -1
- package/dist/encoding/normalize-workflow.d.ts.map +1 -1
- package/dist/encoding/resolve.js +1 -1
- package/dist/encoding/resolve.js.map +1 -1
- package/dist/encoding/schemas.d.ts +20 -20
- package/dist/encoding/schemas.js +1 -1
- package/dist/encoding/schemas.js.map +1 -1
- package/dist/environment/bindings.d.ts +4 -14
- package/dist/environment/bindings.d.ts.map +1 -1
- package/dist/environment/bindings.js +2 -7
- package/dist/environment/bindings.js.map +1 -1
- package/dist/environment/config-resolver.d.ts +1 -3
- package/dist/environment/config-resolver.d.ts.map +1 -1
- package/dist/environment/config-resolver.js +13 -19
- package/dist/environment/config-resolver.js.map +1 -1
- package/dist/environment/describe.d.ts +1 -1
- package/dist/environment/describe.d.ts.map +1 -1
- package/dist/environment/describe.js +32 -24
- package/dist/environment/describe.js.map +1 -1
- package/dist/environment/ecp.d.ts +10 -13
- package/dist/environment/ecp.d.ts.map +1 -1
- package/dist/environment/ecp.js +4 -14
- package/dist/environment/ecp.js.map +1 -1
- package/dist/environment/environment.d.ts +99 -49
- package/dist/environment/environment.d.ts.map +1 -1
- package/dist/environment/environment.js +203 -155
- package/dist/environment/environment.js.map +1 -1
- package/dist/environment/search.d.ts +1 -1
- package/dist/environment/search.d.ts.map +1 -1
- package/dist/environment/search.js +10 -7
- package/dist/environment/search.js.map +1 -1
- package/dist/environment/validate-binding-config.d.ts +12 -0
- package/dist/environment/validate-binding-config.d.ts.map +1 -0
- package/dist/environment/validate-binding-config.js +43 -0
- package/dist/environment/validate-binding-config.js.map +1 -0
- package/dist/file/file-ref.d.ts +1 -1
- package/dist/file/file-ref.d.ts.map +1 -1
- package/dist/file/file-ref.js +1 -1
- package/dist/file/file-ref.js.map +1 -1
- package/dist/fluent/encode-fluent.d.ts +1 -1
- package/dist/fluent/encode-fluent.d.ts.map +1 -1
- package/dist/fluent/encode-fluent.js +1 -1
- package/dist/fluent/encode-fluent.js.map +1 -1
- package/dist/fluent/render-expr.d.ts +1 -1
- package/dist/fluent/render-expr.d.ts.map +1 -1
- package/dist/fluent/render-node.d.ts +1 -1
- package/dist/fluent/render-node.d.ts.map +1 -1
- package/dist/fluent/render-value.d.ts +1 -2
- package/dist/fluent/render-value.d.ts.map +1 -1
- package/dist/fluent/render-value.js +0 -5
- package/dist/fluent/render-value.js.map +1 -1
- package/dist/fluent/render-workflow.d.ts +1 -1
- package/dist/fluent/render-workflow.d.ts.map +1 -1
- package/dist/fluent/render-workflow.js +0 -2
- package/dist/fluent/render-workflow.js.map +1 -1
- package/dist/formats/format-fluent.d.ts.map +1 -1
- package/dist/formats/format-fluent.js +10 -8
- package/dist/formats/format-fluent.js.map +1 -1
- package/dist/formats/format-json.d.ts.map +1 -1
- package/dist/formats/format-json.js +22 -27
- package/dist/formats/format-json.js.map +1 -1
- package/dist/formats/register-core-formats.d.ts +2 -1
- package/dist/formats/register-core-formats.d.ts.map +1 -1
- package/dist/formats/register-core-formats.js +2 -4
- package/dist/formats/register-core-formats.js.map +1 -1
- package/dist/helpers/env.d.ts +1 -1
- package/dist/helpers/env.d.ts.map +1 -1
- package/dist/helpers/expr.d.ts +1 -1
- package/dist/helpers/expr.d.ts.map +1 -1
- package/dist/helpers/merge-parameter-body.d.ts +11 -0
- package/dist/helpers/merge-parameter-body.d.ts.map +1 -0
- package/dist/helpers/merge-parameter-body.js +36 -0
- package/dist/helpers/merge-parameter-body.js.map +1 -0
- package/dist/{harness/authoring/to-provider-chat-turns.d.ts → helpers/provider-chat-turns.d.ts} +7 -7
- package/dist/helpers/provider-chat-turns.d.ts.map +1 -0
- package/dist/{harness/authoring/to-provider-chat-turns.js → helpers/provider-chat-turns.js} +4 -4
- package/dist/helpers/provider-chat-turns.js.map +1 -0
- package/dist/helpers/ref.d.ts +1 -1
- package/dist/helpers/ref.d.ts.map +1 -1
- package/dist/helpers/secrets.d.ts +1 -1
- package/dist/helpers/secrets.d.ts.map +1 -1
- package/dist/helpers/state.d.ts +1 -1
- package/dist/helpers/state.d.ts.map +1 -1
- package/dist/index.d.ts +28 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -21
- package/dist/index.js.map +1 -1
- package/dist/invoke/execute-invoke.d.ts +2 -2
- package/dist/invoke/execute-invoke.d.ts.map +1 -1
- package/dist/invoke/execute-invoke.js +8 -20
- package/dist/invoke/execute-invoke.js.map +1 -1
- package/dist/invoke/invoke-builder.d.ts +1 -3
- package/dist/invoke/invoke-builder.d.ts.map +1 -1
- package/dist/invoke/invoke-builder.js +1 -6
- package/dist/invoke/invoke-builder.js.map +1 -1
- package/dist/media/base64.d.ts +11 -0
- package/dist/media/base64.d.ts.map +1 -0
- package/dist/media/base64.js +30 -0
- package/dist/media/base64.js.map +1 -0
- package/dist/media/browser-locator.d.ts +8 -0
- package/dist/media/browser-locator.d.ts.map +1 -0
- package/dist/media/browser-locator.js +22 -0
- package/dist/media/browser-locator.js.map +1 -0
- package/dist/media/index.d.ts +4 -2
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +4 -2
- package/dist/media/index.js.map +1 -1
- package/dist/media/resolve-file.d.ts +17 -15
- package/dist/media/resolve-file.d.ts.map +1 -1
- package/dist/media/resolve-file.js +28 -85
- package/dist/media/resolve-file.js.map +1 -1
- package/dist/media/resolved-file.d.ts +15 -0
- package/dist/media/resolved-file.d.ts.map +1 -0
- package/dist/media/resolved-file.js +2 -0
- package/dist/media/resolved-file.js.map +1 -0
- package/dist/media/write-media.d.ts +3 -14
- package/dist/media/write-media.d.ts.map +1 -1
- package/dist/media/write-media.js +17 -99
- package/dist/media/write-media.js.map +1 -1
- package/dist/patch/apply-patch.d.ts +2 -2
- package/dist/patch/apply-patch.d.ts.map +1 -1
- package/dist/patch/apply-patch.js +1 -1
- package/dist/patch/apply-patch.js.map +1 -1
- package/dist/patch/normalize-input.d.ts +1 -1
- package/dist/patch/normalize-input.d.ts.map +1 -1
- package/dist/patch/normalize-input.js +1 -1
- package/dist/patch/normalize-input.js.map +1 -1
- package/dist/patch/patch-builder.d.ts +1 -1
- package/dist/patch/patch-builder.d.ts.map +1 -1
- package/dist/patch/patch-builder.js.map +1 -1
- package/dist/patch/patch-document.d.ts +2 -2
- package/dist/patch/resolve-path.d.ts +2 -2
- package/dist/patch/resolve-path.d.ts.map +1 -1
- package/dist/patch/resolve-path.js +1 -1
- package/dist/patch/resolve-path.js.map +1 -1
- package/dist/patch/step-index.d.ts +1 -1
- package/dist/patch/step-index.d.ts.map +1 -1
- package/dist/policies/registry-control.d.ts +20 -0
- package/dist/policies/registry-control.d.ts.map +1 -0
- package/dist/policies/registry-control.js +72 -0
- package/dist/policies/registry-control.js.map +1 -0
- package/dist/registry/ensure-bound-extensions.d.ts +1 -1
- package/dist/registry/ensure-bound-extensions.js +2 -2
- package/dist/registry/ensure-bound-extensions.js.map +1 -1
- package/dist/registry/errors.d.ts +1 -1
- package/dist/registry/errors.d.ts.map +1 -1
- package/dist/registry/errors.js +2 -1
- package/dist/registry/errors.js.map +1 -1
- package/dist/registry/extension-catalog.d.ts +3 -18
- package/dist/registry/extension-catalog.d.ts.map +1 -1
- package/dist/registry/extension-catalog.js +3 -25
- package/dist/registry/extension-catalog.js.map +1 -1
- package/dist/registry/registry.d.ts +8 -9
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/registry.js +9 -10
- package/dist/registry/registry.js.map +1 -1
- package/dist/runtime/capability-execution.d.ts +9 -8
- package/dist/runtime/capability-execution.d.ts.map +1 -1
- package/dist/runtime/capability-execution.js +11 -11
- package/dist/runtime/capability-execution.js.map +1 -1
- package/dist/runtime/commit.d.ts +2 -2
- package/dist/runtime/commit.d.ts.map +1 -1
- package/dist/runtime/context.d.ts +24 -4
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/context.js.map +1 -1
- package/dist/runtime/dispatch-capability.d.ts +1 -1
- package/dist/runtime/dispatch-capability.d.ts.map +1 -1
- package/dist/runtime/dispatch-capability.js +10 -5
- package/dist/runtime/dispatch-capability.js.map +1 -1
- package/dist/runtime/error-details.d.ts +13 -0
- package/dist/runtime/error-details.d.ts.map +1 -0
- package/dist/runtime/error-details.js +56 -0
- package/dist/runtime/error-details.js.map +1 -0
- package/dist/runtime/executor.d.ts +14 -5
- package/dist/runtime/executor.d.ts.map +1 -1
- package/dist/runtime/in-memory-executor.d.ts +1 -1
- package/dist/runtime/in-memory-executor.d.ts.map +1 -1
- package/dist/runtime/in-memory-executor.js +195 -27
- package/dist/runtime/in-memory-executor.js.map +1 -1
- package/dist/runtime/lifecycle.d.ts +1 -1
- package/dist/runtime/lifecycle.d.ts.map +1 -1
- package/dist/runtime/mutation-records.d.ts +1 -1
- package/dist/runtime/mutation-records.d.ts.map +1 -1
- package/dist/runtime/policy-engine.d.ts +3 -2
- package/dist/runtime/policy-engine.d.ts.map +1 -1
- package/dist/runtime/policy-engine.js +12 -3
- package/dist/runtime/policy-engine.js.map +1 -1
- package/dist/runtime/remote-invoke.d.ts +22 -2
- package/dist/runtime/remote-invoke.d.ts.map +1 -1
- package/dist/runtime/remote-invoke.js +43 -6
- package/dist/runtime/remote-invoke.js.map +1 -1
- package/dist/runtime/resolve-input.d.ts +1 -1
- package/dist/runtime/resolve-input.d.ts.map +1 -1
- package/dist/runtime/resolve-input.js +6 -0
- package/dist/runtime/resolve-input.js.map +1 -1
- package/dist/runtime/runtime-ids.d.ts +4 -4
- package/dist/runtime/runtime-ids.d.ts.map +1 -1
- package/dist/runtime/runtime-ids.js +4 -4
- package/dist/runtime/runtime-ids.js.map +1 -1
- package/dist/runtime/step-order.d.ts +32 -0
- package/dist/runtime/step-order.d.ts.map +1 -0
- package/dist/runtime/step-order.js +85 -0
- package/dist/runtime/step-order.js.map +1 -0
- package/dist/runtime/store.d.ts +1 -1
- package/dist/runtime/store.d.ts.map +1 -1
- package/dist/schema/json-schema.d.ts +20 -4
- package/dist/schema/json-schema.d.ts.map +1 -1
- package/dist/schema/json-schema.js +66 -10
- package/dist/schema/json-schema.js.map +1 -1
- package/dist/schema/workflow-io.d.ts +1 -1
- package/dist/schema/workflow-io.d.ts.map +1 -1
- package/dist/schemas/decode.result.json +165 -0
- package/dist/schemas/encode.result.json +172 -0
- package/dist/schemas/environment.describe.json +362 -0
- package/dist/schemas/environment.manifest.json +159 -0
- package/dist/schemas/environment.search.json +72 -0
- package/dist/schemas/patch.json +104 -0
- package/dist/schemas/patch.result.json +270 -0
- package/dist/schemas/requirements.json +102 -0
- package/dist/schemas/run.journal.json +158 -0
- package/dist/schemas/run.request.json +491 -0
- package/dist/schemas/run.result.json +240 -0
- package/dist/schemas/validation.result.json +99 -0
- package/dist/schemas/workflow.manifest.json +457 -0
- package/dist/services/index.d.ts +4 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +4 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/map.d.ts +24 -0
- package/dist/services/map.d.ts.map +1 -0
- package/dist/services/map.js +37 -0
- package/dist/services/map.js.map +1 -0
- package/dist/services/media-store.d.ts +78 -0
- package/dist/services/media-store.d.ts.map +1 -0
- package/dist/services/media-store.js +16 -0
- package/dist/services/media-store.js.map +1 -0
- package/dist/services/provider.d.ts +35 -0
- package/dist/services/provider.d.ts.map +1 -0
- package/dist/services/provider.js +25 -0
- package/dist/services/provider.js.map +1 -0
- package/dist/testing/index.d.ts +4 -2
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +4 -2
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/memory-media-store.d.ts +24 -0
- package/dist/testing/memory-media-store.d.ts.map +1 -0
- package/dist/testing/memory-media-store.js +71 -0
- package/dist/testing/memory-media-store.js.map +1 -0
- package/dist/testing/test-extension.d.ts +19 -3
- package/dist/testing/test-extension.d.ts.map +1 -1
- package/dist/testing/test-extension.js +83 -51
- package/dist/testing/test-extension.js.map +1 -1
- package/dist/testing/test-lifecycle-extension.d.ts +5 -4
- package/dist/testing/test-lifecycle-extension.d.ts.map +1 -1
- package/dist/testing/test-lifecycle-extension.js +28 -25
- package/dist/testing/test-lifecycle-extension.js.map +1 -1
- package/dist/types/capabilities.d.ts +39 -0
- package/dist/types/capabilities.d.ts.map +1 -0
- package/dist/types/capabilities.js +2 -0
- package/dist/types/capabilities.js.map +1 -0
- package/dist/types/capability-execution.d.ts +5 -0
- package/dist/types/capability-execution.d.ts.map +1 -0
- package/dist/types/capability-execution.js +3 -0
- package/dist/types/capability-execution.js.map +1 -0
- package/dist/types/capability-metadata.d.ts +216 -0
- package/dist/types/capability-metadata.d.ts.map +1 -0
- package/dist/types/capability-metadata.js +138 -0
- package/dist/types/capability-metadata.js.map +1 -0
- package/dist/types/encoding.d.ts +103 -0
- package/dist/types/encoding.d.ts.map +1 -0
- package/dist/types/encoding.js +29 -0
- package/dist/types/encoding.js.map +1 -0
- package/dist/types/environment.d.ts +155 -0
- package/dist/types/environment.d.ts.map +1 -0
- package/dist/types/environment.js +2 -0
- package/dist/types/environment.js.map +1 -0
- package/dist/types/errors.d.ts +93 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +89 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/file-ref.d.ts +84 -0
- package/dist/types/file-ref.d.ts.map +1 -0
- package/dist/types/file-ref.js +117 -0
- package/dist/types/file-ref.js.map +1 -0
- package/dist/types/image-output.d.ts +32 -0
- package/dist/types/image-output.d.ts.map +1 -0
- package/dist/types/image-output.js +11 -0
- package/dist/types/image-output.js.map +1 -0
- package/dist/types/index.d.ts +36 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +13 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/invoke.d.ts +51 -0
- package/dist/types/invoke.d.ts.map +1 -0
- package/dist/types/invoke.js +32 -0
- package/dist/types/invoke.js.map +1 -0
- package/dist/types/journal.d.ts +121 -0
- package/dist/types/journal.d.ts.map +1 -0
- package/dist/types/journal.js +3 -0
- package/dist/types/journal.js.map +1 -0
- package/dist/types/lifecycle.d.ts +27 -0
- package/dist/types/lifecycle.d.ts.map +1 -0
- package/dist/types/lifecycle.js +2 -0
- package/dist/types/lifecycle.js.map +1 -0
- package/dist/types/model.d.ts +102 -0
- package/dist/types/model.d.ts.map +1 -0
- package/dist/types/model.js +51 -0
- package/dist/types/model.js.map +1 -0
- package/dist/types/patch-errors.d.ts +11 -0
- package/dist/types/patch-errors.d.ts.map +1 -0
- package/dist/types/patch-errors.js +9 -0
- package/dist/types/patch-errors.js.map +1 -0
- package/dist/types/patch.d.ts +51 -0
- package/dist/types/patch.d.ts.map +1 -0
- package/dist/types/patch.js +2 -0
- package/dist/types/patch.js.map +1 -0
- package/dist/types/registry.d.ts +24 -0
- package/dist/types/registry.d.ts.map +1 -0
- package/dist/types/registry.js +2 -0
- package/dist/types/registry.js.map +1 -0
- package/dist/types/requirements.d.ts +42 -0
- package/dist/types/requirements.d.ts.map +1 -0
- package/dist/types/requirements.js +2 -0
- package/dist/types/requirements.js.map +1 -0
- package/dist/types/run-events.d.ts +32 -0
- package/dist/types/run-events.d.ts.map +1 -0
- package/dist/types/run-events.js +8 -0
- package/dist/types/run-events.js.map +1 -0
- package/dist/types/run.d.ts +48 -0
- package/dist/types/run.d.ts.map +1 -0
- package/dist/types/run.js +2 -0
- package/dist/types/run.js.map +1 -0
- package/dist/types/schema.d.ts +58 -0
- package/dist/types/schema.d.ts.map +1 -0
- package/dist/types/schema.js +2 -0
- package/dist/types/schema.js.map +1 -0
- package/dist/types/store.d.ts +30 -0
- package/dist/types/store.d.ts.map +1 -0
- package/dist/types/store.js +2 -0
- package/dist/types/store.js.map +1 -0
- package/dist/types/validation.d.ts +30 -0
- package/dist/types/validation.d.ts.map +1 -0
- package/dist/types/validation.js +2 -0
- package/dist/types/validation.js.map +1 -0
- package/dist/types/version.d.ts +5 -0
- package/dist/types/version.d.ts.map +1 -0
- package/dist/types/version.js +3 -0
- package/dist/types/version.js.map +1 -0
- package/dist/types/workflow.d.ts +80 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/types/workflow.js +2 -0
- package/dist/types/workflow.js.map +1 -0
- package/dist/util/semver-range.d.ts +6 -0
- package/dist/util/semver-range.d.ts.map +1 -0
- package/dist/util/semver-range.js +9 -0
- package/dist/util/semver-range.js.map +1 -0
- package/dist/validate/environment.d.ts +5 -2
- package/dist/validate/environment.d.ts.map +1 -1
- package/dist/validate/environment.js +38 -19
- package/dist/validate/environment.js.map +1 -1
- package/dist/validate/workflow-schema.d.ts +17 -31
- package/dist/validate/workflow-schema.d.ts.map +1 -1
- package/dist/validate/workflow-schema.js +1 -10
- package/dist/validate/workflow-schema.js.map +1 -1
- package/dist/validate/workflow.d.ts +1 -1
- package/dist/validate/workflow.d.ts.map +1 -1
- package/dist/validate/workflow.js +2 -11
- package/dist/validate/workflow.js.map +1 -1
- package/dist/validate/zod-mapper.d.ts +1 -1
- package/dist/validate/zod-mapper.d.ts.map +1 -1
- package/dist/workflow/assign-unique-step-ids.d.ts +1 -1
- package/dist/workflow/assign-unique-step-ids.d.ts.map +1 -1
- package/dist/workflow/builder.d.ts +17 -1
- package/dist/workflow/builder.d.ts.map +1 -1
- package/dist/workflow/builder.js +27 -1
- package/dist/workflow/builder.js.map +1 -1
- package/dist/workflow/flow.d.ts +2 -2
- package/dist/workflow/flow.d.ts.map +1 -1
- package/dist/workflow/requirements.d.ts +34 -0
- package/dist/workflow/requirements.d.ts.map +1 -0
- package/dist/workflow/requirements.js +134 -0
- package/dist/workflow/requirements.js.map +1 -0
- package/package.json +13 -86
- package/dist/bindings/harness.d.ts +0 -24
- package/dist/bindings/harness.d.ts.map +0 -1
- package/dist/bindings/harness.js +0 -44
- package/dist/bindings/harness.js.map +0 -1
- package/dist/bindings/runtime.d.ts +0 -19
- package/dist/bindings/runtime.d.ts.map +0 -1
- package/dist/bindings/runtime.js +0 -32
- package/dist/bindings/runtime.js.map +0 -1
- package/dist/browser-runtime-entry.d.ts +0 -61
- package/dist/browser-runtime-entry.d.ts.map +0 -1
- package/dist/browser-runtime-entry.js +0 -54
- package/dist/browser-runtime-entry.js.map +0 -1
- package/dist/browser.d.ts +0 -20
- package/dist/browser.d.ts.map +0 -1
- package/dist/browser.js +0 -20
- package/dist/browser.js.map +0 -1
- package/dist/compile/compile-harness-artifact.d.ts +0 -30
- package/dist/compile/compile-harness-artifact.d.ts.map +0 -1
- package/dist/compile/compile-harness-artifact.js +0 -43
- package/dist/compile/compile-harness-artifact.js.map +0 -1
- package/dist/compile/entry.d.ts +0 -3
- package/dist/compile/entry.d.ts.map +0 -1
- package/dist/compile/entry.js +0 -3
- package/dist/compile/entry.js.map +0 -1
- package/dist/compile/evaluate-browser.d.ts +0 -7
- package/dist/compile/evaluate-browser.d.ts.map +0 -1
- package/dist/compile/evaluate-browser.js +0 -26
- package/dist/compile/evaluate-browser.js.map +0 -1
- package/dist/compile/evaluate-harness-artifact.d.ts +0 -3
- package/dist/compile/evaluate-harness-artifact.d.ts.map +0 -1
- package/dist/compile/evaluate-harness-artifact.js +0 -17
- package/dist/compile/evaluate-harness-artifact.js.map +0 -1
- package/dist/compile/evaluate.d.ts +0 -5
- package/dist/compile/evaluate.d.ts.map +0 -1
- package/dist/compile/evaluate.js +0 -20
- package/dist/compile/evaluate.js.map +0 -1
- package/dist/compile/extract-harness-artifact.d.ts +0 -9
- package/dist/compile/extract-harness-artifact.d.ts.map +0 -1
- package/dist/compile/extract-harness-artifact.js +0 -33
- package/dist/compile/extract-harness-artifact.js.map +0 -1
- package/dist/compile/index.browser.d.ts +0 -49
- package/dist/compile/index.browser.d.ts.map +0 -1
- package/dist/compile/index.browser.js +0 -93
- package/dist/compile/index.browser.js.map +0 -1
- package/dist/compile/prepare-browser-source.d.ts +0 -3
- package/dist/compile/prepare-browser-source.d.ts.map +0 -1
- package/dist/compile/prepare-browser-source.js +0 -25
- package/dist/compile/prepare-browser-source.js.map +0 -1
- package/dist/compile/transpile-browser.d.ts +0 -44
- package/dist/compile/transpile-browser.d.ts.map +0 -1
- package/dist/compile/transpile-browser.js +0 -120
- package/dist/compile/transpile-browser.js.map +0 -1
- package/dist/compile/transpile.d.ts +0 -27
- package/dist/compile/transpile.d.ts.map +0 -1
- package/dist/compile/transpile.js +0 -150
- package/dist/compile/transpile.js.map +0 -1
- package/dist/definitions/runtime.d.ts +0 -22
- package/dist/definitions/runtime.d.ts.map +0 -1
- package/dist/definitions/runtime.js +0 -48
- package/dist/definitions/runtime.js.map +0 -1
- package/dist/encoding/strip-harness-typescript-output.d.ts +0 -7
- package/dist/encoding/strip-harness-typescript-output.d.ts.map +0 -1
- package/dist/encoding/strip-harness-typescript-output.js +0 -40
- package/dist/encoding/strip-harness-typescript-output.js.map +0 -1
- package/dist/encoding/strip-markdown-fences.d.ts +0 -6
- package/dist/encoding/strip-markdown-fences.d.ts.map +0 -1
- package/dist/encoding/strip-markdown-fences.js +0 -23
- package/dist/encoding/strip-markdown-fences.js.map +0 -1
- package/dist/feedback/collect.d.ts +0 -32
- package/dist/feedback/collect.d.ts.map +0 -1
- package/dist/feedback/collect.js +0 -97
- package/dist/feedback/collect.js.map +0 -1
- package/dist/feedback/index.d.ts +0 -2
- package/dist/feedback/index.d.ts.map +0 -1
- package/dist/feedback/index.js +0 -2
- package/dist/feedback/index.js.map +0 -1
- package/dist/harness/authoring/chat-result.d.ts +0 -19
- package/dist/harness/authoring/chat-result.d.ts.map +0 -1
- package/dist/harness/authoring/chat-result.js +0 -56
- package/dist/harness/authoring/chat-result.js.map +0 -1
- package/dist/harness/authoring/classified-intent.d.ts +0 -46
- package/dist/harness/authoring/classified-intent.d.ts.map +0 -1
- package/dist/harness/authoring/classified-intent.js +0 -261
- package/dist/harness/authoring/classified-intent.js.map +0 -1
- package/dist/harness/authoring/context-policy.d.ts +0 -47
- package/dist/harness/authoring/context-policy.d.ts.map +0 -1
- package/dist/harness/authoring/context-policy.js +0 -160
- package/dist/harness/authoring/context-policy.js.map +0 -1
- package/dist/harness/authoring/describe-for-prompt.d.ts +0 -19
- package/dist/harness/authoring/describe-for-prompt.d.ts.map +0 -1
- package/dist/harness/authoring/describe-for-prompt.js +0 -105
- package/dist/harness/authoring/describe-for-prompt.js.map +0 -1
- package/dist/harness/authoring/encode-prompt-text.d.ts +0 -7
- package/dist/harness/authoring/encode-prompt-text.d.ts.map +0 -1
- package/dist/harness/authoring/encode-prompt-text.js +0 -13
- package/dist/harness/authoring/encode-prompt-text.js.map +0 -1
- package/dist/harness/authoring/environment-question.d.ts +0 -6
- package/dist/harness/authoring/environment-question.d.ts.map +0 -1
- package/dist/harness/authoring/environment-question.js +0 -11
- package/dist/harness/authoring/environment-question.js.map +0 -1
- package/dist/harness/authoring/index.d.ts +0 -23
- package/dist/harness/authoring/index.d.ts.map +0 -1
- package/dist/harness/authoring/index.js +0 -22
- package/dist/harness/authoring/index.js.map +0 -1
- package/dist/harness/authoring/normalize-create-eql-output.d.ts +0 -27
- package/dist/harness/authoring/normalize-create-eql-output.d.ts.map +0 -1
- package/dist/harness/authoring/normalize-create-eql-output.js +0 -284
- package/dist/harness/authoring/normalize-create-eql-output.js.map +0 -1
- package/dist/harness/authoring/normalize-intent-eql-output.d.ts +0 -7
- package/dist/harness/authoring/normalize-intent-eql-output.d.ts.map +0 -1
- package/dist/harness/authoring/normalize-intent-eql-output.js +0 -59
- package/dist/harness/authoring/normalize-intent-eql-output.js.map +0 -1
- package/dist/harness/authoring/normalize-patch-eql-output.d.ts +0 -28
- package/dist/harness/authoring/normalize-patch-eql-output.d.ts.map +0 -1
- package/dist/harness/authoring/normalize-patch-eql-output.js +0 -202
- package/dist/harness/authoring/normalize-patch-eql-output.js.map +0 -1
- package/dist/harness/authoring/normalize-workflow-output.d.ts +0 -6
- package/dist/harness/authoring/normalize-workflow-output.d.ts.map +0 -1
- package/dist/harness/authoring/normalize-workflow-output.js +0 -51
- package/dist/harness/authoring/normalize-workflow-output.js.map +0 -1
- package/dist/harness/authoring/patch-clear-intent.d.ts +0 -17
- package/dist/harness/authoring/patch-clear-intent.d.ts.map +0 -1
- package/dist/harness/authoring/patch-clear-intent.js +0 -46
- package/dist/harness/authoring/patch-clear-intent.js.map +0 -1
- package/dist/harness/authoring/presentation.d.ts +0 -57
- package/dist/harness/authoring/presentation.d.ts.map +0 -1
- package/dist/harness/authoring/presentation.js +0 -137
- package/dist/harness/authoring/presentation.js.map +0 -1
- package/dist/harness/authoring/recover-structured-patch.d.ts +0 -21
- package/dist/harness/authoring/recover-structured-patch.d.ts.map +0 -1
- package/dist/harness/authoring/recover-structured-patch.js +0 -230
- package/dist/harness/authoring/recover-structured-patch.js.map +0 -1
- package/dist/harness/authoring/repair-workflow-json.d.ts +0 -16
- package/dist/harness/authoring/repair-workflow-json.d.ts.map +0 -1
- package/dist/harness/authoring/repair-workflow-json.js +0 -183
- package/dist/harness/authoring/repair-workflow-json.js.map +0 -1
- package/dist/harness/authoring/safe-reply.d.ts +0 -71
- package/dist/harness/authoring/safe-reply.d.ts.map +0 -1
- package/dist/harness/authoring/safe-reply.js +0 -291
- package/dist/harness/authoring/safe-reply.js.map +0 -1
- package/dist/harness/authoring/summarize-capability-schema.d.ts +0 -20
- package/dist/harness/authoring/summarize-capability-schema.d.ts.map +0 -1
- package/dist/harness/authoring/summarize-capability-schema.js +0 -141
- package/dist/harness/authoring/summarize-capability-schema.js.map +0 -1
- package/dist/harness/authoring/summarize-environment.d.ts +0 -77
- package/dist/harness/authoring/summarize-environment.d.ts.map +0 -1
- package/dist/harness/authoring/summarize-environment.js +0 -298
- package/dist/harness/authoring/summarize-environment.js.map +0 -1
- package/dist/harness/authoring/summarize-probe-context.d.ts +0 -31
- package/dist/harness/authoring/summarize-probe-context.d.ts.map +0 -1
- package/dist/harness/authoring/summarize-probe-context.js +0 -134
- package/dist/harness/authoring/summarize-probe-context.js.map +0 -1
- package/dist/harness/authoring/summarize-run-context.d.ts +0 -28
- package/dist/harness/authoring/summarize-run-context.d.ts.map +0 -1
- package/dist/harness/authoring/summarize-run-context.js +0 -40
- package/dist/harness/authoring/summarize-run-context.js.map +0 -1
- package/dist/harness/authoring/summarize-workflow.d.ts +0 -37
- package/dist/harness/authoring/summarize-workflow.d.ts.map +0 -1
- package/dist/harness/authoring/summarize-workflow.js +0 -148
- package/dist/harness/authoring/summarize-workflow.js.map +0 -1
- package/dist/harness/authoring/to-provider-chat-turns.d.ts.map +0 -1
- package/dist/harness/authoring/to-provider-chat-turns.js.map +0 -1
- package/dist/harness/call-model.d.ts +0 -15
- package/dist/harness/call-model.d.ts.map +0 -1
- package/dist/harness/call-model.js +0 -59
- package/dist/harness/call-model.js.map +0 -1
- package/dist/harness/context.d.ts +0 -28
- package/dist/harness/context.d.ts.map +0 -1
- package/dist/harness/context.js +0 -19
- package/dist/harness/context.js.map +0 -1
- package/dist/harness/define-harness.d.ts +0 -37
- package/dist/harness/define-harness.d.ts.map +0 -1
- package/dist/harness/define-harness.js +0 -88
- package/dist/harness/define-harness.js.map +0 -1
- package/dist/harness/definitions/test-minimal-harness.d.ts +0 -13
- package/dist/harness/definitions/test-minimal-harness.d.ts.map +0 -1
- package/dist/harness/definitions/test-minimal-harness.js +0 -45
- package/dist/harness/definitions/test-minimal-harness.js.map +0 -1
- package/dist/harness/execute-harness.d.ts +0 -9
- package/dist/harness/execute-harness.d.ts.map +0 -1
- package/dist/harness/execute-harness.js +0 -142
- package/dist/harness/execute-harness.js.map +0 -1
- package/dist/harness/format-resolve.d.ts +0 -26
- package/dist/harness/format-resolve.d.ts.map +0 -1
- package/dist/harness/format-resolve.js +0 -50
- package/dist/harness/format-resolve.js.map +0 -1
- package/dist/harness/harness-catalog.d.ts +0 -41
- package/dist/harness/harness-catalog.d.ts.map +0 -1
- package/dist/harness/harness-catalog.js +0 -66
- package/dist/harness/harness-catalog.js.map +0 -1
- package/dist/harness/index.d.ts +0 -11
- package/dist/harness/index.d.ts.map +0 -1
- package/dist/harness/index.js +0 -9
- package/dist/harness/index.js.map +0 -1
- package/dist/harness/prompts/build-repair-hint.d.ts +0 -8
- package/dist/harness/prompts/build-repair-hint.d.ts.map +0 -1
- package/dist/harness/prompts/build-repair-hint.js +0 -28
- package/dist/harness/prompts/build-repair-hint.js.map +0 -1
- package/dist/harness/prompts/build-system-prompt.d.ts +0 -7
- package/dist/harness/prompts/build-system-prompt.d.ts.map +0 -1
- package/dist/harness/prompts/build-system-prompt.js +0 -97
- package/dist/harness/prompts/build-system-prompt.js.map +0 -1
- package/dist/harness/prompts/eql-primer.d.ts +0 -14
- package/dist/harness/prompts/eql-primer.d.ts.map +0 -1
- package/dist/harness/prompts/eql-primer.js +0 -221
- package/dist/harness/prompts/eql-primer.js.map +0 -1
- package/dist/harness/prompts/fixtures-root.d.ts +0 -5
- package/dist/harness/prompts/fixtures-root.d.ts.map +0 -1
- package/dist/harness/prompts/fixtures-root.js +0 -7
- package/dist/harness/prompts/fixtures-root.js.map +0 -1
- package/dist/harness/prompts/harness-prompt-fixture-schema.d.ts +0 -95
- package/dist/harness/prompts/harness-prompt-fixture-schema.d.ts.map +0 -1
- package/dist/harness/prompts/harness-prompt-fixture-schema.js +0 -28
- package/dist/harness/prompts/harness-prompt-fixture-schema.js.map +0 -1
- package/dist/harness/prompts/identity-primer.d.ts +0 -6
- package/dist/harness/prompts/identity-primer.d.ts.map +0 -1
- package/dist/harness/prompts/identity-primer.js +0 -9
- package/dist/harness/prompts/identity-primer.js.map +0 -1
- package/dist/harness/prompts/index.d.ts +0 -7
- package/dist/harness/prompts/index.d.ts.map +0 -1
- package/dist/harness/prompts/index.js +0 -7
- package/dist/harness/prompts/index.js.map +0 -1
- package/dist/harness/prompts/load-schema-example.browser.d.ts +0 -11
- package/dist/harness/prompts/load-schema-example.browser.d.ts.map +0 -1
- package/dist/harness/prompts/load-schema-example.browser.js +0 -70
- package/dist/harness/prompts/load-schema-example.browser.js.map +0 -1
- package/dist/harness/prompts/load-schema-example.d.ts +0 -11
- package/dist/harness/prompts/load-schema-example.d.ts.map +0 -1
- package/dist/harness/prompts/load-schema-example.js +0 -22
- package/dist/harness/prompts/load-schema-example.js.map +0 -1
- package/dist/harness/prompts/load-schema-example.node.d.ts +0 -7
- package/dist/harness/prompts/load-schema-example.node.d.ts.map +0 -1
- package/dist/harness/prompts/load-schema-example.node.js +0 -38
- package/dist/harness/prompts/load-schema-example.node.js.map +0 -1
- package/dist/harness/prompts/schema-example-files.d.ts +0 -7
- package/dist/harness/prompts/schema-example-files.d.ts.map +0 -1
- package/dist/harness/prompts/schema-example-files.js +0 -12
- package/dist/harness/prompts/schema-example-files.js.map +0 -1
- package/dist/harness/prompts/typescript-primer.d.ts +0 -11
- package/dist/harness/prompts/typescript-primer.d.ts.map +0 -1
- package/dist/harness/prompts/typescript-primer.js +0 -80
- package/dist/harness/prompts/typescript-primer.js.map +0 -1
- package/dist/harness/repair-loop-timing.d.ts +0 -17
- package/dist/harness/repair-loop-timing.d.ts.map +0 -1
- package/dist/harness/repair-loop-timing.js +0 -89
- package/dist/harness/repair-loop-timing.js.map +0 -1
- package/dist/harness/resolve-harness-binding.d.ts +0 -10
- package/dist/harness/resolve-harness-binding.d.ts.map +0 -1
- package/dist/harness/resolve-harness-binding.js +0 -14
- package/dist/harness/resolve-harness-binding.js.map +0 -1
- package/dist/harness/run-model-repair-loop.d.ts +0 -45
- package/dist/harness/run-model-repair-loop.d.ts.map +0 -1
- package/dist/harness/run-model-repair-loop.js +0 -57
- package/dist/harness/run-model-repair-loop.js.map +0 -1
- package/dist/harness/types.d.ts +0 -34
- package/dist/harness/types.d.ts.map +0 -1
- package/dist/harness/types.js +0 -2
- package/dist/harness/types.js.map +0 -1
- package/dist/helpers/browser.d.ts +0 -12
- package/dist/helpers/browser.d.ts.map +0 -1
- package/dist/helpers/browser.js +0 -12
- package/dist/helpers/browser.js.map +0 -1
- package/dist/loaders/files.d.ts +0 -13
- package/dist/loaders/files.d.ts.map +0 -1
- package/dist/loaders/files.js +0 -66
- package/dist/loaders/files.js.map +0 -1
- package/dist/loaders/index.d.ts +0 -2
- package/dist/loaders/index.d.ts.map +0 -1
- package/dist/loaders/index.js +0 -2
- package/dist/loaders/index.js.map +0 -1
- package/dist/loaders/read-media-file.d.ts +0 -6
- package/dist/loaders/read-media-file.d.ts.map +0 -1
- package/dist/loaders/read-media-file.js +0 -10
- package/dist/loaders/read-media-file.js.map +0 -1
- package/dist/node.d.ts +0 -8
- package/dist/node.d.ts.map +0 -1
- package/dist/node.js +0 -8
- package/dist/node.js.map +0 -1
- package/dist/runtime/test-session-state.d.ts +0 -23
- package/dist/runtime/test-session-state.d.ts.map +0 -1
- package/dist/runtime/test-session-state.js +0 -62
- package/dist/runtime/test-session-state.js.map +0 -1
- package/dist/test-session/index.d.ts +0 -2
- package/dist/test-session/index.d.ts.map +0 -1
- package/dist/test-session/index.js +0 -2
- package/dist/test-session/index.js.map +0 -1
- package/dist/test-session/test-session.d.ts +0 -36
- package/dist/test-session/test-session.d.ts.map +0 -1
- package/dist/test-session/test-session.js +0 -115
- package/dist/test-session/test-session.js.map +0 -1
- package/dist/testing/test-model-generate.d.ts +0 -15
- package/dist/testing/test-model-generate.d.ts.map +0 -1
- package/dist/testing/test-model-generate.js +0 -71
- package/dist/testing/test-model-generate.js.map +0 -1
- package/dist/validate/harness.d.ts +0 -11
- package/dist/validate/harness.d.ts.map +0 -1
- package/dist/validate/harness.js +0 -72
- package/dist/validate/harness.js.map +0 -1
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { ECP_HARNESS_ERROR_CODES, ECP_INVOKE_ERROR_CODES, LATEST_ECP_VERSION, } from "@executioncontrolprotocol/types";
|
|
2
|
-
import { createUtilityCapabilityContext } from "../encoding/utility-context.js";
|
|
3
|
-
import { evaluatePolicies } from "../runtime/policy-engine.js";
|
|
4
|
-
import { createUsageLedger } from "../runtime/context.js";
|
|
5
|
-
import { emptyValidationResult } from "../validate/workflow-schema.js";
|
|
6
|
-
import { zodIssuesToValidationIssues } from "../validate/zod-mapper.js";
|
|
7
|
-
import { getCatalogedHarness, harnessIdFromCapabilityId } from "./harness-catalog.js";
|
|
8
|
-
import { createHarnessCapabilityContext } from "./context.js";
|
|
9
|
-
import { findHarnessBinding } from "./resolve-harness-binding.js";
|
|
10
|
-
import { EcpImpl } from "../environment/ecp.js";
|
|
11
|
-
import { CapabilityDispatchError, createDispatchingCall, } from "../runtime/dispatch-capability.js";
|
|
12
|
-
const INVOKE_STUB_WORKFLOW = {
|
|
13
|
-
schema: "@executioncontrolprotocol.workflow",
|
|
14
|
-
version: LATEST_ECP_VERSION,
|
|
15
|
-
workflow: { id: "invoke-stub" },
|
|
16
|
-
steps: [],
|
|
17
|
-
};
|
|
18
|
-
function invokeFailure(capabilityId, code, message, validation) {
|
|
19
|
-
return {
|
|
20
|
-
schema: "@executioncontrolprotocol.invoke.result",
|
|
21
|
-
version: LATEST_ECP_VERSION,
|
|
22
|
-
success: false,
|
|
23
|
-
capabilityId,
|
|
24
|
-
validation,
|
|
25
|
-
diagnostics: [{ severity: "error", code, message }],
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Execute a harness evaluate capability.
|
|
30
|
-
* @category Harness
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
export async function executeHarnessInvoke(env, capabilityId, input, providerOverride) {
|
|
34
|
-
const harnessId = harnessIdFromCapabilityId(capabilityId);
|
|
35
|
-
if (!harnessId) {
|
|
36
|
-
return invokeFailure(capabilityId, ECP_INVOKE_ERROR_CODES.CAPABILITY_NOT_FOUND, `Not a harness capability: ${capabilityId}`);
|
|
37
|
-
}
|
|
38
|
-
const def = getCatalogedHarness(harnessId);
|
|
39
|
-
if (!def) {
|
|
40
|
-
return invokeFailure(capabilityId, ECP_HARNESS_ERROR_CODES.UNKNOWN_HARNESS, `Harness ${harnessId} is not registered.`);
|
|
41
|
-
}
|
|
42
|
-
const binding = findHarnessBinding(env, harnessId);
|
|
43
|
-
if (!binding) {
|
|
44
|
-
return invokeFailure(capabilityId, ECP_HARNESS_ERROR_CODES.HARNESS_NOT_BOUND, `Harness ${harnessId} is not bound in this environment.`);
|
|
45
|
-
}
|
|
46
|
-
const uses = providerOverride ?? binding.uses;
|
|
47
|
-
if (!uses) {
|
|
48
|
-
return invokeFailure(capabilityId, ECP_HARNESS_ERROR_CODES.UNKNOWN_HARNESS_PROVIDER, `Harness ${harnessId} has no provider (.uses(...)).`);
|
|
49
|
-
}
|
|
50
|
-
let parsedInput = input;
|
|
51
|
-
if (def.inputSchema) {
|
|
52
|
-
const parsed = def.inputSchema.safeParse(input);
|
|
53
|
-
if (!parsed.success) {
|
|
54
|
-
const validation = emptyValidationResult(false);
|
|
55
|
-
validation.errors.push(...zodIssuesToValidationIssues(parsed.error.issues));
|
|
56
|
-
return invokeFailure(capabilityId, ECP_INVOKE_ERROR_CODES.INVOKE_INPUT_INVALID, "Harness input validation failed", validation);
|
|
57
|
-
}
|
|
58
|
-
parsedInput = parsed.data;
|
|
59
|
-
}
|
|
60
|
-
const bindings = env.ecpResolveBindings();
|
|
61
|
-
const policyCtx = {
|
|
62
|
-
workflow: INVOKE_STUB_WORKFLOW,
|
|
63
|
-
run: { id: env.getEnvId(), input: {} },
|
|
64
|
-
step: { id: "invoke", capabilityId },
|
|
65
|
-
state: {},
|
|
66
|
-
input: (parsedInput ?? {}),
|
|
67
|
-
usage: createUsageLedger(),
|
|
68
|
-
scope: "invoke",
|
|
69
|
-
operation: "invoke",
|
|
70
|
-
capabilityId,
|
|
71
|
-
};
|
|
72
|
-
const preDecision = await evaluatePolicies("policy:pre", bindings.policyHooks, policyCtx);
|
|
73
|
-
if (preDecision.type === "deny" || preDecision.type === "pause") {
|
|
74
|
-
return invokeFailure(capabilityId, ECP_INVOKE_ERROR_CODES.INVOKE_DENIED, preDecision.reason ?? "Harness invocation denied by policy");
|
|
75
|
-
}
|
|
76
|
-
const registry = env.getRegistry();
|
|
77
|
-
const utilityCtx = createUtilityCapabilityContext(env.getEnvId(), env.getEnvLabel(), registry);
|
|
78
|
-
const extPrefix = uses.replace(/\.[^.]+$/, "");
|
|
79
|
-
const extBinding = bindings.extensions.find((e) => e.id === extPrefix);
|
|
80
|
-
const capCtx = {
|
|
81
|
-
store: utilityCtx.store,
|
|
82
|
-
state: {},
|
|
83
|
-
run: { id: env.getEnvId(), input: {} },
|
|
84
|
-
step: { id: "invoke", capabilityId },
|
|
85
|
-
logger: utilityCtx.logger,
|
|
86
|
-
usage: policyCtx.usage,
|
|
87
|
-
extensionConfig: extBinding?.config,
|
|
88
|
-
blobs: env.getBlobStore(),
|
|
89
|
-
artifacts: env.ensureArtifactStore(),
|
|
90
|
-
capabilities: {
|
|
91
|
-
call: async (id) => {
|
|
92
|
-
throw new Error(`nested call not bound: ${id}`);
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
capCtx.capabilities.call = createDispatchingCall({
|
|
97
|
-
ctx: capCtx,
|
|
98
|
-
registry,
|
|
99
|
-
runtimeId: env.getRuntimeId(),
|
|
100
|
-
remoteInvoke: env.getRemoteInvoke(),
|
|
101
|
-
});
|
|
102
|
-
const ecp = new EcpImpl(env);
|
|
103
|
-
const harnessCtx = createHarnessCapabilityContext(harnessId, uses, binding.config, env, ecp, capCtx, def.configSchema);
|
|
104
|
-
let output;
|
|
105
|
-
try {
|
|
106
|
-
output = await def.handler(parsedInput, harnessCtx);
|
|
107
|
-
}
|
|
108
|
-
catch (err) {
|
|
109
|
-
if (err instanceof CapabilityDispatchError) {
|
|
110
|
-
return invokeFailure(capabilityId, err.result.diagnostics[0]?.code ?? ECP_HARNESS_ERROR_CODES.HARNESS_EVALUATE_FAILED, err.result.diagnostics[0]?.message ?? "Harness evaluation failed");
|
|
111
|
-
}
|
|
112
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
113
|
-
return invokeFailure(capabilityId, ECP_HARNESS_ERROR_CODES.HARNESS_EVALUATE_FAILED, message);
|
|
114
|
-
}
|
|
115
|
-
if (def.outputSchema) {
|
|
116
|
-
const parsed = def.outputSchema.safeParse(output);
|
|
117
|
-
if (!parsed.success) {
|
|
118
|
-
const validation = emptyValidationResult(false);
|
|
119
|
-
validation.errors.push(...zodIssuesToValidationIssues(parsed.error.issues));
|
|
120
|
-
return invokeFailure(capabilityId, ECP_INVOKE_ERROR_CODES.INVOKE_OUTPUT_INVALID, "Harness output validation failed", validation);
|
|
121
|
-
}
|
|
122
|
-
output = parsed.data;
|
|
123
|
-
}
|
|
124
|
-
return {
|
|
125
|
-
schema: "@executioncontrolprotocol.invoke.result",
|
|
126
|
-
version: LATEST_ECP_VERSION,
|
|
127
|
-
success: true,
|
|
128
|
-
capabilityId,
|
|
129
|
-
result: output,
|
|
130
|
-
validation: emptyValidationResult(true),
|
|
131
|
-
diagnostics: [],
|
|
132
|
-
usage: policyCtx.usage.modelCalls > 0
|
|
133
|
-
? {
|
|
134
|
-
modelCalls: policyCtx.usage.modelCalls,
|
|
135
|
-
costUsd: policyCtx.usage.costUsd,
|
|
136
|
-
tokens: policyCtx.usage.tokens,
|
|
137
|
-
retries: policyCtx.usage.retries,
|
|
138
|
-
}
|
|
139
|
-
: undefined,
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
//# sourceMappingURL=execute-harness.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execute-harness.js","sourceRoot":"","sources":["../../src/harness/execute-harness.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,GAInB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,8BAA8B,EAAE,MAAM,gCAAgC,CAAA;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAA0B,MAAM,uBAAuB,CAAA;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EACL,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,mCAAmC,CAAA;AAE1C,MAAM,oBAAoB,GAAG;IAC3B,MAAM,EAAE,oCAA6C;IACrD,OAAO,EAAE,kBAAkB;IAC3B,QAAQ,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE;IAC/B,KAAK,EAAE,EAAE;CACV,CAAA;AAED,SAAS,aAAa,CACpB,YA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X,CAAA;QACH,CAAC;QACD,MAAM,GAAG,MAAM,CAAC,IAAI,CAAA;IACtB,CAAC;IAED,OAAO;QACL,MAAM,EAAE,yCAAyC;QACjD,OAAO,EAAE,kBAAkB;QAC3B,OAAO,EAAE,IAAI;QACb,YAAY;QACZ,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,qBAAqB,CAAC,IAAI,CAAC;QACvC,WAAW,EAAE,EAAE;QACf,KAAK,EACH,SAAS,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC;YAC5B,CAAC,CAAC;gBACE,UAAU,EAAE,SAAS,CAAC,KAAK,CAAC,UAAU;gBACtC,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO;gBAChC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,MAAM;gBAC9B,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,OAAO;aACjC;YACH,CAAC,CAAC,SAAS;KAChB,CAAA;AACH,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { type NamespacedId } from "@executioncontrolprotocol/types";
|
|
2
|
-
/** Core formatter ids that do not require environment binding. @category Harness */
|
|
3
|
-
export declare const CORE_FORMATTER_IDS: Set<string>;
|
|
4
|
-
/**
|
|
5
|
-
* Whether a formatter id is core-cataloged (always available).
|
|
6
|
-
* @category Harness
|
|
7
|
-
*/
|
|
8
|
-
export declare function isCoreFormatterId(formatId: string): boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Normalize harness config format field to extension id.
|
|
11
|
-
* @category Harness
|
|
12
|
-
*/
|
|
13
|
-
export declare function normalizeFormatId(format: string): NamespacedId;
|
|
14
|
-
/**
|
|
15
|
-
* Whether formatter is registered in catalog or core set.
|
|
16
|
-
* @category Harness
|
|
17
|
-
*/
|
|
18
|
-
export declare function isFormatterRegistered(formatId: string): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Infer model response format hint from formatter id.
|
|
21
|
-
* @category Harness
|
|
22
|
-
*/
|
|
23
|
-
/** Logical harness output format for TypeScript source (not an extension id). @category Harness */
|
|
24
|
-
export declare const HARNESS_OUTPUT_FORMAT_TYPESCRIPT: "typescript";
|
|
25
|
-
export declare function inferResponseFormatFromFormatter(formatId: string): "text" | "json" | "toon" | "eql" | undefined;
|
|
26
|
-
//# sourceMappingURL=format-resolve.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-resolve.d.ts","sourceRoot":"","sources":["../../src/harness/format-resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAG3F,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,aAG7B,CAAA;AAEF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAE9D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAI/D;AAED;;;GAGG;AACH,mGAAmG;AACnG,eAAO,MAAM,gCAAgC,EAAG,YAAqB,CAAA;AAErE,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAO9C"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ECP_CORE_FORMATTER_IDS } from "@executioncontrolprotocol/types";
|
|
2
|
-
import { getCatalogedExtension, normalizeExtensionId } from "../registry/extension-catalog.js";
|
|
3
|
-
/** Core formatter ids that do not require environment binding. @category Harness */
|
|
4
|
-
export const CORE_FORMATTER_IDS = new Set([
|
|
5
|
-
ECP_CORE_FORMATTER_IDS.JSON,
|
|
6
|
-
ECP_CORE_FORMATTER_IDS.FLUENT,
|
|
7
|
-
]);
|
|
8
|
-
/**
|
|
9
|
-
* Whether a formatter id is core-cataloged (always available).
|
|
10
|
-
* @category Harness
|
|
11
|
-
*/
|
|
12
|
-
export function isCoreFormatterId(formatId) {
|
|
13
|
-
return CORE_FORMATTER_IDS.has(normalizeExtensionId(formatId));
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Normalize harness config format field to extension id.
|
|
17
|
-
* @category Harness
|
|
18
|
-
*/
|
|
19
|
-
export function normalizeFormatId(format) {
|
|
20
|
-
return normalizeExtensionId(format);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Whether formatter is registered in catalog or core set.
|
|
24
|
-
* @category Harness
|
|
25
|
-
*/
|
|
26
|
-
export function isFormatterRegistered(formatId) {
|
|
27
|
-
const normalized = normalizeFormatId(formatId);
|
|
28
|
-
if (isCoreFormatterId(normalized))
|
|
29
|
-
return true;
|
|
30
|
-
return getCatalogedExtension(normalized) !== undefined;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Infer model response format hint from formatter id.
|
|
34
|
-
* @category Harness
|
|
35
|
-
*/
|
|
36
|
-
/** Logical harness output format for TypeScript source (not an extension id). @category Harness */
|
|
37
|
-
export const HARNESS_OUTPUT_FORMAT_TYPESCRIPT = "typescript";
|
|
38
|
-
export function inferResponseFormatFromFormatter(formatId) {
|
|
39
|
-
if (formatId === HARNESS_OUTPUT_FORMAT_TYPESCRIPT)
|
|
40
|
-
return "text";
|
|
41
|
-
const id = normalizeFormatId(formatId);
|
|
42
|
-
if (id === ECP_CORE_FORMATTER_IDS.JSON)
|
|
43
|
-
return "json";
|
|
44
|
-
if (id === "@executioncontrolprotocol/format-toon")
|
|
45
|
-
return "toon";
|
|
46
|
-
if (id === "@executioncontrolprotocol/format-eql")
|
|
47
|
-
return "eql";
|
|
48
|
-
return "text";
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=format-resolve.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format-resolve.js","sourceRoot":"","sources":["../../src/harness/format-resolve.ts"],"names":[],"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@ -1,41 +0,0 @@
|
|
|
1
|
-
import { type HarnessCapabilityId, type HarnessId, type NamespacedId } from "@executioncontrolprotocol/types";
|
|
2
|
-
import type { HarnessDefinition } from "./types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Normalize harness id to `@namespace/name` form.
|
|
5
|
-
* @category Harness
|
|
6
|
-
*/
|
|
7
|
-
export declare function normalizeHarnessId(ref: string): HarnessId;
|
|
8
|
-
/**
|
|
9
|
-
* Register a harness definition for catalog lookup and invocation.
|
|
10
|
-
* @category Harness
|
|
11
|
-
*/
|
|
12
|
-
export declare function catalogHarness(def: HarnessDefinition): void;
|
|
13
|
-
/**
|
|
14
|
-
* Look up a cataloged harness by id.
|
|
15
|
-
* @category Harness
|
|
16
|
-
*/
|
|
17
|
-
export declare function getCatalogedHarness(id: HarnessId | string): HarnessDefinition | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* List cataloged harness ids.
|
|
20
|
-
* @category Harness
|
|
21
|
-
*/
|
|
22
|
-
export declare function listCatalogedHarnessIds(): HarnessId[];
|
|
23
|
-
/**
|
|
24
|
-
* Parse harness id from evaluate capability id.
|
|
25
|
-
* @category Harness
|
|
26
|
-
*/
|
|
27
|
-
export declare function harnessIdFromCapabilityId(capabilityId: string): HarnessId | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Build harness evaluate capability id.
|
|
30
|
-
* @category Harness
|
|
31
|
-
*/
|
|
32
|
-
export declare function harnessEvaluateCapabilityId(harnessId: NamespacedId | string): HarnessCapabilityId;
|
|
33
|
-
/**
|
|
34
|
-
* Whether a capability id is a harness evaluate endpoint.
|
|
35
|
-
* Extension capabilities such as `@executioncontrolprotocol/ollama.evaluate` also end with `.evaluate` but are not harnesses.
|
|
36
|
-
* @category Harness
|
|
37
|
-
*/
|
|
38
|
-
export declare function isHarnessCapabilityId(capabilityId: string): boolean;
|
|
39
|
-
/** Clear harness catalog (unit tests). @internal */
|
|
40
|
-
export declare function resetHarnessCatalogForTests(): void;
|
|
41
|
-
//# sourceMappingURL=harness-catalog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"harness-catalog.d.ts","sourceRoot":"","sources":["../../src/harness/harness-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAInD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAGzD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,iBAAiB,GAAG,IAAI,CAE3D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAEzF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,IAAI,SAAS,EAAE,CAErD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAIrF;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,YAAY,GAAG,MAAM,GAAG,mBAAmB,CAGjG;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAInE;AAED,oDAAoD;AACpD,wBAAgB,2BAA2B,IAAI,IAAI,CAElD"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { ECP_HARNESS_CAPABILITY_NAME, } from "@executioncontrolprotocol/types";
|
|
2
|
-
const catalog = new Map();
|
|
3
|
-
/**
|
|
4
|
-
* Normalize harness id to `@namespace/name` form.
|
|
5
|
-
* @category Harness
|
|
6
|
-
*/
|
|
7
|
-
export function normalizeHarnessId(ref) {
|
|
8
|
-
if (ref.startsWith("@"))
|
|
9
|
-
return ref;
|
|
10
|
-
return `@executioncontrolprotocol/${ref}`;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Register a harness definition for catalog lookup and invocation.
|
|
14
|
-
* @category Harness
|
|
15
|
-
*/
|
|
16
|
-
export function catalogHarness(def) {
|
|
17
|
-
catalog.set(def.id, def);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Look up a cataloged harness by id.
|
|
21
|
-
* @category Harness
|
|
22
|
-
*/
|
|
23
|
-
export function getCatalogedHarness(id) {
|
|
24
|
-
return catalog.get(normalizeHarnessId(id));
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* List cataloged harness ids.
|
|
28
|
-
* @category Harness
|
|
29
|
-
*/
|
|
30
|
-
export function listCatalogedHarnessIds() {
|
|
31
|
-
return [...catalog.keys()];
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Parse harness id from evaluate capability id.
|
|
35
|
-
* @category Harness
|
|
36
|
-
*/
|
|
37
|
-
export function harnessIdFromCapabilityId(capabilityId) {
|
|
38
|
-
const suffix = `.${ECP_HARNESS_CAPABILITY_NAME}`;
|
|
39
|
-
if (!capabilityId.endsWith(suffix))
|
|
40
|
-
return undefined;
|
|
41
|
-
return capabilityId.slice(0, -suffix.length);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Build harness evaluate capability id.
|
|
45
|
-
* @category Harness
|
|
46
|
-
*/
|
|
47
|
-
export function harnessEvaluateCapabilityId(harnessId) {
|
|
48
|
-
const id = normalizeHarnessId(String(harnessId));
|
|
49
|
-
return `${id}.${ECP_HARNESS_CAPABILITY_NAME}`;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Whether a capability id is a harness evaluate endpoint.
|
|
53
|
-
* Extension capabilities such as `@executioncontrolprotocol/ollama.evaluate` also end with `.evaluate` but are not harnesses.
|
|
54
|
-
* @category Harness
|
|
55
|
-
*/
|
|
56
|
-
export function isHarnessCapabilityId(capabilityId) {
|
|
57
|
-
const harnessId = harnessIdFromCapabilityId(capabilityId);
|
|
58
|
-
if (!harnessId)
|
|
59
|
-
return false;
|
|
60
|
-
return getCatalogedHarness(harnessId) !== undefined;
|
|
61
|
-
}
|
|
62
|
-
/** Clear harness catalog (unit tests). @internal */
|
|
63
|
-
export function resetHarnessCatalogForTests() {
|
|
64
|
-
catalog.clear();
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=harness-catalog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"harness-catalog.js","sourceRoot":"","sources":["../../src/harness/harness-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,GAI5B,MAAM,iCAAiC,CAAA;AAGxC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAgC,CAAA;AAEvD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,GAAgB,CAAA;IAChD,OAAO,6BAA6B,GAAG,EAAe,CAAA;AACxD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,GAAsB;IACnD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;AAC1B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAsB;IACxD,OAAO,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,CAAA;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;AAC5B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,YAAoB;IAC5D,MAAM,MAAM,GAAG,IAAI,2BAA2B,EAAE,CAAA;IAChD,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAA;IACpD,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAc,CAAA;AAC3D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,SAAgC;IAC1E,MAAM,EAAE,GAAG,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAA;IAChD,OAAO,GAAG,EAAE,IAAI,2BAA2B,EAAyB,CAAA;AACtE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAoB;IACxD,MAAM,SAAS,GAAG,yBAAyB,CAAC,YAAY,CAAC,CAAA;IACzD,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAA;IAC5B,OAAO,mBAAmB,CAAC,SAAS,CAAC,KAAK,SAAS,CAAA;AACrD,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,2BAA2B;IACzC,OAAO,CAAC,KAAK,EAAE,CAAA;AACjB,CAAC"}
|
package/dist/harness/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { defineHarness, HarnessDefinitionBuilder, isHarnessDefinition } from "./define-harness.js";
|
|
2
|
-
export { catalogHarness, getCatalogedHarness, listCatalogedHarnessIds, harnessEvaluateCapabilityId, harnessIdFromCapabilityId, isHarnessCapabilityId, } from "./harness-catalog.js";
|
|
3
|
-
export type { ErasedHarnessHandler, HarnessConfigOf, HarnessDefinition, HarnessHandler, HarnessInputOf, HarnessOutputOf, } from "./types.js";
|
|
4
|
-
export type { HarnessCapabilityContext } from "./context.js";
|
|
5
|
-
export { callModelGenerate, HARNESS_MODEL_GENERATE_OPTIONS } from "./call-model.js";
|
|
6
|
-
export { isCoreFormatterId, CORE_FORMATTER_IDS, inferResponseFormatFromFormatter, HARNESS_OUTPUT_FORMAT_TYPESCRIPT, } from "./format-resolve.js";
|
|
7
|
-
export { runModelRepairLoop, type ModelRepairGenerateContext, type ModelRepairEvaluateResult, type RunModelRepairLoopOptions, type ModelRepairLoopResult, } from "./run-model-repair-loop.js";
|
|
8
|
-
export { isHarnessTimingDebugEnabled, summarizeRepairAttemptTiming, formatRepairLoopTimingReport, logRepairLoopTiming, } from "./repair-loop-timing.js";
|
|
9
|
-
export { harnessPromptFixtureSchema, loadSchemaExample, loadSchemaExampleEql, formatSchemaExampleJson, formatSchemaExampleEql, buildSystemPromptFromFixture, buildRepairHintFromFixture, type HarnessPromptFixture, } from "./prompts/index.js";
|
|
10
|
-
export * from "./authoring/index.js";
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/harness/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAClG,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAA;AACnB,YAAY,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAA;AACnF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,GAC3B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAA;AAC3B,cAAc,sBAAsB,CAAA"}
|
package/dist/harness/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { defineHarness, HarnessDefinitionBuilder, isHarnessDefinition } from "./define-harness.js";
|
|
2
|
-
export { catalogHarness, getCatalogedHarness, listCatalogedHarnessIds, harnessEvaluateCapabilityId, harnessIdFromCapabilityId, isHarnessCapabilityId, } from "./harness-catalog.js";
|
|
3
|
-
export { callModelGenerate, HARNESS_MODEL_GENERATE_OPTIONS } from "./call-model.js";
|
|
4
|
-
export { isCoreFormatterId, CORE_FORMATTER_IDS, inferResponseFormatFromFormatter, HARNESS_OUTPUT_FORMAT_TYPESCRIPT, } from "./format-resolve.js";
|
|
5
|
-
export { runModelRepairLoop, } from "./run-model-repair-loop.js";
|
|
6
|
-
export { isHarnessTimingDebugEnabled, summarizeRepairAttemptTiming, formatRepairLoopTimingReport, logRepairLoopTiming, } from "./repair-loop-timing.js";
|
|
7
|
-
export { harnessPromptFixtureSchema, loadSchemaExample, loadSchemaExampleEql, formatSchemaExampleJson, formatSchemaExampleEql, buildSystemPromptFromFixture, buildRepairHintFromFixture, } from "./prompts/index.js";
|
|
8
|
-
export * from "./authoring/index.js";
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/harness/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAClG,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,sBAAsB,CAAA;AAU7B,OAAO,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAA;AACnF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,kBAAkB,GAKnB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,0BAA0B,EAC1B,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,0BAA0B,GAE3B,MAAM,oBAAoB,CAAA;AAC3B,cAAc,sBAAsB,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { HarnessPromptFixture } from "./harness-prompt-fixture-schema.js";
|
|
2
|
-
/**
|
|
3
|
-
* Build repair-line text from an in-memory harness prompt fixture.
|
|
4
|
-
* TypeScript / JSON return prose only (no EQL example shapes). EQL appends an example shape.
|
|
5
|
-
* @category Harness
|
|
6
|
-
*/
|
|
7
|
-
export declare function buildRepairHintFromFixture(fixture: HarnessPromptFixture): string;
|
|
8
|
-
//# sourceMappingURL=build-repair-hint.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-repair-hint.d.ts","sourceRoot":"","sources":["../../../src/harness/prompts/build-repair-hint.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AAS9E;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAchF"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { formatSchemaExampleEql, formatSchemaExampleJson } from "./load-schema-example.js";
|
|
2
|
-
function formatRepairExample(outputSchema, eql) {
|
|
3
|
-
if (eql && outputSchema === "@executioncontrolprotocol.patch") {
|
|
4
|
-
return "PATCH WORKFLOW <workflow-id> then only required UPDATE/ADD/DELETE/MOVE lines with real step ids.";
|
|
5
|
-
}
|
|
6
|
-
return eql ? formatSchemaExampleEql(outputSchema) : formatSchemaExampleJson(outputSchema);
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Build repair-line text from an in-memory harness prompt fixture.
|
|
10
|
-
* TypeScript / JSON return prose only (no EQL example shapes). EQL appends an example shape.
|
|
11
|
-
* @category Harness
|
|
12
|
-
*/
|
|
13
|
-
export function buildRepairHintFromFixture(fixture) {
|
|
14
|
-
const format = fixture.promptFormat ?? "eql";
|
|
15
|
-
if (format === "typescript") {
|
|
16
|
-
return fixture.repairHint ?? "Return corrected TypeScript only.";
|
|
17
|
-
}
|
|
18
|
-
if (format === "json") {
|
|
19
|
-
return fixture.repairHint ?? "Return corrected JSON only.";
|
|
20
|
-
}
|
|
21
|
-
const parts = [fixture.repairHint ?? "Return corrected EQL only."];
|
|
22
|
-
if (fixture.outputSchema !== "@executioncontrolprotocol.patch") {
|
|
23
|
-
const example = formatRepairExample(fixture.outputSchema, true);
|
|
24
|
-
parts.push(`Example shape:\n${example}`);
|
|
25
|
-
}
|
|
26
|
-
return parts.join(" ");
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=build-repair-hint.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-repair-hint.js","sourceRoot":"","sources":["../../../src/harness/prompts/build-repair-hint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAG1F,SAAS,mBAAmB,CAAC,YAAoB,EAAE,GAAY;IAC7D,IAAI,GAAG,IAAI,YAAY,KAAK,iCAAiC,EAAE,CAAC;QAC9D,OAAO,kGAAkG,CAAA;IAC3G,CAAC;IACD,OAAO,GAAG,CAAC,CAAC,CAAC,sBAAsB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAA;AAC3F,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAA6B;IACtE,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,IAAI,KAAK,CAAA;IAC5C,IAAI,MAAM,KAAK,YAAY,EAAE,CAAC;QAC5B,OAAO,OAAO,CAAC,UAAU,IAAI,mCAAmC,CAAA;IAClE,CAAC;IACD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,OAAO,OAAO,CAAC,UAAU,IAAI,6BAA6B,CAAA;IAC5D,CAAC;IACD,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,UAAU,IAAI,4BAA4B,CAAC,CAAA;IAClE,IAAI,OAAO,CAAC,YAAY,KAAK,iCAAiC,EAAE,CAAC;QAC/D,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;QAC/D,KAAK,CAAC,IAAI,CAAC,mBAAmB,OAAO,EAAE,CAAC,CAAA;IAC1C,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { HarnessPromptFixture } from "./harness-prompt-fixture-schema.js";
|
|
2
|
-
/**
|
|
3
|
-
* Build the system prompt string from an in-memory harness prompt fixture.
|
|
4
|
-
* @category Harness
|
|
5
|
-
*/
|
|
6
|
-
export declare function buildSystemPromptFromFixture(fixture: HarnessPromptFixture): string;
|
|
7
|
-
//# sourceMappingURL=build-system-prompt.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-system-prompt.d.ts","sourceRoot":"","sources":["../../../src/harness/prompts/build-system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AAmD9E;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CA+ClF"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { formatSchemaExampleEql, formatSchemaExampleJson } from "./load-schema-example.js";
|
|
2
|
-
import { eqlPrimerForOutputSchema } from "./eql-primer.js";
|
|
3
|
-
import { ECP_ASSISTANT_IDENTITY_PRIMER } from "./identity-primer.js";
|
|
4
|
-
import { typescriptPrimerForOutputSchema } from "./typescript-primer.js";
|
|
5
|
-
function usesEql(fixture) {
|
|
6
|
-
return fixture.promptFormat === "eql";
|
|
7
|
-
}
|
|
8
|
-
function usesTypeScript(fixture) {
|
|
9
|
-
return fixture.promptFormat === "typescript";
|
|
10
|
-
}
|
|
11
|
-
function formatAllowedValues(fixture) {
|
|
12
|
-
if (!fixture.allowedValues)
|
|
13
|
-
return [];
|
|
14
|
-
const lines = ["Allowed values:"];
|
|
15
|
-
for (const [field, values] of Object.entries(fixture.allowedValues)) {
|
|
16
|
-
lines.push(`- ${field}: ${values.join(", ")}`);
|
|
17
|
-
}
|
|
18
|
-
return lines;
|
|
19
|
-
}
|
|
20
|
-
function formatDefinitions(fixture) {
|
|
21
|
-
if (!fixture.definitions?.length)
|
|
22
|
-
return [];
|
|
23
|
-
const lines = ["Intent definitions:"];
|
|
24
|
-
for (const def of fixture.definitions) {
|
|
25
|
-
lines.push(`- ${def.intent}: ${def.when}`);
|
|
26
|
-
}
|
|
27
|
-
return lines;
|
|
28
|
-
}
|
|
29
|
-
function formatFewShots(fixture) {
|
|
30
|
-
if (!fixture.fewShots?.length)
|
|
31
|
-
return [];
|
|
32
|
-
const header = usesTypeScript(fixture)
|
|
33
|
-
? "Examples (message -> TypeScript output):"
|
|
34
|
-
: usesEql(fixture)
|
|
35
|
-
? "Additional examples (message -> EQL output):"
|
|
36
|
-
: "Examples (message -> JSON output):";
|
|
37
|
-
const lines = [header];
|
|
38
|
-
for (const shot of fixture.fewShots) {
|
|
39
|
-
lines.push(`User: ${shot.message}`);
|
|
40
|
-
if (typeof shot.output === "string") {
|
|
41
|
-
lines.push(`Output:\n${shot.output.trimEnd()}`);
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
lines.push(`Output: ${JSON.stringify(shot.output)}`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return lines;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Build the system prompt string from an in-memory harness prompt fixture.
|
|
51
|
-
* @category Harness
|
|
52
|
-
*/
|
|
53
|
-
export function buildSystemPromptFromFixture(fixture) {
|
|
54
|
-
const identityBlock = fixture.identity ? [ECP_ASSISTANT_IDENTITY_PRIMER] : [];
|
|
55
|
-
if (usesTypeScript(fixture)) {
|
|
56
|
-
const sections = [
|
|
57
|
-
...identityBlock,
|
|
58
|
-
typescriptPrimerForOutputSchema(fixture.outputSchema),
|
|
59
|
-
...formatFewShots(fixture),
|
|
60
|
-
[fixture.role, fixture.task].filter(Boolean).join("\n"),
|
|
61
|
-
...formatAllowedValues(fixture),
|
|
62
|
-
...formatDefinitions(fixture),
|
|
63
|
-
"Reply with TypeScript only. No markdown fences. No prose outside code.",
|
|
64
|
-
].filter((s) => s.length > 0);
|
|
65
|
-
return sections.join("\n\n");
|
|
66
|
-
}
|
|
67
|
-
const eql = usesEql(fixture);
|
|
68
|
-
const example = eql
|
|
69
|
-
? formatSchemaExampleEql(fixture.outputSchema)
|
|
70
|
-
: formatSchemaExampleJson(fixture.outputSchema);
|
|
71
|
-
const sections = eql
|
|
72
|
-
? [
|
|
73
|
-
...identityBlock,
|
|
74
|
-
eqlPrimerForOutputSchema(fixture.outputSchema),
|
|
75
|
-
fixture.outputSchema === "@executioncontrolprotocol.patch"
|
|
76
|
-
? undefined
|
|
77
|
-
: `Operation syntax sample (${fixture.outputSchema}):\n${example}`,
|
|
78
|
-
...formatFewShots(fixture),
|
|
79
|
-
[fixture.role, fixture.task].filter(Boolean).join("\n"),
|
|
80
|
-
...formatAllowedValues(fixture),
|
|
81
|
-
...formatDefinitions(fixture),
|
|
82
|
-
"Reply with SQL-like EQL only. No markdown fences. No header line.",
|
|
83
|
-
].filter((s) => s !== undefined && s.length > 0)
|
|
84
|
-
: [
|
|
85
|
-
...identityBlock,
|
|
86
|
-
fixture.role,
|
|
87
|
-
fixture.task,
|
|
88
|
-
`Output schema: ${fixture.outputSchema}`,
|
|
89
|
-
`Example output (copy this shape exactly): ${example}`,
|
|
90
|
-
...formatAllowedValues(fixture),
|
|
91
|
-
...formatDefinitions(fixture),
|
|
92
|
-
...formatFewShots(fixture),
|
|
93
|
-
"Reply with JSON only. No markdown fences.",
|
|
94
|
-
];
|
|
95
|
-
return sections.filter((s) => s.length > 0).join("\n\n");
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=build-system-prompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-system-prompt.js","sourceRoot":"","sources":["../../../src/harness/prompts/build-system-prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAA;AAExE,SAAS,OAAO,CAAC,OAA6B;IAC5C,OAAO,OAAO,CAAC,YAAY,KAAK,KAAK,CAAA;AACvC,CAAC;AAED,SAAS,cAAc,CAAC,OAA6B;IACnD,OAAO,OAAO,CAAC,YAAY,KAAK,YAAY,CAAA;AAC9C,CAAC;AAED,SAAS,mBAAmB,CAAC,OAA6B;IACxD,IAAI,CAAC,OAAO,CAAC,aAAa;QAAE,OAAO,EAAE,CAAA;IACrC,MAAM,KAAK,GAAa,CAAC,iBAAiB,CAAC,CAAA;IAC3C,KAAK,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,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AY,OAAO,OAAO,EAAE;YACpE,GAAG,cAAc,CAAC,OAAO,CAAC;YAC1B,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACvD,GAAG,mBAAmB,CAAC,OAAO,CAAC;YAC/B,GAAG,iBAAiB,CAAC,OAAO,CAAC;YAC7B,mEAAmE;SACpE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAC/D,CAAC,CAAC;YACE,GAAG,aAAa;YAChB,OAAO,CAAC,IAAI;YACZ,OAAO,CAAC,IAAI;YACZ,kBAAkB,OAAO,CAAC,YAAY,EAAE;YACxC,6CAA6C,OAAO,EAAE;YACtD,GAAG,mBAAmB,CAAC,OAAO,CAAC;YAC/B,GAAG,iBAAiB,CAAC,OAAO,CAAC;YAC7B,GAAG,cAAc,CAAC,OAAO,CAAC;YAC1B,2CAA2C;SAC5C,CAAA;IAEL,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAC1D,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** Shared EQL language primer blocks for harness system prompts. @internal */
|
|
2
|
-
export declare const EQL_ZERO_KNOWLEDGE_INTRO: string;
|
|
3
|
-
export declare const EQL_VALUE_EXPRESSIONS: string;
|
|
4
|
-
export declare const EQL_WORKFLOW_IO: string;
|
|
5
|
-
export declare const EQL_WORKFLOW_OPERATIONS: string;
|
|
6
|
-
export declare const EQL_PATCH_OPERATIONS: string;
|
|
7
|
-
export declare const EQL_PATCH_CANONICAL_EXAMPLES: string;
|
|
8
|
-
export declare const EQL_WORKFLOW_PRIMER: string;
|
|
9
|
-
export declare const EQL_PATCH_PRIMER: string;
|
|
10
|
-
export declare const EQL_INTENT_PRIMER: string;
|
|
11
|
-
export declare const EQL_REPLY_PRIMER: string;
|
|
12
|
-
/** Pick the EQL primer for a harness output schema id. */
|
|
13
|
-
export declare function eqlPrimerForOutputSchema(outputSchema: string): string;
|
|
14
|
-
//# sourceMappingURL=eql-primer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eql-primer.d.ts","sourceRoot":"","sources":["../../../src/harness/prompts/eql-primer.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAE9E,eAAO,MAAM,wBAAwB,QAezB,CAAA;AAEZ,eAAO,MAAM,qBAAqB,QAQtB,CAAA;AAEZ,eAAO,MAAM,eAAe,QAYhB,CAAA;AAEZ,eAAO,MAAM,uBAAuB,QAUxB,CAAA;AAEZ,eAAO,MAAM,oBAAoB,QAwCrB,CAAA;AAEZ,eAAO,MAAM,4BAA4B,QA0E7B,CAAA;AAEZ,eAAO,MAAM,mBAAmB,QAQpB,CAAA;AAEZ,eAAO,MAAM,gBAAgB,QAUjB,CAAA;AAEZ,eAAO,MAAM,iBAAiB,QAQlB,CAAA;AAEZ,eAAO,MAAM,gBAAgB,QASjB,CAAA;AAEZ,0DAA0D;AAC1D,wBAAgB,wBAAwB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAarE"}
|