@boboddy/sdk 0.0.12-alpha → 0.0.13-alpha
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/dist/client.js +62 -0
- package/dist/define-step.js +1018 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1016 -0
- package/dist/step-definitions-client.js +47 -0
- package/dist/treaty.js +34 -0
- package/package.json +1 -1
- package/dist/apps/api/src/app.d.ts +0 -19731
- package/dist/apps/api/src/contracts.d.ts +0 -20
- package/dist/apps/api/src/http/error-handler.d.ts +0 -23
- package/dist/apps/api/src/http/routes/auth.d.ts +0 -57
- package/dist/apps/api/src/http/routes/authenticated.d.ts +0 -79
- package/dist/apps/api/src/http/routes/feedback-requests.d.ts +0 -281
- package/dist/apps/api/src/http/routes/linear-pipeline-definitions.d.ts +0 -1563
- package/dist/apps/api/src/http/routes/linear-pipeline-executions.d.ts +0 -2540
- package/dist/apps/api/src/http/routes/project-context-entries.d.ts +0 -387
- package/dist/apps/api/src/http/routes/projects.d.ts +0 -1906
- package/dist/apps/api/src/http/routes/step-definition-templates.d.ts +0 -479
- package/dist/apps/api/src/http/routes/step-definitions.d.ts +0 -917
- package/dist/apps/api/src/http/routes/step-execution-route-helpers.d.ts +0 -64
- package/dist/apps/api/src/http/routes/step-executions.d.ts +0 -1485
- package/dist/apps/api/src/http/routes/work-items.d.ts +0 -966
- package/dist/apps/api/src/problem-details.d.ts +0 -9
- package/dist/packages/core/src/access/authorization/application/user-authorization-service.d.ts +0 -12
- package/dist/packages/core/src/access/authorization/infra/project-authorization-service.d.ts +0 -9
- package/dist/packages/core/src/agent-sessions/project-runtime-session/application/ai-container-launcher.d.ts +0 -21
- package/dist/packages/core/src/agent-sessions/project-runtime-session/application/create-project-runtime-session.d.ts +0 -15
- package/dist/packages/core/src/agent-sessions/project-runtime-session/application/devcontainer-launcher.d.ts +0 -21
- package/dist/packages/core/src/agent-sessions/project-runtime-session/application/get-project-runtime-session.d.ts +0 -13
- package/dist/packages/core/src/agent-sessions/project-runtime-session/application/git-clone-service.d.ts +0 -11
- package/dist/packages/core/src/agent-sessions/project-runtime-session/application/list-project-runtime-sessions.d.ts +0 -13
- package/dist/packages/core/src/agent-sessions/project-runtime-session/application/project-runtime-session-contract-mapper.d.ts +0 -3
- package/dist/packages/core/src/agent-sessions/project-runtime-session/application/project-runtime-session-execution-target.d.ts +0 -3
- package/dist/packages/core/src/agent-sessions/project-runtime-session/application/project-runtime-session-network-metadata.d.ts +0 -15
- package/dist/packages/core/src/agent-sessions/project-runtime-session/application/project-runtime-session-repo.d.ts +0 -10
- package/dist/packages/core/src/agent-sessions/project-runtime-session/application/runtime-session-network-manager.d.ts +0 -14
- package/dist/packages/core/src/agent-sessions/project-runtime-session/application/stop-project-runtime-session.d.ts +0 -31
- package/dist/packages/core/src/agent-sessions/project-runtime-session/application/workspace-manager.d.ts +0 -10
- package/dist/packages/core/src/agent-sessions/project-runtime-session/contracts/project-runtime-session-contracts.d.ts +0 -62
- package/dist/packages/core/src/agent-sessions/project-runtime-session/domain/project-runtime-session-entity-helpers.d.ts +0 -12
- package/dist/packages/core/src/agent-sessions/project-runtime-session/domain/project-runtime-session-entity.d.ts +0 -99
- package/dist/packages/core/src/agent-sessions/project-runtime-session/domain/project-runtime-session-execution-target.d.ts +0 -16
- package/dist/packages/core/src/agent-sessions/project-runtime-session/infra/devcontainer-cli-launcher.d.ts +0 -6
- package/dist/packages/core/src/agent-sessions/project-runtime-session/infra/docker-ai-container-launcher.d.ts +0 -8
- package/dist/packages/core/src/agent-sessions/project-runtime-session/infra/drizzle-project-runtime-session-repo.d.ts +0 -11
- package/dist/packages/core/src/agent-sessions/project-runtime-session/infra/git-cli-clone-service.d.ts +0 -4
- package/dist/packages/core/src/agent-sessions/project-runtime-session/infra/local-devcontainer-jsonc.d.ts +0 -4
- package/dist/packages/core/src/agent-sessions/project-runtime-session/infra/local-devcontainer-port-forward-manager-support.d.ts +0 -42
- package/dist/packages/core/src/agent-sessions/project-runtime-session/infra/local-devcontainer-port-forward-manager.d.ts +0 -24
- package/dist/packages/core/src/agent-sessions/project-runtime-session/infra/local-devcontainer-working-directory.d.ts +0 -5
- package/dist/packages/core/src/agent-sessions/project-runtime-session/infra/local-docker-runtime-session-network-manager.d.ts +0 -17
- package/dist/packages/core/src/agent-sessions/project-runtime-session/infra/local-workspace-manager.d.ts +0 -11
- package/dist/packages/core/src/agent-sessions/runtime-command/application/complete-claimed-runtime-command.d.ts +0 -13
- package/dist/packages/core/src/agent-sessions/runtime-command/application/create-runtime-command.d.ts +0 -19
- package/dist/packages/core/src/agent-sessions/runtime-command/application/fail-claimed-runtime-command.d.ts +0 -13
- package/dist/packages/core/src/agent-sessions/runtime-command/application/interrupt-claimed-runtime-command.d.ts +0 -13
- package/dist/packages/core/src/agent-sessions/runtime-command/application/run-runtime-command-locally.d.ts +0 -27
- package/dist/packages/core/src/agent-sessions/runtime-command/application/runtime-command-claim-helpers.d.ts +0 -1
- package/dist/packages/core/src/agent-sessions/runtime-command/application/runtime-command-contract-mapper.d.ts +0 -3
- package/dist/packages/core/src/agent-sessions/runtime-command/application/runtime-command-output-summary.d.ts +0 -4
- package/dist/packages/core/src/agent-sessions/runtime-command/application/runtime-command-repo.d.ts +0 -20
- package/dist/packages/core/src/agent-sessions/runtime-command/application/runtime-command-runner.d.ts +0 -25
- package/dist/packages/core/src/agent-sessions/runtime-command/contracts/runtime-command-contracts.d.ts +0 -194
- package/dist/packages/core/src/agent-sessions/runtime-command/domain/runtime-command-entity.d.ts +0 -111
- package/dist/packages/core/src/agent-sessions/runtime-command/infra/drizzle-runtime-command-repo.d.ts +0 -20
- package/dist/packages/core/src/agent-sessions/runtime-command/infra/local-runtime-command-runner.d.ts +0 -25
- package/dist/packages/core/src/agent-sessions/runtime-environment/domain/runtime-environment.d.ts +0 -12
- package/dist/packages/core/src/agent-sessions/runtime-operation-event/application/runtime-operation-event-publisher.d.ts +0 -24
- package/dist/packages/core/src/agent-sessions/runtime-operation-event/application/runtime-operation-event-repo.d.ts +0 -17
- package/dist/packages/core/src/agent-sessions/runtime-operation-event/domain/runtime-operation-event.d.ts +0 -35
- package/dist/packages/core/src/agent-sessions/runtime-operation-event/infra/file-runtime-operation-event-repo.d.ts +0 -25
- package/dist/packages/core/src/agent-sessions/runtime-service/application/create-runtime-service.d.ts +0 -19
- package/dist/packages/core/src/agent-sessions/runtime-service/application/get-runtime-service.d.ts +0 -13
- package/dist/packages/core/src/agent-sessions/runtime-service/application/runtime-service-contract-mapper.d.ts +0 -3
- package/dist/packages/core/src/agent-sessions/runtime-service/application/runtime-service-output-summary.d.ts +0 -10
- package/dist/packages/core/src/agent-sessions/runtime-service/application/runtime-service-repo.d.ts +0 -9
- package/dist/packages/core/src/agent-sessions/runtime-service/application/runtime-service-runner.d.ts +0 -23
- package/dist/packages/core/src/agent-sessions/runtime-service/application/runtime-session-service-exposure-provider.d.ts +0 -19
- package/dist/packages/core/src/agent-sessions/runtime-service/application/start-runtime-service-locally.d.ts +0 -23
- package/dist/packages/core/src/agent-sessions/runtime-service/application/stop-runtime-service.d.ts +0 -34
- package/dist/packages/core/src/agent-sessions/runtime-service/contracts/runtime-service-contracts.d.ts +0 -140
- package/dist/packages/core/src/agent-sessions/runtime-service/domain/runtime-service-access-point.d.ts +0 -12
- package/dist/packages/core/src/agent-sessions/runtime-service/domain/runtime-service-entity.d.ts +0 -76
- package/dist/packages/core/src/agent-sessions/runtime-service/domain/runtime-service-healthcheck.d.ts +0 -20
- package/dist/packages/core/src/agent-sessions/runtime-service/infra/drizzle-runtime-service-repo.d.ts +0 -9
- package/dist/packages/core/src/agent-sessions/runtime-service/infra/local-runtime-service-readiness-probe.d.ts +0 -42
- package/dist/packages/core/src/agent-sessions/runtime-service/infra/local-runtime-service-runner.d.ts +0 -32
- package/dist/packages/core/src/common/contracts/json.d.ts +0 -9
- package/dist/packages/core/src/common/contracts/opencode-mcp.d.ts +0 -73
- package/dist/packages/core/src/common/contracts/uuid-v7.d.ts +0 -8
- package/dist/packages/core/src/lib/db/db-executor.d.ts +0 -4
- package/dist/packages/core/src/lib/db/index.d.ts +0 -7
- package/dist/packages/core/src/lib/db/schema.d.ts +0 -4950
- package/dist/packages/core/src/lib/di.d.ts +0 -113
- package/dist/packages/core/src/lib/domain-events/domain-event.d.ts +0 -12
- package/dist/packages/core/src/lib/domain-events/in-memory-domain-event-dispatcher.d.ts +0 -7
- package/dist/packages/core/src/lib/errors.d.ts +0 -37
- package/dist/packages/core/src/lib/logger.d.ts +0 -7
- package/dist/packages/core/src/lib/result.d.ts +0 -15
- package/dist/packages/core/src/lib/time-provider.d.ts +0 -5
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/add-linear-pipeline-step-definition.d.ts +0 -13
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/archive-linear-pipeline-definition.d.ts +0 -13
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/create-linear-pipeline-definition.d.ts +0 -11
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/get-linear-pipeline-definition.d.ts +0 -11
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/linear-pipeline-definition-contract-mapper.d.ts +0 -3
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/linear-pipeline-definition-repo.d.ts +0 -9
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/list-linear-pipeline-definitions.d.ts +0 -9
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/remove-linear-pipeline-step-definition.d.ts +0 -13
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/set-linear-pipeline-step-advancement-policy-definition.d.ts +0 -13
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/update-linear-pipeline-definition.d.ts +0 -13
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/application/update-linear-pipeline-step-definition.d.ts +0 -13
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/contracts/linear-pipeline-definition-contracts.d.ts +0 -357
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/domain/linear-pipeline-definition-entity.d.ts +0 -36
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/entities/linear-pipeline-step-advancement-policy-definition-entity.d.ts +0 -42
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/entities/linear-pipeline-step-definition-entity.d.ts +0 -42
- package/dist/packages/core/src/pipeline-definitions/pipeline-definition/infra/drizzle-linear-pipeline-definition-repo.d.ts +0 -11
- package/dist/packages/core/src/pipeline-definitions/step-definition/application/archive-step-definition.d.ts +0 -13
- package/dist/packages/core/src/pipeline-definitions/step-definition/application/create-step-definition.d.ts +0 -11
- package/dist/packages/core/src/pipeline-definitions/step-definition/application/get-step-definition.d.ts +0 -11
- package/dist/packages/core/src/pipeline-definitions/step-definition/application/list-step-definitions.d.ts +0 -9
- package/dist/packages/core/src/pipeline-definitions/step-definition/application/step-definition-contract-mapper.d.ts +0 -3
- package/dist/packages/core/src/pipeline-definitions/step-definition/application/step-definition-repo.d.ts +0 -9
- package/dist/packages/core/src/pipeline-definitions/step-definition/application/update-step-definition.d.ts +0 -13
- package/dist/packages/core/src/pipeline-definitions/step-definition/contracts/step-definition-contracts.d.ts +0 -281
- package/dist/packages/core/src/pipeline-definitions/step-definition/domain/step-definition-entity.d.ts +0 -53
- package/dist/packages/core/src/pipeline-definitions/step-definition/entities/computed-signal-definition-entity.d.ts +0 -31
- package/dist/packages/core/src/pipeline-definitions/step-definition/entities/signal-extractor-definition-entity.d.ts +0 -30
- package/dist/packages/core/src/pipeline-definitions/step-definition/infra/drizzle-step-definition-repo.d.ts +0 -11
- package/dist/packages/core/src/pipeline-definitions/step-definition-template/application/get-step-definition-template.d.ts +0 -8
- package/dist/packages/core/src/pipeline-definitions/step-definition-template/application/instantiate-step-definition-template.d.ts +0 -15
- package/dist/packages/core/src/pipeline-definitions/step-definition-template/application/list-step-definition-templates.d.ts +0 -5
- package/dist/packages/core/src/pipeline-definitions/step-definition-template/application/step-definition-template-repo.d.ts +0 -7
- package/dist/packages/core/src/pipeline-definitions/step-definition-template/contracts/step-definition-template-contracts.d.ts +0 -98
- package/dist/packages/core/src/pipeline-definitions/step-definition-template/domain/step-definition-template-entity.d.ts +0 -37
- package/dist/packages/core/src/pipeline-definitions/step-definition-template/infra/drizzle-step-definition-template-repo.d.ts +0 -9
- package/dist/packages/core/src/pipeline-executions/feedback-request/application/create-feedback-requests-on-step-signal-created.d.ts +0 -9
- package/dist/packages/core/src/pipeline-executions/feedback-request/application/decline-feedback-request.d.ts +0 -13
- package/dist/packages/core/src/pipeline-executions/feedback-request/application/feedback-request-repo.d.ts +0 -8
- package/dist/packages/core/src/pipeline-executions/feedback-request/application/list-feedback-requests-by-step-signal.d.ts +0 -14
- package/dist/packages/core/src/pipeline-executions/feedback-request/contracts/feedback-request-contracts.d.ts +0 -21
- package/dist/packages/core/src/pipeline-executions/feedback-request/domain/feedback-request-entity.d.ts +0 -29
- package/dist/packages/core/src/pipeline-executions/feedback-request/infra/drizzle-feedback-request-repo.d.ts +0 -10
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/accept-linear-pipeline-step-run.d.ts +0 -19
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/apply-linear-pipeline-step-result-and-advance.d.ts +0 -21
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/cancel-linear-pipeline-execution.d.ts +0 -15
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/create-linear-pipeline-execution.d.ts +0 -15
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/create-linear-pipeline-step-run-attempt.d.ts +0 -17
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/get-linear-pipeline-execution.d.ts +0 -15
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/linear-pipeline-execution-contract-mapper.d.ts +0 -3
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/linear-pipeline-execution-helpers.d.ts +0 -52
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/linear-pipeline-execution-repo.d.ts +0 -15
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/linear-pipeline-step-input-resolution.d.ts +0 -5
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/list-linear-pipeline-executions-by-definition.d.ts +0 -15
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/list-linear-pipeline-executions.d.ts +0 -13
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/mark-linear-pipeline-step-run-attempt-running.d.ts +0 -15
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/project-linear-pipeline-executions.d.ts +0 -10
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/queue-first-linear-pipeline-step-run.d.ts +0 -19
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/retrigger-linear-pipeline-step-run.d.ts +0 -17
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/application/start-linear-pipeline-execution.d.ts +0 -19
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/contracts/linear-pipeline-execution-contracts.d.ts +0 -330
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/domain/linear-pipeline-execution-entity.d.ts +0 -43
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/entities/linear-pipeline-execution-event-entity.d.ts +0 -25
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/entities/linear-pipeline-step-evaluation-entity.d.ts +0 -45
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/entities/linear-pipeline-step-run-attempt-entity.d.ts +0 -24
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/entities/linear-pipeline-step-run-entity.d.ts +0 -63
- package/dist/packages/core/src/pipeline-executions/pipeline-execution/infra/drizzle-linear-pipeline-execution-repo.d.ts +0 -19
- package/dist/packages/core/src/pipeline-executions/step-execution/application/add-step-execution-result.d.ts +0 -13
- package/dist/packages/core/src/pipeline-executions/step-execution/application/claim-step-executions.d.ts +0 -19
- package/dist/packages/core/src/pipeline-executions/step-execution/application/complete-claimed-step-execution.d.ts +0 -39
- package/dist/packages/core/src/pipeline-executions/step-execution/application/create-step-execution.d.ts +0 -11
- package/dist/packages/core/src/pipeline-executions/step-execution/application/extract-step-execution-signals.d.ts +0 -17
- package/dist/packages/core/src/pipeline-executions/step-execution/application/get-step-execution-worker-context.d.ts +0 -17
- package/dist/packages/core/src/pipeline-executions/step-execution/application/get-step-execution.d.ts +0 -13
- package/dist/packages/core/src/pipeline-executions/step-execution/application/heartbeat-step-execution-claim.d.ts +0 -21
- package/dist/packages/core/src/pipeline-executions/step-execution/application/list-step-executions-by-project.d.ts +0 -11
- package/dist/packages/core/src/pipeline-executions/step-execution/application/load-status-adjusted-step-executions.d.ts +0 -31
- package/dist/packages/core/src/pipeline-executions/step-execution/application/mark-step-execution-running.d.ts +0 -13
- package/dist/packages/core/src/pipeline-executions/step-execution/application/step-execution-claim-helpers.d.ts +0 -13
- package/dist/packages/core/src/pipeline-executions/step-execution/application/step-execution-contract-mapper.d.ts +0 -7
- package/dist/packages/core/src/pipeline-executions/step-execution/application/step-execution-repo.d.ts +0 -29
- package/dist/packages/core/src/pipeline-executions/step-execution/contracts/step-execution-contracts.d.ts +0 -325
- package/dist/packages/core/src/pipeline-executions/step-execution/domain/step-execution-entity.d.ts +0 -61
- package/dist/packages/core/src/pipeline-executions/step-execution/domain/step-signal-created.domain-event.d.ts +0 -18
- package/dist/packages/core/src/pipeline-executions/step-execution/entities/step-execution-result-entity.d.ts +0 -32
- package/dist/packages/core/src/pipeline-executions/step-execution/entities/step-signal-entity.d.ts +0 -36
- package/dist/packages/core/src/pipeline-executions/step-execution/infra/drizzle-step-execution-repo.d.ts +0 -31
- package/dist/packages/core/src/projects/project/application/create-project.d.ts +0 -13
- package/dist/packages/core/src/projects/project/application/default-pipelines/default-create-failing-test-step-definition.d.ts +0 -4
- package/dist/packages/core/src/projects/project/application/default-pipelines/default-description-quality-step-definition.d.ts +0 -4
- package/dist/packages/core/src/projects/project/application/default-pipelines/default-fix-failing-test-step-definition.d.ts +0 -4
- package/dist/packages/core/src/projects/project/application/default-pipelines/default-linear-pipeline-conventions.d.ts +0 -9
- package/dist/packages/core/src/projects/project/application/default-pipelines/default-linear-pipeline-definitions.d.ts +0 -7
- package/dist/packages/core/src/projects/project/application/default-pipelines/default-step-definitions.d.ts +0 -8
- package/dist/packages/core/src/projects/project/application/default-pipelines/default-web-repro-playwright-step-definition.d.ts +0 -4
- package/dist/packages/core/src/projects/project/application/get-project.d.ts +0 -11
- package/dist/packages/core/src/projects/project/application/list-projects.d.ts +0 -9
- package/dist/packages/core/src/projects/project/application/project-authorization.d.ts +0 -4
- package/dist/packages/core/src/projects/project/application/project-contract-mapper.d.ts +0 -3
- package/dist/packages/core/src/projects/project/application/project-repo.d.ts +0 -9
- package/dist/packages/core/src/projects/project/application/seed-default-pipelines-on-project-created.d.ts +0 -12
- package/dist/packages/core/src/projects/project/application/update-project-membership.d.ts +0 -13
- package/dist/packages/core/src/projects/project/contracts/project-contracts.d.ts +0 -37
- package/dist/packages/core/src/projects/project/domain/project-created.domain-event.d.ts +0 -13
- package/dist/packages/core/src/projects/project/domain/project-entity.d.ts +0 -31
- package/dist/packages/core/src/projects/project/domain/project-git-url.d.ts +0 -7
- package/dist/packages/core/src/projects/project/domain/project-membership.d.ts +0 -21
- package/dist/packages/core/src/projects/project/domain/project-permission.d.ts +0 -7
- package/dist/packages/core/src/projects/project/infra/drizzle-project-repo.d.ts +0 -11
- package/dist/packages/core/src/projects/project-context/application/create-project-context-entry.d.ts +0 -11
- package/dist/packages/core/src/projects/project-context/application/delete-project-context-entry.d.ts +0 -11
- package/dist/packages/core/src/projects/project-context/application/list-project-context-entries.d.ts +0 -12
- package/dist/packages/core/src/projects/project-context/application/project-context-entry-repo.d.ts +0 -8
- package/dist/packages/core/src/projects/project-context/contracts/project-context-entry-contracts.d.ts +0 -46
- package/dist/packages/core/src/projects/project-context/domain/project-context-entry-entity.d.ts +0 -27
- package/dist/packages/core/src/projects/project-context/infra/drizzle-project-context-entry-repo.d.ts +0 -10
- package/dist/packages/core/src/projects/project-opencode-config/application/project-opencode-runtime-metadata.d.ts +0 -17
- package/dist/packages/core/src/work-items/work-item/application/create-work-item.d.ts +0 -16
- package/dist/packages/core/src/work-items/work-item/application/delete-work-items.d.ts +0 -14
- package/dist/packages/core/src/work-items/work-item/application/get-work-items.d.ts +0 -14
- package/dist/packages/core/src/work-items/work-item/application/list-work-items-by-project.d.ts +0 -13
- package/dist/packages/core/src/work-items/work-item/application/upsert-work-item.d.ts +0 -14
- package/dist/packages/core/src/work-items/work-item/application/work-item-contract-mapper.d.ts +0 -4
- package/dist/packages/core/src/work-items/work-item/application/work-item-repo.d.ts +0 -27
- package/dist/packages/core/src/work-items/work-item/contracts/work-item-contracts.d.ts +0 -119
- package/dist/packages/core/src/work-items/work-item/domain/date-utils.d.ts +0 -1
- package/dist/packages/core/src/work-items/work-item/domain/work-item-entity.d.ts +0 -58
- package/dist/packages/core/src/work-items/work-item/domain/work-item-field-value.d.ts +0 -3
- package/dist/packages/core/src/work-items/work-item/domain/work-item-id.d.ts +0 -6
- package/dist/packages/core/src/work-items/work-item/domain/work-item-platform.d.ts +0 -2
- package/dist/packages/core/src/work-items/work-item/domain/work-item-projection-fingerprint-entity.d.ts +0 -18
- package/dist/packages/core/src/work-items/work-item/infra/drizzle-work-item-repo.d.ts +0 -25
- package/dist/packages/sdks/js/script/build.d.ts +0 -1
- package/dist/packages/sdks/js/src/index.d.ts +0 -1
- package/dist/packages/sdks/js/test/define-step.test.d.ts +0 -1
- /package/dist/{packages/sdks/js/src/client.d.ts → client.d.ts} +0 -0
- /package/dist/{packages/sdks/js/src/define-step.d.ts → define-step.d.ts} +0 -0
- /package/dist/{packages/sdks/js/src/step-definitions-client.d.ts → step-definitions-client.d.ts} +0 -0
- /package/dist/{packages/sdks/js/src/step-execution-plane-client.d.ts → step-execution-plane-client.d.ts} +0 -0
- /package/dist/{packages/sdks/js/src/treaty.d.ts → treaty.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -54,8 +54,1024 @@ var buildStepExecutionPlaneClient = (apiClient) => {
|
|
|
54
54
|
}, options))
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
|
+
// ../../../node_modules/.bun/zod@4.4.2/node_modules/zod/v4/core/util.js
|
|
58
|
+
function getEnumValues(entries) {
|
|
59
|
+
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
60
|
+
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
61
|
+
return values;
|
|
62
|
+
}
|
|
63
|
+
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
|
|
64
|
+
var NUMBER_FORMAT_RANGES = {
|
|
65
|
+
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
66
|
+
int32: [-2147483648, 2147483647],
|
|
67
|
+
uint32: [0, 4294967295],
|
|
68
|
+
float32: [-340282346638528860000000000000000000000, 340282346638528860000000000000000000000],
|
|
69
|
+
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
70
|
+
};
|
|
71
|
+
// ../../../node_modules/.bun/zod@4.4.2/node_modules/zod/v4/core/registries.js
|
|
72
|
+
var _a;
|
|
73
|
+
var $output = Symbol("ZodOutput");
|
|
74
|
+
var $input = Symbol("ZodInput");
|
|
75
|
+
|
|
76
|
+
class $ZodRegistry {
|
|
77
|
+
constructor() {
|
|
78
|
+
this._map = new WeakMap;
|
|
79
|
+
this._idmap = new Map;
|
|
80
|
+
}
|
|
81
|
+
add(schema, ..._meta) {
|
|
82
|
+
const meta = _meta[0];
|
|
83
|
+
this._map.set(schema, meta);
|
|
84
|
+
if (meta && typeof meta === "object" && "id" in meta) {
|
|
85
|
+
this._idmap.set(meta.id, schema);
|
|
86
|
+
}
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
89
|
+
clear() {
|
|
90
|
+
this._map = new WeakMap;
|
|
91
|
+
this._idmap = new Map;
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
remove(schema) {
|
|
95
|
+
const meta = this._map.get(schema);
|
|
96
|
+
if (meta && typeof meta === "object" && "id" in meta) {
|
|
97
|
+
this._idmap.delete(meta.id);
|
|
98
|
+
}
|
|
99
|
+
this._map.delete(schema);
|
|
100
|
+
return this;
|
|
101
|
+
}
|
|
102
|
+
get(schema) {
|
|
103
|
+
const p = schema._zod.parent;
|
|
104
|
+
if (p) {
|
|
105
|
+
const pm = { ...this.get(p) ?? {} };
|
|
106
|
+
delete pm.id;
|
|
107
|
+
const f = { ...pm, ...this._map.get(schema) };
|
|
108
|
+
return Object.keys(f).length ? f : undefined;
|
|
109
|
+
}
|
|
110
|
+
return this._map.get(schema);
|
|
111
|
+
}
|
|
112
|
+
has(schema) {
|
|
113
|
+
return this._map.has(schema);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function registry() {
|
|
117
|
+
return new $ZodRegistry;
|
|
118
|
+
}
|
|
119
|
+
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
120
|
+
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
121
|
+
// ../../../node_modules/.bun/zod@4.4.2/node_modules/zod/v4/core/to-json-schema.js
|
|
122
|
+
function initializeContext(params) {
|
|
123
|
+
let target = params?.target ?? "draft-2020-12";
|
|
124
|
+
if (target === "draft-4")
|
|
125
|
+
target = "draft-04";
|
|
126
|
+
if (target === "draft-7")
|
|
127
|
+
target = "draft-07";
|
|
128
|
+
return {
|
|
129
|
+
processors: params.processors ?? {},
|
|
130
|
+
metadataRegistry: params?.metadata ?? globalRegistry,
|
|
131
|
+
target,
|
|
132
|
+
unrepresentable: params?.unrepresentable ?? "throw",
|
|
133
|
+
override: params?.override ?? (() => {}),
|
|
134
|
+
io: params?.io ?? "output",
|
|
135
|
+
counter: 0,
|
|
136
|
+
seen: new Map,
|
|
137
|
+
cycles: params?.cycles ?? "ref",
|
|
138
|
+
reused: params?.reused ?? "inline",
|
|
139
|
+
external: params?.external ?? undefined
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function process(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
143
|
+
var _a2;
|
|
144
|
+
const def = schema._zod.def;
|
|
145
|
+
const seen = ctx.seen.get(schema);
|
|
146
|
+
if (seen) {
|
|
147
|
+
seen.count++;
|
|
148
|
+
const isCycle = _params.schemaPath.includes(schema);
|
|
149
|
+
if (isCycle) {
|
|
150
|
+
seen.cycle = _params.path;
|
|
151
|
+
}
|
|
152
|
+
return seen.schema;
|
|
153
|
+
}
|
|
154
|
+
const result = { schema: {}, count: 1, cycle: undefined, path: _params.path };
|
|
155
|
+
ctx.seen.set(schema, result);
|
|
156
|
+
const overrideSchema = schema._zod.toJSONSchema?.();
|
|
157
|
+
if (overrideSchema) {
|
|
158
|
+
result.schema = overrideSchema;
|
|
159
|
+
} else {
|
|
160
|
+
const params = {
|
|
161
|
+
..._params,
|
|
162
|
+
schemaPath: [..._params.schemaPath, schema],
|
|
163
|
+
path: _params.path
|
|
164
|
+
};
|
|
165
|
+
if (schema._zod.processJSONSchema) {
|
|
166
|
+
schema._zod.processJSONSchema(ctx, result.schema, params);
|
|
167
|
+
} else {
|
|
168
|
+
const _json = result.schema;
|
|
169
|
+
const processor = ctx.processors[def.type];
|
|
170
|
+
if (!processor) {
|
|
171
|
+
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
|
|
172
|
+
}
|
|
173
|
+
processor(schema, ctx, _json, params);
|
|
174
|
+
}
|
|
175
|
+
const parent = schema._zod.parent;
|
|
176
|
+
if (parent) {
|
|
177
|
+
if (!result.ref)
|
|
178
|
+
result.ref = parent;
|
|
179
|
+
process(parent, ctx, params);
|
|
180
|
+
ctx.seen.get(parent).isParent = true;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const meta = ctx.metadataRegistry.get(schema);
|
|
184
|
+
if (meta)
|
|
185
|
+
Object.assign(result.schema, meta);
|
|
186
|
+
if (ctx.io === "input" && isTransforming(schema)) {
|
|
187
|
+
delete result.schema.examples;
|
|
188
|
+
delete result.schema.default;
|
|
189
|
+
}
|
|
190
|
+
if (ctx.io === "input" && "_prefault" in result.schema)
|
|
191
|
+
(_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
|
|
192
|
+
delete result.schema._prefault;
|
|
193
|
+
const _result = ctx.seen.get(schema);
|
|
194
|
+
return _result.schema;
|
|
195
|
+
}
|
|
196
|
+
function extractDefs(ctx, schema) {
|
|
197
|
+
const root = ctx.seen.get(schema);
|
|
198
|
+
if (!root)
|
|
199
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
200
|
+
const idToSchema = new Map;
|
|
201
|
+
for (const entry of ctx.seen.entries()) {
|
|
202
|
+
const id = ctx.metadataRegistry.get(entry[0])?.id;
|
|
203
|
+
if (id) {
|
|
204
|
+
const existing = idToSchema.get(id);
|
|
205
|
+
if (existing && existing !== entry[0]) {
|
|
206
|
+
throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
|
|
207
|
+
}
|
|
208
|
+
idToSchema.set(id, entry[0]);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const makeURI = (entry) => {
|
|
212
|
+
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
213
|
+
if (ctx.external) {
|
|
214
|
+
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
215
|
+
const uriGenerator = ctx.external.uri ?? ((id2) => id2);
|
|
216
|
+
if (externalId) {
|
|
217
|
+
return { ref: uriGenerator(externalId) };
|
|
218
|
+
}
|
|
219
|
+
const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
220
|
+
entry[1].defId = id;
|
|
221
|
+
return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
|
|
222
|
+
}
|
|
223
|
+
if (entry[1] === root) {
|
|
224
|
+
return { ref: "#" };
|
|
225
|
+
}
|
|
226
|
+
const uriPrefix = `#`;
|
|
227
|
+
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
|
|
228
|
+
const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
|
|
229
|
+
return { defId, ref: defUriPrefix + defId };
|
|
230
|
+
};
|
|
231
|
+
const extractToDef = (entry) => {
|
|
232
|
+
if (entry[1].schema.$ref) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const seen = entry[1];
|
|
236
|
+
const { ref, defId } = makeURI(entry);
|
|
237
|
+
seen.def = { ...seen.schema };
|
|
238
|
+
if (defId)
|
|
239
|
+
seen.defId = defId;
|
|
240
|
+
const schema2 = seen.schema;
|
|
241
|
+
for (const key in schema2) {
|
|
242
|
+
delete schema2[key];
|
|
243
|
+
}
|
|
244
|
+
schema2.$ref = ref;
|
|
245
|
+
};
|
|
246
|
+
if (ctx.cycles === "throw") {
|
|
247
|
+
for (const entry of ctx.seen.entries()) {
|
|
248
|
+
const seen = entry[1];
|
|
249
|
+
if (seen.cycle) {
|
|
250
|
+
throw new Error("Cycle detected: " + `#/${seen.cycle?.join("/")}/<root>` + '\n\nSet the `cycles` parameter to `"ref"` to resolve cyclical schemas with defs.');
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
for (const entry of ctx.seen.entries()) {
|
|
255
|
+
const seen = entry[1];
|
|
256
|
+
if (schema === entry[0]) {
|
|
257
|
+
extractToDef(entry);
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
if (ctx.external) {
|
|
261
|
+
const ext = ctx.external.registry.get(entry[0])?.id;
|
|
262
|
+
if (schema !== entry[0] && ext) {
|
|
263
|
+
extractToDef(entry);
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
const id = ctx.metadataRegistry.get(entry[0])?.id;
|
|
268
|
+
if (id) {
|
|
269
|
+
extractToDef(entry);
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
if (seen.cycle) {
|
|
273
|
+
extractToDef(entry);
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
if (seen.count > 1) {
|
|
277
|
+
if (ctx.reused === "ref") {
|
|
278
|
+
extractToDef(entry);
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
function finalize(ctx, schema) {
|
|
285
|
+
const root = ctx.seen.get(schema);
|
|
286
|
+
if (!root)
|
|
287
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
288
|
+
const flattenRef = (zodSchema) => {
|
|
289
|
+
const seen = ctx.seen.get(zodSchema);
|
|
290
|
+
if (seen.ref === null)
|
|
291
|
+
return;
|
|
292
|
+
const schema2 = seen.def ?? seen.schema;
|
|
293
|
+
const _cached = { ...schema2 };
|
|
294
|
+
const ref = seen.ref;
|
|
295
|
+
seen.ref = null;
|
|
296
|
+
if (ref) {
|
|
297
|
+
flattenRef(ref);
|
|
298
|
+
const refSeen = ctx.seen.get(ref);
|
|
299
|
+
const refSchema = refSeen.schema;
|
|
300
|
+
if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
|
|
301
|
+
schema2.allOf = schema2.allOf ?? [];
|
|
302
|
+
schema2.allOf.push(refSchema);
|
|
303
|
+
} else {
|
|
304
|
+
Object.assign(schema2, refSchema);
|
|
305
|
+
}
|
|
306
|
+
Object.assign(schema2, _cached);
|
|
307
|
+
const isParentRef = zodSchema._zod.parent === ref;
|
|
308
|
+
if (isParentRef) {
|
|
309
|
+
for (const key in schema2) {
|
|
310
|
+
if (key === "$ref" || key === "allOf")
|
|
311
|
+
continue;
|
|
312
|
+
if (!(key in _cached)) {
|
|
313
|
+
delete schema2[key];
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
if (refSchema.$ref && refSeen.def) {
|
|
318
|
+
for (const key in schema2) {
|
|
319
|
+
if (key === "$ref" || key === "allOf")
|
|
320
|
+
continue;
|
|
321
|
+
if (key in refSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(refSeen.def[key])) {
|
|
322
|
+
delete schema2[key];
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
const parent = zodSchema._zod.parent;
|
|
328
|
+
if (parent && parent !== ref) {
|
|
329
|
+
flattenRef(parent);
|
|
330
|
+
const parentSeen = ctx.seen.get(parent);
|
|
331
|
+
if (parentSeen?.schema.$ref) {
|
|
332
|
+
schema2.$ref = parentSeen.schema.$ref;
|
|
333
|
+
if (parentSeen.def) {
|
|
334
|
+
for (const key in schema2) {
|
|
335
|
+
if (key === "$ref" || key === "allOf")
|
|
336
|
+
continue;
|
|
337
|
+
if (key in parentSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(parentSeen.def[key])) {
|
|
338
|
+
delete schema2[key];
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
ctx.override({
|
|
345
|
+
zodSchema,
|
|
346
|
+
jsonSchema: schema2,
|
|
347
|
+
path: seen.path ?? []
|
|
348
|
+
});
|
|
349
|
+
};
|
|
350
|
+
for (const entry of [...ctx.seen.entries()].reverse()) {
|
|
351
|
+
flattenRef(entry[0]);
|
|
352
|
+
}
|
|
353
|
+
const result = {};
|
|
354
|
+
if (ctx.target === "draft-2020-12") {
|
|
355
|
+
result.$schema = "https://json-schema.org/draft/2020-12/schema";
|
|
356
|
+
} else if (ctx.target === "draft-07") {
|
|
357
|
+
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
358
|
+
} else if (ctx.target === "draft-04") {
|
|
359
|
+
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
360
|
+
} else if (ctx.target === "openapi-3.0") {} else {}
|
|
361
|
+
if (ctx.external?.uri) {
|
|
362
|
+
const id = ctx.external.registry.get(schema)?.id;
|
|
363
|
+
if (!id)
|
|
364
|
+
throw new Error("Schema is missing an `id` property");
|
|
365
|
+
result.$id = ctx.external.uri(id);
|
|
366
|
+
}
|
|
367
|
+
Object.assign(result, root.def ?? root.schema);
|
|
368
|
+
const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
|
|
369
|
+
if (rootMetaId !== undefined && result.id === rootMetaId)
|
|
370
|
+
delete result.id;
|
|
371
|
+
const defs = ctx.external?.defs ?? {};
|
|
372
|
+
for (const entry of ctx.seen.entries()) {
|
|
373
|
+
const seen = entry[1];
|
|
374
|
+
if (seen.def && seen.defId) {
|
|
375
|
+
if (seen.def.id === seen.defId)
|
|
376
|
+
delete seen.def.id;
|
|
377
|
+
defs[seen.defId] = seen.def;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
if (ctx.external) {} else {
|
|
381
|
+
if (Object.keys(defs).length > 0) {
|
|
382
|
+
if (ctx.target === "draft-2020-12") {
|
|
383
|
+
result.$defs = defs;
|
|
384
|
+
} else {
|
|
385
|
+
result.definitions = defs;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
try {
|
|
390
|
+
const finalized = JSON.parse(JSON.stringify(result));
|
|
391
|
+
Object.defineProperty(finalized, "~standard", {
|
|
392
|
+
value: {
|
|
393
|
+
...schema["~standard"],
|
|
394
|
+
jsonSchema: {
|
|
395
|
+
input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
|
|
396
|
+
output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
enumerable: false,
|
|
400
|
+
writable: false
|
|
401
|
+
});
|
|
402
|
+
return finalized;
|
|
403
|
+
} catch (_err) {
|
|
404
|
+
throw new Error("Error converting schema to JSON.");
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
function isTransforming(_schema, _ctx) {
|
|
408
|
+
const ctx = _ctx ?? { seen: new Set };
|
|
409
|
+
if (ctx.seen.has(_schema))
|
|
410
|
+
return false;
|
|
411
|
+
ctx.seen.add(_schema);
|
|
412
|
+
const def = _schema._zod.def;
|
|
413
|
+
if (def.type === "transform")
|
|
414
|
+
return true;
|
|
415
|
+
if (def.type === "array")
|
|
416
|
+
return isTransforming(def.element, ctx);
|
|
417
|
+
if (def.type === "set")
|
|
418
|
+
return isTransforming(def.valueType, ctx);
|
|
419
|
+
if (def.type === "lazy")
|
|
420
|
+
return isTransforming(def.getter(), ctx);
|
|
421
|
+
if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") {
|
|
422
|
+
return isTransforming(def.innerType, ctx);
|
|
423
|
+
}
|
|
424
|
+
if (def.type === "intersection") {
|
|
425
|
+
return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
|
|
426
|
+
}
|
|
427
|
+
if (def.type === "record" || def.type === "map") {
|
|
428
|
+
return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
|
|
429
|
+
}
|
|
430
|
+
if (def.type === "pipe") {
|
|
431
|
+
if (_schema._zod.traits.has("$ZodCodec"))
|
|
432
|
+
return true;
|
|
433
|
+
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
|
|
434
|
+
}
|
|
435
|
+
if (def.type === "object") {
|
|
436
|
+
for (const key in def.shape) {
|
|
437
|
+
if (isTransforming(def.shape[key], ctx))
|
|
438
|
+
return true;
|
|
439
|
+
}
|
|
440
|
+
return false;
|
|
441
|
+
}
|
|
442
|
+
if (def.type === "union") {
|
|
443
|
+
for (const option of def.options) {
|
|
444
|
+
if (isTransforming(option, ctx))
|
|
445
|
+
return true;
|
|
446
|
+
}
|
|
447
|
+
return false;
|
|
448
|
+
}
|
|
449
|
+
if (def.type === "tuple") {
|
|
450
|
+
for (const item of def.items) {
|
|
451
|
+
if (isTransforming(item, ctx))
|
|
452
|
+
return true;
|
|
453
|
+
}
|
|
454
|
+
if (def.rest && isTransforming(def.rest, ctx))
|
|
455
|
+
return true;
|
|
456
|
+
return false;
|
|
457
|
+
}
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
461
|
+
const { libraryOptions, target } = params ?? {};
|
|
462
|
+
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
463
|
+
process(schema, ctx);
|
|
464
|
+
extractDefs(ctx, schema);
|
|
465
|
+
return finalize(ctx, schema);
|
|
466
|
+
};
|
|
467
|
+
// ../../../node_modules/.bun/zod@4.4.2/node_modules/zod/v4/core/json-schema-processors.js
|
|
468
|
+
var formatMap = {
|
|
469
|
+
guid: "uuid",
|
|
470
|
+
url: "uri",
|
|
471
|
+
datetime: "date-time",
|
|
472
|
+
json_string: "json-string",
|
|
473
|
+
regex: ""
|
|
474
|
+
};
|
|
475
|
+
var stringProcessor = (schema, ctx, _json, _params) => {
|
|
476
|
+
const json = _json;
|
|
477
|
+
json.type = "string";
|
|
478
|
+
const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
|
|
479
|
+
if (typeof minimum === "number")
|
|
480
|
+
json.minLength = minimum;
|
|
481
|
+
if (typeof maximum === "number")
|
|
482
|
+
json.maxLength = maximum;
|
|
483
|
+
if (format) {
|
|
484
|
+
json.format = formatMap[format] ?? format;
|
|
485
|
+
if (json.format === "")
|
|
486
|
+
delete json.format;
|
|
487
|
+
if (format === "time") {
|
|
488
|
+
delete json.format;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
if (contentEncoding)
|
|
492
|
+
json.contentEncoding = contentEncoding;
|
|
493
|
+
if (patterns && patterns.size > 0) {
|
|
494
|
+
const regexes = [...patterns];
|
|
495
|
+
if (regexes.length === 1)
|
|
496
|
+
json.pattern = regexes[0].source;
|
|
497
|
+
else if (regexes.length > 1) {
|
|
498
|
+
json.allOf = [
|
|
499
|
+
...regexes.map((regex) => ({
|
|
500
|
+
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
501
|
+
pattern: regex.source
|
|
502
|
+
}))
|
|
503
|
+
];
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
var numberProcessor = (schema, ctx, _json, _params) => {
|
|
508
|
+
const json = _json;
|
|
509
|
+
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
|
|
510
|
+
if (typeof format === "string" && format.includes("int"))
|
|
511
|
+
json.type = "integer";
|
|
512
|
+
else
|
|
513
|
+
json.type = "number";
|
|
514
|
+
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
515
|
+
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
516
|
+
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
517
|
+
if (exMin) {
|
|
518
|
+
if (legacy) {
|
|
519
|
+
json.minimum = exclusiveMinimum;
|
|
520
|
+
json.exclusiveMinimum = true;
|
|
521
|
+
} else {
|
|
522
|
+
json.exclusiveMinimum = exclusiveMinimum;
|
|
523
|
+
}
|
|
524
|
+
} else if (typeof minimum === "number") {
|
|
525
|
+
json.minimum = minimum;
|
|
526
|
+
}
|
|
527
|
+
if (exMax) {
|
|
528
|
+
if (legacy) {
|
|
529
|
+
json.maximum = exclusiveMaximum;
|
|
530
|
+
json.exclusiveMaximum = true;
|
|
531
|
+
} else {
|
|
532
|
+
json.exclusiveMaximum = exclusiveMaximum;
|
|
533
|
+
}
|
|
534
|
+
} else if (typeof maximum === "number") {
|
|
535
|
+
json.maximum = maximum;
|
|
536
|
+
}
|
|
537
|
+
if (typeof multipleOf === "number")
|
|
538
|
+
json.multipleOf = multipleOf;
|
|
539
|
+
};
|
|
540
|
+
var booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
541
|
+
json.type = "boolean";
|
|
542
|
+
};
|
|
543
|
+
var bigintProcessor = (_schema, ctx, _json, _params) => {
|
|
544
|
+
if (ctx.unrepresentable === "throw") {
|
|
545
|
+
throw new Error("BigInt cannot be represented in JSON Schema");
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
var symbolProcessor = (_schema, ctx, _json, _params) => {
|
|
549
|
+
if (ctx.unrepresentable === "throw") {
|
|
550
|
+
throw new Error("Symbols cannot be represented in JSON Schema");
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
var nullProcessor = (_schema, ctx, json, _params) => {
|
|
554
|
+
if (ctx.target === "openapi-3.0") {
|
|
555
|
+
json.type = "string";
|
|
556
|
+
json.nullable = true;
|
|
557
|
+
json.enum = [null];
|
|
558
|
+
} else {
|
|
559
|
+
json.type = "null";
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
var undefinedProcessor = (_schema, ctx, _json, _params) => {
|
|
563
|
+
if (ctx.unrepresentable === "throw") {
|
|
564
|
+
throw new Error("Undefined cannot be represented in JSON Schema");
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
var voidProcessor = (_schema, ctx, _json, _params) => {
|
|
568
|
+
if (ctx.unrepresentable === "throw") {
|
|
569
|
+
throw new Error("Void cannot be represented in JSON Schema");
|
|
570
|
+
}
|
|
571
|
+
};
|
|
572
|
+
var neverProcessor = (_schema, _ctx, json, _params) => {
|
|
573
|
+
json.not = {};
|
|
574
|
+
};
|
|
575
|
+
var anyProcessor = (_schema, _ctx, _json, _params) => {};
|
|
576
|
+
var unknownProcessor = (_schema, _ctx, _json, _params) => {};
|
|
577
|
+
var dateProcessor = (_schema, ctx, _json, _params) => {
|
|
578
|
+
if (ctx.unrepresentable === "throw") {
|
|
579
|
+
throw new Error("Date cannot be represented in JSON Schema");
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
var enumProcessor = (schema, _ctx, json, _params) => {
|
|
583
|
+
const def = schema._zod.def;
|
|
584
|
+
const values = getEnumValues(def.entries);
|
|
585
|
+
if (values.every((v) => typeof v === "number"))
|
|
586
|
+
json.type = "number";
|
|
587
|
+
if (values.every((v) => typeof v === "string"))
|
|
588
|
+
json.type = "string";
|
|
589
|
+
json.enum = values;
|
|
590
|
+
};
|
|
591
|
+
var literalProcessor = (schema, ctx, json, _params) => {
|
|
592
|
+
const def = schema._zod.def;
|
|
593
|
+
const vals = [];
|
|
594
|
+
for (const val of def.values) {
|
|
595
|
+
if (val === undefined) {
|
|
596
|
+
if (ctx.unrepresentable === "throw") {
|
|
597
|
+
throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
598
|
+
} else {}
|
|
599
|
+
} else if (typeof val === "bigint") {
|
|
600
|
+
if (ctx.unrepresentable === "throw") {
|
|
601
|
+
throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
602
|
+
} else {
|
|
603
|
+
vals.push(Number(val));
|
|
604
|
+
}
|
|
605
|
+
} else {
|
|
606
|
+
vals.push(val);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
if (vals.length === 0) {} else if (vals.length === 1) {
|
|
610
|
+
const val = vals[0];
|
|
611
|
+
json.type = val === null ? "null" : typeof val;
|
|
612
|
+
if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
|
|
613
|
+
json.enum = [val];
|
|
614
|
+
} else {
|
|
615
|
+
json.const = val;
|
|
616
|
+
}
|
|
617
|
+
} else {
|
|
618
|
+
if (vals.every((v) => typeof v === "number"))
|
|
619
|
+
json.type = "number";
|
|
620
|
+
if (vals.every((v) => typeof v === "string"))
|
|
621
|
+
json.type = "string";
|
|
622
|
+
if (vals.every((v) => typeof v === "boolean"))
|
|
623
|
+
json.type = "boolean";
|
|
624
|
+
if (vals.every((v) => v === null))
|
|
625
|
+
json.type = "null";
|
|
626
|
+
json.enum = vals;
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
var nanProcessor = (_schema, ctx, _json, _params) => {
|
|
630
|
+
if (ctx.unrepresentable === "throw") {
|
|
631
|
+
throw new Error("NaN cannot be represented in JSON Schema");
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
var templateLiteralProcessor = (schema, _ctx, json, _params) => {
|
|
635
|
+
const _json = json;
|
|
636
|
+
const pattern = schema._zod.pattern;
|
|
637
|
+
if (!pattern)
|
|
638
|
+
throw new Error("Pattern not found in template literal");
|
|
639
|
+
_json.type = "string";
|
|
640
|
+
_json.pattern = pattern.source;
|
|
641
|
+
};
|
|
642
|
+
var fileProcessor = (schema, _ctx, json, _params) => {
|
|
643
|
+
const _json = json;
|
|
644
|
+
const file = {
|
|
645
|
+
type: "string",
|
|
646
|
+
format: "binary",
|
|
647
|
+
contentEncoding: "binary"
|
|
648
|
+
};
|
|
649
|
+
const { minimum, maximum, mime } = schema._zod.bag;
|
|
650
|
+
if (minimum !== undefined)
|
|
651
|
+
file.minLength = minimum;
|
|
652
|
+
if (maximum !== undefined)
|
|
653
|
+
file.maxLength = maximum;
|
|
654
|
+
if (mime) {
|
|
655
|
+
if (mime.length === 1) {
|
|
656
|
+
file.contentMediaType = mime[0];
|
|
657
|
+
Object.assign(_json, file);
|
|
658
|
+
} else {
|
|
659
|
+
Object.assign(_json, file);
|
|
660
|
+
_json.anyOf = mime.map((m) => ({ contentMediaType: m }));
|
|
661
|
+
}
|
|
662
|
+
} else {
|
|
663
|
+
Object.assign(_json, file);
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
var successProcessor = (_schema, _ctx, json, _params) => {
|
|
667
|
+
json.type = "boolean";
|
|
668
|
+
};
|
|
669
|
+
var customProcessor = (_schema, ctx, _json, _params) => {
|
|
670
|
+
if (ctx.unrepresentable === "throw") {
|
|
671
|
+
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
672
|
+
}
|
|
673
|
+
};
|
|
674
|
+
var functionProcessor = (_schema, ctx, _json, _params) => {
|
|
675
|
+
if (ctx.unrepresentable === "throw") {
|
|
676
|
+
throw new Error("Function types cannot be represented in JSON Schema");
|
|
677
|
+
}
|
|
678
|
+
};
|
|
679
|
+
var transformProcessor = (_schema, ctx, _json, _params) => {
|
|
680
|
+
if (ctx.unrepresentable === "throw") {
|
|
681
|
+
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
682
|
+
}
|
|
683
|
+
};
|
|
684
|
+
var mapProcessor = (_schema, ctx, _json, _params) => {
|
|
685
|
+
if (ctx.unrepresentable === "throw") {
|
|
686
|
+
throw new Error("Map cannot be represented in JSON Schema");
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
var setProcessor = (_schema, ctx, _json, _params) => {
|
|
690
|
+
if (ctx.unrepresentable === "throw") {
|
|
691
|
+
throw new Error("Set cannot be represented in JSON Schema");
|
|
692
|
+
}
|
|
693
|
+
};
|
|
694
|
+
var arrayProcessor = (schema, ctx, _json, params) => {
|
|
695
|
+
const json = _json;
|
|
696
|
+
const def = schema._zod.def;
|
|
697
|
+
const { minimum, maximum } = schema._zod.bag;
|
|
698
|
+
if (typeof minimum === "number")
|
|
699
|
+
json.minItems = minimum;
|
|
700
|
+
if (typeof maximum === "number")
|
|
701
|
+
json.maxItems = maximum;
|
|
702
|
+
json.type = "array";
|
|
703
|
+
json.items = process(def.element, ctx, {
|
|
704
|
+
...params,
|
|
705
|
+
path: [...params.path, "items"]
|
|
706
|
+
});
|
|
707
|
+
};
|
|
708
|
+
var objectProcessor = (schema, ctx, _json, params) => {
|
|
709
|
+
const json = _json;
|
|
710
|
+
const def = schema._zod.def;
|
|
711
|
+
json.type = "object";
|
|
712
|
+
json.properties = {};
|
|
713
|
+
const shape = def.shape;
|
|
714
|
+
for (const key in shape) {
|
|
715
|
+
json.properties[key] = process(shape[key], ctx, {
|
|
716
|
+
...params,
|
|
717
|
+
path: [...params.path, "properties", key]
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
const allKeys = new Set(Object.keys(shape));
|
|
721
|
+
const requiredKeys = new Set([...allKeys].filter((key) => {
|
|
722
|
+
const v = def.shape[key]._zod;
|
|
723
|
+
if (ctx.io === "input") {
|
|
724
|
+
return v.optin === undefined;
|
|
725
|
+
} else {
|
|
726
|
+
return v.optout === undefined;
|
|
727
|
+
}
|
|
728
|
+
}));
|
|
729
|
+
if (requiredKeys.size > 0) {
|
|
730
|
+
json.required = Array.from(requiredKeys);
|
|
731
|
+
}
|
|
732
|
+
if (def.catchall?._zod.def.type === "never") {
|
|
733
|
+
json.additionalProperties = false;
|
|
734
|
+
} else if (!def.catchall) {
|
|
735
|
+
if (ctx.io === "output")
|
|
736
|
+
json.additionalProperties = false;
|
|
737
|
+
} else if (def.catchall) {
|
|
738
|
+
json.additionalProperties = process(def.catchall, ctx, {
|
|
739
|
+
...params,
|
|
740
|
+
path: [...params.path, "additionalProperties"]
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
var unionProcessor = (schema, ctx, json, params) => {
|
|
745
|
+
const def = schema._zod.def;
|
|
746
|
+
const isExclusive = def.inclusive === false;
|
|
747
|
+
const options = def.options.map((x, i) => process(x, ctx, {
|
|
748
|
+
...params,
|
|
749
|
+
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i]
|
|
750
|
+
}));
|
|
751
|
+
if (isExclusive) {
|
|
752
|
+
json.oneOf = options;
|
|
753
|
+
} else {
|
|
754
|
+
json.anyOf = options;
|
|
755
|
+
}
|
|
756
|
+
};
|
|
757
|
+
var intersectionProcessor = (schema, ctx, json, params) => {
|
|
758
|
+
const def = schema._zod.def;
|
|
759
|
+
const a = process(def.left, ctx, {
|
|
760
|
+
...params,
|
|
761
|
+
path: [...params.path, "allOf", 0]
|
|
762
|
+
});
|
|
763
|
+
const b = process(def.right, ctx, {
|
|
764
|
+
...params,
|
|
765
|
+
path: [...params.path, "allOf", 1]
|
|
766
|
+
});
|
|
767
|
+
const isSimpleIntersection = (val) => ("allOf" in val) && Object.keys(val).length === 1;
|
|
768
|
+
const allOf = [
|
|
769
|
+
...isSimpleIntersection(a) ? a.allOf : [a],
|
|
770
|
+
...isSimpleIntersection(b) ? b.allOf : [b]
|
|
771
|
+
];
|
|
772
|
+
json.allOf = allOf;
|
|
773
|
+
};
|
|
774
|
+
var tupleProcessor = (schema, ctx, _json, params) => {
|
|
775
|
+
const json = _json;
|
|
776
|
+
const def = schema._zod.def;
|
|
777
|
+
json.type = "array";
|
|
778
|
+
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
779
|
+
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
780
|
+
const prefixItems = def.items.map((x, i) => process(x, ctx, {
|
|
781
|
+
...params,
|
|
782
|
+
path: [...params.path, prefixPath, i]
|
|
783
|
+
}));
|
|
784
|
+
const rest = def.rest ? process(def.rest, ctx, {
|
|
785
|
+
...params,
|
|
786
|
+
path: [...params.path, restPath, ...ctx.target === "openapi-3.0" ? [def.items.length] : []]
|
|
787
|
+
}) : null;
|
|
788
|
+
if (ctx.target === "draft-2020-12") {
|
|
789
|
+
json.prefixItems = prefixItems;
|
|
790
|
+
if (rest) {
|
|
791
|
+
json.items = rest;
|
|
792
|
+
}
|
|
793
|
+
} else if (ctx.target === "openapi-3.0") {
|
|
794
|
+
json.items = {
|
|
795
|
+
anyOf: prefixItems
|
|
796
|
+
};
|
|
797
|
+
if (rest) {
|
|
798
|
+
json.items.anyOf.push(rest);
|
|
799
|
+
}
|
|
800
|
+
json.minItems = prefixItems.length;
|
|
801
|
+
if (!rest) {
|
|
802
|
+
json.maxItems = prefixItems.length;
|
|
803
|
+
}
|
|
804
|
+
} else {
|
|
805
|
+
json.items = prefixItems;
|
|
806
|
+
if (rest) {
|
|
807
|
+
json.additionalItems = rest;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
const { minimum, maximum } = schema._zod.bag;
|
|
811
|
+
if (typeof minimum === "number")
|
|
812
|
+
json.minItems = minimum;
|
|
813
|
+
if (typeof maximum === "number")
|
|
814
|
+
json.maxItems = maximum;
|
|
815
|
+
};
|
|
816
|
+
var recordProcessor = (schema, ctx, _json, params) => {
|
|
817
|
+
const json = _json;
|
|
818
|
+
const def = schema._zod.def;
|
|
819
|
+
json.type = "object";
|
|
820
|
+
const keyType = def.keyType;
|
|
821
|
+
const keyBag = keyType._zod.bag;
|
|
822
|
+
const patterns = keyBag?.patterns;
|
|
823
|
+
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
824
|
+
const valueSchema = process(def.valueType, ctx, {
|
|
825
|
+
...params,
|
|
826
|
+
path: [...params.path, "patternProperties", "*"]
|
|
827
|
+
});
|
|
828
|
+
json.patternProperties = {};
|
|
829
|
+
for (const pattern of patterns) {
|
|
830
|
+
json.patternProperties[pattern.source] = valueSchema;
|
|
831
|
+
}
|
|
832
|
+
} else {
|
|
833
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
834
|
+
json.propertyNames = process(def.keyType, ctx, {
|
|
835
|
+
...params,
|
|
836
|
+
path: [...params.path, "propertyNames"]
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
json.additionalProperties = process(def.valueType, ctx, {
|
|
840
|
+
...params,
|
|
841
|
+
path: [...params.path, "additionalProperties"]
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
const keyValues = keyType._zod.values;
|
|
845
|
+
if (keyValues) {
|
|
846
|
+
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
847
|
+
if (validKeyValues.length > 0) {
|
|
848
|
+
json.required = validKeyValues;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
};
|
|
852
|
+
var nullableProcessor = (schema, ctx, json, params) => {
|
|
853
|
+
const def = schema._zod.def;
|
|
854
|
+
const inner = process(def.innerType, ctx, params);
|
|
855
|
+
const seen = ctx.seen.get(schema);
|
|
856
|
+
if (ctx.target === "openapi-3.0") {
|
|
857
|
+
seen.ref = def.innerType;
|
|
858
|
+
json.nullable = true;
|
|
859
|
+
} else {
|
|
860
|
+
json.anyOf = [inner, { type: "null" }];
|
|
861
|
+
}
|
|
862
|
+
};
|
|
863
|
+
var nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
864
|
+
const def = schema._zod.def;
|
|
865
|
+
process(def.innerType, ctx, params);
|
|
866
|
+
const seen = ctx.seen.get(schema);
|
|
867
|
+
seen.ref = def.innerType;
|
|
868
|
+
};
|
|
869
|
+
var defaultProcessor = (schema, ctx, json, params) => {
|
|
870
|
+
const def = schema._zod.def;
|
|
871
|
+
process(def.innerType, ctx, params);
|
|
872
|
+
const seen = ctx.seen.get(schema);
|
|
873
|
+
seen.ref = def.innerType;
|
|
874
|
+
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
875
|
+
};
|
|
876
|
+
var prefaultProcessor = (schema, ctx, json, params) => {
|
|
877
|
+
const def = schema._zod.def;
|
|
878
|
+
process(def.innerType, ctx, params);
|
|
879
|
+
const seen = ctx.seen.get(schema);
|
|
880
|
+
seen.ref = def.innerType;
|
|
881
|
+
if (ctx.io === "input")
|
|
882
|
+
json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
883
|
+
};
|
|
884
|
+
var catchProcessor = (schema, ctx, json, params) => {
|
|
885
|
+
const def = schema._zod.def;
|
|
886
|
+
process(def.innerType, ctx, params);
|
|
887
|
+
const seen = ctx.seen.get(schema);
|
|
888
|
+
seen.ref = def.innerType;
|
|
889
|
+
let catchValue;
|
|
890
|
+
try {
|
|
891
|
+
catchValue = def.catchValue(undefined);
|
|
892
|
+
} catch {
|
|
893
|
+
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
894
|
+
}
|
|
895
|
+
json.default = catchValue;
|
|
896
|
+
};
|
|
897
|
+
var pipeProcessor = (schema, ctx, _json, params) => {
|
|
898
|
+
const def = schema._zod.def;
|
|
899
|
+
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
900
|
+
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
901
|
+
process(innerType, ctx, params);
|
|
902
|
+
const seen = ctx.seen.get(schema);
|
|
903
|
+
seen.ref = innerType;
|
|
904
|
+
};
|
|
905
|
+
var readonlyProcessor = (schema, ctx, json, params) => {
|
|
906
|
+
const def = schema._zod.def;
|
|
907
|
+
process(def.innerType, ctx, params);
|
|
908
|
+
const seen = ctx.seen.get(schema);
|
|
909
|
+
seen.ref = def.innerType;
|
|
910
|
+
json.readOnly = true;
|
|
911
|
+
};
|
|
912
|
+
var promiseProcessor = (schema, ctx, _json, params) => {
|
|
913
|
+
const def = schema._zod.def;
|
|
914
|
+
process(def.innerType, ctx, params);
|
|
915
|
+
const seen = ctx.seen.get(schema);
|
|
916
|
+
seen.ref = def.innerType;
|
|
917
|
+
};
|
|
918
|
+
var optionalProcessor = (schema, ctx, _json, params) => {
|
|
919
|
+
const def = schema._zod.def;
|
|
920
|
+
process(def.innerType, ctx, params);
|
|
921
|
+
const seen = ctx.seen.get(schema);
|
|
922
|
+
seen.ref = def.innerType;
|
|
923
|
+
};
|
|
924
|
+
var lazyProcessor = (schema, ctx, _json, params) => {
|
|
925
|
+
const innerType = schema._zod.innerType;
|
|
926
|
+
process(innerType, ctx, params);
|
|
927
|
+
const seen = ctx.seen.get(schema);
|
|
928
|
+
seen.ref = innerType;
|
|
929
|
+
};
|
|
930
|
+
var allProcessors = {
|
|
931
|
+
string: stringProcessor,
|
|
932
|
+
number: numberProcessor,
|
|
933
|
+
boolean: booleanProcessor,
|
|
934
|
+
bigint: bigintProcessor,
|
|
935
|
+
symbol: symbolProcessor,
|
|
936
|
+
null: nullProcessor,
|
|
937
|
+
undefined: undefinedProcessor,
|
|
938
|
+
void: voidProcessor,
|
|
939
|
+
never: neverProcessor,
|
|
940
|
+
any: anyProcessor,
|
|
941
|
+
unknown: unknownProcessor,
|
|
942
|
+
date: dateProcessor,
|
|
943
|
+
enum: enumProcessor,
|
|
944
|
+
literal: literalProcessor,
|
|
945
|
+
nan: nanProcessor,
|
|
946
|
+
template_literal: templateLiteralProcessor,
|
|
947
|
+
file: fileProcessor,
|
|
948
|
+
success: successProcessor,
|
|
949
|
+
custom: customProcessor,
|
|
950
|
+
function: functionProcessor,
|
|
951
|
+
transform: transformProcessor,
|
|
952
|
+
map: mapProcessor,
|
|
953
|
+
set: setProcessor,
|
|
954
|
+
array: arrayProcessor,
|
|
955
|
+
object: objectProcessor,
|
|
956
|
+
union: unionProcessor,
|
|
957
|
+
intersection: intersectionProcessor,
|
|
958
|
+
tuple: tupleProcessor,
|
|
959
|
+
record: recordProcessor,
|
|
960
|
+
nullable: nullableProcessor,
|
|
961
|
+
nonoptional: nonoptionalProcessor,
|
|
962
|
+
default: defaultProcessor,
|
|
963
|
+
prefault: prefaultProcessor,
|
|
964
|
+
catch: catchProcessor,
|
|
965
|
+
pipe: pipeProcessor,
|
|
966
|
+
readonly: readonlyProcessor,
|
|
967
|
+
promise: promiseProcessor,
|
|
968
|
+
optional: optionalProcessor,
|
|
969
|
+
lazy: lazyProcessor
|
|
970
|
+
};
|
|
971
|
+
function toJSONSchema(input, params) {
|
|
972
|
+
if ("_idmap" in input) {
|
|
973
|
+
const registry2 = input;
|
|
974
|
+
const ctx2 = initializeContext({ ...params, processors: allProcessors });
|
|
975
|
+
const defs = {};
|
|
976
|
+
for (const entry of registry2._idmap.entries()) {
|
|
977
|
+
const [_, schema] = entry;
|
|
978
|
+
process(schema, ctx2);
|
|
979
|
+
}
|
|
980
|
+
const schemas = {};
|
|
981
|
+
const external = {
|
|
982
|
+
registry: registry2,
|
|
983
|
+
uri: params?.uri,
|
|
984
|
+
defs
|
|
985
|
+
};
|
|
986
|
+
ctx2.external = external;
|
|
987
|
+
for (const entry of registry2._idmap.entries()) {
|
|
988
|
+
const [key, schema] = entry;
|
|
989
|
+
extractDefs(ctx2, schema);
|
|
990
|
+
schemas[key] = finalize(ctx2, schema);
|
|
991
|
+
}
|
|
992
|
+
if (Object.keys(defs).length > 0) {
|
|
993
|
+
const defsSegment = ctx2.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
994
|
+
schemas.__shared = {
|
|
995
|
+
[defsSegment]: defs
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
return { schemas };
|
|
999
|
+
}
|
|
1000
|
+
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
1001
|
+
process(input, ctx);
|
|
1002
|
+
extractDefs(ctx, input);
|
|
1003
|
+
return finalize(ctx, input);
|
|
1004
|
+
}
|
|
1005
|
+
// src/define-step.ts
|
|
1006
|
+
var UNWRAP_TYPES = new Set(["optional", "nullable", "default"]);
|
|
1007
|
+
function unwrapZodType(schema) {
|
|
1008
|
+
while (UNWRAP_TYPES.has(schema._def.type)) {
|
|
1009
|
+
const inner = schema._def.innerType;
|
|
1010
|
+
if (!inner)
|
|
1011
|
+
break;
|
|
1012
|
+
schema = inner;
|
|
1013
|
+
}
|
|
1014
|
+
return schema;
|
|
1015
|
+
}
|
|
1016
|
+
function deriveSignalType(schema, path) {
|
|
1017
|
+
if (!schema)
|
|
1018
|
+
return "string";
|
|
1019
|
+
let current = unwrapZodType(schema);
|
|
1020
|
+
for (const part of path.split(".")) {
|
|
1021
|
+
if (current._def.type !== "object")
|
|
1022
|
+
return "string";
|
|
1023
|
+
const next = current._def.shape?.[part];
|
|
1024
|
+
if (!next)
|
|
1025
|
+
return "string";
|
|
1026
|
+
current = unwrapZodType(next);
|
|
1027
|
+
}
|
|
1028
|
+
switch (current._def.type) {
|
|
1029
|
+
case "string":
|
|
1030
|
+
return "string";
|
|
1031
|
+
case "number":
|
|
1032
|
+
return "number";
|
|
1033
|
+
case "boolean":
|
|
1034
|
+
return "boolean";
|
|
1035
|
+
case "array":
|
|
1036
|
+
return "array";
|
|
1037
|
+
case "object":
|
|
1038
|
+
case "record":
|
|
1039
|
+
return "object";
|
|
1040
|
+
default:
|
|
1041
|
+
return "string";
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
function defineStep(config) {
|
|
1045
|
+
return {
|
|
1046
|
+
key: config.key,
|
|
1047
|
+
name: config.name,
|
|
1048
|
+
description: config.description ?? null,
|
|
1049
|
+
version: config.version ?? 1,
|
|
1050
|
+
kind: "user_defined",
|
|
1051
|
+
status: config.status ?? "active",
|
|
1052
|
+
prompt: config.prompt ?? null,
|
|
1053
|
+
inputSchemaJson: config.input ? toJSONSchema(config.input) : null,
|
|
1054
|
+
resultSchemaJson: config.result ? toJSONSchema(config.result) : null,
|
|
1055
|
+
signalExtractorDefinitions: (config.signals ?? []).map((s) => ({
|
|
1056
|
+
key: s.key ?? s.sourcePath,
|
|
1057
|
+
sourcePath: s.sourcePath,
|
|
1058
|
+
type: s.type ?? deriveSignalType(config.result, s.sourcePath),
|
|
1059
|
+
required: s.required ?? true,
|
|
1060
|
+
availableWhenResultStatusIn: s.availableWhenResultStatusIn ?? null
|
|
1061
|
+
})),
|
|
1062
|
+
computedSignalDefinitions: (config.computedSignals ?? []).map((cs) => ({
|
|
1063
|
+
key: cs.key,
|
|
1064
|
+
type: cs.type,
|
|
1065
|
+
inputSignalKeys: cs.inputSignalKeys,
|
|
1066
|
+
configJson: cs.configJson ?? null,
|
|
1067
|
+
availableWhenResultStatusIn: cs.availableWhenResultStatusIn ?? null
|
|
1068
|
+
})),
|
|
1069
|
+
opencodeMcpJson: config.mcpServers ?? null
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
57
1072
|
export {
|
|
58
1073
|
unwrapTreatyResponse,
|
|
1074
|
+
defineStep,
|
|
59
1075
|
createStepExecutionPlaneClient,
|
|
60
1076
|
createBoboddyTreaty,
|
|
61
1077
|
createBoboddyApiClient
|