@wirecat/cli-template 0.14.0 → 0.15.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 (40) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/bin/clidev.js +2 -2
  3. package/dist/bundle/{app-server-B6BCKXR7.js → app-server-OW5LT5XV.js} +8 -8
  4. package/dist/bundle/{chunk-4PA6DJ7F.js → chunk-4MU2UM4C.js} +2 -2
  5. package/dist/bundle/{chunk-BEBD27QT.js → chunk-5GTMQTQH.js} +7 -7
  6. package/dist/bundle/{chunk-UT5TQ6MD.js → chunk-7UPBPE3Z.js} +3 -3
  7. package/dist/bundle/{chunk-BVLPNNEL.js → chunk-EX2FV7YJ.js} +3 -3
  8. package/dist/bundle/{chunk-QXOSPYM3.js → chunk-FC53WQHG.js} +1 -1
  9. package/dist/bundle/{chunk-5SAF3XOL.js → chunk-GHF72SHT.js} +1 -1
  10. package/dist/bundle/{chunk-PX2KP4QE.js → chunk-KJ3UADR3.js} +4 -4
  11. package/dist/bundle/{chunk-IZKXJJ7V.js → chunk-KLFYY7KC.js} +25 -2
  12. package/dist/bundle/{chunk-ASHVHS52.js → chunk-MWUHBEDN.js} +2 -2
  13. package/dist/bundle/{chunk-BWBZCYUN.js → chunk-NG7MOJBT.js} +4 -4
  14. package/dist/bundle/{chunk-BM5ZCDPQ.js → chunk-NRZV7K4M.js} +1 -1
  15. package/dist/bundle/{chunk-HYTHTSJP.js → chunk-NVGOHYTE.js} +1 -1
  16. package/dist/bundle/{chunk-RJ7AS7UB.js → chunk-VVGPAHUN.js} +1 -0
  17. package/dist/bundle/clidev.js +2 -2
  18. package/dist/bundle/{command-contract-JMVMT5HT.js → command-contract-3MPKXBVL.js} +2 -2
  19. package/dist/bundle/{first-run-MDD4SIUK.js → first-run-PURIGDLD.js} +1 -1
  20. package/dist/bundle/{first-screen-376CXGXJ.js → first-screen-B2CF2CET.js} +3 -3
  21. package/dist/bundle/{mcp-MZHWJXAE.js → mcp-ASNYBQ5B.js} +6 -6
  22. package/dist/bundle/{mcp-KHUZOJO6.js → mcp-EY2NUYDQ.js} +5 -5
  23. package/dist/bundle/{program-B3CY3FP7.js → program-37NVH5YJ.js} +29 -26
  24. package/dist/bundle/{server-2ZN7KZHZ.js → server-3TPCEZ6P.js} +5 -5
  25. package/dist/bundle/{server-5VYM7CCF.js → server-GQX5MZTT.js} +8 -8
  26. package/dist/bundle/{store-maintenance-command-7XICIYHW.js → store-maintenance-command-ND4ADMGC.js} +4 -4
  27. package/dist/config.d.ts +2 -0
  28. package/dist/config.d.ts.map +1 -1
  29. package/dist/config.js +4 -2
  30. package/dist/config.js.map +1 -1
  31. package/dist/program.d.ts.map +1 -1
  32. package/dist/program.js +2 -1
  33. package/dist/program.js.map +1 -1
  34. package/dist/version.d.ts +1 -1
  35. package/dist/version.js +1 -1
  36. package/package.json +1 -1
  37. package/src/config.ts +5 -2
  38. package/src/program.test.ts +30 -1
  39. package/src/program.ts +2 -1
  40. package/src/version.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ Notable changes to `@wirecat/cli-template`. One section per version, newest firs
5
5
 
6
6
  <!-- cspell:words clawhub gcal katex openclaw smol whatsapp -->
7
7
 
8
+ ## 0.15.0 — 06.11.2026
9
+
10
+ ### Fixed
11
+
12
+ - **A `deny` in a profile stops a command again.** The skeleton handed cli-core only `resolveSettings`, and cli-core
13
+ checks a command's key only when it gets the permission table too, so a denied read still ran and `--dry-run`
14
+ previewed every command as allowed. `src/program.ts` now passes the whole `configuration`, and `src/config.ts`
15
+ declares `commandPermissions()`, so each command is checked against its own path. A CLI made from an older
16
+ skeleton makes the same two changes by hand.
17
+
8
18
  ## 0.14.0 — 06.11.2026
9
19
 
10
20
  ### Added
@@ -9,7 +9,7 @@ if (
9
9
  (words[0] === "--version" || words[0] === "-V") &&
10
10
  !Object.keys(process.env).some((key) => key.endsWith("_TEST_ARGV_LOG"))
11
11
  ) {
12
- process.stdout.write("0.14.0\n")
12
+ process.stdout.write("0.15.0\n")
13
13
  } else {
14
14
  // Before the bundle compiles: the bundle's own call comes after its chunks.
15
15
  module.enableCompileCache()
@@ -28,7 +28,7 @@ if (
28
28
  : next(specifier, context),
29
29
  })
30
30
  }
31
- const chunks = ["../bundle/all-profiles-NVB2HT2S.js","../bundle/anthropic-ICTW7CNQ.js","../bundle/app-server-B6BCKXR7.js","../bundle/bun-ILPS6AYA.js","../bundle/bun-sqlite-JE6FJFQT.js","../bundle/decode-NXB5UKMO.js","../bundle/dist-ESHIQU4M.js","../bundle/echarts-DRDGGHJT.js","../bundle/embed-IKZ24BMC.js","../bundle/embedder-GMQ24DOQ.js","../bundle/first-screen-376CXGXJ.js","../bundle/instructions-EOQOXY6V.js","../bundle/mcp-7HBLFGCW.js","../bundle/mcp-KHUZOJO6.js","../bundle/mcp-MZHWJXAE.js","../bundle/node-52WF2326.js","../bundle/node-P4E63KXA.js","../bundle/node-TLZSIHIJ.js","../bundle/node-sqlite-73Z4SFOA.js","../bundle/oauth-EVTPAMZP.js","../bundle/open-46WZAPJ3.js","../bundle/openai-GWRDAHDU.js","../bundle/process-YIQPKLZI.js","../bundle/program-B3CY3FP7.js","../bundle/prompt-IVEYRLS5.js","../bundle/recognize-WVEKHODM.js","../bundle/remote-4K5VPMC7.js","../bundle/rerank-V24UJZYJ.js","../bundle/serve-PJWSOV7F.js","../bundle/server-2ZN7KZHZ.js","../bundle/server-5VYM7CCF.js","../bundle/state-ZPYGECVP.js","../bundle/store-6JQCLPQF.js","../bundle/store-maintenance-command-7XICIYHW.js"]
31
+ const chunks = ["../bundle/all-profiles-NVB2HT2S.js","../bundle/anthropic-ICTW7CNQ.js","../bundle/app-server-OW5LT5XV.js","../bundle/bun-ILPS6AYA.js","../bundle/bun-sqlite-JE6FJFQT.js","../bundle/decode-NXB5UKMO.js","../bundle/dist-ESHIQU4M.js","../bundle/echarts-DRDGGHJT.js","../bundle/embed-IKZ24BMC.js","../bundle/embedder-GMQ24DOQ.js","../bundle/first-screen-B2CF2CET.js","../bundle/instructions-EOQOXY6V.js","../bundle/mcp-7HBLFGCW.js","../bundle/mcp-ASNYBQ5B.js","../bundle/mcp-EY2NUYDQ.js","../bundle/node-52WF2326.js","../bundle/node-P4E63KXA.js","../bundle/node-TLZSIHIJ.js","../bundle/node-sqlite-73Z4SFOA.js","../bundle/oauth-EVTPAMZP.js","../bundle/open-46WZAPJ3.js","../bundle/openai-GWRDAHDU.js","../bundle/process-YIQPKLZI.js","../bundle/program-37NVH5YJ.js","../bundle/prompt-IVEYRLS5.js","../bundle/recognize-WVEKHODM.js","../bundle/remote-4K5VPMC7.js","../bundle/rerank-V24UJZYJ.js","../bundle/serve-PJWSOV7F.js","../bundle/server-3TPCEZ6P.js","../bundle/server-GQX5MZTT.js","../bundle/state-ZPYGECVP.js","../bundle/store-6JQCLPQF.js","../bundle/store-maintenance-command-ND4ADMGC.js"]
32
32
  if (((words) => words
33
33
  .filter((word) => !word.startsWith("-"))
34
34
  .slice(0, 2)
@@ -3,8 +3,8 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  PER_RUN,
5
5
  envelope
6
- } from "./chunk-BEBD27QT.js";
7
- import "./chunk-BWBZCYUN.js";
6
+ } from "./chunk-5GTMQTQH.js";
7
+ import "./chunk-NG7MOJBT.js";
8
8
  import {
9
9
  mcpUrlOf
10
10
  } from "./chunk-GUFPQZUA.js";
