@llm-dev-ops/agentics-cli 1.3.1 → 1.3.3
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/adapters/base-adapter.js +10 -10
- package/dist/adapters/base-adapter.js.map +1 -1
- package/dist/audit/audit-trail.js +1 -1
- package/dist/cli/index.js +6 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/deploy.d.ts +14 -5
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +58 -16
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/diligence.d.ts +12 -4
- package/dist/commands/diligence.d.ts.map +1 -1
- package/dist/commands/diligence.js +54 -14
- package/dist/commands/diligence.js.map +1 -1
- package/dist/commands/export.d.ts +10 -3
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +56 -16
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/inspect.d.ts +13 -7
- package/dist/commands/inspect.d.ts.map +1 -1
- package/dist/commands/inspect.js +57 -19
- package/dist/commands/inspect.js.map +1 -1
- package/dist/commands/login.js +1 -1
- package/dist/commands/plan.d.ts +11 -4
- package/dist/commands/plan.d.ts.map +1 -1
- package/dist/commands/plan.js +39 -12
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/quantify.d.ts +12 -6
- package/dist/commands/quantify.d.ts.map +1 -1
- package/dist/commands/quantify.js +56 -17
- package/dist/commands/quantify.js.map +1 -1
- package/dist/commands/simulate.d.ts +10 -3
- package/dist/commands/simulate.d.ts.map +1 -1
- package/dist/commands/simulate.js +69 -18
- package/dist/commands/simulate.js.map +1 -1
- package/dist/config/endpoints.d.ts.map +1 -1
- package/dist/config/endpoints.js +10 -8
- package/dist/config/endpoints.js.map +1 -1
- package/dist/contracts/index.d.ts +21 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +20 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/validator.d.ts +62 -0
- package/dist/contracts/validator.d.ts.map +1 -0
- package/dist/contracts/validator.js +397 -0
- package/dist/contracts/validator.js.map +1 -0
- package/dist/server/index.d.ts +26 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +144 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/routes/auth.d.ts +12 -0
- package/dist/server/routes/auth.d.ts.map +1 -0
- package/dist/server/routes/auth.js +111 -0
- package/dist/server/routes/auth.js.map +1 -0
- package/dist/server/routes/diligence.d.ts +12 -0
- package/dist/server/routes/diligence.d.ts.map +1 -0
- package/dist/server/routes/diligence.js +48 -0
- package/dist/server/routes/diligence.js.map +1 -0
- package/dist/server/routes/erpsurface.d.ts +11 -0
- package/dist/server/routes/erpsurface.d.ts.map +1 -0
- package/dist/server/routes/erpsurface.js +59 -0
- package/dist/server/routes/erpsurface.js.map +1 -0
- package/dist/server/routes/exporters.d.ts +12 -0
- package/dist/server/routes/exporters.d.ts.map +1 -0
- package/dist/server/routes/exporters.js +47 -0
- package/dist/server/routes/exporters.js.map +1 -0
- package/dist/server/routes/health.d.ts +11 -0
- package/dist/server/routes/health.d.ts.map +1 -0
- package/dist/server/routes/health.js +33 -0
- package/dist/server/routes/health.js.map +1 -0
- package/dist/server/routes/index.d.ts +17 -0
- package/dist/server/routes/index.d.ts.map +1 -0
- package/dist/server/routes/index.js +17 -0
- package/dist/server/routes/index.js.map +1 -0
- package/dist/server/routes/intent.d.ts +12 -0
- package/dist/server/routes/intent.d.ts.map +1 -0
- package/dist/server/routes/intent.js +50 -0
- package/dist/server/routes/intent.js.map +1 -0
- package/dist/server/routes/manifests.d.ts +12 -0
- package/dist/server/routes/manifests.d.ts.map +1 -0
- package/dist/server/routes/manifests.js +46 -0
- package/dist/server/routes/manifests.js.map +1 -0
- package/dist/server/routes/plans.d.ts +12 -0
- package/dist/server/routes/plans.d.ts.map +1 -0
- package/dist/server/routes/plans.js +47 -0
- package/dist/server/routes/plans.js.map +1 -0
- package/dist/server/routes/roi.d.ts +12 -0
- package/dist/server/routes/roi.d.ts.map +1 -0
- package/dist/server/routes/roi.js +48 -0
- package/dist/server/routes/roi.js.map +1 -0
- package/dist/server/routes/runner.d.ts +12 -0
- package/dist/server/routes/runner.d.ts.map +1 -0
- package/dist/server/routes/runner.js +50 -0
- package/dist/server/routes/runner.js.map +1 -0
- package/dist/server/routes/simulate.d.ts +13 -0
- package/dist/server/routes/simulate.d.ts.map +1 -0
- package/dist/server/routes/simulate.js +58 -0
- package/dist/server/routes/simulate.js.map +1 -0
- package/dist/server/utils/id-generator.d.ts +32 -0
- package/dist/server/utils/id-generator.d.ts.map +1 -0
- package/dist/server/utils/id-generator.js +51 -0
- package/dist/server/utils/id-generator.js.map +1 -0
- package/dist/server/utils/index.d.ts +8 -0
- package/dist/server/utils/index.d.ts.map +1 -0
- package/dist/server/utils/index.js +8 -0
- package/dist/server/utils/index.js.map +1 -0
- package/dist/server/utils/response-builder.d.ts +56 -0
- package/dist/server/utils/response-builder.d.ts.map +1 -0
- package/dist/server/utils/response-builder.js +388 -0
- package/dist/server/utils/response-builder.js.map +1 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +10 -3
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth Route Handler
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/cli/auth/sessions - Create OAuth device flow session
|
|
5
|
+
* GET /v1/cli/auth/sessions/:device_code - Poll for auth completion
|
|
6
|
+
*
|
|
7
|
+
* OAuth device flow authentication endpoints for CLI login.
|
|
8
|
+
*/
|
|
9
|
+
import { Hono } from 'hono';
|
|
10
|
+
const auth = new Hono();
|
|
11
|
+
// In-memory session store (for stub implementation)
|
|
12
|
+
const sessions = new Map();
|
|
13
|
+
/**
|
|
14
|
+
* Generate a random code of specified length
|
|
15
|
+
*/
|
|
16
|
+
function generateCode(length, charset = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789') {
|
|
17
|
+
let result = '';
|
|
18
|
+
for (let i = 0; i < length; i++) {
|
|
19
|
+
result += charset.charAt(Math.floor(Math.random() * charset.length));
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* POST /v1/cli/auth/sessions
|
|
25
|
+
*
|
|
26
|
+
* Create a new OAuth device flow session.
|
|
27
|
+
*/
|
|
28
|
+
auth.post('/sessions', async (c) => {
|
|
29
|
+
try {
|
|
30
|
+
const deviceCode = generateCode(32, 'abcdef0123456789');
|
|
31
|
+
const userCode = generateCode(8); // 8-char code to match API format
|
|
32
|
+
const sessionId = `sess-${generateCode(16, 'abcdef0123456789')}`;
|
|
33
|
+
const session = {
|
|
34
|
+
session_id: sessionId,
|
|
35
|
+
device_code: deviceCode,
|
|
36
|
+
user_code: userCode,
|
|
37
|
+
verification_url: `https://platform.agentics.dev/auth/device?code=${userCode}`,
|
|
38
|
+
expires_at: new Date(Date.now() + 15 * 60 * 1000).toISOString(), // 15 minutes
|
|
39
|
+
interval: 5,
|
|
40
|
+
status: 'pending',
|
|
41
|
+
};
|
|
42
|
+
sessions.set(deviceCode, session);
|
|
43
|
+
// Auto-authorize after 3 seconds for testing
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
const s = sessions.get(deviceCode);
|
|
46
|
+
if (s && s.status === 'pending') {
|
|
47
|
+
s.status = 'authorized';
|
|
48
|
+
s.api_key = `ak-${generateCode(48, 'abcdef0123456789')}`;
|
|
49
|
+
}
|
|
50
|
+
}, 3000);
|
|
51
|
+
return c.json({
|
|
52
|
+
session_id: session.session_id,
|
|
53
|
+
verification_url: session.verification_url,
|
|
54
|
+
user_code: session.user_code,
|
|
55
|
+
expires_at: session.expires_at,
|
|
56
|
+
interval: session.interval,
|
|
57
|
+
}, 201);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.error('Auth sessions POST error:', error);
|
|
61
|
+
return c.json({
|
|
62
|
+
error: {
|
|
63
|
+
code: 'INTERNAL_ERROR',
|
|
64
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
65
|
+
},
|
|
66
|
+
}, 500);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* GET /v1/cli/auth/sessions/:device_code
|
|
71
|
+
*
|
|
72
|
+
* Poll for authentication status.
|
|
73
|
+
*/
|
|
74
|
+
auth.get('/sessions/:device_code', async (c) => {
|
|
75
|
+
try {
|
|
76
|
+
const deviceCode = c.req.param('device_code');
|
|
77
|
+
const session = sessions.get(deviceCode);
|
|
78
|
+
if (!session) {
|
|
79
|
+
return c.json({
|
|
80
|
+
error: {
|
|
81
|
+
code: 'NOT_FOUND',
|
|
82
|
+
message: 'Session not found',
|
|
83
|
+
},
|
|
84
|
+
}, 404);
|
|
85
|
+
}
|
|
86
|
+
// Check if expired
|
|
87
|
+
if (new Date(session.expires_at) < new Date()) {
|
|
88
|
+
session.status = 'expired';
|
|
89
|
+
}
|
|
90
|
+
if (session.status === 'authorized' && session.api_key) {
|
|
91
|
+
return c.json({
|
|
92
|
+
status: session.status,
|
|
93
|
+
api_key: session.api_key,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return c.json({
|
|
97
|
+
status: session.status,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
console.error('Auth sessions GET error:', error);
|
|
102
|
+
return c.json({
|
|
103
|
+
error: {
|
|
104
|
+
code: 'INTERNAL_ERROR',
|
|
105
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
106
|
+
},
|
|
107
|
+
}, 500);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
export { auth };
|
|
111
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/server/routes/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE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CAAC,OAAO,EAAE,CAAC;YACb,OAAO,CAAC,CAAC,IAAI,CACX;gBACE,KAAK,EAAE;oBACL,IAAI,EAAE,WAAW;oBACjB,OAAO,EAAE,mBAAmB;iBAC7B;aACF,EACD,GAAG,CACJ,CAAC;QACJ,CAAC;QAED,mBAAmB;QACnB,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,IAAI,IAAI,EAAE,EAAE,CAAC;YAC9C,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;QAC7B,CAAC;QAED,IAAI,OAAO,CAAC,MAAM,KAAK,YAAY,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACvD,OAAO,CAAC,CAAC,IAAI,CAAC;gBACZ,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB,CAAC,CAAC;QACL,CAAC;QAED,OAAO,CAAC,CAAC,IAAI,CAAC;YACZ,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;QACjD,OAAO,CAAC,CAAC,IAAI,CACX;YACE,KAAK,EAAE;gBACL,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aAClE;SACF,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diligence Route Handler
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/diligence
|
|
5
|
+
*
|
|
6
|
+
* Handles compliance diligence package creation from the diligence service.
|
|
7
|
+
* Used by the CLI's `diligence` command.
|
|
8
|
+
*/
|
|
9
|
+
import { Hono } from 'hono';
|
|
10
|
+
declare const diligence: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
11
|
+
export { diligence };
|
|
12
|
+
//# sourceMappingURL=diligence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diligence.d.ts","sourceRoot":"","sources":["../../../src/server/routes/diligence.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAI5B,QAAA,MAAM,SAAS,4EAAa,CAAC;AAoD7B,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diligence Route Handler
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/diligence
|
|
5
|
+
*
|
|
6
|
+
* Handles compliance diligence package creation from the diligence service.
|
|
7
|
+
* Used by the CLI's `diligence` command.
|
|
8
|
+
*/
|
|
9
|
+
import { Hono } from 'hono';
|
|
10
|
+
import { ids } from '../utils/id-generator.js';
|
|
11
|
+
import { buildDiligencePackageReference } from '../utils/response-builder.js';
|
|
12
|
+
const diligence = new Hono();
|
|
13
|
+
/**
|
|
14
|
+
* POST /v1/diligence
|
|
15
|
+
*
|
|
16
|
+
* Create a diligence package based on source references.
|
|
17
|
+
*/
|
|
18
|
+
diligence.post('/', async (c) => {
|
|
19
|
+
try {
|
|
20
|
+
const body = await c.req.json();
|
|
21
|
+
// Validate required fields
|
|
22
|
+
if (!body.refs) {
|
|
23
|
+
return c.json({
|
|
24
|
+
error: {
|
|
25
|
+
code: 'VALIDATION_ERROR',
|
|
26
|
+
message: 'refs is required',
|
|
27
|
+
},
|
|
28
|
+
}, 400);
|
|
29
|
+
}
|
|
30
|
+
const id = ids.diligence();
|
|
31
|
+
const frameworks = body.frameworks ?? ['SOC2'];
|
|
32
|
+
const requirements = body.requirements ?? {};
|
|
33
|
+
// Build response matching DiligencePackageReference type
|
|
34
|
+
const response = buildDiligencePackageReference(id, body.refs, frameworks, requirements);
|
|
35
|
+
return c.json(response, 200);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
console.error('Diligence route error:', error);
|
|
39
|
+
return c.json({
|
|
40
|
+
error: {
|
|
41
|
+
code: 'INTERNAL_ERROR',
|
|
42
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
43
|
+
},
|
|
44
|
+
}, 500);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export { diligence };
|
|
48
|
+
//# sourceMappingURL=diligence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diligence.js","sourceRoot":"","sources":["../../../src/server/routes/diligence.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAE9E,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;AAQ7B;;;;GAIG;AACH,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC9B,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,EAAoB,CAAC;QAElD,2BAA2B;QAC3B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,CAAC,CAAC,IAAI,CACX;gBACE,KAAK,EAAE;oBACL,IAAI,EAAE,kBAAkB;oBACxB,OAAO,EAAE,kBAAkB;iBAC5B;aACF,EACD,GAAG,CACJ,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/C,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC;QAE7C,yDAAyD;QACzD,MAAM,QAAQ,GAAG,8BAA8B,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;QAEzF,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;QAC/C,OAAO,CAAC,CAAC,IAAI,CACX;YACE,KAAK,EAAE;gBACL,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aAClE;SACF,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ERP Surface Route Handler
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/erpsurface
|
|
5
|
+
*
|
|
6
|
+
* Handles ERP Surface integration requests for enterprise resource planning.
|
|
7
|
+
*/
|
|
8
|
+
import { Hono } from 'hono';
|
|
9
|
+
declare const erpsurface: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
10
|
+
export { erpsurface };
|
|
11
|
+
//# sourceMappingURL=erpsurface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erpsurface.d.ts","sourceRoot":"","sources":["../../../src/server/routes/erpsurface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAI5B,QAAA,MAAM,UAAU,4EAAa,CAAC;AA+E9B,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ERP Surface Route Handler
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/erpsurface
|
|
5
|
+
*
|
|
6
|
+
* Handles ERP Surface integration requests for enterprise resource planning.
|
|
7
|
+
*/
|
|
8
|
+
import { Hono } from 'hono';
|
|
9
|
+
import { ids } from '../utils/id-generator.js';
|
|
10
|
+
import { buildErpSurfaceReference } from '../utils/response-builder.js';
|
|
11
|
+
const erpsurface = new Hono();
|
|
12
|
+
/**
|
|
13
|
+
* POST /v1/erpsurface
|
|
14
|
+
*
|
|
15
|
+
* Handles ERP Surface integration operations.
|
|
16
|
+
*/
|
|
17
|
+
erpsurface.post('/', async (c) => {
|
|
18
|
+
try {
|
|
19
|
+
const body = await c.req.json();
|
|
20
|
+
const id = ids.erp();
|
|
21
|
+
const erpType = body.erp_type ?? 'generic';
|
|
22
|
+
const operation = body.operation ?? 'sync';
|
|
23
|
+
const entityType = body.entity_type ?? 'all';
|
|
24
|
+
const response = buildErpSurfaceReference(id, body.source_ref, erpType, operation, entityType, body.query ?? {}, body.sync_config ?? {});
|
|
25
|
+
return c.json(response, 200);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.error('ERP Surface route error:', error);
|
|
29
|
+
return c.json({
|
|
30
|
+
error: {
|
|
31
|
+
code: 'INTERNAL_ERROR',
|
|
32
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
33
|
+
},
|
|
34
|
+
}, 500);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* GET /v1/erpsurface/:id
|
|
39
|
+
*
|
|
40
|
+
* Get ERP Surface integration status.
|
|
41
|
+
*/
|
|
42
|
+
erpsurface.get('/:id', async (c) => {
|
|
43
|
+
const id = c.req.param('id');
|
|
44
|
+
return c.json({
|
|
45
|
+
id,
|
|
46
|
+
type: 'ErpSurfaceReference',
|
|
47
|
+
status: 'completed',
|
|
48
|
+
repository: 'agentics-erp-surface',
|
|
49
|
+
created_at: new Date().toISOString(),
|
|
50
|
+
sync_status: {
|
|
51
|
+
entities_synced: 1250,
|
|
52
|
+
entities_failed: 0,
|
|
53
|
+
last_sync_at: new Date().toISOString(),
|
|
54
|
+
next_sync_at: new Date(Date.now() + 3600000).toISOString(),
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
export { erpsurface };
|
|
59
|
+
//# sourceMappingURL=erpsurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"erpsurface.js","sourceRoot":"","sources":["../../../src/server/routes/erpsurface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAExE,MAAM,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC;AAiB9B;;;;GAIG;AACH,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC/B,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,EAAqB,CAAC;QAEnD,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;QACrB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,IAAI,SAAS,CAAC;QAC3C,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,MAAM,CAAC;QAC3C,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC;QAE7C,MAAM,QAAQ,GAAG,wBAAwB,CACvC,EAAE,EACF,IAAI,CAAC,UAAU,EACf,OAAO,EACP,SAAS,EACT,UAAU,EACV,IAAI,CAAC,KAAK,IAAI,EAAE,EAChB,IAAI,CAAC,WAAW,IAAI,E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.
|
|
7
|
+
* Used by the CLI's `export` command.
|
|
8
|
+
*/
|
|
9
|
+
import { Hono } from 'hono';
|
|
10
|
+
declare const exporters: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
11
|
+
export { exporters };
|
|
12
|
+
//# sourceMappingURL=exporters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exporters.d.ts","sourceRoot":"","sources":["../../../src/server/routes/exporters.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAI5B,QAAA,MAAM,SAAS,4EAAa,CAAC;AAqD7B,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exporters Route Handler
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/exporters
|
|
5
|
+
*
|
|
6
|
+
* Handles deployment export generation from the exporters service.
|
|
7
|
+
* Used by the CLI's `export` command.
|
|
8
|
+
*/
|
|
9
|
+
import { Hono } from 'hono';
|
|
10
|
+
import { ids } from '../utils/id-generator.js';
|
|
11
|
+
import { buildExportReference } from '../utils/response-builder.js';
|
|
12
|
+
const exporters = new Hono();
|
|
13
|
+
/**
|
|
14
|
+
* POST /v1/exporters
|
|
15
|
+
*
|
|
16
|
+
* Generate deployment exports based on an intent reference.
|
|
17
|
+
*/
|
|
18
|
+
exporters.post('/', async (c) => {
|
|
19
|
+
try {
|
|
20
|
+
const body = await c.req.json();
|
|
21
|
+
// Validate required fields
|
|
22
|
+
if (!body.intent_ref) {
|
|
23
|
+
return c.json({
|
|
24
|
+
error: {
|
|
25
|
+
code: 'VALIDATION_ERROR',
|
|
26
|
+
message: 'intent_ref is required',
|
|
27
|
+
},
|
|
28
|
+
}, 400);
|
|
29
|
+
}
|
|
30
|
+
const id = ids.export();
|
|
31
|
+
const formatSpec = body.format_spec ?? { format: 'terraform' };
|
|
32
|
+
// Build response matching ExportReference type
|
|
33
|
+
const response = buildExportReference(id, body.intent_ref, formatSpec);
|
|
34
|
+
return c.json(response, 200);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
console.error('Exporters route error:', error);
|
|
38
|
+
return c.json({
|
|
39
|
+
error: {
|
|
40
|
+
code: 'INTERNAL_ERROR',
|
|
41
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
42
|
+
},
|
|
43
|
+
}, 500);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export { exporters };
|
|
47
|
+
//# sourceMappingURL=exporters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exporters.js","sourceRoot":"","sources":["../../../src/server/routes/exporters.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;AAU7B;;;;GAIG;AACH,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC9B,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,EAAoB,CAAC;QAElD,2BAA2B;QAC3B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,OAAO,CAAC,CAAC,IAAI,CACX;gBACE,KAAK,EAAE;oBACL,IAAI,EAAE,kBAAkB;oBACxB,OAAO,EAAE,wBAAwB;iBAClC;aACF,EACD,GAAG,CACJ,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;QACxB,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;QAE/D,+CAA+C;QAC/C,MAAM,QAAQ,GAAG,oBAAoB,CAAC,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAEvE,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;QAC/C,OAAO,CAAC,CAAC,IAAI,CACX;YACE,KAAK,EAAE;gBACL,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aAClE;SACF,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Health Route Handler
|
|
3
|
+
*
|
|
4
|
+
* GET /health
|
|
5
|
+
*
|
|
6
|
+
* Health check endpoint for the API server.
|
|
7
|
+
*/
|
|
8
|
+
import { Hono } from 'hono';
|
|
9
|
+
declare const health: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
10
|
+
export { health };
|
|
11
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../../src/server/routes/health.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,QAAA,MAAM,MAAM,4EAAa,CAAC;AAyB1B,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Health Route Handler
|
|
3
|
+
*
|
|
4
|
+
* GET /health
|
|
5
|
+
*
|
|
6
|
+
* Health check endpoint for the API server.
|
|
7
|
+
*/
|
|
8
|
+
import { Hono } from 'hono';
|
|
9
|
+
const health = new Hono();
|
|
10
|
+
/**
|
|
11
|
+
* GET /health
|
|
12
|
+
*
|
|
13
|
+
* Returns server health status.
|
|
14
|
+
*/
|
|
15
|
+
health.get('/', (c) => {
|
|
16
|
+
return c.json({
|
|
17
|
+
status: 'healthy',
|
|
18
|
+
timestamp: new Date().toISOString(),
|
|
19
|
+
version: '1.0.0',
|
|
20
|
+
services: {
|
|
21
|
+
'simulation-engine': 'available',
|
|
22
|
+
'manifests': 'available',
|
|
23
|
+
'planner': 'available',
|
|
24
|
+
'runner': 'available',
|
|
25
|
+
'roi-engine': 'available',
|
|
26
|
+
'intent': 'available',
|
|
27
|
+
'exporters': 'available',
|
|
28
|
+
'diligence': 'available',
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
export { health };
|
|
33
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../../src/server/routes/health.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;AAE1B;;;;GAIG;AACH,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;IACpB,OAAO,CAAC,CAAC,IAAI,CAAC;QACZ,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE;YACR,mBAAmB,EAAE,WAAW;YAChC,WAAW,EAAE,WAAW;YACxB,SAAS,EAAE,WAAW;YACtB,QAAQ,EAAE,WAAW;YACrB,YAAY,EAAE,WAAW;YACzB,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,WAAW;SACzB;KACF,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route Exports
|
|
3
|
+
*
|
|
4
|
+
* Central export for all API route handlers.
|
|
5
|
+
*/
|
|
6
|
+
export { simulate } from './simulate.js';
|
|
7
|
+
export { manifests } from './manifests.js';
|
|
8
|
+
export { plans } from './plans.js';
|
|
9
|
+
export { runner } from './runner.js';
|
|
10
|
+
export { roi } from './roi.js';
|
|
11
|
+
export { intent } from './intent.js';
|
|
12
|
+
export { exporters } from './exporters.js';
|
|
13
|
+
export { diligence } from './diligence.js';
|
|
14
|
+
export { health } from './health.js';
|
|
15
|
+
export { auth } from './auth.js';
|
|
16
|
+
export { erpsurface } from './erpsurface.js';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/routes/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route Exports
|
|
3
|
+
*
|
|
4
|
+
* Central export for all API route handlers.
|
|
5
|
+
*/
|
|
6
|
+
export { simulate } from './simulate.js';
|
|
7
|
+
export { manifests } from './manifests.js';
|
|
8
|
+
export { plans } from './plans.js';
|
|
9
|
+
export { runner } from './runner.js';
|
|
10
|
+
export { roi } from './roi.js';
|
|
11
|
+
export { intent } from './intent.js';
|
|
12
|
+
export { exporters } from './exporters.js';
|
|
13
|
+
export { diligence } from './diligence.js';
|
|
14
|
+
export { health } from './health.js';
|
|
15
|
+
export { auth } from './auth.js';
|
|
16
|
+
export { erpsurface } from './erpsurface.js';
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/routes/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent Route Handler
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/intent
|
|
5
|
+
*
|
|
6
|
+
* Handles deployment intent resolution from the intent service.
|
|
7
|
+
* Used by the CLI's `deploy` command.
|
|
8
|
+
*/
|
|
9
|
+
import { Hono } from 'hono';
|
|
10
|
+
declare const intent: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
11
|
+
export { intent };
|
|
12
|
+
//# sourceMappingURL=intent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../../src/server/routes/intent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAI5B,QAAA,MAAM,MAAM,4EAAa,CAAC;AAsD1B,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intent Route Handler
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/intent
|
|
5
|
+
*
|
|
6
|
+
* Handles deployment intent resolution from the intent service.
|
|
7
|
+
* Used by the CLI's `deploy` command.
|
|
8
|
+
*/
|
|
9
|
+
import { Hono } from 'hono';
|
|
10
|
+
import { ids } from '../utils/id-generator.js';
|
|
11
|
+
import { buildIntentReference } from '../utils/response-builder.js';
|
|
12
|
+
const intent = new Hono();
|
|
13
|
+
/**
|
|
14
|
+
* POST /v1/intent
|
|
15
|
+
*
|
|
16
|
+
* Resolve deployment intent based on a simulation reference.
|
|
17
|
+
*/
|
|
18
|
+
intent.post('/', async (c) => {
|
|
19
|
+
try {
|
|
20
|
+
const body = await c.req.json();
|
|
21
|
+
// Validate required fields
|
|
22
|
+
if (!body.sim_ref) {
|
|
23
|
+
return c.json({
|
|
24
|
+
error: {
|
|
25
|
+
code: 'VALIDATION_ERROR',
|
|
26
|
+
message: 'sim_ref is required',
|
|
27
|
+
},
|
|
28
|
+
}, 400);
|
|
29
|
+
}
|
|
30
|
+
const id = ids.intent();
|
|
31
|
+
const spec = {
|
|
32
|
+
...body.spec,
|
|
33
|
+
environment: body.environment ?? 'default',
|
|
34
|
+
};
|
|
35
|
+
// Build response matching IntentReference type
|
|
36
|
+
const response = buildIntentReference(id, body.sim_ref, spec);
|
|
37
|
+
return c.json(response, 200);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.error('Intent route error:', error);
|
|
41
|
+
return c.json({
|
|
42
|
+
error: {
|
|
43
|
+
code: 'INTERNAL_ERROR',
|
|
44
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
45
|
+
},
|
|
46
|
+
}, 500);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export { intent };
|
|
50
|
+
//# sourceMappingURL=intent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent.js","sourceRoot":"","sources":["../../../src/server/routes/intent.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;AAQ1B;;;;GAIG;AACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC3B,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,EAAiB,CAAC;QAE/C,2BAA2B;QAC3B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,CAAC,CAAC,IAAI,CACX;gBACE,KAAK,EAAE;oBACL,IAAI,EAAE,kBAAkB;oBACxB,OAAO,EAAE,qBAAqB;iBAC/B;aACF,EACD,GAAG,CACJ,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;QACxB,MAAM,IAAI,GAAG;YACX,GAAG,IAAI,CAAC,IAAI;YACZ,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,SAAS;SAC3C,CAAC;QAEF,+CAA+C;QAC/C,MAAM,QAAQ,GAAG,oBAAoB,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAE9D,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;QAC5C,OAAO,CAAC,CAAC,IAAI,CACX;YACE,KAAK,EAAE;gBACL,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aAClE;SACF,EACD,GAAG,CACJ,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifests Route Handler
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/manifests
|
|
5
|
+
*
|
|
6
|
+
* Handles manifest selection/query from the manifests repository.
|
|
7
|
+
* Used by the CLI's `plan` command.
|
|
8
|
+
*/
|
|
9
|
+
import { Hono } from 'hono';
|
|
10
|
+
declare const manifests: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
11
|
+
export { manifests };
|
|
12
|
+
//# sourceMappingURL=manifests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifests.d.ts","sourceRoot":"","sources":["../../../src/server/routes/manifests.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAI5B,QAAA,MAAM,SAAS,4EAAa,CAAC;AAgD7B,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manifests Route Handler
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/manifests
|
|
5
|
+
*
|
|
6
|
+
* Handles manifest selection/query from the manifests repository.
|
|
7
|
+
* Used by the CLI's `plan` command.
|
|
8
|
+
*/
|
|
9
|
+
import { Hono } from 'hono';
|
|
10
|
+
import { ids } from '../utils/id-generator.js';
|
|
11
|
+
import { buildManifestReference } from '../utils/response-builder.js';
|
|
12
|
+
const manifests = new Hono();
|
|
13
|
+
/**
|
|
14
|
+
* POST /v1/manifests
|
|
15
|
+
*
|
|
16
|
+
* Select a manifest based on a query string.
|
|
17
|
+
*/
|
|
18
|
+
manifests.post('/', async (c) => {
|
|
19
|
+
try {
|
|
20
|
+
const body = await c.req.json();
|
|
21
|
+
// Validate required fields
|
|
22
|
+
if (!body.query) {
|
|
23
|
+
return c.json({
|
|
24
|
+
error: {
|
|
25
|
+
code: 'VALIDATION_ERROR',
|
|
26
|
+
message: 'query is required',
|
|
27
|
+
},
|
|
28
|
+
}, 400);
|
|
29
|
+
}
|
|
30
|
+
const id = ids.manifest();
|
|
31
|
+
// Build response matching ManifestReference type
|
|
32
|
+
const response = buildManifestReference(id, body.query);
|
|
33
|
+
return c.json(response, 200);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error('Manifests route error:', error);
|
|
37
|
+
return c.json({
|
|
38
|
+
error: {
|
|
39
|
+
code: 'INTERNAL_ERROR',
|
|
40
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
41
|
+
},
|
|
42
|
+
}, 500);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export { manifests };
|
|
46
|
+
//# sourceMappingURL=manifests.js.map
|
|
@@ -0,0 +1 @@
|
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AAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plans Route Handler
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/plans
|
|
5
|
+
*
|
|
6
|
+
* Handles simulation plan creation from the planner service.
|
|
7
|
+
* Used by the CLI's `plan` command.
|
|
8
|
+
*/
|
|
9
|
+
import { Hono } from 'hono';
|
|
10
|
+
declare const plans: Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
|
|
11
|
+
export { plans };
|
|
12
|
+
//# sourceMappingURL=plans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../../src/server/routes/plans.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAI5B,QAAA,MAAM,KAAK,4EAAa,CAAC;AAkDzB,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plans Route Handler
|
|
3
|
+
*
|
|
4
|
+
* POST /v1/plans
|
|
5
|
+
*
|
|
6
|
+
* Handles simulation plan creation from the planner service.
|
|
7
|
+
* Used by the CLI's `plan` command.
|
|
8
|
+
*/
|
|
9
|
+
import { Hono } from 'hono';
|
|
10
|
+
import { ids } from '../utils/id-generator.js';
|
|
11
|
+
import { buildPlanReference } from '../utils/response-builder.js';
|
|
12
|
+
const plans = new Hono();
|
|
13
|
+
/**
|
|
14
|
+
* POST /v1/plans
|
|
15
|
+
*
|
|
16
|
+
* Create a simulation plan based on a manifest reference.
|
|
17
|
+
*/
|
|
18
|
+
plans.post('/', async (c) => {
|
|
19
|
+
try {
|
|
20
|
+
const body = await c.req.json();
|
|
21
|
+
// Validate required fields
|
|
22
|
+
if (!body.manifest_ref) {
|
|
23
|
+
return c.json({
|
|
24
|
+
error: {
|
|
25
|
+
code: 'VALIDATION_ERROR',
|
|
26
|
+
message: 'manifest_ref is required',
|
|
27
|
+
},
|
|
28
|
+
}, 400);
|
|
29
|
+
}
|
|
30
|
+
const id = ids.plan();
|
|
31
|
+
const params = body.params ?? {};
|
|
32
|
+
// Build response matching PlanReference type
|
|
33
|
+
const response = buildPlanReference(id, body.manifest_ref, params);
|
|
34
|
+
return c.json(response, 200);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
console.error('Plans route error:', error);
|
|
38
|
+
return c.json({
|
|
39
|
+
error: {
|
|
40
|
+
code: 'INTERNAL_ERROR',
|
|
41
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
42
|
+
},
|
|
43
|
+
}, 500);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export { plans };
|
|
47
|
+
//# sourceMappingURL=plans.js.map
|