@biznetgio/neo-app 0.4.44 → 0.4.47
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/package.json +1 -1
- package/src/mcp/tools.js +49 -4
package/package.json
CHANGED
package/src/mcp/tools.js
CHANGED
|
@@ -1258,6 +1258,45 @@ export const TOOLS = [
|
|
|
1258
1258
|
return result(status, data);
|
|
1259
1259
|
},
|
|
1260
1260
|
},
|
|
1261
|
+
{
|
|
1262
|
+
name: 'neo_plan_project_deletion',
|
|
1263
|
+
description:
|
|
1264
|
+
'Create a ZERO-WRITE, immutable deletion plan for a project (#107 §4): enumerates the full child inventory, pins it (planId/planHash, expires in 15 min), and returns the reverse-dependency delete phases + a server-side exact-name project_delete confirmation. Deletes NOTHING. Then: show the user the inventory + no-refund warning, call neo_confirm_action(confirmationId, "approve", confirmationPhrase=<EXACT project name>, and acknowledgeNoRefund:true if ackRequired), then neo_apply_project_deletion(planId, planHash, confirmationId). Poll neo_get_operation/neo_wait_operation. Destructive, irreversible, no refund; the organization is never deleted.',
|
|
1265
|
+
mutating: false,
|
|
1266
|
+
schema: {
|
|
1267
|
+
type: 'object',
|
|
1268
|
+
properties: {
|
|
1269
|
+
projectId: str('Project id'),
|
|
1270
|
+
cascade: { type: 'boolean', description: 'REQUIRED true for a non-empty project — plan deleting the project AND all of its resources.' },
|
|
1271
|
+
},
|
|
1272
|
+
required: ['projectId'],
|
|
1273
|
+
},
|
|
1274
|
+
async call(api, args) {
|
|
1275
|
+
const { status, data } = await api.post(`/api/v1/projects/${args.projectId}/plans/deletion`, { cascade: args.cascade === true });
|
|
1276
|
+
return redactSecrets(result(status, data));
|
|
1277
|
+
},
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
name: 'neo_apply_project_deletion',
|
|
1281
|
+
description:
|
|
1282
|
+
'Apply an APPROVED project-deletion plan (#107 §8): deletes the project and ALL its resources in reverse dependency order, server-enforced + single-use. Requires planId + planHash (from neo_plan_project_deletion) and an APPROVED confirmationId (from neo_confirm_action). Returns an operationId — poll neo_get_operation / neo_wait_operation for per-resource phase status (deleting_scheduled_jobs → applications → bindings → queues_and_buckets → databases → deleting_project → reconciling_metering; terminal applied|partial). Destructive, irreversible, no refund; the organization is never deleted.',
|
|
1283
|
+
mutating: true,
|
|
1284
|
+
destructive: true,
|
|
1285
|
+
schema: {
|
|
1286
|
+
type: 'object',
|
|
1287
|
+
properties: {
|
|
1288
|
+
planId: str('Plan id from neo_plan_project_deletion'),
|
|
1289
|
+
planHash: str('Plan hash from neo_plan_project_deletion'),
|
|
1290
|
+
confirmationId: str('An APPROVED project_delete confirmation id (from neo_confirm_action)'),
|
|
1291
|
+
idempotencyKey: str('Optional idempotency key'),
|
|
1292
|
+
},
|
|
1293
|
+
required: ['planId', 'planHash', 'confirmationId'],
|
|
1294
|
+
},
|
|
1295
|
+
async call(api, args) {
|
|
1296
|
+
const { status, data } = await api.post(`/api/v1/plans/${args.planId}/apply`, { planHash: args.planHash, confirmationId: args.confirmationId, idempotencyKey: args.idempotencyKey });
|
|
1297
|
+
return redactSecrets(result(status, data));
|
|
1298
|
+
},
|
|
1299
|
+
},
|
|
1261
1300
|
// --- Costed plan / apply backbone (handoff 3.3-3.5 + 7): plan a whole stack
|
|
1262
1301
|
// zero-write, review the cost, then apply with the plan id+hash. The server
|
|
1263
1302
|
// enforces the plan (hash/expiry/one-shot) and runs it in dependency order. ---
|
|
@@ -1367,23 +1406,29 @@ export const TOOLS = [
|
|
|
1367
1406
|
},
|
|
1368
1407
|
{
|
|
1369
1408
|
name: 'neo_wait_operation',
|
|
1370
|
-
description: 'Wait for a stack apply (
|
|
1409
|
+
description: 'Wait for an operation — a stack apply (neo_apply_stack) OR a project deletion (neo_apply_project_deletion) — to finish: polls until the status is terminal (applied | partial | failed) or the timeout elapses, then returns the final operation with per-resource status (secrets redacted). Pass afterRevision to also return as soon as the operation advances past a revision you already saw (resume observation after a disconnect). Convenience over polling neo_get_operation yourself.',
|
|
1371
1410
|
mutating: false,
|
|
1372
1411
|
schema: {
|
|
1373
1412
|
type: 'object',
|
|
1374
|
-
properties: {
|
|
1413
|
+
properties: {
|
|
1414
|
+
operationId: str('Operation id (= plan id)'),
|
|
1415
|
+
timeoutMs: int('Max wait in milliseconds (default 180000)'),
|
|
1416
|
+
afterRevision: int('Return as soon as the operation revision exceeds this (resume observation); omit to wait for a terminal status'),
|
|
1417
|
+
},
|
|
1375
1418
|
required: ['operationId'],
|
|
1376
1419
|
},
|
|
1377
1420
|
async call(api, args) {
|
|
1378
1421
|
const deadline = Date.now() + (args.timeoutMs && args.timeoutMs > 0 ? args.timeoutMs : 180000);
|
|
1379
1422
|
const terminal = new Set(['applied', 'partial', 'failed']);
|
|
1423
|
+
const after = Number.isInteger(args.afterRevision) ? args.afterRevision : undefined;
|
|
1380
1424
|
let op;
|
|
1381
1425
|
for (;;) {
|
|
1382
1426
|
op = redactSecrets((await api.get(`/api/v1/plans/${args.operationId}`)).data);
|
|
1383
|
-
|
|
1427
|
+
const advanced = after !== undefined && typeof op.revision === 'number' && op.revision > after;
|
|
1428
|
+
if (terminal.has(op.status) || advanced || Date.now() >= deadline) break;
|
|
1384
1429
|
await new Promise((r) => setTimeout(r, 5000));
|
|
1385
1430
|
}
|
|
1386
|
-
if (op && !terminal.has(op.status)) return { ...op, timedOut: true, note: 'still in progress at timeout — call neo_get_operation again' };
|
|
1431
|
+
if (op && !terminal.has(op.status) && Date.now() >= deadline) return { ...op, timedOut: true, note: 'still in progress at timeout — call neo_get_operation again' };
|
|
1387
1432
|
return op;
|
|
1388
1433
|
},
|
|
1389
1434
|
},
|