@@ -17,17 +17,17 @@ import {
17
17
  registerCommands,
18
18
  runCommandForAgent,
19
19
  toolsFromCommands
20
- } from "./chunk-UT5TQ6MD.js";
20
+ } from "./chunk-7UPBPE3Z.js";
21
21
  import {
22
22
  agentJson,
23
23
  skillResource
24
- } from "./chunk-HYTHTSJP.js";
24
+ } from "./chunk-NVGOHYTE.js";
25
25
  import {
26
26
  StdioServerTransport,
27
27
  serveStdio
28
28
  } from "./chunk-F34HGYWF.js";
29
- import "./chunk-IZKXJJ7V.js";
30
- import "./chunk-5SAF3XOL.js";
29
+ import "./chunk-KLFYY7KC.js";
30
+ import "./chunk-GHF72SHT.js";
31
31
  import "./chunk-PIJUGF5F.js";
32
32
  import "./chunk-2DAXUNTS.js";
33
33
  import "./chunk-AS2PJNQ2.js";
@@ -44,7 +44,7 @@ import {
44
44
  import "./chunk-DZLHY4IA.js";
45
45
  import "./chunk-SOYOOU2D.js";
46
46
  import "./chunk-LATYBJ4T.js";
47
- import "./chunk-BM5ZCDPQ.js";
47
+ import "./chunk-NRZV7K4M.js";
48
48
  import {
49
49
  DEFAULT_OUTPUT_BYTES,
50
50
  changesAuthorityAt,
@@ -54,7 +54,7 @@ import {
54
54
  readOnlyLockOf,
55
55
  readsOverMcpAt,
56
56
  rootOf2 as rootOf
57
- } from "./chunk-RJ7AS7UB.js";
57
+ } from "./chunk-VVGPAHUN.js";
58
58
  import "./chunk-VXOR76ZL.js";
59
59
  import "./chunk-U6QD3J3F.js";
60
60
  import "./chunk-VOTEB3AN.js";
@@ -7,7 +7,7 @@ import {
7
7
  commandPathOf,
8
8
  findCommand,
9
9
  outputOf
10
- } from "./chunk-BM5ZCDPQ.js";
10
+ } from "./chunk-NRZV7K4M.js";
11
11
  import {
12
12
  Command,
13
13
  Help,
@@ -18,7 +18,7 @@ import {
18
18
  environmentOf,
19
19
  metaOf,
20
20
  takesProfile
21
- } from "./chunk-RJ7AS7UB.js";
21
+ } from "./chunk-VVGPAHUN.js";
22
22
  import {
23
23
  CliError,
24
24
  writes
@@ -12,7 +12,7 @@ import {
12
12
  registerPrompts,
13
13
  stdinFieldOf,
14
14
  syncsFirst
15
- } from "./chunk-BWBZCYUN.js";
15
+ } from "./chunk-NG7MOJBT.js";
16
16
  import {
17
17
  mcpUrlOf
18
18
  } from "./chunk-GUFPQZUA.js";
@@ -39,11 +39,11 @@ import {
39
39
  tool,
40
40
  toolKey,
41
41
  toolsFromCommands
42
- } from "./chunk-UT5TQ6MD.js";
42
+ } from "./chunk-7UPBPE3Z.js";
43
43
  import {
44
44
  agentJson,
45
45
  skillResource
46
- } from "./chunk-HYTHTSJP.js";
46
+ } from "./chunk-NVGOHYTE.js";
47
47
  import {
48
48
  StdioServerTransport,
49
49
  callerOf,
@@ -53,7 +53,7 @@ import {
53
53
  import {
54
54
  connectedFor,
55
55
  guardFor
56
- } from "./chunk-IZKXJJ7V.js";
56
+ } from "./chunk-KLFYY7KC.js";
57
57
  import {
58
58
  capability,
59
59
  dateWindow,
@@ -62,7 +62,7 @@ import {
62
62
  servicesFor,
63
63
  storedDeps,
64
64
  wholeList
65
- } from "./chunk-5SAF3XOL.js";
65
+ } from "./chunk-GHF72SHT.js";
66
66
  import {
67
67
  instructions
68
68
  } from "./chunk-G45R7M42.js";
@@ -75,7 +75,7 @@ import {
75
75
  } from "./chunk-6AW4DDK4.js";
76
76
  import {
77
77
  findCommand
78
- } from "./chunk-BM5ZCDPQ.js";
78
+ } from "./chunk-NRZV7K4M.js";
79
79
  import {
80
80
  DEFAULT_OUTPUT_BYTES,
81
81
  changesAuthorityAt,
@@ -92,7 +92,7 @@ import {
92
92
  sealed,
93
93
  snakeKeys,
94
94
  typedCommand
95
- } from "./chunk-RJ7AS7UB.js";
95
+ } from "./chunk-VVGPAHUN.js";
96
96
  import {
97
97
  isCliFailure,
98
98
  withCaller
@@ -7,7 +7,7 @@ import {
7
7
  agentJson,
8
8
  commandAvailability,
9
9
  failureContext
10
- } from "./chunk-HYTHTSJP.js";
10
+ } from "./chunk-NVGOHYTE.js";
11
11
  import {
12
12
  callerOf
13
13
  } from "./chunk-F34HGYWF.js";
