@mesh-tech/mesh-cli 0.16.0 → 0.18.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 (81) hide show
  1. package/dist/bin/mesh.js +1724 -925
  2. package/dist/bin/mesh.js.map +4 -4
  3. package/dist/build-info.json +2 -2
  4. package/dist/src/commands/agent-api-client.d.ts +17 -0
  5. package/dist/src/commands/agent-api-client.d.ts.map +1 -1
  6. package/dist/src/commands/agent-api-client.js +22 -0
  7. package/dist/src/commands/agent-api-client.js.map +1 -1
  8. package/dist/src/commands/dev-doctor.d.ts.map +1 -1
  9. package/dist/src/commands/dev-doctor.js +7 -2
  10. package/dist/src/commands/dev-doctor.js.map +1 -1
  11. package/dist/src/commands/dev.d.ts +22 -0
  12. package/dist/src/commands/dev.d.ts.map +1 -1
  13. package/dist/src/commands/dev.js +124 -9
  14. package/dist/src/commands/dev.js.map +1 -1
  15. package/dist/src/commands/local/docker-runner.d.ts.map +1 -1
  16. package/dist/src/commands/local/docker-runner.js +2 -4
  17. package/dist/src/commands/local/docker-runner.js.map +1 -1
  18. package/dist/src/commands/local/hub-local.d.ts.map +1 -1
  19. package/dist/src/commands/local/hub-local.js +2 -3
  20. package/dist/src/commands/local/hub-local.js.map +1 -1
  21. package/dist/src/commands/local/seed-zitadel.d.ts.map +1 -1
  22. package/dist/src/commands/local/seed-zitadel.js +108 -109
  23. package/dist/src/commands/local/seed-zitadel.js.map +1 -1
  24. package/dist/src/commands/local/stack.d.ts.map +1 -1
  25. package/dist/src/commands/local/stack.js +4 -9
  26. package/dist/src/commands/local/stack.js.map +1 -1
  27. package/dist/src/commands/site.d.ts +3 -0
  28. package/dist/src/commands/site.d.ts.map +1 -0
  29. package/dist/src/commands/site.js +277 -0
  30. package/dist/src/commands/site.js.map +1 -0
  31. package/dist/src/commands/temporal.d.ts +25 -0
  32. package/dist/src/commands/temporal.d.ts.map +1 -1
  33. package/dist/src/commands/temporal.js +2459 -732
  34. package/dist/src/commands/temporal.js.map +7 -1
  35. package/dist/src/commands/vcs/clone.d.ts.map +1 -1
  36. package/dist/src/commands/vcs/clone.js +4 -4
  37. package/dist/src/commands/vcs/clone.js.map +1 -1
  38. package/dist/src/commands/vcs/common.d.ts +34 -0
  39. package/dist/src/commands/vcs/common.d.ts.map +1 -1
  40. package/dist/src/commands/vcs/common.js +52 -0
  41. package/dist/src/commands/vcs/common.js.map +1 -1
  42. package/dist/src/commands/vcs/index.d.ts.map +1 -1
  43. package/dist/src/commands/vcs/index.js +7 -1
  44. package/dist/src/commands/vcs/index.js.map +1 -1
  45. package/dist/src/commands/vcs/propose.d.ts +22 -0
  46. package/dist/src/commands/vcs/propose.d.ts.map +1 -1
  47. package/dist/src/commands/vcs/propose.js +25 -5
  48. package/dist/src/commands/vcs/propose.js.map +1 -1
  49. package/dist/src/commands/vcs/rm.d.ts +18 -0
  50. package/dist/src/commands/vcs/rm.d.ts.map +1 -0
  51. package/dist/src/commands/vcs/rm.js +88 -0
  52. package/dist/src/commands/vcs/rm.js.map +1 -0
  53. package/dist/src/commands/workflow.d.ts.map +1 -1
  54. package/dist/src/commands/workflow.js +26 -9
  55. package/dist/src/commands/workflow.js.map +1 -1
  56. package/dist/src/program.d.ts.map +1 -1
  57. package/dist/src/program.js +2 -0
  58. package/dist/src/program.js.map +1 -1
  59. package/dist/src/utils/aws-auth.d.ts +10 -0
  60. package/dist/src/utils/aws-auth.d.ts.map +1 -1
  61. package/dist/src/utils/aws-auth.js +35 -0
  62. package/dist/src/utils/aws-auth.js.map +1 -1
  63. package/dist/src/utils/cache-home.d.ts +25 -0
  64. package/dist/src/utils/cache-home.d.ts.map +1 -0
  65. package/dist/src/utils/cache-home.js +36 -0
  66. package/dist/src/utils/cache-home.js.map +1 -0
  67. package/dist/src/utils/temporal-codec.js +207 -294
  68. package/dist/src/utils/temporal-codec.js.map +7 -1
  69. package/fragments/base/index.ts.hbs +1 -1
  70. package/package.json +12 -3
  71. package/skills/core/SKILL.md +14 -4
  72. package/templates/api-auth/README.md.hbs +6 -0
  73. package/templates/api-auth/index.ts.hbs +1 -1
  74. package/templates/api-auth/package.json.hbs +1 -0
  75. package/templates/api-role-gating/index.ts.hbs +1 -1
  76. package/templates/api-role-gating/package.json.hbs +1 -0
  77. package/templates/external-service/api/package.json.hbs +1 -0
  78. package/templates/external-service/index.ts.hbs +1 -1
  79. package/templates/external-service/package.json.hbs +1 -0
  80. package/templates/workflow/index.ts.hbs +1 -1
  81. package/templates/workflow/package.json.hbs +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mesh-tech/mesh-cli",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "CLI for Mesh platform development utilities",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -30,11 +30,19 @@
