dataiku-sdk 3.2.0 → 3.3.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 (120) hide show
  1. package/README.md +149 -46
  2. package/dist/build-metadata.json +1 -1
  3. package/dist/packages/types/src/index.d.ts +102 -0
  4. package/dist/packages/types/src/index.js +76 -0
  5. package/dist/src/cli/commands/app.js +57 -15
  6. package/dist/src/cli/commands/bundle.js +1 -1
  7. package/dist/src/cli/commands/code-env.js +13 -7
  8. package/dist/src/cli/commands/connection.d.ts +9 -0
  9. package/dist/src/cli/commands/connection.js +267 -1
  10. package/dist/src/cli/commands/data-collection.d.ts +2 -0
  11. package/dist/src/cli/commands/data-collection.js +164 -0
  12. package/dist/src/cli/commands/dataset.js +161 -32
  13. package/dist/src/cli/commands/future.js +2 -2
  14. package/dist/src/cli/commands/group.d.ts +2 -0
  15. package/dist/src/cli/commands/group.js +109 -0
  16. package/dist/src/cli/commands/index.js +151 -78
  17. package/dist/src/cli/commands/knowledge-bank.d.ts +2 -0
  18. package/dist/src/cli/commands/knowledge-bank.js +80 -0
  19. package/dist/src/cli/commands/llm.d.ts +2 -0
  20. package/dist/src/cli/commands/llm.js +93 -0
  21. package/dist/src/cli/commands/macro.d.ts +2 -0
  22. package/dist/src/cli/commands/macro.js +221 -0
  23. package/dist/src/cli/commands/ml-task.js +18 -6
  24. package/dist/src/cli/commands/notebook.js +6 -2
  25. package/dist/src/cli/commands/plugin.d.ts +2 -0
  26. package/dist/src/cli/commands/plugin.js +799 -0
  27. package/dist/src/cli/commands/project-folder.d.ts +2 -0
  28. package/dist/src/cli/commands/project-folder.js +197 -0
  29. package/dist/src/cli/commands/project-git.js +14 -54
  30. package/dist/src/cli/commands/project.js +52 -6
  31. package/dist/src/cli/commands/recipe.js +36 -1
  32. package/dist/src/cli/commands/saved-model.d.ts +5 -0
  33. package/dist/src/cli/commands/saved-model.js +388 -1
  34. package/dist/src/cli/commands/scenario.js +138 -1
  35. package/dist/src/cli/commands/user.d.ts +8 -0
  36. package/dist/src/cli/commands/user.js +296 -0
  37. package/dist/src/cli/contract.d.ts +1 -2
  38. package/dist/src/cli/contract.js +1089 -103
  39. package/dist/src/cli/flags.js +30 -1
  40. package/dist/src/cli/helpers/app-successor.d.ts +19 -4
  41. package/dist/src/cli/helpers/app-successor.js +90 -30
  42. package/dist/src/cli/helpers/cleanup.js +3 -1
  43. package/dist/src/cli/helpers/flow-zone.js +1 -2
  44. package/dist/src/cli/output.d.ts +1 -1
  45. package/dist/src/cli/output.js +23 -10
  46. package/dist/src/cli/usage.d.ts +1 -0
  47. package/dist/src/cli/usage.js +47 -1
  48. package/dist/src/cli.js +147 -41
  49. package/dist/src/client.d.ts +83 -5
  50. package/dist/src/client.js +185 -29
  51. package/dist/src/errors.d.ts +3 -0
  52. package/dist/src/errors.js +2 -0
  53. package/dist/src/index.d.ts +16 -7
  54. package/dist/src/index.js +11 -2
  55. package/dist/src/resources/analyses.js +1 -8
  56. package/dist/src/resources/applications.d.ts +8 -6
  57. package/dist/src/resources/applications.js +21 -21
  58. package/dist/src/resources/base.d.ts +4 -0
  59. package/dist/src/resources/base.js +15 -0
  60. package/dist/src/resources/bundles.d.ts +9 -4
  61. package/dist/src/resources/bundles.js +10 -5
  62. package/dist/src/resources/connections.d.ts +78 -1
  63. package/dist/src/resources/connections.js +132 -1
  64. package/dist/src/resources/data-collections.d.ts +118 -0
  65. package/dist/src/resources/data-collections.js +49 -0
  66. package/dist/src/resources/datasets.d.ts +69 -0
  67. package/dist/src/resources/datasets.js +99 -1
  68. package/dist/src/resources/futures.d.ts +4 -1
  69. package/dist/src/resources/futures.js +38 -6
  70. package/dist/src/resources/groups.d.ts +47 -0
  71. package/dist/src/resources/groups.js +56 -0
  72. package/dist/src/resources/jobs.d.ts +8 -13
  73. package/dist/src/resources/jobs.js +41 -16
  74. package/dist/src/resources/knowledge-banks.d.ts +58 -0
  75. package/dist/src/resources/knowledge-banks.js +61 -0
  76. package/dist/src/resources/llms.d.ts +92 -0
  77. package/dist/src/resources/llms.js +62 -0
  78. package/dist/src/resources/macros.d.ts +121 -0
  79. package/dist/src/resources/macros.js +231 -0
  80. package/dist/src/resources/ml-tasks.d.ts +37 -2
  81. package/dist/src/resources/ml-tasks.js +100 -20
  82. package/dist/src/resources/model-evaluation-stores.js +1 -8
  83. package/dist/src/resources/notebooks.d.ts +43 -7
  84. package/dist/src/resources/notebooks.js +53 -13
  85. package/dist/src/resources/plugins.d.ts +265 -0
  86. package/dist/src/resources/plugins.js +458 -0
  87. package/dist/src/resources/project-folders.d.ts +71 -0
  88. package/dist/src/resources/project-folders.js +57 -0
  89. package/dist/src/resources/project-git.d.ts +6 -0
  90. package/dist/src/resources/project-git.js +69 -42
  91. package/dist/src/resources/project-library.d.ts +0 -1
  92. package/dist/src/resources/project-library.js +1 -17
  93. package/dist/src/resources/projects.d.ts +19 -1
  94. package/dist/src/resources/projects.js +27 -1
  95. package/dist/src/resources/recipes.d.ts +15 -1
  96. package/dist/src/resources/recipes.js +73 -6
  97. package/dist/src/resources/saved-models.d.ts +134 -1
  98. package/dist/src/resources/saved-models.js +214 -6
  99. package/dist/src/resources/scenarios.d.ts +105 -0
  100. package/dist/src/resources/scenarios.js +232 -106
  101. package/dist/src/resources/sql.js +5 -1
  102. package/dist/src/resources/users.d.ts +129 -0
  103. package/dist/src/resources/users.js +128 -0
  104. package/dist/src/resources/webapps.d.ts +15 -2
  105. package/dist/src/resources/webapps.js +18 -4
  106. package/dist/src/schemas.d.ts +2 -2
  107. package/dist/src/schemas.js +1 -1
  108. package/dist/src/utils/deep-merge.d.ts +1 -1
  109. package/dist/src/utils/polling.d.ts +20 -0
  110. package/dist/src/utils/polling.js +27 -0
  111. package/dist/src/utils/response-file.js +1 -1
  112. package/dist/src/utils/secret-sanitize.d.ts +54 -0
  113. package/dist/src/utils/secret-sanitize.js +101 -0
  114. package/package.json +6 -5
  115. package/packages/types/dist/index.d.ts +102 -0
  116. package/packages/types/dist/index.js +76 -0
  117. package/plugin.json +1 -1
  118. package/skills/dataiku-dss/SKILL.md +7 -5
  119. package/skills/dataiku-dss/references/app-releases.md +8 -7
  120. package/skills/dataiku-dss/references/discovery.md +4 -4
