@dench.com/cli 3.11.27-staging.636 → 3.11.29-staging.640
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/README.md +9 -9
- package/app-sdk.d.ts +6 -172
- package/dench.ts +6 -164
- package/lib/api-schemas.ts +9 -65
- package/lib/app-sdk-catalog.generated.ts +0 -8
- package/lib/app-sdk-surface.ts +0 -21
- package/lib/command-registry.ts +0 -36
- package/lib/references.generated.json +12 -12
- package/package.json +1 -1
- package/tools.ts +7 -24
package/lib/api-schemas.ts
CHANGED
|
@@ -222,8 +222,6 @@ const memoryVisibility = z
|
|
|
222
222
|
.enum(["user", "org"])
|
|
223
223
|
.describe("Who can see the memory. Defaults to `user`.");
|
|
224
224
|
|
|
225
|
-
const riskLevel = z.enum(["low", "medium", "high"]).describe("Risk level.");
|
|
226
|
-
|
|
227
225
|
const repeatWeekday = z.enum(["mo", "tu", "we", "th", "fr", "sa", "su"]);
|
|
228
226
|
/** Structured repeat rule for tasks (mirrors convex/lib/crm/taskRepeatRule). */
|
|
229
227
|
const taskRepeatRuleSchema = z.discriminatedUnion("freq", [
|
|
@@ -256,10 +254,6 @@ const taskRepeatRuleSchema = z.discriminatedUnion("freq", [
|
|
|
256
254
|
}),
|
|
257
255
|
]);
|
|
258
256
|
|
|
259
|
-
const approvalDecision = z
|
|
260
|
-
.enum(["approved", "rejected"])
|
|
261
|
-
.describe("Human decision for an approval request.");
|
|
262
|
-
|
|
263
257
|
const signInIntent = z
|
|
264
258
|
.enum(["join_existing", "create_workspace"])
|
|
265
259
|
.describe("Whether to join an existing workspace or create a new one.");
|
|
@@ -1187,19 +1181,11 @@ const workspaceStatusPayload = z
|
|
|
1187
1181
|
activeAgents: z.array(
|
|
1188
1182
|
agentRef.extend({ lastSeenAt: z.number().optional() }),
|
|
1189
1183
|
),
|
|
1190
|
-
pendingApprovals: z
|
|
1191
|
-
z
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
reason: z.string(),
|
|
1196
|
-
kind: z.string().optional(),
|
|
1197
|
-
risk: riskLevel,
|
|
1198
|
-
agentId: z.string().optional(),
|
|
1199
|
-
createdAt: z.number(),
|
|
1200
|
-
})
|
|
1201
|
-
.passthrough(),
|
|
1202
|
-
),
|
|
1184
|
+
pendingApprovals: z
|
|
1185
|
+
.array(z.object({}).passthrough())
|
|
1186
|
+
.describe(
|
|
1187
|
+
"Always empty: approvals were removed. Kept for older clients.",
|
|
1188
|
+
),
|
|
1203
1189
|
recentArtifacts: z.array(artifactRow),
|
|
1204
1190
|
suggestedWork: z.array(
|
|
1205
1191
|
artifactRow.extend({ nextCommands: z.array(z.string()) }),
|
|
@@ -1233,12 +1219,11 @@ const workspaceStatusPayload = z
|
|
|
1233
1219
|
tools: z.object({
|
|
1234
1220
|
discovery: z.array(z.string()),
|
|
1235
1221
|
cli: z.array(z.string()),
|
|
1236
|
-
approvalPolicy: z.string(),
|
|
1237
1222
|
}),
|
|
1238
1223
|
nextActions: z.array(z.string()),
|
|
1239
1224
|
})
|
|
1240
1225
|
.describe(
|
|
1241
|
-
"Workspace orientation payload shared by /context, /status
|
|
1226
|
+
"Workspace orientation payload shared by /context, /status and /agents.",
|
|
1242
1227
|
);
|
|
1243
1228
|
|
|
1244
1229
|
const workspaceInstructionsResponse = z.object({
|
|
@@ -2394,6 +2379,7 @@ const composioToolRun = z.object({
|
|
|
2394
2379
|
.describe("Tool arguments object."),
|
|
2395
2380
|
account: z.string().optional(),
|
|
2396
2381
|
connected_account_id: z.string().optional(),
|
|
2382
|
+
/** Ignored: approvals were removed, but older callers still send one. */
|
|
2397
2383
|
approvalId: z.string().optional(),
|
|
2398
2384
|
});
|
|
2399
2385
|
|
|
@@ -4017,7 +4003,6 @@ export const requestSchemas: Record<string, ZodTypeAny> = {
|
|
|
4017
4003
|
"workspace.instructions": z.object({ organizationId: z.string().optional() }),
|
|
4018
4004
|
"workspace.status": noInput,
|
|
4019
4005
|
"workspace.agents": noInput,
|
|
4020
|
-
"workspace.approvals.list": noInput,
|
|
4021
4006
|
"workspace.artifacts.list": z.object({
|
|
4022
4007
|
limit: z.coerce.number().int().min(1).max(100).optional(),
|
|
4023
4008
|
}),
|
|
@@ -4043,21 +4028,6 @@ export const requestSchemas: Record<string, ZodTypeAny> = {
|
|
|
4043
4028
|
importance: z.number().optional(),
|
|
4044
4029
|
}),
|
|
4045
4030
|
|
|
4046
|
-
// Approvals
|
|
4047
|
-
"approval.request": z.object({
|
|
4048
|
-
title: z.string().describe("What needs human approval."),
|
|
4049
|
-
reason: z.string().optional(),
|
|
4050
|
-
risk: riskLevel,
|
|
4051
|
-
}),
|
|
4052
|
-
"approval.decide": z.object({
|
|
4053
|
-
approvalId: z.string(),
|
|
4054
|
-
decision: approvalDecision,
|
|
4055
|
-
evidence: z
|
|
4056
|
-
.string()
|
|
4057
|
-
.optional()
|
|
4058
|
-
.describe("Required when the requesting agent records its own decision."),
|
|
4059
|
-
}),
|
|
4060
|
-
|
|
4061
4031
|
// Billing
|
|
4062
4032
|
"billing.status": noInput,
|
|
4063
4033
|
"billing.topup": z.object({
|
|
@@ -5952,29 +5922,16 @@ export const responseSchemas: Record<string, ZodTypeAny> = {
|
|
|
5952
5922
|
"workspace.instructions": workspaceInstructionsResponse,
|
|
5953
5923
|
"workspace.status": workspaceStatusPayload,
|
|
5954
5924
|
"workspace.agents": workspaceStatusPayload,
|
|
5955
|
-
"workspace.approvals.list": workspaceStatusPayload,
|
|
5956
5925
|
"workspace.artifacts.list": z.array(artifactRow),
|
|
5957
5926
|
"workspace.suggestedWork.list": z.array(artifactRow),
|
|
5958
5927
|
|
|
5959
|
-
// Memory
|
|
5928
|
+
// Memory
|
|
5960
5929
|
"memory.search": z.array(memoryDoc),
|
|
5961
5930
|
"memory.save": z.object({
|
|
5962
5931
|
ok: z.boolean(),
|
|
5963
5932
|
memoryId: z.string(),
|
|
5964
5933
|
status: z.enum(["active", "needs_review", "archived"]),
|
|
5965
5934
|
}),
|
|
5966
|
-
"approval.request": z.object({ ok: z.boolean(), approvalId: z.string() }),
|
|
5967
|
-
"approval.decide": z.union([
|
|
5968
|
-
z.object({
|
|
5969
|
-
ok: z.literal(true),
|
|
5970
|
-
status: approvalDecision,
|
|
5971
|
-
}),
|
|
5972
|
-
z.object({
|
|
5973
|
-
ok: z.literal(false),
|
|
5974
|
-
code: z.string().describe("e.g. approval_not_pending."),
|
|
5975
|
-
error: z.string(),
|
|
5976
|
-
}),
|
|
5977
|
-
]),
|
|
5978
5935
|
|
|
5979
5936
|
// Billing
|
|
5980
5937
|
"billing.status": billingStatusResponse,
|
|
@@ -7339,15 +7296,6 @@ export const requestExamples: Record<string, unknown> = {
|
|
|
7339
7296
|
text: "Never deploy without human approval.",
|
|
7340
7297
|
tags: ["deployment", "policy"],
|
|
7341
7298
|
},
|
|
7342
|
-
"approval.request": {
|
|
7343
|
-
title: "Deploy the new API branch?",
|
|
7344
|
-
reason: "Production deploy changes public behavior.",
|
|
7345
|
-
risk: "high",
|
|
7346
|
-
},
|
|
7347
|
-
"approval.decide": {
|
|
7348
|
-
decision: "approved",
|
|
7349
|
-
evidence: "User said yes in chat",
|
|
7350
|
-
},
|
|
7351
7299
|
"chat.new": { prompt: "Summarize the latest CRM changes." },
|
|
7352
7300
|
"chat.rename": {
|
|
7353
7301
|
items: [{ threadId: "th_abc123", title: "Deploy checklist" }],
|
|
@@ -7512,7 +7460,7 @@ export const requestExamples: Record<string, unknown> = {
|
|
|
7512
7460
|
// Mirror real backend outputs; ids are illustrative opaque strings.
|
|
7513
7461
|
// ---------------------------------------------------------------------------
|
|
7514
7462
|
|
|
7515
|
-
/** /context, /status
|
|
7463
|
+
/** /context, /status and /agents all return this payload. */
|
|
7516
7464
|
const workspaceStatusExample = {
|
|
7517
7465
|
workspace: { id: "org_abc123", name: "Acme", slug: "acme" },
|
|
7518
7466
|
agent: { id: "ag_xyz789", name: "Cursor", kind: "cursor" },
|
|
@@ -7537,7 +7485,6 @@ const workspaceStatusExample = {
|
|
|
7537
7485
|
tools: {
|
|
7538
7486
|
discovery: ["dench_list_apps", "dench_search_tools"],
|
|
7539
7487
|
cli: ["dench apps --json"],
|
|
7540
|
-
approvalPolicy: "Read-only tools can run by default.",
|
|
7541
7488
|
},
|
|
7542
7489
|
nextActions: ["Ask for a goal or start a chat agent"],
|
|
7543
7490
|
};
|
|
@@ -7732,7 +7679,6 @@ export const responseExamples: Record<string, unknown> = {
|
|
|
7732
7679
|
},
|
|
7733
7680
|
"workspace.status": workspaceStatusExample,
|
|
7734
7681
|
"workspace.agents": workspaceStatusExample,
|
|
7735
|
-
"workspace.approvals.list": workspaceStatusExample,
|
|
7736
7682
|
"workspace.artifacts.list": [
|
|
7737
7683
|
{
|
|
7738
7684
|
id: "ra_def456",
|
|
@@ -7772,8 +7718,6 @@ export const responseExamples: Record<string, unknown> = {
|
|
|
7772
7718
|
},
|
|
7773
7719
|
],
|
|
7774
7720
|
"memory.save": { ok: true, memoryId: "wm_jkl012", status: "active" },
|
|
7775
|
-
"approval.request": { ok: true, approvalId: "ap_mno345" },
|
|
7776
|
-
"approval.decide": { ok: true, status: "approved" },
|
|
7777
7721
|
"billing.status": {
|
|
7778
7722
|
workspace: { id: "org_abc123", name: "Acme", slug: "acme" },
|
|
7779
7723
|
availableCreditsCents: 500,
|
|
@@ -34,8 +34,6 @@ export const APP_SDK_SCOPES = [
|
|
|
34
34
|
"agent-config:write",
|
|
35
35
|
"agent:invoke",
|
|
36
36
|
"ai:chat",
|
|
37
|
-
"approvals:read",
|
|
38
|
-
"approvals:write",
|
|
39
37
|
"apps:message",
|
|
40
38
|
"apps:read",
|
|
41
39
|
"apps:write",
|
|
@@ -136,7 +134,6 @@ export const APP_SDK_OPERATIONS: readonly AppSdkOperationInfo[] = [
|
|
|
136
134
|
{"id":"workspace.instructions","group":"workspace","summary":"Return the current workspace's standing instructions for external agents.","cli":"dench context --instructions","method":"GET","path":"/context/instructions","permission":"workspace:read","pathParams":[]},
|
|
137
135
|
{"id":"workspace.status","group":"workspace","summary":"Return workspace and agent status.","cli":"dench status","method":"GET","path":"/status","permission":"workspace:read","pathParams":[]},
|
|
138
136
|
{"id":"workspace.agents","group":"workspace","summary":"List agents visible in the workspace status payload.","cli":"dench agents","method":"GET","path":"/agents","permission":"workspace:read","pathParams":[]},
|
|
139
|
-
{"id":"workspace.approvals.list","group":"approvals","summary":"List approval requests visible in the workspace status payload.","cli":"dench approvals","method":"GET","path":"/approvals","permission":"approvals:read","pathParams":[]},
|
|
140
137
|
{"id":"workspace.artifacts.list","group":"workspace","summary":"List artifacts for the authenticated workspace.","cli":"dench artifacts","method":"GET","path":"/artifacts","permission":"workspace:read","pathParams":[]},
|
|
141
138
|
{"id":"workspace.suggestedWork.list","group":"workspace","summary":"List draft suggested-work artifacts.","cli":"dench suggested-work","method":"GET","path":"/suggested-work","permission":"workspace:read","pathParams":[]},
|
|
142
139
|
{"id":"lists.list","group":"lists","summary":"List saved searches (find-result lists) in the workspace, newest first.","cli":"dench lists","method":"GET","path":"/lists","permission":"lists:read","pathParams":[]},
|
|
@@ -152,8 +149,6 @@ export const APP_SDK_OPERATIONS: readonly AppSdkOperationInfo[] = [
|
|
|
152
149
|
{"id":"lists.prospects.assess","group":"lists","summary":"Suggest ICP fit for one profile. Never changes a human review decision.","cli":"dench lists assess","method":"POST","path":"/lists/{artifactId}/assess","permission":"lists:write","pathParams":["artifactId"]},
|
|
153
150
|
{"id":"memory.search","group":"memory","summary":"Search durable workspace memory.","cli":"dench memory search","method":"GET","path":"/memory/search","permission":"memory:read","pathParams":[]},
|
|
154
151
|
{"id":"memory.save","group":"memory","summary":"Save a durable workspace memory fact.","cli":"dench memory save","method":"POST","path":"/memory","permission":"memory:write","pathParams":[]},
|
|
155
|
-
{"id":"approval.request","group":"approvals","summary":"Request human approval.","cli":"dench approval request","method":"POST","path":"/approvals","permission":"approvals:write","pathParams":[]},
|
|
156
|
-
{"id":"approval.decide","group":"approvals","summary":"Record an approval decision.","cli":"dench approval approve|reject","method":"POST","path":"/approvals/{approvalId}/decision","permission":"approvals:write","pathParams":["approvalId"]},
|
|
157
152
|
{"id":"billing.status","group":"billing","summary":"Get billing and AI credit status.","cli":"dench billing status","method":"GET","path":"/billing/status","permission":"billing:read","pathParams":[]},
|
|
158
153
|
{"id":"billing.topup","group":"billing","summary":"Create an AI credit top-up checkout link.","cli":"dench billing topup","method":"POST","path":"/billing/topup","permission":"billing:write","pathParams":[]},
|
|
159
154
|
{"id":"billing.upgrade","group":"billing","summary":"Create a workspace upgrade checkout link.","cli":"dench upgrade","method":"POST","path":"/billing/upgrade","permission":"billing:write","pathParams":[]},
|
|
@@ -681,9 +676,6 @@ export const APP_SDK_METHODS: Readonly<Record<string, AppSdkMethodInfo>> = {
|
|
|
681
676
|
"billing.status": {"kind":"op","permission":"billing:read","op":"billing.status","doc":"Plan, AI balance and usage for the workspace."},
|
|
682
677
|
"billing.topup": {"kind":"op","permission":"billing:write","op":"billing.topup","doc":"Start an AI credit top-up (returns a Stripe URL)."},
|
|
683
678
|
"billing.upgrade": {"kind":"op","permission":"billing:write","op":"billing.upgrade","doc":"Upgrade the plan (returns a Stripe Checkout URL or updates in place)."},
|
|
684
|
-
"approvals.list": {"kind":"op","permission":"approvals:read","op":"workspace.approvals.list","doc":"Pending approvals in the workspace."},
|
|
685
|
-
"approvals.request": {"kind":"op","permission":"approvals:write","op":"approval.request","doc":"Ask a human to approve an action."},
|
|
686
|
-
"approvals.decide": {"kind":"op","permission":"approvals:write","op":"approval.decide","doc":"Approve or reject a pending approval."},
|
|
687
679
|
"memory.get": {"kind":"host","permission":"memory:read","deprecated":"Use memory.search(query).","doc":"The workspace's saved memories (legacy shape)."},
|
|
688
680
|
"memory.search": {"kind":"op","permission":"memory:read","op":"memory.search","doc":"Full-text search over saved memories."},
|
|
689
681
|
"memory.save": {"kind":"op","permission":"memory:write","op":"memory.save","doc":"Save a memory under a stable key."},
|
package/lib/app-sdk-surface.ts
CHANGED
|
@@ -1076,27 +1076,6 @@ export const APP_SDK_SURFACE: AppSdkSurface = {
|
|
|
1076
1076
|
},
|
|
1077
1077
|
},
|
|
1078
1078
|
|
|
1079
|
-
approvals: {
|
|
1080
|
-
list: {
|
|
1081
|
-
op: "workspace.approvals.list",
|
|
1082
|
-
doc: "Pending approvals in the workspace.",
|
|
1083
|
-
args: "",
|
|
1084
|
-
returns: R("workspace.approvals.list"),
|
|
1085
|
-
},
|
|
1086
|
-
request: {
|
|
1087
|
-
op: "approval.request",
|
|
1088
|
-
doc: "Ask a human to approve an action.",
|
|
1089
|
-
args: `request: ${A("approval.request")}`,
|
|
1090
|
-
returns: R("approval.request"),
|
|
1091
|
-
},
|
|
1092
|
-
decide: {
|
|
1093
|
-
op: "approval.decide",
|
|
1094
|
-
doc: "Approve or reject a pending approval.",
|
|
1095
|
-
args: `approvalId: string, decision: Req<"approval.decide">["decision"], opts?: ${Rest("approval.decide", "approvalId", "decision")}`,
|
|
1096
|
-
returns: R("approval.decide"),
|
|
1097
|
-
},
|
|
1098
|
-
},
|
|
1099
|
-
|
|
1100
1079
|
memory: {
|
|
1101
1080
|
get: {
|
|
1102
1081
|
host: true,
|
package/lib/command-registry.ts
CHANGED
|
@@ -888,17 +888,6 @@ const rawApiOperations = [
|
|
|
888
888
|
responseSchema: anyResponse,
|
|
889
889
|
backend: convex("query", "functions/agentWorkspace:whatCanIDoHere"),
|
|
890
890
|
}),
|
|
891
|
-
op({
|
|
892
|
-
id: "workspace.approvals.list",
|
|
893
|
-
group: "approvals",
|
|
894
|
-
summary: "List approval requests visible in the workspace status payload.",
|
|
895
|
-
cli: "dench approvals",
|
|
896
|
-
method: "GET",
|
|
897
|
-
path: "/approvals",
|
|
898
|
-
requestSchema: noBody,
|
|
899
|
-
responseSchema: anyResponse,
|
|
900
|
-
backend: convex("query", "functions/agentWorkspace:whatCanIDoHere"),
|
|
901
|
-
}),
|
|
902
891
|
op({
|
|
903
892
|
id: "workspace.artifacts.list",
|
|
904
893
|
group: "workspace",
|
|
@@ -1158,31 +1147,6 @@ const rawApiOperations = [
|
|
|
1158
1147
|
responseSchema: anyResponse,
|
|
1159
1148
|
backend: convex("mutation", "functions/agentWorkspace:agentSaveMemory"),
|
|
1160
1149
|
}),
|
|
1161
|
-
op({
|
|
1162
|
-
id: "approval.request",
|
|
1163
|
-
group: "approvals",
|
|
1164
|
-
summary: "Request human approval.",
|
|
1165
|
-
cli: "dench approval request",
|
|
1166
|
-
method: "POST",
|
|
1167
|
-
path: "/approvals",
|
|
1168
|
-
requestSchema: anyObject,
|
|
1169
|
-
responseSchema: anyResponse,
|
|
1170
|
-
backend: convex(
|
|
1171
|
-
"mutation",
|
|
1172
|
-
"functions/agentWorkspace:agentRequestApproval",
|
|
1173
|
-
),
|
|
1174
|
-
}),
|
|
1175
|
-
op({
|
|
1176
|
-
id: "approval.decide",
|
|
1177
|
-
group: "approvals",
|
|
1178
|
-
summary: "Record an approval decision.",
|
|
1179
|
-
cli: "dench approval approve|reject",
|
|
1180
|
-
method: "POST",
|
|
1181
|
-
path: "/approvals/{approvalId}/decision",
|
|
1182
|
-
requestSchema: anyObject,
|
|
1183
|
-
responseSchema: anyResponse,
|
|
1184
|
-
backend: convex("mutation", "functions/agentWorkspace:agentDecideApproval"),
|
|
1185
|
-
}),
|
|
1186
1150
|
|
|
1187
1151
|
// Billing.
|
|
1188
1152
|
op({
|