@mesh-tech/mesh-cli 0.15.0 → 0.17.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 (106) hide show
  1. package/dist/bin/mesh.js +11663 -10745
  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/app-check.d.ts +97 -0
  9. package/dist/src/commands/app-check.d.ts.map +1 -0
  10. package/dist/src/commands/app-check.js +502 -0
  11. package/dist/src/commands/app-check.js.map +1 -0
  12. package/dist/src/commands/create-app.d.ts +24 -0
  13. package/dist/src/commands/create-app.d.ts.map +1 -1
  14. package/dist/src/commands/create-app.js +27 -1
  15. package/dist/src/commands/create-app.js.map +1 -1
  16. package/dist/src/commands/dev-doctor.d.ts +28 -12
  17. package/dist/src/commands/dev-doctor.d.ts.map +1 -1
  18. package/dist/src/commands/dev-doctor.js +16 -7
  19. package/dist/src/commands/dev-doctor.js.map +1 -1
  20. package/dist/src/commands/dev.d.ts +22 -0
  21. package/dist/src/commands/dev.d.ts.map +1 -1
  22. package/dist/src/commands/dev.js +124 -9
  23. package/dist/src/commands/dev.js.map +1 -1
  24. package/dist/src/commands/local/docker-runner.d.ts.map +1 -1
  25. package/dist/src/commands/local/docker-runner.js +2 -4
  26. package/dist/src/commands/local/docker-runner.js.map +1 -1
  27. package/dist/src/commands/local/hub-local.d.ts.map +1 -1
  28. package/dist/src/commands/local/hub-local.js +2 -3
  29. package/dist/src/commands/local/hub-local.js.map +1 -1
  30. package/dist/src/commands/local/seed-zitadel.d.ts.map +1 -1
  31. package/dist/src/commands/local/seed-zitadel.js +108 -109
  32. package/dist/src/commands/local/seed-zitadel.js.map +1 -1
  33. package/dist/src/commands/local/stack.d.ts.map +1 -1
  34. package/dist/src/commands/local/stack.js +4 -9
  35. package/dist/src/commands/local/stack.js.map +1 -1
  36. package/dist/src/commands/site.d.ts +3 -0
  37. package/dist/src/commands/site.d.ts.map +1 -0
  38. package/dist/src/commands/site.js +277 -0
  39. package/dist/src/commands/site.js.map +1 -0
  40. package/dist/src/commands/temporal.d.ts +25 -0
  41. package/dist/src/commands/temporal.d.ts.map +1 -1
  42. package/dist/src/commands/temporal.js +2459 -732
  43. package/dist/src/commands/temporal.js.map +7 -1
  44. package/dist/src/commands/vcs/clone.d.ts.map +1 -1
  45. package/dist/src/commands/vcs/clone.js +4 -4
  46. package/dist/src/commands/vcs/clone.js.map +1 -1
  47. package/dist/src/commands/vcs/common.d.ts +34 -0
  48. package/dist/src/commands/vcs/common.d.ts.map +1 -1
  49. package/dist/src/commands/vcs/common.js +52 -0
  50. package/dist/src/commands/vcs/common.js.map +1 -1
  51. package/dist/src/commands/vcs/index.d.ts.map +1 -1
  52. package/dist/src/commands/vcs/index.js +7 -1
  53. package/dist/src/commands/vcs/index.js.map +1 -1
  54. package/dist/src/commands/vcs/propose.d.ts +22 -0
  55. package/dist/src/commands/vcs/propose.d.ts.map +1 -1
  56. package/dist/src/commands/vcs/propose.js +25 -5
  57. package/dist/src/commands/vcs/propose.js.map +1 -1
  58. package/dist/src/commands/vcs/rm.d.ts +18 -0
  59. package/dist/src/commands/vcs/rm.d.ts.map +1 -0
  60. package/dist/src/commands/vcs/rm.js +88 -0
  61. package/dist/src/commands/vcs/rm.js.map +1 -0
  62. package/dist/src/program.d.ts.map +1 -1
  63. package/dist/src/program.js +4 -0
  64. package/dist/src/program.js.map +1 -1
  65. package/dist/src/utils/aws-auth.d.ts +10 -0
  66. package/dist/src/utils/aws-auth.d.ts.map +1 -1
  67. package/dist/src/utils/aws-auth.js +35 -0
  68. package/dist/src/utils/aws-auth.js.map +1 -1
  69. package/dist/src/utils/cache-home.d.ts +25 -0
  70. package/dist/src/utils/cache-home.d.ts.map +1 -0
  71. package/dist/src/utils/cache-home.js +36 -0
  72. package/dist/src/utils/cache-home.js.map +1 -0
  73. package/dist/src/utils/temporal-codec.js +207 -294
  74. package/dist/src/utils/temporal-codec.js.map +7 -1
  75. package/fragments/base/index.ts.hbs +1 -1
  76. package/fragments/service/api/package.json.hbs +1 -0
  77. package/fragments/service/api/src/index.ts.hbs +6 -1
  78. package/fragments/temporal/worker/package.json.hbs +1 -0
  79. package/fragments/temporal/worker/src/activities.ts.hbs +6 -5
  80. package/fragments/temporal/worker/src/worker.ts.hbs +7 -1
  81. package/package.json +12 -3
  82. package/skills/core/SKILL.md +15 -3
  83. package/templates/api-auth/AGENTS.md.hbs +6 -0
  84. package/templates/api-auth/README.md.hbs +17 -8
  85. package/templates/api-auth/api/package.json.hbs +2 -1
  86. package/templates/api-auth/api/{src → scripts}/seed-authz.ts.hbs +3 -3
  87. package/templates/api-auth/api/src/index.ts.hbs +20 -9
  88. package/templates/api-auth/index.ts.hbs +79 -25
  89. package/templates/api-auth/package.json.hbs +2 -0
  90. package/templates/api-role-gating/api/package.json.hbs +1 -0
  91. package/templates/api-role-gating/api/src/main.ts.hbs +6 -1
  92. package/templates/api-role-gating/index.ts.hbs +1 -1
  93. package/templates/api-role-gating/package.json.hbs +1 -0
  94. package/templates/external-service/api/package.json.hbs +2 -0
  95. package/templates/external-service/api/src/index.ts.hbs +7 -2
  96. package/templates/external-service/index.ts.hbs +1 -1
  97. package/templates/external-service/package.json.hbs +1 -0
  98. package/templates/workflow/api/package.json.hbs +1 -0
  99. package/templates/workflow/api/src/index.ts.hbs +10 -5
  100. package/templates/workflow/index.ts.hbs +1 -1
  101. package/templates/workflow/package.json.hbs +1 -0
  102. package/templates/workflow/worker/package.json.hbs +1 -0
  103. package/templates/workflow/worker/src/activities.ts.hbs +7 -3
  104. package/templates/workflow/worker/src/encryption-codec.ts +3 -2
  105. package/templates/workflow/worker/src/worker.ts.hbs +7 -1
  106. package/templates/workflow/worker/src/workflows.ts.hbs +3 -3
