@hotmeshio/long-tail 0.26.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/build/index.d.ts +4 -0
  2. package/build/index.js +30 -8
  3. package/build/lib/events/nats.d.ts +11 -0
  4. package/build/lib/events/nats.js +33 -2
  5. package/build/lib/machines/index.d.ts +1 -0
  6. package/build/lib/machines/index.js +1 -0
  7. package/build/lib/machines/protocol/codec.d.ts +16 -0
  8. package/build/lib/machines/protocol/codec.js +1 -0
  9. package/build/lib/machines/protocol/contract.js +10 -1
  10. package/build/lib/machines/site/edge-account.d.ts +11 -0
  11. package/build/lib/machines/site/edge-account.js +24 -0
  12. package/build/lib/machines/site/site-conf.d.ts +7 -4
  13. package/build/lib/machines/site/site-conf.js +13 -6
  14. package/build/lib/machines/transport/delivery.d.ts +3 -4
  15. package/build/lib/machines/transport/delivery.js +3 -8
  16. package/build/lib/machines/transport/index.d.ts +2 -0
  17. package/build/lib/machines/transport/index.js +2 -0
  18. package/build/lib/machines/transport/nats-bus.d.ts +7 -13
  19. package/build/lib/machines/transport/nats-bus.js +23 -43
  20. package/build/lib/machines/transport/nats-feed.js +2 -2
  21. package/build/lib/machines/transport/pubsub-feed.d.ts +17 -0
  22. package/build/lib/machines/transport/pubsub-feed.js +39 -0
  23. package/build/lib/machines/transport/stream-bus.d.ts +40 -0
  24. package/build/lib/machines/transport/stream-bus.js +57 -0
  25. package/build/lib/machines/transport/streams.d.ts +10 -14
  26. package/build/lib/machines/transport/streams.js +18 -61
  27. package/build/lib/messaging/config.d.ts +25 -0
  28. package/build/lib/messaging/config.js +55 -0
  29. package/build/lib/messaging/constants.d.ts +26 -0
  30. package/build/lib/messaging/constants.js +26 -0
  31. package/build/lib/messaging/index.d.ts +24 -0
  32. package/build/lib/messaging/index.js +65 -0
  33. package/build/lib/messaging/memory.d.ts +16 -0
  34. package/build/lib/messaging/memory.js +147 -0
  35. package/build/lib/messaging/nats/permissions.d.ts +13 -0
  36. package/build/lib/messaging/nats/permissions.js +22 -0
  37. package/build/lib/messaging/nats/provider.d.ts +30 -0
  38. package/build/lib/messaging/nats/provider.js +77 -0
  39. package/build/lib/messaging/nats/render-conf.d.ts +68 -0
  40. package/build/lib/messaging/nats/render-conf.js +58 -0
  41. package/build/lib/messaging/nats/streams.d.ts +26 -0
  42. package/build/lib/messaging/nats/streams.js +97 -0
  43. package/build/lib/messaging/subjects.d.ts +8 -0
  44. package/build/lib/messaging/subjects.js +25 -0
  45. package/build/scripts/bambu-boat.d.ts +17 -0
  46. package/build/scripts/bambu-boat.js +134 -0
  47. package/build/scripts/bambu-print.d.ts +18 -0
  48. package/build/scripts/bambu-print.js +114 -0
  49. package/build/services/machines/config.d.ts +6 -0
  50. package/build/services/machines/config.js +16 -6
  51. package/build/services/machines/contracts.d.ts +19 -2
  52. package/build/services/machines/contracts.js +12 -3
  53. package/build/services/machines/gateway/actions.d.ts +1 -1
  54. package/build/services/machines/gateway/dispatcher.d.ts +16 -3
  55. package/build/services/machines/gateway/dispatcher.js +50 -10
  56. package/build/services/machines/gateway/executor.d.ts +7 -2
  57. package/build/services/machines/gateway/executor.js +35 -9
  58. package/build/services/machines/gateway/gateway.d.ts +6 -0
  59. package/build/services/machines/gateway/gateway.js +33 -10
  60. package/build/services/machines/gateway/lifecycle.d.ts +21 -0
  61. package/build/services/machines/gateway/lifecycle.js +89 -0
  62. package/build/services/machines/gateway/pacing.d.ts +14 -0
  63. package/build/services/machines/gateway/pacing.js +26 -2
  64. package/build/services/machines/gateway/plan-escalation.js +13 -4
  65. package/build/services/machines/gateway/plan-machine.d.ts +5 -4
  66. package/build/services/machines/gateway/plan-machine.js +55 -14
  67. package/build/services/machines/gateway/reconcile.d.ts +2 -0
  68. package/build/services/machines/gateway/reconcile.js +13 -0
  69. package/build/services/machines/gateway/state.d.ts +21 -1
  70. package/build/services/machines/gateway/state.js +16 -3
  71. package/build/services/machines/leadership.d.ts +17 -4
  72. package/build/services/machines/leadership.js +43 -18
  73. package/build/services/machines/rows.js +17 -2
  74. package/build/services/machines/select.d.ts +9 -2
  75. package/build/services/machines/select.js +20 -7
  76. package/build/services/machines/surface.js +8 -2
  77. package/build/services/machines/testing/fake-long-tail.d.ts +1 -0
  78. package/build/services/machines/testing/fake-long-tail.js +6 -3
  79. package/build/start/adapters.js +11 -2
  80. package/build/start/index.js +7 -1
  81. package/build/tsconfig.tsbuildinfo +1 -1
  82. package/build/types/index.d.ts +1 -0
  83. package/build/types/machines.d.ts +2 -1
  84. package/build/types/messaging.d.ts +72 -0
  85. package/build/types/messaging.js +11 -0
  86. package/build/types/startup.d.ts +26 -1
  87. package/docs/events.md +50 -4
  88. package/docs/machines.md +38 -9
  89. package/package.json +3 -1
  90. package/build/lib/machines/transport/nats-durable.d.ts +0 -11
  91. package/build/lib/machines/transport/nats-durable.js +0 -28