package/README.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  Agent-only TypeScript SDK and `dss` CLI for Dataiku DSS automation.
4
4
 
5
+ ## API coverage
6
+
7
+ The SDK and CLI include scenario run management; project, recipe, and dataset metadata; managed datasets, lineage, and table imports; external saved models and MLflow imports; LLM completions and embeddings; knowledge banks; project folders and data collections; users, groups, connections, macros, and plugin administration. Discover exact inputs with `dss commands run` and scoped command contracts rather than assuming flags from API field names. MLflow archive/folder imports and evaluations resolve the external container config explicitly: DSS 15 requires the `containerExecConfigName` parameter, so the SDK/CLI send `NONE` rather than omitting it (the plan surface matches the executed request).
8
+
9
+ The [DSS 15 coverage matrix](docs/API-COVERAGE-DSS-15.md) maps documented operations to SDK methods and CLI actions, records documentation discrepancies, and identifies remaining gaps. A [machine-readable matrix](docs/API-COVERAGE-DSS-15.json) is also available. Coverage is not full DSS parity or live compatibility certification: availability depends on DSS version, permissions, licensing, and installed capabilities. One known documentation discrepancy: `plugin git-branches` is served by GET on DSS 15 (the same route rejects POST with 405 `rawMethodPOSTnotsupported`, contrary to the public docs).
10
+
11
+ Metadata setters replace the complete metadata object: fetch it, edit it, then submit the replacement. Metadata previews expose that replacement under `next`. New mutation previews (`--plan` and `--dry-run`) make no DSS requests; sensitive payloads may be represented by redacted summaries rather than literal request bodies. LLM completions and embeddings are cost-bearing operations, and macros execute plugin code. Review their contracts before execution.
12
+
13
+ ML training and macro waits bound status requests by the remaining wait deadline, including response bodies and retries. The client `requestTimeoutMs` still caps each request: an overall wait budget can shorten that cap, never extend it. An individual request timeout propagates as an error until the overall wait budget expires. Future and Project Git waits use adaptive polling by default; explicit polling intervals remain fixed. Early CLI usage errors load at most the selected resource definitions, not the full command runtime.
14
+
15
+ Malformed user/group listings and scenario run histories fail explicitly instead of appearing empty. Scenario and macro run responses must contain usable run identifiers; missing identifiers are server-response errors, not caller-validation errors.
16
+
5
17
  ## Platform support
6
18
 
7
19
  The published `dss` CLI requires Bun >= 1.4.0 and supports Linux, macOS, and Windows. The release gate runs Bun 1.4.0 on all three operating systems. The runtime dependency is pure JavaScript, so the same package also runs on every Bun-supported x64 and ARM64 system.
@@ -33,8 +45,9 @@ writable managed storage connection. No imported tutorials are required.
33
45
  bun run test:live setup
34
46
  bun run test:live run --case core.dataset.baseline
35
47
  bun run test:live run --case "core.recipe.*"
36
- bun run test:live run # all core cases + migrated integration suites
48
+ bun run test:live run --profile all # every profile's run cases in one lab
37
49
  bun run test:live run --profile ml --case "ml.*"
50
+ bun run test:live run --profile all --case "applications.*,infrastructure.sql-select"
38
51
  bun run test:live status
39
52
  bun run test:live clean # delete only this lab, including its root project
40
53
  # CI: setup + run + cleanup, even when cases fail
@@ -51,6 +64,12 @@ an incomplete or cleaned lab rather than silently rebuilding it. Clean failed se
51
64
  before provisioning a replacement. Authentication and transport failures retain their
52
65
  original errors; they are not evidence that the lab is missing.
53
66
 
67
+ `--profile all` is a selection operator, not a lifecycle command: it widens run-case
68
+ availability to every profile (core, ml, applications, infrastructure) in the same
69
+ persistent lab, and setup-only cases stay unselectable. The selector itself neither
70
+ provisions beyond the selected cases nor cleans — combined with the `all` VERB the
71
+ run still ends in the usual destructive cleanup.
72
+
54
73
  Core fixtures include deterministic CSVs with nulls, duplicates, Unicode and quoting;
55
74
  server-provisioned managed datasets; sync, Prepare, join, fuzzy-join, grouping and Python
56
75
  recipes; folders, scenarios, variables, wiki, notebooks, dashboards, insights, libraries,
@@ -58,9 +77,18 @@ metrics and quality rules. Project export/import/duplicate cases use separate ow
58
77
  projects. Managed dataset types, paths and recipe output schemas come from DSS rather
59
78
  than tutorial-specific connection guesses.
60
79
 
