@mesh-tech/mesh-cli 0.18.2 → 0.20.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 (72) hide show
  1. package/README.md +111 -56
  2. package/dist/bin/mesh.js +5158 -4302
  3. package/dist/bin/mesh.js.map +4 -4
  4. package/dist/build-info.json +2 -2
  5. package/dist/src/commands/create-app.d.ts +28 -0
  6. package/dist/src/commands/create-app.d.ts.map +1 -1
  7. package/dist/src/commands/create-app.js +45 -1
  8. package/dist/src/commands/create-app.js.map +1 -1
  9. package/dist/src/commands/dev-doctor.js +2 -2
  10. package/dist/src/commands/dev-doctor.js.map +1 -1
  11. package/dist/src/commands/dev.d.ts +7 -0
  12. package/dist/src/commands/dev.d.ts.map +1 -1
  13. package/dist/src/commands/dev.js +1 -0
  14. package/dist/src/commands/dev.js.map +1 -1
  15. package/dist/src/commands/hub/index.d.ts.map +1 -1
  16. package/dist/src/commands/hub/index.js +5 -0
  17. package/dist/src/commands/hub/index.js.map +1 -1
  18. package/dist/src/commands/init/wizard.d.ts +216 -0
  19. package/dist/src/commands/init/wizard.d.ts.map +1 -0
  20. package/dist/src/commands/init/wizard.js +471 -0
  21. package/dist/src/commands/init/wizard.js.map +1 -0
  22. package/dist/src/commands/init.d.ts +14 -6
  23. package/dist/src/commands/init.d.ts.map +1 -1
  24. package/dist/src/commands/init.js +41 -15
  25. package/dist/src/commands/init.js.map +1 -1
  26. package/dist/src/commands/local/auth-provision.d.ts +4 -0
  27. package/dist/src/commands/local/auth-provision.d.ts.map +1 -1
  28. package/dist/src/commands/local/auth-provision.js +20 -0
  29. package/dist/src/commands/local/auth-provision.js.map +1 -1
  30. package/dist/src/commands/local/dev-local.d.ts +32 -0
  31. package/dist/src/commands/local/dev-local.d.ts.map +1 -1
  32. package/dist/src/commands/local/dev-local.js +88 -2
  33. package/dist/src/commands/local/dev-local.js.map +1 -1
  34. package/dist/src/commands/local/seed.d.ts +9 -0
  35. package/dist/src/commands/local/seed.d.ts.map +1 -1
  36. package/dist/src/commands/local/seed.js +49 -10
  37. package/dist/src/commands/local/seed.js.map +1 -1
  38. package/dist/src/commands/login.d.ts +76 -5
  39. package/dist/src/commands/login.d.ts.map +1 -1
  40. package/dist/src/commands/login.js +161 -60
  41. package/dist/src/commands/login.js.map +1 -1
  42. package/dist/src/commands/registry.d.ts +133 -10
  43. package/dist/src/commands/registry.d.ts.map +1 -1
  44. package/dist/src/commands/registry.js +238 -86
  45. package/dist/src/commands/registry.js.map +1 -1
  46. package/dist/src/commands/temporal.js +54 -24
  47. package/dist/src/commands/temporal.js.map +3 -3
  48. package/dist/src/docs/registry-docs.d.ts.map +1 -1
  49. package/dist/src/docs/registry-docs.js +8 -3
  50. package/dist/src/docs/registry-docs.js.map +1 -1
  51. package/dist/src/program.d.ts.map +1 -1
  52. package/dist/src/program.js +5 -1
  53. package/dist/src/program.js.map +1 -1
  54. package/dist/src/utils/auth-preflight.d.ts +51 -20
  55. package/dist/src/utils/auth-preflight.d.ts.map +1 -1
  56. package/dist/src/utils/auth-preflight.js +48 -21
  57. package/dist/src/utils/auth-preflight.js.map +1 -1
  58. package/dist/src/utils/mesh-json.d.ts +58 -0
  59. package/dist/src/utils/mesh-json.d.ts.map +1 -0
  60. package/dist/src/utils/mesh-json.js +85 -0
  61. package/dist/src/utils/mesh-json.js.map +1 -0
  62. package/dist/src/utils/registry-broker.d.ts +12 -29
  63. package/dist/src/utils/registry-broker.d.ts.map +1 -1
  64. package/dist/src/utils/registry-broker.js +12 -29
  65. package/dist/src/utils/registry-broker.js.map +1 -1
  66. package/dist/src/utils/registry-identity.d.ts +170 -0
  67. package/dist/src/utils/registry-identity.d.ts.map +1 -0
  68. package/dist/src/utils/registry-identity.js +273 -0
  69. package/dist/src/utils/registry-identity.js.map +1 -0
  70. package/package.json +3 -2
  71. package/skills/core/SKILL.md +8 -7
  72. package/templates/apps-repo/gitignore +4 -0