@@ -1 +1 @@
1
- {"root":["../index.ts","../vitest.config.ts","../vitest.fast.config.ts","../vitest.integration.config.ts","../vitest.llm.config.ts","../adapters/express.ts","../api/agent-subscriptions.ts","../api/agents.ts","../api/announcements.ts","../api/auth-sso.ts","../api/auth.ts","../api/bot-accounts.ts","../api/capabilities.ts","../api/controlplane.ts","../api/dba.ts","../api/diagnostics.ts","../api/domain.ts","../api/exports.ts","../api/files.ts","../api/index.ts","../api/insight.ts","../api/knowledge.ts","../api/maintenance.ts","../api/me.ts","../api/namespaces.ts","../api/overview.ts","../api/personas.ts","../api/pipelines.ts","../api/roles.ts","../api/settings.ts","../api/tasks.ts","../api/topics.ts","../api/users.ts","../api/workflow-sets.ts","../api/escalations/accumulate.ts","../api/escalations/analytics.ts","../api/escalations/batch-flag.ts","../api/escalations/bulk.ts","../api/escalations/cancel.ts","../api/escalations/claim.ts","../api/escalations/create.ts","../api/escalations/facets.ts","../api/escalations/helpers.ts","../api/escalations/index.ts","../api/escalations/list.ts","../api/escalations/lookups.ts","../api/escalations/metadata.ts","../api/escalations/related.ts","../api/escalations/resolve-batch.ts","../api/escalations/resolve.ts","../api/escalations/roster-action.ts","../api/escalations/single.ts","../api/mcp/index.ts","../api/mcp/servers.ts","../api/mcp/tools.ts","../api/scan-codes/badge-policy.ts","../api/scan-codes/choice-roles.ts","../api/scan-codes/choice.ts","../api/scan-codes/config.ts","../api/scan-codes/context.ts","../api/scan-codes/execute.ts","../api/scan-codes/fill-labels.ts","../api/scan-codes/grant.ts","../api/scan-codes/hold.ts","../api/scan-codes/identity.ts","../api/scan-codes/index.ts","../api/scan-codes/locate.ts","../api/scan-codes/present.ts","../api/scan-codes/subject.ts","../api/scan-codes/verb-accumulate.ts","../api/scan-codes/verb-fill.ts","../api/scan-codes/verb-into-subject.ts","../api/scan-codes/verbs-subject.ts","../api/scan-codes/verbs.ts","../api/workflows/config.ts","../api/workflows/discovery.ts","../api/workflows/index.ts","../api/workflows/input-lookups.ts","../api/workflows/input-validation.ts","../api/workflows/invocable.ts","../api/workflows/invocation.ts","../api/yaml-workflows/cron.ts","../api/yaml-workflows/crud.ts","../api/yaml-workflows/deploy.ts","../api/yaml-workflows/helpers.ts","../api/yaml-workflows/index.ts","../api/yaml-workflows/versions.ts","../bin/ltc.ts","../lib/typed-resolution.ts","../lib/uuid.ts","../lib/cli/auth.ts","../lib/cli/client.ts","../lib/cli/compile.ts","../lib/cli/format.ts","../lib/cli/init.ts","../lib/cli/output.ts","../lib/cli/scanner.ts","../lib/cli/types.ts","../lib/cli/commands/escalations.ts","../lib/cli/commands/knowledge.ts","../lib/cli/commands/mcp.ts","../lib/cli/commands/personas.ts","../lib/cli/commands/pipelines.ts","../lib/cli/commands/roles.ts","../lib/cli/commands/status.ts","../lib/cli/commands/streams.ts","../lib/cli/commands/users.ts","../lib/cli/commands/workflows.ts","../lib/db/index.ts","../lib/db/migrate.ts","../lib/events/browser-view.ts","../lib/events/callback.ts","../lib/events/escalation-wire.ts","../lib/events/index.ts","../lib/events/matching.ts","../lib/events/memory.ts","../lib/events/nats-ws-filter.ts","../lib/events/nats-ws-proxy.ts","../lib/events/nats-ws-server-filter.ts","../lib/events/nats-ws-ticket.ts","../lib/events/nats.ts","../lib/events/publish.ts","../lib/events/socketio.ts","../lib/events/system-events.ts","../lib/http/index.ts","../lib/json-path/pick.ts","../lib/logger/index.ts","../lib/logger/pino.ts","../lib/machines/index.ts","../lib/machines/line.ts","../lib/machines/protocol/codec.ts","../lib/machines/protocol/constants.ts","../lib/machines/protocol/contract.ts","../lib/machines/protocol/envelope.ts","../lib/machines/protocol/index.ts","../lib/machines/protocol/topics.ts","../lib/machines/site/mosquitto-conf.ts","../lib/machines/site/site-conf.ts","../lib/machines/transport/callback-feed.ts","../lib/machines/transport/delivery.ts","../lib/machines/transport/index.ts","../lib/machines/transport/memory-broker.ts","../lib/machines/transport/memory.ts","../lib/machines/transport/mqtt-bus.ts","../lib/machines/transport/mqtt-link.ts","../lib/machines/transport/mqtt-session.ts","../lib/machines/transport/nats-bus.ts","../lib/machines/transport/nats-durable.ts","../lib/machines/transport/nats-feed.ts","../lib/machines/transport/serial.ts","../lib/machines/transport/streams.ts","../lib/storage/index.ts","../lib/storage/local.ts","../lib/storage/mime.ts","../lib/storage/s3.ts","../lib/storage/types.ts","../lib/telemetry/honeycomb.ts","../lib/telemetry/index.ts","../modules/auth.ts","../modules/branding.ts","../modules/capabilities.ts","../modules/config.ts","../modules/defaults.ts","../modules/display.ts","../modules/features.ts","../modules/ltconfig.ts","../modules/maintenance.ts","../modules/mcp-auth.ts","../modules/oauth-server.ts","../modules/search.ts","../modules/sso.ts","../modules/utils.ts","../modules/version.ts","../routes/agents.ts","../routes/announcements.ts","../routes/auth-sso.ts","../routes/auth.ts","../routes/bot-accounts.ts","../routes/capabilities.ts","../routes/controlplane.ts","../routes/dba.ts","../routes/delegation.ts","../routes/diagnostics.ts","../routes/docs.ts","../routes/domain.ts","../routes/exports.ts","../routes/file-browser.ts","../routes/files.ts","../routes/index.ts","../routes/insight.ts","../routes/knowledge.ts","../routes/maintenance.ts","../routes/mcp-endpoint.ts","../routes/mcp.ts","../routes/me.ts","../routes/namespaces.ts","../routes/nats-credentials.ts","../routes/oauth-well-known.ts","../routes/oauth.ts","../routes/overview.ts","../routes/personas.ts","../routes/pipelines.ts","../routes/roles.ts","../routes/scan-codes.ts","../routes/settings.ts","../routes/tasks.ts","../routes/topics.ts","../routes/users.ts","../routes/workflow-sets.ts","../routes/escalations/accumulate.ts","../routes/escalations/acting.ts","../routes/escalations/analytics.ts","../routes/escalations/bulk.ts","../routes/escalations/facets.ts","../routes/escalations/index.ts","../routes/escalations/list.ts","../routes/escalations/metadata.ts","../routes/escalations/related.ts","../routes/escalations/resolve.ts","../routes/escalations/single.ts","../routes/oauth-server/authorize.ts","../routes/oauth-server/grants.ts","../routes/oauth-server/index.ts","../routes/oauth-server/registration.ts","../routes/oauth-server/token.ts","../routes/workflows/config.ts","../routes/workflows/discovery.ts","../routes/workflows/index.ts","../routes/workflows/invocation.ts","../routes/yaml-workflows/cron.ts","../routes/yaml-workflows/crud.ts","../routes/yaml-workflows/deployment.ts","../routes/yaml-workflows/index.ts","../routes/yaml-workflows/versions.ts","../scripts/consolidation-sim.ts","../scripts/machine-line.ts","../scripts/ortho-populate.ts","../scripts/printer-cycle.ts","../scripts/process-helpers.ts","../scripts/process.ts","../scripts/token.ts","../scripts/twin-farm.ts","../sdk/index.ts","../services/dba.ts","../services/hotmesh-utils.ts","../services/invocation-access.ts","../services/workflow-invocation.ts","../services/workflow-state.ts","../services/agent/authority.ts","../services/agent/index.ts","../services/agent/input-mapper.ts","../services/agent/sql.ts","../services/agent/subscription-sql.ts","../services/agent/subscriptions.ts","../services/agent/trigger-registry.ts","../services/announcement/index.ts","../services/announcement/sql.ts","../services/auth/bot-api-key.ts","../services/auth/delegation.ts","../services/auth/index.ts","../services/auth/service-token.ts","../services/auth/sql.ts","../services/auth/oauth-server/access-token.ts","../services/auth/oauth-server/authorization.ts","../services/auth/oauth-server/constants.ts","../services/auth/oauth-server/index.ts","../services/auth/oauth-server/metadata.ts","../services/auth/oauth-server/registration.ts","../services/auth/oauth-server/sql.ts","../services/auth/oauth-server/store.ts","../services/config/cache.ts","../services/config/index.ts","../services/config/provider.ts","../services/config/read.ts","../services/config/sql.ts","../services/config/write.ts","../services/controlplane/index.ts","../services/controlplane/quorum-bridge.ts","../services/controlplane/sql.ts","../services/controlplane/stream-messages-sql.ts","../services/controlplane/types.ts","../services/cron/index.ts","../services/diagnostics/index.ts","../services/diagnostics/patterns.ts","../services/domain/index.ts","../services/domain/read.ts","../services/domain/seed.ts","../services/domain/sql.ts","../services/domain/validate.ts","../services/domain/write.ts","../services/escalation/accumulate.ts","../services/escalation/aggregate-sql.ts","../services/escalation/aggregate-validate.ts","../services/escalation/aggregates.ts","../services/escalation/batch-flag.ts","../services/escalation/batch.ts","../services/escalation/bulk.ts","../services/escalation/claim-asserted.ts","../services/escalation/client.ts","../services/escalation/crud.ts","../services/escalation/facet-sql.ts","../services/escalation/facets.ts","../services/escalation/grouped-list.ts","../services/escalation/index.ts","../services/escalation/map.ts","../services/escalation/metrics-cache.ts","../services/escalation/queries.ts","../services/escalation/read-scope-sql.ts","../services/escalation/related-extremes.ts","../services/escalation/related.ts","../services/escalation/resolver-validation.ts","../services/escalation/roster.ts","../services/escalation/sql.ts","../services/escalation/submit-guard.ts","../services/escalation/types.ts","../services/escalation-strategy/default.ts","../services/escalation-strategy/index.ts","../services/escalation-strategy/mcp.ts","../services/export/client.ts","../services/export/index.ts","../services/export/post-process.ts","../services/export/types.ts","../services/iam/acting-identity.ts","../services/iam/activity.ts","../services/iam/bots.ts","../services/iam/context.ts","../services/iam/credentials.ts","../services/iam/envelope.ts","../services/iam/ephemeral.ts","../services/iam/index.ts","../services/iam/principal.ts","../services/iam/resolve.ts","../services/iam/sql.ts","../services/insight/index.ts","../services/insight/prompts.ts","../services/interceptor/activity-interceptor.ts","../services/interceptor/completion.ts","../services/interceptor/context.ts","../services/interceptor/escalation.ts","../services/interceptor/index.ts","../services/interceptor/lifecycle.ts","../services/interceptor/state.ts","../services/interceptor/types.ts","../services/interceptor/activities/config.ts","../services/interceptor/activities/escalation.ts","../services/interceptor/activities/index.ts","../services/interceptor/activities/task.ts","../services/interceptor/activities/workflow.ts","../services/knowledge/index.ts","../services/knowledge/lookup-cache.ts","../services/knowledge/lookup-refs.ts","../services/knowledge/sql.ts","../services/llm/detect.ts","../services/llm/index.ts","../services/llm/translate.ts","../services/llm/types.ts","../services/llm/providers/anthropic.ts","../services/llm/providers/openai.ts","../services/machines/commands.ts","../services/machines/config.ts","../services/machines/contracts.ts","../services/machines/forms.ts","../services/machines/identities.ts","../services/machines/index.ts","../services/machines/leadership.ts","../services/machines/roles.ts","../services/machines/rows.ts","../services/machines/select.ts","../services/machines/surface.ts","../services/machines/gateway/actions.ts","../services/machines/gateway/address-book.ts","../services/machines/gateway/admission.ts","../services/machines/gateway/api-escalations.ts","../services/machines/gateway/dispatcher.ts","../services/machines/gateway/escalations.ts","../services/machines/gateway/executor.ts","../services/machines/gateway/gateway.ts","../services/machines/gateway/index.ts","../services/machines/gateway/jobs.ts","../services/machines/gateway/log.ts","../services/machines/gateway/lt-http.ts","../services/machines/gateway/pacing.ts","../services/machines/gateway/plan-escalation.ts","../services/machines/gateway/plan-machine.ts","../services/machines/gateway/plan-shared.ts","../services/machines/gateway/provision.ts","../services/machines/gateway/receipts.ts","../services/machines/gateway/reconcile.ts","../services/machines/gateway/registration.ts","../services/machines/gateway/reply-waiter.ts","../services/machines/gateway/state.ts","../services/machines/gateway/trace.ts","../services/machines/testing/fake-long-tail.ts","../services/machines/testing/index.ts","../services/machines/testing/recording-log.ts","../services/machines/testing/wait.ts","../services/maintenance/index.ts","../services/mcp/adapter.ts","../services/mcp/db.ts","../services/mcp/exposure.ts","../services/mcp/external-server.ts","../services/mcp/index.ts","../services/mcp/register-tool.ts","../services/mcp/registered-tools.ts","../services/mcp/seed-service-account.ts","../services/mcp/server-lifecycle.ts","../services/mcp/server-tools.ts","../services/mcp/server.ts","../services/mcp/sql.ts","../services/mcp/types.ts","../services/mcp/workflow-compiler-server.ts","../services/mcp/workflow-server.ts","../services/mcp/client/connection-dispatch.ts","../services/mcp/client/connection-lifecycle.ts","../services/mcp/client/connection-test.ts","../services/mcp/client/connection.ts","../services/mcp/client/index.ts","../services/mcp/client/network-transport.ts","../services/mcp/client/tools.ts","../services/mcp/db-server/index.ts","../services/mcp/db-server/schemas.ts","../services/mcp/db-server/tools.ts","../services/mcp/playwright-server/index.ts","../services/mcp/playwright-server/lifecycle.ts","../services/mcp/playwright-server/schemas.ts","../services/mcp/playwright-server/tools.ts","../services/namespace/index.ts","../services/namespace/sql.ts","../services/namespace/types.ts","../services/oauth/crypto.ts","../services/oauth/db.ts","../services/oauth/index.ts","../services/oauth/sql.ts","../services/oauth/state.ts","../services/oauth/providers/anthropic.ts","../services/oauth/providers/github.ts","../services/oauth/providers/google.ts","../services/oauth/providers/index.ts","../services/oauth/providers/microsoft.ts","../services/oauth/providers/mock.ts","../services/oauth/providers/registry.ts","../services/oauth/providers/types.ts","../services/orchestrator/condition.ts","../services/orchestrator/index.ts","../services/orchestrator/types.ts","../services/overview/index.ts","../services/overview/sql.ts","../services/persona/index.ts","../services/persona/sql.ts","../services/persona/types.ts","../services/pipelines/enrichment.ts","../services/pipelines/events.ts","../services/pipelines/execution-builder.ts","../services/pipelines/index.ts","../services/pipelines/queries.ts","../services/pipelines/sql.ts","../services/pipelines/types.ts","../services/role/badge-grant.ts","../services/role/enforcement-cache.ts","../services/role/index.ts","../services/role/schema-validator.ts","../services/role/seed.ts","../services/role/sql.ts","../services/role/types.ts","../services/scan-code/index.ts","../services/scan-code/parse.ts","../services/scan-code/read.ts","../services/scan-code/sql.ts","../services/scan-code/validate-facts.ts","../services/scan-code/validate-query.ts","../services/scan-code/validate-subject.ts","../services/scan-code/validate.ts","../services/scan-code/write.ts","../services/task/crud.ts","../services/task/index.ts","../services/task/process.ts","../services/task/resolve.ts","../services/task/sql.ts","../services/task/types.ts","../services/topics/index.ts","../services/topics/sql.ts","../services/topics/system-topics.ts","../services/user/auth.ts","../services/user/crud.ts","../services/user/index.ts","../services/user/preferences.ts","../services/user/rbac.ts","../services/user/roles.ts","../services/user/scope.ts","../services/user/seed-admin.ts","../services/user/sql.ts","../services/user/sso-provision.ts","../services/user/types.ts","../services/workers/registry.ts","../services/workflow-sets/db.ts","../services/workflow-sets/index.ts","../services/workflow-sets/sql.ts","../services/yaml-workflow/builder-regenerate.ts","../services/yaml-workflow/db-utils.ts","../services/yaml-workflow/db-versions.ts","../services/yaml-workflow/db.ts","../services/yaml-workflow/deployer-helpers.ts","../services/yaml-workflow/deployer.ts","../services/yaml-workflow/generator.ts","../services/yaml-workflow/index.ts","../services/yaml-workflow/input-analyzer-helpers.ts","../services/yaml-workflow/input-analyzer.ts","../services/yaml-workflow/invoke.ts","../services/yaml-workflow/pipe-validator.ts","../services/yaml-workflow/sql.ts","../services/yaml-workflow/types.ts","../services/yaml-workflow/durable-compiler/index.ts","../services/yaml-workflow/durable-compiler/parser.ts","../services/yaml-workflow/durable-compiler/prompts.ts","../services/yaml-workflow/durable-compiler/types.ts","../services/yaml-workflow/pattern-detector/array-source.ts","../services/yaml-workflow/pattern-detector/collapse.ts","../services/yaml-workflow/pattern-detector/index.ts","../services/yaml-workflow/pattern-detector/run-detection.ts","../services/yaml-workflow/pattern-detector/types.ts","../services/yaml-workflow/pipeline/analyze.ts","../services/yaml-workflow/pipeline/extract-helpers.ts","../services/yaml-workflow/pipeline/extract.ts","../services/yaml-workflow/pipeline/index.ts","../services/yaml-workflow/pipeline/prompt-templates.ts","../services/yaml-workflow/pipeline/prompts.ts","../services/yaml-workflow/pipeline/validate.ts","../services/yaml-workflow/pipeline/build/dag-assembly.ts","../services/yaml-workflow/pipeline/build/dag.ts","../services/yaml-workflow/pipeline/build/index.ts","../services/yaml-workflow/pipeline/build/iteration.ts","../services/yaml-workflow/pipeline/build/metadata.ts","../services/yaml-workflow/pipeline/build/transform.ts","../services/yaml-workflow/pipeline/build/utils.ts","../services/yaml-workflow/pipeline/build/wiring.ts","../services/yaml-workflow/pipeline/compile/index.ts","../services/yaml-workflow/pipeline/compile/llm-call.ts","../services/yaml-workflow/pipeline/compile/parse-plan.ts","../services/yaml-workflow/pipeline/compile/summarize.ts","../services/yaml-workflow/workers/callbacks.ts","../services/yaml-workflow/workers/events.ts","../services/yaml-workflow/workers/index.ts","../services/yaml-workflow/workers/register.ts","../services/yaml-workflow/workers/scope.ts","../services/yaml-workflow/workers/step-tool.ts","../shared/workflow-state.ts","../shared/form-validation/ctx-path.ts","../shared/form-validation/derive-field-label.ts","../shared/form-validation/display-only-widgets.ts","../shared/form-validation/field-validator.ts","../shared/form-validation/index.ts","../shared/form-validation/invoke-context.ts","../shared/form-validation/validate-resolver-payload.ts","../shared/form-validation/x-lt-actions.ts","../shared/form-validation/x-lt-bind.ts","../shared/form-validation/x-lt-help.ts","../shared/form-validation/x-lt-invoke.ts","../shared/form-validation/x-lt-labels.ts","../shared/form-validation/x-lt-options.ts","../shared/form-validation/x-lt-query.ts","../shared/form-validation/x-lt-require-any.ts","../shared/form-validation/x-lt-require-sum.ts","../shared/form-validation/x-lt-roster.ts","../shared/form-validation/x-lt-scan.ts","../shared/form-validation/x-lt-show-if.ts","../shared/form-validation/x-lt-submit-guard.ts","../shared/form-validation/x-lt-submit-on-claim.ts","../shared/form-validation/x-lt-transition.ts","../shared/list-schema/aggregate.ts","../shared/list-schema/index.ts","../shared/list-schema/template.ts","../shared/list-schema/types.ts","../shared/list-schema/validate.ts","../shared/roles/segment.ts","../shared/scan-code/gtin.ts","../shared/scan-code/index.ts","../shared/scan-code/parse.ts","../start/adapters.ts","../start/apply-report.ts","../start/config.ts","../start/graph-workflows.ts","../start/index.ts","../start/server.ts","../start/socket-auth.ts","../start/workers.ts","../system/index.ts","../system/activities/claude-code.ts","../system/activities/file-storage.ts","../system/activities/http.ts","../system/activities/knowledge.ts","../system/activities/oauth.ts","../system/activities/schema-exchange.ts","../system/activities/sql.ts","../system/activities/triage/cache.ts","../system/activities/triage/context.ts","../system/activities/triage/discovery.ts","../system/activities/triage/index.ts","../system/activities/triage/llm.ts","../system/activities/triage/tools.ts","../system/mcp-servers/caller-auth.ts","../system/mcp-servers/claude-code.ts","../system/mcp-servers/docs.ts","../system/mcp-servers/events.ts","../system/mcp-servers/file-storage.ts","../system/mcp-servers/http-fetch.ts","../system/mcp-servers/human-queue-schemas.ts","../system/mcp-servers/human-queue.ts","../system/mcp-servers/knowledge.ts","../system/mcp-servers/oauth.ts","../system/mcp-servers/schema-exchange.ts","../system/mcp-servers/translation.ts","../system/mcp-servers/vision-prompts.ts","../system/mcp-servers/vision.ts","../system/mcp-servers/workflow-compiler.ts","../system/mcp-servers/workflow.ts","../system/mcp-servers/admin/agent-subscriptions.ts","../system/mcp-servers/admin/agents.ts","../system/mcp-servers/admin/announcements.ts","../system/mcp-servers/admin/bot-accounts.ts","../system/mcp-servers/admin/controlplane.ts","../system/mcp-servers/admin/diagnostics.ts","../system/mcp-servers/admin/domain-context.ts","../system/mcp-servers/admin/escalations.ts","../system/mcp-servers/admin/exports.ts","../system/mcp-servers/admin/index.ts","../system/mcp-servers/admin/maintenance.ts","../system/mcp-servers/admin/mcp-servers.ts","../system/mcp-servers/admin/overview.ts","../system/mcp-servers/admin/personas.ts","../system/mcp-servers/admin/pipelines.ts","../system/mcp-servers/admin/run-read.ts","../system/mcp-servers/admin/scan-codes.ts","../system/mcp-servers/admin/schemas.ts","../system/mcp-servers/admin/settings.ts","../system/mcp-servers/admin/tasks.ts","../system/mcp-servers/admin/topics.ts","../system/mcp-servers/admin/users.ts","../system/mcp-servers/admin/workflow-config.ts","../system/mcp-servers/admin/workflows.ts","../system/mcp-servers/admin/yaml-workflows.ts","../system/mcp-servers/db-query/index.ts","../system/mcp-servers/db-query/schemas.ts","../system/mcp-servers/db-query/tools.ts","../system/seed/index.ts","../system/seed/tool-manifests-admin.ts","../system/seed/tool-manifests-data.ts","../system/seed/tool-manifests-escalation.ts","../system/seed/tool-manifests-events.ts","../system/seed/tool-manifests-knowledge.ts","../system/seed/tool-manifests-workflows.ts","../system/workflows/tool-result-guard.ts","../system/workflows/capability-invoke/activities.ts","../system/workflows/capability-invoke/index.ts","../system/workflows/mcp-deterministic/activities.ts","../system/workflows/mcp-deterministic/index.ts","../system/workflows/mcp-query/index.ts","../system/workflows/mcp-query/prompts.ts","../system/workflows/mcp-query/strategy-advisors.ts","../system/workflows/mcp-query/types.ts","../system/workflows/mcp-query/activities/caches.ts","../system/workflows/mcp-query/activities/discovery.ts","../system/workflows/mcp-query/activities/index.ts","../system/workflows/mcp-query/activities/llm.ts","../system/workflows/mcp-query/activities/tool-executor.ts","../system/workflows/mcp-query/activities/tool-loader.ts","../system/workflows/mcp-query-router/activities.ts","../system/workflows/mcp-query-router/index.ts","../system/workflows/mcp-query-router/prompts.ts","../system/workflows/mcp-triage/activities-proxy.ts","../system/workflows/mcp-triage/index.ts","../system/workflows/mcp-triage/prompts.ts","../system/workflows/mcp-triage/response-builders.ts","../system/workflows/mcp-triage/response.ts","../system/workflows/mcp-triage/types.ts","../system/workflows/mcp-triage-deterministic/activities.ts","../system/workflows/mcp-triage-deterministic/index.ts","../system/workflows/mcp-triage-router/activities.ts","../system/workflows/mcp-triage-router/index.ts","../system/workflows/mcp-workflow-builder/index.ts","../system/workflows/mcp-workflow-builder/prompts.ts","../system/workflows/mcp-workflow-builder/activities/caches.ts","../system/workflows/mcp-workflow-builder/activities/index.ts","../system/workflows/mcp-workflow-builder/activities/llm.ts","../system/workflows/mcp-workflow-builder/activities/tool-loader.ts","../system/workflows/mcp-workflow-planner/index.ts","../system/workflows/mcp-workflow-planner/prompts.ts","../system/workflows/mcp-workflow-planner/activities/analyze.ts","../system/workflows/mcp-workflow-planner/activities/index.ts","../system/workflows/mcp-workflow-planner/activities/persist.ts","../system/workflows/mcp-workflow-planner/activities/plan.ts","../system/workflows/shared/discovery.ts","../system/workflows/shared/index.ts","../system/workflows/shared/llm-caller.ts","../system/workflows/shared/principal-tools.ts","../system/workflows/shared/prompts.ts","../system/workflows/shared/strategy-advisors.ts","../system/workflows/shared/tool-executor.ts","../system/workflows/shared/tool-loader.ts","../system/workflows/shared/types.ts","../themes/midnight.ts","../types/agent.ts","../types/analytics.ts","../types/auth.ts","../types/capability.ts","../types/config.ts","../types/delegation.ts","../types/discovery.ts","../types/domain-manifest.ts","../types/envelope.ts","../types/escalation-strategy.ts","../types/escalation.ts","../types/events.ts","../types/export.ts","../types/express.d.ts","../types/facets.ts","../types/index.ts","../types/logger.ts","../types/machines.ts","../types/maintenance.ts","../types/mcp.ts","../types/oauth-server.ts","../types/oauth.ts","../types/persona.ts","../types/scan-choice.ts","../types/sdk.ts","../types/startup.ts","../types/task.ts","../types/telemetry.ts","../types/tool-context.ts","../types/user.ts","../types/validation.ts","../types/workflow-icons.ts","../types/workflow-set.ts","../types/workflow.ts","../types/yaml-workflow.ts","../types/scan-code/constants.ts","../types/scan-code/index.ts","../types/scan-code/response.ts","../types/scan-code/rule.ts","../workers/index.ts"],"version":"5.9.3"}
1
+ {"root":["../index.ts","../vitest.config.ts","../vitest.fast.config.ts","../vitest.integration.config.ts","../vitest.llm.config.ts","../adapters/express.ts","../api/agent-subscriptions.ts","../api/agents.ts","../api/announcements.ts","../api/auth-sso.ts","../api/auth.ts","../api/bot-accounts.ts","../api/capabilities.ts","../api/controlplane.ts","../api/dba.ts","../api/diagnostics.ts","../api/domain.ts","../api/exports.ts","../api/files.ts","../api/index.ts","../api/insight.ts","../api/knowledge.ts","../api/maintenance.ts","../api/me.ts","../api/namespaces.ts","../api/overview.ts","../api/personas.ts","../api/pipelines.ts","../api/roles.ts","../api/settings.ts","../api/tasks.ts","../api/topics.ts","../api/users.ts","../api/workflow-sets.ts","../api/escalations/accumulate.ts","../api/escalations/analytics.ts","../api/escalations/batch-flag.ts","../api/escalations/bulk.ts","../api/escalations/cancel.ts","../api/escalations/claim.ts","../api/escalations/create.ts","../api/escalations/facets.ts","../api/escalations/helpers.ts","../api/escalations/index.ts","../api/escalations/list.ts","../api/escalations/lookups.ts","../api/escalations/metadata.ts","../api/escalations/related.ts","../api/escalations/resolve-batch.ts","../api/escalations/resolve.ts","../api/escalations/roster-action.ts","../api/escalations/single.ts","../api/mcp/index.ts","../api/mcp/servers.ts","../api/mcp/tools.ts","../api/scan-codes/badge-policy.ts","../api/scan-codes/choice-roles.ts","../api/scan-codes/choice.ts","../api/scan-codes/config.ts","../api/scan-codes/context.ts","../api/scan-codes/execute.ts","../api/scan-codes/fill-labels.ts","../api/scan-codes/grant.ts","../api/scan-codes/hold.ts","../api/scan-codes/identity.ts","../api/scan-codes/index.ts","../api/scan-codes/locate.ts","../api/scan-codes/present.ts","../api/scan-codes/subject.ts","../api/scan-codes/verb-accumulate.ts","../api/scan-codes/verb-fill.ts","../api/scan-codes/verb-into-subject.ts","../api/scan-codes/verbs-subject.ts","../api/scan-codes/verbs.ts","../api/workflows/config.ts","../api/workflows/discovery.ts","../api/workflows/index.ts","../api/workflows/input-lookups.ts","../api/workflows/input-validation.ts","../api/workflows/invocable.ts","../api/workflows/invocation.ts","../api/yaml-workflows/cron.ts","../api/yaml-workflows/crud.ts","../api/yaml-workflows/deploy.ts","../api/yaml-workflows/helpers.ts","../api/yaml-workflows/index.ts","../api/yaml-workflows/versions.ts","../bin/ltc.ts","../lib/typed-resolution.ts","../lib/uuid.ts","../lib/cli/auth.ts","../lib/cli/client.ts","../lib/cli/compile.ts","../lib/cli/format.ts","../lib/cli/init.ts","../lib/cli/output.ts","../lib/cli/scanner.ts","../lib/cli/types.ts","../lib/cli/commands/escalations.ts","../lib/cli/commands/knowledge.ts","../lib/cli/commands/mcp.ts","../lib/cli/commands/personas.ts","../lib/cli/commands/pipelines.ts","../lib/cli/commands/roles.ts","../lib/cli/commands/status.ts","../lib/cli/commands/streams.ts","../lib/cli/commands/users.ts","../lib/cli/commands/workflows.ts","../lib/db/index.ts","../lib/db/migrate.ts","../lib/events/browser-view.ts","../lib/events/callback.ts","../lib/events/escalation-wire.ts","../lib/events/index.ts","../lib/events/matching.ts","../lib/events/memory.ts","../lib/events/nats-ws-filter.ts","../lib/events/nats-ws-proxy.ts","../lib/events/nats-ws-server-filter.ts","../lib/events/nats-ws-ticket.ts","../lib/events/nats.ts","../lib/events/publish.ts","../lib/events/socketio.ts","../lib/events/system-events.ts","../lib/http/index.ts","../lib/json-path/pick.ts","../lib/logger/index.ts","../lib/logger/pino.ts","../lib/machines/index.ts","../lib/machines/line.ts","../lib/machines/protocol/codec.ts","../lib/machines/protocol/constants.ts","../lib/machines/protocol/contract.ts","../lib/machines/protocol/envelope.ts","../lib/machines/protocol/index.ts","../lib/machines/protocol/topics.ts","../lib/machines/site/edge-account.ts","../lib/machines/site/mosquitto-conf.ts","../lib/machines/site/site-conf.ts","../lib/machines/transport/callback-feed.ts","../lib/machines/transport/delivery.ts","../lib/machines/transport/index.ts","../lib/machines/transport/memory-broker.ts","../lib/machines/transport/memory.ts","../lib/machines/transport/mqtt-bus.ts","../lib/machines/transport/mqtt-link.ts","../lib/machines/transport/mqtt-session.ts","../lib/machines/transport/nats-bus.ts","../lib/machines/transport/nats-feed.ts","../lib/machines/transport/pubsub-feed.ts","../lib/machines/transport/serial.ts","../lib/machines/transport/stream-bus.ts","../lib/machines/transport/streams.ts","../lib/messaging/config.ts","../lib/messaging/constants.ts","../lib/messaging/index.ts","../lib/messaging/memory.ts","../lib/messaging/subjects.ts","../lib/messaging/nats/permissions.ts","../lib/messaging/nats/provider.ts","../lib/messaging/nats/render-conf.ts","../lib/messaging/nats/streams.ts","../lib/storage/index.ts","../lib/storage/local.ts","../lib/storage/mime.ts","../lib/storage/s3.ts","../lib/storage/types.ts","../lib/telemetry/honeycomb.ts","../lib/telemetry/index.ts","../modules/auth.ts","../modules/branding.ts","../modules/capabilities.ts","../modules/config.ts","../modules/defaults.ts","../modules/display.ts","../modules/features.ts","../modules/ltconfig.ts","../modules/maintenance.ts","../modules/mcp-auth.ts","../modules/oauth-server.ts","../modules/search.ts","../modules/sso.ts","../modules/utils.ts","../modules/version.ts","../routes/agents.ts","../routes/announcements.ts","../routes/auth-sso.ts","../routes/auth.ts","../routes/bot-accounts.ts","../routes/capabilities.ts","../routes/controlplane.ts","../routes/dba.ts","../routes/delegation.ts","../routes/diagnostics.ts","../routes/docs.ts","../routes/domain.ts","../routes/exports.ts","../routes/file-browser.ts","../routes/files.ts","../routes/index.ts","../routes/insight.ts","../routes/knowledge.ts","../routes/maintenance.ts","../routes/mcp-endpoint.ts","../routes/mcp.ts","../routes/me.ts","../routes/namespaces.ts","../routes/nats-credentials.ts","../routes/oauth-well-known.ts","../routes/oauth.ts","../routes/overview.ts","../routes/personas.ts","../routes/pipelines.ts","../routes/roles.ts","../routes/scan-codes.ts","../routes/settings.ts","../routes/tasks.ts","../routes/topics.ts","../routes/users.ts","../routes/workflow-sets.ts","../routes/escalations/accumulate.ts","../routes/escalations/acting.ts","../routes/escalations/analytics.ts","../routes/escalations/bulk.ts","../routes/escalations/facets.ts","../routes/escalations/index.ts","../routes/escalations/list.ts","../routes/escalations/metadata.ts","../routes/escalations/related.ts","../routes/escalations/resolve.ts","../routes/escalations/single.ts","../routes/oauth-server/authorize.ts","../routes/oauth-server/grants.ts","../routes/oauth-server/index.ts","../routes/oauth-server/registration.ts","../routes/oauth-server/token.ts","../routes/workflows/config.ts","../routes/workflows/discovery.ts","../routes/workflows/index.ts","../routes/workflows/invocation.ts","../routes/yaml-workflows/cron.ts","../routes/yaml-workflows/crud.ts","../routes/yaml-workflows/deployment.ts","../routes/yaml-workflows/index.ts","../routes/yaml-workflows/versions.ts","../scripts/bambu-boat.ts","../scripts/bambu-print.ts","../scripts/consolidation-sim.ts","../scripts/machine-line.ts","../scripts/ortho-populate.ts","../scripts/printer-cycle.ts","../scripts/process-helpers.ts","../scripts/process.ts","../scripts/token.ts","../scripts/twin-farm.ts","../sdk/index.ts","../services/dba.ts","../services/hotmesh-utils.ts","../services/invocation-access.ts","../services/workflow-invocation.ts","../services/workflow-state.ts","../services/agent/authority.ts","../services/agent/index.ts","../services/agent/input-mapper.ts","../services/agent/sql.ts","../services/agent/subscription-sql.ts","../services/agent/subscriptions.ts","../services/agent/trigger-registry.ts","../services/announcement/index.ts","../services/announcement/sql.ts","../services/auth/bot-api-key.ts","../services/auth/delegation.ts","../services/auth/index.ts","../services/auth/service-token.ts","../services/auth/sql.ts","../services/auth/oauth-server/access-token.ts","../services/auth/oauth-server/authorization.ts","../services/auth/oauth-server/constants.ts","../services/auth/oauth-server/index.ts","../services/auth/oauth-server/metadata.ts","../services/auth/oauth-server/registration.ts","../services/auth/oauth-server/sql.ts","../services/auth/oauth-server/store.ts","../services/config/cache.ts","../services/config/index.ts","../services/config/provider.ts","../services/config/read.ts","../services/config/sql.ts","../services/config/write.ts","../services/controlplane/index.ts","../services/controlplane/quorum-bridge.ts","../services/controlplane/sql.ts","../services/controlplane/stream-messages-sql.ts","../services/controlplane/types.ts","../services/cron/index.ts","../services/diagnostics/index.ts","../services/diagnostics/patterns.ts","../services/domain/index.ts","../services/domain/read.ts","../services/domain/seed.ts","../services/domain/sql.ts","../services/domain/validate.ts","../services/domain/write.ts","../services/escalation/accumulate.ts","../services/escalation/aggregate-sql.ts","../services/escalation/aggregate-validate.ts","../services/escalation/aggregates.ts","../services/escalation/batch-flag.ts","../services/escalation/batch.ts","../services/escalation/bulk.ts","../services/escalation/claim-asserted.ts","../services/escalation/client.ts","../services/escalation/crud.ts","../services/escalation/facet-sql.ts","../services/escalation/facets.ts","../services/escalation/grouped-list.ts","../services/escalation/index.ts","../services/escalation/map.ts","../services/escalation/metrics-cache.ts","../services/escalation/queries.ts","../services/escalation/read-scope-sql.ts","../services/escalation/related-extremes.ts","../services/escalation/related.ts","../services/escalation/resolver-validation.ts","../services/escalation/roster.ts","../services/escalation/sql.ts","../services/escalation/submit-guard.ts","../services/escalation/types.ts","../services/escalation-strategy/default.ts","../services/escalation-strategy/index.ts","../services/escalation-strategy/mcp.ts","../services/export/client.ts","../services/export/index.ts","../services/export/post-process.ts","../services/export/types.ts","../services/iam/acting-identity.ts","../services/iam/activity.ts","../services/iam/bots.ts","../services/iam/context.ts","../services/iam/credentials.ts","../services/iam/envelope.ts","../services/iam/ephemeral.ts","../services/iam/index.ts","../services/iam/principal.ts","../services/iam/resolve.ts","../services/iam/sql.ts","../services/insight/index.ts","../services/insight/prompts.ts","../services/interceptor/activity-interceptor.ts","../services/interceptor/completion.ts","../services/interceptor/context.ts","../services/interceptor/escalation.ts","../services/interceptor/index.ts","../services/interceptor/lifecycle.ts","../services/interceptor/state.ts","../services/interceptor/types.ts","../services/interceptor/activities/config.ts","../services/interceptor/activities/escalation.ts","../services/interceptor/activities/index.ts","../services/interceptor/activities/task.ts","../services/interceptor/activities/workflow.ts","../services/knowledge/index.ts","../services/knowledge/lookup-cache.ts","../services/knowledge/lookup-refs.ts","../services/knowledge/sql.ts","../services/llm/detect.ts","../services/llm/index.ts","../services/llm/translate.ts","../services/llm/types.ts","../services/llm/providers/anthropic.ts","../services/llm/providers/openai.ts","../services/machines/commands.ts","../services/machines/config.ts","../services/machines/contracts.ts","../services/machines/forms.ts","../services/machines/identities.ts","../services/machines/index.ts","../services/machines/leadership.ts","../services/machines/roles.ts","../services/machines/rows.ts","../services/machines/select.ts","../services/machines/surface.ts","../services/machines/gateway/actions.ts","../services/machines/gateway/address-book.ts","../services/machines/gateway/admission.ts","../services/machines/gateway/api-escalations.ts","../services/machines/gateway/dispatcher.ts","../services/machines/gateway/escalations.ts","../services/machines/gateway/executor.ts","../services/machines/gateway/gateway.ts","../services/machines/gateway/index.ts","../services/machines/gateway/jobs.ts","../services/machines/gateway/lifecycle.ts","../services/machines/gateway/log.ts","../services/machines/gateway/lt-http.ts","../services/machines/gateway/pacing.ts","../services/machines/gateway/plan-escalation.ts","../services/machines/gateway/plan-machine.ts","../services/machines/gateway/plan-shared.ts","../services/machines/gateway/provision.ts","../services/machines/gateway/receipts.ts","../services/machines/gateway/reconcile.ts","../services/machines/gateway/registration.ts","../services/machines/gateway/reply-waiter.ts","../services/machines/gateway/state.ts","../services/machines/gateway/trace.ts","../services/machines/testing/fake-long-tail.ts","../services/machines/testing/index.ts","../services/machines/testing/recording-log.ts","../services/machines/testing/wait.ts","../services/maintenance/index.ts","../services/mcp/adapter.ts","../services/mcp/db.ts","../services/mcp/exposure.ts","../services/mcp/external-server.ts","../services/mcp/index.ts","../services/mcp/register-tool.ts","../services/mcp/registered-tools.ts","../services/mcp/seed-service-account.ts","../services/mcp/server-lifecycle.ts","../services/mcp/server-tools.ts","../services/mcp/server.ts","../services/mcp/sql.ts","../services/mcp/types.ts","../services/mcp/workflow-compiler-server.ts","../services/mcp/workflow-server.ts","../services/mcp/client/connection-dispatch.ts","../services/mcp/client/connection-lifecycle.ts","../services/mcp/client/connection-test.ts","../services/mcp/client/connection.ts","../services/mcp/client/index.ts","../services/mcp/client/network-transport.ts","../services/mcp/client/tools.ts","../services/mcp/db-server/index.ts","../services/mcp/db-server/schemas.ts","../services/mcp/db-server/tools.ts","../services/mcp/playwright-server/index.ts","../services/mcp/playwright-server/lifecycle.ts","../services/mcp/playwright-server/schemas.ts","../services/mcp/playwright-server/tools.ts","../services/namespace/index.ts","../services/namespace/sql.ts","../services/namespace/types.ts","../services/oauth/crypto.ts","../services/oauth/db.ts","../services/oauth/index.ts","../services/oauth/sql.ts","../services/oauth/state.ts","../services/oauth/providers/anthropic.ts","../services/oauth/providers/github.ts","../services/oauth/providers/google.ts","../services/oauth/providers/index.ts","../services/oauth/providers/microsoft.ts","../services/oauth/providers/mock.ts","../services/oauth/providers/registry.ts","../services/oauth/providers/types.ts","../services/orchestrator/condition.ts","../services/orchestrator/index.ts","../services/orchestrator/types.ts","../services/overview/index.ts","../services/overview/sql.ts","../services/persona/index.ts","../services/persona/sql.ts","../services/persona/types.ts","../services/pipelines/enrichment.ts","../services/pipelines/events.ts","../services/pipelines/execution-builder.ts","../services/pipelines/index.ts","../services/pipelines/queries.ts","../services/pipelines/sql.ts","../services/pipelines/types.ts","../services/role/badge-grant.ts","../services/role/enforcement-cache.ts","../services/role/index.ts","../services/role/schema-validator.ts","../services/role/seed.ts","../services/role/sql.ts","../services/role/types.ts","../services/scan-code/index.ts","../services/scan-code/parse.ts","../services/scan-code/read.ts","../services/scan-code/sql.ts","../services/scan-code/validate-facts.ts","../services/scan-code/validate-query.ts","../services/scan-code/validate-subject.ts","../services/scan-code/validate.ts","../services/scan-code/write.ts","../services/task/crud.ts","../services/task/index.ts","../services/task/process.ts","../services/task/resolve.ts","../services/task/sql.ts","../services/task/types.ts","../services/topics/index.ts","../services/topics/sql.ts","../services/topics/system-topics.ts","../services/user/auth.ts","../services/user/crud.ts","../services/user/index.ts","../services/user/preferences.ts","../services/user/rbac.ts","../services/user/roles.ts","../services/user/scope.ts","../services/user/seed-admin.ts","../services/user/sql.ts","../services/user/sso-provision.ts","../services/user/types.ts","../services/workers/registry.ts","../services/workflow-sets/db.ts","../services/workflow-sets/index.ts","../services/workflow-sets/sql.ts","../services/yaml-workflow/builder-regenerate.ts","../services/yaml-workflow/db-utils.ts","../services/yaml-workflow/db-versions.ts","../services/yaml-workflow/db.ts","../services/yaml-workflow/deployer-helpers.ts","../services/yaml-workflow/deployer.ts","../services/yaml-workflow/generator.ts","../services/yaml-workflow/index.ts","../services/yaml-workflow/input-analyzer-helpers.ts","../services/yaml-workflow/input-analyzer.ts","../services/yaml-workflow/invoke.ts","../services/yaml-workflow/pipe-validator.ts","../services/yaml-workflow/sql.ts","../services/yaml-workflow/types.ts","../services/yaml-workflow/durable-compiler/index.ts","../services/yaml-workflow/durable-compiler/parser.ts","../services/yaml-workflow/durable-compiler/prompts.ts","../services/yaml-workflow/durable-compiler/types.ts","../services/yaml-workflow/pattern-detector/array-source.ts","../services/yaml-workflow/pattern-detector/collapse.ts","../services/yaml-workflow/pattern-detector/index.ts","../services/yaml-workflow/pattern-detector/run-detection.ts","../services/yaml-workflow/pattern-detector/types.ts","../services/yaml-workflow/pipeline/analyze.ts","../services/yaml-workflow/pipeline/extract-helpers.ts","../services/yaml-workflow/pipeline/extract.ts","../services/yaml-workflow/pipeline/index.ts","../services/yaml-workflow/pipeline/prompt-templates.ts","../services/yaml-workflow/pipeline/prompts.ts","../services/yaml-workflow/pipeline/validate.ts","../services/yaml-workflow/pipeline/build/dag-assembly.ts","../services/yaml-workflow/pipeline/build/dag.ts","../services/yaml-workflow/pipeline/build/index.ts","../services/yaml-workflow/pipeline/build/iteration.ts","../services/yaml-workflow/pipeline/build/metadata.ts","../services/yaml-workflow/pipeline/build/transform.ts","../services/yaml-workflow/pipeline/build/utils.ts","../services/yaml-workflow/pipeline/build/wiring.ts","../services/yaml-workflow/pipeline/compile/index.ts","../services/yaml-workflow/pipeline/compile/llm-call.ts","../services/yaml-workflow/pipeline/compile/parse-plan.ts","../services/yaml-workflow/pipeline/compile/summarize.ts","../services/yaml-workflow/workers/callbacks.ts","../services/yaml-workflow/workers/events.ts","../services/yaml-workflow/workers/index.ts","../services/yaml-workflow/workers/register.ts","../services/yaml-workflow/workers/scope.ts","../services/yaml-workflow/workers/step-tool.ts","../shared/workflow-state.ts","../shared/form-validation/ctx-path.ts","../shared/form-validation/derive-field-label.ts","../shared/form-validation/display-only-widgets.ts","../shared/form-validation/field-validator.ts","../shared/form-validation/index.ts","../shared/form-validation/invoke-context.ts","../shared/form-validation/validate-resolver-payload.ts","../shared/form-validation/x-lt-actions.ts","../shared/form-validation/x-lt-bind.ts","../shared/form-validation/x-lt-help.ts","../shared/form-validation/x-lt-invoke.ts","../shared/form-validation/x-lt-labels.ts","../shared/form-validation/x-lt-options.ts","../shared/form-validation/x-lt-query.ts","../shared/form-validation/x-lt-require-any.ts","../shared/form-validation/x-lt-require-sum.ts","../shared/form-validation/x-lt-roster.ts","../shared/form-validation/x-lt-scan.ts","../shared/form-validation/x-lt-show-if.ts","../shared/form-validation/x-lt-submit-guard.ts","../shared/form-validation/x-lt-submit-on-claim.ts","../shared/form-validation/x-lt-transition.ts","../shared/list-schema/aggregate.ts","../shared/list-schema/index.ts","../shared/list-schema/template.ts","../shared/list-schema/types.ts","../shared/list-schema/validate.ts","../shared/roles/segment.ts","../shared/scan-code/gtin.ts","../shared/scan-code/index.ts","../shared/scan-code/parse.ts","../start/adapters.ts","../start/apply-report.ts","../start/config.ts","../start/graph-workflows.ts","../start/index.ts","../start/server.ts","../start/socket-auth.ts","../start/workers.ts","../system/index.ts","../system/activities/claude-code.ts","../system/activities/file-storage.ts","../system/activities/http.ts","../system/activities/knowledge.ts","../system/activities/oauth.ts","../system/activities/schema-exchange.ts","../system/activities/sql.ts","../system/activities/triage/cache.ts","../system/activities/triage/context.ts","../system/activities/triage/discovery.ts","../system/activities/triage/index.ts","../system/activities/triage/llm.ts","../system/activities/triage/tools.ts","../system/mcp-servers/caller-auth.ts","../system/mcp-servers/claude-code.ts","../system/mcp-servers/docs.ts","../system/mcp-servers/events.ts","../system/mcp-servers/file-storage.ts","../system/mcp-servers/http-fetch.ts","../system/mcp-servers/human-queue-schemas.ts","../system/mcp-servers/human-queue.ts","../system/mcp-servers/knowledge.ts","../system/mcp-servers/oauth.ts","../system/mcp-servers/schema-exchange.ts","../system/mcp-servers/translation.ts","../system/mcp-servers/vision-prompts.ts","../system/mcp-servers/vision.ts","../system/mcp-servers/workflow-compiler.ts","../system/mcp-servers/workflow.ts","../system/mcp-servers/admin/agent-subscriptions.ts","../system/mcp-servers/admin/agents.ts","../system/mcp-servers/admin/announcements.ts","../system/mcp-servers/admin/bot-accounts.ts","../system/mcp-servers/admin/controlplane.ts","../system/mcp-servers/admin/diagnostics.ts","../system/mcp-servers/admin/domain-context.ts","../system/mcp-servers/admin/escalations.ts","../system/mcp-servers/admin/exports.ts","../system/mcp-servers/admin/index.ts","../system/mcp-servers/admin/maintenance.ts","../system/mcp-servers/admin/mcp-servers.ts","../system/mcp-servers/admin/overview.ts","../system/mcp-servers/admin/personas.ts","../system/mcp-servers/admin/pipelines.ts","../system/mcp-servers/admin/run-read.ts","../system/mcp-servers/admin/scan-codes.ts","../system/mcp-servers/admin/schemas.ts","../system/mcp-servers/admin/settings.ts","../system/mcp-servers/admin/tasks.ts","../system/mcp-servers/admin/topics.ts","../system/mcp-servers/admin/users.ts","../system/mcp-servers/admin/workflow-config.ts","../system/mcp-servers/admin/workflows.ts","../system/mcp-servers/admin/yaml-workflows.ts","../system/mcp-servers/db-query/index.ts","../system/mcp-servers/db-query/schemas.ts","../system/mcp-servers/db-query/tools.ts","../system/seed/index.ts","../system/seed/tool-manifests-admin.ts","../system/seed/tool-manifests-data.ts","../system/seed/tool-manifests-escalation.ts","../system/seed/tool-manifests-events.ts","../system/seed/tool-manifests-knowledge.ts","../system/seed/tool-manifests-workflows.ts","../system/workflows/tool-result-guard.ts","../system/workflows/capability-invoke/activities.ts","../system/workflows/capability-invoke/index.ts","../system/workflows/mcp-deterministic/activities.ts","../system/workflows/mcp-deterministic/index.ts","../system/workflows/mcp-query/index.ts","../system/workflows/mcp-query/prompts.ts","../system/workflows/mcp-query/strategy-advisors.ts","../system/workflows/mcp-query/types.ts","../system/workflows/mcp-query/activities/caches.ts","../system/workflows/mcp-query/activities/discovery.ts","../system/workflows/mcp-query/activities/index.ts","../system/workflows/mcp-query/activities/llm.ts","../system/workflows/mcp-query/activities/tool-executor.ts","../system/workflows/mcp-query/activities/tool-loader.ts","../system/workflows/mcp-query-router/activities.ts","../system/workflows/mcp-query-router/index.ts","../system/workflows/mcp-query-router/prompts.ts","../system/workflows/mcp-triage/activities-proxy.ts","../system/workflows/mcp-triage/index.ts","../system/workflows/mcp-triage/prompts.ts","../system/workflows/mcp-triage/response-builders.ts","../system/workflows/mcp-triage/response.ts","../system/workflows/mcp-triage/types.ts","../system/workflows/mcp-triage-deterministic/activities.ts","../system/workflows/mcp-triage-deterministic/index.ts","../system/workflows/mcp-triage-router/activities.ts","../system/workflows/mcp-triage-router/index.ts","../system/workflows/mcp-workflow-builder/index.ts","../system/workflows/mcp-workflow-builder/prompts.ts","../system/workflows/mcp-workflow-builder/activities/caches.ts","../system/workflows/mcp-workflow-builder/activities/index.ts","../system/workflows/mcp-workflow-builder/activities/llm.ts","../system/workflows/mcp-workflow-builder/activities/tool-loader.ts","../system/workflows/mcp-workflow-planner/index.ts","../system/workflows/mcp-workflow-planner/prompts.ts","../system/workflows/mcp-workflow-planner/activities/analyze.ts","../system/workflows/mcp-workflow-planner/activities/index.ts","../system/workflows/mcp-workflow-planner/activities/persist.ts","../system/workflows/mcp-workflow-planner/activities/plan.ts","../system/workflows/shared/discovery.ts","../system/workflows/shared/index.ts","../system/workflows/shared/llm-caller.ts","../system/workflows/shared/principal-tools.ts","../system/workflows/shared/prompts.ts","../system/workflows/shared/strategy-advisors.ts","../system/workflows/shared/tool-executor.ts","../system/workflows/shared/tool-loader.ts","../system/workflows/shared/types.ts","../themes/midnight.ts","../types/agent.ts","../types/analytics.ts","../types/auth.ts","../types/capability.ts","../types/config.ts","../types/delegation.ts","../types/discovery.ts","../types/domain-manifest.ts","../types/envelope.ts","../types/escalation-strategy.ts","../types/escalation.ts","../types/events.ts","../types/export.ts","../types/express.d.ts","../types/facets.ts","../types/index.ts","../types/logger.ts","../types/machines.ts","../types/maintenance.ts","../types/mcp.ts","../types/messaging.ts","../types/oauth-server.ts","../types/oauth.ts","../types/persona.ts","../types/scan-choice.ts","../types/sdk.ts","../types/startup.ts","../types/task.ts","../types/telemetry.ts","../types/tool-context.ts","../types/user.ts","../types/validation.ts","../types/workflow-icons.ts","../types/workflow-set.ts","../types/workflow.ts","../types/yaml-workflow.ts","../types/scan-code/constants.ts","../types/scan-code/index.ts","../types/scan-code/response.ts","../types/scan-code/rule.ts","../workers/index.ts"],"version":"5.9.3"}
@@ -20,6 +20,7 @@ export type { LTMaintenanceRule, LTMaintenanceConfig, } from './maintenance';
20
20
  export type { LTExportField, LTExportOptions, LTTimelineEntry, LTTransitionEntry, LTWorkflowExport, } from './export';
