@ductape/mcp 0.2.27 → 0.2.29

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/dist/index.js +56 -21
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -780,19 +780,24 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
780
780
  databases.migration.rollback [migrations, count?]
781
781
  databases.migration.history []
782
782
  databases.migration.status [migrations]
783
- databases.action.create [{ tag: "product:database:action", name, tableName, operation: "query"|"insert"|"update"|"delete"|"upsert"|"aggregate"|"rawSql", template: { where?, select?, limit?, offset?, orderBy?, records?, query?, params?, ... }, description?, filterTemplate? }]
783
+ databases.action.create [{ tag: "product:database:action", name, description, tableName, operation: "query"|"insert"|"update"|"delete"|"aggregate"|"count", template, filterTemplate? }]
784
784
  ← ADMINISTRATIVE (access key required). FORBIDDEN via ductape_execute (publishable key) —
785
- use ductape_cli("db actions create -f action.json") instead. tag MUST be fully qualified
785
+ use ductape_cli("db actions create --action-file action.json") instead. tag MUST be fully qualified
786
786
  "product_tag:database_tag:action_tag" — a 2-part "database:action" shorthand only resolves
787
787
  inside a long-lived process that already has that product's builder cached, never in a
788
788
  fresh CLI/MCP call. This is pure metadata registration; it never connects to the live
789
789
  database, so it does NOT require the database to be reachable at call time.
790
+ MongoDB query example: { operation: "query", template: { where: { email: "{{email}}" } } }
791
+ Placeholders are {{name}}, never $Input{name}. For the exact manifest call
792
+ ductape_schema({ module: "product", method: "databases.action.create" }).
790
793
  databases.action.update [{ tag, name?, description?, template?, filterTemplate? }]
791
- ← ADMINISTRATIVE. Use ductape_cli("db actions update --tag <tag> -f patch.json").
794
+ ← ADMINISTRATIVE. Use ductape_cli("db actions update --tag <tag> --action-file patch.json").
792
795
  databases.action.fetch [action_tag] ← read-only, safe via ductape_execute
793
796
  databases.action.fetchAll [database_tag] ← read-only, safe via ductape_execute.
794
797
  NOTE: the method is fetchAll — "action.list" is not a callable method on this sub-object.
795
798
  databases.action.delete [action_tag] ← ADMINISTRATIVE. Use ductape_cli("db actions delete <tag>").
