windmill-cli 1.730.0 → 1.732.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 (2) hide show
  1. package/esm/main.js +143 -2
  2. package/package.json +1 -1
package/esm/main.js CHANGED
@@ -16772,7 +16772,7 @@ var init_OpenAPI = __esm(() => {
16772
16772
  PASSWORD: undefined,
16773
16773
  TOKEN: getEnv3("WM_TOKEN"),
16774
16774
  USERNAME: undefined,
16775
- VERSION: "1.730.0",
16775
+ VERSION: "1.732.0",
16776
16776
  WITH_CREDENTIALS: true,
16777
16777
  interceptors: {
16778
16778
  request: new Interceptors,
@@ -25420,7 +25420,7 @@ var init_auth = __esm(async () => {
25420
25420
  });
25421
25421
 
25422
25422
  // src/core/constants.ts
25423
- var WM_FORK_PREFIX = "wm-fork", VERSION = "1.730.0";
25423
+ var WM_FORK_PREFIX = "wm-fork", VERSION = "1.732.0";
25424
25424
 
25425
25425
  // src/utils/git.ts
25426
25426
  var exports_git = {};
@@ -78745,6 +78745,7 @@ var AGENTS_WMILL_FILENAME = "AGENTS.wmill.md", AGENTS_WMILL_INCLUDE_LINE = "@AGE
78745
78745
  var SKILLS, SKILL_CONTENT, SCHEMAS, SCHEMA_MAPPINGS;
78746
78746
  var init_skills_gen = __esm(() => {
78747
78747
  SKILLS = [
78748
+ { name: "write-script-ansible", description: "MUST use when writing Ansible playbooks.", languageKey: "ansible" },
78748
78749
  { name: "write-script-bash", description: "MUST use when writing Bash scripts.", languageKey: "bash" },
78749
78750
  { name: "write-script-bigquery", description: "MUST use when writing BigQuery queries.", languageKey: "bigquery" },
78750
78751
  { name: "write-script-bun", description: "MUST use when writing Bun/TypeScript scripts.", languageKey: "bun" },
@@ -78774,6 +78775,146 @@ var init_skills_gen = __esm(() => {
78774
78775
  { name: "preview", description: "MUST use when opening the Windmill dev page / visual preview of a flow, script, or app. Triggers on words like preview, open, navigate to, visualize, see the flow/app/script, and after writing a flow/script/app for visual verification." }
78775
78776
  ];
78776
78777
  SKILL_CONTENT = {
78778
+ "write-script-ansible": `---
78779
+ name: write-script-ansible
78780
+ description: MUST use when writing Ansible playbooks.
78781
+ ---
78782
+
78783
+ ## CLI Commands
78784
+
78785
+ Place scripts in a folder.
78786
+
78787
+ After writing, tell the user which command fits what they want to do:
78788
+
78789
+ - \`wmill script preview <script_path>\` — **default when iterating on a local script.** Runs the local file without deploying.
78790
+ - \`wmill script run <path>\` — runs the script **already deployed** in the workspace. Use only when the user explicitly wants to test the deployed version, not local edits.
78791
+ - \`wmill generate-metadata\` — regenerate the local \`.script.yaml\` (input schema) and \`.lock\` (resolved dependencies) for scripts you changed, and refresh their content hashes in \`wmill-lock.yaml\`. Local files only — **not** a deploy. See "Keep metadata in sync" below.
78792
+ - \`wmill sync push\` — deploy local changes to the workspace. Only suggest/run this when the user explicitly asks to deploy/publish/push — not when they say "run", "try", or "test".
78793
+
78794
+ ### Preview vs run — choose by intent, not habit
78795
+
78796
+ If the user says "run the script", "try it", "test it", "does it work" while there are **local edits to the script file**, use \`script preview\`. Do NOT push the script to then \`script run\` it — pushing is a deploy, and deploying just to test overwrites the workspace version with untested changes.
78797
+
78798
+ Only use \`script run\` when:
78799
+ - The user explicitly says "run the deployed version" / "run what's on the server".
78800
+ - There is no local script being edited (you're just invoking an existing script).
78801
+
78802
+ Only use \`sync push\` when:
78803
+ - The user explicitly asks to deploy, publish, push, or ship.
78804
+ - The preview has already validated the change and the user wants it in the workspace.
78805
+
78806
+ ### Keep metadata in sync after editing
78807
+
78808
+ \`wmill-lock.yaml\` tracks a content hash for each item. Editing a script's content — most importantly **adding or removing an import** or **changing \`main\`'s arguments** — invalidates that hash and leaves the \`.lock\`, the \`.script.yaml\` input schema, and the hash row out of date. Run \`wmill generate-metadata\` (scoped to what you touched) after such edits so the resolved lock, the auto-generated args UI (driven by \`.script.yaml\`), and \`wmill-lock.yaml\` all match the code. Leaving them stale produces spurious diffs in git-sync and CI.
78809
+
78810
+ This only writes local files (it is **not** a deploy), but it re-resolves dependencies, so it can bump unpinned versions (the same as deploying from the UI; expected, not a bug). So by default offer it and run it once the user agrees, rather than running it silently after every edit — unless the project's \`AGENTS.md\` opts into running metadata automatically (see the "Keeping metadata in sync" preference there). Either way YOU run the command, not the user. After running it, diff the regenerated \`.lock\` / \`.script.lock\` files and tell the user which dependency versions changed (e.g. \`requests 2.31.0 → 2.32.0\`), so they can catch an unwanted bump before deploying — even under \`Metadata: auto\`, since it's information, not a confirmation gate. Pin versions in code to keep them fixed.
78811
+
78812
+ With no path argument, \`generate-metadata\` regenerates only the items whose content hash drifted — not everything. Imports propagate: editing a script that others import marks every importer stale too, so a one-line change to a shared module can regenerate many locks (by design — their locks must reflect the imported code). If it touches more than you expect, run \`wmill generate-metadata --dry-run\` — it lists each stale item with a reason (\`content changed\` or \`depends on <path>\`) without changing anything — then narrow with a path argument (\`wmill generate-metadata f/foo\`) or \`--strict-folder-boundaries\`.
78813
+
78814
+ If the on-disk \`.lock\` and \`.script.yaml\` are already correct and only \`wmill-lock.yaml\` needs its hashes refreshed (hash drift, or bootstrapping missing entries), use \`wmill generate-metadata rehash\` — it re-records hashes from disk with no backend round-trip and no dependency changes.
78815
+
78816
+ ### After writing — offer to test, don't wait passively
78817
+
78818
+ If the user hasn't already told you to run/test/preview the script, offer it as a one-sentence next step (e.g. "Want me to run \`wmill script preview\` with sample args?"). Do not present a multi-option menu.
78819
+
78820
+ If the user already asked to test/run/try the script in their original request, skip the offer and just execute \`wmill script preview <path> -d '<args>'\` directly — pick plausible args from the script's declared parameters. The shape varies by language: \`main(...)\` for code languages, the SQL dialect's own placeholder syntax (\`$1\` for PostgreSQL, \`?\` for MySQL/Snowflake, \`@P1\` for MSSQL, \`@name\` for BigQuery, etc.), positional \`$1\`, \`$2\`, … for Bash, \`param(...)\` for PowerShell.
78821
+
78822
+ \`wmill script preview\` does not deploy, but it still executes script code and may cause side effects; run it yourself when the user asked to test/preview (or after confirming that execution is intended). \`wmill generate-metadata\` does not deploy either — it only writes local files (locks, schemas, hashes) — but offer it before running (or run automatically if the project's \`AGENTS.md\` opts in), per "Keep metadata in sync" above. Only \`wmill sync push\` deploys to the workspace — run it only when the user explicitly asks to deploy/publish/push.
78823
+
78824
+ For a **visual** open-the-script-in-the-dev-page preview (rather than \`script preview\`'s run-and-print-result), use the \`preview\` skill.
78825
+
78826
+ Use \`wmill resource-type list --schema\` to discover available resource types.
78827
+
78828
+ # Ansible
78829
+
78830
+ Windmill runs Ansible playbooks with \`ansible-playbook\`. A script is a single YAML
78831
+ document made of two parts separated by a \`---\` line: a Windmill **header** and one or
78832
+ more standard Ansible **plays**.
78833
+
78834
+ ## Structure
78835
+
78836
+ \`\`\`yaml
78837
+ ---
78838
+ # Windmill header: configures inventories, file resources, arguments and dependencies
78839
+ extra_vars:
78840
+ world_qualifier:
78841
+ type: string
78842
+ dependencies:
78843
+ galaxy:
78844
+ collections:
78845
+ - name: community.general
78846
+ python:
78847
+ - jmespath
78848
+ ---
78849
+ # Standard Ansible plays
78850
+ - name: Echo
78851
+ hosts: 127.0.0.1
78852
+ connection: local
78853
+ tasks:
78854
+ - name: Print debug message
78855
+ debug:
78856
+ msg: "Hello, {{ world_qualifier }} world!"
78857
+ \`\`\`
78858
+
78859
+ ## Header
78860
+
78861
+ The header is **not** standard Ansible — it is parsed by Windmill to build the script's
78862
+ inputs and runtime environment. Supported keys:
78863
+
78864
+ - \`extra_vars\`: defines the script arguments. Each entry is passed to the playbook via
78865
+ \`--extra-vars\` and becomes a Jinja variable usable as \`{{ name }}\` in the plays. Give
78866
+ each argument a \`type\` (\`string\`, \`number\`, \`boolean\`, \`object\`, ...) so Windmill can
78867
+ generate the input form.
78868
+ - \`inventory\`: lists inventories. Use \`resource_type: ansible_inventory\` (optionally
78869
+ pinned with \`resource: u/user/your_resource\`) or \`resource_type: dynamic_inventory\`.
78870
+ - \`files\`: writes Windmill resources/variables to files before the run, e.g.
78871
+ \`- resource: u/user/template\` with \`target: ./config.j2\`, or
78872
+ \`- variable: u/user/ssh_key\` with \`target: ./ssh_key\` and \`mode: '0600'\`.
78873
+ - \`dependencies\`: \`galaxy\` collections/roles (installed with \`ansible-galaxy\`) and
78874
+ \`python\` pip packages available to the playbook.
78875
+ - \`options\`: extra \`ansible-playbook\` flags such as \`- verbosity: vvv\`.
78876
+ - \`vault_password\`: a Windmill variable path to use as the Ansible Vault password.
78877
+
78878
+ ## Arguments
78879
+
78880
+ Reference header \`extra_vars\` directly as Jinja variables in the plays:
78881
+
78882
+ \`\`\`yaml
78883
+ extra_vars:
78884
+ name:
78885
+ type: string
78886
+ count:
78887
+ type: number
78888
+ ---
78889
+ - hosts: localhost
78890
+ tasks:
78891
+ - debug:
78892
+ msg: "{{ name }} x {{ count }}"
78893
+ \`\`\`
78894
+
78895
+ ## Environment variables
78896
+
78897
+ Windmill contextual variables are available as environment variables and read with the
78898
+ \`env\` lookup:
78899
+
78900
+ \`\`\`yaml
78901
+ - debug:
78902
+ msg: "Running in workspace {{ lookup('env', 'WM_WORKSPACE') }}"
78903
+ \`\`\`
78904
+
78905
+ ## Output
78906
+
78907
+ To return a result, write JSON to a \`result.json\` file in the job directory:
78908
+
78909
+ \`\`\`yaml
78910
+ - hosts: localhost
78911
+ tasks:
78912
+ - name: Write result
78913
+ copy:
78914
+ content: "{{ { 'ok': true, 'value': 42 } | to_json }}"
78915
+ dest: result.json
78916
+ \`\`\`
78917
+ `,
78777
78918
  "write-script-bash": `---
78778
78919
  name: write-script-bash
78779
78920
  description: MUST use when writing Bash scripts.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.730.0",
3
+ "version": "1.732.0",
4
4
  "description": "CLI for Windmill",
5
5
  "license": "Apache 2.0",
6
6
  "type": "module",