@loxtep/sdk 0.2.3 → 0.4.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/CHANGELOG.md +68 -0
- package/README.md +255 -4
- 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 +103 -0
- package/dist/authoring/compiler.d.ts.map +1 -0
- package/dist/authoring/compiler.js +305 -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 +111 -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/data-contracts-cmd.d.ts +8 -0
- package/dist/cli/commands/data-contracts-cmd.d.ts.map +1 -1
- package/dist/cli/commands/data-contracts-cmd.js +11 -0
- package/dist/cli/commands/data-contracts-cmd.js.map +1 -1
- package/dist/cli/commands/data-products-cmd.d.ts +2 -0
- package/dist/cli/commands/data-products-cmd.d.ts.map +1 -1
- package/dist/cli/commands/data-products-cmd.js +35 -0
- package/dist/cli/commands/data-products-cmd.js.map +1 -1
- 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/instances-cmd.d.ts +37 -0
- package/dist/cli/commands/instances-cmd.d.ts.map +1 -0
- package/dist/cli/commands/instances-cmd.js +150 -0
- package/dist/cli/commands/instances-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 +5 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +240 -8
- 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-types.d.ts +23 -0
- package/dist/client/data-products-types.d.ts.map +1 -1
- package/dist/client/data-products.d.ts +3 -1
- package/dist/client/data-products.d.ts.map +1 -1
- package/dist/client/data-products.js +20 -98
- package/dist/client/data-products.js.map +1 -1
- package/dist/client/{consumptions-types.d.ts → delivery-types.d.ts} +25 -8
- package/dist/client/delivery-types.d.ts.map +1 -0
- package/dist/client/delivery-types.js +10 -0
- package/dist/client/delivery-types.js.map +1 -0
- package/dist/client/delivery.d.ts +23 -0
- package/dist/client/delivery.d.ts.map +1 -0
- package/dist/client/delivery.js +105 -0
- package/dist/client/delivery.js.map +1 -0
- 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 +8 -3
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/instances-types.d.ts +92 -0
- package/dist/client/instances-types.d.ts.map +1 -1
- package/dist/client/instances.d.ts +26 -4
- package/dist/client/instances.d.ts.map +1 -1
- package/dist/client/instances.js +94 -3
- package/dist/client/instances.js.map +1 -1
- package/dist/client/loxtep-client.d.ts +48 -3
- package/dist/client/loxtep-client.d.ts.map +1 -1
- package/dist/client/loxtep-client.js +73 -5
- 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/promises.d.ts +11 -0
- package/dist/client/promises.d.ts.map +1 -1
- package/dist/client/promises.js +11 -0
- package/dist/client/promises.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/client/schemas.d.ts +1 -0
- package/dist/client/schemas.d.ts.map +1 -1
- package/dist/client/schemas.js +4 -0
- package/dist/client/schemas.js.map +1 -1
- package/dist/client/thesaurus.d.ts +5 -0
- package/dist/client/thesaurus.d.ts.map +1 -1
- package/dist/client/thesaurus.js +12 -0
- package/dist/client/thesaurus.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/docs/getting-started.md +7 -0
- package/package.json +7 -5
- package/dist/cli/commands/data-assets-cmd.d.ts +0 -12
- package/dist/cli/commands/data-assets-cmd.d.ts.map +0 -1
- package/dist/cli/commands/data-assets-cmd.js +0 -75
- package/dist/cli/commands/data-assets-cmd.js.map +0 -1
- package/dist/cli/commands/pipelines-cmd.d.ts +0 -17
- package/dist/cli/commands/pipelines-cmd.d.ts.map +0 -1
- package/dist/cli/commands/pipelines-cmd.js +0 -52
- package/dist/cli/commands/pipelines-cmd.js.map +0 -1
- package/dist/cli/commands/promises-cmd.d.ts +0 -11
- package/dist/cli/commands/promises-cmd.d.ts.map +0 -1
- package/dist/cli/commands/promises-cmd.js +0 -53
- package/dist/cli/commands/promises-cmd.js.map +0 -1
- package/dist/client/consumptions-types.d.ts.map +0 -1
- package/dist/client/consumptions-types.js +0 -5
- package/dist/client/consumptions-types.js.map +0 -1
- package/dist/client/consumptions.d.ts +0 -14
- package/dist/client/consumptions.d.ts.map +0 -1
- package/dist/client/consumptions.js +0 -47
- package/dist/client/consumptions.js.map +0 -1
- package/dist/client/data-assets-types.d.ts +0 -150
- package/dist/client/data-assets-types.d.ts.map +0 -1
- package/dist/client/data-assets-types.js +0 -5
- package/dist/client/data-assets-types.js.map +0 -1
- package/dist/client/data-assets.d.ts +0 -31
- package/dist/client/data-assets.d.ts.map +0 -1
- package/dist/client/data-assets.js +0 -182
- package/dist/client/data-assets.js.map +0 -1
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic `toolbox` namespace — direct, typed platform calls with no model
|
|
3
|
+
* in the loop (R4.1, R4.7).
|
|
4
|
+
*
|
|
5
|
+
* Each method is a thin wrapper over the corresponding `LoxtepClient` namespace
|
|
6
|
+
* method. On success, it returns a typed result. On failure, it throws a
|
|
7
|
+
* `ToolboxOperationError` identifying the failed operation — it never falls back
|
|
8
|
+
* to a model.
|
|
9
|
+
*/
|
|
10
|
+
import { LoxtepError } from '../errors/base.js';
|
|
11
|
+
// ─── Error type ──────────────────────────────────────────────────────────────
|
|
12
|
+
/**
|
|
13
|
+
* Error thrown when a deterministic toolbox operation fails.
|
|
14
|
+
* Identifies the failed operation and namespace so the caller can
|
|
15
|
+
* distinguish it from other errors.
|
|
16
|
+
*
|
|
17
|
+
* Per R4.7 — the SDK never falls back to a model on failure.
|
|
18
|
+
*/
|
|
19
|
+
export class ToolboxOperationError extends LoxtepError {
|
|
20
|
+
/** The toolbox namespace where the failure occurred (e.g. 'dataProducts'). */
|
|
21
|
+
namespace;
|
|
22
|
+
/** The operation that failed (e.g. 'write', 'query', 'list'). */
|
|
23
|
+
operation;
|
|
24
|
+
constructor(namespace, operation, message, cause) {
|
|
25
|
+
super(`toolbox.${namespace}.${operation} failed: ${message}`, {
|
|
26
|
+
code: 'TOOLBOX_OPERATION_FAILED',
|
|
27
|
+
status_code: cause?.status_code,
|
|
28
|
+
details: {
|
|
29
|
+
namespace,
|
|
30
|
+
operation,
|
|
31
|
+
...(cause instanceof Error ? { cause_message: cause.message } : {}),
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
this.name = 'ToolboxOperationError';
|
|
35
|
+
this.namespace = namespace;
|
|
36
|
+
this.operation = operation;
|
|
37
|
+
Object.setPrototypeOf(this, ToolboxOperationError.prototype);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Create a `Toolbox` — deterministic, typed platform operations with no model
|
|
42
|
+
* in the loop.
|
|
43
|
+
*
|
|
44
|
+
* On success each method returns a typed result. On failure, a
|
|
45
|
+
* `ToolboxOperationError` is thrown identifying the failed operation.
|
|
46
|
+
* The toolbox never falls back to an AI model.
|
|
47
|
+
*
|
|
48
|
+
* @param options - Client and project configuration.
|
|
49
|
+
* @returns A `Toolbox` instance.
|
|
50
|
+
*/
|
|
51
|
+
export function createToolbox(options) {
|
|
52
|
+
const { client, projectId } = options;
|
|
53
|
+
const dataProducts = {
|
|
54
|
+
async write(ref, event) {
|
|
55
|
+
try {
|
|
56
|
+
const writer = await client.data_products.get_writer(ref.name);
|
|
57
|
+
writer.write(event);
|
|
58
|
+
await writer.close();
|
|
59
|
+
return { success: true, events_written: 1 };
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
throw new ToolboxOperationError('dataProducts', 'write', err instanceof Error ? err.message : String(err), err);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
async query(ref, sql) {
|
|
66
|
+
try {
|
|
67
|
+
const result = await client.data_products.query(ref.id, sql);
|
|
68
|
+
return { items: result.items, metadata: result.metadata };
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
throw new ToolboxOperationError('dataProducts', 'query', err instanceof Error ? err.message : String(err), err);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
async get(ref) {
|
|
75
|
+
try {
|
|
76
|
+
return await client.data_products.get(ref.id);
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
throw new ToolboxOperationError('dataProducts', 'get', err instanceof Error ? err.message : String(err), err);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
async list(filters) {
|
|
83
|
+
try {
|
|
84
|
+
const result = await client.data_products.list({
|
|
85
|
+
domain_id: filters?.domain_id,
|
|
86
|
+
});
|
|
87
|
+
return result.items;
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
throw new ToolboxOperationError('dataProducts', 'list', err instanceof Error ? err.message : String(err), err);
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
const queues = {
|
|
95
|
+
async write(ref, event) {
|
|
96
|
+
try {
|
|
97
|
+
const writer = await client.queues.open_writer({
|
|
98
|
+
bot_id: `toolbox-writer-${ref.name}`,
|
|
99
|
+
queue_name: ref.name,
|
|
100
|
+
});
|
|
101
|
+
await writer.write(event);
|
|
102
|
+
await writer.close();
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
throw new ToolboxOperationError('queues', 'write', err instanceof Error ? err.message : String(err), err);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
async getMetadata(ref) {
|
|
109
|
+
try {
|
|
110
|
+
const metadata = await client.queues.get_queue_metadata(ref.name);
|
|
111
|
+
return metadata;
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
throw new ToolboxOperationError('queues', 'getMetadata', err instanceof Error ? err.message : String(err), err);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
const connections = {
|
|
119
|
+
async list() {
|
|
120
|
+
try {
|
|
121
|
+
const result = await client.connections.list();
|
|
122
|
+
return result.items;
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
throw new ToolboxOperationError('connections', 'list', err instanceof Error ? err.message : String(err), err);
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
async get(connectionId) {
|
|
129
|
+
try {
|
|
130
|
+
return await client.connections.get(connectionId);
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
throw new ToolboxOperationError('connections', 'get', err instanceof Error ? err.message : String(err), err);
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
async test(connectionId) {
|
|
137
|
+
try {
|
|
138
|
+
return await client.connections.test(connectionId);
|
|
139
|
+
}
|
|
140
|
+
catch (err) {
|
|
141
|
+
throw new ToolboxOperationError('connections', 'test', err instanceof Error ? err.message : String(err), err);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
const workflows = {
|
|
146
|
+
async list() {
|
|
147
|
+
try {
|
|
148
|
+
const result = await client.workflows.listWorkflows({ project_id: projectId });
|
|
149
|
+
return result.items;
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
throw new ToolboxOperationError('workflows', 'list', err instanceof Error ? err.message : String(err), err);
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
async getGraph(ref) {
|
|
156
|
+
try {
|
|
157
|
+
return await client.workflows.getWorkflowGraph(ref.id, projectId);
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
throw new ToolboxOperationError('workflows', 'getGraph', err instanceof Error ? err.message : String(err), err);
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
return { dataProducts, queues, connections, workflows };
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=toolbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbox.js","sourceRoot":"","sources":["../../src/authoring/toolbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAkBhD,gFAAgF;AAEhF;;;;;;GAMG;AACH,MAAM,OAAO,qBAAsB,SAAQ,WAAW;IACpD,8EAA8E;IACrE,SAAS,CAAS;IAC3B,iEAAiE;IACxD,SAAS,CAAS;IAE3B,YACE,SAAiB,EACjB,SAAiB,EACjB,OAAe,EACf,KAAe;QAEf,KAAK,CACH,WAAW,SAAS,IAAI,SAAS,YAAY,OAAO,EAAE,EACtD;YACE,IAAI,EAAE,0BAA0B;YAChC,WAAW,EAAG,KAA8C,EAAE,WAAW;YACzE,OAAO,EAAE;gBACP,SAAS;gBACT,SAAS;gBACT,GAAG,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACpE;SACF,CACF,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC/D,CAAC;CACF;AAyFD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAAC,OAA6B;IACzD,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAEtC,MA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C,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAChD,GAAG,CACJ,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;IAEF,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trigger builders for code-first data workflow authoring.
|
|
3
|
+
*
|
|
4
|
+
* Each builder accepts typed constants from the Generated_SDK_Artifact and
|
|
5
|
+
* returns a `TriggerSpec` describing the event source.
|
|
6
|
+
*/
|
|
7
|
+
import type { TriggerSpec, QueueRef, ConnectorRef } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Trigger builder namespace. Each method constructs a `TriggerSpec` from a
|
|
10
|
+
* typed workspace constant.
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { on } from '@loxtep/sdk/authoring';
|
|
15
|
+
* import { queues, connectors } from './.loxtep/generated/index';
|
|
16
|
+
*
|
|
17
|
+
* on.queueEvent(queues.orders_raw)
|
|
18
|
+
* on.connectorEvent(connectors.shopify_main)
|
|
19
|
+
* on.schedule('0 * * * *')
|
|
20
|
+
* on.webhook('/ingest/orders')
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const on: {
|
|
24
|
+
/**
|
|
25
|
+
* Trigger on a queue event from a typed queue constant.
|
|
26
|
+
*/
|
|
27
|
+
readonly queueEvent: (queue: QueueRef) => TriggerSpec;
|
|
28
|
+
/**
|
|
29
|
+
* Trigger on a connector event from a typed connector constant.
|
|
30
|
+
*/
|
|
31
|
+
readonly connectorEvent: (connector: ConnectorRef) => TriggerSpec;
|
|
32
|
+
/**
|
|
33
|
+
* Trigger on a cron schedule.
|
|
34
|
+
*/
|
|
35
|
+
readonly schedule: (cron: string) => TriggerSpec;
|
|
36
|
+
/**
|
|
37
|
+
* Trigger on an incoming webhook at the given path.
|
|
38
|
+
*/
|
|
39
|
+
readonly webhook: (path: string) => TriggerSpec;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=triggers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../src/authoring/triggers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEtE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,EAAE;IACb;;OAEG;iCACe,QAAQ,KAAG,WAAW;IAOxC;;OAEG;yCACuB,YAAY,KAAG,WAAW;IAOpD;;OAEG;8BACY,MAAM,KAAG,WAAW;IAOnC;;OAEG;6BACW,MAAM,KAAG,WAAW;CAM1B,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trigger builders for code-first data workflow authoring.
|
|
3
|
+
*
|
|
4
|
+
* Each builder accepts typed constants from the Generated_SDK_Artifact and
|
|
5
|
+
* returns a `TriggerSpec` describing the event source.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Trigger builder namespace. Each method constructs a `TriggerSpec` from a
|
|
9
|
+
* typed workspace constant.
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { on } from '@loxtep/sdk/authoring';
|
|
14
|
+
* import { queues, connectors } from './.loxtep/generated/index';
|
|
15
|
+
*
|
|
16
|
+
* on.queueEvent(queues.orders_raw)
|
|
17
|
+
* on.connectorEvent(connectors.shopify_main)
|
|
18
|
+
* on.schedule('0 * * * *')
|
|
19
|
+
* on.webhook('/ingest/orders')
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export const on = {
|
|
23
|
+
/**
|
|
24
|
+
* Trigger on a queue event from a typed queue constant.
|
|
25
|
+
*/
|
|
26
|
+
queueEvent(queue) {
|
|
27
|
+
return {
|
|
28
|
+
kind: 'queue',
|
|
29
|
+
ref: { id: queue.id, name: queue.name },
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* Trigger on a connector event from a typed connector constant.
|
|
34
|
+
*/
|
|
35
|
+
connectorEvent(connector) {
|
|
36
|
+
return {
|
|
37
|
+
kind: 'connector',
|
|
38
|
+
ref: { id: connector.id, name: connector.type },
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* Trigger on a cron schedule.
|
|
43
|
+
*/
|
|
44
|
+
schedule(cron) {
|
|
45
|
+
return {
|
|
46
|
+
kind: 'schedule',
|
|
47
|
+
schedule: cron,
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* Trigger on an incoming webhook at the given path.
|
|
52
|
+
*/
|
|
53
|
+
webhook(path) {
|
|
54
|
+
return {
|
|
55
|
+
kind: 'webhook',
|
|
56
|
+
path,
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=triggers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggers.js","sourceRoot":"","sources":["../../src/authoring/triggers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB;;OAEG;IACH,UAAU,CAAC,KAAe;QACxB,OAAO;YACL,IAAI,EAAE,OAAO;YACb,GAAG,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE;SACxC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,SAAuB;QACpC,OAAO;YACL,IAAI,EAAE,WAAW;YACjB,GAAG,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE;SAChD,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,IAAY;QACnB,OAAO;YACL,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,IAAI;SACf,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,IAAY;QAClB,OAAO;YACL,IAAI,EAAE,SAAS;YACf,IAAI;SACL,CAAC;IACJ,CAAC;CACO,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the code-first data workflow authoring surface.
|
|
3
|
+
*
|
|
4
|
+
* A `DataWorkflowModule` is the developer-facing unit of authoring: it declares
|
|
5
|
+
* a trigger, an optional filter, and a handler that compiles down to the existing
|
|
6
|
+
* flow/workflow graph on deploy.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Trigger specification describing what event starts a workflow.
|
|
10
|
+
*/
|
|
11
|
+
export interface TriggerSpec {
|
|
12
|
+
kind: 'queue' | 'connector' | 'schedule' | 'webhook';
|
|
13
|
+
/** Typed constant reference from the generated artifact (queue or connector). */
|
|
14
|
+
ref?: {
|
|
15
|
+
id: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
};
|
|
18
|
+
/** Cron expression, for kind:'schedule'. */
|
|
19
|
+
schedule?: string;
|
|
20
|
+
/** URL path, for kind:'webhook'. */
|
|
21
|
+
path?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A typed queue constant from the Generated_SDK_Artifact.
|
|
25
|
+
*/
|
|
26
|
+
export interface QueueRef {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A typed connector constant from the Generated_SDK_Artifact.
|
|
32
|
+
*/
|
|
33
|
+
export interface ConnectorRef {
|
|
34
|
+
id: string;
|
|
35
|
+
type: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Context object passed to the handler function during execution.
|
|
39
|
+
*/
|
|
40
|
+
export interface HandlerContext {
|
|
41
|
+
/** The workflow name. */
|
|
42
|
+
workflowName: string;
|
|
43
|
+
/** The attached instance ID. */
|
|
44
|
+
instanceId: string;
|
|
45
|
+
/** The project ID. */
|
|
46
|
+
projectId: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Spec for a Human Approval Node in the workflow graph.
|
|
50
|
+
* Events pause at this node pending a human decision, then route to
|
|
51
|
+
* an approved or rejected downstream path.
|
|
52
|
+
*/
|
|
53
|
+
export interface ApprovalNodeSpec {
|
|
54
|
+
kind: 'approval';
|
|
55
|
+
/** Node name, 1–128 characters. */
|
|
56
|
+
name: string;
|
|
57
|
+
/** Approval channel identifier, 1–256 characters. */
|
|
58
|
+
approvalChannel: string;
|
|
59
|
+
/** Hours before the approval request expires, 1–168. */
|
|
60
|
+
timeoutHours: number;
|
|
61
|
+
/** Optional human-readable description. */
|
|
62
|
+
description?: string;
|
|
63
|
+
/** Name of the upstream node feeding events into this node. */
|
|
64
|
+
upstream: string;
|
|
65
|
+
/** Name of the downstream node receiving approved events. */
|
|
66
|
+
approved?: string;
|
|
67
|
+
/** Name of the downstream node receiving rejected/expired events. */
|
|
68
|
+
rejected?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Spec for an Agent Node in the workflow graph.
|
|
72
|
+
* Each event is processed by an AI model; the structured result flows downstream.
|
|
73
|
+
*/
|
|
74
|
+
export interface AgentNodeSpec {
|
|
75
|
+
kind: 'agent';
|
|
76
|
+
/** Node name, 1–128 characters. */
|
|
77
|
+
name: string;
|
|
78
|
+
/** Model identifier, 1–256 characters. */
|
|
79
|
+
modelId: string;
|
|
80
|
+
/** Prompt template rendered with event data, 1–10000 characters. */
|
|
81
|
+
promptTemplate: string;
|
|
82
|
+
/** Maximum seconds to wait for model response, 1–300. Defaults to 30. */
|
|
83
|
+
timeoutSeconds?: number;
|
|
84
|
+
/** JSON Schema describing expected model output structure, ≤50KB. */
|
|
85
|
+
outputSchema?: object;
|
|
86
|
+
/** Optional human-readable description. */
|
|
87
|
+
description?: string;
|
|
88
|
+
/** Name of the upstream node feeding events into this node. */
|
|
89
|
+
upstream: string;
|
|
90
|
+
/** Name of the downstream node receiving failed invocation events. */
|
|
91
|
+
error?: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* A code-first data workflow module declaration.
|
|
95
|
+
* Created via `defineDataWorkflow()`.
|
|
96
|
+
*/
|
|
97
|
+
export interface DataWorkflowModule {
|
|
98
|
+
/** Workflow name, 1–64 characters (R3.1, R3.8). */
|
|
99
|
+
name: string;
|
|
100
|
+
/** 1–10 triggers that start this workflow (R3.1, R3.8). */
|
|
101
|
+
triggers: TriggerSpec[];
|
|
102
|
+
/** Optional event filter predicate. */
|
|
103
|
+
filter?: (event: unknown) => boolean;
|
|
104
|
+
/** The workflow handler function. */
|
|
105
|
+
handler: (ctx: HandlerContext, event: unknown) => Promise<void> | void;
|
|
106
|
+
/** Operation names requiring human approval, ≤100 entries, each 1–256 chars (R6.1). */
|
|
107
|
+
requireApproval?: string[];
|
|
108
|
+
/** Declarative graph nodes (approval gates, agent invocations) compiled to graph ops on deploy (R9.3). */
|
|
109
|
+
nodes?: Array<ApprovalNodeSpec | AgentNodeSpec>;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/authoring/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;IACrD,iFAAiF;IACjF,GAAG,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,C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AE,MAAM,CAAC;IACjB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,uCAAuC;IACvC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IACrC,qCAAqC;IACrC,OAAO,EAAE,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACvE,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,0GAA0G;IAC1G,KAAK,CAAC,EAAE,KAAK,CAAC,gBAAgB,GAAG,aAAa,CAAC,CAAC;CACjD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the code-first data workflow authoring surface.
|
|
3
|
+
*
|
|
4
|
+
* A `DataWorkflowModule` is the developer-facing unit of authoring: it declares
|
|
5
|
+
* a trigger, an optional filter, and a handler that compiles down to the existing
|
|
6
|
+
* flow/workflow graph on deploy.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/authoring/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI: loxtep activity list [--source <s>] [--actor <a>] [--resource-type <t>] [--from <date>] [--to <date>]
|
|
3
|
+
*
|
|
4
|
+
* Lists activity and audit entries from the unified Activity/Audit read-model API.
|
|
5
|
+
* Ordered by UTC timestamp DESC with stable entry_id tie-break.
|
|
6
|
+
* Applies source/actor/resource-type/time-range filters combined with AND (R7.4).
|
|
7
|
+
* Synchronous read — R18.6 carve-out.
|
|
8
|
+
*
|
|
9
|
+
* Requirements: 7.4, 18.5
|
|
10
|
+
*/
|
|
11
|
+
import type { LoxtepClient } from '../../client/loxtep-client.js';
|
|
12
|
+
import type { CliResult } from '../project-context.js';
|
|
13
|
+
export interface ActivityListOptions {
|
|
14
|
+
source?: string;
|
|
15
|
+
actor?: string;
|
|
16
|
+
resource_type?: string;
|
|
17
|
+
from?: string;
|
|
18
|
+
to?: string;
|
|
19
|
+
limit?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Execute `loxtep activity list`.
|
|
23
|
+
*
|
|
24
|
+
* Lists activity and audit entries from the platform, applying optional filters.
|
|
25
|
+
* Does NOT require an attached project — operates at the organization level.
|
|
26
|
+
*/
|
|
27
|
+
export declare function runActivityListCommand(client: LoxtepClient, options?: ActivityListOptions): Promise<CliResult>;
|
|
28
|
+
//# sourceMappingURL=activity-cmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-cmd.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/activity-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,SAAS,CAAC,CA0DpB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI: loxtep activity list [--source <s>] [--actor <a>] [--resource-type <t>] [--from <date>] [--to <date>]
|
|
3
|
+
*
|
|
4
|
+
* Lists activity and audit entries from the unified Activity/Audit read-model API.
|
|
5
|
+
* Ordered by UTC timestamp DESC with stable entry_id tie-break.
|
|
6
|
+
* Applies source/actor/resource-type/time-range filters combined with AND (R7.4).
|
|
7
|
+
* Synchronous read — R18.6 carve-out.
|
|
8
|
+
*
|
|
9
|
+
* Requirements: 7.4, 18.5
|
|
10
|
+
*/
|
|
11
|
+
const VALID_SOURCES = ['cli', 'sdk', 'mcp', 'ui'];
|
|
12
|
+
/**
|
|
13
|
+
* Execute `loxtep activity list`.
|
|
14
|
+
*
|
|
15
|
+
* Lists activity and audit entries from the platform, applying optional filters.
|
|
16
|
+
* Does NOT require an attached project — operates at the organization level.
|
|
17
|
+
*/
|
|
18
|
+
export async function runActivityListCommand(client, options) {
|
|
19
|
+
try {
|
|
20
|
+
// Validate source filter
|
|
21
|
+
if (options?.source && !VALID_SOURCES.includes(options.source)) {
|
|
22
|
+
return {
|
|
23
|
+
exitCode: 1,
|
|
24
|
+
stdout: [],
|
|
25
|
+
stderr: [
|
|
26
|
+
`Invalid source filter: '${options.source}'. Must be one of: ${VALID_SOURCES.join(', ')}.`,
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const filters = {};
|
|
31
|
+
if (options?.source)
|
|
32
|
+
filters.source = options.source;
|
|
33
|
+
if (options?.actor)
|
|
34
|
+
filters.actor = options.actor;
|
|
35
|
+
if (options?.resource_type)
|
|
36
|
+
filters.resource_type = options.resource_type;
|
|
37
|
+
if (options?.from)
|
|
38
|
+
filters.start = options.from;
|
|
39
|
+
if (options?.to)
|
|
40
|
+
filters.end = options.to;
|
|
41
|
+
if (options?.limit != null)
|
|
42
|
+
filters.limit = options.limit;
|
|
43
|
+
const result = await client.activity.list(filters);
|
|
44
|
+
const { entries } = result;
|
|
45
|
+
if (entries.length === 0) {
|
|
46
|
+
return { exitCode: 0, stdout: ['No activity entries found.'], stderr: [] };
|
|
47
|
+
}
|
|
48
|
+
const lines = [];
|
|
49
|
+
for (const entry of entries) {
|
|
50
|
+
const kindTag = entry.kind === 'action_trace' ? 'TRACE' : 'AUDIT';
|
|
51
|
+
const outcomeTag = entry.outcome ? ` [${entry.outcome}]` : '';
|
|
52
|
+
const sourceTag = entry.source ? ` (${entry.source})` : '';
|
|
53
|
+
lines.push(`${entry.timestamp} ${kindTag}${outcomeTag}${sourceTag} ${entry.operation_name}`);
|
|
54
|
+
if (entry.workflow_name) {
|
|
55
|
+
lines.push(` Workflow: ${entry.workflow_name}`);
|
|
56
|
+
}
|
|
57
|
+
if (entry.actor) {
|
|
58
|
+
lines.push(` Actor: ${entry.actor}`);
|
|
59
|
+
}
|
|
60
|
+
if (entry.target_resource) {
|
|
61
|
+
lines.push(` Target: ${entry.target_resource}`);
|
|
62
|
+
}
|
|
63
|
+
if (entry.resource_type && entry.resource_id) {
|
|
64
|
+
lines.push(` Resource: ${entry.resource_type}/${entry.resource_id}`);
|
|
65
|
+
}
|
|
66
|
+
if (entry.skill_name) {
|
|
67
|
+
lines.push(` Skill: ${entry.skill_name}`);
|
|
68
|
+
}
|
|
69
|
+
lines.push('');
|
|
70
|
+
}
|
|
71
|
+
return { exitCode: 0, stdout: lines, stderr: [] };
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
75
|
+
return { exitCode: 1, stdout: [], stderr: [`Failed to list activity: ${message}`] };
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=activity-cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-cmd.js","sourceRoot":"","sources":["../../../src/cli/commands/activity-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,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,CAAC,CAAC;YACxE,CAAC;YACD,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;gBACrB,KAAK,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;YAC7C,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACpD,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,4BAA4B,OAAO,EAAE,CAAC,EAAE,CAAC;IACtF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `loxtep attach [--instance <id>]`
|
|
3
|
+
*
|
|
4
|
+
* Links the project to an existing Instance using the same connection mechanism
|
|
5
|
+
* the Platform_UI uses (client.projects + client.instances / update_project).
|
|
6
|
+
*
|
|
7
|
+
* On success: writes resolved `instance_id` + `api_url` atomically into
|
|
8
|
+
* `.loxtep/project.json`, including a `repository` block when the project is
|
|
9
|
+
* GitHub-bound (R17.2) and omitting it when unbound (R17.3).
|
|
10
|
+
*
|
|
11
|
+
* On failure: exits non-zero, prints the failure reason, and leaves
|
|
12
|
+
* `.loxtep/project.json` byte-unchanged (R1.9).
|
|
13
|
+
*/
|
|
14
|
+
import type { LoxtepClient } from '../../client/loxtep-client.js';
|
|
15
|
+
import type { Project } from '../../client/projects-types.js';
|
|
16
|
+
import { type CliResult, type ProjectRepository } from '../project-context.js';
|
|
17
|
+
export interface AttachOptions {
|
|
18
|
+
/** Explicit instance ID from `--instance <id>`. When omitted, the org's sole instance is used. */
|
|
19
|
+
instanceId?: string;
|
|
20
|
+
/** Working directory override (defaults to `process.cwd()`). */
|
|
21
|
+
cwd?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Project the GitHub binding fields from a project record into a
|
|
25
|
+
* {@link ProjectRepository} block, or `undefined` when the project is unbound.
|
|
26
|
+
*
|
|
27
|
+
* A project is considered bound when it has both `github_repo_url` and
|
|
28
|
+
* `github_repo_name` present and non-empty.
|
|
29
|
+
*/
|
|
30
|
+
export declare function projectToRepository(project: Project): ProjectRepository | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Core attach logic, separated from CLI wiring for testability.
|
|
33
|
+
*
|
|
34
|
+
* Returns a {@link CliResult} so the thin CLI `main()` can map `exitCode` to
|
|
35
|
+
* `process.exitCode` without spawning a process.
|
|
36
|
+
*/
|
|
37
|
+
export declare function runAttach(client: LoxtepClient, options?: AttachOptions): Promise<CliResult>;
|
|
38
|
+
//# sourceMappingURL=attach-cmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach-cmd.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/attach-cmd.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAIL,KAAK,SAAS,EAEd,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,aAAa;IAC5B,kGAAkG;IAClG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,iBAAiB,GAAG,SAAS,CAoBnF;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,MAAM,EAAE,YAAY,EACpB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,SAAS,CAAC,CAwEpB"}
|