@cef-ai/cli 0.2.7 → 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.
Files changed (127) hide show
  1. package/README.md +75 -1247
  2. package/dist/build/duration.d.ts +22 -0
  3. package/dist/build/duration.d.ts.map +1 -0
  4. package/dist/build/duration.js +44 -0
  5. package/dist/build/duration.js.map +1 -0
  6. package/dist/build/esbuild-plugin.d.ts +32 -0
  7. package/dist/build/esbuild-plugin.d.ts.map +1 -0
  8. package/dist/build/esbuild-plugin.js +53 -0
  9. package/dist/build/esbuild-plugin.js.map +1 -0
  10. package/dist/build/lints.d.ts +55 -0
  11. package/dist/build/lints.d.ts.map +1 -0
  12. package/dist/build/lints.js +214 -0
  13. package/dist/build/lints.js.map +1 -0
  14. package/dist/build/load-config.d.ts +114 -0
  15. package/dist/build/load-config.d.ts.map +1 -0
  16. package/dist/build/load-config.js +150 -0
  17. package/dist/build/load-config.js.map +1 -0
  18. package/dist/build/manifest.d.ts +156 -0
  19. package/dist/build/manifest.d.ts.map +1 -0
  20. package/dist/build/manifest.js +111 -0
  21. package/dist/build/manifest.js.map +1 -0
  22. package/dist/build/targeting.d.ts +15 -0
  23. package/dist/build/targeting.d.ts.map +1 -0
  24. package/dist/build/targeting.js +69 -0
  25. package/dist/build/targeting.js.map +1 -0
  26. package/dist/cli.d.ts +2 -2
  27. package/dist/cli.d.ts.map +1 -0
  28. package/dist/cli.js +107 -62
  29. package/dist/cli.js.map +1 -0
  30. package/dist/commands/build.d.ts +41 -0
  31. package/dist/commands/build.d.ts.map +1 -0
  32. package/dist/commands/build.js +252 -0
  33. package/dist/commands/build.js.map +1 -0
  34. package/dist/commands/inspect.d.ts +49 -0
  35. package/dist/commands/inspect.d.ts.map +1 -0
  36. package/dist/commands/inspect.js +135 -0
  37. package/dist/commands/inspect.js.map +1 -0
  38. package/dist/commands/typegen.d.ts +36 -0
  39. package/dist/commands/typegen.d.ts.map +1 -0
  40. package/dist/commands/typegen.js +210 -0
  41. package/dist/commands/typegen.js.map +1 -0
  42. package/dist/index.d.ts +6 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +6 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/lib.d.ts +12 -0
  47. package/dist/lib.d.ts.map +1 -0
  48. package/dist/lib.js +9 -0
  49. package/dist/lib.js.map +1 -0
  50. package/dist/typegen/augment.d.ts +57 -0
  51. package/dist/typegen/augment.d.ts.map +1 -0
  52. package/dist/typegen/augment.js +87 -0
  53. package/dist/typegen/augment.js.map +1 -0
  54. package/dist/typegen/fetch.d.ts +30 -0
  55. package/dist/typegen/fetch.d.ts.map +1 -0
  56. package/dist/typegen/fetch.js +38 -0
  57. package/dist/typegen/fetch.js.map +1 -0
  58. package/dist/typegen/lockfile.d.ts +42 -0
  59. package/dist/typegen/lockfile.d.ts.map +1 -0
  60. package/dist/typegen/lockfile.js +58 -0
  61. package/dist/typegen/lockfile.js.map +1 -0
  62. package/dist/typegen/schema-to-ts.d.ts +21 -0
  63. package/dist/typegen/schema-to-ts.d.ts.map +1 -0
  64. package/dist/typegen/schema-to-ts.js +29 -0
  65. package/dist/typegen/schema-to-ts.js.map +1 -0
  66. package/package.json +20 -58
  67. package/dist/commands/auth/index.d.ts +0 -2
  68. package/dist/commands/auth/index.js +0 -162
  69. package/dist/commands/deploy/clone.d.ts +0 -13
  70. package/dist/commands/deploy/clone.js +0 -143
  71. package/dist/commands/deploy/delete.d.ts +0 -14
  72. package/dist/commands/deploy/delete.js +0 -134
  73. package/dist/commands/deploy/deploy.d.ts +0 -24
  74. package/dist/commands/deploy/deploy.js +0 -654
  75. package/dist/commands/deploy/index.d.ts +0 -2
  76. package/dist/commands/deploy/index.js +0 -216
  77. package/dist/commands/deploy/status.d.ts +0 -14
  78. package/dist/commands/deploy/status.js +0 -61
  79. package/dist/commands/dev/index.d.ts +0 -2
  80. package/dist/commands/dev/index.js +0 -134
  81. package/dist/commands/dev/server.d.ts +0 -14
  82. package/dist/commands/dev/server.js +0 -195
  83. package/dist/commands/dev/static/app.js +0 -633
  84. package/dist/commands/dev/static/index.html +0 -205
  85. package/dist/commands/dev/static/static/app.js +0 -633
  86. package/dist/commands/dev/static/static/index.html +0 -205
  87. package/dist/commands/dev/static/static/style.css +0 -184
  88. package/dist/commands/dev/static/style.css +0 -184
  89. package/dist/commands/playground/index.d.ts +0 -2
  90. package/dist/commands/playground/index.js +0 -75
  91. package/dist/commands/playground/test.d.ts +0 -15
  92. package/dist/commands/playground/test.js +0 -166
  93. package/dist/commands/service/index.d.ts +0 -2
  94. package/dist/commands/service/index.js +0 -89
  95. package/dist/lib/api.d.ts +0 -146
  96. package/dist/lib/api.js +0 -330
  97. package/dist/lib/config.d.ts +0 -12
  98. package/dist/lib/config.js +0 -145
  99. package/dist/lib/credentials.d.ts +0 -19
  100. package/dist/lib/credentials.js +0 -68
  101. package/dist/lib/runtime/agent-router.d.ts +0 -12
  102. package/dist/lib/runtime/agent-router.js +0 -67
  103. package/dist/lib/runtime/context-builder.d.ts +0 -27
  104. package/dist/lib/runtime/context-builder.js +0 -166
  105. package/dist/lib/runtime/cubby-manager.d.ts +0 -20
  106. package/dist/lib/runtime/cubby-manager.js +0 -162
  107. package/dist/lib/runtime/index.d.ts +0 -51
  108. package/dist/lib/runtime/index.js +0 -181
  109. package/dist/lib/runtime/log-collector.d.ts +0 -17
  110. package/dist/lib/runtime/log-collector.js +0 -61
  111. package/dist/lib/runtime/stream-manager.d.ts +0 -10
  112. package/dist/lib/runtime/stream-manager.js +0 -77
  113. package/dist/lib/runtime/types.d.ts +0 -76
  114. package/dist/lib/runtime/types.js +0 -2
  115. package/dist/lib/transpile.d.ts +0 -1
  116. package/dist/lib/transpile.js +0 -9
  117. package/dist/lib/typecheck.d.ts +0 -31
  118. package/dist/lib/typecheck.js +0 -175
  119. package/dist/lib/types.d.ts +0 -246
  120. package/dist/lib/types.js +0 -2
  121. package/dist/lib/utils.d.ts +0 -4
  122. package/dist/lib/utils.js +0 -33
  123. package/example/.env.example +0 -6
  124. package/example/agents/object-detection/tasks/yolo.ts +0 -28
  125. package/example/agents/parking-violation-detector/tasks/detect.ts +0 -326
  126. package/example/cef.config.yaml +0 -91
  127. package/example/engagements/engagement.ts +0 -902