21
21
  export type { WorkflowExecution, WorkflowExecutionEvent, WorkflowExecutionStatus, WorkflowExecutionSummary, WorkflowEventType, WorkflowEventCategory, WorkflowEventAttributes, ExecutionExportOptions, ExportMode, ActivityDetail, JobExport, } from './export';
22
22
  export type { LTToolManifestEntry, LTStartConfig, LTInstance, LTWorkerConfig, LTMcpServerConfig, LTAgentConfig, LTTopicConfig, LTRoleConfig, LTMachinesConfig, LTScanSchemeConfig, LTScanRuleConfig, } from './startup';
23
+ export type { LTMessage, LTSubscription, LTPubSub, LTStreams, LTStreamMessage, LTConsumeOptions, LTMessagingProvider, StreamSpec, ConsumerSpec, } from './messaging';
23
24
  export type { LTMcpTransportType, LTMcpServerRecord, LTMcpServerStatus, LTMcpToolManifest, LTMcpAdapter, } from './mcp';
24
25
  export type { ResolutionContext, ResolutionDirective, LTEscalationStrategy, } from './escalation-strategy';
25
26
  export type { WorkflowCandidate, } from './discovery';
@@ -3,8 +3,9 @@
3
3
  * Long Tail, and the transports that carry them. Runtime values live in
