@mrciphersmith/keryx 0.4.36 → 0.4.38

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/core.js CHANGED
@@ -25103,6 +25103,45 @@ var init_templates2 = __esm(() => {
25103
25103
  ];
25104
25104
  });
25105
25105
 
25106
+ // src/wiki/page-groups.ts
25107
+ function parseGroupSize(raw) {
25108
+ const text = raw.trim();
25109
+ const match = /^(\d+)(?:\s*-\s*(\d+))?$/.exec(text);
25110
+ if (match === null) {
25111
+ throw new Error(`--group-size must be N or MIN-MAX (e.g. 10-20), got "${raw}"`);
25112
+ }
25113
+ const min = Number.parseInt(match[1], 10);
25114
+ const max = match[2] !== undefined ? Number.parseInt(match[2], 10) : min;
25115
+ if (min < 1 || max < min) {
25116
+ throw new Error(`--group-size needs 1 <= MIN <= MAX, got "${raw}"`);
25117
+ }
25118
+ if (max > MAX_GROUP_SIZE) {
25119
+ throw new Error(`--group-size MAX is capped at ${MAX_GROUP_SIZE}, got ${max}`);
25120
+ }
25121
+ return { min, max };
25122
+ }
25123
+ function parsePagesArgument(raw, readFile) {
25124
+ const fromFile = readFile(raw);
25125
+ const text = fromFile ?? raw;
25126
+ const trimmed = text.trim();
25127
+ if (fromFile !== null && trimmed.startsWith("[")) {
25128
+ const parsed = JSON.parse(trimmed);
25129
+ if (!Array.isArray(parsed) || !parsed.every((v) => typeof v === "string")) {
25130
+ throw new Error(`--pages file ${raw} must hold a JSON array of strings`);
25131
+ }
25132
+ return dedupe2(parsed.map((v) => v.trim()).filter((v) => v.length > 0));
25133
+ }
25134
+ return dedupe2(trimmed.split(/[\n,]/).map((v) => v.trim()).filter((v) => v.length > 0 && !v.startsWith("#")));
25135
+ }
25136
+ function dedupe2(values) {
25137
+ return [...new Set(values)];
25138
+ }
25139
+ var DEFAULT_GROUP_SIZE, MAX_GROUP_SIZE = 50;
25140
+ var init_page_groups = __esm(() => {
25141
+ init_backlinks();
25142
+ DEFAULT_GROUP_SIZE = { min: 10, max: 20 };
25143
+ });
25144
+
25106
25145
  // src/wiki/template-structure.ts