61
- Profiles add to core: `ml` trains and deploys a small decision tree and checks clustering;
62
- `applications` requires `DATAIKU_LIVE_APP_TEMPLATE_ID`; `infrastructure` requires
63
- `DATAIKU_SQL_CONNECTION` or `DATAIKU_SQL_DATASET_FULL_NAME` for read-only SQL.
80
+ Profiles add to core: `ml` trains and deploys a small decision tree and checks clustering.
81
+ `applications` Designer cases provision disposable owned templates when
82
+ `DATAIKU_LIVE_APP_TEMPLATE_ID` is absent. That variable optionally selects an external
83
+ read-only template; version writes always use an owned template. The owned workflow
84
+ exercises form variables, a Python scenario, and a managed-folder download. Explicit-key
85
+ instance and successor creation still blocks before POST when target absence is unprovable.
86
+ Packaged Business Apps are separate: their cases use `DATAIKU_LIVE_BUSINESS_APP_ID`,
87
+ `DATAIKU_LIVE_BAPP_INSTANCE_PROJECT`, `DATAIKU_LIVE_BAPP_USER`, or
88
+ `DATAIKU_LIVE_BAPP_ARCHIVE_PATH`, and report missing prerequisites as blockers.
89
+ Other application and infrastructure read/CRUD cases run without these. The SQL probe
90
+ case needs `DATAIKU_SQL_CONNECTION` or `DATAIKU_SQL_DATASET_FULL_NAME` (other
91
+ infrastructure read-only cases run without either).
64
92
  The SQL case permits only the fixed, table-free `SELECT 1 AS one` probe with an
65
93
  explicit target and an owned project whose incarnation is checked before execution.
66
94
  It does not authorize arbitrary SQL, alternate query inputs or global mutations. Missing
@@ -68,23 +96,73 @@ prerequisites are recorded as **blocked**, never passed. Required blocked cases
68
96
  nonzero; optional blocked cases remain visible in reports. Global administration,
69
97
  external Git mutations and unsupported capabilities are not silently exercised.
70
98
 
71
- For an admin-only disposable SQL target (verified on the hosted trial), create a uniquely
72
- named connection with `POST /public/api/admin/connections/` and body
73
- `{"name":"<unique-name>","type":"JDBC","params":{"driver":"org.sqlite.JDBC","jdbcurl":"jdbc:sqlite::memory:","properties":[]},"usableBy":"ALLOWED","allowedGroups":[],"allowWrite":false,"allowManagedDatasets":false}`.
74
- Run `DATAIKU_SQL_CONNECTION=<name> bun run test:live all --profile infrastructure --case infrastructure.sql-select`.
75
- In a `finally` block, verify that the connection still matches the created definition, then
76
- remove it with `DELETE /public/api/admin/connections/<name>`. `all` cleans the owned projects,
77
- not this separately created connection. The in-memory database creates no database file.
78
-
79
- State is ignored by Git under `.live-tests/<server-hash>/`. Use `--state-dir PATH` for
80
- another lab or `--manifest PATH` to select an existing manifest for `run`, `clean` or
81
- `status` (not `setup`/`all`). Keep the manifest and
99
+ SQL catalog/import cases can provision an owned file-backed SQLite connection and
100
+ seed a real table. Project and plugin Git cases use owned bare repositories served on loopback
101
+ through the server's `git-http-backend`; they never change global Git rules. These
102
+ fixtures require server-side Python execution and the relevant admin/Git permissions.
103
+ Host paths and process identities are recorded in the manifest. Cleanup verifies
104
+ ownership before stopping services and deleting directories; failed cleanup retains
105
+ the runner project for recovery.
106
+
107
+ State is ignored by Git under `.live-tests/<server-hash>/`. Use `--state-dir PATH` to keep
108
+ a persistent demo or verification lab outside the default root — the directory is
109
+ created on demand, isolated per server hash, and never cleaned implicitly. For `run`,
110
+ `clean` or `status` you can alternatively select an existing lab with `--manifest PATH`
111
+ (the two flags overlap only there; `setup`/`all` require `--state-dir` instead). Keep the manifest and
82
112
  `cleanup.jsonl`: cleanup requires exact project identities and creation-incarnation
83
113
  hashes, never a prefix sweep. A changed server/project identity or unconfirmed creation
84
114
  fails closed; investigate its journal before manual recovery. Locks prevent concurrent
85
115
  lab runs; after an uncatchable process kill, confirm its recorded process is gone before
86
116
  removing a stale lock. Interrupting a run preserves the lab; `all` attempts cleanup.
87
117
 
118
+ New globally-scoped case families create only isolated, disposable resources: users,
119
+ groups, meanings, workspaces, data collections, API-deployer infra/services/deployments,
120
+ and plugins require an explicit reservation in the lab manifest plus an exact
121
+ ownership marker written into a lab-controlled field and re-read on every GET
122
+ (`ctx.markerFor`; code-envs instead bind on the server's `desc.creationTag`
123
+ incarnation snapshot, and project folders have no nonce field — they bind on the
124
+ server-generated id plus owner binding). The lifecycle is explicit: reserve checks the
125
+ pending reservation against the manifest; create runs the command and binds the entry
126
+ only after a GET proves the marker/incarnation identity; bound-target mutations
127
+ re-verify the live object before every request. A GET that cannot prove identity
128
+ leaves the entry unconfirmed rather than bound. A failed creation is never deleted
129
+ blind and a conflicting pre-existing resource is recorded, not removed. Pre-existing
130
+ accounts, connections and configuration are never modified or deleted.
131
+
132
+ Trained-ML demonstration state is retained across iterations in the lab: the `ml`
133
+ profile keeps a real trained decision-tree model and its fixtures, so subsequent
134
+ iterations read model metadata, settings and versions without retraining.
135
+
136
+ Core fixtures include deterministic CSVs with nulls, duplicates, Unicode and quoting;
137
+ server-provisioned managed datasets; sync, Prepare, join, fuzzy-join, grouping and Python
138
+ recipes; folders, scenarios, variables, wiki, notebooks, dashboards, insights, libraries,
139
+ metrics and quality rules. Project export/import/duplicate cases use separate owned
140
+ projects. Managed dataset types, paths and recipe output schemas come from DSS rather
141
+ than tutorial-specific connection guesses. Expanded case families beyond the original
142
+ core set cover bundles (export/publish lifecycles), Project Git (inspect, commit,
143
+ remote and external-library lifecycles against owned loopback repositories), scenario statistics and
144
+ payload round-trips, application template and instance manifests, webapp backend state,
145
+ infrastructure reads (connections, users, groups, macros, code-envs, project folders,
146
+ data collections), disposable global lifecycles under the ownership-marker contract,
147
+ and disposable folders/notebooks with plugin.json receipt flows. Plugin cases that
148
+ generate a plugin-managed code environment delete that derived environment explicitly
149
+ before deleting the parent plugin (DSS does not cascade the deletion), and plugin updates
150
+ require the `settings.codeEnvName` association created after plugin creation. MLflow
151
+ import fixtures use canonical packaging (`code:'code'`, `data:'model'`, `env:'conda.yaml'`)
152
+ inside owned runtime environments with pinned scientific versions, and both archive and
153
+ folder imports/evaluations pass explicit `containerExecConfigName=NONE` (DSS 15 rejects
154
+ requests that omit it; folder imports previously inherited a default); noncanonical
155
+ model-path layouts fail with READ_META `ModuleNotFoundError`.
156
+
157
+ Some capabilities have external prerequisites the lab cannot self-provision; each
158
+ affected action records an explicit per-action blocker instead of passing or being
159
+ silently omitted: an installed application template (`DATAIKU_LIVE_APP_TEMPLATE_ID`),
160
+ external SQL connectivity for non-fixture workloads (`DATAIKU_SQL_CONNECTION`/`DATAIKU_SQL_DATASET_FULL_NAME`),
161
+ an external auth backend (LDAP/SAML) for user external-directory reads and resyncs, plugin-store
162
+ access, and any cost-bearing surface (LLM completions/embeddings bill per call; macros
163
+ execute plugin code). Missing credentials, templates, external infrastructure or billing
164
+ eligibility are reported as **blocked**, never as success.
165
+
88
166
  Each iteration retains logs and `report.json` with cases, timing, executed actions,
