@biznetgio/neo-app 0.4.22 → 0.4.23

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/mcp/tools.js +33 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biznetgio/neo-app",
3
- "version": "0.4.22",
3
+ "version": "0.4.23",
4
4
  "description": "NEO App CLI — one-command agent onboarding, MCP server, and project ops for coding agents (Codex, Claude Code).",
5
5
  "type": "module",
6
6
  "bin": {
package/src/mcp/tools.js CHANGED
@@ -105,7 +105,7 @@ export const TOOLS = [
105
105
  controlPlane,
106
106
  resourceTypes,
107
107
  // Verbs this MCP build exposes today (no create-DB/queue/cron/bucket, no costed plan/apply yet).
108
- lifecycleVerbs: ['plan', 'apply', 'get_operation', 'create', 'list', 'get', 'deploy', 'scale', 'logs', 'get_variables', 'set_variable', 'estimate', 'bind', 'unbind', 'run_cron', 'delete', 'list_approvals', 'get_approval', 'get_credit', 'list_templates'],
108
+ lifecycleVerbs: ['plan', 'apply', 'get_operation', 'wait_operation', 'create', 'list', 'get', 'update', 'deploy', 'scale', 'logs', 'get_variables', 'set_variable', 'estimate', 'scan_repo', 'bind', 'unbind', 'run_cron', 'presign_object', 'delete', 'list_approvals', 'get_approval', 'get_credit', 'list_templates'],
109
109
  bindings: { supported: true, targets: ['neo_db', 'neo_queue'], writeOnly: true, note: 'neo_bind_resource injects DATABASE_URL/NATS_URL server-side at deploy; the secret is never returned (handoff 5)' },
110
110
  sourceTypes: ['git', 'image', 'dockerfile', 'local', 'template'],
111
111
  environments: ['staging', 'production'],
@@ -661,6 +661,15 @@ export const TOOLS = [
661
661
  return result(status, data);
662
662
  },
663
663
  },
664
+ {
665
+ name: 'neo_presign_bucket_object',
666
+ description: 'Get a time-limited presigned URL to download an object from a bucket (handoff 4.7 — object get). The URL is a short-lived signed link, not long-term credentials.',
667
+ mutating: false,
668
+ schema: { type: 'object', properties: { bucketId: str('Bucket id'), object: str('Object key/path') }, required: ['bucketId', 'object'] },
669
+ async call(api, args) {
670
+ return (await api.get(`/api/v1/buckets/${args.bucketId}/objects/presign`, { query: { object: args.object } })).data;
671
+ },
672
+ },
664
673
  // --- Typed bindings (handoff 5): attach a DB/queue to a consumer service. The
665
674
  // connection string is injected as an env var SERVER-SIDE at the consumer's next
666
675
  // deploy (marked a secret) — it is never returned to the agent (write-only). ---
@@ -785,13 +794,35 @@ export const TOOLS = [
785
794
  },
786
795
  {
787
796
  name: 'neo_get_operation',
788
- description: 'Get the status of a stack apply (the operationId/planId from neo_apply_stack): overall status (applying | applied | failed) plus per-resource status (creating | deploying | deployed | failed). Apply waits for each deploy — "applied" means every resource reached a successful deploy (databases/queues rollout-ready), not merely that the manifest was submitted. Poll until terminal.',
797
+ description: 'Get the status of a stack apply (the operationId/planId from neo_apply_stack). Overall status: applying | applied | partial | failed. Per-resource status: creating | deploying | deployed | ready | blocked | failed, plus a `healthy` flag + `url` for services (apply probes the public URL — "ready" means it actually responded) and `blockedBy` when a consumer\'s foundation failed. Poll until terminal.',
789
798
  mutating: false,
790
799
  schema: { type: 'object', properties: { operationId: str('Operation id (= plan id from neo_apply_stack)') }, required: ['operationId'] },
791
800
  async call(api, args) {
792
801
  return redactSecrets((await api.get(`/api/v1/plans/${args.operationId}`)).data);
793
802
  },
794
803
  },
804
+ {
805
+ name: 'neo_wait_operation',
806
+ description: 'Wait for a stack apply (operationId from neo_apply_stack) 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). Convenience over polling neo_get_operation yourself.',
807
+ mutating: false,
808
+ schema: {
809
+ type: 'object',
810
+ properties: { operationId: str('Operation id (= plan id)'), timeoutMs: int('Max wait in milliseconds (default 180000)') },
811
+ required: ['operationId'],
812
+ },
813
+ async call(api, args) {
814
+ const deadline = Date.now() + (args.timeoutMs && args.timeoutMs > 0 ? args.timeoutMs : 180000);
815
+ const terminal = new Set(['applied', 'partial', 'failed']);
816
+ let op;
817
+ for (;;) {
818
+ op = redactSecrets((await api.get(`/api/v1/plans/${args.operationId}`)).data);
819
+ if (terminal.has(op.status) || Date.now() >= deadline) break;
820
+ await new Promise((r) => setTimeout(r, 5000));
821
+ }
822
+ if (op && !terminal.has(op.status)) return { ...op, timedOut: true, note: 'still in progress at timeout — call neo_get_operation again' };
823
+ return op;
824
+ },
825
+ },
795
826
  // --- Cleanup (handoff 3.6): MCP can delete every resource type it can reach, so
796
827
  // an agent never leaks a resource it created. These are DESTRUCTIVE and permanent;
797
828
  // the server hard-deletes the record and tears down the running workload. ---