25107
25146
  function validateTemplateStructure(pageType, content, options = {}) {
25108
25147
  const kind = options.template ?? templateKindForPageType(pageType);
@@ -25225,6 +25264,7 @@ var init_template_structure = __esm(() => {
25225
25264
  // src/wiki/service.ts
25226
25265
  var exports_service4 = {};
25227
25266
  __export(exports_service4, {
25267
+ DEFAULT_GROUP_SIZE: () => DEFAULT_GROUP_SIZE,
25228
25268
  collectGraphWikiCandidates: () => collectGraphWikiCandidates,
25229
25269
  createGdWikiService: () => createGdWikiService,
25230
25270
  extractModuleApi: () => extractModuleApi,
@@ -25233,6 +25273,8 @@ __export(exports_service4, {
25233
25273
  moduleNameFromProjectPath: () => moduleNameFromProjectPath,
25234
25274
  openWikiWriteContext: () => openWikiWriteContext,
25235
25275
  pageHistoryDir: () => pageHistoryDir,
25276
+ parseGroupSize: () => parseGroupSize,
25277
+ parsePagesArgument: () => parsePagesArgument,
25236
25278
  parseVersionLabel: () => parseVersionLabel,
25237
25279
  printWikiUndoHint: () => printWikiUndoHint,
25238
25280
  readPageHistory: () => readPageHistory,
@@ -26470,6 +26512,7 @@ var init_service4 = __esm(() => {
26470
26512
  init_templates2();
26471
26513
  init_types3();
26472
26514
  init_history();
26515
+ init_page_groups();
26473
26516
  EXTERNAL_LINK = /^(https?:|mailto:|tel:)/i;
26474
26517
  WIKI_PAGE_PRODUCERS = [
26475
26518
  {
@@ -49018,6 +49061,12 @@ var HELP_GROUPS = [
49018
49061
  group: "External agents, ACP and MCP",
49019
49062
  summary: "Speak ACP v1 (newline-delimited JSON-RPC) over stdio, for an ACP client (e.g. an editor)."
49020
49063
  },
49064
+ {
49065
+ kind: "cli",
49066
+ name: "app",
49067
+ group: "External agents, ACP and MCP",
49068
+ summary: "Install, update, build or check the Keryx desktop app (macOS), the ACP client over keryx acp --profile shell."
49069
+ },
49021
49070
  {
49022
49071
  kind: "cli",
49023
49072
  name: "agents",
@@ -21794,6 +21794,11 @@ var init_templates2 = __esm(() => {
21794
21794
  init_types3();
21795
21795
  });
21796
21796
 
21797
+ // src/wiki/page-groups.ts
21798
+ var init_page_groups = __esm(() => {
21799
+ init_backlinks();
21800
+ });
21801
+
21797
21802
  // src/wiki/service.ts
21798
21803
  var init_service4 = __esm(() => {
21799
21804
  init_data_dir();
@@ -21813,6 +21818,7 @@ var init_service4 = __esm(() => {
21813
21818
  init_templates2();
21814
21819
  init_types3();
21815
21820
  init_history();
21821
+ init_page_groups();
21816
21822
  });
21817
21823
 
21818
21824
  // src/sac/preserved-wrap-up.ts
@@ -36618,6 +36624,17 @@ var TURN_INTERRUPTED_LINE = `
36618
36624
  [stopped] Model turn interrupted by user.
36619
36625
  `;
36620
36626
  var usageAnchors = new WeakMap;
36627
+ function isFloorExemptMcpCall(call, exempt) {
36628
+ if (exempt === undefined || call.name !== "use_tool")
36629
+ return false;
36630
+ try {
36631
+ const parsed = JSON.parse(call.input);
36632
+ const fqn = typeof parsed === "object" && parsed !== null ? parsed.tool_name : undefined;
36633
+ return typeof fqn === "string" && exempt(fqn);
36634
+ } catch {
36635
+ return false;
36636
+ }
36637
+ }
36621
36638
  var RECOVERY_MAX_DELAY_MS = 60000;
36622
36639
  var RECOVERY_MAX_RETRY_AFTER_MS = 300000;
36623
36640
  function recoveryDelayMs(attempt, retryAfterMs, random) {
@@ -38465,7 +38482,7 @@ ${shown.join(`
38465
38482
  }
38466
38483
  const risk = toolByName.get(call.name)?.definition.risk;
38467
38484
  const isPureReadTool = risk === "read" && !DURABLE_READ_TOOL_NAMES.has(call.name);
38468
- const untrustedOrigin = !isPureReadTool && untrustedContentSeen;
38485
+ const untrustedOrigin = !isPureReadTool && untrustedContentSeen && !isFloorExemptMcpCall(call, io.mcpFloorExempt);
38469
38486
  if (untrustedOrigin && deps.unattended === true) {
38470
38487
  const result = {
38471
38488
  output: "tool blocked: external web content cannot authorize further tool calls in this turn",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrciphersmith/keryx",
3
- "version": "0.4.36",
3
+ "version": "0.4.38",
4
4
  "description": "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -40,6 +40,7 @@
40
40
  },
41
41
  "scripts": {
42
42
  "keryx": "bun ./src/cli.ts",
43
+ "desktop:build": "bash scripts/desktop/build.sh",
43
44
  "build": "bun scripts/build-hub-web.ts --check && bun build ./src/cli.ts --outdir ./dist --target bun --external @modelcontextprotocol/sdk --external web-tree-sitter --external @opentui/core && bun build ./src/core.ts --outdir ./dist --target bun --external @modelcontextprotocol/sdk --external web-tree-sitter --external @opentui/core && bun build ./src/harness/process/sandbox/proxy-worker.ts --outdir ./dist --target bun --external @modelcontextprotocol/sdk --external web-tree-sitter --external @opentui/core && bun build ./src/commands/review-agents-runtime/keryx-general-worker-entry.ts --outdir ./dist --target bun --external @modelcontextprotocol/sdk --external web-tree-sitter --external @opentui/core",
44
45
  "prepare": "bun run build",
45
46
  "typecheck": "tsc --noEmit",
@@ -32,9 +32,12 @@ operator reads in the shell's Schedules section.
32
32
  "sometimes". Ask.
33
33
  - **Prompt**: the task in the operator's words, written for an agent that runs
34
34
  alone and whose final message is the report.
35
- - **Budget**: `rates` (USD per million input/output tokens for the model) and
36
- `ceilingUsd`. keryx has no price table. If you do not know the rates, ASK.
37
- Never guess them.
35
+ - **Permission mode**: ASK which one the unattended run uses: `ask` (commands
36
+ needing approval are DENIED), `trust` (non-destructive commands run in the
37
+ sandbox) or `auto` (all but credential-touching ones run in the sandbox).
38
+ - **Cost** (optional): `rates` (USD per million tokens) only prices the report;
39
+ `ceilingUsd` is informational. Cost is reported, never a limit. No price
40
+ table: if rates are unknown, leave them out. Never guess them.
38
41
 
39
42
  ### Step 2: Grant only what the task needs
40
43
  - `tools`: pick from the fixed catalogue: `gh.pr.list`, `gh.pr.view`,
@@ -48,12 +51,10 @@ operator reads in the shell's Schedules section.
48
51
  tools cover it. `full` hands the shell the whole host network; say why. `allowlist`
49
52
  (Linux only, `domains` required) reaches only the named domains, and governs only
50
53
  the agent's own shell — never the model call or a granted tool.
51
- - `permissionMode`: `ask` (the default) is read-only, and granted tools still run.
52
- Propose `trust` only when the scheduled agent must run shell commands.
53
54
 
54
55
  ### Step 3: Propose with schedule_create
55
56
  Call `schedule_create`. The operator then sees a confirmation card: cadence and
56
- next runs, prompt, runner, budget, network, every granted tool with its binary
57
+ next runs, prompt, runner, permission mode, network, every granted tool with its binary
57
58
  and account, and exactly what gets installed. You do not confirm it. Only the
58
59
  operator can, and every permission mode asks, `auto` included. Changing an existing schedule works the same way (`schedule_pause`, `schedule_resume`, `schedule_run`, `schedule_remove`): the operator answers a card; never send them to a terminal.
59
60
 
@@ -85,7 +86,6 @@ that nothing was written. Point to `/schedules` for the list and the reports.
85
86
  | "The operator said 'every so often' — I'll pick hourly" | A cadence runs and spends unattended. Ask for it |
86
87
  | "I'll grant every gh tool so the agent is not stuck" | Grants are the operator's credentials acting unattended. Grant what the prompt needs |
87
88
  | "Network full is simpler than granted tools" | It gives the unattended shell the whole host network. Granted tools need none |
88
- | "I know roughly what the model costs" | A wrong rate makes both spend ceilings wrong by the same factor. Ask |
89
89
 
90
90
  ## Verification
91
91