@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
|
+
* Codegen types for the typed Workspace Context generation pipeline.
|
|
3
|
+
*
|
|
4
|
+
* The codegen pipeline compiles the connected Loxtep resources into a single
|
|
5
|
+
* typed SDK artifact at `.loxtep/generated/index.ts`. These types define the
|
|
6
|
+
* intermediate representations used across the pipeline stages.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A JSON Schema representation. Matches the standard JSON Schema shape used
|
|
10
|
+
* across the Loxtep platform for data product schemas.
|
|
11
|
+
*/
|
|
12
|
+
export interface JsonSchema {
|
|
13
|
+
type?: string;
|
|
14
|
+
properties?: Record<string, JsonSchema>;
|
|
15
|
+
items?: JsonSchema;
|
|
16
|
+
required?: string[];
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Raw workspace context fetched from the control plane.
|
|
21
|
+
* Each resource collection contains the minimal fields needed for typed codegen.
|
|
22
|
+
* This is the output of Stage 1 (I/O load) and input to Stage 2 (normalize).
|
|
23
|
+
*/
|
|
24
|
+
export interface WorkspaceContext {
|
|
25
|
+
dataProducts: {
|
|
26
|
+
name: string;
|
|
27
|
+
id: string;
|
|
28
|
+
domain: string | null;
|
|
29
|
+
schema: JsonSchema | null;
|
|
30
|
+
}[];
|
|
31
|
+
connectors: {
|
|
32
|
+
type: string;
|
|
33
|
+
id: string;
|
|
34
|
+
connection_id: string | null;
|
|
35
|
+
name: string;
|
|
36
|
+
}[];
|
|
37
|
+
domains: {
|
|
38
|
+
name: string;
|
|
39
|
+
id: string;
|
|
40
|
+
data_product_ids: string[];
|
|
41
|
+
}[];
|
|
42
|
+
queues: {
|
|
43
|
+
name: string;
|
|
44
|
+
id: string;
|
|
45
|
+
}[];
|
|
46
|
+
flows: {
|
|
47
|
+
name: string;
|
|
48
|
+
id: string;
|
|
49
|
+
}[];
|
|
50
|
+
workflows: {
|
|
51
|
+
name: string;
|
|
52
|
+
id: string;
|
|
53
|
+
}[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A single normalized resource entry after deterministic key derivation.
|
|
57
|
+
* The `key` is the stable namespace accessor (e.g. `shopify_gql_customer`).
|
|
58
|
+
*/
|
|
59
|
+
export interface NormalizedResource<T> {
|
|
60
|
+
key: string;
|
|
61
|
+
data: T;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Normalized context after Stage 2 processing.
|
|
65
|
+
* Resources are sorted by id in ascending order with deterministic keys derived
|
|
66
|
+
* from resource names. This guarantees byte-identical output for unchanged contexts.
|
|
67
|
+
*/
|
|
68
|
+
export interface NormalizedContext {
|
|
69
|
+
dataProducts: NormalizedResource<WorkspaceContext['dataProducts'][number]>[];
|
|
70
|
+
connectors: NormalizedResource<WorkspaceContext['connectors'][number]>[];
|
|
71
|
+
domains: NormalizedResource<WorkspaceContext['domains'][number]>[];
|
|
72
|
+
queues: NormalizedResource<WorkspaceContext['queues'][number]>[];
|
|
73
|
+
flows: NormalizedResource<WorkspaceContext['flows'][number]>[];
|
|
74
|
+
workflows: NormalizedResource<WorkspaceContext['workflows'][number]>[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Per-resource-type counts reported after artifact generation.
|
|
78
|
+
* Each field reports the number of typed constants written for that resource type.
|
|
79
|
+
* Reports 0 for resource types with no resources (R2.7).
|
|
80
|
+
*/
|
|
81
|
+
export interface GenerateCounts {
|
|
82
|
+
dataProducts: number;
|
|
83
|
+
connectors: number;
|
|
84
|
+
domains: number;
|
|
85
|
+
queues: number;
|
|
86
|
+
flows: number;
|
|
87
|
+
workflows: number;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/codegen/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC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,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IACzE,OAAO,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IACnE,MAAM,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IACjE,KAAK,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC/D,SAAS,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;CACxE;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codegen types for the typed Workspace Context generation pipeline.
|
|
3
|
+
*
|
|
4
|
+
* The codegen pipeline compiles the connected Loxtep resources into a single
|
|
5
|
+
* typed SDK artifact at `.loxtep/generated/index.ts`. These types define the
|
|
6
|
+
* intermediate representations used across the pipeline stages.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/codegen/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stage 4: Write — atomic file overwrite returning per-type counts.
|
|
3
|
+
*
|
|
4
|
+
* This I/O stage takes the emitted TypeScript source string and writes it
|
|
5
|
+
* atomically to the target path. "Atomic" means: write to a temporary file
|
|
6
|
+
* in the same directory, then rename over the target. If the process crashes
|
|
7
|
+
* or the write fails at any point, the prior artifact remains unchanged (R2.8).
|
|
8
|
+
*
|
|
9
|
+
* The function also computes and returns per-resource-type counts from the
|
|
10
|
+
* provided NormalizedContext so the CLI can print them (R2.7).
|
|
11
|
+
*
|
|
12
|
+
* Requirements: R2.6, R2.7, R2.8
|
|
13
|
+
*
|
|
14
|
+
* @module codegen/write-artifact
|
|
15
|
+
*/
|
|
16
|
+
import type { NormalizedContext, GenerateCounts } from './types.js';
|
|
17
|
+
/**
|
|
18
|
+
* Computes per-resource-type counts from a NormalizedContext.
|
|
19
|
+
* Returns 0 for each resource type that has no resources (R2.7).
|
|
20
|
+
*/
|
|
21
|
+
export declare function computeCounts(norm: NormalizedContext): GenerateCounts;
|
|
22
|
+
/**
|
|
23
|
+
* Writes the generated artifact source to disk atomically and returns per-type counts.
|
|
24
|
+
*
|
|
25
|
+
* Atomicity strategy:
|
|
26
|
+
* 1. Ensure the target directory exists.
|
|
27
|
+
* 2. Write the full source to a temporary file in the same directory (same filesystem).
|
|
28
|
+
* 3. Rename the temporary file over the target path (atomic on POSIX filesystems).
|
|
29
|
+
*
|
|
30
|
+
* If any step fails, the temporary file is cleaned up (best-effort) and the
|
|
31
|
+
* prior artifact at `targetPath` remains unchanged (R2.8). The error is re-thrown
|
|
32
|
+
* so the caller can handle it (e.g. exit non-zero, print the failure reason).
|
|
33
|
+
*
|
|
34
|
+
* @param targetPath - Absolute or relative path to the generated artifact file.
|
|
35
|
+
* @param source - The TypeScript source string produced by `emitArtifact`.
|
|
36
|
+
* @param norm - The NormalizedContext used to compute resource counts.
|
|
37
|
+
* @returns Per-resource-type counts written to the artifact (R2.7).
|
|
38
|
+
*/
|
|
39
|
+
export declare function writeArtifact(targetPath: string, source: string, norm: NormalizedContext): Promise<GenerateCounts>;
|
|
40
|
+
//# sourceMappingURL=write-artifact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-artifact.d.ts","sourceRoot":"","sources":["../../src/codegen/write-artifact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEpE;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,cAAc,CASrE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,aAAa,CACjC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,cAAc,CAAC,CAyBzB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stage 4: Write — atomic file overwrite returning per-type counts.
|
|
3
|
+
*
|
|
4
|
+
* This I/O stage takes the emitted TypeScript source string and writes it
|
|
5
|
+
* atomically to the target path. "Atomic" means: write to a temporary file
|
|
6
|
+
* in the same directory, then rename over the target. If the process crashes
|
|
7
|
+
* or the write fails at any point, the prior artifact remains unchanged (R2.8).
|
|
8
|
+
*
|
|
9
|
+
* The function also computes and returns per-resource-type counts from the
|
|
10
|
+
* provided NormalizedContext so the CLI can print them (R2.7).
|
|
11
|
+
*
|
|
12
|
+
* Requirements: R2.6, R2.7, R2.8
|
|
13
|
+
*
|
|
14
|
+
* @module codegen/write-artifact
|
|
15
|
+
*/
|
|
16
|
+
import { writeFile, rename, mkdir, unlink } from 'node:fs/promises';
|
|
17
|
+
import { dirname, join } from 'node:path';
|
|
18
|
+
import { randomBytes } from 'node:crypto';
|
|
19
|
+
/**
|
|
20
|
+
* Computes per-resource-type counts from a NormalizedContext.
|
|
21
|
+
* Returns 0 for each resource type that has no resources (R2.7).
|
|
22
|
+
*/
|
|
23
|
+
export function computeCounts(norm) {
|
|
24
|
+
return {
|
|
25
|
+
dataProducts: norm.dataProducts.length,
|
|
26
|
+
connectors: norm.connectors.length,
|
|
27
|
+
domains: norm.domains.length,
|
|
28
|
+
queues: norm.queues.length,
|
|
29
|
+
flows: norm.flows.length,
|
|
30
|
+
workflows: norm.workflows.length,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Writes the generated artifact source to disk atomically and returns per-type counts.
|
|
35
|
+
*
|
|
36
|
+
* Atomicity strategy:
|
|
37
|
+
* 1. Ensure the target directory exists.
|
|
38
|
+
* 2. Write the full source to a temporary file in the same directory (same filesystem).
|
|
39
|
+
* 3. Rename the temporary file over the target path (atomic on POSIX filesystems).
|
|
40
|
+
*
|
|
41
|
+
* If any step fails, the temporary file is cleaned up (best-effort) and the
|
|
42
|
+
* prior artifact at `targetPath` remains unchanged (R2.8). The error is re-thrown
|
|
43
|
+
* so the caller can handle it (e.g. exit non-zero, print the failure reason).
|
|
44
|
+
*
|
|
45
|
+
* @param targetPath - Absolute or relative path to the generated artifact file.
|
|
46
|
+
* @param source - The TypeScript source string produced by `emitArtifact`.
|
|
47
|
+
* @param norm - The NormalizedContext used to compute resource counts.
|
|
48
|
+
* @returns Per-resource-type counts written to the artifact (R2.7).
|
|
49
|
+
*/
|
|
50
|
+
export async function writeArtifact(targetPath, source, norm) {
|
|
51
|
+
const dir = dirname(targetPath);
|
|
52
|
+
const tempName = `.loxtep-gen-${randomBytes(8).toString('hex')}.tmp`;
|
|
53
|
+
const tempPath = join(dir, tempName);
|
|
54
|
+
try {
|
|
55
|
+
// Ensure target directory exists
|
|
56
|
+
await mkdir(dir, { recursive: true });
|
|
57
|
+
// Write full content to temp file (same directory → same filesystem for rename)
|
|
58
|
+
await writeFile(tempPath, source, 'utf-8');
|
|
59
|
+
// Atomic rename over the target (R2.8: prior artifact unchanged on failure above)
|
|
60
|
+
await rename(tempPath, targetPath);
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
// Best-effort cleanup of the temp file
|
|
64
|
+
try {
|
|
65
|
+
await unlink(tempPath);
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// Ignore cleanup errors — the temp file may not have been created
|
|
69
|
+
}
|
|
70
|
+
throw err;
|
|
71
|
+
}
|
|
72
|
+
return computeCounts(norm);
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=write-artifact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-artifact.js","sourceRoot":"","sources":["../../src/codegen/write-artifact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAAuB;IACnD,OAAO;QACL,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM;QACtC,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM;QAClC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;QAC5B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;QAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;QACxB,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM;KACjC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,UAAkB,EAClB,MAAc,EACd,IAAuB;IAEvB,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAChC,MAAM,QAAQ,GAAG,eAAe,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;IACrE,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAErC,IAAI,CAAC;QACH,iCAAiC;QACjC,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAEtC,gFAAgF;QAChF,MAAM,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAE3C,kFAAkF;QAClF,MAAM,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,uCAAuC;QACvC,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACP,kEAAkE;QACpE,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
package/dist/config/index.d.ts
CHANGED
|
@@ -7,4 +7,5 @@ export { DEFAULT_CONFIG } from './types.js';
|
|
|
7
7
|
export { buildAuthServiceUrl, extendClientBaseUrl } from './api-path.js';
|
|
8
8
|
export { buildPlatformRequestUrl, getGatewayMicroserviceId, SDK_HTTP_PATHS_BY_FEATURE, } from './platform-request-url.js';
|
|
9
9
|
export { resolveSdkApiPaths, resolveConfigSdkPath, SDK_EXAMPLE_PATHS, type ResolvedSdkApiPaths, } from './resolve-sdk-urls.js';
|
|
10
|
+
export { loadWorkspaceConfig, resolveAutoConfig, type WorkspaceResolvedFields, type WorkspaceConfigResult, type ExplicitConfigFields, type AutoConfigResult, } from './workspace-config.js';
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB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index.js
CHANGED
|
@@ -6,4 +6,5 @@ export { DEFAULT_CONFIG } from './types.js';
|
|
|
6
6
|
export { buildAuthServiceUrl, extendClientBaseUrl } from './api-path.js';
|
|
7
7
|
export { buildPlatformRequestUrl, getGatewayMicroserviceId, SDK_HTTP_PATHS_BY_FEATURE, } from './platform-request-url.js';
|
|
8
8
|
export { resolveSdkApiPaths, resolveConfigSdkPath, SDK_EXAMPLE_PATHS, } from './resolve-sdk-urls.js';
|
|
9
|
+
export { loadWorkspaceConfig, resolveAutoConfig, } from './workspace-config.js';
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
package/dist/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,GAElB,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,GAKlB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace-aware config resolution for the SDK auto-config feature (R13).
|
|
3
|
+
*
|
|
4
|
+
* Resolution precedence: env vars > explicit config > `.loxtep/project.json` + `~/.loxtep/credentials.json`.
|
|
5
|
+
*
|
|
6
|
+
* This module provides:
|
|
7
|
+
* - {@link loadWorkspaceConfig} — resolves config from workspace files (project.json + credentials.json)
|
|
8
|
+
* - {@link resolveAutoConfig} — merges all layers (env, explicit, workspace) following the precedence
|
|
9
|
+
* - {@link WorkspaceConfigResult} — the resolved config with metadata about which files were used
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Fields that auto-config resolves from workspace files.
|
|
13
|
+
*/
|
|
14
|
+
export interface WorkspaceResolvedFields {
|
|
15
|
+
api_url?: string;
|
|
16
|
+
project_id?: string;
|
|
17
|
+
instance_id?: string;
|
|
18
|
+
token?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Result of loading workspace config, including which files were found.
|
|
22
|
+
*/
|
|
23
|
+
export interface WorkspaceConfigResult {
|
|
24
|
+
/** Resolved fields from workspace files. */
|
|
25
|
+
fields: WorkspaceResolvedFields;
|
|
26
|
+
/** Files that were found and used. */
|
|
27
|
+
resolvedFiles: string[];
|
|
28
|
+
/** Files that were looked for but missing. */
|
|
29
|
+
missingFiles: string[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Load workspace-resolved configuration from `.loxtep/project.json` (local project)
|
|
33
|
+
* and `~/.loxtep/credentials.json` (user credentials).
|
|
34
|
+
*
|
|
35
|
+
* This does NOT check env vars or explicit config — it only resolves from files.
|
|
36
|
+
* The caller is responsible for merging with the correct precedence.
|
|
37
|
+
*
|
|
38
|
+
* @param cwd - The working directory to search from (defaults to `process.cwd()`).
|
|
39
|
+
* @returns Resolved fields and metadata about which files were used.
|
|
40
|
+
*/
|
|
41
|
+
export declare function loadWorkspaceConfig(cwd?: string): WorkspaceConfigResult;
|
|
42
|
+
/**
|
|
43
|
+
* Options that can be explicitly passed to override auto-resolved config.
|
|
44
|
+
*/
|
|
45
|
+
export interface ExplicitConfigFields {
|
|
46
|
+
api_url?: string;
|
|
47
|
+
project_id?: string;
|
|
48
|
+
instance_id?: string;
|
|
49
|
+
token?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Resolved auto-config result with full precedence applied.
|
|
53
|
+
*/
|
|
54
|
+
export interface AutoConfigResult {
|
|
55
|
+
/** Final resolved api_url. */
|
|
56
|
+
api_url?: string;
|
|
57
|
+
/** Final resolved project_id. */
|
|
58
|
+
project_id?: string;
|
|
59
|
+
/** Final resolved instance_id. */
|
|
60
|
+
instance_id?: string;
|
|
61
|
+
/** Final resolved auth token. */
|
|
62
|
+
token?: string;
|
|
63
|
+
/** Files that were resolved (for debug log). */
|
|
64
|
+
resolvedFiles: string[];
|
|
65
|
+
/** Files that were missing. */
|
|
66
|
+
missingFiles: string[];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Resolve configuration with full precedence: env > explicit > workspace files.
|
|
70
|
+
*
|
|
71
|
+
* @param explicit - Explicitly passed config (overrides workspace but not env).
|
|
72
|
+
* @param cwd - Working directory to search for `.loxtep/project.json`.
|
|
73
|
+
* @returns The merged config with metadata about resolution sources.
|
|
74
|
+
*/
|
|
75
|
+
export declare function resolveAutoConfig(explicit?: ExplicitConfigFields, cwd?: string): AutoConfigResult;
|
|
76
|
+
//# sourceMappingURL=workspace-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-config.d.ts","sourceRoot":"","sources":["../../src/config/workspace-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,4CAA4C;IAC5C,MAAM,EAAE,uBAAuB,CAAC;IAChC,sCAAsC;IACtC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,8CAA8C;IAC9C,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAKD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,qBAAqB,CAkEvE;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAUD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,+BAA+B;IAC/B,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,CAAC,EAAE,oBAAoB,EAC/B,GAAG,CAAC,EAAE,MAAM,GACX,gBAAgB,CA0BlB"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace-aware config resolution for the SDK auto-config feature (R13).
|
|
3
|
+
*
|
|
4
|
+
* Resolution precedence: env vars > explicit config > `.loxtep/project.json` + `~/.loxtep/credentials.json`.
|
|
5
|
+
*
|
|
6
|
+
* This module provides:
|
|
7
|
+
* - {@link loadWorkspaceConfig} — resolves config from workspace files (project.json + credentials.json)
|
|
8
|
+
* - {@link resolveAutoConfig} — merges all layers (env, explicit, workspace) following the precedence
|
|
9
|
+
* - {@link WorkspaceConfigResult} — the resolved config with metadata about which files were used
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
12
|
+
import { join } from 'node:path';
|
|
13
|
+
import { getConfigDir } from './paths.js';
|
|
14
|
+
import { findProjectDir, getProjectFilePath, PROJECT_DIR_NAME, PROJECT_FILE_NAME } from '../cli/project-context.js';
|
|
15
|
+
/** Credentials file name within `~/.loxtep/`. */
|
|
16
|
+
const CREDENTIALS_FILE_NAME = 'credentials.json';
|
|
17
|
+
/**
|
|
18
|
+
* Load workspace-resolved configuration from `.loxtep/project.json` (local project)
|
|
19
|
+
* and `~/.loxtep/credentials.json` (user credentials).
|
|
20
|
+
*
|
|
21
|
+
* This does NOT check env vars or explicit config — it only resolves from files.
|
|
22
|
+
* The caller is responsible for merging with the correct precedence.
|
|
23
|
+
*
|
|
24
|
+
* @param cwd - The working directory to search from (defaults to `process.cwd()`).
|
|
25
|
+
* @returns Resolved fields and metadata about which files were used.
|
|
26
|
+
*/
|
|
27
|
+
export function loadWorkspaceConfig(cwd) {
|
|
28
|
+
const workDir = cwd ?? process.cwd();
|
|
29
|
+
const resolvedFiles = [];
|
|
30
|
+
const missingFiles = [];
|
|
31
|
+
const fields = {};
|
|
32
|
+
// 1. Resolve .loxtep/project.json (search upward from cwd)
|
|
33
|
+
const projectDir = findProjectDir(workDir);
|
|
34
|
+
const projectFilePath = projectDir ? getProjectFilePath(projectDir) : null;
|
|
35
|
+
if (projectFilePath && existsSync(projectFilePath)) {
|
|
36
|
+
try {
|
|
37
|
+
const raw = readFileSync(projectFilePath, 'utf-8');
|
|
38
|
+
const parsed = JSON.parse(raw);
|
|
39
|
+
if (typeof parsed === 'object' && parsed !== null) {
|
|
40
|
+
if (typeof parsed.api_url === 'string' && parsed.api_url.trim()) {
|
|
41
|
+
fields.api_url = parsed.api_url.trim();
|
|
42
|
+
}
|
|
43
|
+
if (typeof parsed.project_id === 'string' && parsed.project_id.trim()) {
|
|
44
|
+
fields.project_id = parsed.project_id.trim();
|
|
45
|
+
}
|
|
46
|
+
if (typeof parsed.instance_id === 'string' && parsed.instance_id.trim()) {
|
|
47
|
+
fields.instance_id = parsed.instance_id.trim();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
resolvedFiles.push(projectFilePath);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// File exists but can't be read/parsed — treat as missing
|
|
54
|
+
missingFiles.push(projectFilePath);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
// Project file not found in any parent directory
|
|
59
|
+
const searchedPath = join(workDir, PROJECT_DIR_NAME, PROJECT_FILE_NAME);
|
|
60
|
+
missingFiles.push(searchedPath);
|
|
61
|
+
}
|
|
62
|
+
// 2. Resolve ~/.loxtep/credentials.json (user-level credentials)
|
|
63
|
+
const credentialsPath = join(getConfigDir(), CREDENTIALS_FILE_NAME);
|
|
64
|
+
if (existsSync(credentialsPath)) {
|
|
65
|
+
try {
|
|
66
|
+
const raw = readFileSync(credentialsPath, 'utf-8');
|
|
67
|
+
const parsed = JSON.parse(raw);
|
|
68
|
+
if (typeof parsed === 'object' && parsed !== null) {
|
|
69
|
+
if (typeof parsed.access_token === 'string' && parsed.access_token.trim()) {
|
|
70
|
+
fields.token = parsed.access_token.trim();
|
|
71
|
+
}
|
|
72
|
+
// credentials.json can also carry api_base_url (from login)
|
|
73
|
+
if (!fields.api_url &&
|
|
74
|
+
typeof parsed.api_base_url === 'string' &&
|
|
75
|
+
parsed.api_base_url.trim()) {
|
|
76
|
+
fields.api_url = parsed.api_base_url.trim();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
resolvedFiles.push(credentialsPath);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// File exists but can't be read/parsed — treat as missing
|
|
83
|
+
missingFiles.push(credentialsPath);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
missingFiles.push(credentialsPath);
|
|
88
|
+
}
|
|
89
|
+
return { fields, resolvedFiles, missingFiles };
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Env var names that take precedence over everything.
|
|
93
|
+
*/
|
|
94
|
+
const ENV_API_URL = 'LOXTEP_API_URL';
|
|
95
|
+
const ENV_PROJECT_ID = 'LOXTEP_PROJECT_ID';
|
|
96
|
+
const ENV_INSTANCE_ID = 'LOXTEP_INSTANCE_ID';
|
|
97
|
+
const ENV_TOKEN = 'LOXTEP_TOKEN';
|
|
98
|
+
/**
|
|
99
|
+
* Resolve configuration with full precedence: env > explicit > workspace files.
|
|
100
|
+
*
|
|
101
|
+
* @param explicit - Explicitly passed config (overrides workspace but not env).
|
|
102
|
+
* @param cwd - Working directory to search for `.loxtep/project.json`.
|
|
103
|
+
* @returns The merged config with metadata about resolution sources.
|
|
104
|
+
*/
|
|
105
|
+
export function resolveAutoConfig(explicit, cwd) {
|
|
106
|
+
// Layer 1: workspace files (lowest precedence)
|
|
107
|
+
const workspace = loadWorkspaceConfig(cwd);
|
|
108
|
+
// Layer 2: explicit config (overrides workspace)
|
|
109
|
+
const afterExplicit = {
|
|
110
|
+
api_url: explicit?.api_url || workspace.fields.api_url,
|
|
111
|
+
project_id: explicit?.project_id || workspace.fields.project_id,
|
|
112
|
+
instance_id: explicit?.instance_id || workspace.fields.instance_id,
|
|
113
|
+
token: explicit?.token || workspace.fields.token,
|
|
114
|
+
};
|
|
115
|
+
// Layer 3: env vars (highest precedence)
|
|
116
|
+
const envApiUrl = process.env[ENV_API_URL]?.trim() || undefined;
|
|
117
|
+
const envProjectId = process.env[ENV_PROJECT_ID]?.trim() || undefined;
|
|
118
|
+
const envInstanceId = process.env[ENV_INSTANCE_ID]?.trim() || undefined;
|
|
119
|
+
const envToken = process.env[ENV_TOKEN]?.trim() || undefined;
|
|
120
|
+
return {
|
|
121
|
+
api_url: envApiUrl || afterExplicit.api_url,
|
|
122
|
+
project_id: envProjectId || afterExplicit.project_id,
|
|
123
|
+
instance_id: envInstanceId || afterExplicit.instance_id,
|
|
124
|
+
token: envToken || afterExplicit.token,
|
|
125
|
+
resolvedFiles: workspace.resolvedFiles,
|
|
126
|
+
missingFiles: workspace.missingFiles,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=workspace-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-config.js","sourceRoot":"","sources":["../../src/config/workspace-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAwBpH,iDAAiD;AACjD,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAEjD;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,MAAM,OAAO,GAAG,GAAG,IA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7D,OAAO;QACL,OAAO,EAAE,SAAS,IAAI,aAAa,CAAC,OAAO;QAC3C,UAAU,EAAE,YAAY,IAAI,aAAa,CAAC,UAAU;QACpD,WAAW,EAAE,aAAa,IAAI,aAAa,CAAC,WAAW;QACvD,KAAK,EAAE,QAAQ,IAAI,aAAa,CAAC,KAAK;QACtC,aAAa,EAAE,SAAS,CAAC,aAAa;QACtC,YAAY,EAAE,SAAS,CAAC,YAAY;KACrC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,4 +10,7 @@ export * from './http/index.js';
|
|
|
10
10
|
export * from './checkpoint/index.js';
|
|
11
11
|
export * from './streaming/index.js';
|
|
12
12
|
export * from './types/index.js';
|
|
13
|
+
export * from './codegen/index.js';
|
|
14
|
+
export * from './skills/index.js';
|
|
15
|
+
export * from './authoring/index.js';
|
|
13
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,4 +10,7 @@ export * from './http/index.js';
|
|
|
10
10
|
export * from './checkpoint/index.js';
|
|
11
11
|
export * from './streaming/index.js';
|
|
12
12
|
export * from './types/index.js';
|
|
13
|
+
export * from './codegen/index.js';
|
|
14
|
+
export * from './skills/index.js';
|
|
15
|
+
export * from './authoring/index.js';
|
|
13
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|
|
@@ -2,8 +2,22 @@
|
|
|
2
2
|
* Map stream read wrappers to the SDK queue event shape; write payloads via putEvent / putEvents.
|
|
3
3
|
*/
|
|
4
4
|
import type { RStreamsSdk } from 'leo-sdk';
|
|
5
|
-
import type { QueueEvent } from '../client/queue-types.js';
|
|
6
|
-
|
|
5
|
+
import type { QueueEvent, WriteOptions } from '../client/queue-types.js';
|
|
6
|
+
import type { FlowWriter } from '../client/flow-types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Build the rstreams envelope for a business object. The source bot is set by the writer
|
|
9
|
+
* (`rsdk.load(botId, …)`), so we deliberately emit NO top-level `id` — in rstreams that is the
|
|
10
|
+
* SOURCE-BOT identity, and letting a caller's record id land there registers a bogus bot per record
|
|
11
|
+
* in LeoCron. The business object is always the `payload`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function toLeoEnvelope(businessObject: unknown, options?: WriteOptions): Record<string, unknown>;
|
|
14
|
+
/**
|
|
15
|
+
* Thin queue writer over the rstreams `load` stream. The rstreams SDK owns buffering, batching,
|
|
16
|
+
* backoff, and checkpointing — this wrapper does NOT buffer or retry; it only wraps each business
|
|
17
|
+
* object into a leo envelope (source = `botId`) and forwards it to `rsdk.load(botId, queueName)`,
|
|
18
|
+
* then flushes on `close()`. Callers pass the business object to `write()`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createQueueWriter(rsdk: RStreamsSdk, botId: string, queueName: string, closedError: () => Error): FlowWriter;
|
|
7
21
|
/**
|
|
8
22
|
* Read up to `limit` events from `inQueue` acting as bot `id`, then return (mapped events, last start for next page).
|
|
9
23
|
* Uses one offloadEvents invocation per batch (stream checkpoints advance between calls).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-bridge.d.ts","sourceRoot":"","sources":["../../src/rstreams/event-bridge.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"event-bridge.d.ts","sourceRoot":"","sources":["../../src/rstreams/event-bridge.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAa,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAwB1D;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQtG;AAQD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,KAAK,GACvB,UAAU,CAmBZ;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAE5F,wBAAsB,cAAc,CAAC,CAAC,GAAG,OAAO,EAC9C,IAAI,EAAE,WAAW,EACjB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GACpB,OAAO,CAAC,oBAAoB,CAAC,CAqB/B"}
|
|
@@ -15,11 +15,44 @@ function readEventToQueueEvent(wrapper) {
|
|
|
15
15
|
correlation_id: w.correlation_id,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Build the rstreams envelope for a business object. The source bot is set by the writer
|
|
20
|
+
* (`rsdk.load(botId, …)`), so we deliberately emit NO top-level `id` — in rstreams that is the
|
|
21
|
+
* SOURCE-BOT identity, and letting a caller's record id land there registers a bogus bot per record
|
|
22
|
+
* in LeoCron. The business object is always the `payload`.
|
|
23
|
+
*/
|
|
24
|
+
export function toLeoEnvelope(businessObject, options) {
|
|
25
|
+
const env = { payload: businessObject };
|
|
26
|
+
const ts = options?.event_source_timestamp;
|
|
27
|
+
if (ts != null) {
|
|
28
|
+
const ms = typeof ts === 'number' ? ts : Date.parse(String(ts));
|
|
29
|
+
if (!Number.isNaN(ms))
|
|
30
|
+
env.event_source_timestamp = ms;
|
|
31
|
+
}
|
|
32
|
+
return env;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Thin queue writer over the rstreams `load` stream. The rstreams SDK owns buffering, batching,
|
|
36
|
+
* backoff, and checkpointing — this wrapper does NOT buffer or retry; it only wraps each business
|
|
37
|
+
* object into a leo envelope (source = `botId`) and forwards it to `rsdk.load(botId, queueName)`,
|
|
38
|
+
* then flushes on `close()`. Callers pass the business object to `write()`.
|
|
39
|
+
*/
|
|
40
|
+
export function createQueueWriter(rsdk, botId, queueName, closedError) {
|
|
41
|
+
const stream = rsdk.load(botId, queueName);
|
|
42
|
+
let closed = false;
|
|
43
|
+
return {
|
|
44
|
+
write(event, options) {
|
|
45
|
+
if (closed)
|
|
46
|
+
throw closedError();
|
|
47
|
+
stream.write(toLeoEnvelope(event, options));
|
|
48
|
+
},
|
|
49
|
+
async close() {
|
|
50
|
+
if (closed)
|
|
51
|
+
return;
|
|
52
|
+
closed = true;
|
|
53
|
+
await new Promise((resolve, reject) => stream.end(err => (err ? reject(err) : resolve())));
|
|
54
|
+
},
|
|
55
|
+
};
|
|
23
56
|
}
|
|
24
57
|
export async function readQueueBatch(rsdk, id, inQueue, limit, start) {
|
|
25
58
|
const collected = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-bridge.js","sourceRoot":"","sources":["../../src/rstreams/event-bridge.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"event-bridge.js","sourceRoot":"","sources":["../../src/rstreams/event-bridge.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,SAAS,qBAAqB,CAAI,OAAqB;IACrD,MAAM,CAAC,GAAG,OAMT,CAAC;IACF,MAAM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