30
30
  "types": "./dist/src/index.d.ts",
31
31
  "default": "./dist/src/index.js"
32
32
  },
33
+ "./temporal": {
34
+ "types": "./dist/src/commands/temporal.d.ts",
35
+ "default": "./dist/src/commands/temporal.js"
36
+ },
37
+ "./temporal-codec": {
38
+ "types": "./dist/src/utils/temporal-codec.d.ts",
39
+ "default": "./dist/src/utils/temporal-codec.js"
40
+ },
33
41
  "./package.json": "./package.json"
34
42
  },
35
43
  "devDependencies": {
36
- "@mesh-tech/tsconfig": "1.53.1",
37
- "@mesh-tech/workflow-viz": "0.2.1",
44
+ "@mesh-tech/tsconfig": "2.0.1",
45
+ "@mesh-tech/workflow-viz": "0.3.0",
38
46
  "@tanstack/intent": "^0.3.6",
39
47
  "@types/node": "^20.0.0",
40
48
  "tsx": "^4.20.4"
@@ -48,6 +56,7 @@
48
56
  "@inquirer/input": "^4.2.1",
49
57
  "@inquirer/password": "^4.0.17",
50
58
  "@inquirer/select": "^4.3.1",
59
+ "@mesh-tech/agent-contracts": "0.2.0",
51
60
  "@mesh-tech/secrets": "0.1.0",
52
61
  "chalk": "^5.3.0",
53
62
  "commander": "^12.1.0",
@@ -20,8 +20,9 @@ metadata:
20
20
 
21
21
  # `@mesh-tech/mesh-cli`
22
22
 
23
- Developer CLI for Mesh Platform. Binary name is **`mesh`**. Installed standalone or
24
- transitively via the app-kit bundle.
23
+ Developer CLI for Mesh Platform. Binary name is **`mesh`**. Install it explicitly —
24
+ `@mesh-tech/app-kit` ships a `mesh` bin shim onto it but declares it an **optional
25
+ peer**, so it is never installed transitively.
25
26
 
26
27
  ## Running it (MESH-2261)
27
28
 
@@ -107,7 +108,9 @@ Top-level commands (each `register*` is wired in `src/program.ts`, which `bin/me
107
108
  | `mesh artifacts` | `get <ref>` | Download workflow artifact files from an AI-agent conversation. Ref `<conversationId>:<artifactId>` (artifactId defaults to `workflow-artifact`). | `-o/--output <dir>`, `--target <name>`, `--api-url <url>`, `--context <ctx>` (default `mesh.dev`) |
108
109
  | `mesh conversations` (alias `conv`) | `list`, `show <id>`, `artifacts <id>` | Read a deployed Mesh agent's conversations: list the caller's conversations, render a transcript, or list a conversation's artifacts. Resolves against the same `agent-targets` registry the MCP `agent_*` tools use. | all three: `--target <name>`, `--api-url <url>` (overrides `--target`), `--context <ctx>` (used with `--api-url`, default `mesh.dev`), `--json` (default when stdout isn't a TTY) |
109
110
  | `mesh vpn` | `connect <context>`, `disconnect`, `status`, `tunnel <up\|down\|status>`, `api-key`, `pre-auth-key`, `users` | Headscale VPN mgmt via Tailscale + kubectl. **`connect` now defaults to the userspace `tailscaled`** (brew formula, NOT the GUI Tailscale.app) — the same daemon `mesh dev --transport tailscale` / `mesh vpn tunnel` use, so it **runs headless / under the sandbox** and exposes a local SOCKS5 proxy (route a tool via `ALL_PROXY=socks5://127.0.0.1:<port>`). It relays a one-time browser-register URL for Zitadel auth. `--system` opts into the whole-machine GUI Tailscale.app (system TUN) — needs the app installed and **cannot run headless/sandboxed** (Sparkle.framework abort). For auto-forwarded VPC services (Temporal/RDS) prefer **`mesh vpn tunnel up`** or `mesh dev`. `tunnel status` reports runner **ownership** (`Runner: owned (verified)` vs `NOT OWNED (<reason>)` — a port answering a dial is not proof it's mesh's, MESH-2407); `--json` adds `owned` (bool) + `ownership` (reason string). Admin subcommands `exec` into the `headscale-0` pod. | root: `-t/--tenant` (default `mesh`), `-e/--env` (default `dev`), `-n/--namespace`; `connect`/`disconnect`: `--system`; `tunnel up`: `--context <ctx>`; `tunnel down`: `--stop` (stop daemon, keep login), `--logout`; `tunnel status`: `--json`; `pre-auth-key`: `-u/--user` (**required**), `--expiration <24h>`, `--reusable`, `--ephemeral` |
110
- | `mesh workflow` | `extract-ir <path>` | Parse Temporal workflow TS source → WorkflowIR graph (nodes+edges). Prints JSON or uploads to S3. | `--app <name>`, `--upload <bucket>` (both required together for S3) |
111
+ | `mesh workflow` | `extract-ir <path>`, `inventory <path>`, `lint-process <path>` | `extract-ir`: parse Temporal workflow TS source → WorkflowIR graph (nodes+edges); prints JSON or uploads to S3. `inventory`: the as-built `{workflowType, commands, queries, activities}` the process lint diffs against. `lint-process`: parse + conformance-lint a process artifact against that inventory; exits 1 on any error-severity finding. | `extract-ir`: `--app <name>`, `--upload <bucket>` (both required together for S3); `extract-ir`/`lint-process`: `--process <path>` (else a sibling `process/*.process.json` is discovered); `lint-process`: `--predicates <csv>`, `--selectors <csv>` — the CLI cannot execute the worker's registries, so without a flag those findings are skipped (a note is printed) while every other rule still runs |
112
+ | `mesh site` | `publish <name> <dir>`, `versions <name>`, `rollback <name> <version>` | Publish a built directory as an OAuth-protected static site served by Studio, content-addressed and incremental: `publish` walks and hashes the tree, uploads only the blobs the site does not already hold, then commits a version and points the site at it; `versions` lists what has been published, newest first; `rollback` points the site back at an earlier version. Three stateless calls against the agent-api, so a run that dies partway leaves nothing to clean up. | all: `--target <name>`, `--api-url <url>`, `--context <ctx>`; `publish`: `--version-id <id>`, `--no-activate` (publish without pointing the site at it) |
113
+ | `mesh vcs` | `clone <repo> [dest]`, `get <repo> <path>`, `propose`, `rm <repo> <paths...>`, `proposals`/`show`/`diff`/`approve`/`reject`/`comment`/`request-changes`, `drafts <list\|show\|create\|submit\|discard>` | Versioned content repos (`mesh.vcs`). Repos are real git repos over smart HTTP but **read-only** — every change goes through a proposal. `clone` wires the bearer auth header into the clone; `propose` submits the working tree (binary content is base64-encoded from the bytes, not the extension, so images survive intact); **`rm` proposes deletions of files or folders with no clone at all**, and `--dry-run` lists what would go without proposing anything. | all: `--url <base>`, `--token <t>`, `--context <ctx>`; `propose`: `-m/--message`, `--revise <id>`, `--merge-parent <sha>`; `rm`: `-m/--message`, `--dry-run` |
111
114
  | `mesh temporal` | `describe <wfId> [runId]`, `history <wfId> [runId]`, `recover-conversation <wfId> [runId]`, `capture-history <wfId> [runId]` | Inspect Temporal workflows for the current app/stack; reconstruct an agent conversation transcript from durable history when the worker can't replay it; capture a full history to a local replay fixture. | shared: `--stack`, `--address`, `--namespace`; `history`: `-n/--limit <200>`, `-f/--follow`, `--no-compact`, `-p/--show-payloads` (decrypts via `TEMPORAL_ENCODING_KEY` from the K8s secret); `recover-conversation`: `--out <path>`, `--json`, `--snapshot` (structured `{conversationId,messages,artifacts,focus}` blob); `capture-history`: `--out <path>` (default `~/.mesh/replay-histories/<wfId>.json`, do not commit) | <!-- skill-lint-disable-next-line — row documents the mesh-owned kubectl wrappers; the backticked `aws eks get-token` describes what the CLI runs internally, not an operator step -->
112
115
  | `mesh kubectl` / `mesh logs` / `mesh exec` | `kubectl [args…]`, `logs [service\|deployment/x\|k=v]`, `exec <service> -- <cmd>` | Cluster access for a **deployed** app — debug CrashLoops/logs without broader creds. Assumes the app's `mesh:deployerRole`, builds a session kubeconfig from the platform `eks` SSM export (`aws eks get-token` — no `eks:DescribeCluster` / `~/.kube/config` needed), shells out to kubectl. Defaults the namespace to the app's own (deployer RBAC is tenant-namespace-scoped). **Use `--stack <name>` to target the deployed stack (e.g. `dev`, not `dev-local`).** | `--stack <name>`; `logs`: `-f/--follow`, `--tail <200>`, `-c/--container`, `--previous`; `exec`: `-c/--container` |
113
116
 
@@ -305,6 +308,13 @@ MCP `agent_*` tools use; see the dedicated
305
308
  (registry format, auth model, the `conversation_unavailable` → `mesh temporal
306
309
  recover-conversation` break-glass path, and the MCP-vs-CLI relationship).
307
310
 
311
+ ### 7b. Workspace environments are driven from mesh-studio
312
+
313
+ A Studio workspace's environment (live container, grace, build queue) is read and signalled
314
+ by `studio workspace status|restart|reseed|rebuild` from mesh-studio's `@mesh-tech/studio-cli`,
315
+ which builds on this package's `@mesh-tech/mesh-cli/temporal` (`connect`) and
316
+ `@mesh-tech/mesh-cli/temporal-codec` exports. This CLI has no `workspace` command.
317
+
308
318
  ### 8. Relaunch safety — don't strand live conversations
309
319
 
310
320
  For a **code-only** change, prefer a scoped `mesh dev restart <service>` over a full
@@ -375,5 +385,5 @@ pulumi, vpn, and log helpers.
375
385
 
376
386
  ## See also
377
387
 
378
- - `@mesh-tech/app-kit#core` — app-kit bundles this CLI; consumers usually invoke it as `pnpm mesh <cmd>`
388
+ - `@mesh-tech/app-kit#core` — app-kit's `mesh` bin is a shim onto this CLI, which is an **optional peer**: declare `@mesh-tech/mesh-cli` in your repo root's devDependencies. Consumers then invoke it as `pnpm mesh <cmd>`
379
389
  - `@mesh-tech/credentials#core` — credential resolution the auth/deploy flows build on
@@ -52,6 +52,12 @@ mesh login {{tenant}}.dev
52
52
  mesh deploy up --yes
53
53
  ```
54
54
 
55
+ A browser-facing Service you add later signs people in through the platform
56
+ proxy (`auth: { provider: "mesh" }`). The proxy pins its sign-in callback to
57
+ that Service's own ingress hostname; a Service that answers for more than one
58
+ hostname (`ingress.extraHostnames`) sets `auth.deriveRedirectUrl: true` so each
59
+ host gets its own callback, and registers a redirect URI per host at the IdP.
60
+
55
61
  `index.ts` owns the whole access surface, so there is nothing to create by
56
62
  hand: `ZitadelAppIdentity` makes the app's Zitadel project + roles,
57
63
  `SpiceDBSchema` compiles `api/src/schema.ts` into the app's own SpiceDB and
@@ -26,7 +26,7 @@
26
26
  */
27
27
 
28
28
  import * as pulumi from "@pulumi/pulumi";
29
- import { mesh } from "@mesh-tech/app-kit";
29
+ import { mesh } from "@mesh-tech/app-kit/infra";
30
30
  import { compileOpsHubMetadata, compileSpiceDBSchema } from "@mesh-tech/authz";
31
31
  // The authz schema is the single source of truth, shared by the api (enforces
32
32
  // it) and this Pulumi program (compiles it to SpiceDB + ops-hub metadata + roles).
@@ -12,6 +12,7 @@
12
12
  "dependencies": {
13
13
  "@mesh-tech/app-kit": "latest",
14
14
  "@mesh-tech/authz": "latest",
15
+ "@mesh-tech/infra-components": "latest",
15
16
  "@pulumi/pulumi": "^3.214.1"
16
17
  },
17
18
  "devDependencies": {
@@ -24,7 +24,7 @@
24
24
  * Deploy: mesh deploy up
25
25
  */
26
26
  import * as pulumi from "@pulumi/pulumi";
27
- import { mesh } from "@mesh-tech/app-kit";
27
+ import { mesh } from "@mesh-tech/app-kit/infra";
28
28
  import { compileOpsHubMetadata } from "@mesh-tech/authz";
29
29
  import type { OpsHubMetadata } from "@mesh-tech/authz";
30
30
  // The authz schema is the single source of truth, shared by the api (enforces
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@mesh-tech/app-kit": "latest",
14
+ "@mesh-tech/infra-components": "latest",
14
15
  "@mesh-tech/authz": "latest",
15
16
  "@pulumi/pulumi": "^3.214.1"
16
17
  },
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@mesh-tech/app-kit": "latest",
14
+ "@mesh-tech/secrets": "latest",
14
15
  "@opentelemetry/auto-instrumentations-node": "^0.78.0",
15
16
  "@mesh-tech/http-client": "latest",
16
17
  "@mesh-tech/logger": "latest",
@@ -16,7 +16,7 @@
16
16
  import * as pulumi from "@pulumi/pulumi";
17
17
  import * as path from "node:path";
18
18
  import { fileURLToPath } from "node:url";
19
- import { mesh } from "@mesh-tech/app-kit";
19
+ import { mesh } from "@mesh-tech/app-kit/infra";
20
20
 
21
21
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
22
22
  const { tenant, platform, stack, deploy } = mesh.apps.getConfig(pulumi);
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@mesh-tech/app-kit": "latest",
14
+ "@mesh-tech/infra-components": "latest",
14
15
  "@pulumi/pulumi": "^3.214.1"
15
16
  },
16
17
  "devDependencies": {
@@ -10,7 +10,7 @@
10
10
  import * as pulumi from "@pulumi/pulumi";
11
11
  import * as path from "node:path";
12
12
  import { fileURLToPath } from "node:url";
13
- import { mesh } from "@mesh-tech/app-kit";
13
+ import { mesh } from "@mesh-tech/app-kit/infra";
14
14
 
15
15
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
16
16
  const { tenant, platform, stack, deploy } = mesh.apps.getConfig(pulumi);
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@mesh-tech/app-kit": "latest",
14
+ "@mesh-tech/infra-components": "latest",
14
15
  "@pulumi/pulumi": "^3.214.1"
15
16
  },
16
17
  "devDependencies": {