89
167
  capability reasons, coverage and external-project metadata integrity. Unavailable project
90
168
  metadata is reported separately in `integrity.unreadable`, not as confirmed drift;
@@ -95,13 +173,16 @@ both fail, the cleanup error remains primary and the report preserves both resul
95
173
  Planned lifecycle commands retain ownership checks; local outputs stay inside the lab
96
174
  for both `--output` and `--output-file`. Treat local reports and exported archives as private project
97
175
  data. Coverage is an explicit inventory of every registered action, not a claim that
98
- every action has a live test: unexercised actions remain **uncovered**. Add cases through
176
+ every action has a live test: unexercised actions remain **uncovered**, and the
177
+ expanded demonstration keeps each registered action visible as demonstrated, blocked
178
+ with a recorded prerequisite, or uncovered — never silently dropped. Add cases through
99
179
  the typed catalogue in `tests/live-cases.ts`, `LiveContext.check` and guarded helpers,
100
180
  then update `tests/live-coverage.ts` when the
101
181
  registry changes; catalogue drift fails the offline gate. Plan/dry-run calls do not count
102
182
  as executed live coverage.
103
183
 
104
184
  Regular `bun run check` and `bun run lint` include the live runner and fixtures.
185
+ Lint includes project-owned rules in `tools/oxlint/index.ts`: accumulator-copy, widen-then-assert, and chained-assertion errors, alongside the native accumulating-spread check.
105
186
  For focused verification:
106
187
 
107
188
  ```sh
@@ -170,11 +251,11 @@ Each entry in the `installed` array reports pre-install bundle state:
170
251
 
171
252
  The entrypoint contains bootstrap/discovery, output interpretation, and universal safety rules. Seven focused files under [references/](skills/dataiku-dss/references/) cover authentication, discovery, mutations, application releases, flow maps, coding, and troubleshooting. All are linked directly from `SKILL.md` with task-specific read conditions; agents should not preload the whole directory.
172
253
 
173
- The entrypoint measures **750 o200k_base tokens**, down from **851** in the previous revision (12% less) and **4,272** before progressive disclosure. The token-budget test now caps it at **825** tokens. Claude V5 reconstruction counts fell **1,420 → 1,250** and GLM5 **858 → 752**. Safety rules and all seven reference links remain. Reference content consumes context only when read; all five agent installers ship the complete bundle.
254
+ The entrypoint measures **774 o200k_base tokens**, within its **825-token** budget. Current Claude V5 reconstruction and GLM5 counts are **1,297** and **776**. Safety rules and all seven reference links remain. Reference content consumes context only when read; all five agent installers ship the complete bundle.
174
255
 
175
256
  All seven references are token-budgeted (each measured `o200k_base` baseline plus 5% headroom). Per-file baselines live in [the token-budget tests](tests/cli/agent-token-budget.test.ts); run `bun run test:tokens` to check them.
176
257
 
177
- References total **4,179 → 3,545 tokens (15.2% less)**. With the 750-token entrypoint, the whole bundle totals **4,295**; this is a sum of file counts, not a recommendation to preload them. All references shrink across ten encodings; whole-bundle Claude V5 reconstruction **8,200 → 7,362**, GLM5 **4,943 → 4,305**. Runnable examples and safety conditions are retained.
258
+ References total **3,797 o200k_base tokens**; including the entrypoint, the bundle totals **4,571**. This is a sum of file counts, not a recommendation to preload them. Runnable examples, sharing safeguards, and cleanup conditions are retained.
178
259
 
179
260
  This uses progressive disclosure from the [Agent Skills specification](https://agentskills.io/specification) and [Anthropic's authoring guidance](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices): concise metadata/instructions, direct relative reference links, and domain-focused documents. No scripts or assets are needed here; generated command metadata is queried from the CLI rather than duplicated in the skill.
180
261
 
@@ -184,14 +265,16 @@ This uses progressive disclosure from the [Agent Skills specification](https://a
184
265
  DSS_TOKENIZER_MODULE=/absolute/path/to/oh-my-pi/packages/natives/native/index.js bun run test:tokens
185
266
  ```
186
267
 
187
- Without this variable, only the native cross-model case is skipped. A configured missing/incompatible module fails rather than estimating tokens. The cross-model gate permits 10% growth over its recorded text baselines for bootstrap and action discovery; the pinned OpenAI gate also enforces the skill ceiling above. Claude counts use ctok reconstructions, not an official tokenizer, and all counts exclude provider message/tool framing. No native dependency is added to the CLI.
268
+ When configured, the native module also accelerates ordinary OpenAI token measurements after parity checks against the pinned JavaScript model. The JS fingerprint and independent cross-model reference checks remain authoritative; reserved special-token validation is preserved. Without this variable, measurements use JavaScript and only the native cross-model case is skipped. A configured missing/incompatible module fails instead of silently falling back. The cross-model gate permits 10% growth over recorded text baselines. Claude counts use ctok reconstructions, not an official tokenizer; counts exclude provider framing. No native dependency is added to the CLI.
188
269
 
