@hotmeshio/long-tail 0.5.2 → 0.5.4
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/build/api/escalations/index.d.ts +1 -1
- package/build/api/escalations/index.js +2 -1
- package/build/api/escalations/resolve.d.ts +10 -0
- package/build/api/escalations/resolve.js +52 -0
- package/build/lib/events/system-events.d.ts +19 -0
- package/build/lib/events/system-events.js +62 -0
- package/build/modules/ltconfig.d.ts +8 -0
- package/build/modules/ltconfig.js +10 -0
- package/build/routes/escalations/resolve.js +15 -3
- package/build/services/escalation/bulk.d.ts +2 -1
- package/build/services/escalation/bulk.js +20 -19
- package/build/services/escalation/client.d.ts +22 -0
- package/build/services/escalation/client.js +141 -0
- package/build/services/escalation/crud.d.ts +47 -21
- package/build/services/escalation/crud.js +204 -140
- package/build/services/escalation/index.d.ts +1 -0
- package/build/services/escalation/index.js +3 -0
- package/build/services/escalation/map.d.ts +15 -0
- package/build/services/escalation/map.js +64 -0
- package/build/services/escalation/queries.js +64 -149
- package/build/services/escalation/sql.d.ts +13 -32
- package/build/services/escalation/sql.js +36 -176
- package/build/services/export/post-process.js +23 -4
- package/build/services/interceptor/activities/config.js +5 -1
- package/build/services/interceptor/index.d.ts +3 -0
- package/build/services/interceptor/index.js +7 -21
- package/build/services/mcp/db-server/schemas.d.ts +1 -1
- package/build/services/orchestrator/condition.d.ts +30 -25
- package/build/services/orchestrator/condition.js +30 -26
- package/build/services/yaml-workflow/deployer.js +4 -0
- package/build/services/yaml-workflow/workers/register.js +3 -0
- package/build/start/index.js +2 -1
- package/build/start/workers.js +12 -0
- package/build/system/mcp-servers/admin/schemas.d.ts +1 -1
- package/build/system/mcp-servers/db-query/schemas.d.ts +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types/escalation.d.ts +1 -0
- package/docs/api/http/escalations.md +19 -0
- package/docs/api/sdk/escalations.md +33 -0
- package/docs/hitl-guide.md +44 -1
- package/package.json +2 -2
|
@@ -57,7 +57,7 @@ const DEFAULT_ACTIVITY_QUEUE = 'lt-interceptor';
|
|
|
57
57
|
*/
|
|
58
58
|
async function registerLT(connection, options) {
|
|
59
59
|
const taskQueue = options?.taskQueue ?? DEFAULT_ACTIVITY_QUEUE;
|
|
60
|
-
await hotmesh_1.Durable.registerActivityWorker({ connection, taskQueue, guid: `interceptor::${taskQueue}-${hotmesh_1.Durable.guid()}
|
|
60
|
+
await hotmesh_1.Durable.registerActivityWorker({ connection, taskQueue, guid: `interceptor::${taskQueue}-${hotmesh_1.Durable.guid()}`, events: options?.events }, interceptorActivities, taskQueue);
|
|
61
61
|
hotmesh_1.Durable.registerInboundInterceptor(createLTInterceptor({
|
|
62
62
|
activityTaskQueue: taskQueue,
|
|
63
63
|
defaultRole: options?.defaultRole,
|
|
@@ -100,26 +100,12 @@ function createLTInterceptor(options) {
|
|
|
100
100
|
retry: { maximumAttempts: 3 },
|
|
101
101
|
});
|
|
102
102
|
const envelope = (0, state_1.extractEnvelope)(ctx);
|
|
103
|
-
// 2.
|
|
104
|
-
//
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const taskQueue = (0, lifecycle_1.deriveTaskQueue)(wf);
|
|
110
|
-
(0, lifecycle_1.publishStartedEvents)(wf, taskQueue, undefined, wf.workflowId);
|
|
111
|
-
const result = toolCtx ? await (0, context_2.runWithToolContext)(toolCtx, next) : await next();
|
|
112
|
-
(0, publish_1.publishWorkflowEvent)({
|
|
113
|
-
type: 'workflow.completed',
|
|
114
|
-
source: 'interceptor',
|
|
115
|
-
workflowId: wf.workflowId,
|
|
116
|
-
workflowName: wf.workflowName,
|
|
117
|
-
taskQueue,
|
|
118
|
-
status: 'completed',
|
|
119
|
-
});
|
|
120
|
-
return result;
|
|
121
|
-
}
|
|
122
|
-
// 3. Load config — unregistered/uncertified workflows get ToolContext only
|
|
103
|
+
// 2. The gate is REGISTRATION in lt_config_workflows, not the runtime
|
|
104
|
+
// `certified` flag. Every registered workflow gets task tracking and
|
|
105
|
+
// escalation wiring; unregistered ad-hoc durable workflows get
|
|
106
|
+
// ToolContext + lifecycle events only. The `certified` flag is
|
|
107
|
+
// propagated by executeLT and gates parent/child signal composition
|
|
108
|
+
// (services/orchestrator), not task-record creation.
|
|
123
109
|
const wfConfig = await activities.ltGetWorkflowConfig(wf.workflowName);
|
|
124
110
|
if (!wfConfig) {
|
|
125
111
|
const toolCtx = (0, envelope_1.buildToolContextFromEnvelope)(envelope, wf.workflowId, wf.workflowTrace, wf.workflowSpan);
|
|
@@ -15,8 +15,8 @@ export declare const findTasksSchema: z.ZodObject<{
|
|
|
15
15
|
status?: "pending" | "in_progress" | "completed" | "needs_intervention" | "failed" | undefined;
|
|
16
16
|
workflow_type?: string | undefined;
|
|
17
17
|
workflow_id?: string | undefined;
|
|
18
|
-
limit?: number | undefined;
|
|
19
18
|
origin_id?: string | undefined;
|
|
19
|
+
limit?: number | undefined;
|
|
20
20
|
}>;
|
|
21
21
|
export declare const findEscalationsSchema: z.ZodObject<{
|
|
22
22
|
status: z.ZodOptional<z.ZodEnum<["pending", "resolved"]>>;
|
|
@@ -1,34 +1,39 @@
|
|
|
1
|
+
import type { Types } from '@hotmeshio/hotmesh';
|
|
1
2
|
/**
|
|
2
3
|
* Wait for a signal and resolve the associated escalation automatically.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* activity,
|
|
5
|
+
* Two ways to call it:
|
|
6
|
+
*
|
|
7
|
+
* **Efficient (atomic) — pass an escalation config.** The escalation row is
|
|
8
|
+
* written inside this workflow's Leg1 checkpoint (one commit, crash-safe — no
|
|
9
|
+
* separate create activity, no enrich). `signal_key` is the signal id, so the
|
|
10
|
+
* dashboard resolve endpoint (Path 0), `resolveEscalationBySignalKey`, and any
|
|
11
|
+
* webhook resume the SAME job in place. `system.escalation.{id}.created` fires
|
|
12
|
+
* from the engine automatically.
|
|
9
13
|
*
|
|
10
|
-
* Usage (from within a workflow):
|
|
11
14
|
* ```typescript
|
|
12
|
-
*
|
|
15
|
+
* const decision = await conditionLT<{ approved: boolean }>(signalId, {
|
|
16
|
+
* role: 'reviewer',
|
|
17
|
+
* type: 'orderPipeline',
|
|
18
|
+
* subtype: stationName,
|
|
19
|
+
* priority: 2,
|
|
20
|
+
* description: instructions,
|
|
21
|
+
* metadata: { orderId, station: stationName },
|
|
22
|
+
* envelope: { instructions },
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
13
25
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* // ...
|
|
22
|
-
* });
|
|
26
|
+
* **Legacy (two-step) — no config.** Create the escalation first (e.g. via
|
|
27
|
+
* `ltCreateEscalation`) with `signal_id`/`signal_routing` metadata, then wait.
|
|
28
|
+
* On resume the signal payload carries an injected `$escalation_id`; this helper
|
|
29
|
+
* strips it, resolves the escalation as a durable activity, and returns the
|
|
30
|
+
* clean resolver payload. If no `$escalation_id` is present (efficient path, or
|
|
31
|
+
* a manual signal), the payload is returned as-is — the escalation was already
|
|
32
|
+
* resolved server-side.
|
|
23
33
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* }
|
|
34
|
+
* ```typescript
|
|
35
|
+
* await activities.ltCreateEscalation({ type: 'approval', role: 'reviewer', metadata: { signal_id: signalId } });
|
|
36
|
+
* const decision = await conditionLT<{ approved: boolean }>(signalId);
|
|
28
37
|
* ```
|
|
29
|
-
*
|
|
30
|
-
* If the signal payload does not contain `$escalation_id` (e.g., signaled
|
|
31
|
-
* manually), the function returns the payload as-is without calling
|
|
32
|
-
* the resolve activity.
|
|
33
38
|
*/
|
|
34
|
-
export declare function conditionLT<T = Record<string, any>>(signalId: string): Promise<T>;
|
|
39
|
+
export declare function conditionLT<T = Record<string, any>>(signalId: string, escalation?: Types.ConditionQueueConfig): Promise<T>;
|
|
@@ -40,38 +40,42 @@ const LT_ACTIVITY_QUEUE = 'lt-interceptor';
|
|
|
40
40
|
/**
|
|
41
41
|
* Wait for a signal and resolve the associated escalation automatically.
|
|
42
42
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* activity,
|
|
43
|
+
* Two ways to call it:
|
|
44
|
+
*
|
|
45
|
+
* **Efficient (atomic) — pass an escalation config.** The escalation row is
|
|
46
|
+
* written inside this workflow's Leg1 checkpoint (one commit, crash-safe — no
|
|
47
|
+
* separate create activity, no enrich). `signal_key` is the signal id, so the
|
|
48
|
+
* dashboard resolve endpoint (Path 0), `resolveEscalationBySignalKey`, and any
|
|
49
|
+
* webhook resume the SAME job in place. `system.escalation.{id}.created` fires
|
|
50
|
+
* from the engine automatically.
|
|
48
51
|
*
|
|
49
|
-
* Usage (from within a workflow):
|
|
50
52
|
* ```typescript
|
|
51
|
-
*
|
|
53
|
+
* const decision = await conditionLT<{ approved: boolean }>(signalId, {
|
|
54
|
+
* role: 'reviewer',
|
|
55
|
+
* type: 'orderPipeline',
|
|
56
|
+
* subtype: stationName,
|
|
57
|
+
* priority: 2,
|
|
58
|
+
* description: instructions,
|
|
59
|
+
* metadata: { orderId, station: stationName },
|
|
60
|
+
* envelope: { instructions },
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
52
63
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* // ...
|
|
61
|
-
* });
|
|
64
|
+
* **Legacy (two-step) — no config.** Create the escalation first (e.g. via
|
|
65
|
+
* `ltCreateEscalation`) with `signal_id`/`signal_routing` metadata, then wait.
|
|
66
|
+
* On resume the signal payload carries an injected `$escalation_id`; this helper
|
|
67
|
+
* strips it, resolves the escalation as a durable activity, and returns the
|
|
68
|
+
* clean resolver payload. If no `$escalation_id` is present (efficient path, or
|
|
69
|
+
* a manual signal), the payload is returned as-is — the escalation was already
|
|
70
|
+
* resolved server-side.
|
|
62
71
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* }
|
|
72
|
+
* ```typescript
|
|
73
|
+
* await activities.ltCreateEscalation({ type: 'approval', role: 'reviewer', metadata: { signal_id: signalId } });
|
|
74
|
+
* const decision = await conditionLT<{ approved: boolean }>(signalId);
|
|
67
75
|
* ```
|
|
68
|
-
*
|
|
69
|
-
* If the signal payload does not contain `$escalation_id` (e.g., signaled
|
|
70
|
-
* manually), the function returns the payload as-is without calling
|
|
71
|
-
* the resolve activity.
|
|
72
76
|
*/
|
|
73
|
-
async function conditionLT(signalId) {
|
|
74
|
-
const raw = await hotmesh_1.Durable.workflow.condition(signalId);
|
|
77
|
+
async function conditionLT(signalId, escalation) {
|
|
78
|
+
const raw = await hotmesh_1.Durable.workflow.condition(signalId, escalation);
|
|
75
79
|
const escalationId = raw.$escalation_id;
|
|
76
80
|
if (escalationId) {
|
|
77
81
|
// Resolve the escalation as a durable activity (crash-safe)
|
|
@@ -46,6 +46,7 @@ const hotmesh_1 = require("@hotmeshio/hotmesh");
|
|
|
46
46
|
const db_1 = require("../../lib/db");
|
|
47
47
|
const defaults_1 = require("../../modules/defaults");
|
|
48
48
|
const logger_1 = require("../../lib/logger");
|
|
49
|
+
const system_events_1 = require("../../lib/events/system-events");
|
|
49
50
|
const namespaceService = __importStar(require("../namespace"));
|
|
50
51
|
const deployer_helpers_1 = require("./deployer-helpers");
|
|
51
52
|
// Re-export helpers so existing `import * from './deployer'` consumers keep working
|
|
@@ -67,6 +68,9 @@ async function getEngine(appId) {
|
|
|
67
68
|
engine: {
|
|
68
69
|
connection: (0, db_1.getConnection)(),
|
|
69
70
|
},
|
|
71
|
+
// YAML hook `escalation:` blocks write their row in this engine's Leg1 —
|
|
72
|
+
// wire the sink so those escalation events flow through the eventManager.
|
|
73
|
+
events: system_events_1.systemEventsConfig,
|
|
70
74
|
});
|
|
71
75
|
engines.set(appId, engine);
|
|
72
76
|
return engine;
|
|
@@ -38,6 +38,7 @@ exports.registerAllActiveWorkers = registerAllActiveWorkers;
|
|
|
38
38
|
const hotmesh_1 = require("@hotmeshio/hotmesh");
|
|
39
39
|
const db_1 = require("../../../lib/db");
|
|
40
40
|
const logger_1 = require("../../../lib/logger");
|
|
41
|
+
const system_events_1 = require("../../../lib/events/system-events");
|
|
41
42
|
const ephemeral_1 = require("../../iam/ephemeral");
|
|
42
43
|
const mcpClient = __importStar(require("../../mcp/client"));
|
|
43
44
|
const connection_1 = require("../../mcp/client/connection");
|
|
@@ -267,6 +268,8 @@ async function registerWorkersForWorkflow(workflow) {
|
|
|
267
268
|
},
|
|
268
269
|
},
|
|
269
270
|
workers: workerConfigs,
|
|
271
|
+
// Emit escalation/lifecycle events (incl. YAML hook `escalation:` Leg1 writes).
|
|
272
|
+
events: system_events_1.systemEventsConfig,
|
|
270
273
|
});
|
|
271
274
|
logger_1.loggerRegistry.info(`[yaml-workflow] registered ${workerConfigs.length} workers for ${workflow.app_id}`);
|
|
272
275
|
}
|
package/build/start/index.js
CHANGED
|
@@ -14,6 +14,7 @@ const adapters_1 = require("./adapters");
|
|
|
14
14
|
const workers_1 = require("./workers");
|
|
15
15
|
const server_1 = require("./server");
|
|
16
16
|
const socketio_1 = require("../lib/events/socketio");
|
|
17
|
+
const system_events_1 = require("../lib/events/system-events");
|
|
17
18
|
const nats_1 = require("../lib/events/nats");
|
|
18
19
|
const nats_ws_proxy_1 = require("../lib/events/nats-ws-proxy");
|
|
19
20
|
/**
|
|
@@ -96,7 +97,7 @@ async function start(startConfig) {
|
|
|
96
97
|
}
|
|
97
98
|
// 7. Return instance
|
|
98
99
|
const connection = (0, workers_1.buildConnection)();
|
|
99
|
-
const client = new hotmesh_1.Durable.Client({ connection });
|
|
100
|
+
const client = new hotmesh_1.Durable.Client({ connection, events: system_events_1.systemEventsConfig });
|
|
100
101
|
const shutdown = async () => {
|
|
101
102
|
logger_1.loggerRegistry.info('[long-tail] shutting down...');
|
|
102
103
|
if (httpServer) {
|
package/build/start/workers.js
CHANGED
|
@@ -39,6 +39,8 @@ exports.startWorkers = startWorkers;
|
|
|
39
39
|
const hotmesh_1 = require("@hotmeshio/hotmesh");
|
|
40
40
|
const db_1 = require("../lib/db");
|
|
41
41
|
const interceptor_1 = require("../services/interceptor");
|
|
42
|
+
const escalation_1 = require("../services/escalation");
|
|
43
|
+
const system_events_1 = require("../lib/events/system-events");
|
|
42
44
|
const registry_1 = require("../services/workers/registry");
|
|
43
45
|
const logger_1 = require("../lib/logger");
|
|
44
46
|
const telemetry_1 = require("../lib/telemetry");
|
|
@@ -127,7 +129,12 @@ async function startWorkers(startConfig, workers, builtinMcpServerFactories) {
|
|
|
127
129
|
// Register LT interceptors
|
|
128
130
|
await (0, interceptor_1.registerLT)(connection, {
|
|
129
131
|
defaultRole: startConfig.interceptor?.defaultRole ?? 'reviewer',
|
|
132
|
+
events: system_events_1.systemEventsConfig,
|
|
130
133
|
});
|
|
134
|
+
// Replace the legacy lt_escalations table with a view over the SDK's
|
|
135
|
+
// hmsh_escalations (migrating any rows). Read-path consumers (overview,
|
|
136
|
+
// mcp health, role/agent) and test cleanup depend on the view. Idempotent.
|
|
137
|
+
await (0, escalation_1.ensureEscalationCompatView)();
|
|
131
138
|
// Start each worker
|
|
132
139
|
for (const w of workers) {
|
|
133
140
|
if (w.connection?.readonly) {
|
|
@@ -143,6 +150,11 @@ async function startWorkers(startConfig, workers, builtinMcpServerFactories) {
|
|
|
143
150
|
taskQueue: w.taskQueue,
|
|
144
151
|
workflow: w.workflow,
|
|
145
152
|
guid: `${label}-${hotmesh_1.Durable.guid()}`,
|
|
153
|
+
// Efficient path: a workflow that suspends via condition(signalId, config)
|
|
154
|
+
// writes its escalation row in this worker engine's Leg1 — this hook
|
|
155
|
+
// emits the lifecycle event, mapped into the eventManager. (Disjoint from
|
|
156
|
+
// the service-mediated path, so no duplicate events.)
|
|
157
|
+
events: system_events_1.systemEventsConfig,
|
|
146
158
|
});
|
|
147
159
|
await worker.run();
|
|
148
160
|
(0, registry_1.registerWorker)(w.workflow.name, w.taskQueue);
|
|
@@ -28,9 +28,9 @@ export declare const findTasksSchema: z.ZodObject<{
|
|
|
28
28
|
status?: string | undefined;
|
|
29
29
|
workflow_type?: string | undefined;
|
|
30
30
|
workflow_id?: string | undefined;
|
|
31
|
+
origin_id?: string | undefined;
|
|
31
32
|
limit?: number | undefined;
|
|
32
33
|
offset?: number | undefined;
|
|
33
|
-
origin_id?: string | undefined;
|
|
34
34
|
}>;
|
|
35
35
|
export declare const getProcessDetailSchema: z.ZodObject<{
|
|
36
36
|
origin_id: z.ZodString;
|
|
@@ -15,8 +15,8 @@ export declare const findTasksSchema: z.ZodObject<{
|
|
|
15
15
|
status?: "pending" | "in_progress" | "completed" | "needs_intervention" | "failed" | undefined;
|
|
16
16
|
workflow_type?: string | undefined;
|
|
17
17
|
workflow_id?: string | undefined;
|
|
18
|
-
limit?: number | undefined;
|
|
19
18
|
origin_id?: string | undefined;
|
|
19
|
+
limit?: number | undefined;
|
|
20
20
|
}>;
|
|
21
21
|
export declare const findEscalationsSchema: z.ZodObject<{
|
|
22
22
|
status: z.ZodOptional<z.ZodEnum<["pending", "resolved"]>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../index.ts","../vitest.config.ts","../vitest.integration.config.ts","../adapters/express.ts","../api/agent-subscriptions.ts","../api/agents.ts","../api/auth-sso.ts","../api/auth.ts","../api/bot-accounts.ts","../api/capabilities.ts","../api/controlplane.ts","../api/dba.ts","../api/exports.ts","../api/files.ts","../api/index.ts","../api/insight.ts","../api/knowledge.ts","../api/maintenance.ts","../api/namespaces.ts","../api/overview.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/bulk.ts","../api/escalations/claim.ts","../api/escalations/create.ts","../api/escalations/helpers.ts","../api/escalations/index.ts","../api/escalations/list.ts","../api/escalations/metadata.ts","../api/escalations/resolve.ts","../api/escalations/single.ts","../api/mcp/index.ts","../api/mcp/servers.ts","../api/mcp/tools.ts","../api/workflows/config.ts","../api/workflows/discovery.ts","../api/workflows/index.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/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/pipelines.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/callback.ts","../lib/events/index.ts","../lib/events/matching.ts","../lib/events/memory.ts","../lib/events/nats-ws-proxy.ts","../lib/events/nats.ts","../lib/events/publish.ts","../lib/events/socketio.ts","../lib/logger/index.ts","../lib/logger/pino.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/config.ts","../modules/defaults.ts","../modules/ltconfig.ts","../modules/maintenance.ts","../modules/sso.ts","../modules/utils.ts","../routes/agents.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/docs.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/namespaces.ts","../routes/nats-credentials.ts","../routes/oauth.ts","../routes/overview.ts","../routes/pipelines.ts","../routes/roles.ts","../routes/settings.ts","../routes/tasks.ts","../routes/topics.ts","../routes/users.ts","../routes/workflow-sets.ts","../routes/escalations/bulk.ts","../routes/escalations/index.ts","../routes/escalations/list.ts","../routes/escalations/metadata.ts","../routes/escalations/resolve.ts","../routes/escalations/single.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/process-helpers.ts","../scripts/process.ts","../scripts/token.ts","../sdk/index.ts","../services/dba.ts","../services/hotmesh-utils.ts","../services/workflow-invocation.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/auth/bot-api-key.ts","../services/auth/delegation.ts","../services/auth/index.ts","../services/auth/service-token.ts","../services/auth/sql.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/escalation/bulk.ts","../services/escalation/crud.ts","../services/escalation/index.ts","../services/escalation/queries.ts","../services/escalation/sql.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/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/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/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/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/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/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/index.ts","../services/role/sql.ts","../services/role/types.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/rbac.ts","../services/user/roles.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/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","../start/adapters.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/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/bot-accounts.ts","../system/mcp-servers/admin/controlplane.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/pipelines.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/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","../types/agent.ts","../types/auth.ts","../types/config.ts","../types/delegation.ts","../types/discovery.ts","../types/envelope.ts","../types/escalation-strategy.ts","../types/escalation.ts","../types/events.ts","../types/export.ts","../types/express.d.ts","../types/index.ts","../types/logger.ts","../types/maintenance.ts","../types/mcp.ts","../types/oauth.ts","../types/sdk.ts","../types/startup.ts","../types/task.ts","../types/telemetry.ts","../types/tool-context.ts","../types/user.ts","../types/workflow-set.ts","../types/workflow.ts","../types/yaml-workflow.ts","../workers/index.ts"],"version":"5.9.3"}
|
|
1
|
+
{"root":["../index.ts","../vitest.config.ts","../vitest.integration.config.ts","../adapters/express.ts","../api/agent-subscriptions.ts","../api/agents.ts","../api/auth-sso.ts","../api/auth.ts","../api/bot-accounts.ts","../api/capabilities.ts","../api/controlplane.ts","../api/dba.ts","../api/exports.ts","../api/files.ts","../api/index.ts","../api/insight.ts","../api/knowledge.ts","../api/maintenance.ts","../api/namespaces.ts","../api/overview.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/bulk.ts","../api/escalations/claim.ts","../api/escalations/create.ts","../api/escalations/helpers.ts","../api/escalations/index.ts","../api/escalations/list.ts","../api/escalations/metadata.ts","../api/escalations/resolve.ts","../api/escalations/single.ts","../api/mcp/index.ts","../api/mcp/servers.ts","../api/mcp/tools.ts","../api/workflows/config.ts","../api/workflows/discovery.ts","../api/workflows/index.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/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/pipelines.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/callback.ts","../lib/events/index.ts","../lib/events/matching.ts","../lib/events/memory.ts","../lib/events/nats-ws-proxy.ts","../lib/events/nats.ts","../lib/events/publish.ts","../lib/events/socketio.ts","../lib/events/system-events.ts","../lib/logger/index.ts","../lib/logger/pino.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/config.ts","../modules/defaults.ts","../modules/ltconfig.ts","../modules/maintenance.ts","../modules/sso.ts","../modules/utils.ts","../routes/agents.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/docs.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/namespaces.ts","../routes/nats-credentials.ts","../routes/oauth.ts","../routes/overview.ts","../routes/pipelines.ts","../routes/roles.ts","../routes/settings.ts","../routes/tasks.ts","../routes/topics.ts","../routes/users.ts","../routes/workflow-sets.ts","../routes/escalations/bulk.ts","../routes/escalations/index.ts","../routes/escalations/list.ts","../routes/escalations/metadata.ts","../routes/escalations/resolve.ts","../routes/escalations/single.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/process-helpers.ts","../scripts/process.ts","../scripts/token.ts","../sdk/index.ts","../services/dba.ts","../services/hotmesh-utils.ts","../services/workflow-invocation.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/auth/bot-api-key.ts","../services/auth/delegation.ts","../services/auth/index.ts","../services/auth/service-token.ts","../services/auth/sql.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/escalation/bulk.ts","../services/escalation/client.ts","../services/escalation/crud.ts","../services/escalation/index.ts","../services/escalation/map.ts","../services/escalation/queries.ts","../services/escalation/sql.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/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/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/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/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/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/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/index.ts","../services/role/sql.ts","../services/role/types.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/rbac.ts","../services/user/roles.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/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","../start/adapters.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/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/bot-accounts.ts","../system/mcp-servers/admin/controlplane.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/pipelines.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/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","../types/agent.ts","../types/auth.ts","../types/config.ts","../types/delegation.ts","../types/discovery.ts","../types/envelope.ts","../types/escalation-strategy.ts","../types/escalation.ts","../types/events.ts","../types/export.ts","../types/express.d.ts","../types/index.ts","../types/logger.ts","../types/maintenance.ts","../types/mcp.ts","../types/oauth.ts","../types/sdk.ts","../types/startup.ts","../types/task.ts","../types/telemetry.ts","../types/tool-context.ts","../types/user.ts","../types/workflow-set.ts","../types/workflow.ts","../types/yaml-workflow.ts","../workers/index.ts"],"version":"5.9.3"}
|
|
@@ -215,8 +215,27 @@ The workflow is responsible for resolving the escalation. The `conditionLT()` he
|
|
|
215
215
|
|
|
216
216
|
If you use raw `Durable.workflow.condition()` instead, you must resolve the escalation yourself using the `$escalation_id` from the signal data.
|
|
217
217
|
|
|
218
|
+
### Signal-key resolution (efficient/atomic — `signal_key`)
|
|
219
|
+
|
|
220
|
+
When an escalation was written atomically by `conditionLT(signalId, config)` (or `Durable.workflow.condition(signalId, config)`), the row carries a `signal_key` and no `signal_id`/`signal_routing` metadata. The resolve endpoint detects `signal_key` and resolves it through the SDK: the resolve marks the row resolved **and** delivers the signal to the waiting `condition()` in one transaction, so the original job resumes in place — no re-run, no separate resolve activity. `system.escalation.{id}.resolved` fires.
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
POST /api/escalations/resolve-by-signal-key
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
For callers that know the deterministic signal id (webhooks — e.g. `signal-scan-ar-${orderId}`) and want to skip the id lookup.
|
|
227
|
+
|
|
228
|
+
| Field | Type | Required | Description |
|
|
229
|
+
|-------|------|----------|-------------|
|
|
230
|
+
| `signalKey` | `string` | yes | The signal id passed to `conditionLT(signalId, config)` |
|
|
231
|
+
| `resolverPayload` | `object` | yes | The decision payload delivered to the waiting workflow |
|
|
232
|
+
|
|
233
|
+
Returns `404` when the key is unknown, `409` when the escalation is already terminal, and `200 { signaled: true }` on success. RBAC-scoped to the caller's visible roles.
|
|
234
|
+
|
|
218
235
|
### What happens during resolution
|
|
219
236
|
|
|
237
|
+
> Applies to the **re-run** path (an escalation with no `signal_id`, `signal_routing`, or `signal_key`). Signal-based and signal-key escalations resume the live workflow in place, as described above.
|
|
238
|
+
|
|
220
239
|
1. The route reads the escalation record and verifies it is still `pending`.
|
|
221
240
|
2. It reconstructs the original workflow envelope from the escalation's `envelope` field (or from the parent task if the escalation envelope is missing).
|
|
222
241
|
3. It injects `resolver` (the reviewer's payload) and `lt.escalationId` into the envelope.
|
|
@@ -279,6 +279,39 @@ const result = await lt.escalations.resolve({
|
|
|
279
279
|
|
|
280
280
|
Wait for a signal and automatically resolve the associated escalation. This is the counterpart to `executeLT` — where `executeLT` wraps `startChild` + `condition`, `conditionLT` wraps `condition` + escalation resolution.
|
|
281
281
|
|
|
282
|
+
```typescript
|
|
283
|
+
conditionLT<T>(signalId: string, escalation?: ConditionQueueConfig): Promise<T>
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### Atomic form (recommended)
|
|
287
|
+
|
|
288
|
+
Pass an escalation config as the second argument. The escalation row is written inside the workflow's Leg1 checkpoint — one commit, crash-safe: no separate `ltCreateEscalation` activity, no enrich step. `signal_key` is set to `signalId`, so the dashboard resolve endpoint (resolve-by-id → Path 0) and `POST /escalations/resolve-by-signal-key` resume *this* job in place, and `system.escalation.{id}.created` fires automatically.
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
import { conditionLT } from '@hotmeshio/long-tail';
|
|
292
|
+
|
|
293
|
+
export async function stationWorker(envelope: LTEnvelope) {
|
|
294
|
+
const ctx = Durable.workflow.workflowInfo();
|
|
295
|
+
const signalId = `station-done-${ctx.workflowId}`;
|
|
296
|
+
|
|
297
|
+
const decision = await conditionLT<{ approved: boolean }>(signalId, {
|
|
298
|
+
role: 'qc-inspector',
|
|
299
|
+
type: 'orderPipeline',
|
|
300
|
+
subtype: 'qc',
|
|
301
|
+
priority: 2,
|
|
302
|
+
description: 'Inspect the order and approve',
|
|
303
|
+
workflowType: 'stationWorker',
|
|
304
|
+
metadata: { orderId: envelope.data.orderId, station: 'qc' },
|
|
305
|
+
envelope: { instructions: 'Review and approve or reject' },
|
|
306
|
+
});
|
|
307
|
+
// decision is clean — the escalation was resolved by the resolve endpoint
|
|
308
|
+
}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Two-step form
|
|
312
|
+
|
|
313
|
+
Create the escalation first (e.g. to enrich routing metadata), then wait:
|
|
314
|
+
|
|
282
315
|
```typescript
|
|
283
316
|
import { conditionLT } from '@hotmeshio/long-tail';
|
|
284
317
|
|
package/docs/hitl-guide.md
CHANGED
|
@@ -31,7 +31,50 @@ Durable Workflow Long-tail Platform Dashboard
|
|
|
31
31
|
|
|
32
32
|
### Pattern 1: `conditionLT` Signal (Recommended)
|
|
33
33
|
|
|
34
|
-
The workflow stays running and waits for a signal. Lightweight, no re-run needed.
|
|
34
|
+
The workflow stays running and waits for a signal. Lightweight, no re-run needed. Two forms — prefer the atomic one.
|
|
35
|
+
|
|
36
|
+
#### Atomic form (recommended)
|
|
37
|
+
|
|
38
|
+
Pass an escalation config to `conditionLT`. The escalation row is written inside the workflow's Leg1 checkpoint — one commit, crash-safe: no separate create activity, no enrich step. `signal_key` is the resume key, so the dashboard resolve endpoint and `POST /escalations/resolve-by-signal-key` both resume *this* job in place, and `system.escalation.{id}.created` fires automatically.
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { conditionLT } from '@hotmeshio/long-tail';
|
|
42
|
+
|
|
43
|
+
export async function approvalWorkflow(envelope: LTEnvelope) {
|
|
44
|
+
const ctx = Durable.workflow.workflowInfo();
|
|
45
|
+
const signalId = `approval-${ctx.workflowId}`;
|
|
46
|
+
|
|
47
|
+
// One atomic expression: write the escalation in Leg1, then pause.
|
|
48
|
+
const decision = await conditionLT<{ approved: boolean; notes?: string }>(signalId, {
|
|
49
|
+
role: 'finance-reviewer',
|
|
50
|
+
type: 'approval',
|
|
51
|
+
subtype: 'budget-request',
|
|
52
|
+
priority: 2,
|
|
53
|
+
description: `Budget approval needed: $${envelope.data.amount}`,
|
|
54
|
+
metadata: {
|
|
55
|
+
form_schema: {
|
|
56
|
+
title: 'Budget Approval',
|
|
57
|
+
properties: {
|
|
58
|
+
approved: { type: 'boolean', description: 'Approve this request?' },
|
|
59
|
+
notes: { type: 'string', format: 'textarea' },
|
|
60
|
+
},
|
|
61
|
+
required: ['approved'],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
envelope: { data: envelope.data },
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
if (decision.approved) {
|
|
68
|
+
// ... proceed with approved flow ...
|
|
69
|
+
} else {
|
|
70
|
+
// ... handle rejection ...
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### Two-step form
|
|
76
|
+
|
|
77
|
+
When you need to create the escalation separately — for example to enrich routing metadata before pausing — create it first, then wait:
|
|
35
78
|
|
|
36
79
|
```typescript
|
|
37
80
|
import { conditionLT } from 'long-tail/orchestrator';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotmeshio/long-tail",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
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",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@anthropic-ai/sdk": "^0.92.0",
|
|
71
71
|
"@aws-sdk/client-s3": "^3.1017.0",
|
|
72
72
|
"@aws-sdk/s3-request-presigner": "^3.1045.0",
|
|
73
|
-
"@hotmeshio/hotmesh": "^0.
|
|
73
|
+
"@hotmeshio/hotmesh": "^0.22.5",
|
|
74
74
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
75
75
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.215.0",
|
|
76
76
|
"@opentelemetry/resources": "^2.5.1",
|