@@ -118,16 +118,22 @@ function isExpiredAwsTokenMessage(message) {
118
118
  message
119
119
  );
120
120
  }
121
- var REGISTRY_CONTEXT, REGISTRY_LOGIN_FIX, SSO_LOGIN_FIX;
121
+ var SSO_LOGIN_FIX;
122
122
  var init_auth_preflight = __esm({
123
123
  "libs/mesh-cli/src/utils/auth-preflight.ts"() {
124
124
  "use strict";
125
- REGISTRY_CONTEXT = "mesh.dev";
126
- REGISTRY_LOGIN_FIX = `mesh registry login ${REGISTRY_CONTEXT}`;
127
125
  SSO_LOGIN_FIX = "aws sso login --sso-session=mesh # or: pnpm sso";
128
126
  }
129
127
  });
130
128
 
129
+ // libs/mesh-cli/src/utils/errors.ts
130
+ import chalk2 from "chalk";
131
+ var init_errors = __esm({
132
+ "libs/mesh-cli/src/utils/errors.ts"() {
133
+ "use strict";
134
+ }
135
+ });
136
+
131
137
  // libs/mesh-cli/src/utils/first-party-contexts.ts
132
138
  function firstPartyDomainFor(context) {
133
139
  if (!Object.hasOwn(FIRST_PARTY_CONTEXTS, context)) return null;
@@ -150,14 +156,6 @@ var init_first_party_contexts = __esm({
150
156
  }
151
157
  });
152
158
 
153
- // libs/mesh-cli/src/utils/errors.ts
154
- import chalk2 from "chalk";
155
- var init_errors = __esm({
156
- "libs/mesh-cli/src/utils/errors.ts"() {
157
- "use strict";
158
- }
159
- });
160
-
161
159
  // libs/mesh-cli/src/utils/context.ts