189
- Measured full `dataset.create` discovery versus its `usage,description,flags,examples` projection: OpenAI **1,059 → 356**, Claude V5 reconstruction **1,771 → 640**, GLM5 **1,015 → 347** tokens. Use the projection when those fields suffice; fetch the full action when schema details are needed. This is selective disclosure, not lossless compression.
270
+ For a known resource, `dss agent contract --fields commands.actions.dataset` lists action names in **64 tokens**, versus **1,575** for the global index. For known writes, fetch the full action entry directly once: `dataset.create` costs **1,059 tokens**, versus **1,415** for compact discovery followed by the required full entry. Use compact `usage,description,flags,examples` projections for reads when those fields suffice. This is selective disclosure, not lossless compression. Scoped discovery builds only selected resource metadata; action-name indexes avoid constructing payload schemas, while full registry exports and recovery hints retain their existing content.
190
271
 
191
272
  Boolean flags accept bare flags or explicit `=true`/`=false` values, including aliases. Invalid boolean values fail before dispatch. Direct, batch, and local commands share execution-mode resolution; `--plan --dry-run` returns a plan with `plannedAndDryRun:true` when both modes are supported. Unreadable JSON/text payload files produce `validation_failed` usage errors (exit 1) with the flag, path, and filesystem cause.
192
273
 
193
274
  For raw streaming downloads, `--request-timeout MS` bounds each pending body read, not the total transfer duration: large progressing transfers remain supported. Buffered text/JSON consumers retain their bounded body-read budget. Request retries do not replay partially consumed streams. Project, bundle, and API-service archives and managed-folder downloads are written to private temporary files beside the destination, then renamed on success. Failures leave no partial output and preserve any existing destination.
194
275
 
276
+ The SDK configuration `maxResponseBodyBytes` (default **50 MiB**) also bounds retained non-2xx response bodies. Oversized errors preserve HTTP status, header request IDs, and a UTF-8-safe prefix, with `DataikuError.bodyTruncated: true`; CLI errors expose `details.bodyTruncated: true`. Retry eligibility is unchanged, and error-body reads share the transport attempt deadline.
277
+
195
278
  ## Credentials
196
279
 
197
280
  Use environment variables for ephemeral runs. For disposable agent tests, set `DSS_CONFIG_DIR` to a temporary directory so saved credentials never touch your real profile.
@@ -254,11 +337,14 @@ dss recipe get-payload compute_orders --output code.py --project-key MYPROJ
254
337
  dss install-skill --dry-run
255
338
  dss app validate-manifest --project-key MYAPP_INSTANCE
256
339
  dss app compare-manifest my-app --project-key MYAPP_INSTANCE
257
- dss app create-instance my-app --data '{"targetProjectKey":"MYAPP_INSTANCE"}' --wait --record-cleanup cleanup.jsonl
340
+ dss app create-instance my-app --data '{"targetProjectName":"My app instance"}' --wait --record-cleanup cleanup.jsonl
341
+ # Substitute the returned projectKey for MYAPP_INSTANCE in later commands.
258
342
  dss app manifest-version --project-key MYAPP_TEMPLATE
259
343
  dss app successor-preflight my-app --from MYAPP_INSTANCE --to MYAPP_INSTANCE_V2 --copy-permissions
260
344
  dss app set-manifest-version --manifest-version 1.4.0 --expect-hash PREFLIGHT_TEMPLATE_MANIFEST_HASH --project-key MYAPP_TEMPLATE
261
345
  dss app create-successor-instance my-app --from MYAPP_INSTANCE --to MYAPP_INSTANCE_V2 --copy-permissions --record-cleanup cleanup.jsonl
346
+ # Or omit --to: the target key is generated during apply (preflight/plan allocate nothing).
347
+ dss app create-successor-instance my-app --from MYAPP_INSTANCE --copy-permissions --record-cleanup cleanup.jsonl
262
348
  dss app verify-instance my-app --project-key MYAPP_INSTANCE_V2 --expect-version 1.4.0
263
349
  dss app permissions-snapshot --project-key MYAPP_INSTANCE --output permissions.json
264
350
  dss app permissions-diff --project-key MYAPP_INSTANCE --file permissions.json
@@ -305,8 +391,10 @@ dss app compare-manifest APP_ID --project-key RELEASE_INSTANCE
305
391
  dss app manifest-version --project-key APP_TEMPLATE
306
392
 
307
393
  # Run every read-only successor gate before changing the template version. This validates the
308
- # template references, verifies the predecessor, proves target absence, and optionally snapshots
309
- # the predecessor ACL. Keep template.manifestHash from the result for the next command.
394
+ # template references, verifies the predecessor, proves target absence for an explicit --to, and
395
+ # optionally snapshots the predecessor ACL. Keep template.manifestHash from the result for the
396
+ # next command. Omit --to to leave the target to apply: preflight then reports
397
+ # targetProjectKeyGeneratedDuringApply with no absence probe and no allocation.
310
398
  dss app successor-preflight APP_ID \
311
399
  --from RELEASE_INSTANCE --to RELEASE_INSTANCE_V2 --copy-permissions
312
400
 
@@ -320,20 +408,24 @@ dss app successor-preflight APP_ID \
320
408
  dss app set-manifest-version --manifest-version 1.4.0 \
321
409
  --expect-hash PREFLIGHT_TEMPLATE_MANIFEST_HASH --project-key APP_TEMPLATE
322
410
 
323
- # Create an instance only after its target key is confirmed absent, wait on the DSS future, and
324
- # record deterministic cleanup.
411
+ # Create a fresh instance without global project visibility; the CLI generates the key.
412
+ # Use the returned projectKey for verification and later commands; cleanup binds that instance.
325
413
  dss app create-instance APP_ID \
326
- --data '{"targetProjectKey":"RELEASE_INSTANCE","targetProjectName":"Release instance"}' \
414
+ --data '{"targetProjectName":"Release instance"}' \
327
415
  --wait --record-cleanup cleanup.jsonl
328
416
 
329
417
  # Roll out a new template version to an existing instance as an additive successor: the old
330
418
  # instance is never modified or deleted, and the command always waits on the DSS future
331
419
  # (there is no --wait flag). The recorded cleanup entry targets only the new project key. If DSS
332
420
  # may have accepted creation but no future ID is returned, the outcome is indeterminate and no
333
- # unbound cleanup entry is written.
421
+ # unbound cleanup entry is written. Omit --to to generate the target key during apply: preflight
422
+ # and plans stay allocation-free, the key is generated once before the single POST, and cleanup
423
+ # binds it through the creation future plus creationTag.
334
424
  dss app create-successor-instance APP_ID \