799
+ databases.execute [{ product, env, database, action, input, session? }] ← synchronous saved-action execution
800
+ CLI: ductape db actions execute --action-file execute.json --json
796
801
  databases.action.dispatch [{ product, env, database, action, input, schedule? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="dispatch", targets={database: "db_tag", table: "table_name"}) — requires redisUrl in ductape initialization
797
802
  databases.dispatch [{ product, env, database, action, input, schedule? }] ← CALL ductape_generate_payload FIRST (operation_family="database", method="dispatch", targets={database: "db_tag", table: "table_name"}) — requires redisUrl in ductape initialization
798
803
  databases.beginTransaction [{ product, env, database, isolationLevel?: "READ_COMMITTED"|"REPEATABLE_READ"|"SERIALIZABLE" }]
@@ -853,6 +858,13 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
853
858
  graph.getAction [actionTag, graphTag?, productTag?]
854
859
  graph.updateAction [actionTag, updates, graphTag?, productTag?]
855
860
  graph.deleteAction [actionTag, graphTag?, productTag?]
861
+ graph.action.create [{ product, graph|graphTag, name, description?, operation, query, parameters? }]
862
+ graph.action.update [{ product, graph|graphTag, action|actionTag, name?, description?, query?, parameters? }]
863
+ graph.action.fetch [{ product, graph|graphTag, action|actionTag }]
864
+ graph.action.fetchAll [{ product, graph|graphTag }]
865
+ graph.action.delete [{ product, graph|graphTag, action|actionTag }]
866
+ graph.action.execute [{ product, env, graph, action, input }]
867
+ graph.action.dispatch [{ product, env, graph, event, input, schedule? }]
856
868
  graph.beginTransaction [options?]
857
869
  graph.commitTransaction [transaction]
858
870
  graph.rollbackTransaction [transaction]
@@ -887,6 +899,12 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
887
899
  vector.deleteIndex [{ product, env, vector, name }]
888
900
  vector.listIndexes [{ product, env, vector }]
889
901
  vector.count [{ product, env, vector, namespace? }]
902
+ vector.actions.create [{ product, vector, actionTag, name, operation, template, description?, parameters? }]
903
+ vector.actions.update [{ product, vector, actionTag, name?, description?, template?, parameters? }]
904
+ vector.actions.fetch [{ product, vector, actionTag }]
905
+ vector.actions.fetchAll [{ product, vector }]
906
+ vector.actions.delete [{ product, vector, actionTag }]
907
+ vector.actions.execute [{ product, env, vector, action, input }]
890
908
 
891
909
  ━━━ MODULE: features ━━━
892
910
  Feature definitions are code-first. Use features.define in application source; do not call
@@ -918,7 +936,8 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
918
936
  // ctx.step(tag, fn, rollback?, opts?) – define a durable step
919
937
  // ctx.api.run({ app, action, input }) – call an app action (NOT 'event' -- that field name
920
938
  // only applies to ctx.database/ctx.notification/ctx.storage below, never ctx.api/ctx.action)
921
- // ctx.database.query/insert/update/delete({ database, event, ... })
939
+ // ctx.database.execute({ database, action, input }) for a saved database action
940
+ // ctx.database.query/insert/update/delete({ database, table, ... }) for direct operations
922
941
  // ctx.graph.execute({ graph, action, input })
923
942
  // ctx.notification.send/email/push/sms({ notification, event, ... })
924
943
  // ctx.storage.upload/download({ storage, event, input })
@@ -2409,22 +2428,24 @@ DUCTAPE DATABASE ACTIONS
2409
2428
 
2410
2429
  A database action is a saved, parameterized query or mutation template (with {{placeholder}}
2411
2430
  fields) stored on a database component and executed by tag at runtime. This is what
2412
- ctx.database.query/insert/update/delete inside a Feature step actually calls via its
2413
- \`event\` field Features do NOT accept the top-level {table, where} shape that
2414
- sdk.databases.query/insert/update use outside of a Feature.
2431
+ ctx.database.execute inside a Feature step invokes a saved action through its \`action\` field.
2432
+ Direct ctx.database.query/insert/update/delete calls retain their normal {table, where, data, ...}
2433
+ shape and do not resolve a saved action.
2415
2434
 
2416
2435
  Create/update/delete are ADMINISTRATIVE (access key) — FORBIDDEN through ductape_execute
2417
2436
  (publishable key). Use ductape_cli, same as every other admin resource:
2418
- ductape_cli("db actions create -f action.json")
2419
- File: { tag: "product:database:action", name, tableName,
2420
- operation: "query"|"insert"|"update"|"delete"|"upsert"|"aggregate"|"rawSql",
2421
- template: { where?, select?, limit?, offset?, orderBy?, records?, query?, params? },
2422
- description?, filterTemplate? }
2437
+ ductape_cli("db actions create --action-file action.json")
2438
+ File: { tag: "product:database:action", name, description, tableName,
2439
+ operation: "query"|"insert"|"update"|"delete"|"aggregate"|"count",
2440
+ template, filterTemplate? }
2441
+ MongoDB query: { operation: "query", template: { where: { email: "{{email}}" } } }
2442
+ Placeholders use {{name}}, never $Input{name}. Call
2443
+ ductape_schema({ module: "product", method: "databases.action.create" }) for the exact shape.
2423
2444
  tag MUST be fully qualified "product_tag:database_tag:action_tag" — the SDK's 2-part
2424
2445
  "database:action" shorthand only works inside one already-warm process, never a fresh CLI call.
2425
2446
  This is pure metadata registration — it does not connect to the live database, so the
2426
2447
  database does not need to be reachable at creation time.
2427
- ductape_cli("db actions update --tag <tag> -f patch.json")
2448
+ ductape_cli("db actions update --tag <tag> --action-file patch.json")
2428
2449
  ductape_cli("db actions delete <tag>")
2429
2450
 
2430
2451
  List/fetch are read-only and safe via ductape_execute:
@@ -2433,6 +2454,15 @@ List/fetch are read-only and safe via ductape_execute:
2433
2454
  ductape_execute("databases.action.fetch", ["product_tag:database_tag:action_tag"])
2434
2455
 
2435
2456
  Dispatch an action at runtime:
2457
+ Synchronous execution:
2458
+ ductape_execute("databases.execute", [{
2459
+ product: "my-product", env: "prd", database: "core-db",
2460
+ action: "get-active-users", input: { status: "active" }
2461
+ }])
2462
+ CLI equivalent:
2463
+ ductape_cli("db actions execute --action-file execute.json --json")
2464
+
2465
+ Deferred or scheduled execution:
2436
2466
  → CALL ductape_generate_payload FIRST to get the canonical input shape.
2437
2467
  ductape_execute("databases.action.dispatch", [{
2438
2468
  product: "my-product",
@@ -2861,8 +2891,8 @@ Run an action at runtime:
2861
2891
  In a Ductape feature handler, call the registered action through:
2862
2892
  await ctx.api.run({ app: "<app_tag>", action: "<action_tag>", input: { ... } })
2863
2893
  ctx.api is the supported feature-context surface (also described as ctx.action in older code).
2864
- NEVER use 'event' as the field name here -- that is only correct for ctx.database/ctx.notification/
2865
- ctx.storage steps. ctx.api.run's real field is 'action'; passing 'event' instead silently produces
2894
+ NEVER use 'event' as the field name here -- that is only correct for ctx.notification/ctx.storage
2895
+ steps. ctx.api.run and ctx.database.execute both use 'action'; passing 'event' instead produces
2866
2896
  an unset step and fails feature compilation with "did not record a portable operation".
2867
2897
  There is no ctx.apps, ctx.integrations, or generic external-HTTP feature surface.
2868
2898
 
@@ -3903,9 +3933,9 @@ Synchronous multi-step Feature (no Event, schedule, sleep, signal, or external s
3903
3933
  },
3904
3934
  handler: async (ctx) => {
3905
3935
  const validated = await ctx.step('validate-orders', () =>
3906
- ctx.database.execute({ database: 'orders-db', event: 'validate-orders', input: ctx.input }));
3936
+ ctx.database.execute({ database: 'orders-db', action: 'validate-orders', input: ctx.input }));
3907
3937
  return ctx.step('resolve-orders', () =>
3908
- ctx.database.execute({ database: 'orders-db', event: 'resolve-orders', input: validated }));
3938
+ ctx.database.execute({ database: 'orders-db', action: 'resolve-orders', input: validated }));
3909
3939
  },
3910
3940
  });
3911
3941
  This is a valid Feature despite requiring no signal and producing no Event. Its qualification comes
@@ -3919,9 +3949,9 @@ Define a feature (write this into the project's source files — do NOT use feat
3919
3949
  name: "Onboard User",
3920
3950
  handler: async (ctx) => {
3921
3951
  const account = await ctx.step("create-account", async () =>
3922
- ctx.database.insert({ database: "core-db", event: "insert-user",
3952
+ ctx.database.insert({ database: "core-db", table: "users",
3923
3953
  data: { userId: ctx.input.userId, email: ctx.input.email } }),
3924
- async (result) => ctx.database.delete({ database: "core-db", event: "delete-user",
3954
+ async (result) => ctx.database.delete({ database: "core-db", table: "users",
3925
3955
  where: { id: result.id } }) // rollback
3926
3956
  );
3927
3957
 
@@ -5016,9 +5046,9 @@ SAVED GRAPH ACTION ASSET AND CLI CONTRACT:
5016
5046
  Validate without mutation:
5017
5047
  ductape graph validateAction -f ductape/graphs/discovery-graph/actions/upsert-product-v1.action.json --json
5018
5048
  Create and persist against the linked product:
5019
- ductape graph createAction -f ductape/graphs/discovery-graph/actions/upsert-product-v1.action.json --json
5049
+ ductape graph actions create --action-file ductape/graphs/discovery-graph/actions/upsert-product-v1.action.json --json
5020
5050
  Read back with graph.getAction/listActions before relying on it. In-place updates use:
5021
- ductape graph updateAction -f <patch.json> --json
5051
+ ductape graph actions update --action-file <patch.json> --json
5022
5052
  where patch.json is { "actionTag":"upsert-product-v1", "graphTag":"discovery-graph", "updates":{...} }.
5023
5053
  Updating name does not change the stored tag. For breaking query/input/result changes, create a new
5024
5054
  name/tag such as V2 and migrate callers; use updateAction for compatible corrections only.
@@ -5044,6 +5074,11 @@ EXACT CODE-FIRST VECTOR CONTEXT:
5044
5074
  Product/env and the Feature's inherited session are supplied by the executor. Do not serialize
5045
5075
  them into the Feature definition. Note the deliberate naming: ctx.vector.query uses values for
5046
5076
  the embedding, while the lower-level ductape.vector.query runtime facade uses vector.
5077
+ Register reusable vector actions administratively, then read them back before compiling Features:
5078
+ ductape vector actions create --action-file vector-action.json --json
5079
+ ductape vector actions get <action-tag> --vector <vector-tag> --json
5080
+ Update/delete/list use the same \`ductape vector actions\` surface. At runtime the SDK namespace is
5081
+ \`ductape.vector.actions.*\` (plural), while Feature reuse is singular \`ctx.vector.execute(...)\`.
5047
5082
  Vertex AI Vector Search stores and searches supplied vectors. It does NOT generate embeddings.
5048
5083
  Do not claim that a Vertex Vector Search index embeds text.
5049
5084
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ductape/mcp",
3
- "version": "0.2.27",
3
+ "version": "0.2.29",
4
4
  "description": "MCP server that exposes Ductape SDK operations via the backend proxy",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",