mano-coding 0.1.34 → 0.1.36

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.js CHANGED
@@ -23224,6 +23224,11 @@ var init_errors3 = __esm({
23224
23224
  // packages/core/src/resolvers/registry-client.ts
23225
23225
  function selectRelease(entry, versionRange) {
23226
23226
  const packageId = entry.id ?? entry.metadata?.id ?? "unknown";
23227
+ const channelVersion = entry.channels?.[versionRange];
23228
+ if (channelVersion && (versionRange !== "stable" || !import_semver2.default.prerelease(channelVersion))) {
23229
+ const channelRelease = entry.releases.find((release) => release.version === channelVersion);
23230
+ if (channelRelease) return channelRelease;
23231
+ }
23227
23232
  const normalizedRange = normalizeRange(versionRange);
23228
23233
  const candidates = entry.releases.filter((r) => {
23229
23234
  if (import_semver2.default.prerelease(r.version) && !rangeAllowsPrerelease(normalizedRange)) {
@@ -46435,6 +46440,7 @@ async function buildLock(_operation, templateResolution, addonResolutions, proje
46435
46440
  }
46436
46441
  const desiredPackages = [];
46437
46442
  const resolvedPackages = [];
46443
+ const currentPackageIds = new Set(allResolutions.map((r) => r.packageId));
46438
46444
  for (const res of allResolutions) {
46439
46445
  const packageRoot = service?.getPackageRoot(res) ?? process.cwd();
46440
46446
  const contentDigest = await computePackageDigest(packageRoot);
@@ -46457,6 +46463,20 @@ async function buildLock(_operation, templateResolution, addonResolutions, proje
46457
46463
  ...res.integrity ? { integrity: res.integrity } : {}
46458
46464
  });
46459
46465
  }
46466
+ if (existingLock) {
46467
+ const existingDesired = existingLock.desired?.packages ?? [];
46468
+ const existingResolved = existingLock.resolved?.packages ?? [];
46469
+ for (const ep of existingDesired) {
46470
+ if (!currentPackageIds.has(ep.id)) {
46471
+ desiredPackages.push(ep);
46472
+ }
46473
+ }
46474
+ for (const ep of existingResolved) {
46475
+ if (!currentPackageIds.has(ep.id)) {
46476
+ resolvedPackages.push(ep);
46477
+ }
46478
+ }
46479
+ }
46460
46480
  const resources = /* @__PURE__ */ new Map();
46461
46481
  if (existingLock?.resources) {
46462
46482
  for (const res of existingLock.resources) {
@@ -46537,6 +46557,15 @@ async function buildLock(_operation, templateResolution, addonResolutions, proje
46537
46557
  });
46538
46558
  }
46539
46559
  }
46560
+ const mergedTargets = [...targetStrings];
46561
+ if (existingLock?.desired?.targets) {
46562
+ for (const t2 of existingLock.desired.targets) {
46563
+ const tid = typeof t2 === "string" ? t2 : t2.id;
46564
+ if (!mergedTargets.includes(tid)) {
46565
+ mergedTargets.push(tid);
46566
+ }
46567
+ }
46568
+ }
46540
46569
  return {
46541
46570
  apiVersion: "mano-coding/v1",
46542
46571
  kind: "ProjectLock",
@@ -46546,7 +46575,7 @@ async function buildLock(_operation, templateResolution, addonResolutions, proje
46546
46575
  },
46547
46576
  desired: {
46548
46577
  packages: desiredPackages,
46549
- targets: targetStrings
46578
+ targets: mergedTargets
46550
46579
  },
46551
46580
  resolved: {
46552
46581
  packages: resolvedPackages
@@ -46917,24 +46946,29 @@ async function confirmPlanInteractive(opts) {
46917
46946
  `);
46918
46947
  }
46919
46948
  }
46920
- process.stderr.write(`
46921
- \u786E\u8BA4\u540E\u5C06\u6267\u884C\u4EE5\u4E0A\u64CD\u4F5C\u3002
46922
- `);
46923
- const confirmed = await readConfirm();
46949
+ process.stderr.write(t("tty.confirmPrompt"));
46950
+ const confirmed = await readConfirm({
46951
+ input: opts.input,
46952
+ output: opts.interactiveOutput
46953
+ });
46924
46954
  if (!confirmed) {
46925
46955
  return { confirmed: false, granted: [], denied: toConfirm };
46926
46956
  }
46927
46957
  return { confirmed: true, granted: requested, denied: [] };
46928
46958
  }
46929
- async function readConfirm() {
46959
+ async function readConfirm(streams) {
46930
46960
  try {
46931
46961
  return await dist_default5(
46932
46962
  {
46933
46963
  message: t("tty.proceedPrompt"),
46934
- default: false
46964
+ default: true
46935
46965
  },
46936
46966
  // 1 分钟无响应超时视为拒绝
46937
- { signal: AbortSignal.timeout(6e4) }
46967
+ {
46968
+ signal: AbortSignal.timeout(6e4),
46969
+ ...streams?.input ? { input: streams.input } : {},
46970
+ ...streams?.output ? { output: streams.output } : {}
46971
+ }
46938
46972
  );
46939
46973
  } catch {
46940
46974
  return false;
@@ -47186,7 +47220,9 @@ async function executeCreate(packageSpecs, directory, options, cliVersion, event
47186
47220
  await recoverIncompleteJournals(service, output);
47187
47221
  let cliTargets = options.target;
47188
47222
  if (cliTargets.length === 0) {
47189
- if (isInteractive) {
47223
+ if (existingLock?.desired?.targets && existingLock.desired.targets.length > 0) {
47224
+ cliTargets = existingLock.desired.targets.map((t2) => typeof t2 === "string" ? t2 : t2.id);
47225
+ } else if (isInteractive) {
47190
47226
  try {
47191
47227
  const selected = await selectSearchableMulti({
47192
47228
  message: t("create.chooseTargets"),
@@ -47441,7 +47477,7 @@ async function executeCreate(packageSpecs, directory, options, cliVersion, event
47441
47477
  );
47442
47478
  if (!output.json && userInstallationKeys.size > 0) writeHumanOutput(t("create.userToolsInstalled", formatElapsed(userInstallationStartedAt)));
47443
47479
  addRollback(userLifecycle.rollback);
47444
- const lock = await buildLock("create", templateResolution, addonResolutions, projectTargets, planResult.plan, service.cliVersion, inputValues, service, intents, userInstallationKeys);
47480
+ const lock = await buildLock("create", templateResolution, addonResolutions, projectTargets, planResult.plan, service.cliVersion, inputValues, service, intents, userInstallationKeys, void 0, existingLock);
47445
47481
  await lockRepo.write(lock);
47446
47482
  addRollback(async () => previousLock ? lockRepo.write(previousLock) : unlink9(lockRepo.path).catch(() => void 0));
47447
47483
  await userLifecycle.addReferences(lock);
@@ -50913,7 +50949,7 @@ import { createRequire as createRequire2 } from "node:module";
50913
50949
  import { readFileSync as readFileSync4 } from "node:fs";
50914
50950
  import { fileURLToPath as fileURLToPath5 } from "node:url";
50915
50951
  function resolveVersion() {
50916
- if (true) return "0.1.34";
50952
+ if (true) return "0.1.36";
50917
50953
  const candidates = [
50918
50954
  new URL("../package.json", import.meta.url),
50919
50955
  new URL("../../package.json", import.meta.url),
@@ -13,7 +13,11 @@
13
13
  "displayName": { "type": "string", "minLength": 1, "maxLength": 80 },
14
14
  "description": { "type": "string", "maxLength": 500 },
15
15
  "metadata": { "$ref": "#/$defs/metadata" },
16
- "channels": { "type": "object" },
16
+ "channels": {
17
+ "type": "object",
18
+ "propertyNames": { "pattern": "^[a-z][a-z0-9-]*$" },
19
+ "additionalProperties": { "$ref": "#/$defs/semver" }
20
+ },
17
21
  "releases": {
18
22
  "type": "array",
19
23
  "minItems": 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mano-coding",
3
- "version": "0.1.34",
3
+ "version": "0.1.36",
4
4
  "description": "Mano Coding CLI and toolchain",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -13,7 +13,11 @@
13
13
  "displayName": { "type": "string", "minLength": 1, "maxLength": 80 },
14
14
  "description": { "type": "string", "maxLength": 500 },
15
15
  "metadata": { "$ref": "#/$defs/metadata" },
16
- "channels": { "type": "object" },
16
+ "channels": {
17
+ "type": "object",
18
+ "propertyNames": { "pattern": "^[a-z][a-z0-9-]*$" },
19
+ "additionalProperties": { "$ref": "#/$defs/semver" }
20
+ },
17
21
  "releases": {
18
22
  "type": "array",
19
23
  "minItems": 1,