335
425
  --from RELEASE_INSTANCE --to RELEASE_INSTANCE_V2 \
336
426
  --name "Release instance v2" --copy-permissions --record-cleanup cleanup.jsonl
427
+ dss app create-successor-instance APP_ID \
428
+ --from RELEASE_INSTANCE --name "Release instance v2" --copy-permissions --record-cleanup cleanup.jsonl
337
429
 
338
430
  # API readiness gate for the successor. apiReady:true with status API_VERIFIED_UI_PENDING is an
339
431
  # API-verified state only — never visual verification. The API key authenticates public REST only;
@@ -358,24 +450,33 @@ restore reject snapshots from another DSS server, project key, or observed incar
358
450
  client-side, non-atomic stale-identity checks: DSS exposes no conditional permission PUT, so the
359
451
  checks narrow and detect key-reuse races but cannot serialize the final check with the write.
360
452
  Snapshots contain access-control identities; commit them only when repository policy permits.
361
- `validate-manifest` checks `SCENARIO_RUN` scenario IDs, `DOWNLOAD_FILE`
362
- managed-folder IDs, and runtime-form parameter names against supported public project APIs.
363
-
364
- Some DSS deployments hide unknown project keys behind `403` instead of returning `404`.
365
- Instance creation requires confirmed target absence before POST: an inaccessible target not present
366
- in the visible project and app-instance lists is still unconfirmed and is rejected with
367
- `target_absence_unverifiable` / `permission_or_environment` rather than risking cleanup against a
368
- pre-existing project. Choosing another key does not solve deployments that mask every unknown key.
369
- DSS exposes no permission-independent public availability endpoint, and its published app-instance
370
- API does not guarantee duplicate-key rejection before any write or non-overwrite behavior, so
371
- there is no unsafe force or unconfirmed-target bypass. Use an identity with global project
372
- visibility. A definitive create rejection never produces a cleanup entry; an ambiguous POST
373
- without a future ID or verified
374
- incarnation also produces no cleanup entry.
375
-
376
- Static create plans describe, but do not execute, these reads:
377
- `preflightExecuted:false` and `preflightWillRunDuringApply:true`. Run `successor-preflight` when
378
- live read evidence is required before changing the template version.
453
+ `validate-manifest` checks `SCENARIO_RUN` scenario IDs, `DOWNLOAD_MANAGED_FOLDER_FILE`
454
+ folder IDs, and `PROJECT_VARIABLES_EDIT` parameter names against supported public project APIs.
455
+ Unknown tile types and custom content remain opaque; reference validation is not UI-rendering proof.
456
+
457
+ Fresh `app create-instance` requests can omit `targetProjectKey`: the CLI generates a cryptographic
458
+ `APP_` + UUIDv4 key locally (122 random bits), without global visibility probes. It preserves
459
+ `targetProjectName`; if omitted, the name defaults to the key. Normal app-instantiation permissions
460
+ still apply. Use the returned `projectKey` for verification and later commands. Only omission
461
+ selects generation; explicit blank, null, or non-string keys are rejected. Collision risk is
462
+ negligible, not zero; DSS does not document atomic duplicate-key rejection. This follows the
463
+ [official client's random-key pattern](https://github.com/dataiku/dataiku-api-client-python/blob/master/dataikuapi/dss/app.py).
464
+
465
+ Caller-chosen keys, including successor `--to`, still require confirmed absence before POST.
466
+ A masked `403` remains `target_absence_unverifiable` / `permission_or_environment`, even if absent from
467
+ visible lists. DSS has no public availability endpoint or force bypass; exact keys need global
468
+ visibility. Otherwise omit the key for a fresh instance, or omit successor `--to` to generate the
469
+ successor target during apply. Definitive rejections produce no cleanup entry; ambiguous POSTs
470
+ without a future ID or verified incarnation produce none either.
471
+
472
+ Plans allocate and reserve nothing. Direct `create-instance` generated-key plans report
473
+ `preflightExecuted:false` and `preflightWillRunDuringApply:false`; explicit-key plans report the
474
+ latter as `true`. `create-successor-instance` plans always report
475
+ `preflightWillRunDuringApply:true` — with `--to` the read-only gates re-run during apply, and
476
+ without `--to` the target key is generated only then
477
+ (`targetProjectKeyGeneratedDuringApply:true`, `preflightExecuted:false`). Use `--plan`
478
+ for preview (`create-instance` does not support `--dry-run`). Run `successor-preflight` for named
479
+ releases when live read evidence is required before changing the template version.
379
480
 
380
481
  Every new cleanup entry records the canonical DSS URL. App-instance cleanup records a
381
482
  `creationTag` hash observed after the DSS future identifies the target key; a future-addressable
@@ -544,7 +645,9 @@ dss notebook unload-jupyter --all --dry-run --project-key MYPROJ
544
645
  Code-environment reads expose definitions, deployment mode, installed/requested packages, project
545
646
  versions, usages, and bounded build logs. Fetch the definition/hash before `set-definition` or
546
647
  `set-packages --expect-hash`; package, image, Jupyter, create, and delete operations can return DSS
547
- futures with `--no-wait`.
648
+ futures with `--no-wait`. `set-packages` replaces the requested package list wholesale: an
649
+ explicitly empty `--packages ''` value (or an empty `--file`) clears the requested specs, while a
650
+ call with no package source flag at all is a usage error.
548
651
 
549
652
  Webapp updates use GET–deep-merge–PUT; API-service `save-settings` is explicit full replacement.
550
653
  Run either with `--dry-run` to inspect `currentHash`/`nextHash`, then apply with
@@ -1 +1 @@
1
- {"format":1,"buildRevision":"aa9d13ec085be8f8637265cabcc8466df4817c88"}
1
+ {"format":1,"buildRevision":"944ec2a6e0780142399032675854ef6b4ac957a7"}
@@ -59,6 +59,12 @@ export declare const ProjectMetadataSchema: import("@sinclair/typebox").TObject<
59
59
  }>>;
60
60
  }>;
61
61
  export type ProjectMetadata = Static<typeof ProjectMetadataSchema>;