@@ -18,7 +18,7 @@ import {
18
18
  refuseLacking,
19
19
  servicesFor,
20
20
  storeModeDeps
21
- } from "./chunk-5SAF3XOL.js";
21
+ } from "./chunk-GHF72SHT.js";
22
22
  import {
23
23
  MAX_BUFFERED_INPUT
24
24
  } from "./chunk-2DAXUNTS.js";
@@ -45,7 +45,7 @@ import {
45
45
  sealed,
46
46
  startRecording,
47
47
  traceOf
48
- } from "./chunk-RJ7AS7UB.js";
48
+ } from "./chunk-VVGPAHUN.js";
49
49
  import {
50
50
  currentCaller,
51
51
  keepsSuccess,
@@ -3,7 +3,7 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  answerOf,
5
5
  messengerContext
6
- } from "./chunk-IZKXJJ7V.js";
6
+ } from "./chunk-KLFYY7KC.js";
7
7
  import {
8
8
  FETCHING,
9
9
  RULES_VERSION,
@@ -24,7 +24,7 @@ import {
24
24
  typedQuery,
25
25
  withQuery,
26
26
  withTimeLimit
27
- } from "./chunk-5SAF3XOL.js";
27
+ } from "./chunk-GHF72SHT.js";
28
28
  import {
29
29
  readSecret
30
30
  } from "./chunk-G7W53MQP.js";
@@ -76,7 +76,7 @@ import {
76
76
  snakeKeys,
77
77
  storeTable,
78
78
  withoutProviderRefs
79
- } from "./chunk-RJ7AS7UB.js";
79
+ } from "./chunk-VVGPAHUN.js";
80
80
  import {
81
81
  failureKey
82
82
  } from "./chunk-VXOR76ZL.js";
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
 
4
4
  // dist/version.js
5
- var VERSION = "0.14.0";
5
+ var VERSION = "0.15.0";
6
6
 
7
7
  // dist/identity.js
8
8
  var PACKAGE = "@wirecat/clidev-cli";
@@ -59,7 +59,7 @@ import {
59
59
  typedCommand,
60
60
  vectorModelKey,
61
61
  withAttempt
62
- } from "./chunk-RJ7AS7UB.js";
62
+ } from "./chunk-VVGPAHUN.js";
63
63
  import {
64
64
  isCliFailure
65
65
  } from "./chunk-VXOR76ZL.js";
@@ -9,18 +9,18 @@ import {
9
9
  registerCommands,
10
10
  runCommandForAgent,
11
11
  toolsFromCommands
12
- } from "./chunk-UT5TQ6MD.js";
12
+ } from "./chunk-7UPBPE3Z.js";
13
13
  import {
14
14
  agentJson,
15
15
  skillResource
16
- } from "./chunk-HYTHTSJP.js";
16
+ } from "./chunk-NVGOHYTE.js";
17
17
  import {
18
18
  callerOf,
19
19
  serveStdio
20
20
  } from "./chunk-F34HGYWF.js";
21
21
  import {
22
22
  wholeList
23
- } from "./chunk-5SAF3XOL.js";
23
+ } from "./chunk-GHF72SHT.js";
24
24
  import {
25
25
  McpServer
26
26
  } from "./chunk-5D4AEUVA.js";
@@ -31,7 +31,7 @@ import {
31
31
  itemOf,
32
32
  readOnlyLockOf,
33
33
  readOnlyRefusal
34
- } from "./chunk-RJ7AS7UB.js";
34
+ } from "./chunk-VVGPAHUN.js";
35
35
  import {
36
36
  mcpErrorResult,
37
37
  object
@@ -13,12 +13,14 @@ import {
13
13
  refuseLacking,
14
14
  servicesFor,
15
15
  throughWrapper
16
- } from "./chunk-5SAF3XOL.js";
16
+ } from "./chunk-GHF72SHT.js";
17
17
  import {
18
18
  servingProfiles
19
19
  } from "./chunk-DZLHY4IA.js";
