@ductape/mcp 0.2.27 → 0.2.28
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/index.js +46 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -782,17 +782,19 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
782
782
|
databases.migration.status [migrations]
|
|
783
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? }]
|
|
784
784
|
← ADMINISTRATIVE (access key required). FORBIDDEN via ductape_execute (publishable key) —
|
|
785
|
-
use ductape_cli("db actions create -
|
|
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
790
|
databases.action.update [{ tag, name?, description?, template?, filterTemplate? }]
|
|
791
|
-
← ADMINISTRATIVE. Use ductape_cli("db actions update --tag <tag> -
|
|
791
|
+
← ADMINISTRATIVE. Use ductape_cli("db actions update --tag <tag> --action-file patch.json").
|
|
792
792
|
databases.action.fetch [action_tag] ← read-only, safe via ductape_execute
|
|
793
793
|
databases.action.fetchAll [database_tag] ← read-only, safe via ductape_execute.
|
|
794
794
|
NOTE: the method is fetchAll — "action.list" is not a callable method on this sub-object.
|
|
795
795
|
databases.action.delete [action_tag] ← ADMINISTRATIVE. Use ductape_cli("db actions delete <tag>").
|
|
796
|
+
databases.execute [{ product, env, database, action, input, session? }] ← synchronous saved-action execution
|
|
797
|
+
CLI: ductape db actions execute --action-file execute.json --json
|
|
796
798
|
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
799
|
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
800
|
databases.beginTransaction [{ product, env, database, isolationLevel?: "READ_COMMITTED"|"REPEATABLE_READ"|"SERIALIZABLE" }]
|
|
@@ -853,6 +855,13 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
853
855
|
graph.getAction [actionTag, graphTag?, productTag?]
|
|
854
856
|
graph.updateAction [actionTag, updates, graphTag?, productTag?]
|
|
855
857
|
graph.deleteAction [actionTag, graphTag?, productTag?]
|
|
858
|
+
graph.action.create [{ product, graph|graphTag, name, description?, operation, query, parameters? }]
|
|
859
|
+
graph.action.update [{ product, graph|graphTag, action|actionTag, name?, description?, query?, parameters? }]
|
|
860
|
+
graph.action.fetch [{ product, graph|graphTag, action|actionTag }]
|
|
861
|
+
graph.action.fetchAll [{ product, graph|graphTag }]
|
|
862
|
+
graph.action.delete [{ product, graph|graphTag, action|actionTag }]
|
|
863
|
+
graph.action.execute [{ product, env, graph, action, input }]
|
|
864
|
+
graph.action.dispatch [{ product, env, graph, event, input, schedule? }]
|
|
856
865
|
graph.beginTransaction [options?]
|
|
857
866
|
graph.commitTransaction [transaction]
|
|
858
867
|
graph.rollbackTransaction [transaction]
|
|
@@ -887,6 +896,12 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
887
896
|
vector.deleteIndex [{ product, env, vector, name }]
|
|
888
897
|
vector.listIndexes [{ product, env, vector }]
|
|
889
898
|
vector.count [{ product, env, vector, namespace? }]
|
|
899
|
+
vector.actions.create [{ product, vector, actionTag, name, operation, template, description?, parameters? }]
|
|
900
|
+
vector.actions.update [{ product, vector, actionTag, name?, description?, template?, parameters? }]
|
|
901
|
+
vector.actions.fetch [{ product, vector, actionTag }]
|
|
902
|
+
vector.actions.fetchAll [{ product, vector }]
|
|
903
|
+
vector.actions.delete [{ product, vector, actionTag }]
|
|
904
|
+
vector.actions.execute [{ product, env, vector, action, input }]
|
|
890
905
|
|
|
891
906
|
━━━ MODULE: features ━━━
|
|
892
907
|
Feature definitions are code-first. Use features.define in application source; do not call
|
|
@@ -918,7 +933,8 @@ ALL params are passed as a JSON array in positional order matching the SDK signa
|
|
|
918
933
|
// ctx.step(tag, fn, rollback?, opts?) – define a durable step
|
|
919
934
|
// ctx.api.run({ app, action, input }) – call an app action (NOT 'event' -- that field name
|
|
920
935
|
// only applies to ctx.database/ctx.notification/ctx.storage below, never ctx.api/ctx.action)
|
|
921
|
-
// ctx.database.
|
|
936
|
+
// ctx.database.execute({ database, action, input }) for a saved database action
|
|
937
|
+
// ctx.database.query/insert/update/delete({ database, table, ... }) for direct operations
|
|
922
938
|
// ctx.graph.execute({ graph, action, input })
|
|
923
939
|
// ctx.notification.send/email/push/sms({ notification, event, ... })
|
|
924
940
|
// ctx.storage.upload/download({ storage, event, input })
|
|
@@ -2409,13 +2425,13 @@ DUCTAPE DATABASE ACTIONS
|
|
|
2409
2425
|
|
|
2410
2426
|
A database action is a saved, parameterized query or mutation template (with {{placeholder}}
|
|
2411
2427
|
fields) stored on a database component and executed by tag at runtime. This is what
|
|
2412
|
-
ctx.database.
|
|
2413
|
-
|
|
2414
|
-
|
|
2428
|
+
ctx.database.execute inside a Feature step invokes a saved action through its \`action\` field.
|
|
2429
|
+
Direct ctx.database.query/insert/update/delete calls retain their normal {table, where, data, ...}
|
|
2430
|
+
shape and do not resolve a saved action.
|
|
2415
2431
|
|
|
2416
2432
|
Create/update/delete are ADMINISTRATIVE (access key) — FORBIDDEN through ductape_execute
|
|
2417
2433
|
(publishable key). Use ductape_cli, same as every other admin resource:
|
|
2418
|
-
ductape_cli("db actions create -
|
|
2434
|
+
ductape_cli("db actions create --action-file action.json")
|
|
2419
2435
|
File: { tag: "product:database:action", name, tableName,
|
|
2420
2436
|
operation: "query"|"insert"|"update"|"delete"|"upsert"|"aggregate"|"rawSql",
|
|
2421
2437
|
template: { where?, select?, limit?, offset?, orderBy?, records?, query?, params? },
|
|
@@ -2424,7 +2440,7 @@ Create/update/delete are ADMINISTRATIVE (access key) — FORBIDDEN through ducta
|
|
|
2424
2440
|
"database:action" shorthand only works inside one already-warm process, never a fresh CLI call.
|
|
2425
2441
|
This is pure metadata registration — it does not connect to the live database, so the
|
|
2426
2442
|
database does not need to be reachable at creation time.
|
|
2427
|
-
ductape_cli("db actions update --tag <tag> -
|
|
2443
|
+
ductape_cli("db actions update --tag <tag> --action-file patch.json")
|
|
2428
2444
|
ductape_cli("db actions delete <tag>")
|
|
2429
2445
|
|
|
2430
2446
|
List/fetch are read-only and safe via ductape_execute:
|
|
@@ -2433,6 +2449,15 @@ List/fetch are read-only and safe via ductape_execute:
|
|
|
2433
2449
|
ductape_execute("databases.action.fetch", ["product_tag:database_tag:action_tag"])
|
|
2434
2450
|
|
|
2435
2451
|
Dispatch an action at runtime:
|
|
2452
|
+
Synchronous execution:
|
|
2453
|
+
ductape_execute("databases.execute", [{
|
|
2454
|
+
product: "my-product", env: "prd", database: "core-db",
|
|
2455
|
+
action: "get-active-users", input: { status: "active" }
|
|
2456
|
+
}])
|
|
2457
|
+
CLI equivalent:
|
|
2458
|
+
ductape_cli("db actions execute --action-file execute.json --json")
|
|
2459
|
+
|
|
2460
|
+
Deferred or scheduled execution:
|
|
2436
2461
|
→ CALL ductape_generate_payload FIRST to get the canonical input shape.
|
|
2437
2462
|
ductape_execute("databases.action.dispatch", [{
|
|
2438
2463
|
product: "my-product",
|
|
@@ -2861,8 +2886,8 @@ Run an action at runtime:
|
|
|
2861
2886
|
In a Ductape feature handler, call the registered action through:
|
|
2862
2887
|
await ctx.api.run({ app: "<app_tag>", action: "<action_tag>", input: { ... } })
|
|
2863
2888
|
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.
|
|
2865
|
-
|
|
2889
|
+
NEVER use 'event' as the field name here -- that is only correct for ctx.notification/ctx.storage
|
|
2890
|
+
steps. ctx.api.run and ctx.database.execute both use 'action'; passing 'event' instead produces
|
|
2866
2891
|
an unset step and fails feature compilation with "did not record a portable operation".
|
|
2867
2892
|
There is no ctx.apps, ctx.integrations, or generic external-HTTP feature surface.
|
|
2868
2893
|
|
|
@@ -3903,9 +3928,9 @@ Synchronous multi-step Feature (no Event, schedule, sleep, signal, or external s
|
|
|
3903
3928
|
},
|
|
3904
3929
|
handler: async (ctx) => {
|
|
3905
3930
|
const validated = await ctx.step('validate-orders', () =>
|
|
3906
|
-
ctx.database.execute({ database: 'orders-db',
|
|
3931
|
+
ctx.database.execute({ database: 'orders-db', action: 'validate-orders', input: ctx.input }));
|
|
3907
3932
|
return ctx.step('resolve-orders', () =>
|
|
3908
|
-
ctx.database.execute({ database: 'orders-db',
|
|
3933
|
+
ctx.database.execute({ database: 'orders-db', action: 'resolve-orders', input: validated }));
|
|
3909
3934
|
},
|
|
3910
3935
|
});
|
|
3911
3936
|
This is a valid Feature despite requiring no signal and producing no Event. Its qualification comes
|
|
@@ -3919,9 +3944,9 @@ Define a feature (write this into the project's source files — do NOT use feat
|
|
|
3919
3944
|
name: "Onboard User",
|
|
3920
3945
|
handler: async (ctx) => {
|
|
3921
3946
|
const account = await ctx.step("create-account", async () =>
|
|
3922
|
-
ctx.database.insert({ database: "core-db",
|
|
3947
|
+
ctx.database.insert({ database: "core-db", table: "users",
|
|
3923
3948
|
data: { userId: ctx.input.userId, email: ctx.input.email } }),
|
|
3924
|
-
async (result) => ctx.database.delete({ database: "core-db",
|
|
3949
|
+
async (result) => ctx.database.delete({ database: "core-db", table: "users",
|
|
3925
3950
|
where: { id: result.id } }) // rollback
|
|
3926
3951
|
);
|
|
3927
3952
|
|
|
@@ -5016,9 +5041,9 @@ SAVED GRAPH ACTION ASSET AND CLI CONTRACT:
|
|
|
5016
5041
|
Validate without mutation:
|
|
5017
5042
|
ductape graph validateAction -f ductape/graphs/discovery-graph/actions/upsert-product-v1.action.json --json
|
|
5018
5043
|
Create and persist against the linked product:
|
|
5019
|
-
ductape graph
|
|
5044
|
+
ductape graph actions create --action-file ductape/graphs/discovery-graph/actions/upsert-product-v1.action.json --json
|
|
5020
5045
|
Read back with graph.getAction/listActions before relying on it. In-place updates use:
|
|
5021
|
-
ductape graph
|
|
5046
|
+
ductape graph actions update --action-file <patch.json> --json
|
|
5022
5047
|
where patch.json is { "actionTag":"upsert-product-v1", "graphTag":"discovery-graph", "updates":{...} }.
|
|
5023
5048
|
Updating name does not change the stored tag. For breaking query/input/result changes, create a new
|
|
5024
5049
|
name/tag such as V2 and migrate callers; use updateAction for compatible corrections only.
|
|
@@ -5044,6 +5069,11 @@ EXACT CODE-FIRST VECTOR CONTEXT:
|
|
|
5044
5069
|
Product/env and the Feature's inherited session are supplied by the executor. Do not serialize
|
|
5045
5070
|
them into the Feature definition. Note the deliberate naming: ctx.vector.query uses values for
|
|
5046
5071
|
the embedding, while the lower-level ductape.vector.query runtime facade uses vector.
|
|
5072
|
+
Register reusable vector actions administratively, then read them back before compiling Features:
|
|
5073
|
+
ductape vector actions create --action-file vector-action.json --json
|
|
5074
|
+
ductape vector actions get <action-tag> --vector <vector-tag> --json
|
|
5075
|
+
Update/delete/list use the same \`ductape vector actions\` surface. At runtime the SDK namespace is
|
|
5076
|
+
\`ductape.vector.actions.*\` (plural), while Feature reuse is singular \`ctx.vector.execute(...)\`.
|
|
5047
5077
|
Vertex AI Vector Search stores and searches supplied vectors. It does NOT generate embeddings.
|
|
5048
5078
|
Do not claim that a Vertex Vector Search index embeds text.
|
|
5049
5079
|
|