62
+ export declare const ProjectTagsSchema: import("@sinclair/typebox").TObject<{
63
+ tags: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
64
+ color: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
65
+ }>>;
66
+ }>;
67
+ export type ProjectTags = Static<typeof ProjectTagsSchema>;
62
68
  export declare const DatasetSummarySchema: import("@sinclair/typebox").TObject<{
63
69
  name: import("@sinclair/typebox").TString;
64
70
  type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
@@ -308,6 +314,85 @@ export declare const ScenarioWaitResultSchema: import("@sinclair/typebox").TObje
308
314
  }>>>;
309
315
  }>;
310
316
  export type ScenarioWaitResult = Static<typeof ScenarioWaitResultSchema>;
317
+ /** A macro definition as returned by GET /projects/{pk}/runnables/{runnableType}. */
318
+ export declare const MacroDefinitionSchema: import("@sinclair/typebox").TObject<{
319
+ runnableType: import("@sinclair/typebox").TString;
320
+ ownerPluginId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
321
+ meta: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
322
+ label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
323
+ }>>;
324
+ longDescription: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
325
+ resultType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
326
+ extension: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
327
+ mimeType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
328
+ resultLabel: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
329
+ params: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
330
+ name: import("@sinclair/typebox").TString;
331
+ type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
332
+ }>>>;
333
+ adminParams: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnknown>>;
334
+ }>;
335
+ export type MacroDefinition = Static<typeof MacroDefinitionSchema>;
336
+ /** One entry of GET /projects/{pk}/runnables (array[Macro]). */
337
+ export declare const MacroSummarySchema: import("@sinclair/typebox").TObject<{
338
+ runnableType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
339
+ /** Owning plugin id as the server returns it (live identifiers are server-authored). */
340
+ ownerPluginId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
341
+ meta: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
342
+ label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
343
+ }>>;
344
+ }>;
345
+ export type MacroSummary = Static<typeof MacroSummarySchema>;
346
+ export declare const MacroSummaryArraySchema: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
347
+ runnableType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
348
+ /** Owning plugin id as the server returns it (live identifiers are server-authored). */
349
+ ownerPluginId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
350
+ meta: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
351
+ label: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
352
+ }>>;
353
+ }>>;
354
+ export type MacroSummaryArray = Static<typeof MacroSummaryArraySchema>;
355
+ /**
356
+ * Poll-state response of GET /projects/{pk}/runnables/{runnableType}/state/{run}.
357
+ * While running: `running: true` and optionally a stack of `progress` entries.
358
+ * When finished: `running: false`; on failure `resultError`/`storedError` carry
359
+ * details, otherwise `type` is filled.
360
+ */
361
+ export declare const MacroStateSchema: import("@sinclair/typebox").TObject<{
362
+ exists: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
363
+ running: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
364
+ empty: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
365
+ type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
366
+ progress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
367
+ resultError: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
368
+ storedError: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
369
+ }>;
370
+ export type MacroState = Static<typeof MacroStateSchema>;
371
+ /** Run trigger response of POST /projects/{pk}/runnables/{runnableType}. */
372
+ export declare const MacroRunStartSchema: import("@sinclair/typebox").TObject<{
373
+ runId: import("@sinclair/typebox").TString;
374
+ }>;
375
+ export type MacroRunStart = Static<typeof MacroRunStartSchema>;
376
+ /** Result of {@link MacrosResource.runAndWait}: bounded client-side polling. */
377
+ export declare const MacroWaitResultSchema: import("@sinclair/typebox").TObject<{
378
+ runnableType: import("@sinclair/typebox").TString;
379
+ runId: import("@sinclair/typebox").TString;
380
+ running: import("@sinclair/typebox").TBoolean;
381
+ success: import("@sinclair/typebox").TBoolean;
382
+ elapsedMs: import("@sinclair/typebox").TNumber;
383
+ pollCount: import("@sinclair/typebox").TNumber;
384
+ timedOut: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
385
+ state: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
386
+ exists: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
387
+ running: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
388
+ empty: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
389
+ type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
390
+ progress: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
391
+ resultError: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
392
+ storedError: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
393
+ }>>;
394
+ }>;
395
+ export type MacroWaitResult = Static<typeof MacroWaitResultSchema>;
311
396
  export declare const FlowZoneObjectTypeSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"DATASET">, import("@sinclair/typebox").TLiteral<"MANAGED_FOLDER">, import("@sinclair/typebox").TLiteral<"SAVED_MODEL">, import("@sinclair/typebox").TLiteral<"RECIPE">, import("@sinclair/typebox").TLiteral<"MODEL_EVALUATION_STORE">, import("@sinclair/typebox").TLiteral<"STREAMING_ENDPOINT">, import("@sinclair/typebox").TLiteral<"LABELING_TASK">, import("@sinclair/typebox").TLiteral<"RETRIEVABLE_KNOWLEDGE">]>;
312
397
  export type FlowZoneObjectType = Static<typeof FlowZoneObjectTypeSchema>;
313
398
  export declare const FlowZoneItemSchema: import("@sinclair/typebox").TObject<{
@@ -658,6 +743,11 @@ export declare const SqlNotebookCellSchema: import("@sinclair/typebox").TObject<
658
743
  id: import("@sinclair/typebox").TString;
659
744
  type: import("@sinclair/typebox").TString;
660
745
  name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
746
+ /**
747
+ * Cell source. DSS enforces a JSON string here: an array fails to parse
748
+ * server-side (`Expected a string but was BEGIN_ARRAY ... $.cells[0].code`),
749
+ * so the official-client example's line-array form does not apply to SQL.
750
+ */
661
751
  code: import("@sinclair/typebox").TString;
662
752
  }>;
663
753
  export type SqlNotebookCell = Static<typeof SqlNotebookCellSchema>;
@@ -668,12 +758,24 @@ export declare const SqlNotebookSummarySchema: import("@sinclair/typebox").TObje
668
758
  connection: import("@sinclair/typebox").TString;
669
759
  }>;
670
760
  export type SqlNotebookSummary = Static<typeof SqlNotebookSummarySchema>;
761
+ /**
762
+ * A SQL notebook's content as returned by GET. The notebook record carries
763
+ * the server-allocated `id` (a request-supplied `id` is rejected on create)
764
+ * plus `name`/`projectKey`/`isRunning` and similar receipt fields via
765
+ * `additionalProperties`; requests supply `connection` + `cells` (and
766
+ * optionally `name` as the display handle).
767
+ */
671
768
  export declare const SqlNotebookContentSchema: import("@sinclair/typebox").TObject<{
672
769
  connection: import("@sinclair/typebox").TString;
673
770
  cells: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
674
771
  id: import("@sinclair/typebox").TString;
675
772
  type: import("@sinclair/typebox").TString;
676
773
  name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
774
+ /**
775
+ * Cell source. DSS enforces a JSON string here: an array fails to parse
776
+ * server-side (`Expected a string but was BEGIN_ARRAY ... $.cells[0].code`),
777
+ * so the official-client example's line-array form does not apply to SQL.
778
+ */
677
779
  code: import("@sinclair/typebox").TString;
678
780
  }>>;