4
4
  * lib/machines and services/machines.
5
5
  */
6
+ import type { Delivery } from './messaging';
6
7
  /** What a consumer tells the transport about one delivered message. */
7
- export type MachineDisposition = 'ack' | 'nak' | 'term';
8
+ export type MachineDisposition = Delivery;
8
9
  /** A machine's place on the site. Each machine is one MQTT client. */
9
10
  export interface MachineIdent {
10
11
  siteId: string;
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Messaging: the capability Long Tail uses to tell every container what
3
+ * changed (pub/sub) and to keep a durable, replayable record that consumers
4
+ * acknowledge (streams). A provider implements both; NATS with JetStream is
5
+ * the one to deploy, and memory serves tests. Nothing here names a provider.
6
+ *
7
+ * Subjects are dot-separated tokens. In a filter, `*` matches one token and
8
+ * `>` matches one or more trailing tokens.
9
+ */
10
+ export type Subject = string;
11
+ export interface LTMessage {
12
+ subject: Subject;
13
+ payload: string;
14
+ }
15
+ export interface LTSubscription {
16
+ close(): Promise<void>;
17
+ }
18
+ /** Fire-and-forget fan-out to every current subscriber. */
19
+ export interface LTPubSub {
20
+ publish(subject: Subject, payload: string): Promise<void>;
21
+ subscribe(filter: Subject, handler: (message: LTMessage) => void): LTSubscription;
22
+ }
23
+ /** What a consumer does with a stream message: ack (handled), nak (deliver again after a delay), term (drop). */
24
+ export type Delivery = 'ack' | 'nak' | 'term';
25
+ /** Where a new consumer starts: only messages appended after it, or the whole retained history. */
26
+ export type StartAt = 'new' | 'all';
27
+ export interface StreamSpec {
28
+ name: string;
29
+ /** Subjects the stream keeps. */
30
+ subjects: Subject[];
31
+ /** How long a message is kept. */
32
+ maxAgeMs: number;
33
+ }
34
+ export interface ConsumerSpec {
35
+ /** Durable name; a consumer keeps its position across restarts. */
36
+ name: string;
37
+ /** Subjects this consumer reads from the stream. */
38
+ filterSubjects: Subject[];
39
+ /** How long a delivered, unsettled message waits before it is delivered again. */
40
+ ackWaitMs?: number;
41
+ startAt?: StartAt;
42
+ }
43
+ export interface LTStreamMessage extends LTMessage {
44
+ /** 1 on first delivery. */
45
+ deliveries: number;
46
+ }
47
+ export interface LTConsumeOptions {
48
+ /** Delay before a nak'd message is delivered again. */
49
+ nakDelayMs?: number;
50
+ }
51
+ /** Durable streams: messages kept, delivered to named consumers in order, one at a time, until settled. */
52
+ export interface LTStreams {
53
+ /** Create the stream, or bring an existing one's subjects and age up to the spec. */
54
+ ensureStream(spec: StreamSpec): Promise<void>;
55
+ /** Create the consumer, or bring an existing one's filter up to the spec; its position is kept. */
56
+ ensureConsumer(stream: string, spec: ConsumerSpec): Promise<void>;
57
+ /** Append a message; resolves once the stream holds it. */
58
+ append(subject: Subject, payload: string): Promise<void>;
59
+ /** Deliver the consumer's messages to `handler` one at a time; a thrown handler counts as a nak. */
60
+ consume(stream: string, consumer: string, handler: (message: LTStreamMessage) => Promise<Delivery>, opts?: LTConsumeOptions): Promise<LTSubscription>;
61
+ }
62
+ export interface LTMessagingProvider {
63
+ /** The provider's name, for logs. */
64
+ readonly name: string;
65
+ /** Whether the provider holds a live connection now. */
66
+ readonly connected: boolean;
67
+ readonly pubsub: LTPubSub;
68
+ /** Null when the provider has no durable streams (for example NATS without JetStream). */
69
+ readonly streams: LTStreams | null;
70
+ connect(): Promise<void>;
71
+ disconnect(): Promise<void>;
72
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * Messaging: the capability Long Tail uses to tell every container what
4
+ * changed (pub/sub) and to keep a durable, replayable record that consumers
5
+ * acknowledge (streams). A provider implements both; NATS with JetStream is
6
+ * the one to deploy, and memory serves tests. Nothing here names a provider.
7
+ *
8
+ * Subjects are dot-separated tokens. In a filter, `*` matches one token and
9
+ * `>` matches one or more trailing tokens.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -8,6 +8,7 @@ import type { LTOAuthStartConfig } from './oauth';
8
8
  import type { LTOAuthServerConfig } from './oauth-server';
9
9
  import type { LTTelemetryAdapter } from './telemetry';
10
10
  import type { LTEventAdapter } from './events';
11
+ import type { LTMessagingProvider } from './messaging';
11
12
  import type { DomainDictionary } from './domain-manifest';
12
13
  import type { LTLoggerAdapter } from './logger';
13
14
  import type { LineDef } from './machines';
@@ -519,7 +520,31 @@ export interface LTStartConfig {
519
520
  };
520
521
  adapter?: LTTelemetryAdapter;
521
522
  };
522
- /** Milestone event publishing. */
523
+ /**
524
+ * Messaging: pub/sub and durable streams, shared by events and the machine
525
+ * surface. NATS (with JetStream for durable streams) is the provider to
526
+ * deploy; LT_MESSAGING with LT_NATS_* configures the same from the
527
+ * environment. Omitted, Long Tail runs without it.
528
+ */
529
+ messaging?: {
530
+ /** A provider of your own; wins over everything else. */
531
+ provider?: LTMessagingProvider;
532
+ nats?: {
533
+ url: string;
534
+ token?: string;
535
+ user?: string;
536
+ password?: string;
537
+ /** How browsers reach events: a public WebSocket URL, or a NATS WebSocket target proxied through this server. */
538
+ ws?: {
539
+ url?: string;
540
+ proxy?: string;
541
+ token?: string;
542
+ };
543
+ };
544
+ /** In-process only; for tests and single-process development. */
545
+ memory?: boolean;
546
+ };
547
+ /** Milestone event publishing. `events.nats` configures the same NATS connection as `messaging.nats`. */
523
548
  events?: {
524
549
  nats?: {
525
550
  url?: string;
package/docs/events.md CHANGED
@@ -16,6 +16,13 @@ await start({
16
16
  events: { nats: { url: 'nats://localhost:4222' } },
17
17
  });
18
18
 
19
+ // The same NATS as Long Tail's messaging, shared with the machine surface
20
+ await start({
21
+ database: { connectionString: process.env.DATABASE_URL },
22
+ workers: [ ... ],
23
+ messaging: { nats: { url: 'nats://nats:4222', token: process.env.NATS_TOKEN, ws: { proxy: 'ws://nats:9222' } } },
24
+ });
25
+
19
26
  // Custom adapters (multiple supported)
20
27
  await start({
21
28
  database: { connectionString: process.env.DATABASE_URL },
@@ -26,6 +33,32 @@ await start({
26
33
 
27
34
  `start()` handles adapter connection and graceful disconnection on shutdown automatically.
28
35
 
36
+ ## Messaging
37
+
38
+ Messaging is one connection that Long Tail opens once and shares: events publish over its pub/sub, and the machine surface keeps the line's durable streams in it. NATS is the provider to deploy, and with JetStream enabled on the server it also provides durable streams. `start()` connects it before events and the machine surface, and closes it after both at shutdown. If it cannot connect, startup logs `messaging.provider.connect_failed` and continues, as events always have.
39
+
40
+ Configure it in one of these ways, in this order of precedence:
41
+
42
+ | Configuration | Meaning |
43
+ |---|---|
44
+ | `messaging.provider` | A provider of your own (`LTMessagingProvider`) |
45
+ | `messaging.nats` | `{ url, token? \| user? + password?, ws? }`; `ws` is `{ url?, proxy?, token? }` for browsers |
46
+ | `messaging.memory` | In process only, for tests and single-process development |
47
+ | `LT_MESSAGING=nats` with `LT_NATS_URL`, `LT_NATS_TOKEN` or `LT_NATS_USER` and `LT_NATS_PASSWORD`, `LT_NATS_WS_URL`, `LT_NATS_WS_PROXY` | The same from the environment; `LT_MESSAGING=memory` for in process |
48
+ | `events.nats` | The same NATS connection, configured as events have been |
49
+
50
+ `events.nats` and `messaging.nats` configure the same connection, so an existing `events: { nats: { url, token, wsProxy } }` keeps working as it is. With none of these, Long Tail runs without messaging, events go over Socket.IO, and anything that asks for messaging (`messagingRegistry.pubsub` or `.streams`) throws, naming what to set.
51
+
52
+ **One server, separate accounts.** A NATS server that only Long Tail and its browsers use needs only a token. When a site's machine broker also connects to it, give each party a NATS account so it reaches only its own subjects. `renderNatsConf` writes such a server's configuration:
53
+
54
+ | Account | Who logs in | What it reaches |
55
+ |---|---|---|
56
+ | `LT` | Long Tail; optionally a subscribe-only dashboard user, and a standalone gateway user scoped by `jsPermissions` to its streams and consumer | Everything of Long Tail's, including the durable streams |
57
+ | `EDGE_<site>_<line>` (`Machines.edgeAccountFor(line, root)`) | The machine broker's bridge, over MQTT only | Publishing the line's subjects; nothing else. `LT` imports exactly those subjects |
58
+ | `SYS` | Monitoring | The server's own |
59
+
60
+ The edge's subjects reach Long Tail's streams, and nothing of Long Tail's reaches the edge.
61
+
29
62
  ## Dashboard Transport Selection
30
63
 
31
64
  The dashboard auto-detects its event transport via `GET /api/settings`. By default, Socket.IO is reported — it works in-process with no additional infrastructure.
@@ -162,15 +195,28 @@ The built-in `NatsEventAdapter` publishes events as JSON-encoded strings to NATS
162
195
  | Option | Default | Description |
163
196
  |-----------------|----------------------------------------------|----------------------------------|
164
197
  | `url` | `process.env.NATS_URL` or `nats://localhost:4222` | NATS server URL |
198
+ | `token` | `process.env.NATS_TOKEN` | NATS token |
199
+ | `wsUrl` | `process.env.NATS_WS_URL` | Public WebSocket URL for browsers |
200
+ | `wsProxy` | | NATS WebSocket target that Long Tail proxies browsers to |
165
201
  | `subjectPrefix` | `lt.events` | Prefix for NATS subject names |
202
+ | `messaging` | | Long Tail's messaging; the adapter publishes over it instead of opening a connection of its own, and skips publishing while it is disconnected |
166
203
 
167
204
  ### Subject Format
168
205
 
169
- Events are published to `{subjectPrefix}.{event.type}`. A milestone event with the default prefix lands on:
206
+ Events are published to `{subjectPrefix}.{event.type}`. Every built-in type starts with `system.`:
170
207
 
171
- ```
172
- lt.events.milestone
173
- ```
208
+ | Event | Subject |
209
+ |---|---|
210
+ | Milestone | `lt.events.system.milestone.<workflowId>` |
211
+ | Task | `lt.events.system.task.<taskId>.<action>` |
212
+ | Escalation | `lt.events.system.escalation.<role>.<escalationId>.<action>` |
213
+ | Activity | `lt.events.system.activity.<workflowId>.<activityName>.<action>` |
214
+ | Workflow | `lt.events.system.workflow.<workflowId>.<action>` |
215
+ | Agent | `lt.events.system.agent.<agentName>.<action>` |
216
+ | Knowledge | `lt.events.system.knowledge.<domain>.<action>` |
217
+ | File | `lt.events.system.file.<action>` |
218
+
219
+ A role is written as one subject token: each run of characters other than letters, digits, `_` and `-` becomes `-`. Subscribe to `lt.events.system.escalation.<role>.>` for one role's escalations.
174
220
 
175
221
  ### Usage
176
222
 
package/docs/machines.md CHANGED
@@ -21,7 +21,7 @@ await start({
21
21
 
22
22
  Transports come from the environment (see [Configuration](#configuration)). `mqtt` is an optional peer dependency; install it in the host when a line runs.
23
23
 
24
- For each line, one replica leads (a Postgres advisory lock held on its own connection), makes sure the line's bot accounts exist, and runs the gateway. Other replicas wait on the lock and take over when the leader's session ends.
24
+ For each line, one replica leads (a Postgres advisory lock held on its own connection), makes sure the line's bot accounts exist, and runs the gateway. Other replicas wait on the lock and take over when the leader's session ends. A replica whose connection drops or is refused, as while Postgres restarts, contends again every 5 seconds.
25
25
 
26
26
  ## The line
27
27
 
@@ -58,7 +58,7 @@ A machine handoff is a row on the receiving machine's role (a handoff to a perso
58
58
  | Facet | Meaning |
59
59
  |---|---|
60
60
  | `siteId`, `lineId` | The line; a gateway acts only on its own line's rows |
61
- | `units` | `[{ unitId, carrierId, artifact?, parameters? }]`: the units that move together; any of a route's units, all or some. A unit's `artifact` (`{ url, sha256 }`) is its own file, such as a per-unit model; its `parameters` are its own settings |
61
+ | `units` | `[{ unitId, carrierId, artifact?, artifacts?, parameters? }]`: the units that move together; any of a route's units, all or some. A unit's `artifact` is its own file, such as a per-unit model, and `artifacts` its files when it has several; each is `{ url, sha256, id?, contentType?, sizeBytes? }`. Its `parameters` are its own settings |
62
62
  | `jobId`, `senderJobId` | The receiver's job and the sender's. Each open handoff into a machine names its own job; a second open row naming the same job there resolves `dispatch-refused`. A row for some of a sender job's units still receives their releases, however the codec split that job |
63
63
  | `fromMachine`, `toMachine` | Machine ids, or null for line entry and for a person |
64
64
  | `recipeId`, `recipeVersion`, `process` | What the receiver runs |
@@ -103,6 +103,22 @@ When a sender finishes a unit, the gateway records the release on the row and, i
103
103
 
104
104
  Both are containment-searchable, so the rows that used a lot, and with them the units, are one query: `GET /escalations?facets={"lots":["LOT-7"]}`. A unit's whole path is every handoff row whose `units` holds it. The sender's full finished record stays on the row as its `released:<unit>` item. A codec maps its own lot fields into `materials`.
105
105
 
106
+ ### Job lifecycle on the row
107
+
108
+ With `MACHINE_LIFECYCLE=on`, while a machine works a job, the gateway notes the job's milestones as items on the open row that holds it, as the machine's bot:
109
+ - the dispatch into the machine, until its units arrive;
110
+ - after that, the handoff out of the machine.
111
+
112
+ | Item | When |
113
+ |---|---|
114
+ | `started:<unit>` | The machine reports `started` |
115
+ | `progress:<unit>:<step>` | `progress` crosses a step of `MACHINE_PROGRESS_STEP` percent (25 by default, so 25, 50 and 75); the row's `progress` facet holds the latest `{ percent, remainingSec, stage, detail, at }` |
116
+ | `stage:<unit>:<stage>` | `progress` names a `stage` the job has not reached before, for machines that report named steps rather than a percent |
117
+ | `paused:<alarm>:<raisedAt>` | A stopping alarm is raised at the machine (the alarm row still goes to the operator role) |
118
+ | `resumed:<alarm>:<raisedAt>` | The machine clears that alarm |
119
+
120
+ Every other progress message stays in the stream, so an hour-long job leaves a handful of items on its row. A row parked with a limit on its items (`accumulate: { max }`) gets no notes, so they never take a slot its units need. Off, the rows hold only their releases and arrivals. A machine whose job runs before its units arrive, such as a printer whose part exists only once the print finishes, reports the arrival at the end, and the whole job lands on the one row. A `progress` job event may carry `percent` (0 to 100), `remainingSec`, a `stage` name and a `detail` object.
121
+
106
122
  ### Decisions on a failed handoff
107
123
 
108
124
  `Machines.handoffDecisions(errorCode)` gives a default set of decisions for a failed handoff. A failure in the move leaves the units on the line, so `retry`, `manual` and `scrap` all fit. Units the sender finished as not ok (`sender-rejected`) leave the line and never re-enter it, so only `manual` and `scrap` fit. After a `partial-arrival` (a timeout once only some units arrived) the units are split between two stations, and a retry of the same hop would ask the sender for units it no longer holds, so the default offers `manual` and `scrap`. A workflow is free to offer its own decisions instead, such as moving only the missing units on; the platform reports the facts and does not choose.
@@ -155,6 +171,8 @@ The gateway sends the command and resolves the row with the reply, as the machin
155
171
  | `no-reply` | No reply after every attempt. The command expired at the end of the asking, so a copy that reaches the machine later is refused, never run |
156
172
  | `unsupported` | Not a command a row may ask for, not a machine on this line, or a command the line's codec has no message for; nothing was sent |
157
173
 
174
+ A command is sent again, under the same `cmdId` and with the same arguments, by a gateway that takes over the line while its row is open. Its `expiresAt` counts in rounds of the asking from the row's creation, and a round begins only once the one before it has expired; a command sent in a later round goes out as a new one, `<row>:command:r<n>`, never as an old one with changed arguments. Dispatches work the same way with `MACHINE_DISPATCH_TTL_MS`, counted from the row's creation, or for `dispatchOn: 'arrival'` from the last unit's arrival, so a machine never holds two valid commands for one row.
175
+
158
176
  The example's `machineCommand` workflow is this one step.
159
177
 
160
178
  ## The wire
@@ -169,6 +187,8 @@ interface LineCodec {
169
187
  unitsPerDispatch: number | null; // 1: one dispatch per unit
170
188
  dispatchOn?: 'created' | 'arrival'; // when a handoff's job goes out
171
189
  strict?: boolean; // broken messages go to a person, never acted on
190
+ snapshotOnStart?: boolean; // ask every machine for a snapshot on taking the line
191
+ retainedAlarms?: boolean; // active alarms stay retained on the broker until they clear
172
192
  decode(topic: string, payload: string, retained?: boolean): Inspection[];
173
193
  encode(ident: MachineIdent, command: MachineCommand): WireMessage[]; // [] when the machines lack the command
174
194
  receipt?(ident: MachineIdent, messageIds: string[]): WireMessage[]; // for machines that keep an outbox
@@ -184,6 +204,10 @@ interface LineCodec {
184
204
  - `strict: true` holds a message with contract violations: it is confirmed, never acted on, and one `contract-violation` row shows it to the operator role. Without it, known fields are acted on and the violations are logged.
185
205
  - An alarm body may name the catalog edition its code comes from, `catalog: { domain, key, version }`. The alarm row then carries it as a lookup ref, so the row reads the code's meaning as of that edition.
186
206
  - Event channels go to the durable stream and telemetry channels are read live. A machine reads its commands on the command channels. The broker ACL is rendered from these channels, so a codec with its own topics gets its own ACL. Unknown body fields are allowed and known ones are checked. Payloads may be up to 256 KB.
207
+ - `snapshotOnStart: true` is for machines that keep no retained state and report only what changes. The gateway asks each machine for a snapshot once it takes the line, so it learns every machine's current job before it acts on a change.
208
+ - `retainedAlarms: true` says active alarms stay retained on the broker until they clear, as in the line protocol. A gateway taking the line then reads every active alarm back, and an alarm row whose alarm is missing has cleared. Without it, a machine's snapshot lists its active alarms (`alarms`), and an alarm row whose alarm a snapshot the machine sends no longer lists resolves `cleared`; a snapshot read back from the broker is never used for this, since it may be older than the alarms.
209
+ - A receiver that reads only the carrier may report `arrived`, or `transfer-failed` with `unreadable-id`, with `carrierId` and no `unitId` or `jobId`. The gateway finds the unit an open handoff into that machine carries on that carrier.
210
+ - Each command reaches `encode` with `attempt`, how many times this gateway has sent that `cmdId`, and `retry`, true when the machine may already have it: sent earlier, or its row existed before this gateway took the line. A protocol with a retransmission flag sets it from `retry`.
187
211
  - When `encode` returns no messages, the machines have no such command. The gateway sends nothing and waits for nothing: a machine-command row resolves `unsupported`, and a cancel or snapshot the machines lack is logged as unsupported.
188
212
 
189
213
  The generic protocol's topics are `{root}/{site}/{line}/{machine}/{channel}`. Every message is wrapped in `{ v, id, at, source, body }`.
@@ -213,20 +237,22 @@ A replica taking a line reads back its learned addresses, its open handoff, comm
213
237
  ## Topology and identity
214
238
 
215
239
  ```
216
- machines ──MQTT, TLS, client cert──▶ machine broker ──bridge──▶ site NATS
217
- (Mosquitto) JetStream
240
+ machines ──MQTT, TLS, client cert──▶ machine broker ──bridge──▶ NATS with JetStream
241
+ (Mosquitto) (Long Tail's messaging, or a site NATS)
218
242
  ▲ ▲
219
243
  └── gateway (commands) └── gateway (streams, read only)
220
244
  ```
221
245
 
222
246
  - **Machines:** each machine logs in over MQTT 3.1.1 or 5 with its own certificate; the CN (`{site}-{line}-{address}`) is its username. The broker ACL lets it write only its own channels and read only its own commands. The line controller may command every machine on the line.
223
- - **Durable streams:** the bridge carries the line's topics one way, into the site NATS, where only the bridge may publish them. JetStream keeps `LINE_EVENTS` (30 days) and `LINE_TELEMETRY` (3 days). The gateway reads through a durable consumer and may publish only JetStream requests and acks.
224
- - **Escalation events:** the gateway inside Long Tail reads them in process. The site NATS is a server of its own; Long Tail's events and NATS stay inside Long Tail.
247
+ - **Durable streams:** the bridge carries the line's topics one way into NATS, where only the bridge may publish them. JetStream keeps `LINE_EVENTS` (30 days) and `LINE_TELEMETRY` (3 days). The gateway reads through a durable consumer, `<controller>-events`, and may publish only JetStream requests and acks for its own streams and consumer; it cannot delete or purge them.
248
+ - **Where the streams live:** by default in Long Tail's messaging ([events](events.md#messaging)), whose NATS server must run JetStream. The bridge then logs in to that server's edge account for the line (`Machines.edgeAccountFor`), which may publish only the line's subjects, so the edge reaches nothing of Long Tail's. With `MACHINE_SITE_NATS_URL`, the streams live instead in a NATS server of the site's own (`Machines.renderSiteConf`), and Long Tail's NATS stays inside Long Tail. Either way the gateway reads the same streams under the same consumer name.
249
+ - **Escalation events:** the gateway inside Long Tail reads them in process. A standalone gateway subscribes to them over Long Tail's messaging.
225
250
  - **Commands:** the gateway publishes commands to the machine broker at QoS 1, so they queue for a machine that is away.
226
251
  - **Bot accounts:** in Long Tail each machine is a bot account on its station and receiver roles, so `claimed_by` and `resolved_by` name the machine. The controller bot holds those roles and the operator role, and raises the operator rows. The bots are member accounts with no password, under names the line derives; the line will not start while a person's account holds one of those names.
227
252
  - **Rows are the authority:** an escalation event only tells the gateway which row to look at. It reads the row back as the controller and acts on the stored role, status and metadata. A row on a role the controller does not hold, or an event its stored row contradicts, does nothing.
228
253
  - **Roles carry the access:** dispatching to a machine or commanding one means parking a row on that machine's role, so Long Tail's role access decides who can. The gateway acts on a handoff into a machine only on that machine's role, and on a handoff to a person only on a receiver role. A row commands only the machine whose role it is on: cancelling a handoff withdraws the receiver's dispatch, and the sender's job is stopped only by a `cancel` command row on the sender's role.
229
254
  - **Rendering:** `Machines.renderSiteConf`, `renderMosquittoConf` and `renderMosquittoAcl(line, codec)` render the configuration from the line; the ACL takes its topics from the codec's channels.
255
+ - **Machines that host their own broker:** the machine broker connects out to each machine's broker with a Mosquitto bridge, carrying the machine's messages in and its commands out under the machine's level of the line's topics, and its codec reads them there. The bridge's notification topic, kept on the machine broker, is the machine's presence. `examples/workflows/bambu-printer` does this for 3D printers.
230
256
 
231
257
  ### Learned addresses
232
258
 
@@ -243,11 +269,11 @@ A line with `addressing: 'learned'` names its stations and lets each machine tel
243
269
 
244
270
  | Variable | Default | Meaning |
245
271
  |---|---|---|
246
- | `MACHINE_TRANSPORT` | | `nats` (site NATS streams) or `mqtt` (any MQTT broker, no replay beyond the session) |
247
- | `MACHINE_ESCALATION_FEED` | `in-process` inside Long Tail, `core` for a standalone gateway | Where escalation events come from; `core` subscribes to Long Tail's NATS (`NATS_URL`, `NATS_TOKEN`) |
272
+ | `MACHINE_TRANSPORT` | | `nats` (durable streams) or `mqtt` (any MQTT broker, no replay beyond the session) |
273
+ | `MACHINE_ESCALATION_FEED` | `in-process` inside Long Tail, `core` for a standalone gateway | Where escalation events come from; `core` subscribes over Long Tail's messaging, or to `NATS_URL` with `NATS_TOKEN` when the gateway has none |
248
274
  | `MACHINE_TOPIC_ROOT` | `line/v1` | The generic codec's root |
249
275
  | `MACHINE_LINE_CONFIG` | | Path of the line JSON |
250
- | `MACHINE_SITE_NATS_URL`, `_USER`, `_PASSWORD` | | Site NATS for the streams |
276
+ | `MACHINE_SITE_NATS_URL`, `_USER`, `_PASSWORD` | | A site NATS of its own for the streams; unset, `nats` keeps them in Long Tail's messaging |
251
277
  | `MACHINE_MQTT_URL`, `_PROTOCOL` | `_PROTOCOL` 5 | Machine broker, for commands and retained reads; 4 for a broker that speaks only MQTT 3.1.1 |
252
278
  | `MACHINE_MQTT_CA`, `_CERT`, `_KEY` | | TLS files; `{clientId}` in a path picks each identity's certificate |
253
279
  | `MACHINE_REPLY_TIMEOUT_MS` | `5000` | Wait for a command reply |
@@ -256,6 +282,9 @@ A line with `addressing: 'learned'` names its stations and lets each machine tel
256
282
  | `MACHINE_OFFLINE_DEBOUNCE_MS` | `15000` | Offline this long before a row |
257
283
  | `MACHINE_QUIET_MS` | `90000` | Silent this long before a row; `0` turns it off |
258
284
  | `MACHINE_RECEIPT_DELAY_MS` | `250` | How long confirmed message ids gather before a receipt goes out |
285
+ | `MACHINE_LIFECYCLE` | `off` | `on` notes each job's start, progress steps and pauses on the row that holds it |
286
+ | `MACHINE_PROGRESS_STEP` | `25` | With lifecycle notes on, progress is noted each time it crosses this many percent; `0` notes none |
287
+ | `MACHINE_CODEC_MODULE` | | Development server only: a module whose `createCodec(line)` speaks the machines' protocol |
259
288
 
260
289
  ## Testing a codec or adapter
261
290
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/long-tail",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "Long Tail Workflows — Durable AI workflows with human-in-the-loop escalation. Powered by PostgreSQL.",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -50,6 +50,8 @@
50
50
  "ortho:populate": "ts-node scripts/ortho-populate.ts",
51
51
  "twin:farm": "ts-node scripts/twin-farm.ts",
52
52
  "machine:line": "ts-node scripts/machine-line.ts",
53
+ "bambu:print": "ts-node scripts/bambu-print.ts",
54
+ "bambu:boat": "ts-node scripts/bambu-boat.ts",
53
55
  "printers:cycle": "ts-node scripts/printer-cycle.ts",
54
56
  "consolidation:sim": "ts-node scripts/consolidation-sim.ts",
55
57
  "dashboard:install": "cd dashboard && npm install",
@@ -1,11 +0,0 @@
1
- /**
2
- * Read a durable JetStream consumer one message at a time and settle each
3
- * with the handler's disposition: ack, nak with a delay, or term.
4
- */
5
- import type { ConsumerMessages, JetStreamClient, JsMsg } from 'nats';
6
- import type { SerialQueue } from './serial';
7
- import { type Disposition } from './delivery';
8
- export declare function readDurable(js: JetStreamClient, stream: string, durable: string, queue: SerialQueue, handle: (msg: JsMsg) => Promise<Disposition>, nakDelayMs: number): Promise<ConsumerMessages>;
9
- export declare function payloadOf(m: {
10
- data: Uint8Array;
11
- }): string;