@@ -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": {
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@mesh-tech/app-kit": "latest",
14
+ "@mesh-tech/logger": "latest",
14
15
  "@opentelemetry/auto-instrumentations-node": "^0.78.0",
15
16
  "@temporalio/client": "^1.11.7",
16
17
  "hono": "^4.0.0",
@@ -12,11 +12,16 @@
12
12
  import { Hono } from "hono";
13
13
  import { serve } from "@hono/node-server";
14
14
  import { createTemporalClient, type WithClient } from "@mesh-tech/app-kit/temporal-client";
15
+ import { createLogger, requestLogger } from "@mesh-tech/logger";
15
16
 
16
17
  const PORT = parseInt(process.env.PORT ?? "3000", 10);
17
18
  const TEMPORAL_TASK_QUEUE = process.env.TEMPORAL_TASK_QUEUE ?? "{{name}}";
18
19
 
20
+ // Every service logs through @mesh-tech/logger (the Mesh app contract, gate
21
+ // 0.4): structured, masked, trace-correlated lines the Hub can search.
22
+ const log = createLogger({ service: "{{name}}-api" });
19
23
  const app = new Hono();
24
+ app.use("*", requestLogger(log));
20
25
 
21
26
  // createTemporalClient returns a withClient wrapper (auth is applied
