4runr-os 1.0.99 → 1.0.100
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/dist/ui/v3/v1Adapters/__tests__/smoke.test.d.ts +16 -0
- package/dist/ui/v3/v1Adapters/__tests__/smoke.test.d.ts.map +1 -0
- package/dist/ui/v3/v1Adapters/__tests__/smoke.test.js +141 -0
- package/dist/ui/v3/v1Adapters/__tests__/smoke.test.js.map +1 -0
- package/dist/ui/v3/v1Adapters/agents.d.ts +52 -0
- package/dist/ui/v3/v1Adapters/agents.d.ts.map +1 -0
- package/dist/ui/v3/v1Adapters/agents.js +134 -0
- package/dist/ui/v3/v1Adapters/agents.js.map +1 -0
- package/dist/ui/v3/v1Adapters/config.d.ts +62 -0
- package/dist/ui/v3/v1Adapters/config.d.ts.map +1 -0
- package/dist/ui/v3/v1Adapters/config.js +79 -0
- package/dist/ui/v3/v1Adapters/config.js.map +1 -0
- package/dist/ui/v3/v1Adapters/connect.d.ts +49 -0
- package/dist/ui/v3/v1Adapters/connect.d.ts.map +1 -0
- package/dist/ui/v3/v1Adapters/connect.js +118 -0
- package/dist/ui/v3/v1Adapters/connect.js.map +1 -0
- package/dist/ui/v3/v1Adapters/runs.d.ts +38 -0
- package/dist/ui/v3/v1Adapters/runs.d.ts.map +1 -0
- package/dist/ui/v3/v1Adapters/runs.js +93 -0
- package/dist/ui/v3/v1Adapters/runs.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smoke Test for V1 Adapters
|
|
3
|
+
*
|
|
4
|
+
* Proves adapters work without TUI
|
|
5
|
+
* - No neo-blessed imports
|
|
6
|
+
* - No stdout spam
|
|
7
|
+
* - Returns structured { ok, ... } responses
|
|
8
|
+
*
|
|
9
|
+
* Run: npm test (or node dist/ui/v3/v1Adapters/__tests__/smoke.test.js)
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Main smoke test
|
|
13
|
+
*/
|
|
14
|
+
declare function runSmokeTest(): Promise<void>;
|
|
15
|
+
export { runSmokeTest };
|
|
16
|
+
//# sourceMappingURL=smoke.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smoke.test.d.ts","sourceRoot":"","sources":["../../../../../src/ui/v3/v1Adapters/__tests__/smoke.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAgHH;;GAEG;AACH,iBAAe,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CA6B3C;AAUD,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smoke Test for V1 Adapters
|
|
3
|
+
*
|
|
4
|
+
* Proves adapters work without TUI
|
|
5
|
+
* - No neo-blessed imports
|
|
6
|
+
* - No stdout spam
|
|
7
|
+
* - Returns structured { ok, ... } responses
|
|
8
|
+
*
|
|
9
|
+
* Run: npm test (or node dist/ui/v3/v1Adapters/__tests__/smoke.test.js)
|
|
10
|
+
*/
|
|
11
|
+
import { listAgents, getAgent, createAgent } from '../agents.js';
|
|
12
|
+
import { connect, getConnectionState } from '../connect.js';
|
|
13
|
+
import { loadConfig, getProviders } from '../config.js';
|
|
14
|
+
/**
|
|
15
|
+
* Test agents adapter
|
|
16
|
+
*/
|
|
17
|
+
async function testAgents() {
|
|
18
|
+
console.log('[TEST] Testing agents adapter...');
|
|
19
|
+
// Test listAgents (should work even if file doesn't exist)
|
|
20
|
+
const listResult = listAgents();
|
|
21
|
+
if (!listResult.ok) {
|
|
22
|
+
console.error('[FAIL] listAgents failed:', listResult.error);
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
console.log(`[PASS] listAgents returned ${listResult.data.length} agents`);
|
|
26
|
+
// Test getAgent with non-existent agent (should return NOT_FOUND)
|
|
27
|
+
const getResult = getAgent('non-existent-agent-12345');
|
|
28
|
+
if (getResult.ok) {
|
|
29
|
+
console.error('[FAIL] getAgent should return NOT_FOUND for non-existent agent');
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
if (getResult.error.code !== 'NOT_FOUND') {
|
|
33
|
+
console.error('[FAIL] getAgent should return NOT_FOUND code, got:', getResult.error.code);
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
console.log('[PASS] getAgent correctly returns NOT_FOUND for non-existent agent');
|
|
37
|
+
// Test createAgent with valid agent
|
|
38
|
+
const testAgent = {
|
|
39
|
+
name: `test-agent-${Date.now()}`,
|
|
40
|
+
description: 'Test agent for smoke test',
|
|
41
|
+
baseAgent: 'gpt-3.5-turbo',
|
|
42
|
+
temperature: 0.7
|
|
43
|
+
};
|
|
44
|
+
const createResult = createAgent(testAgent);
|
|
45
|
+
if (!createResult.ok) {
|
|
46
|
+
console.error('[FAIL] createAgent failed:', createResult.error);
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
console.log('[PASS] createAgent successfully created agent');
|
|
50
|
+
// Test getAgent with newly created agent
|
|
51
|
+
const getCreatedResult = getAgent(testAgent.name);
|
|
52
|
+
if (!getCreatedResult.ok) {
|
|
53
|
+
console.error('[FAIL] getAgent failed for newly created agent:', getCreatedResult.error);
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
if (getCreatedResult.data.name !== testAgent.name) {
|
|
57
|
+
console.error('[FAIL] getAgent returned wrong agent');
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
console.log('[PASS] getAgent successfully retrieved newly created agent');
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Test config adapter
|
|
65
|
+
*/
|
|
66
|
+
async function testConfig() {
|
|
67
|
+
console.log('[TEST] Testing config adapter...');
|
|
68
|
+
const configResult = loadConfig();
|
|
69
|
+
if (!configResult.ok) {
|
|
70
|
+
console.error('[FAIL] loadConfig failed:', configResult.error);
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
console.log('[PASS] loadConfig returned config object');
|
|
74
|
+
const providersResult = getProviders();
|
|
75
|
+
if (!providersResult.ok) {
|
|
76
|
+
console.error('[FAIL] getProviders failed:', providersResult.error);
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
console.log(`[PASS] getProviders returned ${providersResult.data.length} providers`);
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Test connect adapter (may fail if gateway is not running - that's OK)
|
|
84
|
+
*/
|
|
85
|
+
async function testConnect() {
|
|
86
|
+
console.log('[TEST] Testing connect adapter...');
|
|
87
|
+
// Test getConnectionState (should work even if not connected)
|
|
88
|
+
const stateResult = await getConnectionState();
|
|
89
|
+
if (!stateResult.ok) {
|
|
90
|
+
console.error('[FAIL] getConnectionState failed:', stateResult.error);
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
console.log(`[PASS] getConnectionState returned: connected=${stateResult.data.connected}`);
|
|
94
|
+
// Test connect (may fail if gateway is not running - that's OK for smoke test)
|
|
95
|
+
const connectResult = await connect();
|
|
96
|
+
if (!connectResult.ok) {
|
|
97
|
+
console.log(`[SKIP] connect failed (gateway may not be running): ${connectResult.error.message}`);
|
|
98
|
+
console.log('[PASS] connect correctly returned error structure');
|
|
99
|
+
return true; // Not a failure - gateway may not be running
|
|
100
|
+
}
|
|
101
|
+
console.log('[PASS] connect successfully connected to gateway');
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Main smoke test
|
|
106
|
+
*/
|
|
107
|
+
async function runSmokeTest() {
|
|
108
|
+
console.log('=== V1 Adapters Smoke Test ===\n');
|
|
109
|
+
let allPassed = true;
|
|
110
|
+
// Test agents
|
|
111
|
+
const agentsPassed = await testAgents();
|
|
112
|
+
allPassed = allPassed && agentsPassed;
|
|
113
|
+
console.log();
|
|
114
|
+
// Test config
|
|
115
|
+
const configPassed = await testConfig();
|
|
116
|
+
allPassed = allPassed && configPassed;
|
|
117
|
+
console.log();
|
|
118
|
+
// Test connect
|
|
119
|
+
const connectPassed = await testConnect();
|
|
120
|
+
allPassed = allPassed && connectPassed;
|
|
121
|
+
console.log();
|
|
122
|
+
// Summary
|
|
123
|
+
console.log('=== Summary ===');
|
|
124
|
+
if (allPassed) {
|
|
125
|
+
console.log('[PASS] All smoke tests passed');
|
|
126
|
+
process.exit(0);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
console.log('[FAIL] Some smoke tests failed');
|
|
130
|
+
process.exit(1);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// Run if executed directly
|
|
134
|
+
if (import.meta.url === `file://${process.argv[1]?.replace(/\\/g, '/')}`) {
|
|
135
|
+
runSmokeTest().catch((error) => {
|
|
136
|
+
console.error('[FATAL] Smoke test crashed:', error);
|
|
137
|
+
process.exit(1);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
export { runSmokeTest };
|
|
141
|
+
//# sourceMappingURL=smoke.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smoke.test.js","sourceRoot":"","sources":["../../../../../src/ui/v3/v1Adapters/__tests__/smoke.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGxD;;GAEG;AACH,KAAK,UAAU,UAAU;IACvB,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAEhD,2DAA2D;IAC3D,MAAM,UAAU,GAAG,UAAU,EAAE,CAAC;IAChC,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;QACnB,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,UAAU,CAAC,KAAK,CAA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,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,2BAA2B;AAC3B,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;IACzE,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAC7B,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V1 Adapter: Agent Registry
|
|
3
|
+
*
|
|
4
|
+
* Wraps V1 agent storage/loading functionality
|
|
5
|
+
* - No stdout writes
|
|
6
|
+
* - No UI imports
|
|
7
|
+
* - Returns structured { ok, data } or { ok, error }
|
|
8
|
+
*/
|
|
9
|
+
import type { CustomAgent } from '../../../types.js';
|
|
10
|
+
/**
|
|
11
|
+
* List all agents
|
|
12
|
+
*/
|
|
13
|
+
export declare function listAgents(): {
|
|
14
|
+
ok: true;
|
|
15
|
+
data: CustomAgent[];
|
|
16
|
+
} | {
|
|
17
|
+
ok: false;
|
|
18
|
+
error: {
|
|
19
|
+
code: string;
|
|
20
|
+
message: string;
|
|
21
|
+
nextAction?: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Get agent by name (case-insensitive)
|
|
26
|
+
*/
|
|
27
|
+
export declare function getAgent(name: string): {
|
|
28
|
+
ok: true;
|
|
29
|
+
data: CustomAgent;
|
|
30
|
+
} | {
|
|
31
|
+
ok: false;
|
|
32
|
+
error: {
|
|
33
|
+
code: string;
|
|
34
|
+
message: string;
|
|
35
|
+
nextAction?: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Create or update an agent
|
|
40
|
+
*/
|
|
41
|
+
export declare function createAgent(agent: CustomAgent): {
|
|
42
|
+
ok: true;
|
|
43
|
+
data: CustomAgent;
|
|
44
|
+
} | {
|
|
45
|
+
ok: false;
|
|
46
|
+
error: {
|
|
47
|
+
code: string;
|
|
48
|
+
message: string;
|
|
49
|
+
nextAction?: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../../src/ui/v3/v1Adapters/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAsBrD;;GAEG;AACH,wBAAgB,UAAU,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,WAAW,EAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAiC7I;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAmBrJ;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAgD9J"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V1 Adapter: Agent Registry
|
|
3
|
+
*
|
|
4
|
+
* Wraps V1 agent storage/loading functionality
|
|
5
|
+
* - No stdout writes
|
|
6
|
+
* - No UI imports
|
|
7
|
+
* - Returns structured { ok, data } or { ok, error }
|
|
8
|
+
*/
|
|
9
|
+
import * as fs from 'fs';
|
|
10
|
+
import * as path from 'path';
|
|
11
|
+
import * as os from 'os';
|
|
12
|
+
/**
|
|
13
|
+
* Get config directory path (~/.4runr)
|
|
14
|
+
*/
|
|
15
|
+
function getConfigDir() {
|
|
16
|
+
const homeDir = os.homedir();
|
|
17
|
+
const configDir = path.join(homeDir, '.4runr');
|
|
18
|
+
// Ensure directory exists
|
|
19
|
+
if (!fs.existsSync(configDir)) {
|
|
20
|
+
fs.mkdirSync(configDir, { recursive: true });
|
|
21
|
+
}
|
|
22
|
+
return configDir;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get agents file path
|
|
26
|
+
*/
|
|
27
|
+
function getAgentsFilePath() {
|
|
28
|
+
return path.join(getConfigDir(), 'agents.json');
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* List all agents
|
|
32
|
+
*/
|
|
33
|
+
export function listAgents() {
|
|
34
|
+
try {
|
|
35
|
+
const filePath = getAgentsFilePath();
|
|
36
|
+
if (!fs.existsSync(filePath)) {
|
|
37
|
+
return { ok: true, data: [] }; // Empty list, not an error
|
|
38
|
+
}
|
|
39
|
+
const data = fs.readFileSync(filePath, 'utf-8');
|
|
40
|
+
const agents = JSON.parse(data);
|
|
41
|
+
// Validate agents array
|
|
42
|
+
if (!Array.isArray(agents)) {
|
|
43
|
+
return {
|
|
44
|
+
ok: false,
|
|
45
|
+
error: {
|
|
46
|
+
code: 'INVALID_FORMAT',
|
|
47
|
+
message: 'Agents file is not a valid array',
|
|
48
|
+
nextAction: 'Check ~/.4runr/agents.json format'
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return { ok: true, data: agents };
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
return {
|
|
56
|
+
ok: false,
|
|
57
|
+
error: {
|
|
58
|
+
code: 'LOAD_FAILED',
|
|
59
|
+
message: error.message || 'Failed to load agents',
|
|
60
|
+
nextAction: 'Check file permissions and format'
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get agent by name (case-insensitive)
|
|
67
|
+
*/
|
|
68
|
+
export function getAgent(name) {
|
|
69
|
+
const result = listAgents();
|
|
70
|
+
if (!result.ok) {
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
const agent = result.data.find(a => a.name.toLowerCase() === name.toLowerCase());
|
|
74
|
+
if (!agent) {
|
|
75
|
+
return {
|
|
76
|
+
ok: false,
|
|
77
|
+
error: {
|
|
78
|
+
code: 'NOT_FOUND',
|
|
79
|
+
message: `Agent not found: ${name}`,
|
|
80
|
+
nextAction: 'Use listAgents() to see available agents'
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return { ok: true, data: agent };
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Create or update an agent
|
|
88
|
+
*/
|
|
89
|
+
export function createAgent(agent) {
|
|
90
|
+
try {
|
|
91
|
+
// Validate required fields
|
|
92
|
+
if (!agent.name || !agent.name.trim()) {
|
|
93
|
+
return {
|
|
94
|
+
ok: false,
|
|
95
|
+
error: {
|
|
96
|
+
code: 'VALIDATION_ERROR',
|
|
97
|
+
message: 'Agent name is required',
|
|
98
|
+
nextAction: 'Provide a non-empty agent name'
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// Load existing agents
|
|
103
|
+
const result = listAgents();
|
|
104
|
+
if (!result.ok) {
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
const agents = result.data;
|
|
108
|
+
// Check if agent already exists (case-insensitive)
|
|
109
|
+
const existingIndex = agents.findIndex(a => a.name.toLowerCase() === agent.name.toLowerCase());
|
|
110
|
+
if (existingIndex >= 0) {
|
|
111
|
+
// Update existing agent
|
|
112
|
+
agents[existingIndex] = agent;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
// Add new agent
|
|
116
|
+
agents.push(agent);
|
|
117
|
+
}
|
|
118
|
+
// Save to file
|
|
119
|
+
const filePath = getAgentsFilePath();
|
|
120
|
+
fs.writeFileSync(filePath, JSON.stringify(agents, null, 2), 'utf-8');
|
|
121
|
+
return { ok: true, data: agent };
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
return {
|
|
125
|
+
ok: false,
|
|
126
|
+
error: {
|
|
127
|
+
code: 'SAVE_FAILED',
|
|
128
|
+
message: error.message || 'Failed to save agent',
|
|
129
|
+
nextAction: 'Check file permissions and disk space'
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../../src/ui/v3/v1Adapters/agents.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAGzB;;GAEG;AACH,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AAE,CAAC;QAC5B,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;QAE3B,mDAAmD;QACnD,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAE/F,IAAI,aAAa,IAAI,CAAC,EAAE,CAAC;YACvB,wBAAwB;YACxB,MAAM,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,gBAAgB;YAChB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QAED,eAAe;QACf,MAAM,QAAQ,GAAG,iBAAiB,EAAE,CAAC;QACrC,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;QAErE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACnC,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE;gBACL,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,sBAAsB;gBAChD,UAAU,EAAE,uCAAuC;aACpD;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V1 Adapter: Config Loading
|
|
3
|
+
*
|
|
4
|
+
* Wraps V1 env.ts for configuration loading
|
|
5
|
+
* - No stdout writes
|
|
6
|
+
* - No UI imports
|
|
7
|
+
* - Returns structured { ok, data } or { ok, error }
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Config data structure
|
|
11
|
+
*/
|
|
12
|
+
export interface Config {
|
|
13
|
+
NODE_ENV: string;
|
|
14
|
+
PORT?: number;
|
|
15
|
+
HOST?: string;
|
|
16
|
+
DATABASE_URL?: string;
|
|
17
|
+
REDIS_URL?: string;
|
|
18
|
+
GATEWAY_URL?: string;
|
|
19
|
+
GATEWAY_PERSISTENCE?: 'memory' | 'persistent' | 'postgres';
|
|
20
|
+
AUTH_ENABLED?: boolean;
|
|
21
|
+
AUTH_MODE?: 'api_key' | 'jwt' | 'mixed';
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Load configuration from environment
|
|
26
|
+
*
|
|
27
|
+
* This is a lightweight wrapper that reads process.env
|
|
28
|
+
* For full validation, use packages/shared/src/env.ts (if accessible)
|
|
29
|
+
*/
|
|
30
|
+
export declare function loadConfig(): {
|
|
31
|
+
ok: true;
|
|
32
|
+
data: Config;
|
|
33
|
+
} | {
|
|
34
|
+
ok: false;
|
|
35
|
+
error: {
|
|
36
|
+
code: string;
|
|
37
|
+
message: string;
|
|
38
|
+
nextAction?: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Get providers list (if available in config)
|
|
43
|
+
*
|
|
44
|
+
* Note: This is a placeholder. Actual provider list may come from:
|
|
45
|
+
* - Environment variables
|
|
46
|
+
* - Config file
|
|
47
|
+
* - API endpoint
|
|
48
|
+
*
|
|
49
|
+
* For now, returns empty array or env-based list
|
|
50
|
+
*/
|
|
51
|
+
export declare function getProviders(): {
|
|
52
|
+
ok: true;
|
|
53
|
+
data: string[];
|
|
54
|
+
} | {
|
|
55
|
+
ok: false;
|
|
56
|
+
error: {
|
|
57
|
+
code: string;
|
|
58
|
+
message: string;
|
|
59
|
+
nextAction?: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0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Loading
|
|
3
|
+
*
|
|
4
|
+
* Wraps V1 env.ts for configuration loading
|
|
5
|
+
* - No stdout writes
|
|
6
|
+
* - No UI imports
|
|
7
|
+
* - Returns structured { ok, data } or { ok, error }
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Load configuration from environment
|
|
11
|
+
*
|
|
12
|
+
* This is a lightweight wrapper that reads process.env
|
|
13
|
+
* For full validation, use packages/shared/src/env.ts (if accessible)
|
|
14
|
+
*/
|
|
15
|
+
export function loadConfig() {
|
|
16
|
+
try {
|
|
17
|
+
const config = {
|
|
18
|
+
NODE_ENV: process.env.NODE_ENV || 'development',
|
|
19
|
+
PORT: process.env.PORT ? parseInt(process.env.PORT, 10) : undefined,
|
|
20
|
+
HOST: process.env.HOST,
|
|
21
|
+
DATABASE_URL: process.env.DATABASE_URL,
|
|
22
|
+
REDIS_URL: process.env.REDIS_URL,
|
|
23
|
+
GATEWAY_URL: process.env.GATEWAY_URL,
|
|
24
|
+
GATEWAY_PERSISTENCE: process.env.GATEWAY_PERSISTENCE,
|
|
25
|
+
AUTH_ENABLED: process.env.AUTH_ENABLED === 'true',
|
|
26
|
+
AUTH_MODE: process.env.AUTH_MODE,
|
|
27
|
+
};
|
|
28
|
+
// Copy all other env vars (for extensibility)
|
|
29
|
+
for (const key in process.env) {
|
|
30
|
+
if (!(key in config)) {
|
|
31
|
+
config[key] = process.env[key];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return { ok: true, data: config };
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
return {
|
|
38
|
+
ok: false,
|
|
39
|
+
error: {
|
|
40
|
+
code: 'CONFIG_LOAD_FAILED',
|
|
41
|
+
message: error.message || 'Failed to load configuration',
|
|
42
|
+
nextAction: 'Check environment variables'
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get providers list (if available in config)
|
|
49
|
+
*
|
|
50
|
+
* Note: This is a placeholder. Actual provider list may come from:
|
|
51
|
+
* - Environment variables
|
|
52
|
+
* - Config file
|
|
53
|
+
* - API endpoint
|
|
54
|
+
*
|
|
55
|
+
* For now, returns empty array or env-based list
|
|
56
|
+
*/
|
|
57
|
+
export function getProviders() {
|
|
58
|
+
try {
|
|
59
|
+
// Check for providers in env (comma-separated)
|
|
60
|
+
const providersEnv = process.env.PROVIDERS || process.env.AI_PROVIDERS;
|
|
61
|
+
if (providersEnv) {
|
|
62
|
+
const providers = providersEnv.split(',').map(p => p.trim()).filter(Boolean);
|
|
63
|
+
return { ok: true, data: providers };
|
|
64
|
+
}
|
|
65
|
+
// Default providers (if none specified)
|
|
66
|
+
return { ok: true, data: [] };
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
return {
|
|
70
|
+
ok: false,
|
|
71
|
+
error: {
|
|
72
|
+
code: 'PROVIDERS_LOAD_FAILED',
|
|
73
|
+
message: error.message || 'Failed to load providers',
|
|
74
|
+
nextAction: 'Check PROVIDERS or AI_PROVIDERS environment variable'
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/ui/v3/v1Adapters/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAqBH;;;;;GAKG;AACH,MAAM,UAAU,UAAU;IACxB,IAAI,CAAC;QACH,MAAM,MAAM,GAAW;YACrB,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa;YAC/C,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;YACnE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI;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AAC,CAAC;YAC7E,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACvC,CAAC;QAED,wCAAwC;QACxC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IAChC,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE;gBACL,IAAI,EAAE,uBAAuB;gBAC7B,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,0BAA0B;gBACpD,UAAU,EAAE,sDAAsD;aACnE;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V1 Adapter: Gateway Connection
|
|
3
|
+
*
|
|
4
|
+
* Wraps V1 GatewayClient for connection management
|
|
5
|
+
* - No stdout writes
|
|
6
|
+
* - No UI imports
|
|
7
|
+
* - Returns structured { ok, data } or { ok, error }
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Connection state
|
|
11
|
+
*/
|
|
12
|
+
export interface ConnectionState {
|
|
13
|
+
connected: boolean;
|
|
14
|
+
gatewayUrl: string | null;
|
|
15
|
+
health?: {
|
|
16
|
+
ok: boolean;
|
|
17
|
+
persistence?: string;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Connect to gateway
|
|
23
|
+
*/
|
|
24
|
+
export declare function connect(gatewayUrl?: string): Promise<{
|
|
25
|
+
ok: true;
|
|
26
|
+
data: ConnectionState;
|
|
27
|
+
} | {
|
|
28
|
+
ok: false;
|
|
29
|
+
error: {
|
|
30
|
+
code: string;
|
|
31
|
+
message: string;
|
|
32
|
+
nextAction?: string;
|
|
33
|
+
};
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Get current connection state
|
|
37
|
+
*/
|
|
38
|
+
export declare function getConnectionState(): Promise<{
|
|
39
|
+
ok: true;
|
|
40
|
+
data: ConnectionState;
|
|
41
|
+
} | {
|
|
42
|
+
ok: false;
|
|
43
|
+
error: {
|
|
44
|
+
code: string;
|
|
45
|
+
message: string;
|
|
46
|
+
nextAction?: string;
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
//# sourceMappingURL=connect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../../src/ui/v3/v1Adapters/connect.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE;QACP,EAAE,EAAE,OAAO,CAAC;QACZ,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAYD;;GAEG;AACH,wBAAsB,OAAO,CAC3B,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CACR;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,eAAe,CAAA;CAAE,GACnC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAC7E,CA+BA;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CACjD;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,eAAe,CAAA;CAAE,GACnC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAC7E,CA+DA"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V1 Adapter: Gateway Connection
|
|
3
|
+
*
|
|
4
|
+
* Wraps V1 GatewayClient for connection management
|
|
5
|
+
* - No stdout writes
|
|
6
|
+
* - No UI imports
|
|
7
|
+
* - Returns structured { ok, data } or { ok, error }
|
|
8
|
+
*/
|
|
9
|
+
import { GatewayClient } from '../../../gateway-client.js';
|
|
10
|
+
let cachedClient = null;
|
|
11
|
+
let cachedUrl = null;
|
|
12
|
+
/**
|
|
13
|
+
* Create GatewayClient instance
|
|
14
|
+
*/
|
|
15
|
+
function createClient(gatewayUrl) {
|
|
16
|
+
return new GatewayClient({ gatewayUrl });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Connect to gateway
|
|
20
|
+
*/
|
|
21
|
+
export async function connect(gatewayUrl) {
|
|
22
|
+
try {
|
|
23
|
+
const url = gatewayUrl || process.env.GATEWAY_URL || 'http://localhost:3000';
|
|
24
|
+
const client = createClient(url);
|
|
25
|
+
// Test connection with health check
|
|
26
|
+
const health = await client.health();
|
|
27
|
+
// Cache client and URL on success
|
|
28
|
+
cachedClient = client;
|
|
29
|
+
cachedUrl = url;
|
|
30
|
+
return {
|
|
31
|
+
ok: true,
|
|
32
|
+
data: {
|
|
33
|
+
connected: true,
|
|
34
|
+
gatewayUrl: url,
|
|
35
|
+
health
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
return {
|
|
41
|
+
ok: false,
|
|
42
|
+
error: {
|
|
43
|
+
code: 'CONNECTION_FAILED',
|
|
44
|
+
message: error.message || 'Failed to connect to gateway',
|
|
45
|
+
nextAction: 'Check gateway URL and network connectivity'
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get current connection state
|
|
52
|
+
*/
|
|
53
|
+
export async function getConnectionState() {
|
|
54
|
+
try {
|
|
55
|
+
const url = cachedUrl || process.env.GATEWAY_URL || 'http://localhost:3000';
|
|
56
|
+
if (!cachedClient) {
|
|
57
|
+
// Try to create client and check health
|
|
58
|
+
const client = createClient(url);
|
|
59
|
+
try {
|
|
60
|
+
const health = await client.health();
|
|
61
|
+
cachedClient = client;
|
|
62
|
+
cachedUrl = url;
|
|
63
|
+
return {
|
|
64
|
+
ok: true,
|
|
65
|
+
data: {
|
|
66
|
+
connected: true,
|
|
67
|
+
gatewayUrl: url,
|
|
68
|
+
health
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
return {
|
|
74
|
+
ok: true,
|
|
75
|
+
data: {
|
|
76
|
+
connected: false,
|
|
77
|
+
gatewayUrl: url
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// Check health of cached client
|
|
83
|
+
try {
|
|
84
|
+
const health = await cachedClient.health();
|
|
85
|
+
return {
|
|
86
|
+
ok: true,
|
|
87
|
+
data: {
|
|
88
|
+
connected: true,
|
|
89
|
+
gatewayUrl: cachedUrl || url,
|
|
90
|
+
health
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
// Connection lost, clear cache
|
|
96
|
+
cachedClient = null;
|
|
97
|
+
cachedUrl = null;
|
|
98
|
+
return {
|
|
99
|
+
ok: true,
|
|
100
|
+
data: {
|
|
101
|
+
connected: false,
|
|
102
|
+
gatewayUrl: url
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
return {
|
|
109
|
+
ok: false,
|
|
110
|
+
error: {
|
|
111
|
+
code: 'STATE_CHECK_FAILED',
|
|
112
|
+
message: error.message || 'Failed to check connection state',
|
|
113
|
+
nextAction: 'Try connect() first'
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=connect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../../../src/ui/v3/v1Adapters/connect.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAe3D,IAAI,YAAY,GAAyB,IAAI,CAAC;AAC9C,IAAI,SAAS,GAAkB,IAAI,CAAC;AAEpC;;GAEG;AACH,SAAS,YAAY,CAAC,UAAkB;IACtC,OAAO,IAAI,aAAa,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,UAAmB;IAKnB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,uBAAuB,CAAC;QAE7E,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QAEjC,oCAAoC;QACpC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;QAErC,kCAAkC;QAClC,YAAY,GAAG,MAAM,CAAC;QACtB,SAAS,GAAG,GAAG,CAAC;QAEhB,OAAO;YACL,EAAE,EAAE,IAAI;YACR,IAAI,EAAE;gBACJ,SAAS,EAAE,IAAI;gBACf,UAAU,EAAE,GAAG;gBACf,MAAM;aACP;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE;gBACL,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,8BAA8B;gBACxD,UAAU,EAAE,4CAA4C;aACzD;SACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,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AAC;QACpB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE;gBACL,IAAI,EAAE,oBAAoB;gBAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,kCAAkC;gBAC5D,UAAU,EAAE,qBAAqB;aAClC;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V1 Adapter: Run Execution
|
|
3
|
+
*
|
|
4
|
+
* Wraps V1 GatewayClient for run execution
|
|
5
|
+
* - No stdout writes
|
|
6
|
+
* - No UI imports
|
|
7
|
+
* - Returns structured { ok, data } or { ok, error }
|
|
8
|
+
*/
|
|
9
|
+
import type { Run, RunInput } from '../../../gateway-client.js';
|
|
10
|
+
/**
|
|
11
|
+
* Start a run (create + start)
|
|
12
|
+
*/
|
|
13
|
+
export declare function startRun(agentId: string, input?: RunInput): Promise<{
|
|
14
|
+
ok: true;
|
|
15
|
+
data: Run;
|
|
16
|
+
} | {
|
|
17
|
+
ok: false;
|
|
18
|
+
error: {
|
|
19
|
+
code: string;
|
|
20
|
+
message: string;
|
|
21
|
+
nextAction?: string;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Get run status
|
|
26
|
+
*/
|
|
27
|
+
export declare function getRunStatus(runId: string, gatewayUrl?: string): Promise<{
|
|
28
|
+
ok: true;
|
|
29
|
+
data: Run;
|
|
30
|
+
} | {
|
|
31
|
+
ok: false;
|
|
32
|
+
error: {
|
|
33
|
+
code: string;
|
|
34
|
+
message: string;
|
|
35
|
+
nextAction?: string;
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
38
|
+
//# sourceMappingURL=runs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../../../src/ui/v3/v1Adapters/runs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAehE;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,QAAQ,GACf,OAAO,CACR;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,GACvB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAC7E,CAuCA;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CACR;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,GACvB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAC7E,CA0BA"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V1 Adapter: Run Execution
|
|
3
|
+
*
|
|
4
|
+
* Wraps V1 GatewayClient for run execution
|
|
5
|
+
* - No stdout writes
|
|
6
|
+
* - No UI imports
|
|
7
|
+
* - Returns structured { ok, data } or { ok, error }
|
|
8
|
+
*/
|
|
9
|
+
import { GatewayClient } from '../../../gateway-client.js';
|
|
10
|
+
/**
|
|
11
|
+
* Create GatewayClient instance
|
|
12
|
+
* Returns null if URL is not provided and not in environment
|
|
13
|
+
*/
|
|
14
|
+
function createClient(gatewayUrl) {
|
|
15
|
+
const url = gatewayUrl || process.env.GATEWAY_URL || 'http://localhost:3000';
|
|
16
|
+
try {
|
|
17
|
+
return new GatewayClient({ gatewayUrl: url });
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Start a run (create + start)
|
|
25
|
+
*/
|
|
26
|
+
export async function startRun(agentId, input) {
|
|
27
|
+
try {
|
|
28
|
+
const client = createClient();
|
|
29
|
+
if (!client) {
|
|
30
|
+
return {
|
|
31
|
+
ok: false,
|
|
32
|
+
error: {
|
|
33
|
+
code: 'CLIENT_INIT_FAILED',
|
|
34
|
+
message: 'Failed to create GatewayClient',
|
|
35
|
+
nextAction: 'Set GATEWAY_URL environment variable or provide gatewayUrl'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// Create run
|
|
40
|
+
const runInput = {
|
|
41
|
+
agent_id: agentId,
|
|
42
|
+
...input
|
|
43
|
+
};
|
|
44
|
+
const run = await client.runs.create({
|
|
45
|
+
name: `run-${Date.now()}`,
|
|
46
|
+
input: runInput
|
|
47
|
+
});
|
|
48
|
+
// Start the run
|
|
49
|
+
await client.runs.start(run.id);
|
|
50
|
+
return { ok: true, data: run };
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
return {
|
|
54
|
+
ok: false,
|
|
55
|
+
error: {
|
|
56
|
+
code: 'RUN_START_FAILED',
|
|
57
|
+
message: error.message || 'Failed to start run',
|
|
58
|
+
nextAction: 'Check gateway connection and agent ID'
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get run status
|
|
65
|
+
*/
|
|
66
|
+
export async function getRunStatus(runId, gatewayUrl) {
|
|
67
|
+
try {
|
|
68
|
+
const client = createClient(gatewayUrl);
|
|
69
|
+
if (!client) {
|
|
70
|
+
return {
|
|
71
|
+
ok: false,
|
|
72
|
+
error: {
|
|
73
|
+
code: 'CLIENT_INIT_FAILED',
|
|
74
|
+
message: 'Failed to create GatewayClient',
|
|
75
|
+
nextAction: 'Set GATEWAY_URL environment variable or provide gatewayUrl'
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const run = await client.runs.get(runId);
|
|
80
|
+
return { ok: true, data: run };
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
return {
|
|
84
|
+
ok: false,
|
|
85
|
+
error: {
|
|
86
|
+
code: 'RUN_GET_FAILED',
|
|
87
|
+
message: error.message || 'Failed to get run status',
|
|
88
|
+
nextAction: 'Check run ID and gateway connection'
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../../../src/ui/v3/v1Adapters/runs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D;;;GAGG;AACH,SAAS,YAAY,CAAC,UAAmB;IACvC,MAAM,GAAG,GAAG,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,uBAAuB,CAAC;IAC7E,IAAI,CAAC;QACH,OAAO,IAAI,aAAa,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,OAAe,EACf,KAAgB;IAKhB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;QAC9B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,KAAK,EAAE;oBACL,IAAI,EAAE,oBAAoB;oBAC1B,OAAO,EAAE,gCAAgC;oBACzC,UAAU,EAAE,4DAA4D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