@mesh-tech/mesh-cli 0.18.2 → 0.19.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 (55) hide show
  1. package/README.md +111 -56
  2. package/dist/bin/mesh.js +4843 -4077
  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/init/wizard.d.ts +216 -0
  12. package/dist/src/commands/init/wizard.d.ts.map +1 -0
  13. package/dist/src/commands/init/wizard.js +471 -0
  14. package/dist/src/commands/init/wizard.js.map +1 -0
  15. package/dist/src/commands/init.d.ts +14 -6
  16. package/dist/src/commands/init.d.ts.map +1 -1
  17. package/dist/src/commands/init.js +41 -15
  18. package/dist/src/commands/init.js.map +1 -1
  19. package/dist/src/commands/local/dev-local.d.ts.map +1 -1
  20. package/dist/src/commands/local/dev-local.js +6 -0
  21. package/dist/src/commands/local/dev-local.js.map +1 -1
  22. package/dist/src/commands/login.d.ts +76 -5
  23. package/dist/src/commands/login.d.ts.map +1 -1
  24. package/dist/src/commands/login.js +161 -60
  25. package/dist/src/commands/login.js.map +1 -1
  26. package/dist/src/commands/registry.d.ts +133 -10
  27. package/dist/src/commands/registry.d.ts.map +1 -1
  28. package/dist/src/commands/registry.js +238 -86
  29. package/dist/src/commands/registry.js.map +1 -1
  30. package/dist/src/commands/temporal.js +37 -23
  31. package/dist/src/commands/temporal.js.map +3 -3
  32. package/dist/src/docs/registry-docs.d.ts.map +1 -1
  33. package/dist/src/docs/registry-docs.js +8 -3
  34. package/dist/src/docs/registry-docs.js.map +1 -1
  35. package/dist/src/program.d.ts.map +1 -1
  36. package/dist/src/program.js +5 -1
  37. package/dist/src/program.js.map +1 -1
  38. package/dist/src/utils/auth-preflight.d.ts +51 -20
  39. package/dist/src/utils/auth-preflight.d.ts.map +1 -1
  40. package/dist/src/utils/auth-preflight.js +48 -21
  41. package/dist/src/utils/auth-preflight.js.map +1 -1
  42. package/dist/src/utils/mesh-json.d.ts +58 -0
  43. package/dist/src/utils/mesh-json.d.ts.map +1 -0
  44. package/dist/src/utils/mesh-json.js +85 -0
  45. package/dist/src/utils/mesh-json.js.map +1 -0
  46. package/dist/src/utils/registry-broker.d.ts +12 -29
  47. package/dist/src/utils/registry-broker.d.ts.map +1 -1
  48. package/dist/src/utils/registry-broker.js +12 -29
  49. package/dist/src/utils/registry-broker.js.map +1 -1
  50. package/dist/src/utils/registry-identity.d.ts +170 -0
  51. package/dist/src/utils/registry-identity.d.ts.map +1 -0
  52. package/dist/src/utils/registry-identity.js +273 -0
  53. package/dist/src/utils/registry-identity.js.map +1 -0
  54. package/package.json +3 -2
  55. package/skills/core/SKILL.md +6 -5
@@ -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"() {
@@ -578,6 +576,13 @@ var init_auth_provision = __esm({
578
576
  }
579
577
  });
580
578
 
579
+ // libs/mesh-cli/src/utils/mesh-json.ts
580
+ var init_mesh_json = __esm({
581
+ "libs/mesh-cli/src/utils/mesh-json.ts"() {
582
+ "use strict";
583
+ }
584
+ });
585
+
581
586
  // libs/mesh-cli/src/commands/local/dev-local.ts