22
27
  // per-call); with no TEMPORAL_AUTH_* env it runs unauthenticated — the
@@ -61,7 +66,7 @@ app.post("/workflows/greet", async (c) => {
61
66
  });
62
67
  return c.json({ workflowId, result });
63
68
  } catch (error) {
64
- console.error("[API] Error starting workflow:", error);
69
+ log.error({ err: error }, "Error starting workflow");
65
70
  return c.json({ error: "Failed to start workflow" }, 500);
66
71
  }
67
72
  });
@@ -92,7 +97,7 @@ app.post("/workflows/task", async (c) => {
92
97
  message: "Workflow started. Check Temporal Web UI for progress.",
93
98
  });
94
99
  } catch (error) {
95
- console.error("[API] Error starting workflow:", error);
100
+ log.error({ err: error }, "Error starting workflow");
96
101
  return c.json({ error: "Failed to start workflow" }, 500);
97
102
  }
98
103
  });
@@ -112,7 +117,7 @@ app.get("/workflows/:id", async (c) => {
112
117
  closeTime: describe.closeTime,
113
118
  });
114
119
  } catch (error) {
115
- console.error("[API] Error getting workflow:", error);
120
+ log.error({ err: error }, "Error getting workflow");
116
121
  return c.json({ error: "Failed to get workflow status" }, 500);
117
122
  }
118
123
  });
