dataiku-sdk 0.10.1 → 0.12.0

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 (151) hide show
  1. package/LICENSE +21 -0
  2. package/dist/packages/types/src/index.d.ts +19 -2
  3. package/dist/packages/types/src/index.js +13 -1
  4. package/dist/src/cli/coerce.d.ts +36 -0
  5. package/dist/src/cli/coerce.js +239 -0
  6. package/dist/src/cli/commands/analysis.d.ts +2 -0
  7. package/dist/src/cli/commands/analysis.js +66 -0
  8. package/dist/src/cli/commands/api-deployer.d.ts +2 -0
  9. package/dist/src/cli/commands/api-deployer.js +170 -0
  10. package/dist/src/cli/commands/api-service.d.ts +2 -0
  11. package/dist/src/cli/commands/api-service.js +121 -0
  12. package/dist/src/cli/commands/app.d.ts +2 -0
  13. package/dist/src/cli/commands/app.js +78 -0
  14. package/dist/src/cli/commands/bundle.d.ts +2 -0
  15. package/dist/src/cli/commands/bundle.js +107 -0
  16. package/dist/src/cli/commands/business-app.d.ts +2 -0
  17. package/dist/src/cli/commands/business-app.js +76 -0
  18. package/dist/src/cli/commands/code-env.d.ts +2 -0
  19. package/dist/src/cli/commands/code-env.js +255 -0
  20. package/dist/src/cli/commands/code.d.ts +2 -0
  21. package/dist/src/cli/commands/code.js +63 -0
  22. package/dist/src/cli/commands/connection.d.ts +2 -0
  23. package/dist/src/cli/commands/connection.js +54 -0
  24. package/dist/src/cli/commands/continuous-activity.d.ts +2 -0
  25. package/dist/src/cli/commands/continuous-activity.js +38 -0
  26. package/dist/src/cli/commands/dashboard.d.ts +2 -0
  27. package/dist/src/cli/commands/dashboard.js +99 -0
  28. package/dist/src/cli/commands/data-quality.d.ts +2 -0
  29. package/dist/src/cli/commands/data-quality.js +235 -0
  30. package/dist/src/cli/commands/dataset.d.ts +2 -0
  31. package/dist/src/cli/commands/dataset.js +288 -0
  32. package/dist/src/cli/commands/discussion.d.ts +2 -0
  33. package/dist/src/cli/commands/discussion.js +47 -0
  34. package/dist/src/cli/commands/doctor.d.ts +2 -0
  35. package/dist/src/cli/commands/doctor.js +9 -0
  36. package/dist/src/cli/commands/flow-zone.d.ts +2 -0
  37. package/dist/src/cli/commands/flow-zone.js +282 -0
  38. package/dist/src/cli/commands/folder.d.ts +2 -0
  39. package/dist/src/cli/commands/folder.js +202 -0
  40. package/dist/src/cli/commands/future.d.ts +2 -0
  41. package/dist/src/cli/commands/future.js +57 -0
  42. package/dist/src/cli/commands/index.d.ts +2 -0
  43. package/dist/src/cli/commands/index.js +78 -0
  44. package/dist/src/cli/commands/insight.d.ts +2 -0
  45. package/dist/src/cli/commands/insight.js +156 -0
  46. package/dist/src/cli/commands/job.d.ts +2 -0
  47. package/dist/src/cli/commands/job.js +406 -0
  48. package/dist/src/cli/commands/meaning.d.ts +2 -0
  49. package/dist/src/cli/commands/meaning.js +115 -0
  50. package/dist/src/cli/commands/metrics.d.ts +2 -0
  51. package/dist/src/cli/commands/metrics.js +39 -0
  52. package/dist/src/cli/commands/ml-task.d.ts +2 -0
  53. package/dist/src/cli/commands/ml-task.js +171 -0
  54. package/dist/src/cli/commands/model-evaluation-store.d.ts +2 -0
  55. package/dist/src/cli/commands/model-evaluation-store.js +83 -0
  56. package/dist/src/cli/commands/notebook.d.ts +2 -0
  57. package/dist/src/cli/commands/notebook.js +242 -0
  58. package/dist/src/cli/commands/project-deployer.d.ts +2 -0
  59. package/dist/src/cli/commands/project-deployer.js +118 -0
  60. package/dist/src/cli/commands/project-library.d.ts +2 -0
  61. package/dist/src/cli/commands/project-library.js +197 -0
  62. package/dist/src/cli/commands/project.d.ts +2 -0
  63. package/dist/src/cli/commands/project.js +133 -0
  64. package/dist/src/cli/commands/recipe.d.ts +2 -0
  65. package/dist/src/cli/commands/recipe.js +659 -0
  66. package/dist/src/cli/commands/saved-model.d.ts +2 -0
  67. package/dist/src/cli/commands/saved-model.js +85 -0
  68. package/dist/src/cli/commands/scenario.d.ts +2 -0
  69. package/dist/src/cli/commands/scenario.js +190 -0
  70. package/dist/src/cli/commands/sql.d.ts +2 -0
  71. package/dist/src/cli/commands/sql.js +109 -0
  72. package/dist/src/cli/commands/statistics.d.ts +2 -0
  73. package/dist/src/cli/commands/statistics.js +165 -0
  74. package/dist/src/cli/commands/streaming-endpoint.d.ts +2 -0
  75. package/dist/src/cli/commands/streaming-endpoint.js +50 -0
  76. package/dist/src/cli/commands/variable.d.ts +2 -0
  77. package/dist/src/cli/commands/variable.js +49 -0
  78. package/dist/src/cli/commands/webapp.d.ts +2 -0
  79. package/dist/src/cli/commands/webapp.js +67 -0
  80. package/dist/src/cli/commands/wiki.d.ts +2 -0
  81. package/dist/src/cli/commands/wiki.js +123 -0
  82. package/dist/src/cli/commands/workspace.d.ts +2 -0
  83. package/dist/src/cli/commands/workspace.js +68 -0
  84. package/dist/src/cli/contract.d.ts +104 -0
  85. package/dist/src/cli/contract.js +2041 -0
  86. package/dist/src/cli/doctor.d.ts +104 -0
  87. package/dist/src/cli/doctor.js +356 -0
  88. package/dist/src/cli/env.d.ts +2 -0
  89. package/dist/src/cli/env.js +37 -0
  90. package/dist/src/cli/flags.d.ts +16 -0
  91. package/dist/src/cli/flags.js +272 -0
  92. package/dist/src/cli/helpers/cleanup.d.ts +3 -0
  93. package/dist/src/cli/helpers/cleanup.js +204 -0
  94. package/dist/src/cli/helpers/dataset.d.ts +2 -0
  95. package/dist/src/cli/helpers/dataset.js +17 -0
  96. package/dist/src/cli/helpers/flow-zone.d.ts +69 -0
  97. package/dist/src/cli/helpers/flow-zone.js +420 -0
  98. package/dist/src/cli/helpers/recipe.d.ts +11 -0
  99. package/dist/src/cli/helpers/recipe.js +83 -0
  100. package/dist/src/cli/output.d.ts +38 -0
  101. package/dist/src/cli/output.js +159 -0
  102. package/dist/src/cli/runtime.d.ts +15 -0
  103. package/dist/src/cli/runtime.js +59 -0
  104. package/dist/src/cli/types.d.ts +25 -0
  105. package/dist/src/cli/types.js +1 -0
  106. package/dist/src/cli/usage.d.ts +16 -0
  107. package/dist/src/cli/usage.js +84 -0
  108. package/dist/src/cli/version.d.ts +14 -0
  109. package/dist/src/cli/version.js +63 -0
  110. package/dist/src/cli.js +671 -8254
  111. package/dist/src/client.d.ts +13 -1
  112. package/dist/src/client.js +34 -13
  113. package/dist/src/errors.d.ts +6 -0
  114. package/dist/src/errors.js +102 -4
  115. package/dist/src/index.d.ts +7 -3
  116. package/dist/src/index.js +6 -2
  117. package/dist/src/resources/analyses.d.ts +34 -0
  118. package/dist/src/resources/analyses.js +31 -0
  119. package/dist/src/resources/api-services.d.ts +2 -0
  120. package/dist/src/resources/api-services.js +10 -0
  121. package/dist/src/resources/applications.d.ts +1 -1
  122. package/dist/src/resources/applications.js +27 -1
  123. package/dist/src/resources/continuous-activities.js +1 -0
  124. package/dist/src/resources/data-quality.js +5 -3
  125. package/dist/src/resources/datasets.d.ts +3 -0
  126. package/dist/src/resources/datasets.js +10 -5
  127. package/dist/src/resources/flow-zones.d.ts +2 -2
  128. package/dist/src/resources/flow-zones.js +4 -1
  129. package/dist/src/resources/meanings.d.ts +2 -0
  130. package/dist/src/resources/meanings.js +4 -0
  131. package/dist/src/resources/ml-tasks.d.ts +91 -0
  132. package/dist/src/resources/ml-tasks.js +130 -0
  133. package/dist/src/resources/model-evaluation-stores.d.ts +41 -0
  134. package/dist/src/resources/model-evaluation-stores.js +36 -0
  135. package/dist/src/resources/notebooks.d.ts +5 -7
  136. package/dist/src/resources/notebooks.js +10 -7
  137. package/dist/src/resources/projects.d.ts +1 -1
  138. package/dist/src/resources/projects.js +2 -2
  139. package/dist/src/resources/recipes.d.ts +3 -3
  140. package/dist/src/resources/recipes.js +198 -38
  141. package/dist/src/resources/saved-models.d.ts +41 -0
  142. package/dist/src/resources/saved-models.js +40 -0
  143. package/dist/src/resources/scenarios.js +67 -26
  144. package/dist/src/resources/statistics.js +9 -0
  145. package/dist/src/schemas.d.ts +2 -2
  146. package/dist/src/schemas.js +1 -1
  147. package/dist/src/skill.js +2 -2
  148. package/dist/src/utils/sanitize.js +2 -1
  149. package/package.json +1 -1
  150. package/packages/types/dist/index.d.ts +19 -2
  151. package/packages/types/dist/index.js +13 -1
