@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.
- package/dist/bin/mesh.js +11663 -10745
- package/dist/bin/mesh.js.map +4 -4
- package/dist/build-info.json +2 -2
- package/dist/src/commands/agent-api-client.d.ts +17 -0
- package/dist/src/commands/agent-api-client.d.ts.map +1 -1
- package/dist/src/commands/agent-api-client.js +22 -0
- package/dist/src/commands/agent-api-client.js.map +1 -1
- package/dist/src/commands/app-check.d.ts +97 -0
- package/dist/src/commands/app-check.d.ts.map +1 -0
- package/dist/src/commands/app-check.js +502 -0
- package/dist/src/commands/app-check.js.map +1 -0
- package/dist/src/commands/create-app.d.ts +24 -0
- package/dist/src/commands/create-app.d.ts.map +1 -1
- package/dist/src/commands/create-app.js +27 -1
- package/dist/src/commands/create-app.js.map +1 -1
- package/dist/src/commands/dev-doctor.d.ts +28 -12
- package/dist/src/commands/dev-doctor.d.ts.map +1 -1
- package/dist/src/commands/dev-doctor.js +16 -7
- package/dist/src/commands/dev-doctor.js.map +1 -1
- package/dist/src/commands/dev.d.ts +22 -0
- package/dist/src/commands/dev.d.ts.map +1 -1
- package/dist/src/commands/dev.js +124 -9
- package/dist/src/commands/dev.js.map +1 -1
- package/dist/src/commands/local/docker-runner.d.ts.map +1 -1
- package/dist/src/commands/local/docker-runner.js +2 -4
- package/dist/src/commands/local/docker-runner.js.map +1 -1
- package/dist/src/commands/local/hub-local.d.ts.map +1 -1
- package/dist/src/commands/local/hub-local.js +2 -3
- package/dist/src/commands/local/hub-local.js.map +1 -1
- package/dist/src/commands/local/seed-zitadel.d.ts.map +1 -1
- package/dist/src/commands/local/seed-zitadel.js +108 -109
- package/dist/src/commands/local/seed-zitadel.js.map +1 -1
- package/dist/src/commands/local/stack.d.ts.map +1 -1
- package/dist/src/commands/local/stack.js +4 -9
- package/dist/src/commands/local/stack.js.map +1 -1
- package/dist/src/commands/site.d.ts +3 -0
- package/dist/src/commands/site.d.ts.map +1 -0
- package/dist/src/commands/site.js +277 -0
- package/dist/src/commands/site.js.map +1 -0
- package/dist/src/commands/temporal.d.ts +25 -0
- package/dist/src/commands/temporal.d.ts.map +1 -1
- package/dist/src/commands/temporal.js +2459 -732
- package/dist/src/commands/temporal.js.map +7 -1
- package/dist/src/commands/vcs/clone.d.ts.map +1 -1
- package/dist/src/commands/vcs/clone.js +4 -4
- package/dist/src/commands/vcs/clone.js.map +1 -1
- package/dist/src/commands/vcs/common.d.ts +34 -0
- package/dist/src/commands/vcs/common.d.ts.map +1 -1
- package/dist/src/commands/vcs/common.js +52 -0
- package/dist/src/commands/vcs/common.js.map +1 -1
- package/dist/src/commands/vcs/index.d.ts.map +1 -1
- package/dist/src/commands/vcs/index.js +7 -1
- package/dist/src/commands/vcs/index.js.map +1 -1
- package/dist/src/commands/vcs/propose.d.ts +22 -0
- package/dist/src/commands/vcs/propose.d.ts.map +1 -1
- package/dist/src/commands/vcs/propose.js +25 -5
- package/dist/src/commands/vcs/propose.js.map +1 -1
- package/dist/src/commands/vcs/rm.d.ts +18 -0
- package/dist/src/commands/vcs/rm.d.ts.map +1 -0
- package/dist/src/commands/vcs/rm.js +88 -0
- package/dist/src/commands/vcs/rm.js.map +1 -0
- package/dist/src/program.d.ts.map +1 -1
- package/dist/src/program.js +4 -0
- package/dist/src/program.js.map +1 -1
- package/dist/src/utils/aws-auth.d.ts +10 -0
- package/dist/src/utils/aws-auth.d.ts.map +1 -1
- package/dist/src/utils/aws-auth.js +35 -0
- package/dist/src/utils/aws-auth.js.map +1 -1
- package/dist/src/utils/cache-home.d.ts +25 -0
- package/dist/src/utils/cache-home.d.ts.map +1 -0
- package/dist/src/utils/cache-home.js +36 -0
- package/dist/src/utils/cache-home.js.map +1 -0
- package/dist/src/utils/temporal-codec.js +207 -294
- package/dist/src/utils/temporal-codec.js.map +7 -1
- package/fragments/base/index.ts.hbs +1 -1
- package/fragments/service/api/package.json.hbs +1 -0
- package/fragments/service/api/src/index.ts.hbs +6 -1
- package/fragments/temporal/worker/package.json.hbs +1 -0
- package/fragments/temporal/worker/src/activities.ts.hbs +6 -5
- package/fragments/temporal/worker/src/worker.ts.hbs +7 -1
- package/package.json +12 -3
- package/skills/core/SKILL.md +15 -3
- package/templates/api-auth/AGENTS.md.hbs +6 -0
- package/templates/api-auth/README.md.hbs +17 -8
- package/templates/api-auth/api/package.json.hbs +2 -1
- package/templates/api-auth/api/{src → scripts}/seed-authz.ts.hbs +3 -3
- package/templates/api-auth/api/src/index.ts.hbs +20 -9
- package/templates/api-auth/index.ts.hbs +79 -25
- package/templates/api-auth/package.json.hbs +2 -0
- package/templates/api-role-gating/api/package.json.hbs +1 -0
- package/templates/api-role-gating/api/src/main.ts.hbs +6 -1
- package/templates/api-role-gating/index.ts.hbs +1 -1
- package/templates/api-role-gating/package.json.hbs +1 -0
- package/templates/external-service/api/package.json.hbs +2 -0
- package/templates/external-service/api/src/index.ts.hbs +7 -2
- package/templates/external-service/index.ts.hbs +1 -1
- package/templates/external-service/package.json.hbs +1 -0
- package/templates/workflow/api/package.json.hbs +1 -0
- package/templates/workflow/api/src/index.ts.hbs +10 -5
- package/templates/workflow/index.ts.hbs +1 -1
- package/templates/workflow/package.json.hbs +1 -0
- package/templates/workflow/worker/package.json.hbs +1 -0
- package/templates/workflow/worker/src/activities.ts.hbs +7 -3
- package/templates/workflow/worker/src/encryption-codec.ts +3 -2
- package/templates/workflow/worker/src/worker.ts.hbs +7 -1
- package/templates/workflow/worker/src/workflows.ts.hbs +3 -3
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
129
|
+
log.info({ port: PORT }, "{{titleCase name}} API listening");
|
|
125
130
|
});
|
|
126
131
|
})
|
|
127
132
|
.catch((err) => {
|
|
128
|
-
|
|
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);
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
152
|
+
logger.warn("No TEMPORAL_ENCODING_KEY set, payloads will not be encrypted");
|
|
152
153
|
return undefined;
|
|
153
154
|
}
|
|
154
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
54
|
+
log.info("Task completed", { taskId, result });
|
|
55
55
|
|
|
56
56
|
return {
|
|
57
57
|
status: result,
|