@@ -121,10 +126,10 @@ app.get("/workflows/:id", async (c) => {
121
126
  initClient()
122
127
  .then(() => {
123
128
  serve({ fetch: app.fetch, port: PORT, hostname: "0.0.0.0" }, () => {
124
- console.log(`[API] {{titleCase name}} API listening on port ${PORT}`);
129
+ log.info({ port: PORT }, "{{titleCase name}} API listening");
125
130
  });
126
131
  })
127
132
  .catch((err) => {
128
- console.error("[API] Failed to initialize:", err);
133
+ log.error({ err }, "Failed to initialize");
129
134
  process.exit(1);
130
135
  });
@@ -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": {
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@mesh-tech/app-kit": "latest",
14
+ "@mesh-tech/logger": "latest",
14
15
  "@opentelemetry/auto-instrumentations-node": "^0.78.0",
15
16
  "@temporalio/activity": "^1.11.7",
16
17
  "@temporalio/worker": "^1.11.7",
@@ -13,11 +13,15 @@
13
13
  * - Use Date.now(), Math.random(), etc.
14
14
  */
15
15
 
16
+ // `log` carries the activity context and reaches the platform logger the worker
17
+ // installs — never the console (the Mesh app contract, gate 0.4).
18
+ import { log } from "@temporalio/activity";
19
+
16
20
  /**
17
21
  * Generate a greeting message
18
22
  */
19
23
  export async function greet(name: string): Promise<string> {
20
- console.log(`[Activity] Generating greeting for ${name}`);
24
+ log.info("Generating greeting", { name });
21
25
  return `Hello, ${name}!`;
22
26
  }
23
27
 
@@ -25,7 +29,7 @@ export async function greet(name: string): Promise<string> {
25
29
  * Process a task (simulated)
26
30
  */
27
31
  export async function processTask(taskId: string): Promise<string> {
28
- console.log(`[Activity] Processing task ${taskId}`);
32
+ log.info("Processing task", { taskId });
29
33
 
30
34
  // Simulate processing time
31
35
  await new Promise((resolve) => setTimeout(resolve, 1000));
@@ -40,7 +44,7 @@ export async function sendNotification(
40
44
  userId: string,
41
45
  message: string
42
46
  ): Promise<boolean> {
43
- console.log(`[Activity] Sending notification to ${userId}: ${message}`);
47
+ log.info("Sending notification", { userId, message });
44
48
 
45
49
  // Simulate sending
46
50
  await new Promise((resolve) => setTimeout(resolve, 500));
@@ -16,6 +16,7 @@ import {
16
16
  ValueError,
17
17
  } from "@temporalio/common";
18
18
  import proto from "@temporalio/proto";
19
+ import { logger } from "@mesh-tech/logger";
19
20
 
20
21
  const { temporal } = proto;
21
22
 
@@ -148,9 +149,9 @@ export class EncryptionCodec implements PayloadCodec {
148
149
  export async function createEncryptionCodec(): Promise<EncryptionCodec | undefined> {
149
150
  const encodingKey = process.env.TEMPORAL_ENCODING_KEY;
150
151
  if (!encodingKey) {
151
- console.log("[Encryption] No TEMPORAL_ENCODING_KEY set, payloads will not be encrypted");
152
+ logger.warn("No TEMPORAL_ENCODING_KEY set, payloads will not be encrypted");
152
153
  return undefined;
153
154
  }
154
- console.log("[Encryption] Payload encryption enabled");
155
+ logger.info("Payload encryption enabled");
155
156
  return EncryptionCodec.create(encodingKey);
156
157
  }
@@ -3,8 +3,14 @@
3
3
  */
4
4
 
5
5
  import { createTemporalWorker, resolveWorkflows } from "@mesh-tech/app-kit/temporal";
6
+ import { createLogger } from "@mesh-tech/logger";
6
7
  import * as activities from "./activities.js";
7
8
 
9
+ // The worker process logs through @mesh-tech/logger (the Mesh app contract,
10
+ // gate 0.4). Activities use `log` from @temporalio/activity and workflows `log`
11
+ // from @temporalio/workflow — both route to the Runtime logger app-kit installs.
12
+ const log = createLogger({ service: "{{name}}-worker" });
13
+
8
14
  async function run() {
9
15
  const { worker, cleanup } = await createTemporalWorker({
10
16
  activities,
@@ -19,6 +25,6 @@ async function run() {
19
25
  }
20
26
 
21
27
  run().catch((err) => {
22
- console.error("Worker failed to start:", err);
28
+ log.error({ err }, "Worker failed to start");
23
29
  process.exit(1);
24
30
  });
@@ -11,7 +11,7 @@
11
11
  * - Use proxyActivities() to call activities
12
12
  */
13
13
 
14
- import { proxyActivities, sleep } from "@temporalio/workflow";
14
+ import { log, proxyActivities, sleep } from "@temporalio/workflow";
15
15
  import type * as activities from "./activities.js";
16
16
 
17
17
  // Configure activity retries and timeouts
@@ -43,7 +43,7 @@ export async function taskWorkflow(
43
43
  taskId: string,
44
44
  userId: string
45
45
  ): Promise<{ status: string; taskId: string }> {
46
- console.log(`[Workflow] Processing task ${taskId} for user ${userId}`);
46
+ log.info("Processing task", { taskId, userId });
47
47
 
48
48
  // Process the task
49
49
  const result = await processTask(taskId);
@@ -51,7 +51,7 @@ export async function taskWorkflow(
51
51
  // Wait before completing (demonstrates durable timers)
52
52
  await sleep("2 seconds");
53
53
 
54
- console.log(`[Workflow] Task ${taskId} completed with status: ${result}`);
54
+ log.info("Task completed", { taskId, result });
55
55
 
56
56
  return {
57
57
  status: result,