@@ -1,77 +0,0 @@
1
- class PushableStreamImpl {
2
- queue = [];
3
- resolve = null;
4
- ended = false;
5
- push(packet) {
6
- if (this.ended)
7
- return;
8
- if (this.resolve) {
9
- const r = this.resolve;
10
- this.resolve = null;
11
- r({ value: packet, done: false });
12
- }
13
- else {
14
- this.queue.push(packet);
15
- }
16
- }
17
- end() {
18
- this.ended = true;
19
- if (this.resolve) {
20
- const r = this.resolve;
21
- this.resolve = null;
22
- r({ value: undefined, done: true });
23
- }
24
- }
25
- [Symbol.asyncIterator]() {
26
- return {
27
- next: () => {
28
- if (this.queue.length > 0) {
29
- return Promise.resolve({ value: this.queue.shift(), done: false });
30
- }
31
- if (this.ended) {
32
- return Promise.resolve({ value: undefined, done: true });
33
- }
34
- return new Promise(resolve => {
35
- this.resolve = resolve;
36
- });
37
- },
38
- };
39
- }
40
- }
41
- export class StreamManager {
42
- streams = new Map();
43
- createStream(streamId) {
44
- if (this.streams.has(streamId)) {
45
- throw new Error(`Stream "${streamId}" already exists`);
46
- }
47
- const stream = new PushableStreamImpl();
48
- this.streams.set(streamId, stream);
49
- return stream;
50
- }
51
- getStream(streamId) {
52
- const stream = this.streams.get(streamId);
53
- if (!stream) {
54
- throw new Error(`No active stream "${streamId}"`);
55
- }
56
- return stream;
57
- }
58
- pushToStream(streamId, packet) {
59
- this.getStream(streamId).push(packet);
60
- }
61
- hasStream(streamId) {
62
- return this.streams.has(streamId);
63
- }
64
- removeStream(streamId) {
65
- const stream = this.streams.get(streamId);
66
- if (stream) {
67
- stream.end();
68
- this.streams.delete(streamId);
69
- }
70
- }
71
- shutdown() {
72
- for (const stream of this.streams.values()) {
73
- stream.end();
74
- }
75
- this.streams.clear();
76
- }
77
- }
@@ -1,76 +0,0 @@
1
- export interface LogEntry {
2
- timestamp: number;
3
- executionId: string;
4
- agentAlias?: string;
5
- taskAlias?: string;
6
- level: 'log' | 'warn' | 'error';
7
- args: unknown[];
8
- }
9
- export interface CallChainEntry {
10
- caller: string;
11
- callee: string;
12
- timestamp: number;
13
- durationMs?: number;
14
- success: boolean;
15
- }
16
- export interface EngagementHandle {
17
- executionId: string;
18
- pushPacket(data: unknown): void;
19
- stop(): void;
20
- }
21
- export interface TriggerResult {
22
- executionId: string;
23
- started: boolean;
24
- error?: string;
25
- }
26
- export interface AgentCallResult {
27
- success: boolean;
28
- result?: unknown;
29
- error?: string;
30
- durationMs: number;
31
- }
32
- export interface DevServerOptions {
33
- port: number;
34
- host: string;
35
- configPath: string;
36
- }
37
- export interface TraceEvent {
38
- timestamp: number;
39
- executionId: string;
40
- type: 'engagement:start' | 'agent:call' | 'agent:return' | 'cubby:query' | 'cubby:exec';
41
- caller?: string;
42
- callee?: string;
43
- cubbyAlias?: string;
44
- sql?: string;
45
- durationMs?: number;
46
- success?: boolean;
47
- error?: string;
48
- rowsAffected?: number;
49
- rowsRead?: number;
50
- }
51
- export interface QueryResult {
52
- columns: string[];
53
- rows: unknown[][] | null;
54
- meta: {
55
- duration: number;
56
- rowsRead: number;
57
- };
58
- }
59
- export interface ExecResult {
60
- rowsAffected: number;
61
- lastInsertId: number;
62
- meta: {
63
- duration: number;
64
- rowsRead: number;
65
- };
66
- }
67
- export interface StreamPacket {
68
- sequenceNum: number;
69
- payload: Uint8Array;
70
- metadata?: Record<string, unknown>;
71
- }
72
- export interface PushableStream {
73
- push(packet: StreamPacket): void;
74
- end(): void;
75
- [Symbol.asyncIterator](): AsyncIterator<StreamPacket>;
76
- }
@@ -1,2 +0,0 @@
1
- // ─── Local runtime types for cef dev ───────────────────────────────────────
2
- export {};
@@ -1 +0,0 @@
1
- export declare function transpileTypeScript(code: string): string;
@@ -1,9 +0,0 @@
1
- import { transformSync } from 'esbuild';
2
- export function transpileTypeScript(code) {
3
- const result = transformSync(code, {
4
- loader: 'ts',
5
- target: 'es2022',
6
- format: 'esm',
7
- });
8
- return result.code;
9
- }
@@ -1,31 +0,0 @@
1
- export interface TypeCheckError {
2
- file: string;
3
- line: number;
4
- message: string;
5
- }
6
- export interface TypecheckContext {
7
- agentAliases?: string[];
8
- cubbyAliases?: string[];
9
- }
10
- export declare function typecheckFile(filePath: string, ctx?: TypecheckContext): TypeCheckError[];
11
- export declare function typecheckAll(config: {
12
- engagements?: Array<{
13
- _resolvedFilePath?: string;
14
- }>;
15
- agents?: Array<{
16
- alias: string;
17
- tasks: Array<{
18
- _resolvedFilePath?: string;
19
- }>;
20
- }>;
21
- cubbies?: Array<{
22
- alias: string;
23
- }>;
24
- workspaces?: Array<{
25
- streams?: Array<{
26
- rafts?: Array<{
27
- _resolvedFilePath?: string;
28
- }>;
29
- }>;
30
- }>;
31
- }): TypeCheckError[];
@@ -1,175 +0,0 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import os from 'os';
4
- import ts from 'typescript';
5
- // Extracted from UI/ROB/dynamic-indexer-client/src/components/CodeEditor.tsx
6
- // contextTemplate + additionalTypeDefinitions, with dynamic placeholders replaced by `any`
7
- const CEF_TYPE_DEFS = `
8
- interface Packet { data: any; metadata?: any; }
9
-
10
- interface RaftContext { log(msg: string, ...args: any[]): void; }
11
-
12
- interface RaftAgentContext {
13
- stream: { id: string; parentId: string; metadata: any; };
14
- rafts: string[];
15
- query(dataStreamId: string, raftId: string, request: any): Promise<any>;
16
- }
17
-
18
- interface RaftInfo { raftDefId: string; dataStreamId: string; }
19
-
20
- interface SetOptions { ttl?: number; nx?: boolean; xx?: boolean; }
21
-
22
- interface VectorSearchOptions { k?: number; filter?: string; }
23
- interface VectorMatch { id: string; score: number; metadata?: Record<string, any>; }
24
-
25
- interface QueryResult {
26
- columns: string[];
27
- rows: unknown[][] | null;
28
- meta: { duration: number; rowsRead: number };
29
- }
30
-
31
- interface ExecResult {
32
- rowsAffected: number;
33
- lastInsertId: number;
34
- meta: { duration: number; rowsRead: number };
35
- }
36
-
37
- interface CubbyHandle {
38
- query(sql: string, params?: unknown[]): Promise<QueryResult>;
39
- query(instanceId: string, sql: string, params?: unknown[]): Promise<QueryResult>;
40
- exec(sql: string, params?: unknown[]): Promise<ExecResult>;
41
- exec(instanceId: string, sql: string, params?: unknown[]): Promise<ExecResult>;
42
- }
43
-
44
- interface StreamIterator { [Symbol.asyncIterator](): AsyncIterator<any>; }
45
-
46
- declare interface Agent { invoke(params: any): Promise<any>; }
47
-
48
- declare interface Context {
49
- fetch(url: string, options?: any): Promise<Response>;
50
- emit(eventType: string, payload: any, targetId?: string): void;
51
- log(message: string, ...args: any[]): void;
52
- warn(message: string, ...args: any[]): void;
53
- error(message: string, ...args: any[]): void;
54
- streams: { subscribe(streamId: string): Promise<StreamIterator>; };
55
- cubbies: Record<string, CubbyHandle>;
56
- agents: Record<string, any>;
57
- rafts: RaftAgentContext;
58
- }
59
-
60
- declare const context: Context;
61
-
62
- interface Event {
63
- app_id: string;
64
- account_id: string;
65
- app_pub_key: string;
66
- connection_id: string;
67
- data_service_pub_key: string;
68
- event_type: string;
69
- id: string;
70
- payload: Record<string, any>;
71
- session_id: string;
72
- signature: string;
73
- signing: string;
74
- timestamp: string;
75
- }
76
- `;
77
- function buildCefTypeDefs(ctx) {
78
- let defs = CEF_TYPE_DEFS;
79
- if (ctx?.agentAliases) {
80
- const agentsType = ctx.agentAliases.length > 0
81
- ? `{ ${ctx.agentAliases.map(a => `${JSON.stringify(a)}: Agent;`).join(' ')} }`
82
- : '{}';
83
- defs = defs.replace('agents: Record<string, any>;', `agents: ${agentsType};`);
84
- }
85
- if (ctx?.cubbyAliases && ctx.cubbyAliases.length > 0) {
86
- const cubbiesType = `{ ${ctx.cubbyAliases.map(a => `${JSON.stringify(a)}: CubbyHandle;`).join(' ')} }`;
87
- defs = defs.replace('cubbies: Record<string, CubbyHandle>;', `cubbies: ${cubbiesType};`);
88
- }
89
- return defs;
90
- }
91
- // Diagnostic codes to suppress (unresolvable imports are not our concern)
92
- const SUPPRESSED_CODES = new Set([
93
- 2307, // Cannot find module 'X'
94
- 2792, // Cannot find module 'X' (alternative)
95
- ]);
96
- const CEF_COMPILER_OPTIONS = {
97
- noEmit: true,
98
- strict: false,
99
- skipLibCheck: true,
100
- noImplicitAny: false,
101
- target: ts.ScriptTarget.ES2022,
102
- module: ts.ModuleKind.CommonJS,
103
- moduleResolution: ts.ModuleResolutionKind.Node10,
104
- lib: ['lib.es2022.d.ts'],
105
- };
106
- export function typecheckFile(filePath, ctx) {
107
- const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'cef-typecheck-'));
108
- const defsPath = path.join(tmpDir, 'cef-context.d.ts');
109
- try {
110
- fs.writeFileSync(defsPath, buildCefTypeDefs(ctx));
111
- return typecheckFileWithDefs(filePath, defsPath);
112
- }
113
- finally {
114
- fs.rmSync(tmpDir, { recursive: true, force: true });
115
- }
116
- }
117
- /** Typecheck a single file using a pre-written defs file. Shared by typecheckAll. */
118
- function typecheckFileWithDefs(filePath, defsPath) {
119
- const program = ts.createProgram([filePath, defsPath], CEF_COMPILER_OPTIONS);
120
- const diagnostics = ts.getPreEmitDiagnostics(program);
121
- return [...diagnostics]
122
- .filter(d => d.file && path.resolve(d.file.fileName) === path.resolve(filePath))
123
- .filter(d => !SUPPRESSED_CODES.has(d.code))
124
- .map(d => {
125
- const pos = d.file.getLineAndCharacterOfPosition(d.start ?? 0);
126
- return {
127
- file: path.basename(filePath),
128
- line: pos.line + 1,
129
- message: ts.flattenDiagnosticMessageText(d.messageText, ' '),
130
- };
131
- });
132
- }
133
- export function typecheckAll(config) {
134
- const ctx = {
135
- agentAliases: config.agents?.map(a => a.alias) ?? [],
136
- cubbyAliases: config.cubbies?.map(c => c.alias) ?? [],
137
- };
138
- // Collect all files to typecheck
139
- const files = [];
140
- for (const eng of config.engagements ?? []) {
141
- if (eng._resolvedFilePath)
142
- files.push(eng._resolvedFilePath);
143
- }
144
- for (const agent of config.agents ?? []) {
145
- for (const task of agent.tasks) {
146
- if (task._resolvedFilePath)
147
- files.push(task._resolvedFilePath);
148
- }
149
- }
150
- // Cubbies have no file references to typecheck (migrations are inline SQL)
151
- for (const ws of config.workspaces ?? []) {
152
- for (const stream of ws.streams ?? []) {
153
- for (const raft of stream.rafts ?? []) {
154
- if (raft._resolvedFilePath)
155
- files.push(raft._resolvedFilePath);
156
- }
157
- }
158
- }
159
- if (files.length === 0)
160
- return [];
161
- // Create one temp dir, write defs once, check all files, clean up once
162
- const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'cef-typecheck-'));
163
- const defsPath = path.join(tmpDir, 'cef-context.d.ts');
164
- try {
165
- fs.writeFileSync(defsPath, buildCefTypeDefs(ctx));
166
- const errors = [];
167
- for (const filePath of files) {
168
- errors.push(...typecheckFileWithDefs(filePath, defsPath));
169
- }
170
- return errors;
171
- }
172
- finally {
173
- fs.rmSync(tmpDir, { recursive: true, force: true });
174
- }
175
- }
@@ -1,246 +0,0 @@
1
- export interface SelectorConfig {
2
- name: string;
3
- conditions: string[];
4
- }
5
- export interface TriggerConfig {
6
- name: string;
7
- conditions: string[];
8
- }
9
- export interface DeploymentConfig {
10
- name: string;
11
- description?: string;
12
- deploymentId?: string;
13
- engagement: string;
14
- isActive?: boolean;
15
- triggers?: TriggerConfig[];
16
- engagementRules?: unknown[];
17
- }
18
- export interface RaftConfig {
19
- name: string;
20
- description?: string;
21
- raftId?: string;
22
- file?: string;
23
- tsCode?: string;
24
- _resolvedFilePath?: string;
25
- dataSourcesIds?: string[];
26
- queryOperations?: unknown[];
27
- }
28
- export interface StreamConfig {
29
- name: string;
30
- description?: string;
31
- streamId?: string;
32
- selectors?: SelectorConfig[];
33
- deployments?: DeploymentConfig[];
34
- rafts?: RaftConfig[];
35
- }
36
- export interface WorkspaceConfig {
37
- name: string;
38
- description?: string;
39
- workspaceId?: string;
40
- streams?: StreamConfig[];
41
- }
42
- export interface TaskConfig {
43
- name: string;
44
- alias: string;
45
- file: string;
46
- parameters?: Record<string, unknown>;
47
- returns?: Record<string, unknown>;
48
- tsCode?: string;
49
- _resolvedFilePath?: string;
50
- /** Local dev only: SQL file that queries a cubby to produce batch inputs */
51
- batch_file?: string;
52
- /** Local dev only: cubby alias to run batch_file query against */
53
- batch_cubby?: string;
54
- /** Resolved at startup from batch_file contents */
55
- batchSql?: string;
56
- }
57
- export interface AgentConfig {
58
- name: string;
59
- alias: string;
60
- description?: string;
61
- agentId?: string;
62
- version?: string;
63
- tasks: TaskConfig[];
64
- }
65
- export interface EngagementConfig {
66
- name: string;
67
- description?: string;
68
- engagementId?: string;
69
- file: string;
70
- version?: string;
71
- tsCode?: string;
72
- _resolvedFilePath?: string;
73
- /** Local-only: JSON Schema for expected payload. Not sent to orchestrator API. */
74
- parameters?: Record<string, unknown>;
75
- }
76
- export interface CubbyMigration {
77
- version: number;
78
- up: string;
79
- }
80
- export interface CubbyConfig {
81
- alias: string;
82
- name: string;
83
- description?: string;
84
- cubbyId?: string;
85
- migrations?: CubbyMigration[];
86
- maxSizeBytes?: number;
87
- idleTimeout?: string;
88
- }
89
- export interface CefConfig {
90
- agentServicePubKey: string;
91
- agentServiceId?: string;
92
- workspaces?: WorkspaceConfig[];
93
- engagements?: EngagementConfig[];
94
- agents?: AgentConfig[];
95
- cubbies?: CubbyConfig[];
96
- }
97
- export interface EnvConfig {
98
- authToken: string;
99
- orchestratorUrl: string;
100
- robApiUrl: string;
101
- /** Optional Origin header for ROB requests (e.g. http://localhost:5173 to match UI). */
102
- robOrigin?: string;
103
- }
104
- export interface ResolvedConfig {
105
- config: CefConfig;
106
- env: EnvConfig;
107
- configPath: string;
108
- }
109
- export interface WorkspacePayload {
110
- agentServicePubKey: string;
111
- name: string;
112
- description: string;
113
- workspaceId?: string;
114
- }
115
- export interface StreamPayload {
116
- agentServicePubKey: string;
117
- workspaceId?: string;
118
- parentId?: string;
119
- name: string;
120
- description: string;
121
- selectors: SelectorConfig[];
122
- }
123
- export interface EngagementPayload {
124
- agentServicePubKey: string;
125
- name: string;
126
- description: string;
127
- version: string;
128
- conciergeAgent: {
129
- name: string;
130
- description: string;
131
- tsCode: string;
132
- };
133
- }
134
- export interface TaskPayload {
135
- name: string;
136
- alias: string;
137
- tsCode: string;
138
- parameters: Record<string, unknown>;
139
- returns: Record<string, unknown>;
140
- }
141
- export interface AgentPayload {
142
- agentServicePubKey: string;
143
- name: string;
144
- alias: string;
145
- description: string;
146
- version: string;
147
- cid: string;
148
- tasks: TaskPayload[];
149
- }
150
- export interface AgentUpdatePayload {
151
- tasks: TaskPayload[];
152
- }
153
- export interface DeploymentPayload {
154
- name: string;
155
- description: string;
156
- isActive: boolean;
157
- streamId: string;
158
- engagements: Array<{
159
- id: string;
160
- rules: unknown[];
161
- }>;
162
- triggers: TriggerConfig[];
163
- deploymentId?: string;
164
- }
165
- export interface RaftOrchestratorPayload {
166
- alias: string;
167
- tsCode: string;
168
- }
169
- export interface CubbyCreatePayload {
170
- alias: string;
171
- name?: string;
172
- description?: string;
173
- migrations?: CubbyMigration[];
174
- maxSizeBytes?: number;
175
- idleTimeout?: string;
176
- }
177
- export interface CubbyInstance {
178
- agentServicePubKey: string;
179
- cubbyId: string;
180
- instanceId: string;
181
- nodeId: string;
182
- state: string;
183
- schemaVersion: number;
184
- sizeBytes: number;
185
- createdAt: string;
186
- lastAccessedAt: string;
187
- }
188
- export interface CubbyStats {
189
- cubbyId: string;
190
- instanceCount: number;
191
- totalSizeBytes: number;
192
- }
193
- export type EntityType = 'engagement' | 'agent' | 'cubby' | 'workspace' | 'stream' | 'deployment' | 'raft';
194
- export interface DeployResult {
195
- entity: EntityType;
196
- name: string;
197
- action: 'created' | 'updated' | 'dry-run';
198
- id?: string;
199
- }
200
- export type OnlyFilter = EntityType | undefined;
201
- export interface JsonRpcRequest {
202
- jsonrpc: '2.0';
203
- id: number;
204
- method: string;
205
- params: {
206
- name: string;
207
- arguments: Record<string, unknown>;
208
- };
209
- context: {
210
- jobId: string;
211
- workspaceId: string;
212
- engagementId: string;
213
- deploymentId: string;
214
- executionId: string;
215
- };
216
- }
217
- export interface JsonRpcResponse {
218
- jsonrpc: '2.0';
219
- id: number;
220
- result?: {
221
- data: unknown;
222
- };
223
- error?: {
224
- code: number;
225
- message: string;
226
- data?: unknown;
227
- };
228
- }
229
- export interface PlaygroundTestCase {
230
- agent: string;
231
- tool: string;
232
- arguments: Record<string, unknown>;
233
- expect?: {
234
- success?: boolean;
235
- result?: Record<string, unknown>;
236
- };
237
- }
238
- export interface PlaygroundTestResult {
239
- agent: string;
240
- tool: string;
241
- status: 'pass' | 'fail' | 'error';
242
- durationMs: number;
243
- response?: JsonRpcResponse;
244
- error?: string;
245
- expectationFailures?: string[];
246
- }
package/dist/lib/types.js DELETED
@@ -1,2 +0,0 @@
1
- // ─── Config schema types ───────────────────────────────────────────────────
2
- export {};
@@ -1,4 +0,0 @@
1
- export declare function toCamelCase(str: string | undefined | null): string;
2
- export declare function errorMessage(err: unknown): string;
3
- export declare function toFileName(name: string): string;
4
- export declare function extractId(res: Record<string, unknown>, ...keys: string[]): string;
package/dist/lib/utils.js DELETED
@@ -1,33 +0,0 @@
1
- // Matches the toCamelCase logic in ROB's CodeEditor.tsx
2
- export function toCamelCase(str) {
3
- if (!str || typeof str !== 'string')
4
- return 'unknown';
5
- const cleaned = str
6
- .replace(/[^\w\s]/g, '')
7
- .replace(/\s+/g, ' ')
8
- .trim();
9
- const result = cleaned
10
- .replace(/(?:^\w|[A-Z]|\b\w)/g, (word, index) => index === 0 ? word.toLowerCase() : word.toUpperCase())
11
- .replace(/\s+/g, '');
12
- return result.replace(/^[^a-zA-Z_]/, '_') || 'unknown';
13
- }
14
- export function errorMessage(err) {
15
- return err instanceof Error ? err.message : String(err);
16
- }
17
- export function toFileName(name) {
18
- return name
19
- .toLowerCase()
20
- .replace(/[^\w\s-]/g, '')
21
- .replace(/\s+/g, '-')
22
- .replace(/-+/g, '-')
23
- .replace(/^-|-$/g, '')
24
- || 'unknown';
25
- }
26
- export function extractId(res, ...keys) {
27
- for (const key of keys) {
28
- const val = res[key];
29
- if (typeof val === 'string' && val)
30
- return val;
31
- }
32
- return '';
33
- }
@@ -1,6 +0,0 @@
1
- CEF_AUTH_TOKEN=your-token-here
2
- CEF_ORCHESTRATOR_URL=https://orchestrator.compute.test.ddcdragon.com
3
- CEF_ROB_API_URL=https://rob.compute.test.ddcdragon.com/rms-node-backend
4
-
5
- # For E2E tests only (npm run test:e2e): agent service public key the token can use
6
- # CEF_E2E_AGENT_SERVICE_PUB_KEY=0x...
@@ -1,28 +0,0 @@
1
-
2
- async function handle(event: any, ctx: any) {
3
- const { image } = event.payload;
4
-
5
- const response = await ctx.fetch('https://compute-5.devnet.ddc-dragon.com/inference/api/v1/inference', {
6
- method: 'POST',
7
- headers: { 'Content-Type': 'application/json' },
8
- body: JSON.stringify({
9
- model: {
10
- "bucket": 1338,
11
- "name": "yolo11x_1280",
12
- "version": "v1.0.0"
13
- },
14
- input: {
15
- image: image
16
- }
17
- })
18
- }).then(res => res.json());
19
- ctx.log('Inference response', JSON.stringify(response));
20
-
21
- const detections = response.output.detections;
22
-
23
- return {
24
- totalDetections: detections.length,
25
- detections: detections,
26
- processingTime: response.metrics.inference_time
27
- };
28
- }