162
160
  var init_context = __esm({
163
161
  "libs/mesh-cli/src/utils/context.ts"() {
@@ -397,7 +395,7 @@ var init_dev_launch = __esm({
397
395
  });
398
396
 
399
397
  // libs/mesh-cli/src/commands/local/seed.ts
400
- var LOCAL_TENANT, LOCAL_ENV, APP_TENANTS_PARAM, FABRIC_CHECK_PATH, TEMPORAL_NAMESPACE;
398
+ var LOCAL_TENANT, LOCAL_ENV, APP_TENANTS_PARAM, DATA_BUCKET_SEEDS, FABRIC_CHECK_PATH, TEMPORAL_NAMESPACE;
401
399
  var init_seed = __esm({
402
400
  "libs/mesh-cli/src/commands/local/seed.ts"() {
403
401
  "use strict";
@@ -406,6 +404,22 @@ var init_seed = __esm({
406
404
  LOCAL_TENANT = "local";
407
405
  LOCAL_ENV = "dev";
408
406
  APP_TENANTS_PARAM = `/mesh-platform/${LOCAL_TENANT}/${LOCAL_ENV}/app-tenants`;
407
+ DATA_BUCKET_SEEDS = [
408
+ {
409
+ key: "samples/pipes/fragment-0001.json",
410
+ body: JSON.stringify(
411
+ {
412
+ id: "sample-0001",
413
+ kind: "pipes-fragment",
414
+ account: "0001",
415
+ asOf: "2026-01-01",
416
+ lines: [{ amount: "125.00", currency: "USD", description: "Sample credit" }]
417
+ },
418
+ null,
419
+ 2
420
+ )
421
+ }
422
+ ];
409
423
  FABRIC_CHECK_PATH = `/mesh-platform/${LOCAL_TENANT}/${LOCAL_ENV}/.fabric-check`;
410
424
  TEMPORAL_NAMESPACE = `${LOCAL_TENANT}-${LOCAL_ENV}`;
411
425
  }
@@ -578,6 +592,13 @@ var init_auth_provision = __esm({
578
592
  }
579
593
  });
580
594
 
595
+ // libs/mesh-cli/src/utils/mesh-json.ts
596
+ var init_mesh_json = __esm({
597
+ "libs/mesh-cli/src/utils/mesh-json.ts"() {
598
+ "use strict";
599
+ }
600
+ });
601
+
581
602
  // libs/mesh-cli/src/commands/local/dev-local.ts
582
603
  var init_dev_local = __esm({
583
604
  "libs/mesh-cli/src/commands/local/dev-local.ts"() {
@@ -591,6 +612,7 @@ var init_dev_local = __esm({
591
612
  init_auth_provision();
592
613
  init_stack();
593
614
  init_login();
615
+ init_mesh_json();
594
616
  }
595
617
  });
596
618
 
@@ -827,9 +849,9 @@ async function discoverConfigFromSsm(context) {
827
849
  return null;
828
850
  }
829
851
  }
830
- async function discoverConfig(domain, contextKey = domain) {
852
+ async function discoverConfig(domain, contextKey = domain, opts = {}) {
831
853
  const url = `https://cli.${domain}/.well-known/mesh.json`;
832
- logInfo(`Attempting discovery from ${url}...`);
854
+ if (!opts.quiet) logInfo(`Attempting discovery from ${url}...`);
833
855
  try {
834
856
  const controller = new AbortController();
835
857
  const timeout = setTimeout(() => controller.abort(), 5e3);
@@ -850,8 +872,10 @@ async function discoverConfig(domain, contextKey = domain) {
850
872
  if (typeof data.vpn === "string") config.vpn = data.vpn;
851
873
  if (typeof data.vpnJoinBroker === "string") config.vpnJoinBroker = data.vpnJoinBroker;
852
874
  if (typeof data.registryBroker === "string") config.registryBroker = data.registryBroker;
853
- writeContextConfig(contextKey, config);
854
- logSuccess(`Discovered platform configuration for ${contextKey}`);
875
+ if (!opts.quiet) {
876
+ writeContextConfig(contextKey, config);
877
+ logSuccess(`Discovered platform configuration for ${contextKey}`);
878
+ }
855
879
  return config;
856
880
  } catch (err) {
857
881
  const message = err instanceof Error ? err.message : String(err);
@@ -1169,6 +1193,7 @@ function isRemoteEnvironment() {
1169
1193
  return false;
1170
1194
  }
1171
1195
  function hintVpnIfDisconnected(context) {
1196
+ if (context === RESERVED_REGISTRY_CONTEXT) return;
1172
1197
  try {
1173
1198
  const state = tailscaleBackendState();
1174
1199
  if (state !== "Running") {
@@ -1207,18 +1232,21 @@ async function getValidToken(context, opts = {}) {
1207
1232
  return null;
1208
1233
  }
1209
1234
  }
1235
+ async function runLoginFlow(context, config, opts = {}) {
1236
+ const useDevice = opts.device || isRemoteEnvironment();
1237
+ if (useDevice) {
1238
+ logInfo("Using device code flow");
1239
+ await deviceCodeLogin(context, config);
1240
+ } else {
1241
+ await login(context, config);
1242
+ }
1243
+ }
1210
1244
  async function ensureValidToken(context, config, opts) {
1211
1245
  let token = await getValidToken(context);
1212
1246
  if (token) return token;
1213
1247
  logInfo(`No valid Zitadel session for ${context} \u2014 running login flow`);
1214
1248
  try {
1215
- const useDevice = opts.device || isRemoteEnvironment();
1216
- if (useDevice) {
1217
- logInfo("Using device code flow");
1218
- await deviceCodeLogin(context, config);
1219
- } else {
1220
- await login(context, config);
1221
- }
1249
+ await runLoginFlow(context, config, opts);
1222
1250
  } catch (err) {
1223
1251
  logError(`Login failed: ${err.message}`);
1224
1252
  return null;
@@ -1255,11 +1283,12 @@ async function discoverConfigGuarded(context) {
1255
1283
  }
1256
1284
  return config;
1257
1285
  }
1258
- var CONFIG_DIR, CONFIG_FILE, CREDENTIALS_FILE, REDIRECT_PORT, REDIRECT_URI, SCOPES, atomicWriteCounter, MAX_DEVICE_CODES;
1286
+ var CONFIG_DIR, CONFIG_FILE, CREDENTIALS_FILE, REDIRECT_PORT, REDIRECT_URI, SCOPES, atomicWriteCounter, MAX_DEVICE_CODES, RESERVED_REGISTRY_CONTEXT;
1259
1287
  var init_login = __esm({
1260
1288
  "libs/mesh-cli/src/commands/login.ts"() {
1261
1289
  "use strict";
1262
1290
  init_log();
1291
+ init_errors();
1263
1292
  init_aws_auth();
1264
1293
  init_first_party_contexts();
1265
1294
  init_vpn2();
@@ -1274,6 +1303,7 @@ var init_login = __esm({
1274
1303
  SCOPES = "openid email profile offline_access urn:zitadel:iam:org:project:id:zitadel:aud";
1275
1304
  atomicWriteCounter = 0;
1276
1305
  MAX_DEVICE_CODES = 3;
1306
+ RESERVED_REGISTRY_CONTEXT = "registry";
1277
1307
  }
1278
1308
  });
1279
1309