@loxtep/sdk 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -0
- package/dist/authoring/agent.d.ts +164 -0
- package/dist/authoring/agent.d.ts.map +1 -0
- package/dist/authoring/agent.js +376 -0
- package/dist/authoring/agent.js.map +1 -0
- package/dist/authoring/compiler.d.ts +98 -0
- package/dist/authoring/compiler.d.ts.map +1 -0
- package/dist/authoring/compiler.js +156 -0
- package/dist/authoring/compiler.js.map +1 -0
- package/dist/authoring/define-data-workflow.d.ts +24 -0
- package/dist/authoring/define-data-workflow.d.ts.map +1 -0
- package/dist/authoring/define-data-workflow.js +93 -0
- package/dist/authoring/define-data-workflow.js.map +1 -0
- package/dist/authoring/index.d.ts +19 -0
- package/dist/authoring/index.d.ts.map +1 -0
- package/dist/authoring/index.js +15 -0
- package/dist/authoring/index.js.map +1 -0
- package/dist/authoring/toolbox.d.ts +133 -0
- package/dist/authoring/toolbox.d.ts.map +1 -0
- package/dist/authoring/toolbox.js +166 -0
- package/dist/authoring/toolbox.js.map +1 -0
- package/dist/authoring/triggers.d.ts +41 -0
- package/dist/authoring/triggers.d.ts.map +1 -0
- package/dist/authoring/triggers.js +60 -0
- package/dist/authoring/triggers.js.map +1 -0
- package/dist/authoring/types.d.ts +64 -0
- package/dist/authoring/types.d.ts.map +1 -0
- package/dist/authoring/types.js +9 -0
- package/dist/authoring/types.js.map +1 -0
- package/dist/cli/commands/activity-cmd.d.ts +28 -0
- package/dist/cli/commands/activity-cmd.d.ts.map +1 -0
- package/dist/cli/commands/activity-cmd.js +78 -0
- package/dist/cli/commands/activity-cmd.js.map +1 -0
- package/dist/cli/commands/attach-cmd.d.ts +38 -0
- package/dist/cli/commands/attach-cmd.d.ts.map +1 -0
- package/dist/cli/commands/attach-cmd.js +141 -0
- package/dist/cli/commands/attach-cmd.js.map +1 -0
- package/dist/cli/commands/deploy-cmd.d.ts +101 -0
- package/dist/cli/commands/deploy-cmd.d.ts.map +1 -0
- package/dist/cli/commands/deploy-cmd.js +461 -0
- package/dist/cli/commands/deploy-cmd.js.map +1 -0
- package/dist/cli/commands/generate-cmd.d.ts +35 -0
- package/dist/cli/commands/generate-cmd.d.ts.map +1 -0
- package/dist/cli/commands/generate-cmd.js +134 -0
- package/dist/cli/commands/generate-cmd.js.map +1 -0
- package/dist/cli/commands/improvements-cmd.d.ts +44 -0
- package/dist/cli/commands/improvements-cmd.d.ts.map +1 -0
- package/dist/cli/commands/improvements-cmd.js +215 -0
- package/dist/cli/commands/improvements-cmd.js.map +1 -0
- package/dist/cli/commands/init-cmd.d.ts +78 -0
- package/dist/cli/commands/init-cmd.d.ts.map +1 -0
- package/dist/cli/commands/init-cmd.js +250 -0
- package/dist/cli/commands/init-cmd.js.map +1 -0
- package/dist/cli/commands/test-cmd.d.ts +89 -0
- package/dist/cli/commands/test-cmd.d.ts.map +1 -0
- package/dist/cli/commands/test-cmd.js +378 -0
- package/dist/cli/commands/test-cmd.js.map +1 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +146 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/project-context.d.ts +153 -0
- package/dist/cli/project-context.d.ts.map +1 -0
- package/dist/cli/project-context.js +190 -0
- package/dist/cli/project-context.js.map +1 -0
- package/dist/client/activity-types.d.ts +66 -0
- package/dist/client/activity-types.d.ts.map +1 -0
- package/dist/client/activity-types.js +9 -0
- package/dist/client/activity-types.js.map +1 -0
- package/dist/client/activity.d.ts +22 -0
- package/dist/client/activity.d.ts.map +1 -0
- package/dist/client/activity.js +43 -0
- package/dist/client/activity.js.map +1 -0
- package/dist/client/data-products.d.ts.map +1 -1
- package/dist/client/data-products.js +4 -98
- package/dist/client/data-products.js.map +1 -1
- package/dist/client/flow-types.d.ts +4 -2
- package/dist/client/flow-types.d.ts.map +1 -1
- package/dist/client/flows.d.ts +1 -1
- package/dist/client/flows.d.ts.map +1 -1
- package/dist/client/flows.js +49 -124
- package/dist/client/flows.js.map +1 -1
- package/dist/client/improvements-types.d.ts +55 -0
- package/dist/client/improvements-types.d.ts.map +1 -0
- package/dist/client/improvements-types.js +9 -0
- package/dist/client/improvements-types.js.map +1 -0
- package/dist/client/improvements.d.ts +29 -0
- package/dist/client/improvements.d.ts.map +1 -0
- package/dist/client/improvements.js +50 -0
- package/dist/client/improvements.js.map +1 -0
- package/dist/client/index.d.ts +6 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/loxtep-client.d.ts +45 -0
- package/dist/client/loxtep-client.d.ts.map +1 -1
- package/dist/client/loxtep-client.js +68 -0
- package/dist/client/loxtep-client.js.map +1 -1
- package/dist/client/projects-types.d.ts +25 -0
- package/dist/client/projects-types.d.ts.map +1 -1
- package/dist/client/projects.d.ts +2 -1
- package/dist/client/projects.d.ts.map +1 -1
- package/dist/client/projects.js +17 -0
- package/dist/client/projects.js.map +1 -1
- package/dist/client/queue-types.d.ts +15 -2
- package/dist/client/queue-types.d.ts.map +1 -1
- package/dist/client/queues.d.ts.map +1 -1
- package/dist/client/queues.js +3 -14
- package/dist/client/queues.js.map +1 -1
- package/dist/codegen/emit.d.ts +25 -0
- package/dist/codegen/emit.d.ts.map +1 -0
- package/dist/codegen/emit.js +158 -0
- package/dist/codegen/emit.js.map +1 -0
- package/dist/codegen/index.d.ts +17 -0
- package/dist/codegen/index.d.ts.map +1 -0
- package/dist/codegen/index.js +16 -0
- package/dist/codegen/index.js.map +1 -0
- package/dist/codegen/load-workspace-context.d.ts +30 -0
- package/dist/codegen/load-workspace-context.d.ts.map +1 -0
- package/dist/codegen/load-workspace-context.js +127 -0
- package/dist/codegen/load-workspace-context.js.map +1 -0
- package/dist/codegen/normalize.d.ts +35 -0
- package/dist/codegen/normalize.d.ts.map +1 -0
- package/dist/codegen/normalize.js +77 -0
- package/dist/codegen/normalize.js.map +1 -0
- package/dist/codegen/types.d.ts +89 -0
- package/dist/codegen/types.d.ts.map +1 -0
- package/dist/codegen/types.js +9 -0
- package/dist/codegen/types.js.map +1 -0
- package/dist/codegen/write-artifact.d.ts +40 -0
- package/dist/codegen/write-artifact.d.ts.map +1 -0
- package/dist/codegen/write-artifact.js +74 -0
- package/dist/codegen/write-artifact.js.map +1 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/workspace-config.d.ts +76 -0
- package/dist/config/workspace-config.d.ts.map +1 -0
- package/dist/config/workspace-config.js +129 -0
- package/dist/config/workspace-config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/rstreams/event-bridge.d.ts +16 -2
- package/dist/rstreams/event-bridge.d.ts.map +1 -1
- package/dist/rstreams/event-bridge.js +38 -5
- package/dist/rstreams/event-bridge.js.map +1 -1
- package/dist/skills/check-scope.d.ts +42 -0
- package/dist/skills/check-scope.d.ts.map +1 -0
- package/dist/skills/check-scope.js +84 -0
- package/dist/skills/check-scope.js.map +1 -0
- package/dist/skills/index.d.ts +14 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +12 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/loader.d.ts +79 -0
- package/dist/skills/loader.d.ts.map +1 -0
- package/dist/skills/loader.js +102 -0
- package/dist/skills/loader.js.map +1 -0
- package/dist/skills/types.d.ts +55 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js +9 -0
- package/dist/skills/types.js.map +1 -0
- package/dist/skills/validate-references.d.ts +54 -0
- package/dist/skills/validate-references.d.ts.map +1 -0
- package/dist/skills/validate-references.js +80 -0
- package/dist/skills/validate-references.js.map +1 -0
- package/package.json +5 -3
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI: loxtep test <module> --event <file> — local execution with approval prompts.
|
|
3
|
+
*
|
|
4
|
+
* Steps:
|
|
5
|
+
* 1. Call requireAttachedProject() to verify preconditions (R1.7, R1.10)
|
|
6
|
+
* 2. Load the named module from `workflows/<name>.ts` (dynamic import)
|
|
7
|
+
* 3. Read the event file (JSON)
|
|
8
|
+
* 4. Set up a HandlerContext with toolbox + agent from the SDK authoring
|
|
9
|
+
* 5. Execute the handler with the event and context
|
|
10
|
+
* 6. For guarded operations (requireApproval), prompt in the terminal (≤300s)
|
|
11
|
+
* 7. On approval: execute; on reject/timeout: skip, leave unchanged, record
|
|
12
|
+
* 8. Print the resulting action trace
|
|
13
|
+
*
|
|
14
|
+
* Requirements: 1.5, 6.2, 6.3
|
|
15
|
+
*/
|
|
16
|
+
import { type Interface as ReadlineInterface } from 'node:readline';
|
|
17
|
+
import { type CliResult } from '../project-context.js';
|
|
18
|
+
import { type Toolbox } from '../../authoring/toolbox.js';
|
|
19
|
+
import { ActionTrace } from '../../authoring/agent.js';
|
|
20
|
+
/**
|
|
21
|
+
* Prompt the user in the terminal for approval of a guarded operation.
|
|
22
|
+
* Resolves to `true` if approved, `false` if rejected or timed out.
|
|
23
|
+
*
|
|
24
|
+
* @param operationName - The guarded operation name to display.
|
|
25
|
+
* @param targetResource - The target resource to display.
|
|
26
|
+
* @param rl - readline interface (injectable for testing).
|
|
27
|
+
* @returns Whether the operation was approved.
|
|
28
|
+
*/
|
|
29
|
+
export declare function promptApproval(operationName: string, targetResource: string, rl?: ReadlineInterface): Promise<{
|
|
30
|
+
approved: boolean;
|
|
31
|
+
timedOut: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Wraps a toolbox so that operations listed in `requireApproval` prompt the user
|
|
35
|
+
* before executing. On rejection or timeout, the operation is skipped, the target
|
|
36
|
+
* resource is left unchanged, and the outcome is recorded in the action trace.
|
|
37
|
+
*
|
|
38
|
+
* @param toolbox - The underlying toolbox.
|
|
39
|
+
* @param guardedOps - Set of operation names that require approval.
|
|
40
|
+
* @param trace - Action trace to record outcomes.
|
|
41
|
+
* @param promptFn - Injectable approval prompt (defaults to terminal prompt).
|
|
42
|
+
* @returns A wrapped toolbox with approval guards.
|
|
43
|
+
*/
|
|
44
|
+
export declare function createApprovalGuardedToolbox(toolbox: Toolbox, guardedOps: Set<string>, trace: ActionTrace, promptFn?: (opName: string, target: string) => Promise<{
|
|
45
|
+
approved: boolean;
|
|
46
|
+
timedOut: boolean;
|
|
47
|
+
}>): Toolbox;
|
|
48
|
+
/**
|
|
49
|
+
* Thrown when a guarded operation is skipped due to rejection or timeout.
|
|
50
|
+
* This is a flow-control mechanism — it's caught by the test runner and the
|
|
51
|
+
* handler continues executing remaining operations (non-fatal for the handler).
|
|
52
|
+
*/
|
|
53
|
+
export declare class GuardedOperationSkipped extends Error {
|
|
54
|
+
readonly operationName: string;
|
|
55
|
+
readonly targetResource: string;
|
|
56
|
+
readonly timedOut: boolean;
|
|
57
|
+
constructor(operationName: string, targetResource: string, timedOut: boolean);
|
|
58
|
+
}
|
|
59
|
+
export interface TestCommandOptions {
|
|
60
|
+
/** Working directory (defaults to process.cwd()). */
|
|
61
|
+
cwd?: string;
|
|
62
|
+
/** Module name to test. */
|
|
63
|
+
moduleName: string;
|
|
64
|
+
/** Path to the event file (JSON). */
|
|
65
|
+
eventFile: string;
|
|
66
|
+
/** Injectable approval prompt function (for testing). */
|
|
67
|
+
promptFn?: (opName: string, target: string) => Promise<{
|
|
68
|
+
approved: boolean;
|
|
69
|
+
timedOut: boolean;
|
|
70
|
+
}>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Execute the `loxtep test <module> --event <file>` command.
|
|
74
|
+
*
|
|
75
|
+
* Loads one Data_Workflow_Module by name, executes its handler locally against
|
|
76
|
+
* the attached instance with the sample event, prints the action trace.
|
|
77
|
+
* Guarded operations prompt in the terminal (≤300s) and execute only on approval.
|
|
78
|
+
* On rejection/timeout: skip, leave unchanged, record in trace (R6.2, R6.3).
|
|
79
|
+
*
|
|
80
|
+
* @param options - Command options.
|
|
81
|
+
* @returns Structured CLI result for testability.
|
|
82
|
+
*/
|
|
83
|
+
export declare function runTestCommand(options: TestCommandOptions): Promise<CliResult>;
|
|
84
|
+
/**
|
|
85
|
+
* CLI entry point for `loxtep test`.
|
|
86
|
+
* Parses args, prints output, and sets process.exitCode from the structured result.
|
|
87
|
+
*/
|
|
88
|
+
export declare function runTest(): Promise<void>;
|
|
89
|
+
//# sourceMappingURL=test-cmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-cmd.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/test-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAmB,KAAK,SAAS,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAyB,MAAM,0BAA0B,CAAC;AAQ9E;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,EAAE,CAAC,EAAE,iBAAiB,GACrB,OAAO,CAAC;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC,CAmCnD;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,EACvB,KAAK,EAAE,WAAW,EAClB,QAAQ,GAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAkB,GAC/G,OAAO,CAkIT;AAID;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;gBAEf,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO;CAY7E;AAgED,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAClG;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC,CAmHpF;AAED;;;GAGG;AACH,wBAAsB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CA6B7C"}
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI: loxtep test <module> --event <file> — local execution with approval prompts.
|
|
3
|
+
*
|
|
4
|
+
* Steps:
|
|
5
|
+
* 1. Call requireAttachedProject() to verify preconditions (R1.7, R1.10)
|
|
6
|
+
* 2. Load the named module from `workflows/<name>.ts` (dynamic import)
|
|
7
|
+
* 3. Read the event file (JSON)
|
|
8
|
+
* 4. Set up a HandlerContext with toolbox + agent from the SDK authoring
|
|
9
|
+
* 5. Execute the handler with the event and context
|
|
10
|
+
* 6. For guarded operations (requireApproval), prompt in the terminal (≤300s)
|
|
11
|
+
* 7. On approval: execute; on reject/timeout: skip, leave unchanged, record
|
|
12
|
+
* 8. Print the resulting action trace
|
|
13
|
+
*
|
|
14
|
+
* Requirements: 1.5, 6.2, 6.3
|
|
15
|
+
*/
|
|
16
|
+
import { readFileSync } from 'node:fs';
|
|
17
|
+
import { join, resolve } from 'node:path';
|
|
18
|
+
import { createInterface } from 'node:readline';
|
|
19
|
+
import { requireAttachedProject, preconditionToCliResult, } from '../project-context.js';
|
|
20
|
+
import { requireCliClient } from '../create-cli-client.js';
|
|
21
|
+
import { createToolbox } from '../../authoring/toolbox.js';
|
|
22
|
+
import { ActionTrace } from '../../authoring/agent.js';
|
|
23
|
+
// ─── Approval prompt helpers ─────────────────────────────────────────────────
|
|
24
|
+
/** Timeout for approval prompts in milliseconds (300 seconds per R6.2, R6.3). */
|
|
25
|
+
const APPROVAL_TIMEOUT_MS = 300_000;
|
|
26
|
+
/**
|
|
27
|
+
* Prompt the user in the terminal for approval of a guarded operation.
|
|
28
|
+
* Resolves to `true` if approved, `false` if rejected or timed out.
|
|
29
|
+
*
|
|
30
|
+
* @param operationName - The guarded operation name to display.
|
|
31
|
+
* @param targetResource - The target resource to display.
|
|
32
|
+
* @param rl - readline interface (injectable for testing).
|
|
33
|
+
* @returns Whether the operation was approved.
|
|
34
|
+
*/
|
|
35
|
+
export async function promptApproval(operationName, targetResource, rl) {
|
|
36
|
+
const ownRl = !rl;
|
|
37
|
+
const readline = rl ?? createInterface({
|
|
38
|
+
input: process.stdin,
|
|
39
|
+
output: process.stderr,
|
|
40
|
+
});
|
|
41
|
+
return new Promise((resolvePromise) => {
|
|
42
|
+
let settled = false;
|
|
43
|
+
const settle = (approved, timedOut) => {
|
|
44
|
+
if (settled)
|
|
45
|
+
return;
|
|
46
|
+
settled = true;
|
|
47
|
+
clearTimeout(timer);
|
|
48
|
+
if (ownRl)
|
|
49
|
+
readline.close();
|
|
50
|
+
resolvePromise({ approved, timedOut });
|
|
51
|
+
};
|
|
52
|
+
// Timeout after 300 seconds (R6.3)
|
|
53
|
+
const timer = setTimeout(() => {
|
|
54
|
+
settle(false, true);
|
|
55
|
+
}, APPROVAL_TIMEOUT_MS);
|
|
56
|
+
// Use stderr for prompts so stdout remains clean for trace output
|
|
57
|
+
const prompt = `\n⚠️ Guarded operation requires approval:\n` +
|
|
58
|
+
` Operation: ${operationName}\n` +
|
|
59
|
+
` Target: ${targetResource}\n` +
|
|
60
|
+
` Approve? (y/n, 300s timeout): `;
|
|
61
|
+
readline.question(prompt, (answer) => {
|
|
62
|
+
const normalized = answer.trim().toLowerCase();
|
|
63
|
+
const approved = normalized === 'y' || normalized === 'yes';
|
|
64
|
+
settle(approved, false);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
// ─── Guarded toolbox wrapper ─────────────────────────────────────────────────
|
|
69
|
+
/**
|
|
70
|
+
* Wraps a toolbox so that operations listed in `requireApproval` prompt the user
|
|
71
|
+
* before executing. On rejection or timeout, the operation is skipped, the target
|
|
72
|
+
* resource is left unchanged, and the outcome is recorded in the action trace.
|
|
73
|
+
*
|
|
74
|
+
* @param toolbox - The underlying toolbox.
|
|
75
|
+
* @param guardedOps - Set of operation names that require approval.
|
|
76
|
+
* @param trace - Action trace to record outcomes.
|
|
77
|
+
* @param promptFn - Injectable approval prompt (defaults to terminal prompt).
|
|
78
|
+
* @returns A wrapped toolbox with approval guards.
|
|
79
|
+
*/
|
|
80
|
+
export function createApprovalGuardedToolbox(toolbox, guardedOps, trace, promptFn = promptApproval) {
|
|
81
|
+
/**
|
|
82
|
+
* Wrap a toolbox method with the approval guard:
|
|
83
|
+
* - If the operation name is in guardedOps, prompt for approval.
|
|
84
|
+
* - On approval: execute and record success/failure.
|
|
85
|
+
* - On rejection/timeout: skip, leave unchanged, record the skip (R6.3).
|
|
86
|
+
*/
|
|
87
|
+
function guardMethod(opName, targetFn, fn) {
|
|
88
|
+
return async (...args) => {
|
|
89
|
+
const target = targetFn(args);
|
|
90
|
+
if (guardedOps.has(opName)) {
|
|
91
|
+
const { approved, timedOut } = await promptFn(opName, target);
|
|
92
|
+
if (!approved) {
|
|
93
|
+
// R6.3: Skip the operation, leave target unchanged, record the outcome
|
|
94
|
+
const outcome = timedOut ? 'timeout_skipped' : 'rejected_skipped';
|
|
95
|
+
trace.record({
|
|
96
|
+
kind: 'toolbox',
|
|
97
|
+
operationName: opName,
|
|
98
|
+
targetResource: target,
|
|
99
|
+
startedAt: new Date().toISOString(),
|
|
100
|
+
completedAt: new Date().toISOString(),
|
|
101
|
+
outcome: 'failed',
|
|
102
|
+
error: timedOut
|
|
103
|
+
? 'Guarded operation skipped: approval timed out (300s)'
|
|
104
|
+
: 'Guarded operation skipped: rejected by user',
|
|
105
|
+
});
|
|
106
|
+
throw new GuardedOperationSkipped(opName, target, timedOut);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// Execute the actual operation and trace it
|
|
110
|
+
const startedAt = new Date().toISOString();
|
|
111
|
+
try {
|
|
112
|
+
const result = await fn(...args);
|
|
113
|
+
trace.record({
|
|
114
|
+
kind: 'toolbox',
|
|
115
|
+
operationName: opName,
|
|
116
|
+
targetResource: target,
|
|
117
|
+
startedAt,
|
|
118
|
+
completedAt: new Date().toISOString(),
|
|
119
|
+
outcome: 'succeeded',
|
|
120
|
+
});
|
|
121
|
+
return result;
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
if (err instanceof GuardedOperationSkipped)
|
|
125
|
+
throw err;
|
|
126
|
+
trace.record({
|
|
127
|
+
kind: 'toolbox',
|
|
128
|
+
operationName: opName,
|
|
129
|
+
targetResource: target,
|
|
130
|
+
startedAt,
|
|
131
|
+
completedAt: new Date().toISOString(),
|
|
132
|
+
outcome: 'failed',
|
|
133
|
+
error: err instanceof Error ? err.message : String(err),
|
|
134
|
+
});
|
|
135
|
+
throw err;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
dataProducts: {
|
|
141
|
+
write: guardMethod('dataProducts.write', (args) => args[0]?.name ?? 'unknown', (ref, event) => toolbox.dataProducts.write(ref, event)),
|
|
142
|
+
query: guardMethod('dataProducts.query', (args) => args[0]?.name ?? 'unknown', (ref, sql) => toolbox.dataProducts.query(ref, sql)),
|
|
143
|
+
get: guardMethod('dataProducts.get', (args) => args[0]?.name ?? 'unknown', (ref) => toolbox.dataProducts.get(ref)),
|
|
144
|
+
list: guardMethod('dataProducts.list', () => '*', (filters) => toolbox.dataProducts.list(filters)),
|
|
145
|
+
},
|
|
146
|
+
queues: {
|
|
147
|
+
write: guardMethod('queues.write', (args) => args[0]?.name ?? 'unknown', (ref, event) => toolbox.queues.write(ref, event)),
|
|
148
|
+
getMetadata: guardMethod('queues.getMetadata', (args) => args[0]?.name ?? 'unknown', (ref) => toolbox.queues.getMetadata(ref)),
|
|
149
|
+
},
|
|
150
|
+
connections: {
|
|
151
|
+
list: guardMethod('connections.list', () => '*', () => toolbox.connections.list()),
|
|
152
|
+
get: guardMethod('connections.get', (args) => args[0] ?? 'unknown', (id) => toolbox.connections.get(id)),
|
|
153
|
+
test: guardMethod('connections.test', (args) => args[0] ?? 'unknown', (id) => toolbox.connections.test(id)),
|
|
154
|
+
},
|
|
155
|
+
workflows: {
|
|
156
|
+
list: guardMethod('workflows.list', () => '*', () => toolbox.workflows.list()),
|
|
157
|
+
getGraph: guardMethod('workflows.getGraph', (args) => args[0]?.name ?? 'unknown', (ref) => toolbox.workflows.getGraph(ref)),
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
// ─── Error for skipped guarded operations ────────────────────────────────────
|
|
162
|
+
/**
|
|
163
|
+
* Thrown when a guarded operation is skipped due to rejection or timeout.
|
|
164
|
+
* This is a flow-control mechanism — it's caught by the test runner and the
|
|
165
|
+
* handler continues executing remaining operations (non-fatal for the handler).
|
|
166
|
+
*/
|
|
167
|
+
export class GuardedOperationSkipped extends Error {
|
|
168
|
+
operationName;
|
|
169
|
+
targetResource;
|
|
170
|
+
timedOut;
|
|
171
|
+
constructor(operationName, targetResource, timedOut) {
|
|
172
|
+
super(timedOut
|
|
173
|
+
? `Guarded operation "${operationName}" on "${targetResource}" skipped: approval timed out (300s)`
|
|
174
|
+
: `Guarded operation "${operationName}" on "${targetResource}" skipped: rejected by user`);
|
|
175
|
+
this.name = 'GuardedOperationSkipped';
|
|
176
|
+
this.operationName = operationName;
|
|
177
|
+
this.targetResource = targetResource;
|
|
178
|
+
this.timedOut = timedOut;
|
|
179
|
+
Object.setPrototypeOf(this, GuardedOperationSkipped.prototype);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// ─── Module loader ───────────────────────────────────────────────────────────
|
|
183
|
+
/**
|
|
184
|
+
* Attempt to dynamically import a Data_Workflow_Module by name from the
|
|
185
|
+
* `workflows/` directory relative to the project root.
|
|
186
|
+
*
|
|
187
|
+
* Tries `.ts` first, then `.js`, then no extension.
|
|
188
|
+
*/
|
|
189
|
+
async function loadWorkflowModule(projectDir, moduleName) {
|
|
190
|
+
const workflowsDir = join(projectDir, 'workflows');
|
|
191
|
+
const candidates = [
|
|
192
|
+
join(workflowsDir, `${moduleName}.ts`),
|
|
193
|
+
join(workflowsDir, `${moduleName}.js`),
|
|
194
|
+
join(workflowsDir, moduleName),
|
|
195
|
+
];
|
|
196
|
+
for (const candidate of candidates) {
|
|
197
|
+
try {
|
|
198
|
+
// Use dynamic import; for .ts files this requires a loader (tsx, ts-node, etc.)
|
|
199
|
+
const mod = await import(candidate);
|
|
200
|
+
// The module should export a default or named `workflow` that is a DataWorkflowModule
|
|
201
|
+
const workflow = mod.default ?? mod.workflow ?? mod;
|
|
202
|
+
if (workflow && typeof workflow.handler === 'function' && workflow.name) {
|
|
203
|
+
return workflow;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
catch {
|
|
207
|
+
// Try next candidate
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
// ─── Trace printer ───────────────────────────────────────────────────────────
|
|
214
|
+
/**
|
|
215
|
+
* Format action trace entries for human-readable terminal output.
|
|
216
|
+
*/
|
|
217
|
+
function formatTrace(entries) {
|
|
218
|
+
if (entries.length === 0)
|
|
219
|
+
return ['(no operations recorded in action trace)'];
|
|
220
|
+
const lines = ['', '─── Action Trace ───────────────────────────────────'];
|
|
221
|
+
for (const entry of entries) {
|
|
222
|
+
const icon = entry.outcome === 'succeeded' ? '✓' :
|
|
223
|
+
entry.outcome === 'blocked' ? '⊘' : '✗';
|
|
224
|
+
const targetStr = entry.targetResource ? ` → ${entry.targetResource}` : '';
|
|
225
|
+
const errorStr = entry.error ? ` (${entry.error})` : '';
|
|
226
|
+
lines.push(` ${icon} [${entry.seq}] ${entry.operationName}${targetStr} [${entry.outcome}]${errorStr}`);
|
|
227
|
+
}
|
|
228
|
+
lines.push('────────────────────────────────────────────────────');
|
|
229
|
+
return lines;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Execute the `loxtep test <module> --event <file>` command.
|
|
233
|
+
*
|
|
234
|
+
* Loads one Data_Workflow_Module by name, executes its handler locally against
|
|
235
|
+
* the attached instance with the sample event, prints the action trace.
|
|
236
|
+
* Guarded operations prompt in the terminal (≤300s) and execute only on approval.
|
|
237
|
+
* On rejection/timeout: skip, leave unchanged, record in trace (R6.2, R6.3).
|
|
238
|
+
*
|
|
239
|
+
* @param options - Command options.
|
|
240
|
+
* @returns Structured CLI result for testability.
|
|
241
|
+
*/
|
|
242
|
+
export async function runTestCommand(options) {
|
|
243
|
+
const workingDir = options.cwd ?? process.cwd();
|
|
244
|
+
// 1. Verify preconditions: project exists and is attached (R1.7, R1.10)
|
|
245
|
+
const precondition = requireAttachedProject(workingDir);
|
|
246
|
+
if (!precondition.ok) {
|
|
247
|
+
return preconditionToCliResult(precondition.failure);
|
|
248
|
+
}
|
|
249
|
+
const { projectDir, project } = precondition;
|
|
250
|
+
const { project_id: projectId, instance_id: instanceId } = project;
|
|
251
|
+
// 2. Load the named module from workflows/<name>.ts
|
|
252
|
+
const workflowModule = await loadWorkflowModule(projectDir, options.moduleName);
|
|
253
|
+
if (!workflowModule) {
|
|
254
|
+
return {
|
|
255
|
+
exitCode: 1,
|
|
256
|
+
stdout: [],
|
|
257
|
+
stderr: [
|
|
258
|
+
`Module "${options.moduleName}" not found in workflows/ directory.`,
|
|
259
|
+
`Looked for: workflows/${options.moduleName}.ts, workflows/${options.moduleName}.js`,
|
|
260
|
+
],
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
// 3. Read the event file (JSON)
|
|
264
|
+
let event;
|
|
265
|
+
try {
|
|
266
|
+
const eventPath = resolve(workingDir, options.eventFile);
|
|
267
|
+
const eventRaw = readFileSync(eventPath, 'utf-8');
|
|
268
|
+
event = JSON.parse(eventRaw);
|
|
269
|
+
}
|
|
270
|
+
catch (err) {
|
|
271
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
272
|
+
return {
|
|
273
|
+
exitCode: 1,
|
|
274
|
+
stdout: [],
|
|
275
|
+
stderr: [`Failed to read event file "${options.eventFile}": ${message}`],
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
// 4. Set up HandlerContext + toolbox
|
|
279
|
+
const clientResult = await requireCliClient();
|
|
280
|
+
const { client } = clientResult;
|
|
281
|
+
const handlerContext = {
|
|
282
|
+
workflowName: workflowModule.name,
|
|
283
|
+
instanceId,
|
|
284
|
+
projectId,
|
|
285
|
+
};
|
|
286
|
+
const toolbox = createToolbox({ client, projectId });
|
|
287
|
+
const trace = new ActionTrace();
|
|
288
|
+
// 5. Build guarded operations set from requireApproval (R6.1, R6.2)
|
|
289
|
+
const guardedOps = new Set(workflowModule.requireApproval ?? []);
|
|
290
|
+
// 6. Create approval-guarded toolbox
|
|
291
|
+
const promptFn = options.promptFn ?? promptApproval;
|
|
292
|
+
const guardedToolbox = createApprovalGuardedToolbox(toolbox, guardedOps, trace, promptFn);
|
|
293
|
+
// 7. Execute the handler with the event and guarded context
|
|
294
|
+
// The handler receives the context object; toolbox operations go through the guard.
|
|
295
|
+
// We attach the guarded toolbox to the context so the handler can use it.
|
|
296
|
+
const execContext = {
|
|
297
|
+
...handlerContext,
|
|
298
|
+
toolbox: guardedToolbox,
|
|
299
|
+
};
|
|
300
|
+
trace.record({
|
|
301
|
+
kind: 'toolbox',
|
|
302
|
+
operationName: 'handler.start',
|
|
303
|
+
targetResource: workflowModule.name,
|
|
304
|
+
startedAt: new Date().toISOString(),
|
|
305
|
+
completedAt: new Date().toISOString(),
|
|
306
|
+
outcome: 'succeeded',
|
|
307
|
+
});
|
|
308
|
+
try {
|
|
309
|
+
await workflowModule.handler(execContext, event);
|
|
310
|
+
trace.record({
|
|
311
|
+
kind: 'toolbox',
|
|
312
|
+
operationName: 'handler.complete',
|
|
313
|
+
targetResource: workflowModule.name,
|
|
314
|
+
startedAt: new Date().toISOString(),
|
|
315
|
+
completedAt: new Date().toISOString(),
|
|
316
|
+
outcome: 'succeeded',
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
catch (err) {
|
|
320
|
+
// GuardedOperationSkipped is non-fatal — handler may continue
|
|
321
|
+
if (!(err instanceof GuardedOperationSkipped)) {
|
|
322
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
323
|
+
trace.record({
|
|
324
|
+
kind: 'toolbox',
|
|
325
|
+
operationName: 'handler.error',
|
|
326
|
+
targetResource: workflowModule.name,
|
|
327
|
+
startedAt: new Date().toISOString(),
|
|
328
|
+
completedAt: new Date().toISOString(),
|
|
329
|
+
outcome: 'failed',
|
|
330
|
+
error: message,
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
// 8. Print the resulting action trace (R1.5)
|
|
335
|
+
const traceLines = formatTrace(trace.getEntries());
|
|
336
|
+
const summaryLines = [
|
|
337
|
+
`Test completed for module "${workflowModule.name}"`,
|
|
338
|
+
...traceLines,
|
|
339
|
+
];
|
|
340
|
+
return {
|
|
341
|
+
exitCode: 0,
|
|
342
|
+
stdout: summaryLines,
|
|
343
|
+
stderr: [],
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* CLI entry point for `loxtep test`.
|
|
348
|
+
* Parses args, prints output, and sets process.exitCode from the structured result.
|
|
349
|
+
*/
|
|
350
|
+
export async function runTest() {
|
|
351
|
+
const args = process.argv.slice(2);
|
|
352
|
+
// Expected: loxtep test <module> --event <file>
|
|
353
|
+
const moduleName = args[1]; // args[0] is 'test'
|
|
354
|
+
const eventIdx = args.indexOf('--event');
|
|
355
|
+
const eventFile = eventIdx >= 0 ? args[eventIdx + 1] : undefined;
|
|
356
|
+
if (!moduleName || moduleName.startsWith('--')) {
|
|
357
|
+
console.error('Usage: loxtep test <module> --event <file>');
|
|
358
|
+
process.exitCode = 1;
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
if (!eventFile) {
|
|
362
|
+
console.error('Usage: loxtep test <module> --event <file>');
|
|
363
|
+
console.error('Missing required --event <file> argument.');
|
|
364
|
+
process.exitCode = 1;
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
const result = await runTestCommand({ moduleName, eventFile });
|
|
368
|
+
for (const line of result.stdout) {
|
|
369
|
+
console.log(line);
|
|
370
|
+
}
|
|
371
|
+
for (const line of result.stderr) {
|
|
372
|
+
console.error(line);
|
|
373
|
+
}
|
|
374
|
+
if (result.exitCode !== 0) {
|
|
375
|
+
process.exitCode = result.exitCode;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
//# sourceMappingURL=test-cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-cmd.js","sourceRoot":"","sources":["../../../src/cli/commands/test-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAuC,MAAM,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,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IACD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAC5D,OAAO,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC3D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;IAC/D,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QACjC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACrC,CAAC;AACH,CAAC"}
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Loxtep CLI entry point.
|
|
4
4
|
* Usage: loxtep <command> [options]
|
|
5
|
-
* Commands: login, logout, whoami, init, config, bus, data-products, queue, flows, workflows, observe, connections, domains, standards, data-contracts
|
|
5
|
+
* Commands: login, logout, whoami, init, attach, config, bus, data-products, queue, flows, workflows, observe, connections, domains, standards, data-contracts
|
|
6
6
|
*/
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|