@@ -0,0 +1,49 @@
1
+ import { json, } from "../coerce.js";
2
+ import { UsageError, } from "../usage.js";
3
+ export const variableCommands = {
4
+ get: {
5
+ handler: (c, _a, f) => c.variables.get(f["project-key"]),
6
+ usage: "dss variable get [--project-key KEY]",
7
+ description: "Get project variables (standard and local).",
8
+ examples: ["dss variable get", "dss variable get --project-key MYPROJ",],
9
+ },
10
+ set: {
11
+ handler: async (c, _a, f) => {
12
+ const standard = json(f["standard"]);
13
+ const local = json(f["local"]);
14
+ const pk = f["project-key"];
15
+ if (standard === undefined && local === undefined) {
16
+ throw new UsageError("--standard and/or --local is required.");
17
+ }
18
+ if (f["dry-run"] === true) {
19
+ const current = await c.variables.get(pk);
20
+ const next = f["replace"] === true
21
+ ? { standard: standard ?? {}, local: local ?? {}, }
22
+ : {
23
+ standard: { ...current.standard, ...standard, },
24
+ local: { ...current.local, ...local, },
25
+ };
26
+ return {
27
+ dryRun: true,
28
+ action: "set",
29
+ resource: "variable",
30
+ projectKey: pk,
31
+ current,
32
+ next,
33
+ };
34
+ }
35
+ return c.variables.set({
36
+ standard,
37
+ local,
38
+ replace: f["replace"] === true,
39
+ projectKey: pk,
40
+ });
41
+ },
42
+ usage: `dss variable set --standard '{"k":"v"}' --local '{"k":"v"}' [--replace] [--dry-run] [--project-key KEY]`,
43
+ description: "Set project variables via JSON merge (or full replace with --replace).",
44
+ examples: [
45
+ 'dss variable set --standard \'{"env":"staging"}\' --dry-run',
46
+ "dss variable set --local '{\"debug\":true}' --replace",
47
+ ],
48
+ },
49
+ };
@@ -0,0 +1,2 @@
1
+ import type { CommandMeta } from "../types.js";
2
+ export declare const webappCommands: Record<string, CommandMeta>;
@@ -0,0 +1,67 @@
1
+ import { requiredJsonInput, } from "../coerce.js";
2
+ import { requireArgs, } from "../usage.js";
3
+ export const webappCommands = {
4
+ list: {
5
+ handler: (c, _a, f) => c.webapps.list(f["project-key"]),
6
+ usage: "dss webapp list [--project-key KEY]",
7
+ description: "List webapps in a project.",
8
+ examples: ["dss webapp list",],
9
+ },
10
+ "get-settings": {
11
+ handler: (c, a, f) => {
12
+ requireArgs(a, 1, "dss webapp get-settings <webappId> [--project-key KEY]");
13
+ return c.webapps.getSettings(a[0], f["project-key"]);
14
+ },
15
+ usage: "dss webapp get-settings <webappId> [--project-key KEY]",
16
+ description: "Get a webapp's settings.",
17
+ examples: ["dss webapp get-settings WEBAPP_ID",],
18
+ },
19
+ create: {
20
+ handler: (c, _a, f) => {
21
+ const body = requiredJsonInput(f, "--data, --data-file, or --stdin is required (webapp definition).");
22
+ return c.webapps.create(body, f["project-key"]);
23
+ },
24
+ usage: "dss webapp create (--data JSON|--data-file PATH|--stdin) [--project-key KEY]",
25
+ description: "Create a webapp from a JSON definition.",
26
+ examples: ["dss webapp create --data-file webapp.json",],
27
+ },
28
+ "update-settings": {
29
+ handler: (c, a, f) => {
30
+ requireArgs(a, 1, "dss webapp update-settings <webappId> (--data JSON|--data-file PATH|--stdin) [--project-key KEY]");
31
+ const body = requiredJsonInput(f, "--data, --data-file, or --stdin is required (webapp settings).");
32
+ return c.webapps.updateSettings(a[0], body, f["project-key"]);
33
+ },
34
+ usage: "dss webapp update-settings <webappId> (--data JSON|--data-file PATH|--stdin) [--project-key KEY]",
35
+ description: "Replace a webapp's settings.",
36
+ examples: ["dss webapp update-settings WEBAPP_ID --data-file webapp.json",],
37
+ },
38
+ "stop-backend": {
39
+ handler: async (c, a, f) => {
40
+ requireArgs(a, 1, "dss webapp stop-backend <webappId> [--project-key KEY]");
41
+ await c.webapps.stopBackend(a[0], f["project-key"]);
42
+ return { stopped: true, };
43
+ },
44
+ usage: "dss webapp stop-backend <webappId> [--project-key KEY]",
45
+ description: "Stop a webapp's backend.",
46
+ examples: ["dss webapp stop-backend WEBAPP_ID",],
47
+ },
48
+ "restart-backend": {
49
+ handler: async (c, a, f) => {
50
+ requireArgs(a, 1, "dss webapp restart-backend <webappId> [--project-key KEY]");
51
+ await c.webapps.startOrRestartBackend(a[0], f["project-key"]);
52
+ return { restarted: true, };
53
+ },
54
+ usage: "dss webapp restart-backend <webappId> [--project-key KEY]",
55
+ description: "Start or restart a webapp's backend.",
56
+ examples: ["dss webapp restart-backend WEBAPP_ID",],
57
+ },
58
+ "backend-state": {
59
+ handler: (c, a, f) => {
60
+ requireArgs(a, 1, "dss webapp backend-state <webappId> [--project-key KEY]");
61
+ return c.webapps.getBackendState(a[0], f["project-key"]);
62
+ },
63
+ usage: "dss webapp backend-state <webappId> [--project-key KEY]",
64
+ description: "Get a webapp backend's runtime state.",
65
+ examples: ["dss webapp backend-state WEBAPP_ID",],
66
+ },
67
+ };
@@ -0,0 +1,2 @@
1
+ import type { CommandMeta } from "../types.js";
2
+ export declare const wikiCommands: Record<string, CommandMeta>;
@@ -0,0 +1,123 @@
1
+ import { deepMerge, } from "../../utils/deep-merge.js";
2
+ import { jsonInput, textInput, } from "../coerce.js";
3
+ import { readIfExists, skipResult, } from "../output.js";
4
+ import { requireArgs, UsageError, } from "../usage.js";
5
+ export const wikiCommands = {
6
+ settings: {
7
+ handler: (c, _a, f) => c.wiki.settings(f["project-key"]),
8
+ usage: "dss wiki settings [--project-key KEY]",
9
+ description: "Get project wiki settings and taxonomy.",
10
+ examples: ["dss wiki settings",],
11
+ },
12
+ list: {
13
+ handler: (c, _a, f) => c.wiki.list(f["project-key"]),
14
+ usage: "dss wiki list [--project-key KEY]",
15
+ description: "List wiki articles by walking the taxonomy.",
16
+ examples: ["dss wiki list",],
17
+ },
18
+ get: {
19
+ handler: (c, a, f) => {
20
+ requireArgs(a, 1, "dss wiki get <id-or-name>");
21
+ return c.wiki.get(a[0], f["project-key"]);
22
+ },
23
+ usage: "dss wiki get <id-or-name> [--project-key KEY]",
24
+ description: "Get a wiki article including markdown body.",
25
+ examples: ["dss wiki get ARTICLE_ID",],
26
+ },
27
+ create: {
28
+ handler: async (c, _a, f) => {
29
+ const name = f["name"];
30
+ if (!name)
31
+ throw new UsageError("--name is required. Usage: dss wiki create --name NAME");
32
+ const content = textInput(f);
33
+ const pk = f["project-key"];
34
+ if (f["if-not-exists"] === true || f["dry-run"] === true) {
35
+ const existing = (await c.wiki.list(pk)).find((article) => article.article.name === name);
36
+ if (existing && f["if-not-exists"] === true && f["dry-run"] !== true) {
37
+ return skipResult("wiki", existing.article.id, "exists", { current: existing, });
38
+ }
39
+ if (f["dry-run"] === true) {
40
+ return {
41
+ dryRun: true,
42
+ action: "create",
43
+ resource: "wiki",
44
+ name,
45
+ payload: {
46
+ name,
47
+ parent: f["parent"],
48
+ content,
49
+ },
50
+ ...(existing ? { current: existing, } : {}),
51
+ };
52
+ }
53
+ }
54
+ const created = await c.wiki.create({
55
+ name,
56
+ parent: f["parent"],
57
+ content,
58
+ projectKey: pk,
59
+ });
60
+ return { created: created.article.id, resource: "wiki", ...created, };
61
+ },
62
+ usage: "dss wiki create --name NAME [--parent ID] [--content TEXT|--file PATH] [--if-not-exists] [--dry-run] [--project-key KEY]",
63
+ description: "Create a wiki article, optionally with markdown content.",
64
+ examples: [
65
+ "dss wiki create --name 'Agent notes' --content '# Notes'",
66
+ "dss wiki create --name 'Agent notes' --file article.md --dry-run",
67
+ ],
68
+ },
69
+ update: {
70
+ handler: async (c, a, f) => {
71
+ requireArgs(a, 1, "dss wiki update <id-or-name> [--name NAME] [--content TEXT|--file PATH|--data JSON]");
72
+ const data = jsonInput(f);
73
+ const content = textInput(f);
74
+ const name = f["name"];
75
+ if (!data && content === undefined && name === undefined) {
76
+ throw new UsageError("--name, --content, --file, --data, --data-file, or --stdin is required.");
77
+ }
78
+ if (f["dry-run"] === true) {
79
+ const current = await c.wiki.get(a[0], f["project-key"]);
80
+ const next = deepMerge(current, data ?? {});
81
+ if (name !== undefined) {
82
+ next.article = {
83
+ ...((next.article && typeof next.article === "object" && !Array.isArray(next.article))
84
+ ? next.article
85
+ : {}),
86
+ name,
87
+ };
88
+ }
89
+ if (content !== undefined)
90
+ next.payload = content;
91
+ return { dryRun: true, action: "update", resource: "wiki", article: a[0], current, next, };
92
+ }
93
+ return c.wiki.update(a[0], {
94
+ name,
95
+ content,
96
+ data,
97
+ projectKey: f["project-key"],
98
+ });
99
+ },
100
+ usage: "dss wiki update <id-or-name> [--name NAME] [--content TEXT|--file PATH|--data JSON|--data-file PATH|--stdin] [--dry-run] [--project-key KEY]",
101
+ description: "Update wiki article metadata/body via merge.",
102
+ examples: ["dss wiki update ARTICLE_ID --content '# Updated' --dry-run",],
103
+ },
104
+ delete: {
105
+ handler: async (c, a, f) => {
106
+ requireArgs(a, 1, "dss wiki delete <id-or-name>");
107
+ const pk = f["project-key"];
108
+ if (f["dry-run"] === true || f["if-exists"] === true) {
109
+ const current = await readIfExists(() => c.wiki.get(a[0], pk));
110
+ if (!current)
111
+ return skipResult("wiki", a[0], "missing");
112
+ if (f["dry-run"] === true) {
113
+ return { dryRun: true, action: "delete", resource: "wiki", article: a[0], current, };
114
+ }
115
+ }
116
+ await c.wiki.delete(a[0], pk);
117
+ return { deleted: a[0], resource: "wiki", };
118
+ },
119
+ usage: "dss wiki delete <id-or-name> [--if-exists] [--dry-run] [--project-key KEY]",
120
+ description: "Delete a wiki article.",
121
+ examples: ["dss wiki delete ARTICLE_ID --dry-run",],
122
+ },
123
+ };
@@ -0,0 +1,2 @@
1
+ import type { CommandMeta } from "../types.js";
2
+ export declare const workspaceCommands: Record<string, CommandMeta>;
@@ -0,0 +1,68 @@
1
+ import { requiredJsonInput, } from "../coerce.js";
2
+ import { requireArgs, } from "../usage.js";
3
+ export const workspaceCommands = {
4
+ list: {
5
+ handler: (c) => c.workspaces.list(),
6
+ usage: "dss workspace list",
7
+ description: "List collaboration workspaces on the instance.",
8
+ examples: ["dss workspace list",],
9
+ },
10
+ get: {
11
+ handler: (c, a) => {
12
+ requireArgs(a, 1, "dss workspace get <workspaceKey>");
13
+ return c.workspaces.get(a[0]);
14
+ },
15
+ usage: "dss workspace get <workspaceKey>",
16
+ description: "Get a workspace's settings.",
17
+ examples: ["dss workspace get MY_WS",],
18
+ },
19
+ create: {
20
+ handler: (c, _a, f) => {
21
+ const body = requiredJsonInput(f, "--data, --data-file, or --stdin is required (workspace definition).");
22
+ return c.workspaces.create(body);
23
+ },
24
+ usage: "dss workspace create (--data JSON|--data-file PATH|--stdin)",
25
+ description: "Create a collaboration workspace.",
26
+ examples: ["dss workspace create --data-file ws.json",],
27
+ },
28
+ "update-settings": {
29
+ handler: async (c, a, f) => {
30
+ requireArgs(a, 1, "dss workspace update-settings <workspaceKey> (--data JSON|--data-file PATH|--stdin)");
31
+ const body = requiredJsonInput(f, "--data, --data-file, or --stdin is required (workspace settings).");
32
+ await c.workspaces.updateSettings(a[0], body);
33
+ return { updated: a[0], };
34
+ },
35
+ usage: "dss workspace update-settings <workspaceKey> (--data JSON|--data-file PATH|--stdin)",
36
+ description: "Replace a workspace's settings (admin).",
37
+ examples: ["dss workspace update-settings MY_WS --data-file ws.json",],
38
+ },
39
+ delete: {
40
+ handler: async (c, a) => {
41
+ requireArgs(a, 1, "dss workspace delete <workspaceKey>");
42
+ await c.workspaces.delete(a[0]);
43
+ return { deleted: a[0], };
44
+ },
45
+ usage: "dss workspace delete <workspaceKey>",
46
+ description: "Delete a workspace (admin).",
47
+ examples: ["dss workspace delete MY_WS",],
48
+ },
49
+ "list-objects": {
50
+ handler: (c, a) => {
51
+ requireArgs(a, 1, "dss workspace list-objects <workspaceKey>");
52
+ return c.workspaces.listObjects(a[0]);
53
+ },
54
+ usage: "dss workspace list-objects <workspaceKey>",
55
+ description: "List objects shared in a workspace.",
56
+ examples: ["dss workspace list-objects MY_WS",],
57
+ },
58
+ "add-object": {
59
+ handler: (c, a, f) => {
60
+ requireArgs(a, 1, "dss workspace add-object <workspaceKey> (--data JSON|--data-file PATH|--stdin)");
61
+ const object = requiredJsonInput(f, "--data, --data-file, or --stdin is required (object definition).");
62
+ return c.workspaces.addObject(a[0], object);
63
+ },
64
+ usage: "dss workspace add-object <workspaceKey> (--data JSON|--data-file PATH|--stdin)",
65
+ description: "Add an object (link or DSS object) to a workspace.",
66
+ examples: ["dss workspace add-object MY_WS --data-file object.json",],
67
+ },
68
+ };
@@ -0,0 +1,104 @@
1
+ import type { CommandFlagChoice, CommandMeta, CommandPayloadSchema } from "./types.js";
2
+ export declare const AUTH_ACTIONS: Record<string, {
3
+ handler: (flags: Record<string, string | boolean>) => Promise<unknown>;
4
+ usage: string;
5
+ description?: string;
6
+ examples?: string[];
7
+ requiredFlags?: string[];
8
+ }>;
9
+ export type CommandSideEffect = "read" | "write" | "auth";
10
+ export type CommandOutputShape = "object" | "array" | "string" | "void";
11
+ export type CommandDestructiveLevel = "none" | "reversible" | "destructive";
12
+ export type CommandAsyncKind = "none" | "job" | "future";
13
+ export type CommandIdempotency = "safe" | "convergent" | "if-not-exists" | "if-exists" | "none";
14
+ export interface CommandInputContract {
15
+ stdin?: boolean;
16
+ dataFlag?: boolean;
17
+ dataFileFlag?: boolean;
18
+ }
19
+ export interface CommandExitCodes {
20
+ ok: 0;
21
+ usage: 1;
22
+ error: 2;
23
+ transient: 3;
24
+ longRunningFailure?: 4;
25
+ }
26
+ export type CommandFlagMetadata = {
27
+ name: string;
28
+ kind: "boolean" | "value";
29
+ valueType?: string;
30
+ enumValues?: string[];
31
+ aliases?: string[];
32
+ };
33
+ export interface CommandStructuredExample {
34
+ shell: string;
35
+ argv?: string[];
36
+ payload?: unknown;
37
+ }
38
+ export interface CommandUnsafeOutput {
39
+ condition: string;
40
+ kind: "raw-stdout" | "local-file";
41
+ detail: string;
42
+ safeAlternative?: string;
43
+ }
44
+ export interface CommandAgentSchemas {
45
+ argv: Record<string, unknown>;
46
+ input?: Record<string, unknown>;
47
+ output: Record<string, unknown>;
48
+ }
49
+ export interface CommandRegistryEntry {
50
+ resource: string;
51
+ action: string;
52
+ usage: string;
53
+ description?: string;
54
+ examples?: string[];
55
+ structuredExamples: CommandStructuredExample[];
56
+ flags: CommandFlagMetadata[];
57
+ positionals: string[];
58
+ sideEffect: CommandSideEffect;
59
+ requiresAuth: boolean;
60
+ requiresProject: boolean;
61
+ outputShape: CommandOutputShape;
62
+ inputContract: CommandInputContract;
63
+ destructive: CommandDestructiveLevel;
64
+ producesLocalFile: boolean;
65
+ mutatesDss: boolean;
66
+ async: CommandAsyncKind;
67
+ idempotency: CommandIdempotency;
68
+ dryRun: boolean;
69
+ requiredFlags: string[];
70
+ requiredOneOf?: CommandFlagChoice[];
71
+ optionalFlags: string[];
72
+ payloadSchema?: CommandPayloadSchema;
73
+ schemas: CommandAgentSchemas;
74
+ unsafeOutputs?: CommandUnsafeOutput[];
75
+ examplePayload?: unknown;
76
+ cleanupCommand?: string;
77
+ exitCodes: CommandExitCodes;
78
+ cleanupHint?: string;
79
+ agentContractVersion: number;
80
+ }
81
+ export declare const COMMANDS_USAGE = "dss commands run [--json]";
82
+ export declare const AGENT_CONTRACT_USAGE = "dss agent contract";
83
+ export declare const CLEANUP_USAGE = "dss cleanup --file PATH [--dry-run|--apply] [--continue-on-error]";
84
+ export declare function isAllowedCleanupAction(resource: string, action: string): boolean;
85
+ export declare function buildCommandSchemas(resource: string, action: string, flags: CommandFlagMetadata[], positionals: string[], requiredFlags: string[], requiredOneOf: CommandFlagChoice[], payloadSchema: CommandPayloadSchema | undefined, outputShape: CommandOutputShape): CommandAgentSchemas;
86
+ export declare function inferRequiresProject(resource: string, _action: string, usage: string): boolean;
87
+ export declare function inferInputContract(usage: string): CommandInputContract;
88
+ export declare function supportsCleanupLedger(resource: string, action: string): boolean;
89
+ export declare function inferCleanupHint(resource: string, action: string): string | undefined;
90
+ export declare function buildCommandRegistry(): Record<string, Record<string, CommandRegistryEntry>>;
91
+ export declare function agentContractJsonSchema(): Record<string, unknown>;
92
+ export declare function buildAgentContract(): Record<string, unknown>;
93
+ export declare function commandPlanShape(resource: string, action: string, args: string[], flags: Record<string, string | boolean>, entry: CommandRegistryEntry, projectKey: string | undefined): {
94
+ endpoint?: string;
95
+ identifiers?: Record<string, unknown>;
96
+ method?: string;
97
+ payload?: unknown;
98
+ localWrites?: unknown;
99
+ wait?: unknown;
100
+ };
101
+ export declare function buildMutationPlan(resource: string, action: string, meta: CommandMeta, args: string[], flags: Record<string, string | boolean>): Record<string, unknown>;
102
+ export declare const BATCH_USAGE = "dss batch (--data JSON|--data-file PATH|--stdin) [--continue-on-error] [--dry-run]";
103
+ export declare const BATCH_HINT = "Pass a JSON array of argv arrays, e.g. [[\"dataset\",\"list\"],[\"recipe\",\"update\",\"r\",\"--data-file\",\"p.json\"]].";
104
+ export declare const BATCH_EXAMPLE_PAYLOAD: string[][];