20
20
  import {
21
+ AUTHORITY_KEY,
21
22
  CEILING_KEY,
23
+ DEFAULT_PERMISSIONS,
22
24
  LOG_ATTRIBUTES,
23
25
  MESSENGER_CHANGE_REFUSAL,
24
26
  WRITE_KEYS,
@@ -43,7 +45,7 @@ import {
43
45
  rememberAccount,
44
46
  rootOf2 as rootOf,
45
47
  skipFlagFor
46
- } from "./chunk-RJ7AS7UB.js";
48
+ } from "./chunk-VVGPAHUN.js";
47
49
  import {
48
50
  isCliFailure,
49
51
  providerErrorKey
@@ -717,6 +719,26 @@ var Pacer = class {
717
719
  };
718
720
 
719
721
  // node_modules/.pnpm/@wirecat+cli-core@0.584.0_@wirecat+cli-base@0.77.1_commander@15.0.0_esbuild@0.28.2_type_ab8c0b68b8b4768d5b87d6e249ef10da/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
722
+ var HOUSEKEEPING = /* @__PURE__ */ new Set([
723
+ "help",
724
+ "guide",
725
+ "config",
726
+ "session",
727
+ "doctor",
728
+ "commands",
729
+ "complete",
730
+ "upgrade",
731
+ "skill",
732
+ "mcp",
733
+ "runs"
734
+ ]);
735
+ var commandPathKey = /* @__PURE__ */ __name((path) => path[0] === void 0 || HOUSEKEEPING.has(path[0]) ? null : path.join("."), "commandPathKey");
736
+ var commandPermissions = /* @__PURE__ */ __name(({ keyOf = commandPathKey, extra = [], defaults = {}, alsoChecks } = {}) => ({
737
+ keyOf,
738
+ extra: [AUTHORITY_KEY, ...extra],
739
+ defaults: { ...DEFAULT_PERMISSIONS, ...defaults },
740
+ ...alsoChecks ? { alsoChecks } : {}
741
+ }), "commandPermissions");
720
742
  var pathOf = /* @__PURE__ */ __name((command) => {
721
743
  const words = [];
722
744
  for (let at = command; at?.parent; at = at.parent)
@@ -1979,6 +2001,7 @@ export {
1979
2001
  levelRefusal,
1980
2002
  sendGuard,
1981
2003
  guardFor,
2004
+ commandPermissions,
1982
2005
  knownPermissionKeys,
1983
2006
  knownBeside,
1984
2007
  unknownPermissionIssues,
@@ -112,7 +112,7 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
112
112
  return;
113
113
  const [{ openCache }, { buildStems }] = await Promise.all([
114
114
  import("./open-46WZAPJ3.js"),
115
- import("./store-maintenance-command-7XICIYHW.js")
115
+ import("./store-maintenance-command-ND4ADMGC.js")
116
116
  ]);
117
117
  const database = await openCache(storePath(env));
118
118
  try {
@@ -124,7 +124,7 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
124
124
  var askTools = /* @__PURE__ */ __name(async (run) => {
125
125
  const { command, env, io } = run;
126
126
  const installed = run.installed ?? ((name) => onPath(name, env));
127
- const { WIRECAT_TOOLS } = await import("./first-screen-376CXGXJ.js");
127
+ const { WIRECAT_TOOLS } = await import("./first-screen-B2CF2CET.js");
128
128
  const others = WIRECAT_TOOLS.filter((tool) => tool.command !== command);
129
129
  const missing = others.filter((tool) => !installed(tool.command));
130
130
  io.say("Other WireCat tools \u2014 they share this store, so one search finds everything:");
@@ -7,7 +7,7 @@ import {
7
7
  refuseLocalWrite,
8
8
  refuseUnknownPermissionKeys,
9
9
  sendsPathFor
10
- } from "./chunk-IZKXJJ7V.js";
10
+ } from "./chunk-KLFYY7KC.js";
11
11
  import {
12
12
  MAX_SEARCH_OFFSET,
13
13
  chatRef,
@@ -17,10 +17,10 @@ import {
17
17
  positiveCount,
18
18
  refreshedFiles,
19
19
  senderIsMe
20
- } from "./chunk-5SAF3XOL.js";
20
+ } from "./chunk-GHF72SHT.js";
21
21
  import {
22
22
  commandPathOf
23
- } from "./chunk-BM5ZCDPQ.js";
23
+ } from "./chunk-NRZV7K4M.js";
24
24
  import {
25
25
  CEILING_KEY,
26
26
  DEFAULT_TEXT_MODEL,
@@ -40,7 +40,7 @@ import {
40
40
  recalledAccount,
41
41
  settingsFor,
42
42
  writeOfKey
43
- } from "./chunk-RJ7AS7UB.js";
43
+ } from "./chunk-VVGPAHUN.js";
44
44
  import {
45
45
  formatLocator,
46
46
  hitFiles,
@@ -7,7 +7,7 @@ import {
7
7
  describeOptions,
8
8
  keyForCommand,
9
9
  metaOf
10
- } from "./chunk-RJ7AS7UB.js";
10
+ } from "./chunk-VVGPAHUN.js";
11
11
  import {
12
12
  CliError,
13
13
  jsonSchemaOf
@@ -24,7 +24,7 @@ import {
24
24
  keyForCommand,
25
25
  levelFor,
26
26
  readKeysForCommand
27
- } from "./chunk-RJ7AS7UB.js";
27
+ } from "./chunk-VVGPAHUN.js";
28
28
  import {
29
29
  MEETING_QUERY,
30
30
  QUERY_REASONS,
@@ -12396,6 +12396,7 @@ export {
12396
12396
  refuseJoinedPath,
12397
12397
  LEVELS,
12398
12398
  skipFlagFor,
12399
+ DEFAULT_PERMISSIONS,
12399
12400
  AUTHORITY_KEY,
12400
12401
  authorityAllowed,
12401
12402
  BOT_API_KEY,
@@ -3,7 +3,7 @@ import { createRequire as __bundleRequire } from "node:module";
3
3
  const require = __bundleRequire(import.meta.url);
4
4
  import {
5
5
  IDENTITY
6
- } from "./chunk-QXOSPYM3.js";
6
+ } from "./chunk-FC53WQHG.js";
7
7
  import {
8
8
  catchCrashes
9
9
  } from "./chunk-IOJ2DTCY.js";
@@ -14,7 +14,7 @@ import "./chunk-ZVVMGPBJ.js";
14
14
  import { enableCompileCache } from "node:module";
15
15
  enableCompileCache();
16
16
  var stopCatching = catchCrashes({ cli: IDENTITY.command, interactive: process.stdout.isTTY === true });
17
- var { run } = await import("./program-B3CY3FP7.js");
17
+ var { run } = await import("./program-37NVH5YJ.js");
18
18
  try {
19
19
  process.exitCode = await run(process.argv.slice(2));
20
20
  } finally {
@@ -6,8 +6,8 @@ import {
6
6
  commandPathOf,
7
7
  findCommand,
8
8
  outputOf
9
- } from "./chunk-BM5ZCDPQ.js";
10
- import "./chunk-RJ7AS7UB.js";
9
+ } from "./chunk-NRZV7K4M.js";
10
+ import "./chunk-VVGPAHUN.js";
11
11
  import "./chunk-VXOR76ZL.js";
12
12
  import "./chunk-U6QD3J3F.js";
13
13
  import "./chunk-VOTEB3AN.js";
@@ -5,7 +5,7 @@ import {
5
5
  asksAtStart,
6
6
  setupAtStart,
7
7
  systemLanguage
8
- } from "./chunk-ASHVHS52.js";
8
+ } from "./chunk-MWUHBEDN.js";
9
9
  import "./chunk-AS2PJNQ2.js";
10
10
  import "./chunk-7Z4HR6GO.js";
11
11
  import "./chunk-U6QD3J3F.js";
@@ -4,10 +4,10 @@ import {
4
4
  WIRECAT_TOOLS,
5
5
  firstScreen,
6
6
  installHelp
7
- } from "./chunk-4PA6DJ7F.js";
7
+ } from "./chunk-4MU2UM4C.js";
8
8
  import "./chunk-HTQTIKWP.js";
9
- import "./chunk-BM5ZCDPQ.js";
10
- import "./chunk-RJ7AS7UB.js";
9
+ import "./chunk-NRZV7K4M.js";
10
+ import "./chunk-VVGPAHUN.js";
11
11
  import "./chunk-VXOR76ZL.js";
12
12
  import "./chunk-U6QD3J3F.js";
13
13
  import "./chunk-VOTEB3AN.js";
@@ -9,18 +9,18 @@ import "./chunk-NENYWEXF.js";
9
9
  import "./chunk-LU4A2T7Y.js";
10
10
  import "./chunk-GUFPQZUA.js";
11
11
  import "./chunk-VS5LGSTM.js";
12
- import "./chunk-PX2KP4QE.js";
12
+ import "./chunk-KJ3UADR3.js";
13
13
  import "./chunk-YIVY2WI3.js";
14
14
  import {
15
15
  registerCommands,
16
16
  runCommandForAgent,
17
17
  toolsFromCommands
18
- } from "./chunk-UT5TQ6MD.js";
19
- import "./chunk-HYTHTSJP.js";
18
+ } from "./chunk-7UPBPE3Z.js";
19
+ import "./chunk-NVGOHYTE.js";
20
20
  import {
21
21
  StdioServerTransport
22
22
  } from "./chunk-F34HGYWF.js";
23
- import "./chunk-5SAF3XOL.js";
23
+ import "./chunk-GHF72SHT.js";
24
24
  import "./chunk-PIJUGF5F.js";
25
25
  import "./chunk-2DAXUNTS.js";
26
26
  import "./chunk-AS2PJNQ2.js";
@@ -35,13 +35,13 @@ import {
35
35
  import "./chunk-DZLHY4IA.js";
36
36
  import "./chunk-SOYOOU2D.js";
37
37
  import "./chunk-LATYBJ4T.js";
38
- import "./chunk-RJ7AS7UB.js";
38
+ import "./chunk-VVGPAHUN.js";
39
39
  import "./chunk-VXOR76ZL.js";
40
40
  import "./chunk-U6QD3J3F.js";
41
41
  import "./chunk-VOTEB3AN.js";
42
42
  import {
43
43
  IDENTITY
44
- } from "./chunk-QXOSPYM3.js";
44
+ } from "./chunk-FC53WQHG.js";
45
45
  import "./chunk-NVNUUHT5.js";
46
46
  import "./chunk-R2JKPHH5.js";
47
47
  import "./chunk-YOJLIVGO.js";
@@ -19,18 +19,18 @@ import {
19
19
  import "./chunk-VS5LGSTM.js";
20
20
  import {
21
21
  createBotServer
22
- } from "./chunk-PX2KP4QE.js";
22
+ } from "./chunk-KJ3UADR3.js";
23
23
  import "./chunk-YIVY2WI3.js";
24
24
  import {
25
25
  registerCommands,
26
26
  runCommandForAgent,
27
27
  toolsFromCommands
28
- } from "./chunk-UT5TQ6MD.js";
29
- import "./chunk-HYTHTSJP.js";
28
+ } from "./chunk-7UPBPE3Z.js";
29
+ import "./chunk-NVGOHYTE.js";
30
30
  import {
31
31
  callingAgent
32
32
  } from "./chunk-F34HGYWF.js";
33
- import "./chunk-5SAF3XOL.js";
33
+ import "./chunk-GHF72SHT.js";
34
34
  import "./chunk-PIJUGF5F.js";
35
35
  import "./chunk-2DAXUNTS.js";
36
36
  import "./chunk-AS2PJNQ2.js";
@@ -45,7 +45,7 @@ import {
45
45
  import "./chunk-DZLHY4IA.js";
46
46
  import "./chunk-SOYOOU2D.js";
47
47
  import "./chunk-LATYBJ4T.js";
48
- import "./chunk-RJ7AS7UB.js";
48
+ import "./chunk-VVGPAHUN.js";
49
49
  import "./chunk-VXOR76ZL.js";
50
50
  import "./chunk-U6QD3J3F.js";
51
51
  import "./chunk-VOTEB3AN.js";
@@ -44,7 +44,7 @@ import {
44
44
  syncsFirst,
45
45
  taskStatsAnswer,
46
46
  waitingAnswer
47
- } from "./chunk-BWBZCYUN.js";
47
+ } from "./chunk-NG7MOJBT.js";
48
48
  import {
49
49
  mcpUrlOf,
50
50
  portOf,
@@ -63,7 +63,7 @@ import {
63
63
  skillStatus,
64
64
  skillVersion,
65
65
  withVersion
66
- } from "./chunk-HYTHTSJP.js";
66
+ } from "./chunk-NVGOHYTE.js";
67
67
  import {
68
68
  DAY_MS,
69
69
  DRY_RUN_DAYS,
@@ -103,7 +103,7 @@ import {
103
103
  writeRepliesFile,
104
104
  writeRepliesState,
105
105
  writeReplyConsent
106
- } from "./chunk-BVLPNNEL.js";
106
+ } from "./chunk-EX2FV7YJ.js";
107
107
  import {
108
108
  DEFAULT_PACE,
109
109
  FloodMemory,
@@ -111,6 +111,7 @@ import {
111
111
  RecipientList,
112
112
  SendJournal,
113
113
  answerOf,
114
+ commandPermissions,
114
115
  floodPathFor,
115
116
  holdEnd,
116
117
  knownBeside,
@@ -124,7 +125,7 @@ import {
124
125
  sendsPathFor,
125
126
  terminalAsker,
126
127
  unknownPermissionIssues
127
- } from "./chunk-IZKXJJ7V.js";
128
+ } from "./chunk-KLFYY7KC.js";
128
129
  import {
129
130
  ADMIN_RIGHTS,
130
131
  AGENDA_QUERY,
@@ -298,7 +299,7 @@ import {
298
299
  withQuery,
299
300
  withoutPhone,
300
301
  wrongAccount
301
- } from "./chunk-5SAF3XOL.js";
302
+ } from "./chunk-GHF72SHT.js";
302
303
  import {
303
304
  acquireLock,
304
305
  readBoundedUtf8File,
@@ -316,11 +317,11 @@ import {
316
317
  import {
317
318
  commandsText,
318
319
  installHelp
319
- } from "./chunk-4PA6DJ7F.js";
320
+ } from "./chunk-4MU2UM4C.js";
320
321
  import "./chunk-HTQTIKWP.js";
321
322
  import {
322
323
  setupAtStart
323
- } from "./chunk-ASHVHS52.js";
324
+ } from "./chunk-MWUHBEDN.js";
324
325
  import {
325
326
  installerOf,
326
327
  isNewer,
@@ -353,7 +354,7 @@ import {
353
354
  commandContract,
354
355
  commandPathOf,
355
356
  findCommand
356
- } from "./chunk-BM5ZCDPQ.js";
357
+ } from "./chunk-NRZV7K4M.js";
357
358
  import {
358
359
  AUTHORITY_KEY,
359
360
  Argument,
@@ -544,7 +545,7 @@ import {
544
545
  wasSettled,
545
546
  withLines,
546
547
  withoutProviderRefs
547
- } from "./chunk-RJ7AS7UB.js";
548
+ } from "./chunk-VVGPAHUN.js";
548
549
  import {
549
550
  agentOf,
550
551
  isCliFailure,
@@ -563,7 +564,7 @@ import {
563
564
  IDENTITY,
564
565
  PACKAGE,
565
566
  SKILL
566
- } from "./chunk-QXOSPYM3.js";
567
+ } from "./chunk-FC53WQHG.js";
567
568
  import {
568
569
  ACCOUNT_GROUPS_SETTING,
569
570
  ATTACHMENT_LIMIT_ENV,
@@ -2086,14 +2087,14 @@ var PreviewComplete = class extends Error {
2086
2087
  };
2087
2088
  var preview = /* @__PURE__ */ __name((command, settings, tool, keys, messenger = true) => {
2088
2089
  const path = commandPathOf(command);
2089
- const { permissions } = settings;
2090
+ const { permissions: permissions2 } = settings;
2090
2091
  const declared = typeof keys === "object" ? keys : void 0;
2091
2092
  const keyOf3 = typeof keys === "object" ? keys.keyOf : keys;
2092
2093
  refuseUnknownPermissionKeys(command, settings, tool, declared ?? (keyOf3 && ((one) => keyOf3(commandPathOf(one)))));
2093
2094
  const key = declared ? declared.keyOf(path) : keyOf3?.(path) ?? keyForCommand(path);
2094
- const level = key ? levelFor(permissions, key, declared?.defaults).level : "allow";
2095
+ const level = key ? levelFor(permissions2, key, declared?.defaults).level : "allow";
2095
2096
  for (const source of declared ? [] : readKeysForCommand(path)) {
2096
- if (levelFor(permissions, source).level === "deny")
2097
+ if (levelFor(permissions2, source).level === "deny")
2097
2098
  throw new CliError("permission_error", `this profile does not permit ${source}`, { permission: source });
2098
2099
  }
2099
2100
  const meta = metaOf(command);
@@ -2102,7 +2103,7 @@ var preview = /* @__PURE__ */ __name((command, settings, tool, keys, messenger =
2102
2103
  throw new CliError("permission_error", `this profile does not permit ${path.join(" ")}`, { permission: key });
2103
2104
  const also = (declared?.alsoChecks?.(path) ?? []).map((one) => ({
2104
2105
  key: one,
2105
- level: levelFor(permissions, one, declared?.defaults).level
2106
+ level: levelFor(permissions2, one, declared?.defaults).level
2106
2107
  }));
2107
2108
  const stopped = also.find((one) => one.level === "deny" || writes2 && one.level === "readonly");
2108
2109
  if (stopped)
@@ -5416,11 +5417,11 @@ var messengerHost = /* @__PURE__ */ __name((messenger) => ({
5416
5417
  context: /* @__PURE__ */ __name((self, options) => messengerContext(self, messenger, options), "context"),
5417
5418
  permissionExample: "messages.send=deny",
5418
5419
  serveStdio: /* @__PURE__ */ __name(async (self, context) => {
5419
- const { serveOverStdio } = await import("./server-5VYM7CCF.js");
5420
+ const { serveOverStdio } = await import("./server-GQX5MZTT.js");
5420
5421
  await serveOverStdio(self, context, messenger, {});
5421
5422
  }, "serveStdio"),
5422
5423
  serveHttp: /* @__PURE__ */ __name(async (self, context, http) => {
5423
- const { serveOverHttpUntilStopped } = await import("./server-5VYM7CCF.js");
5424
+ const { serveOverHttpUntilStopped } = await import("./server-GQX5MZTT.js");
5424
5425
  await serveOverHttpUntilStopped(self, context, messenger, {}, http);
5425
5426
  }, "serveHttp"),
5426
5427
  instructions: /* @__PURE__ */ __name(async (profiles) => {
@@ -9277,12 +9278,12 @@ var appMcpCommand = /* @__PURE__ */ __name((app, configuration2, options) => {
9277
9278
  permissionExample: options.permissionExample,
9278
9279
  serveStdio: /* @__PURE__ */ __name(async (self, context) => {
9279
9280
  checked2(self, context);
9280
- const { serveAppOverStdio } = await import("./app-server-B6BCKXR7.js");
9281
+ const { serveAppOverStdio } = await import("./app-server-OW5LT5XV.js");
9281
9282
  await serveAppOverStdio(self, context, server());
9282
9283
  }, "serveStdio"),
9283
9284
  serveHttp: /* @__PURE__ */ __name(async (self, context, http) => {
9284
9285
  checked2(self, context);
9285
- const { serveAppOverHttp } = await import("./app-server-B6BCKXR7.js");
9286
+ const { serveAppOverHttp } = await import("./app-server-OW5LT5XV.js");
9286
9287
  await serveAppOverHttp(self, context, server(), http);
9287
9288
  }, "serveHttp"),
9288
9289
  instructions: /* @__PURE__ */ __name(async (profiles) => {
@@ -9862,7 +9863,7 @@ var botMcpCommand = /* @__PURE__ */ __name((bot) => {
9862
9863
  const mcp = bot.mcp;
9863
9864
  if (!mcp)
9864
9865
  throw new Error("bot mcp is mounted only with BotMessenger.mcp");
9865
- const [{ serveBotOverStdio }, run3] = await Promise.all([import("./server-2ZN7KZHZ.js"), mcp.program()]);
9866
+ const [{ serveBotOverStdio }, run3] = await Promise.all([import("./server-3TPCEZ6P.js"), mcp.program()]);
9866
9867
  await serveBotOverStdio({
9867
9868
  bot,
9868
9869
  program: { run: run3, commands: describeProgram(rootOf2(this)) },
@@ -14552,8 +14553,8 @@ var CONTACTS_QUERY = {
14552
14553
  validate: { notes: notesText }
14553
14554
  })
14554
14555
  };
14555
- var notesAllowed = /* @__PURE__ */ __name((permissions, notes2) => {
14556
- if (notes2 && levelFor(permissions, "contacts.notes.list").level === "deny")
14556
+ var notesAllowed = /* @__PURE__ */ __name((permissions2, notes2) => {
14557
+ if (notes2 && levelFor(permissions2, "contacts.notes.list").level === "deny")
14557
14558
  throw new CliError("permission_error", "profile denies contacts.notes.list");
14558
14559
  }, "notesAllowed");
14559
14560
  var VOTERS_QUERY = {
@@ -18890,7 +18891,8 @@ import { existsSync as existsSync18 } from "node:fs";
18890
18891
  import { dirname as dirname8 } from "node:path";
18891
18892
 
18892
18893
  // dist/config.js
18893
- var configuration = settingsFor(IDENTITY);
18894
+ var permissions = commandPermissions();
18895
+ var configuration = settingsFor(IDENTITY, { permissions });
18894
18896
 
18895
18897
  // dist/commands/doctor.js
18896
18898
  var failure2 = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "failure");
@@ -18985,10 +18987,10 @@ var serveCommand3 = /* @__PURE__ */ __name(() => annotate(new Command("serve"),
18985
18987
  run: run3,
18986
18988
  ...environment.signal ? { signal: environment.signal } : {}
18987
18989
  };
18988
- const { serveMcp, serveMcpOverHttp } = await import("./mcp-MZHWJXAE.js");
18990
+ const { serveMcp, serveMcpOverHttp } = await import("./mcp-ASNYBQ5B.js");
18989
18991
  if (!flags.http)
18990
18992
  return serveMcp(options);
18991
- const { portOf: portOf2, publicUrlOf: publicUrlOf2 } = await import("./mcp-KHUZOJO6.js");
18993
+ const { portOf: portOf2, publicUrlOf: publicUrlOf2 } = await import("./mcp-EY2NUYDQ.js");
18992
18994
  const { renderer } = outputFor(this);
18993
18995
  await serveMcpOverHttp(options, {
18994
18996
  publicUrl: publicUrlOf2(flags.publicUrl, {
@@ -19008,7 +19010,7 @@ var revokeCommand = /* @__PURE__ */ __name(() => annotate(new Command("revoke"),
19008
19010
  }).summary("forget every login given to a browser app").description("forget every login `mcp serve --http` gave a browser app; each must log in again").action(async function() {
19009
19011
  refuseUnderReadOnly(this, "mcp revoke");
19010
19012
  const { profile, tokenFile } = settingsOf2(this);
19011
- const { revokeAll } = await import("./mcp-KHUZOJO6.js");
19013
+ const { revokeAll } = await import("./mcp-EY2NUYDQ.js");
19012
19014
  revokeAll(tokenFile);
19013
19015
  renderAnswer(this, outputFor(this), itemOf({ revoked: true, profile }));
19014
19016
  }), "revokeCommand");
@@ -19041,7 +19043,8 @@ var update = appUpdate({
19041
19043
  });
19042
19044
  var definition = /* @__PURE__ */ __name(() => ({
19043
19045
  app: IDENTITY,
19044
- configuration: { resolveSettings: configuration.resolveSettings },
19046
+ // The whole object: cli-core refuses a command by its key only when it gets the permission table too.
19047
+ configuration,
19045
19048
  commands: /* @__PURE__ */ __name(() => [
19046
19049
  commandsCommand2(IDENTITY),
19047
19050
  doctorCommand3(),
@@ -3,12 +3,12 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  createBotServer,
5
5
  serveBotOverStdio
6
- } from "./chunk-PX2KP4QE.js";
6
+ } from "./chunk-KJ3UADR3.js";
7
7
  import "./chunk-YIVY2WI3.js";
8
- import "./chunk-UT5TQ6MD.js";
9
- import "./chunk-HYTHTSJP.js";
8
+ import "./chunk-7UPBPE3Z.js";
9
+ import "./chunk-NVGOHYTE.js";
10
10
  import "./chunk-F34HGYWF.js";
11
- import "./chunk-5SAF3XOL.js";
11
+ import "./chunk-GHF72SHT.js";
12
12
  import "./chunk-PIJUGF5F.js";
13
13
  import "./chunk-2DAXUNTS.js";
14
14
  import "./chunk-AS2PJNQ2.js";
@@ -16,7 +16,7 @@ import "./chunk-7Z4HR6GO.js";
16
16
  import "./chunk-5D4AEUVA.js";
17
17
  import "./chunk-SOYOOU2D.js";
18
18
  import "./chunk-LATYBJ4T.js";
19
- import "./chunk-RJ7AS7UB.js";
19
+ import "./chunk-VVGPAHUN.js";
20
20
  import "./chunk-VXOR76ZL.js";
21
21
  import "./chunk-U6QD3J3F.js";
22
22
  import "./chunk-VOTEB3AN.js";
@@ -6,15 +6,15 @@ import {
6
6
  envelope,
7
7
  serveOverHttpUntilStopped,
8
8
  serveOverStdio
9
- } from "./chunk-BEBD27QT.js";
10
- import "./chunk-BWBZCYUN.js";
9
+ } from "./chunk-5GTMQTQH.js";
10
+ import "./chunk-NG7MOJBT.js";
11
11
  import "./chunk-GUFPQZUA.js";
12
12
  import "./chunk-VS5LGSTM.js";
13
- import "./chunk-UT5TQ6MD.js";
14
- import "./chunk-HYTHTSJP.js";
13
+ import "./chunk-7UPBPE3Z.js";
14
+ import "./chunk-NVGOHYTE.js";
15
15
  import "./chunk-F34HGYWF.js";
16
- import "./chunk-IZKXJJ7V.js";
17
- import "./chunk-5SAF3XOL.js";
16
+ import "./chunk-KLFYY7KC.js";
17
+ import "./chunk-GHF72SHT.js";
18
18
  import "./chunk-PIJUGF5F.js";
19
19
  import "./chunk-2DAXUNTS.js";
20
20
  import "./chunk-AS2PJNQ2.js";
@@ -25,8 +25,8 @@ import "./chunk-6AW4DDK4.js";
25
25
  import "./chunk-DZLHY4IA.js";
26
26
  import "./chunk-SOYOOU2D.js";
27
27
  import "./chunk-LATYBJ4T.js";
28
- import "./chunk-BM5ZCDPQ.js";
29
- import "./chunk-RJ7AS7UB.js";
28
+ import "./chunk-NRZV7K4M.js";
29
+ import "./chunk-VVGPAHUN.js";
30
30
  import "./chunk-VXOR76ZL.js";
31
31
  import "./chunk-U6QD3J3F.js";
32
32
  import "./chunk-VOTEB3AN.js";
@@ -4,9 +4,9 @@ import {
4
4
  buildStems,
5
5
  storeMaintenanceCommands,
6
6
  storeSummary
7
- } from "./chunk-BVLPNNEL.js";
8
- import "./chunk-IZKXJJ7V.js";
9
- import "./chunk-5SAF3XOL.js";
7
+ } from "./chunk-EX2FV7YJ.js";
8
+ import "./chunk-KLFYY7KC.js";
9
+ import "./chunk-GHF72SHT.js";
10
10
  import "./chunk-PIJUGF5F.js";
11
11
  import "./chunk-G7W53MQP.js";
12
12
  import "./chunk-2DAXUNTS.js";
@@ -17,7 +17,7 @@ import "./chunk-DZLHY4IA.js";
17
17
  import "./chunk-SOYOOU2D.js";
18
18
  import "./chunk-R5RYPD23.js";
19
19
  import "./chunk-LATYBJ4T.js";
20
- import "./chunk-RJ7AS7UB.js";
20
+ import "./chunk-VVGPAHUN.js";
21
21
  import "./chunk-VXOR76ZL.js";
22
22
  import "./chunk-U6QD3J3F.js";
23
23
  import "./chunk-VOTEB3AN.js";
package/dist/config.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  import { type Configuration } from "@wirecat/cli-core/cli";
2
+ /** Each command is checked against its own path (`notes.list`); add the keys a command checks inside itself. */
3
+ export declare const permissions: import("@wirecat/cli-core/cli").CommandPermissions;
2
4
  export declare const configuration: Configuration;
3
5
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAe,MAAM,uBAAuB,CAAA;AAGvE,eAAO,MAAM,aAAa,EAAE,aAAqC,CAAA"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAmC,MAAM,uBAAuB,CAAA;AAG3F,gHAAgH;AAChH,eAAO,MAAM,WAAW,oDAAuB,CAAA;AAE/C,eAAO,MAAM,aAAa,EAAE,aAAsD,CAAA"}
package/dist/config.js CHANGED
@@ -1,4 +1,6 @@
1
- import { settingsFor } from "@wirecat/cli-core/cli";
1
+ import { commandPermissions, settingsFor } from "@wirecat/cli-core/cli";
2
2
  import { IDENTITY } from "./identity.js";
3
- export const configuration = settingsFor(IDENTITY);
3
+ /** Each command is checked against its own path (`notes.list`); add the keys a command checks inside itself. */
4
+ export const permissions = commandPermissions();
5
+ export const configuration = settingsFor(IDENTITY, { permissions });
4
6
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,MAAM,CAAC,MAAM,aAAa,GAAkB,WAAW,CAAC,QAAQ,CAAC,CAAA"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,kBAAkB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC3F,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,gHAAgH;AAChH,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAA;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAkB,WAAW,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,UAAU,EAKhB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAiBxC,eAAO,MAAM,UAAU,QAAO,iBAiB5B,CAAA;AAEF,eAAO,MAAM,aAAa,aAAc,cAAc,KAAG,OAAqD,CAAA;AAE9G,eAAO,MAAM,GAAG,SAAU,MAAM,EAAE,YAAY,UAAU,KAAG,OAAO,CAAC,MAAM,CAA2C,CAAA"}
1
+ {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,UAAU,EAKhB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAiBxC,eAAO,MAAM,UAAU,QAAO,iBAkB5B,CAAA;AAEF,eAAO,MAAM,aAAa,aAAc,cAAc,KAAG,OAAqD,CAAA;AAE9G,eAAO,MAAM,GAAG,SAAU,MAAM,EAAE,YAAY,UAAU,KAAG,OAAO,CAAC,MAAM,CAA2C,CAAA"}
package/dist/program.js CHANGED
@@ -17,7 +17,8 @@ const update = appUpdate({
17
17
  });
18
18
  export const definition = () => ({
19
19
  app: IDENTITY,
20
- configuration: { resolveSettings: configuration.resolveSettings },
20
+ // The whole object: cli-core refuses a command by its key only when it gets the permission table too.
21
+ configuration,
21
22
  commands: () => [
22
23
  commandsCommand(IDENTITY),
23
24
  doctorCommand(),
@@ -1 +1 @@
1
- {"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EACL,eAAe,EACf,aAAa,EACb,aAAa,IAAI,mBAAmB,EACpC,SAAS,EAIT,GAAG,IAAI,SAAS,EAChB,WAAW,EACX,YAAY,EACZ,cAAc,GACf,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAExD,MAAM,MAAM,GAAG,SAAS,CAAC;IACvB,WAAW,EAAE,OAAO;IACpB,OAAO,EAAE,QAAQ,CAAC,OAAO;IACzB,OAAO,EAAE,QAAQ,CAAC,OAAO;IACzB,KAAK,EAAE,OAAO,IAAI,CAAC,GAAG;IACtB,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CACjB,IAAI,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,EAAE,mBAAmB,CAAC;IAC/G,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,WAAW;IAC7F,YAAY,EAAE,CAAC,GAAG,QAAQ,CAAC,SAAS,kBAAkB,CAAC;CACxD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,GAAsB,EAAE,CAAC,CAAC;IAClD,GAAG,EAAE,QAAQ;IACb,aAAa,EAAE,EAAE,eAAe,EAAE,aAAa,CAAC,eAAe,EAAE;IACjE,QAAQ,EAAE,GAAG,EAAE,CAAC;QACd,eAAe,CAAC,QAAQ,CAAC;QACzB,aAAa,EAAE;QACf,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC;QAC7B,UAAU,EAAE;QACZ,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC9C,GAAG,SAAS,CAAC,OAAO,CAAC;YACrB,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;YACrC,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/B,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;SAC9C,CAAC,CAAC;QACH,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC;QACtC,WAAW,CAAC,QAAQ,CAAC;KACtB;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAwB,EAAW,EAAE,CAAC,mBAAmB,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,CAAA;AAE9G,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,IAAc,EAAE,OAAoB,EAAmB,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,CAAA"}
1
+ {"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EACL,eAAe,EACf,aAAa,EACb,aAAa,IAAI,mBAAmB,EACpC,SAAS,EAIT,GAAG,IAAI,SAAS,EAChB,WAAW,EACX,YAAY,EACZ,cAAc,GACf,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAExD,MAAM,MAAM,GAAG,SAAS,CAAC;IACvB,WAAW,EAAE,OAAO;IACpB,OAAO,EAAE,QAAQ,CAAC,OAAO;IACzB,OAAO,EAAE,QAAQ,CAAC,OAAO;IACzB,KAAK,EAAE,OAAO,IAAI,CAAC,GAAG;IACtB,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CACjB,IAAI,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,EAAE,mBAAmB,CAAC;IAC/G,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,WAAW;IAC7F,YAAY,EAAE,CAAC,GAAG,QAAQ,CAAC,SAAS,kBAAkB,CAAC;CACxD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,GAAsB,EAAE,CAAC,CAAC;IAClD,GAAG,EAAE,QAAQ;IACb,sGAAsG;IACtG,aAAa;IACb,QAAQ,EAAE,GAAG,EAAE,CAAC;QACd,eAAe,CAAC,QAAQ,CAAC;QACzB,aAAa,EAAE;QACf,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC;QAC7B,UAAU,EAAE;QACZ,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAC9C,GAAG,SAAS,CAAC,OAAO,CAAC;YACrB,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;YACrC,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/B,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC;SAC9C,CAAC,CAAC;QACH,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC;QACtC,WAAW,CAAC,QAAQ,CAAC;KACtB;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAwB,EAAW,EAAE,CAAC,mBAAmB,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,CAAA;AAE9G,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,IAAc,EAAE,OAAoB,EAAmB,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,CAAA"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.14.0";
1
+ export declare const VERSION = "0.15.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = "0.14.0";
1
+ export const VERSION = "0.15.0";
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-template",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Start a new WireCat CLI: a working skeleton on cli-base and cli-core, copied by new and kept current by upgrade",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Viacheslav Ptsarev",
package/src/config.ts CHANGED
@@ -1,4 +1,7 @@
1
- import { type Configuration, settingsFor } from "@wirecat/cli-core/cli"
1
+ import { type Configuration, commandPermissions, settingsFor } from "@wirecat/cli-core/cli"
2
2
  import { IDENTITY } from "./identity.js"
3
3
 
4
- export const configuration: Configuration = settingsFor(IDENTITY)
4
+ /** Each command is checked against its own path (`notes.list`); add the keys a command checks inside itself. */
5
+ export const permissions = commandPermissions()
6
+
7
+ export const configuration: Configuration = settingsFor(IDENTITY, { permissions })
@@ -1,10 +1,13 @@
1
1
  import { chmodSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs"
2
2
  import { join } from "node:path"
3
+ import { annotate } from "@wirecat/cli-base/commands"
4
+ import { REMOTE_READ, run as runShared } from "@wirecat/cli-core/cli"
5
+ import { Command } from "commander"
3
6
  import { expect, it, vi } from "vitest"
4
7
  import { doctorReport } from "./commands/doctor.js"
5
8
  import { configuration } from "./config.js"
6
9
  import { IDENTITY } from "./identity.js"
7
- import { run } from "./program.js"
10
+ import { definition, run } from "./program.js"
8
11
 
9
12
  const ran = async (argv: string[]) => {
10
13
  const out: string[] = []
@@ -233,3 +236,29 @@ it("config repair --dry-run changes nothing, and config repair fixes the JSON wi
233
236
  if (backup) rmSync(backup)
234
237
  }
235
238
  })
239
+
240
+ it("a deny in the profile stops a read command before its action runs", async () => {
241
+ const reached: string[] = []
242
+ const probe = annotate(new Command("probe"), { effects: REMOTE_READ, offline: false }).action(() => {
243
+ reached.push("probe")
244
+ })
245
+ const withProbe = { ...definition(), commands: () => [...definition().commands(), probe] }
246
+ const dir = process.env.CLIDEV_CONFIG_DIR ?? ""
247
+ mkdirSync(dir, { recursive: true })
248
+ writeFileSync(
249
+ join(dir, "config.json"),
250
+ JSON.stringify({ profiles: { personal: { permissions: { probe: "deny" } } } }),
251
+ )
252
+ const err: string[] = []
253
+ try {
254
+ const code = await runShared(["personal", "probe", "--json"], withProbe, {
255
+ streams: { data: () => {}, diagnostic: (text) => err.push(text) },
256
+ tty: false,
257
+ })
258
+ expect(code).not.toBe(0)
259
+ expect(err.join("\n")).toContain("permission_error")
260
+ expect(reached).toEqual([])
261
+ } finally {
262
+ rmSync(join(dir, "config.json"))
263
+ }
264
+ })
package/src/program.ts CHANGED
@@ -33,7 +33,8 @@ const update = appUpdate({
33
33
 
34
34
  export const definition = (): ProgramDefinition => ({
35
35
  app: IDENTITY,
36
- configuration: { resolveSettings: configuration.resolveSettings },
36
+ // The whole object: cli-core refuses a command by its key only when it gets the permission table too.
37
+ configuration,
37
38
  commands: () => [
38
39
  commandsCommand(IDENTITY),
39
40
  doctorCommand(),
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.14.0"
1
+ export const VERSION = "0.15.0"