582
587
  var init_dev_local = __esm({
583
588
  "libs/mesh-cli/src/commands/local/dev-local.ts"() {
@@ -591,6 +596,7 @@ var init_dev_local = __esm({
591
596
  init_auth_provision();
592
597
  init_stack();
593
598
  init_login();
599
+ init_mesh_json();
594
600
  }
595
601
  });
596
602
 
@@ -827,9 +833,9 @@ async function discoverConfigFromSsm(context) {
827
833
  return null;
828
834
  }
829
835
  }
830
- async function discoverConfig(domain, contextKey = domain) {
836
+ async function discoverConfig(domain, contextKey = domain, opts = {}) {
831
837
  const url = `https://cli.${domain}/.well-known/mesh.json`;
832
- logInfo(`Attempting discovery from ${url}...`);
838
+ if (!opts.quiet) logInfo(`Attempting discovery from ${url}...`);
833
839
  try {
834
840
  const controller = new AbortController();
835
841
  const timeout = setTimeout(() => controller.abort(), 5e3);
@@ -850,8 +856,10 @@ async function discoverConfig(domain, contextKey = domain) {
850
856
  if (typeof data.vpn === "string") config.vpn = data.vpn;
851
857
  if (typeof data.vpnJoinBroker === "string") config.vpnJoinBroker = data.vpnJoinBroker;
852
858
  if (typeof data.registryBroker === "string") config.registryBroker = data.registryBroker;
853
- writeContextConfig(contextKey, config);
854
- logSuccess(`Discovered platform configuration for ${contextKey}`);
859
+ if (!opts.quiet) {
860
+ writeContextConfig(contextKey, config);
861
+ logSuccess(`Discovered platform configuration for ${contextKey}`);
862
+ }
855
863
  return config;
856
864
  } catch (err) {
857
865
  const message = err instanceof Error ? err.message : String(err);
@@ -1169,6 +1177,7 @@ function isRemoteEnvironment() {
1169
1177
  return false;
1170
1178
  }
1171
1179
  function hintVpnIfDisconnected(context) {
1180
+ if (context === RESERVED_REGISTRY_CONTEXT) return;
1172
1181
  try {
1173
1182
  const state = tailscaleBackendState();
1174
1183
  if (state !== "Running") {
@@ -1207,18 +1216,21 @@ async function getValidToken(context, opts = {}) {
1207
1216
  return null;
1208
1217
  }
1209
1218
  }
1219
+ async function runLoginFlow(context, config, opts = {}) {
1220
+ const useDevice = opts.device || isRemoteEnvironment();
1221
+ if (useDevice) {
1222
+ logInfo("Using device code flow");
1223
+ await deviceCodeLogin(context, config);
1224
+ } else {
1225
+ await login(context, config);
1226
+ }
1227
+ }
1210
1228
  async function ensureValidToken(context, config, opts) {
1211
1229
  let token = await getValidToken(context);
1212
1230
  if (token) return token;
1213
1231
  logInfo(`No valid Zitadel session for ${context} \u2014 running login flow`);
1214
1232
  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
- }
1233
+ await runLoginFlow(context, config, opts);
1222
1234
  } catch (err) {
1223
1235
  logError(`Login failed: ${err.message}`);
1224
1236
  return null;
@@ -1255,11 +1267,12 @@ async function discoverConfigGuarded(context) {
1255
1267
  }
1256
1268
  return config;
1257
1269
  }
1258
- var CONFIG_DIR, CONFIG_FILE, CREDENTIALS_FILE, REDIRECT_PORT, REDIRECT_URI, SCOPES, atomicWriteCounter, MAX_DEVICE_CODES;
1270
+ var CONFIG_DIR, CONFIG_FILE, CREDENTIALS_FILE, REDIRECT_PORT, REDIRECT_URI, SCOPES, atomicWriteCounter, MAX_DEVICE_CODES, RESERVED_REGISTRY_CONTEXT;
1259
1271
  var init_login = __esm({
1260
1272
  "libs/mesh-cli/src/commands/login.ts"() {
1261
1273
  "use strict";
1262
1274
  init_log();
1275
+ init_errors();
1263
1276
  init_aws_auth();
1264
1277
  init_first_party_contexts();
1265
1278
  init_vpn2();
@@ -1274,6 +1287,7 @@ var init_login = __esm({
1274
1287
  SCOPES = "openid email profile offline_access urn:zitadel:iam:org:project:id:zitadel:aud";
1275
1288
  atomicWriteCounter = 0;
1276
1289
  MAX_DEVICE_CODES = 3;
1290
+ RESERVED_REGISTRY_CONTEXT = "registry";
1277
1291
  }
1278
1292
  });
1279
1293