@frontmcp/sdk 1.13.2 → 1.14.0-rc.2
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/agent/agent.instance.d.ts +4 -0
- package/agent/agent.instance.d.ts.map +1 -1
- package/agent/agent.scope.d.ts +3 -0
- package/agent/agent.scope.d.ts.map +1 -1
- package/agent/flows/call-agent.flow.d.ts.map +1 -1
- package/app/instances/app.local.instance.d.ts.map +1 -1
- package/app/lazy/lazy-placeholders.d.ts +6 -9
- package/app/lazy/lazy-placeholders.d.ts.map +1 -1
- package/auth/auth-ui/auth-ui.contract.d.ts +4 -1
- package/auth/auth-ui/auth-ui.contract.d.ts.map +1 -1
- package/auth/authorized-apps.utils.d.ts +2 -0
- package/auth/authorized-apps.utils.d.ts.map +1 -1
- package/auth/client-display-name.d.ts +52 -0
- package/auth/client-display-name.d.ts.map +1 -0
- package/auth/federated-steps.d.ts.map +1 -1
- package/auth/flows/oauth.auth-ui.flow.d.ts +1 -1
- package/auth/flows/oauth.authorize.flow.d.ts +6 -3
- package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts +3 -8
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.connect.flow.d.ts +1 -1
- package/auth/flows/oauth.provider-callback.flow.d.ts +9 -2
- package/auth/flows/oauth.provider-callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.register.flow.d.ts +6 -4
- package/auth/flows/oauth.register.flow.d.ts.map +1 -1
- package/auth/flows/oauth.token.flow.d.ts +1 -1
- package/auth/flows/oauth.userinfo.flow.d.ts +1 -1
- package/auth/flows/session.verify.flow.d.ts +20 -4
- package/auth/flows/session.verify.flow.d.ts.map +1 -1
- package/auth/flows/well-known.jwks.flow.d.ts +3 -3
- package/auth/flows/well-known.oauth-authorization-server.flow.d.ts +2 -2
- package/auth/flows/well-known.prm.flow.d.ts +1 -1
- package/auth/instances/instance.local-primary-auth.d.ts +8 -0
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/auth/instances/instance.remote-primary-auth.d.ts +2 -0
- package/auth/instances/instance.remote-primary-auth.d.ts.map +1 -1
- package/auth/session/session-store.factory.d.ts.map +1 -1
- package/browser/agent/agent.instance.mjs +16 -0
- package/browser/agent/agent.scope.mjs +9 -0
- package/browser/agent/flows/call-agent.flow.mjs +3 -1
- package/browser/app/instances/app.local.instance.mjs +6 -1
- package/browser/app/lazy/lazy-placeholders.mjs +3 -3
- package/browser/auth/authorized-apps.utils.mjs +15 -0
- package/browser/auth/client-display-name.mjs +62 -0
- package/browser/auth/federated-steps.mjs +2 -0
- package/browser/auth/flows/oauth.authorize.flow.mjs +25 -10
- package/browser/auth/flows/oauth.callback.flow.mjs +29 -31
- package/browser/auth/flows/oauth.provider-callback.flow.mjs +83 -14
- package/browser/auth/flows/oauth.register.flow.mjs +5 -24
- package/browser/auth/flows/session.verify.flow.mjs +31 -12
- package/browser/auth/instances/instance.local-primary-auth.mjs +43 -10
- package/browser/auth/instances/instance.remote-primary-auth.mjs +15 -0
- package/browser/auth/session/session-store.factory.mjs +15 -36
- package/browser/builtin/authorities/authorities-input.mjs +12 -0
- package/browser/common/decorators/front-mcp.decorator.mjs +2 -1
- package/browser/common/decorators/http-route.decorator.mjs +4 -0
- package/browser/common/index.mjs +2 -2
- package/browser/common/interfaces/server.interface.mjs +4 -0
- package/browser/common/metadata/duty.metadata.mjs +29 -6
- package/browser/common/metadata/event.metadata.mjs +2 -1
- package/browser/common/metadata/front-mcp.metadata.mjs +18 -1
- package/browser/common/metadata/workflow.metadata.mjs +1 -0
- package/browser/common/tokens/front-mcp.tokens.mjs +3 -0
- package/browser/common/tokens/workflow.tokens.mjs +1 -0
- package/browser/common/types/auth/session.types.mjs +2 -0
- package/browser/common/types/index.mjs +1 -1
- package/browser/common/types/options/http/schema.mjs +14 -6
- package/browser/common/types/options/index.mjs +1 -1
- package/browser/common/types/options/redis/connection.mjs +19 -0
- package/browser/common/types/options/redis/index.mjs +12 -0
- package/browser/common/types/options/redis/schema.mjs +145 -12
- package/browser/common/types/options/skills-http/schema.mjs +18 -0
- package/browser/common/types/options/transport/schema.mjs +10 -0
- package/browser/common/utils/auth-info.utils.mjs +17 -3
- package/browser/common/utils/guard.utils.mjs +3 -2
- package/browser/common/utils/index.mjs +2 -1
- package/browser/completion/flows/complete.flow.mjs +13 -7
- package/browser/duty/duty.lifecycle.mjs +32 -5
- package/browser/duty/duty.runner.mjs +3 -1
- package/browser/duty/lease-holder.mjs +50 -3
- package/browser/duty/lease-store.mjs +9 -6
- package/browser/elicitation/flows/elicitation-request.flow.mjs +7 -1
- package/browser/elicitation/flows/elicitation-result.flow.mjs +8 -2
- package/browser/elicitation/questions/question-store.factory.mjs +2 -5
- package/browser/elicitation/store/elicitation-store.factory.mjs +11 -4
- package/browser/errors/browser-entry-point.errors.mjs +1 -0
- package/browser/errors/duty.errors.mjs +9 -0
- package/browser/errors/index.mjs +11 -1
- package/browser/errors/job.errors.mjs +29 -4
- package/browser/errors/mcp.error.mjs +54 -8
- package/browser/errors/provider.errors.mjs +18 -0
- package/browser/errors/transport.errors.mjs +31 -0
- package/browser/event/delivery/event-outbox.mjs +43 -9
- package/browser/event/event-gates.mjs +11 -2
- package/browser/event/event-scope.helper.mjs +5 -1
- package/browser/event/flows/event-ended.flow.mjs +9 -3
- package/browser/event/flows/event-poll.flow.mjs +3 -1
- package/browser/event/flows/event-publish.flow.mjs +1 -0
- package/browser/event/flows/event-subscribe.flow.mjs +2 -9
- package/browser/event/flows/event-unsubscribe.flow.mjs +5 -2
- package/browser/event/poll/event-poll-leases.mjs +4 -3
- package/browser/event/replay/event-replays.mjs +2 -0
- package/browser/event/stream/event-stream.mjs +4 -0
- package/browser/event/stream/event-streams.mjs +9 -6
- package/browser/event/subscription/event-subscription-store.factory.mjs +3 -4
- package/browser/event/subscription/event-subscription-termination.mjs +1 -0
- package/browser/event/subscription/event-subscription.store.mjs +11 -1
- package/browser/event/subscription/event-subscriptions.mjs +4 -1
- package/browser/front-mcp/front-mcp.mjs +38 -4
- package/browser/ha/ha-manager.mjs +2 -1
- package/browser/ha/ha-redis-client.mjs +22 -0
- package/browser/ha/heartbeat.service.mjs +2 -1
- package/browser/ha/index.mjs +2 -0
- package/browser/ha/notification-relay.mjs +11 -3
- package/browser/http-route/flows/http.route.flow.mjs +78 -7
- package/browser/http-route/http-route.table.mjs +38 -11
- package/browser/http-route/people-session-store.mjs +7 -6
- package/browser/http-route/people-sign-in.routes.mjs +44 -3
- package/browser/index.cjs +21327 -17821
- package/browser/index.mjs +10 -3
- package/browser/job/execution/job-execution.manager.mjs +293 -84
- package/browser/job/flows/execute-job.flow.mjs +6 -4
- package/browser/job/index.mjs +3 -1
- package/browser/job/job-admission.mjs +284 -2
- package/browser/job/job-attempt.mjs +2 -1
- package/browser/job/job-run-access.mjs +20 -0
- package/browser/job/job-scope.helper.mjs +37 -10
- package/browser/job/runner/detached-job.worker.mjs +71 -10
- package/browser/job/runner/job-runner.mjs +27 -1
- package/browser/job/store/job-definition-store.factory.mjs +13 -12
- package/browser/job/store/job-state-store.factory.mjs +14 -5
- package/browser/job/store/memory-job-state.store.mjs +91 -7
- package/browser/job/store/redis-job-state.store.mjs +39 -6
- package/browser/job/store/storage-job-state.store.mjs +35 -2
- package/browser/job/tools/cancel-job.tool.mjs +2 -2
- package/browser/job/tools/register-job.tool.mjs +5 -2
- package/browser/job/tools/remove-job.tool.mjs +9 -0
- package/browser/job/tools/update-job.tool.mjs +8 -0
- package/browser/notification/notification.service.mjs +14 -3
- package/browser/prompt/flows/get-prompt.flow.mjs +10 -3
- package/browser/prompt/flows/prompts-list.flow.mjs +7 -2
- package/browser/provider/borrow-providers.mjs +40 -0
- package/browser/provider/container-handle.mjs +10 -0
- package/browser/provider/create-container.mjs +25 -3
- package/browser/provider/provider.registry.mjs +43 -6
- package/browser/remote-mcp/remote-oauth.mjs +43 -13
- package/browser/resource/flows/read-resource.flow.mjs +15 -4
- package/browser/resource/flows/resource-templates-list.flow.mjs +7 -2
- package/browser/resource/flows/resources-list.flow.mjs +7 -2
- package/browser/resource/flows/subscribe-resource.flow.mjs +21 -5
- package/browser/resource/materialized/materialized-resources.mjs +53 -23
- package/browser/resource/materialized/resource-store.mjs +97 -26
- package/browser/resource/resource.events.mjs +12 -1
- package/browser/resource/resource.registry.mjs +66 -8
- package/browser/scope/flows/http.request.flow.mjs +52 -3
- package/browser/scope/scope.instance.mjs +12 -14
- package/browser/server/custom-routes.helper.mjs +57 -6
- package/browser/server/security/resolve-allowed-hosts.mjs +26 -2
- package/browser/server/security/same-origin.mjs +5 -5
- package/browser/server/server.instance.mjs +56 -3
- package/browser/skill/cache/skill-http-cache.catalog.mjs +7 -6
- package/browser/skill/cache/skill-http-cache.factory.mjs +16 -19
- package/browser/skill/cache/skill-http-cache.mjs +14 -4
- package/browser/skill/flows/http/llm-full-txt.flow.mjs +16 -5
- package/browser/skill/flows/http/llm-txt.flow.mjs +1 -0
- package/browser/skill/flows/http/skills-api.flow.mjs +6 -5
- package/browser/skill/flows/load-skill.flow.mjs +9 -4
- package/browser/skill/skill-filter.helper.mjs +41 -4
- package/browser/skill/skill-http.utils.mjs +8 -8
- package/browser/surface/entry-enabled.mjs +22 -6
- package/browser/surface/index.mjs +8 -2
- package/browser/surface/live-surface.mjs +63 -3
- package/browser/task/helpers/task-run-context.mjs +12 -0
- package/browser/task/helpers/task-runner.mjs +2 -0
- package/browser/task/store/storage-task.store.mjs +1 -4
- package/browser/task/store/task-store.factory.mjs +2 -3
- package/browser/task/task.types.mjs +2 -0
- package/browser/tool/flows/call-tool.flow.mjs +56 -17
- package/browser/tool/flows/tools-list.flow.mjs +2 -2
- package/browser/tool/ui/ui-shared.mjs +5 -1
- package/browser/tool/ui/widget-enabled.mjs +11 -0
- package/browser/tool/undeclared-arguments-message.mjs +7 -5
- package/browser/tool/undeclared-arguments.mjs +8 -1
- package/browser/transport/adapters/streamable-http-transport.mjs +4 -0
- package/browser/transport/adapters/transport.local.adapter.mjs +26 -21
- package/browser/transport/adapters/transport.sse.adapter.mjs +15 -2
- package/browser/transport/adapters/transport.streamable-http.adapter.mjs +7 -1
- package/browser/transport/bus/redis-transport-bus.mjs +83 -28
- package/browser/transport/channel-signature.mjs +40 -0
- package/browser/transport/event-stores/redis.event-store.mjs +14 -27
- package/browser/transport/flows/handle.mcp-20260728.flow.mjs +4 -3
- package/browser/transport/flows/handle.streamable-http.flow.mjs +17 -10
- package/browser/transport/mcp-20260728/client/index.mjs +1 -1
- package/browser/transport/mcp-20260728/client/mcp-stateless.client.mjs +77 -15
- package/browser/transport/mcp-20260728/index.mjs +1 -1
- package/browser/transport/mcp-20260728/result-decorator.mjs +14 -7
- package/browser/transport/mcp-20260728/subscriptions.mjs +27 -7
- package/browser/transport/mcp-handlers/index.mjs +11 -2
- package/browser/transport/relay/relay-scope.helper.mjs +34 -6
- package/browser/transport/session-end-channel.mjs +199 -0
- package/browser/transport/transport.local.mjs +3 -0
- package/browser/transport/transport.registry.mjs +352 -21
- package/browser/transport/web-fetch-handler.mjs +64 -4
- package/browser/utils/same-origin-fetch.utils.mjs +33 -0
- package/browser/work/index.mjs +13 -0
- package/browser/work/work-spans.mjs +55 -0
- package/browser/worker/worker.lifecycle.mjs +3 -1
- package/browser/workflow/engine/workflow-step.executor.mjs +32 -12
- package/browser/workflow/engine/workflow.engine.mjs +5 -0
- package/browser/workflow/tools/register-workflow.tool.mjs +5 -2
- package/browser/workflow/tools/remove-workflow.tool.mjs +9 -0
- package/browser/workflow/tools/update-workflow.tool.mjs +8 -0
- package/builtin/authorities/authorities-input.d.ts +3 -0
- package/builtin/authorities/authorities-input.d.ts.map +1 -0
- package/common/decorators/front-mcp.decorator.d.ts.map +1 -1
- package/common/decorators/http-route.decorator.d.ts.map +1 -1
- package/common/entries/scope.entry.d.ts +3 -0
- package/common/entries/scope.entry.d.ts.map +1 -1
- package/common/interfaces/server.interface.d.ts +2 -0
- package/common/interfaces/server.interface.d.ts.map +1 -1
- package/common/metadata/agent.metadata.d.ts +2 -2
- package/common/metadata/app.metadata.d.ts +500 -52
- package/common/metadata/app.metadata.d.ts.map +1 -1
- package/common/metadata/duty.metadata.d.ts +41 -11
- package/common/metadata/duty.metadata.d.ts.map +1 -1
- package/common/metadata/enabled.metadata.d.ts +32 -0
- package/common/metadata/enabled.metadata.d.ts.map +1 -1
- package/common/metadata/event.metadata.d.ts +146 -0
- package/common/metadata/event.metadata.d.ts.map +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +9457 -348
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/metadata/http-route.metadata.d.ts +7 -0
- package/common/metadata/http-route.metadata.d.ts.map +1 -1
- package/common/metadata/job.metadata.d.ts +1 -1
- package/common/metadata/output-policy.d.ts +1 -1
- package/common/metadata/plugin.metadata.d.ts +2 -2
- package/common/metadata/tool.metadata.d.ts +1 -1
- package/common/metadata/worker.metadata.d.ts +4 -4
- package/common/metadata/workflow.metadata.d.ts +15 -1
- package/common/metadata/workflow.metadata.d.ts.map +1 -1
- package/common/records/job.record.d.ts +6 -0
- package/common/records/job.record.d.ts.map +1 -1
- package/common/records/workflow.record.d.ts +6 -0
- package/common/records/workflow.record.d.ts.map +1 -1
- package/common/schemas/annotated-class.schema.d.ts +1 -1
- package/common/schemas/http-output.schema.d.ts +24 -24
- package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
- package/common/tokens/workflow.tokens.d.ts +1 -0
- package/common/tokens/workflow.tokens.d.ts.map +1 -1
- package/common/types/auth/session.types.d.ts +12 -1
- package/common/types/auth/session.types.d.ts.map +1 -1
- package/common/types/options/elicitation/schema.d.ts +137 -0
- package/common/types/options/elicitation/schema.d.ts.map +1 -1
- package/common/types/options/http/interfaces.d.ts +41 -4
- package/common/types/options/http/interfaces.d.ts.map +1 -1
- package/common/types/options/http/schema.d.ts +5 -2
- package/common/types/options/http/schema.d.ts.map +1 -1
- package/common/types/options/redis/connection.d.ts +18 -0
- package/common/types/options/redis/connection.d.ts.map +1 -0
- package/common/types/options/redis/index.d.ts +7 -3
- package/common/types/options/redis/index.d.ts.map +1 -1
- package/common/types/options/redis/interfaces.d.ts +54 -2
- package/common/types/options/redis/interfaces.d.ts.map +1 -1
- package/common/types/options/redis/schema.d.ts +412 -2
- package/common/types/options/redis/schema.d.ts.map +1 -1
- package/common/types/options/skills-http/interfaces.d.ts +7 -0
- package/common/types/options/skills-http/interfaces.d.ts.map +1 -1
- package/common/types/options/skills-http/schema.d.ts +19 -0
- package/common/types/options/skills-http/schema.d.ts.map +1 -1
- package/common/types/options/transport/index.d.ts +1 -1
- package/common/types/options/transport/index.d.ts.map +1 -1
- package/common/types/options/transport/interfaces.d.ts +32 -0
- package/common/types/options/transport/interfaces.d.ts.map +1 -1
- package/common/types/options/transport/schema.d.ts +548 -0
- package/common/types/options/transport/schema.d.ts.map +1 -1
- package/common/utils/auth-info.utils.d.ts +29 -1
- package/common/utils/auth-info.utils.d.ts.map +1 -1
- package/common/utils/guard.utils.d.ts +6 -3
- package/common/utils/guard.utils.d.ts.map +1 -1
- package/common/utils/index.d.ts +1 -0
- package/common/utils/index.d.ts.map +1 -1
- package/completion/flows/complete.flow.d.ts +5 -1
- package/completion/flows/complete.flow.d.ts.map +1 -1
- package/context/frontmcp-context.provider.d.ts +1 -1
- package/direct/direct.types.d.ts +4 -4
- package/direct/direct.types.d.ts.map +1 -1
- package/duty/duty.lifecycle.d.ts +1 -1
- package/duty/duty.lifecycle.d.ts.map +1 -1
- package/duty/duty.runner.d.ts +6 -1
- package/duty/duty.runner.d.ts.map +1 -1
- package/duty/lease-holder.d.ts +26 -3
- package/duty/lease-holder.d.ts.map +1 -1
- package/duty/lease-store.d.ts +2 -0
- package/duty/lease-store.d.ts.map +1 -1
- package/elicitation/elicitation.types.d.ts +2 -0
- package/elicitation/elicitation.types.d.ts.map +1 -1
- package/elicitation/flows/elicitation-request.flow.d.ts +2 -0
- package/elicitation/flows/elicitation-request.flow.d.ts.map +1 -1
- package/elicitation/flows/elicitation-result.flow.d.ts +3 -1
- package/elicitation/flows/elicitation-result.flow.d.ts.map +1 -1
- package/elicitation/questions/question-store.factory.d.ts.map +1 -1
- package/elicitation/store/elicitation-store.factory.d.ts.map +1 -1
- package/elicitation/store/elicitation.store.d.ts +2 -0
- package/elicitation/store/elicitation.store.d.ts.map +1 -1
- package/errors/browser-entry-point.errors.d.ts +1 -0
- package/errors/browser-entry-point.errors.d.ts.map +1 -1
- package/errors/duty.errors.d.ts +4 -0
- package/errors/duty.errors.d.ts.map +1 -1
- package/errors/index.d.ts +3 -3
- package/errors/index.d.ts.map +1 -1
- package/errors/job.errors.d.ts +22 -4
- package/errors/job.errors.d.ts.map +1 -1
- package/errors/mcp.error.d.ts +11 -1
- package/errors/mcp.error.d.ts.map +1 -1
- package/errors/provider.errors.d.ts +11 -0
- package/errors/provider.errors.d.ts.map +1 -1
- package/errors/transport.errors.d.ts +29 -0
- package/errors/transport.errors.d.ts.map +1 -1
- package/esm/index.mjs +56 -51
- package/event/delivery/event-outbox.d.ts +15 -2
- package/event/delivery/event-outbox.d.ts.map +1 -1
- package/event/event-gates.d.ts +7 -1
- package/event/event-gates.d.ts.map +1 -1
- package/event/event-scope.helper.d.ts.map +1 -1
- package/event/flows/event-ended.flow.d.ts +4 -3
- package/event/flows/event-ended.flow.d.ts.map +1 -1
- package/event/flows/event-poll.flow.d.ts.map +1 -1
- package/event/flows/event-publish-http.flow.d.ts +1 -1
- package/event/flows/event-publish.flow.d.ts.map +1 -1
- package/event/flows/event-subscribe.flow.d.ts.map +1 -1
- package/event/flows/event-unsubscribe.flow.d.ts +2 -2
- package/event/flows/event-unsubscribe.flow.d.ts.map +1 -1
- package/event/index.d.ts +1 -1
- package/event/index.d.ts.map +1 -1
- package/event/poll/event-poll-leases.d.ts +4 -2
- package/event/poll/event-poll-leases.d.ts.map +1 -1
- package/event/replay/event-replays.d.ts.map +1 -1
- package/event/stream/event-stream.d.ts +2 -0
- package/event/stream/event-stream.d.ts.map +1 -1
- package/event/stream/event-streams.d.ts +5 -2
- package/event/stream/event-streams.d.ts.map +1 -1
- package/event/subscription/event-subscription-store.factory.d.ts.map +1 -1
- package/event/subscription/event-subscription-termination.d.ts.map +1 -1
- package/event/subscription/event-subscription.store.d.ts +6 -0
- package/event/subscription/event-subscription.store.d.ts.map +1 -1
- package/event/subscription/event-subscriptions.d.ts +4 -4
- package/event/subscription/event-subscriptions.d.ts.map +1 -1
- package/front-mcp/front-mcp.d.ts +7 -2
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/ha/ha-manager.d.ts.map +1 -1
- package/ha/ha-redis-client.d.ts +16 -0
- package/ha/ha-redis-client.d.ts.map +1 -0
- package/ha/heartbeat.service.d.ts +4 -2
- package/ha/heartbeat.service.d.ts.map +1 -1
- package/ha/index.d.ts +2 -1
- package/ha/index.d.ts.map +1 -1
- package/ha/notification-relay.d.ts +8 -3
- package/ha/notification-relay.d.ts.map +1 -1
- package/ha/relay-messages.d.ts +23 -4
- package/ha/relay-messages.d.ts.map +1 -1
- package/http-route/flows/http.route.flow.d.ts +15 -4
- package/http-route/flows/http.route.flow.d.ts.map +1 -1
- package/http-route/http-route.table.d.ts +5 -1
- package/http-route/http-route.table.d.ts.map +1 -1
- package/http-route/people-session-store.d.ts +4 -2
- package/http-route/people-session-store.d.ts.map +1 -1
- package/http-route/people-sign-in.routes.d.ts +10 -0
- package/http-route/people-sign-in.routes.d.ts.map +1 -1
- package/index.d.ts +15 -14
- package/index.d.ts.map +1 -1
- package/index.js +62 -57
- package/job/execution/job-execution.manager.d.ts +73 -7
- package/job/execution/job-execution.manager.d.ts.map +1 -1
- package/job/flows/execute-job.flow.d.ts.map +1 -1
- package/job/index.d.ts +2 -2
- package/job/index.d.ts.map +1 -1
- package/job/job-admission.d.ts +81 -2
- package/job/job-admission.d.ts.map +1 -1
- package/job/job-attempt.d.ts +2 -2
- package/job/job-attempt.d.ts.map +1 -1
- package/job/job-run-access.d.ts +14 -0
- package/job/job-run-access.d.ts.map +1 -1
- package/job/job-scope.helper.d.ts +20 -0
- package/job/job-scope.helper.d.ts.map +1 -1
- package/job/runner/detached-job.worker.d.ts +9 -0
- package/job/runner/detached-job.worker.d.ts.map +1 -1
- package/job/runner/job-runner.d.ts +18 -0
- package/job/runner/job-runner.d.ts.map +1 -1
- package/job/store/job-definition-store.factory.d.ts +5 -1
- package/job/store/job-definition-store.factory.d.ts.map +1 -1
- package/job/store/job-state-store.factory.d.ts +5 -1
- package/job/store/job-state-store.factory.d.ts.map +1 -1
- package/job/store/job-state.interface.d.ts +16 -0
- package/job/store/job-state.interface.d.ts.map +1 -1
- package/job/store/memory-job-state.store.d.ts +33 -2
- package/job/store/memory-job-state.store.d.ts.map +1 -1
- package/job/store/redis-job-state.store.d.ts +13 -3
- package/job/store/redis-job-state.store.d.ts.map +1 -1
- package/job/store/storage-job-state.store.d.ts +4 -0
- package/job/store/storage-job-state.store.d.ts.map +1 -1
- package/job/tools/cancel-job.tool.d.ts.map +1 -1
- package/job/tools/register-job.tool.d.ts.map +1 -1
- package/job/tools/remove-job.tool.d.ts.map +1 -1
- package/job/tools/update-job.tool.d.ts.map +1 -1
- package/mcp-registry/flows/server-card.flow.d.ts +3 -3
- package/mcp-registry/flows/well-known.ai-catalog.flow.d.ts +2 -2
- package/mcp-registry/flows/well-known.mcp-registry-auth.flow.d.ts +1 -1
- package/notification/notification.service.d.ts +5 -1
- package/notification/notification.service.d.ts.map +1 -1
- package/package.json +10 -10
- package/prompt/flows/get-prompt.flow.d.ts.map +1 -1
- package/prompt/flows/prompts-list.flow.d.ts +1 -1
- package/prompt/flows/prompts-list.flow.d.ts.map +1 -1
- package/provider/borrow-providers.d.ts +15 -0
- package/provider/borrow-providers.d.ts.map +1 -0
- package/provider/container-handle.d.ts +31 -0
- package/provider/container-handle.d.ts.map +1 -0
- package/provider/create-container.d.ts +8 -2
- package/provider/create-container.d.ts.map +1 -1
- package/provider/provider.registry.d.ts +23 -4
- package/provider/provider.registry.d.ts.map +1 -1
- package/remote-mcp/remote-oauth.d.ts +3 -1
- package/remote-mcp/remote-oauth.d.ts.map +1 -1
- package/resource/flows/read-resource.flow.d.ts.map +1 -1
- package/resource/flows/resource-templates-list.flow.d.ts +1 -1
- package/resource/flows/resource-templates-list.flow.d.ts.map +1 -1
- package/resource/flows/resources-list.flow.d.ts +1 -1
- package/resource/flows/resources-list.flow.d.ts.map +1 -1
- package/resource/flows/subscribe-resource.flow.d.ts +1 -0
- package/resource/flows/subscribe-resource.flow.d.ts.map +1 -1
- package/resource/materialized/materialized-resources.d.ts +15 -3
- package/resource/materialized/materialized-resources.d.ts.map +1 -1
- package/resource/materialized/resource-store.d.ts +6 -2
- package/resource/materialized/resource-store.d.ts.map +1 -1
- package/resource/resource.events.d.ts +3 -0
- package/resource/resource.events.d.ts.map +1 -1
- package/resource/resource.registry.d.ts +8 -3
- package/resource/resource.registry.d.ts.map +1 -1
- package/scope/flows/http.request.flow.d.ts +8 -1
- package/scope/flows/http.request.flow.d.ts.map +1 -1
- package/scope/scope.instance.d.ts +2 -2
- package/scope/scope.instance.d.ts.map +1 -1
- package/server/adapters/express.host.adapter.d.ts +26 -0
- package/server/adapters/express.host.adapter.d.ts.map +1 -1
- package/server/adapters/user-content.listener.d.ts +5 -1
- package/server/adapters/user-content.listener.d.ts.map +1 -1
- package/server/custom-routes.helper.d.ts +19 -2
- package/server/custom-routes.helper.d.ts.map +1 -1
- package/server/security/resolve-allowed-hosts.d.ts +16 -0
- package/server/security/resolve-allowed-hosts.d.ts.map +1 -1
- package/server/security/same-origin.d.ts +2 -1
- package/server/security/same-origin.d.ts.map +1 -1
- package/server/server.instance.d.ts +10 -0
- package/server/server.instance.d.ts.map +1 -1
- package/shared/ensure-shared-server.d.ts +9 -2
- package/shared/ensure-shared-server.d.ts.map +1 -1
- package/shared/flows/shared.drain.flow.d.ts +1 -1
- package/shared/flows/shared.identify.flow.d.ts +6 -2
- package/shared/flows/shared.identify.flow.d.ts.map +1 -1
- package/shared/index.d.ts.map +1 -1
- package/shared/shared-attach.d.ts +15 -6
- package/shared/shared-attach.d.ts.map +1 -1
- package/shared/shared-embedded.d.ts +12 -2
- package/shared/shared-embedded.d.ts.map +1 -1
- package/shared/shared-endpoint.d.ts +3 -1
- package/shared/shared-endpoint.d.ts.map +1 -1
- package/shared/shared-files.d.ts +2 -0
- package/shared/shared-files.d.ts.map +1 -1
- package/shared/shared-serve.d.ts +20 -1
- package/shared/shared-serve.d.ts.map +1 -1
- package/shared/shared-server.lifecycle.d.ts +40 -10
- package/shared/shared-server.lifecycle.d.ts.map +1 -1
- package/shared/shared-server.options.d.ts +43 -6
- package/shared/shared-server.options.d.ts.map +1 -1
- package/skill/cache/skill-http-cache.catalog.d.ts +4 -4
- package/skill/cache/skill-http-cache.catalog.d.ts.map +1 -1
- package/skill/cache/skill-http-cache.d.ts +15 -2
- package/skill/cache/skill-http-cache.d.ts.map +1 -1
- package/skill/cache/skill-http-cache.factory.d.ts +12 -0
- package/skill/cache/skill-http-cache.factory.d.ts.map +1 -1
- package/skill/flows/http/llm-full-txt.flow.d.ts +1 -1
- package/skill/flows/http/llm-full-txt.flow.d.ts.map +1 -1
- package/skill/flows/http/llm-txt.flow.d.ts +1 -1
- package/skill/flows/http/llm-txt.flow.d.ts.map +1 -1
- package/skill/flows/http/skills-api.flow.d.ts +1 -1
- package/skill/flows/http/skills-api.flow.d.ts.map +1 -1
- package/skill/flows/load-skill.flow.d.ts.map +1 -1
- package/skill/skill-filter.helper.d.ts +16 -0
- package/skill/skill-filter.helper.d.ts.map +1 -1
- package/skill/skill-http.utils.d.ts +7 -1
- package/skill/skill-http.utils.d.ts.map +1 -1
- package/surface/entry-enabled.d.ts +23 -6
- package/surface/entry-enabled.d.ts.map +1 -1
- package/surface/index.d.ts +2 -2
- package/surface/index.d.ts.map +1 -1
- package/surface/live-surface.d.ts +32 -7
- package/surface/live-surface.d.ts.map +1 -1
- package/task/helpers/task-run-context.d.ts +5 -0
- package/task/helpers/task-run-context.d.ts.map +1 -0
- package/task/helpers/task-runner.d.ts.map +1 -1
- package/task/store/storage-task.store.d.ts.map +1 -1
- package/task/store/task-store.factory.d.ts.map +1 -1
- package/task/store/task.store.d.ts +1 -1
- package/task/store/task.store.d.ts.map +1 -1
- package/task/task.types.d.ts +1 -0
- package/task/task.types.d.ts.map +1 -1
- package/tool/flows/call-tool.flow.d.ts +10 -3
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tools-list.flow.d.ts +1 -1
- package/tool/flows/tools-list.flow.d.ts.map +1 -1
- package/tool/ui/ui-shared.d.ts +2 -0
- package/tool/ui/ui-shared.d.ts.map +1 -1
- package/tool/ui/widget-enabled.d.ts +8 -0
- package/tool/ui/widget-enabled.d.ts.map +1 -0
- package/tool/undeclared-arguments-message.d.ts.map +1 -1
- package/tool/undeclared-arguments.d.ts +4 -0
- package/tool/undeclared-arguments.d.ts.map +1 -1
- package/transport/adapters/streamable-http-transport.d.ts +2 -0
- package/transport/adapters/streamable-http-transport.d.ts.map +1 -1
- package/transport/adapters/transport.local.adapter.d.ts +3 -0
- package/transport/adapters/transport.local.adapter.d.ts.map +1 -1
- package/transport/adapters/transport.sse.adapter.d.ts +3 -0
- package/transport/adapters/transport.sse.adapter.d.ts.map +1 -1
- package/transport/adapters/transport.streamable-http.adapter.d.ts +1 -0
- package/transport/adapters/transport.streamable-http.adapter.d.ts.map +1 -1
- package/transport/bus/redis-transport-bus.d.ts +25 -4
- package/transport/bus/redis-transport-bus.d.ts.map +1 -1
- package/transport/channel-signature.d.ts +16 -0
- package/transport/channel-signature.d.ts.map +1 -0
- package/transport/event-stores/redis.event-store.d.ts +1 -1
- package/transport/event-stores/redis.event-store.d.ts.map +1 -1
- package/transport/flows/handle.mcp-20260728.flow.d.ts +2 -1
- package/transport/flows/handle.mcp-20260728.flow.d.ts.map +1 -1
- package/transport/flows/handle.streamable-http.flow.d.ts +1 -1
- package/transport/flows/handle.streamable-http.flow.d.ts.map +1 -1
- package/transport/mcp-20260728/client/mcp-stateless.client.d.ts +8 -0
- package/transport/mcp-20260728/client/mcp-stateless.client.d.ts.map +1 -1
- package/transport/mcp-20260728/result-decorator.d.ts +4 -2
- package/transport/mcp-20260728/result-decorator.d.ts.map +1 -1
- package/transport/mcp-20260728/subscriptions.d.ts +2 -0
- package/transport/mcp-20260728/subscriptions.d.ts.map +1 -1
- package/transport/mcp-handlers/index.d.ts +5 -3
- package/transport/mcp-handlers/index.d.ts.map +1 -1
- package/transport/relay/relay-scope.helper.d.ts +2 -2
- package/transport/relay/relay-scope.helper.d.ts.map +1 -1
- package/transport/session-end-channel.d.ts +81 -0
- package/transport/session-end-channel.d.ts.map +1 -0
- package/transport/transport.local.d.ts +2 -1
- package/transport/transport.local.d.ts.map +1 -1
- package/transport/transport.registry.d.ts +73 -2
- package/transport/transport.registry.d.ts.map +1 -1
- package/transport/transport.types.d.ts +6 -1
- package/transport/transport.types.d.ts.map +1 -1
- package/transport/web-fetch-handler.d.ts.map +1 -1
- package/utils/same-origin-fetch.utils.d.ts +5 -0
- package/utils/same-origin-fetch.utils.d.ts.map +1 -0
- package/work/index.d.ts +2 -0
- package/work/index.d.ts.map +1 -0
- package/work/work-spans.d.ts +42 -0
- package/work/work-spans.d.ts.map +1 -0
- package/worker/worker.lifecycle.d.ts.map +1 -1
- package/workflow/engine/workflow-step.executor.d.ts +10 -3
- package/workflow/engine/workflow-step.executor.d.ts.map +1 -1
- package/workflow/engine/workflow.engine.d.ts +2 -0
- package/workflow/engine/workflow.engine.d.ts.map +1 -1
- package/workflow/tools/register-workflow.tool.d.ts.map +1 -1
- package/workflow/tools/remove-workflow.tool.d.ts.map +1 -1
- package/workflow/tools/update-workflow.tool.d.ts.map +1 -1
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
var __frontmcpModule = typeof process !== "undefined" && typeof process.getBuiltinModule === "function" ? process.getBuiltinModule("module") : undefined;
|
|
2
|
+
const require = __frontmcpModule ? __frontmcpModule.createRequire(import.meta.url || 'file:///') : undefined;
|
|
3
|
+
// __frontmcpCreateRequire
|
|
4
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
5
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
6
|
+
}) : x)(function(x) {
|
|
7
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
8
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
9
|
+
});
|
|
10
|
+
|
|
1
11
|
// libs/sdk/src/job/execution/job-execution.manager.ts
|
|
2
12
|
import { getHostname, randomUUID, runRequestExclusive } from "@frontmcp/utils";
|
|
3
13
|
import { FrontMcpContext } from "../../context/index.mjs";
|
|
@@ -7,8 +17,8 @@ import {
|
|
|
7
17
|
JobNotAuthorizedError,
|
|
8
18
|
JobRunFinishedError,
|
|
9
19
|
JobRunnerBootError,
|
|
20
|
+
JobRunnerBusyError,
|
|
10
21
|
JobRunnerUnavailableError,
|
|
11
|
-
JobRunNotCancellableError,
|
|
12
22
|
JobRunNotFoundError,
|
|
13
23
|
JobTimeoutError
|
|
14
24
|
} from "../../errors/index.mjs";
|
|
@@ -36,6 +46,14 @@ var DEFAULT_JOB_TIMEOUT_MS = 3e5;
|
|
|
36
46
|
var DETACHED_FLUSH_MS = 500;
|
|
37
47
|
var DETACHED_BOOT_TTL_SECONDS = 60;
|
|
38
48
|
var DETACHED_WATCH_MS = 1e3;
|
|
49
|
+
function detachedRunLimitsOf(config = {}, admission) {
|
|
50
|
+
const machineSlots = admission?.scope === "machine" ? admission.concurrency : void 0;
|
|
51
|
+
return {
|
|
52
|
+
maxRuns: Math.min(config.maxRuns ?? Math.max(4, 2 * cpuCount()), machineSlots ?? Infinity),
|
|
53
|
+
maxRunsPerCaller: config.maxRunsPerCaller ?? DEFAULT_DETACHED_RUNS_PER_CALLER
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
var DEFAULT_DETACHED_RUNS_PER_CALLER = 4;
|
|
39
57
|
var JobExecutionManager = class {
|
|
40
58
|
stateStore;
|
|
41
59
|
logger;
|
|
@@ -49,6 +67,8 @@ var JobExecutionManager = class {
|
|
|
49
67
|
heartbeat;
|
|
50
68
|
/** The detached runs this server watches, by run. */
|
|
51
69
|
watchers = /* @__PURE__ */ new Map();
|
|
70
|
+
/** The detached runs this server started or watches until they end, with the caller each counts for. */
|
|
71
|
+
detachedRuns = /* @__PURE__ */ new Map();
|
|
52
72
|
/** The progress writes of the detached runs this process runs, at most one per {@link DETACHED_FLUSH_MS}. */
|
|
53
73
|
progressFlushers = /* @__PURE__ */ new Map();
|
|
54
74
|
/**
|
|
@@ -144,12 +164,22 @@ var JobExecutionManager = class {
|
|
|
144
164
|
async startWorkflowRunOnce(workflow, jobRegistry, runId, opts) {
|
|
145
165
|
if (await this.stateStore.getRun(runId)) return false;
|
|
146
166
|
const run = await this.prepareWorkflowRun(workflow, runId, { ...opts, background: true });
|
|
167
|
+
if (workflow.metadata.runner === "detached") {
|
|
168
|
+
return await this.startDetachedWorkflow(workflow, run.record, (record) => this.createRunIfAbsent(record)) !== void 0;
|
|
169
|
+
}
|
|
147
170
|
if (!await this.createRunIfAbsent(run.record)) return false;
|
|
148
171
|
await this.launchWorkflowRun(workflow, jobRegistry, run);
|
|
149
172
|
return true;
|
|
150
173
|
}
|
|
151
174
|
async submitWorkflow(workflow, jobRegistry, runId, opts) {
|
|
152
175
|
const run = await this.prepareWorkflowRun(workflow, runId, opts);
|
|
176
|
+
if (workflow.metadata.runner === "detached") {
|
|
177
|
+
const create = async (record) => {
|
|
178
|
+
await this.stateStore.createRun(record);
|
|
179
|
+
return true;
|
|
180
|
+
};
|
|
181
|
+
return await this.startDetachedWorkflow(workflow, run.record, create) ?? { runId, state: "pending" };
|
|
182
|
+
}
|
|
153
183
|
await this.stateStore.createRun(run.record);
|
|
154
184
|
return this.launchWorkflowRun(workflow, jobRegistry, run);
|
|
155
185
|
}
|
|
@@ -164,6 +194,7 @@ var JobExecutionManager = class {
|
|
|
164
194
|
async prepareWorkflowRun(workflow, runId, opts) {
|
|
165
195
|
await this.assertMaySubmit(workflow.metadata.permissions, workflow.name, opts);
|
|
166
196
|
const workflowInput = parseWorkflowInput(workflow, opts.workflowInput);
|
|
197
|
+
const storedInput = workflow.metadata.runner === "detached" ? opts.workflowInput ?? {} : workflowInput;
|
|
167
198
|
const record = {
|
|
168
199
|
runId,
|
|
169
200
|
jobId: workflow.metadata.id ?? workflow.name,
|
|
@@ -172,7 +203,7 @@ var JobExecutionManager = class {
|
|
|
172
203
|
sessionId: opts.sessionId,
|
|
173
204
|
...runOwnerOf(opts.authInfo, opts.authoritiesContextBuilder),
|
|
174
205
|
state: "pending",
|
|
175
|
-
input:
|
|
206
|
+
input: storedInput,
|
|
176
207
|
startedAt: Date.now(),
|
|
177
208
|
attempt: 1,
|
|
178
209
|
maxAttempts: 1,
|
|
@@ -228,12 +259,12 @@ var JobExecutionManager = class {
|
|
|
228
259
|
return this.stateStore.getRun(runId);
|
|
229
260
|
}
|
|
230
261
|
/**
|
|
231
|
-
* Cancel a job run: the cancel is written to the store first, where every process sharing it reads it,
|
|
262
|
+
* Cancel a job or workflow run: the cancel is written to the store first, where every process sharing it reads it,
|
|
232
263
|
* then the run's `this.signal` is aborted with `JobCancelledError` when this process runs it (another
|
|
233
|
-
* process polls the store and aborts its own run).
|
|
264
|
+
* process polls the store and aborts its own run). A workflow run starts no more steps, and the attempts of its
|
|
265
|
+
* running steps are aborted. The caller checks it may cancel the run.
|
|
234
266
|
*
|
|
235
267
|
* @throws JobRunNotFoundError for an unknown run
|
|
236
|
-
* @throws JobRunNotCancellableError for a workflow run
|
|
237
268
|
* @throws JobRunFinishedError for a run that already ended
|
|
238
269
|
*/
|
|
239
270
|
async cancel(runId) {
|
|
@@ -241,10 +272,12 @@ var JobExecutionManager = class {
|
|
|
241
272
|
await this.withRunLock(runId, async () => {
|
|
242
273
|
const record = await this.stateStore.getRun(runId);
|
|
243
274
|
if (!record) throw new JobRunNotFoundError(runId);
|
|
244
|
-
if ("workflowName" in record) throw new JobRunNotCancellableError(runId);
|
|
245
275
|
if (FINISHED_JOB_STATES.has(record.state)) throw new JobRunFinishedError(runId, record.state);
|
|
246
276
|
await this.stateStore.requestCancel?.(runId);
|
|
247
|
-
await this.write(runId, cancelledUpdate(reason))
|
|
277
|
+
if (!await this.write(runId, cancelledUpdate(reason))) {
|
|
278
|
+
const ended = await this.stateStore.getRun(runId);
|
|
279
|
+
throw new JobRunFinishedError(runId, ended?.state ?? "completed");
|
|
280
|
+
}
|
|
248
281
|
});
|
|
249
282
|
this.activeRuns.get(runId)?.controller.abort(reason);
|
|
250
283
|
}
|
|
@@ -256,6 +289,7 @@ var JobExecutionManager = class {
|
|
|
256
289
|
async dispose(timeoutMs) {
|
|
257
290
|
for (const watch of this.watchers.values()) clearInterval(watch);
|
|
258
291
|
this.watchers.clear();
|
|
292
|
+
this.detachedRuns.clear();
|
|
259
293
|
const runs = [...this.activeRuns.entries()];
|
|
260
294
|
for (const [runId, run] of runs) run.controller.abort(new JobInterruptedError(runId));
|
|
261
295
|
const ended = () => Promise.all(runs.map(([, run]) => run.settled));
|
|
@@ -276,7 +310,10 @@ var JobExecutionManager = class {
|
|
|
276
310
|
if (FINISHED_JOB_STATES.has(record.state) || !record.runner) continue;
|
|
277
311
|
if (this.scope && record.scopeId !== void 0 && record.scopeId !== this.scope.id) continue;
|
|
278
312
|
if (await this.runnerGone(record.runner, record.startedAt)) await this.endOrphan(record);
|
|
279
|
-
else if (record.runner.kind === "detached")
|
|
313
|
+
else if (record.runner.kind === "detached") {
|
|
314
|
+
this.detachedRuns.set(record.runId, callerKeyOf(record));
|
|
315
|
+
this.watch(record.runId);
|
|
316
|
+
}
|
|
280
317
|
}
|
|
281
318
|
}
|
|
282
319
|
/**
|
|
@@ -287,6 +324,7 @@ var JobExecutionManager = class {
|
|
|
287
324
|
async runDetached(runId) {
|
|
288
325
|
const record = await this.stateStore.getRun(runId);
|
|
289
326
|
if (!record?.runner || FINISHED_JOB_STATES.has(record.state)) return;
|
|
327
|
+
if ("workflowName" in record) return this.runDetachedWorkflow(record);
|
|
290
328
|
const job = this.options.findJob?.(record.jobName);
|
|
291
329
|
if (!job) {
|
|
292
330
|
await this.failToBoot(record, `the server has no job named "${record.jobName}"`);
|
|
@@ -295,7 +333,7 @@ var JobExecutionManager = class {
|
|
|
295
333
|
const warn = (error) => this.logger.warn(`Detached run ${runId}: ${toJobError(error).message}`);
|
|
296
334
|
const release = await new RunnerHeartbeat(this.stateStore, record.runner.id, warn).hold();
|
|
297
335
|
const flusher = new LatestValueFlusher(
|
|
298
|
-
(progress) => this.updateState(runId, { progress }),
|
|
336
|
+
(progress) => this.updateState(runId, { progress }).then(() => void 0),
|
|
299
337
|
DETACHED_FLUSH_MS,
|
|
300
338
|
warn
|
|
301
339
|
);
|
|
@@ -311,6 +349,38 @@ var JobExecutionManager = class {
|
|
|
311
349
|
release();
|
|
312
350
|
}
|
|
313
351
|
}
|
|
352
|
+
/** Run a detached workflow run in this process, which becomes its runner, as `runDetached()` runs a job's. */
|
|
353
|
+
async runDetachedWorkflow(record) {
|
|
354
|
+
const { runId } = record;
|
|
355
|
+
const workflow = this.options.workflows?.find(record.workflowName);
|
|
356
|
+
const runner = record.runner;
|
|
357
|
+
if (!workflow || !runner) {
|
|
358
|
+
await this.failToBoot(record, `the server has no workflow named "${record.workflowName}"`);
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
let workflowInput;
|
|
362
|
+
try {
|
|
363
|
+
workflowInput = parseWorkflowInput(workflow, record.input);
|
|
364
|
+
} catch (error) {
|
|
365
|
+
await this.endRun(record, toJobError(error));
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
const warn = (error) => this.logger.warn(`Detached run ${runId}: ${toJobError(error).message}`);
|
|
369
|
+
const release = await new RunnerHeartbeat(this.stateStore, runner.id, warn).hold();
|
|
370
|
+
try {
|
|
371
|
+
await this.updateState(runId, { runner: { ...runner, pid: currentPid(), hostname: getHostname() } });
|
|
372
|
+
const scopeId = this.scope?.id ?? workflow.providers.getActiveScope().id;
|
|
373
|
+
const opts = withBackgroundContext(
|
|
374
|
+
{ sessionId: record.sessionId, authInfo: {}, workflowInput },
|
|
375
|
+
scopeId
|
|
376
|
+
);
|
|
377
|
+
const jobs = this.options.workflows?.jobs;
|
|
378
|
+
if (!jobs) throw new JobRunnerBootError(runId, "the server has no jobs for the steps");
|
|
379
|
+
await this.executeWorkflowInline(workflow, jobs, runId, opts).catch(() => void 0);
|
|
380
|
+
} finally {
|
|
381
|
+
release();
|
|
382
|
+
}
|
|
383
|
+
}
|
|
314
384
|
/**
|
|
315
385
|
* List runs with optional filters.
|
|
316
386
|
*/
|
|
@@ -325,17 +395,89 @@ var JobExecutionManager = class {
|
|
|
325
395
|
async startDetached(job, record) {
|
|
326
396
|
const unavailable = this.options.detachedUnavailable;
|
|
327
397
|
if (unavailable) throw new JobRunnerUnavailableError(job.name, unavailable.why, unavailable.remedy);
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
398
|
+
this.reserveDetached(job.name, record, "Job");
|
|
399
|
+
try {
|
|
400
|
+
const runner = { kind: "detached", id: randomUUID(), pid: 0, hostname: getHostname() };
|
|
401
|
+
await this.stateStore.touchRunner?.(runner.id, DETACHED_BOOT_TTL_SECONDS);
|
|
402
|
+
const child = this.spawnRunner(record.runId);
|
|
403
|
+
const created = this.stateStore.createRun({ ...record, runner: { ...runner, pid: child.pid ?? 0 } });
|
|
404
|
+
child.once("error", (error) => {
|
|
405
|
+
void created.then(
|
|
406
|
+
() => this.failToBoot(record, error.message),
|
|
407
|
+
() => void 0
|
|
408
|
+
);
|
|
409
|
+
});
|
|
410
|
+
await created;
|
|
411
|
+
} catch (error) {
|
|
412
|
+
this.detachedRuns.delete(record.runId);
|
|
413
|
+
throw error;
|
|
414
|
+
}
|
|
415
|
+
this.watch(record.runId);
|
|
416
|
+
return { runId: record.runId, state: "pending" };
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Count a detached run against the server's limits before anything of it exists: every caller's runs together, and
|
|
420
|
+
* one caller's. A run that would exceed one is refused with `JobRunnerBusyError`, and no process is started for it.
|
|
421
|
+
*/
|
|
422
|
+
reserveDetached(name, record, kind) {
|
|
423
|
+
const limits = this.options.detachedLimits ?? detachedRunLimitsOf();
|
|
424
|
+
if (this.detachedRuns.size >= limits.maxRuns) {
|
|
425
|
+
this.logger.warn(`Detached run of "${name}" refused: ${this.detachedRuns.size} detached runs are active`);
|
|
426
|
+
throw new JobRunnerBusyError(name, this.detachedRuns.size, "server", kind);
|
|
427
|
+
}
|
|
428
|
+
const caller = callerKeyOf(record);
|
|
429
|
+
if (caller !== void 0) {
|
|
430
|
+
let held = 0;
|
|
431
|
+
for (const holder of this.detachedRuns.values()) if (holder === caller) held++;
|
|
432
|
+
if (held >= limits.maxRunsPerCaller) throw new JobRunnerBusyError(name, held, "caller", kind);
|
|
433
|
+
}
|
|
434
|
+
this.detachedRuns.set(record.runId, caller);
|
|
435
|
+
}
|
|
436
|
+
/** Start a detached run's process; one that can't be started is logged and refused with `JobRunnerBootError`. */
|
|
437
|
+
spawnRunner(runId) {
|
|
438
|
+
try {
|
|
439
|
+
return (this.options.spawnDetached ?? spawnDetachedRunner)(runId);
|
|
440
|
+
} catch (error) {
|
|
441
|
+
const reason = toJobError(error).message;
|
|
442
|
+
this.logger.error(`The detached runner of run ${runId} could not be started: ${reason}`);
|
|
443
|
+
throw new JobRunnerBootError(runId, reason);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Start a detached workflow run. The run is stored first, through `create`, which may decline it (a run another
|
|
448
|
+
* process started already), with this server as its runner until the process it then starts takes the run over;
|
|
449
|
+
* a process that can't be started ends the run with `JobRunnerBootError`. Answers at once; this server watches the
|
|
450
|
+
* run until it ends. Answers undefined when `create` declined.
|
|
451
|
+
*/
|
|
452
|
+
async startDetachedWorkflow(workflow, record, create) {
|
|
453
|
+
const unavailable = this.options.detachedUnavailable;
|
|
454
|
+
if (unavailable) {
|
|
455
|
+
throw new JobRunnerUnavailableError(workflow.name, unavailable.why, unavailable.remedy, "Workflow");
|
|
456
|
+
}
|
|
457
|
+
if (this.detachedRuns.has(record.runId)) return void 0;
|
|
458
|
+
this.reserveDetached(workflow.name, record, "Workflow");
|
|
459
|
+
const runner = { kind: "detached", id: randomUUID(), pid: currentPid(), hostname: getHostname() };
|
|
460
|
+
const stored = { ...record, background: true, runner };
|
|
461
|
+
let child;
|
|
462
|
+
try {
|
|
463
|
+
await this.stateStore.touchRunner?.(runner.id, DETACHED_BOOT_TTL_SECONDS);
|
|
464
|
+
if (!await create(stored)) {
|
|
465
|
+
this.detachedRuns.delete(record.runId);
|
|
466
|
+
return void 0;
|
|
467
|
+
}
|
|
468
|
+
} catch (error) {
|
|
469
|
+
this.detachedRuns.delete(record.runId);
|
|
470
|
+
throw error;
|
|
471
|
+
}
|
|
472
|
+
try {
|
|
473
|
+
child = this.spawnRunner(record.runId);
|
|
474
|
+
} catch (error) {
|
|
475
|
+
await this.endRun(stored, toJobError(error)).catch(() => void 0);
|
|
476
|
+
this.detachedRuns.delete(record.runId);
|
|
477
|
+
throw error;
|
|
478
|
+
}
|
|
479
|
+
child.once("error", (error) => void this.failToBoot(stored, error.message));
|
|
480
|
+
if (child.pid) await this.updateState(record.runId, { runner: { ...runner, pid: child.pid } });
|
|
339
481
|
this.watch(record.runId);
|
|
340
482
|
return { runId: record.runId, state: "pending" };
|
|
341
483
|
}
|
|
@@ -355,7 +497,7 @@ var JobExecutionManager = class {
|
|
|
355
497
|
}
|
|
356
498
|
if (!record || FINISHED_JOB_STATES.has(record.state)) {
|
|
357
499
|
this.unwatch(runId);
|
|
358
|
-
if (record) await this.notify(
|
|
500
|
+
if (record) await this.notify(statusOf(record, record.state));
|
|
359
501
|
} else if (record.runner && await this.runnerGone(record.runner, record.startedAt)) {
|
|
360
502
|
this.unwatch(runId);
|
|
361
503
|
await this.endOrphan(record);
|
|
@@ -372,6 +514,7 @@ var JobExecutionManager = class {
|
|
|
372
514
|
unwatch(runId) {
|
|
373
515
|
clearInterval(this.watchers.get(runId));
|
|
374
516
|
this.watchers.delete(runId);
|
|
517
|
+
this.detachedRuns.delete(runId);
|
|
375
518
|
}
|
|
376
519
|
/**
|
|
377
520
|
* Whether the runner of a run started at `startedAt` is gone. On this host its pid decides: a runner whose event
|
|
@@ -394,7 +537,7 @@ var JobExecutionManager = class {
|
|
|
394
537
|
const neverStarted = record.state === "pending" && record.runner?.kind === "detached";
|
|
395
538
|
const error = neverStarted ? new JobRunnerBootError(runId, "its process exited before it took the run over") : new JobInterruptedError(runId, "its runner is gone");
|
|
396
539
|
const state = await this.endRun(record, error);
|
|
397
|
-
if (state && record.state === "running") {
|
|
540
|
+
if (state && record.state === "running" && !("workflowName" in record)) {
|
|
398
541
|
await this.cleanupOrphan(record, state === "cancelled" ? "cancel" : "interrupt");
|
|
399
542
|
}
|
|
400
543
|
}
|
|
@@ -411,7 +554,7 @@ var JobExecutionManager = class {
|
|
|
411
554
|
});
|
|
412
555
|
if (!state) return void 0;
|
|
413
556
|
this.unwatch(runId);
|
|
414
|
-
await this.notify(
|
|
557
|
+
await this.notify(statusOf(record, state));
|
|
415
558
|
return state;
|
|
416
559
|
}
|
|
417
560
|
/** Run the job's cleanup for a run whose runner is gone, on an instance built here for the run's input. */
|
|
@@ -435,10 +578,11 @@ var JobExecutionManager = class {
|
|
|
435
578
|
this.logger.warn(`The ${reason} cleanup of run ${record.runId} could not run: ${toJobError(error).message}`);
|
|
436
579
|
}
|
|
437
580
|
}
|
|
438
|
-
/** End a detached run whose runner did not start, with `JobRunnerBootError
|
|
439
|
-
async failToBoot(record,
|
|
581
|
+
/** End a detached run whose runner did not start, with `JobRunnerBootError`; why goes to the log only. */
|
|
582
|
+
async failToBoot(record, reason) {
|
|
583
|
+
this.logger.error(`The detached runner of run ${record.runId} did not start: ${reason}`);
|
|
440
584
|
try {
|
|
441
|
-
await this.endRun(record, new JobRunnerBootError(record.runId,
|
|
585
|
+
await this.endRun(record, new JobRunnerBootError(record.runId, reason));
|
|
442
586
|
} catch (error) {
|
|
443
587
|
this.logger.error(`Could not record that run ${record.runId} did not start: ${toJobError(error).message}`);
|
|
444
588
|
}
|
|
@@ -487,14 +631,10 @@ var JobExecutionManager = class {
|
|
|
487
631
|
}
|
|
488
632
|
}
|
|
489
633
|
async runJobAttempts(job, input, runId, opts, signal) {
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
await this.
|
|
493
|
-
|
|
494
|
-
});
|
|
495
|
-
if (!started) {
|
|
496
|
-
await this.notify({ type: "job:status", runId, state: "cancelled", jobName: job.name });
|
|
497
|
-
throw new JobCancelledError(runId);
|
|
634
|
+
const refused = await this.markRunning(runId);
|
|
635
|
+
if (refused) {
|
|
636
|
+
await this.notify({ type: "job:status", runId, state: finishedStateOf(refused), jobName: job.name });
|
|
637
|
+
throw refused;
|
|
498
638
|
}
|
|
499
639
|
await this.notify({ type: "job:status", runId, state: "running", jobName: job.name });
|
|
500
640
|
const retryConfig = job.metadata.retry ?? {};
|
|
@@ -562,37 +702,38 @@ var JobExecutionManager = class {
|
|
|
562
702
|
async writeOutcome(runId, outcome) {
|
|
563
703
|
if (await this.cancelRequested(runId)) {
|
|
564
704
|
if (outcome.state === "retrying") return void 0;
|
|
565
|
-
|
|
566
|
-
return "cancelled";
|
|
705
|
+
return this.writeEnd(runId, { ...cancelledUpdate(new JobCancelledError(runId)), attempt: outcome.attempt });
|
|
567
706
|
}
|
|
568
|
-
const current = await this.stateStore.getRun(runId);
|
|
569
|
-
if (current && FINISHED_JOB_STATES.has(current.state)) return void 0;
|
|
570
707
|
switch (outcome.state) {
|
|
571
708
|
case "completed":
|
|
572
|
-
|
|
709
|
+
return this.writeEnd(runId, {
|
|
573
710
|
state: "completed",
|
|
574
711
|
result: outcome.result,
|
|
575
712
|
completedAt: Date.now(),
|
|
576
713
|
attempt: outcome.attempt,
|
|
577
714
|
logs: [...outcome.logs]
|
|
578
715
|
});
|
|
579
|
-
return "completed";
|
|
580
716
|
case "retrying":
|
|
581
|
-
|
|
582
|
-
return "retrying";
|
|
717
|
+
return this.writeEnd(runId, { state: "retrying", attempt: outcome.attempt });
|
|
583
718
|
case "failed": {
|
|
584
719
|
const { error } = outcome;
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
error: { message: error.message, name: error.name, stack: error.stack },
|
|
720
|
+
return this.writeEnd(runId, {
|
|
721
|
+
state: finishedStateOf(error),
|
|
722
|
+
error: storedRunError(error),
|
|
589
723
|
completedAt: Date.now(),
|
|
590
724
|
attempt: outcome.attempt
|
|
591
725
|
});
|
|
592
|
-
return state;
|
|
593
726
|
}
|
|
594
727
|
}
|
|
595
728
|
}
|
|
729
|
+
/**
|
|
730
|
+
* Write the state a run moves to unless it already ended, answering the state written; when another process
|
|
731
|
+
* ended it first, a cancel is still this run's end to tell, and any other end is not.
|
|
732
|
+
*/
|
|
733
|
+
async writeEnd(runId, update) {
|
|
734
|
+
if (await this.write(runId, update)) return update.state;
|
|
735
|
+
return (await this.stateStore.getRun(runId))?.state === "cancelled" ? "cancelled" : void 0;
|
|
736
|
+
}
|
|
596
737
|
// ---- Private: background execution ----
|
|
597
738
|
async executeJobBackground(job, input, runId, opts) {
|
|
598
739
|
try {
|
|
@@ -600,43 +741,65 @@ var JobExecutionManager = class {
|
|
|
600
741
|
} catch {
|
|
601
742
|
}
|
|
602
743
|
}
|
|
744
|
+
/**
|
|
745
|
+
* Run a stored workflow run in this process, under its signal: a cancel (in this process, or read from the store) or
|
|
746
|
+
* a shutdown aborts it, and it then starts no more steps and ends `cancelled` or `interrupted`. A run cancelled
|
|
747
|
+
* before it started never starts.
|
|
748
|
+
*/
|
|
603
749
|
async executeWorkflowInline(workflow, jobRegistry, runId, opts) {
|
|
604
|
-
|
|
605
|
-
|
|
750
|
+
const status = (state) => this.notify({ type: "workflow:status", runId, state, workflowName: workflow.name });
|
|
751
|
+
const { signal, end } = this.startRun(runId);
|
|
606
752
|
try {
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
await this.
|
|
637
|
-
|
|
753
|
+
const refused = await this.markRunning(runId);
|
|
754
|
+
if (refused) {
|
|
755
|
+
await status(finishedStateOf(refused));
|
|
756
|
+
throw refused;
|
|
757
|
+
}
|
|
758
|
+
await status("running");
|
|
759
|
+
let result;
|
|
760
|
+
try {
|
|
761
|
+
const engine = new WorkflowEngine(workflow.metadata, jobRegistry, this.logger, {
|
|
762
|
+
authInfo: opts.authInfo ?? {},
|
|
763
|
+
contextProviders: opts.contextProviders,
|
|
764
|
+
context: opts.context,
|
|
765
|
+
authoritiesContextBuilder: opts.authoritiesContextBuilder,
|
|
766
|
+
workflowRunId: runId,
|
|
767
|
+
admission: this.options.admission,
|
|
768
|
+
defaultTimeoutMs: this.options.defaultTimeoutMs,
|
|
769
|
+
signal
|
|
770
|
+
});
|
|
771
|
+
result = await engine.execute(opts.workflowInput);
|
|
772
|
+
} catch (err) {
|
|
773
|
+
const error = toJobError(err);
|
|
774
|
+
const state2 = await this.withRunLock(
|
|
775
|
+
runId,
|
|
776
|
+
() => this.writeWorkflowEnd(runId, { state: finishedStateOf(error), error })
|
|
777
|
+
);
|
|
778
|
+
if (state2) await status(state2);
|
|
779
|
+
throw error;
|
|
780
|
+
}
|
|
781
|
+
const ended = result.state === "completed" ? "completed" : "failed";
|
|
782
|
+
const state = await this.withRunLock(runId, () => this.writeWorkflowEnd(runId, { state: ended, result }));
|
|
783
|
+
if (state) await status(state);
|
|
784
|
+
return { runId, result, state: state ?? ended, logs: [] };
|
|
785
|
+
} finally {
|
|
786
|
+
end();
|
|
638
787
|
}
|
|
639
788
|
}
|
|
789
|
+
/**
|
|
790
|
+
* Write how a workflow run ended, answering the state written: a cancel written to the store wins over it, and a
|
|
791
|
+
* run another process already ended (its runner taken for gone) keeps that end.
|
|
792
|
+
*/
|
|
793
|
+
async writeWorkflowEnd(runId, outcome) {
|
|
794
|
+
if (await this.cancelRequested(runId)) return this.writeEnd(runId, cancelledUpdate(new JobCancelledError(runId)));
|
|
795
|
+
const { error } = outcome;
|
|
796
|
+
return this.writeEnd(runId, {
|
|
797
|
+
state: outcome.state,
|
|
798
|
+
...outcome.result === void 0 ? {} : { result: outcome.result },
|
|
799
|
+
...error ? { error: storedRunError(error) } : {},
|
|
800
|
+
completedAt: Date.now()
|
|
801
|
+
});
|
|
802
|
+
}
|
|
640
803
|
async executeWorkflowBackground(workflow, jobRegistry, runId, opts) {
|
|
641
804
|
try {
|
|
642
805
|
await this.executeWorkflowInline(workflow, jobRegistry, runId, opts);
|
|
@@ -648,10 +811,34 @@ var JobExecutionManager = class {
|
|
|
648
811
|
updateState(runId, updates) {
|
|
649
812
|
return this.withRunLock(runId, () => this.write(runId, updates));
|
|
650
813
|
}
|
|
651
|
-
/**
|
|
814
|
+
/**
|
|
815
|
+
* Write to the run record unless the run already ended, in one step on a store that can (`updateUnfinishedRun`),
|
|
816
|
+
* and tell the subscribers to `job://runs/{runId}`; resolves to whether it wrote. Callers hold the run's lock.
|
|
817
|
+
*/
|
|
652
818
|
async write(runId, updates) {
|
|
653
|
-
|
|
654
|
-
|
|
819
|
+
const store = this.stateStore;
|
|
820
|
+
let written;
|
|
821
|
+
if (store.updateUnfinishedRun) {
|
|
822
|
+
written = await store.updateUnfinishedRun(runId, updates);
|
|
823
|
+
} else {
|
|
824
|
+
const current = await store.getRun(runId);
|
|
825
|
+
written = !!current && !FINISHED_JOB_STATES.has(current.state);
|
|
826
|
+
if (written) await store.updateRun(runId, updates);
|
|
827
|
+
}
|
|
828
|
+
if (written) this.scope?.resources.notifyContentChanged(jobRunUri(runId));
|
|
829
|
+
return written;
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* Mark a stored run `running` unless it was cancelled or already ended, in one step with the write; resolves to
|
|
833
|
+
* why it did not start: `JobCancelledError`, or `JobInterruptedError` for a run another process ended.
|
|
834
|
+
*/
|
|
835
|
+
markRunning(runId) {
|
|
836
|
+
return this.withRunLock(runId, async () => {
|
|
837
|
+
if (await this.cancelRequested(runId)) return new JobCancelledError(runId);
|
|
838
|
+
if (await this.write(runId, { state: "running" })) return void 0;
|
|
839
|
+
const ended = (await this.stateStore.getRun(runId))?.state;
|
|
840
|
+
return ended && ended !== "cancelled" ? new JobInterruptedError(runId, "another process ended it") : new JobCancelledError(runId);
|
|
841
|
+
});
|
|
655
842
|
}
|
|
656
843
|
/**
|
|
657
844
|
* Run `task` once the writes this process queued for the run before it are done. A store's update reads
|
|
@@ -721,6 +908,26 @@ var RunRecorder = class {
|
|
|
721
908
|
function currentPid() {
|
|
722
909
|
return typeof process === "undefined" ? 0 : process.pid;
|
|
723
910
|
}
|
|
911
|
+
function callerKeyOf(record) {
|
|
912
|
+
if (record.ownerSub) return `owner:${record.ownerIss ?? ""}#${record.ownerSub}`;
|
|
913
|
+
return record.sessionId ? `session:${record.sessionId}` : void 0;
|
|
914
|
+
}
|
|
915
|
+
function cpuCount() {
|
|
916
|
+
try {
|
|
917
|
+
const os = __require("node:os");
|
|
918
|
+
return typeof os.availableParallelism === "function" ? os.availableParallelism() : os.cpus().length || 1;
|
|
919
|
+
} catch {
|
|
920
|
+
return 1;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
function statusOf(record, state) {
|
|
924
|
+
if ("workflowName" in record)
|
|
925
|
+
return { type: "workflow:status", runId: record.runId, state, workflowName: record.workflowName };
|
|
926
|
+
return { type: "job:status", runId: record.runId, state, jobName: record.jobName };
|
|
927
|
+
}
|
|
928
|
+
function storedRunError(error) {
|
|
929
|
+
return { message: error.message, name: error.name };
|
|
930
|
+
}
|
|
724
931
|
function cancelledUpdate(reason) {
|
|
725
932
|
return { state: "cancelled", error: { message: reason.message, name: reason.name }, completedAt: Date.now() };
|
|
726
933
|
}
|
|
@@ -731,7 +938,9 @@ function finishedStateOf(error) {
|
|
|
731
938
|
return "failed";
|
|
732
939
|
}
|
|
733
940
|
export {
|
|
941
|
+
DEFAULT_DETACHED_RUNS_PER_CALLER,
|
|
734
942
|
DEFAULT_JOB_TIMEOUT_MS,
|
|
735
943
|
DETACHED_FLUSH_MS,
|
|
736
|
-
JobExecutionManager
|
|
944
|
+
JobExecutionManager,
|
|
945
|
+
detachedRunLimitsOf
|
|
737
946
|
};
|
|
@@ -150,7 +150,7 @@ var ExecuteJobFlow = class extends FlowBase {
|
|
|
150
150
|
const { ctx, attempt } = this.input;
|
|
151
151
|
const contextProviders = ctx.contextProviders ?? await jobContextProviders(job, this.context);
|
|
152
152
|
this.throwIfAborted();
|
|
153
|
-
const attemptAbort = abortControllerFollowing(ctx.signal);
|
|
153
|
+
const attemptAbort = abortControllerFollowing(ctx.signal, ctx.admission?.lost);
|
|
154
154
|
this.state.set("attemptAbort", attemptAbort);
|
|
155
155
|
const jobContext = job.create(parsedInput, {
|
|
156
156
|
authInfo: this.state.authInfo ?? {},
|
|
@@ -288,10 +288,12 @@ ExecuteJobFlow = __decorateClass([
|
|
|
288
288
|
access: "public"
|
|
289
289
|
})
|
|
290
290
|
], ExecuteJobFlow);
|
|
291
|
-
function abortControllerFollowing(
|
|
291
|
+
function abortControllerFollowing(...signals) {
|
|
292
292
|
const controller = new AbortController();
|
|
293
|
-
|
|
294
|
-
|
|
293
|
+
for (const signal of signals) {
|
|
294
|
+
if (signal?.aborted) controller.abort(signal.reason);
|
|
295
|
+
signal?.addEventListener("abort", () => controller.abort(signal.reason), { once: true });
|
|
296
|
+
}
|
|
295
297
|
return controller;
|
|
296
298
|
}
|
|
297
299
|
function progressUntilAborted(run, signal) {
|
package/browser/job/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { JobInstance } from "./job.instance.mjs";
|
|
|
4
4
|
export { JobEmitter } from "./job.events.mjs";
|
|
5
5
|
export { collectJobMetadata, jobDiscoveryDeps, normalizeJob } from "./job.utils.mjs";
|
|
6
6
|
export { JobPermissionGuard } from "./job-permission.guard.mjs";
|
|
7
|
-
import { JobAdmission } from "./job-admission.mjs";
|
|
7
|
+
import { JobAdmission, MachineJobAdmission, createJobAdmission } from "./job-admission.mjs";
|
|
8
8
|
import { jobRunUri, mayAccessRun } from "./job-run-access.mjs";
|
|
9
9
|
import { JobRunResource } from "./resources/job-run.resource.mjs";
|
|
10
10
|
import { default as default3 } from "./flows/execute-job.flow.mjs";
|
|
@@ -21,6 +21,8 @@ export {
|
|
|
21
21
|
JobInstance,
|
|
22
22
|
default2 as JobRegistry,
|
|
23
23
|
JobRunResource,
|
|
24
|
+
MachineJobAdmission,
|
|
25
|
+
createJobAdmission,
|
|
24
26
|
jobRunUri,
|
|
25
27
|
mayAccessRun
|
|
26
28
|
};
|