679
781
  }>;
@@ -113,6 +113,9 @@ export const ProjectMetadataSchema = Type.Object({
113
113
  }, { additionalProperties: true, }))),
114
114
  }, { additionalProperties: true, })),
115
115
  }, { additionalProperties: true, });
116
+ export const ProjectTagsSchema = Type.Object({
117
+ tags: Type.Record(Type.String(), Type.Object({ color: Type.Optional(Type.String()), }, { additionalProperties: true, }), { additionalProperties: true, }),
118
+ }, { additionalProperties: true, });
116
119
  // ---------------------------------------------------------------------------
117
120
  // Datasets
118
121
  // ---------------------------------------------------------------------------
@@ -347,6 +350,67 @@ export const ScenarioWaitResultSchema = Type.Object({
347
350
  steps: Type.Optional(Type.Array(ScenarioStepRunSchema)),
348
351
  });
349
352
  // ---------------------------------------------------------------------------
353
+ // Macros (runnables)
354
+ // ---------------------------------------------------------------------------
355
+ /** A macro definition as returned by GET /projects/{pk}/runnables/{runnableType}. */
356
+ export const MacroDefinitionSchema = Type.Object({
357
+ runnableType: Type.String(),
358
+ ownerPluginId: Type.Optional(Type.String()),
359
+ meta: Type.Optional(Type.Object({
360
+ label: Type.Optional(Type.String()),
361
+ }, { additionalProperties: true, })),
362
+ longDescription: Type.Optional(Type.String()),
363
+ resultType: Type.Optional(Type.String()),
364
+ extension: Type.Optional(Type.String()),
365
+ mimeType: Type.Optional(Type.String()),
366
+ resultLabel: Type.Optional(Type.String()),
367
+ params: Type.Optional(Type.Array(Type.Object({
368
+ name: Type.String(),
369
+ type: Type.Optional(Type.String()),
370
+ }, { additionalProperties: true, }))),
371
+ adminParams: Type.Optional(Type.Array(Type.Unknown())),
372
+ }, { additionalProperties: true, });
373
+ /** One entry of GET /projects/{pk}/runnables (array[Macro]). */
374
+ export const MacroSummarySchema = Type.Object({
375
+ runnableType: Type.Optional(Type.String()),
376
+ /** Owning plugin id as the server returns it (live identifiers are server-authored). */
377
+ ownerPluginId: Type.Optional(Type.String()),
378
+ meta: Type.Optional(Type.Object({
379
+ label: Type.Optional(Type.String()),
380
+ }, { additionalProperties: true, })),
381
+ }, { additionalProperties: true, });
382
+ export const MacroSummaryArraySchema = Type.Array(MacroSummarySchema);
383
+ /**
384
+ * Poll-state response of GET /projects/{pk}/runnables/{runnableType}/state/{run}.
385
+ * While running: `running: true` and optionally a stack of `progress` entries.
386
+ * When finished: `running: false`; on failure `resultError`/`storedError` carry
387
+ * details, otherwise `type` is filled.
388
+ */
389
+ export const MacroStateSchema = Type.Object({
390
+ exists: Type.Optional(Type.Boolean()),
391
+ running: Type.Optional(Type.Boolean()),
392
+ empty: Type.Optional(Type.Boolean()),
393
+ type: Type.Optional(Type.String()),
394
+ progress: Type.Optional(Type.Unknown()),
395
+ resultError: Type.Optional(Type.Unknown()),
396
+ storedError: Type.Optional(Type.Unknown()),
397
+ }, { additionalProperties: true, });
398
+ /** Run trigger response of POST /projects/{pk}/runnables/{runnableType}. */
399
+ export const MacroRunStartSchema = Type.Object({
400
+ runId: Type.String(),
401
+ }, { additionalProperties: true, });
402
+ /** Result of {@link MacrosResource.runAndWait}: bounded client-side polling. */
403
+ export const MacroWaitResultSchema = Type.Object({
404
+ runnableType: Type.String(),
405
+ runId: Type.String(),
406
+ running: Type.Boolean(),
407
+ success: Type.Boolean(),
408
+ elapsedMs: Type.Number(),
409
+ pollCount: Type.Number(),
410
+ timedOut: Type.Optional(Type.Boolean()),
411
+ state: Type.Optional(MacroStateSchema),
412
+ }, { additionalProperties: true, });
413
+ // ---------------------------------------------------------------------------
350
414
  // Flow zones
351
415
  // ---------------------------------------------------------------------------
352
416
  export const FlowZoneObjectTypeSchema = Type.Union([
@@ -631,6 +695,11 @@ export const SqlNotebookCellSchema = Type.Object({
631
695
  id: Type.String(),
632
696
  type: Type.String(),
633
697
  name: Type.Optional(Type.String()),
698
+ /**
699
+ * Cell source. DSS enforces a JSON string here: an array fails to parse
700
+ * server-side (`Expected a string but was BEGIN_ARRAY ... $.cells[0].code`),
701
+ * so the official-client example's line-array form does not apply to SQL.
702
+ */
634
703
  code: Type.String(),
635
704
  }, { additionalProperties: true, });
636
705
  export const SqlNotebookSummarySchema = Type.Object({
@@ -639,6 +708,13 @@ export const SqlNotebookSummarySchema = Type.Object({
639
708
  language: Type.String(),
640
709
  connection: Type.String(),
641
710
  }, { additionalProperties: true, });
711
+ /**
712
+ * A SQL notebook's content as returned by GET. The notebook record carries
713
+ * the server-allocated `id` (a request-supplied `id` is rejected on create)
714
+ * plus `name`/`projectKey`/`isRunning` and similar receipt fields via
715
+ * `additionalProperties`; requests supply `connection` + `cells` (and
716
+ * optionally `name` as the display handle).
717
+ */
642
718
  export const SqlNotebookContentSchema = Type.Object({
643
719
  connection: Type.String(),
644
720
  cells: Type.Array(SqlNotebookCellSchema),