@mrciphersmith/keryx 0.4.58 → 0.4.59
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/cli.js
CHANGED
|
@@ -38567,7 +38567,7 @@ var package_default;
|
|
|
38567
38567
|
var init_package = __esm(() => {
|
|
38568
38568
|
package_default = {
|
|
38569
38569
|
name: "@mrciphersmith/keryx",
|
|
38570
|
-
version: "0.4.
|
|
38570
|
+
version: "0.4.59",
|
|
38571
38571
|
description: "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
|
|
38572
38572
|
private: false,
|
|
38573
38573
|
publishConfig: {
|
|
@@ -53516,7 +53516,7 @@ var init_operator_decisions = __esm(() => {
|
|
|
53516
53516
|
init_json();
|
|
53517
53517
|
init_types();
|
|
53518
53518
|
OPERATOR_DECISION_KINDS = ["mutation-waiver", "reviewer-override"];
|
|
53519
|
-
VIAS = ["tui-card", "remote-card", "terminal", "host-question"];
|
|
53519
|
+
VIAS = ["tui-card", "remote-card", "desktop-card", "terminal", "host-question"];
|
|
53520
53520
|
});
|
|
53521
53521
|
|
|
53522
53522
|
// src/lib/git-env.ts
|
|
@@ -56064,7 +56064,7 @@ function readCoverageWaiver(dispatch) {
|
|
|
56064
56064
|
if (waiver === undefined || !text3(waiver.operatorQuote) || !text3(waiver.time))
|
|
56065
56065
|
return;
|
|
56066
56066
|
const files = Array.isArray(waiver.files) ? waiver.files.filter(text3) : [];
|
|
56067
|
-
const via = waiver.confirmedVia === "tui-card" || waiver.confirmedVia === "remote-card" || waiver.confirmedVia === "host-question" ? waiver.confirmedVia : undefined;
|
|
56067
|
+
const via = waiver.confirmedVia === "tui-card" || waiver.confirmedVia === "remote-card" || waiver.confirmedVia === "desktop-card" || waiver.confirmedVia === "host-question" ? waiver.confirmedVia : undefined;
|
|
56068
56068
|
const pressedBy = typeof waiver.pressedBy === "number" && Number.isSafeInteger(waiver.pressedBy) ? waiver.pressedBy : undefined;
|
|
56069
56069
|
const pressedAt = text3(waiver.pressedAt) ? waiver.pressedAt : undefined;
|
|
56070
56070
|
return { operatorQuote: waiver.operatorQuote, time: waiver.time, files, ...via === undefined ? {} : { confirmedVia: via }, ...cardPressFields({ pressedBy, pressedAt }), ...via === "host-question" && isHostQuestion(waiver.hostQuestion) ? { hostQuestion: waiver.hostQuestion } : {} };
|
|
@@ -60955,7 +60955,7 @@ function flowStateSchema() {
|
|
|
60955
60955
|
additionalProperties: true,
|
|
60956
60956
|
required: ["mechanism", "tokenRef", "mintedAt", "consumedAt", "boundTo"],
|
|
60957
60957
|
properties: {
|
|
60958
|
-
mechanism: { type: "string", enum: ["terminal-token", "tui-card-token", "remote-card-token"] },
|
|
60958
|
+
mechanism: { type: "string", enum: ["terminal-token", "tui-card-token", "remote-card-token", "desktop-card-token"] },
|
|
60959
60959
|
tokenRef: { type: "string", description: "A prefix of the stored token hash. Never the token." },
|
|
60960
60960
|
mintedAt: { type: "string" },
|
|
60961
60961
|
consumedAt: { type: "string" },
|
|
@@ -62328,7 +62328,7 @@ async function consumeConfirmationToken(cwd, dir, stored, now) {
|
|
|
62328
62328
|
const consumedAt = now.toISOString();
|
|
62329
62329
|
await writeFileAtomic(confirmTokenPath(cwd, dir), `${JSON.stringify({ ...stored, usedAt: consumedAt }, null, 2)}
|
|
62330
62330
|
`);
|
|
62331
|
-
const mechanism = stored.confirmedVia === "tui-card" ? "tui-card-token" : stored.confirmedVia === "remote-card" ? "remote-card-token" : "terminal-token";
|
|
62331
|
+
const mechanism = stored.confirmedVia === "tui-card" ? "tui-card-token" : stored.confirmedVia === "remote-card" ? "remote-card-token" : stored.confirmedVia === "desktop-card" ? "desktop-card-token" : "terminal-token";
|
|
62332
62332
|
return {
|
|
62333
62333
|
mechanism,
|
|
62334
62334
|
tokenRef: stored.tokenRef,
|
|
@@ -65119,7 +65119,7 @@ function createFlowService(deps) {
|
|
|
65119
65119
|
} else if (selection.exceptions.length && !selection.remaining.length) {
|
|
65120
65120
|
try {
|
|
65121
65121
|
const decision = await confirmExceptions?.(structuredClone(selection.exceptions), structuredClone(exceptionContext));
|
|
65122
|
-
if (!decision || !/^(yes|\u0434\u0430|y)$/iu.test(decision.operatorWords.trim()) || !["host-question", "terminal", "shell-card"].includes(decision.confirmedVia)) {
|
|
65122
|
+
if (!decision || !/^(yes|\u0434\u0430|y)$/iu.test(decision.operatorWords.trim()) || !["host-question", "terminal", "shell-card", "desktop-card"].includes(decision.confirmedVia)) {
|
|
65123
65123
|
confirmationError = "Accepted exceptions require an affirmative operator decision.";
|
|
65124
65124
|
} else if (decision.confirmedVia === "host-question" && (!decision.hostQuestion || flow.completionAttempts?.some((attempt) => attempt.exceptions?.some((item) => item.hostQuestion?.source === decision.hostQuestion?.source && item.hostQuestion?.ref === decision.hostQuestion?.ref)))) {
|
|
65125
65125
|
confirmationError = "Host question is missing or already used; ask a fresh question.";
|
|
@@ -79431,7 +79431,7 @@ var init_estimate = __esm(() => {
|
|
|
79431
79431
|
init_round_split();
|
|
79432
79432
|
init_types();
|
|
79433
79433
|
init_autonomous_profile();
|
|
79434
|
-
CONFIRMED_VIA = ["tui-card", "remote-card", "terminal", "host-question", "auto-policy"];
|
|
79434
|
+
CONFIRMED_VIA = ["tui-card", "remote-card", "desktop-card", "terminal", "host-question", "auto-policy"];
|
|
79435
79435
|
});
|
|
79436
79436
|
|
|
79437
79437
|
// src/review/layers-usage.ts
|
|
@@ -110563,6 +110563,7 @@ function buildAgentSystemInstruction(orient, ctx = {}) {
|
|
|
110563
110563
|
` + "- web_search uses the engine named in the result's `Provider:` line (DuckDuckGo unless the user selected another via /search-provider and /search-connect). You cannot switch providers \u2014 ask_user cannot change them. If Provider is not duckduckgo and the hits are unrelated to the query, tell the user to run `/search-connect duckduckgo` once and stop. Do not rephrase the query, guess URLs, or claim you switched engines.\n" + "- ALWAYS pass every required field in the tool JSON (e.g. search_code needs " + (offered("read_wiki") ? "`pattern`, read_wiki needs `path`, wiki_ask needs `question`). " : "`pattern`, read_file needs `path`). ") + `Never call a tool with an empty object.
|
|
110564
110564
|
` + locateRule + "- read_file returns a bounded window starting at `start_line` (default 1). A large file " + "is read by paging: its truncation notice names the start_line to continue from, and a " + `line number from ${hasGraph ? "search_code or graph_symbol" : "search_code"} can be read directly \u2014 do not re-read the ` + `same head hoping for more.
|
|
110565
110565
|
` + "- Prefer ONE correct shell_exec over many exploratory tool calls when the user asks " + `to run a known keryx workflow.
|
|
110566
|
+
` + "- Handing the user a command: when a step is the user's own to run (a decision or command you may not run, " + "one that needs their terminal, one that was refused to you), say in ONE sentence why they must run it and what it " + "does, then give the command alone in a fenced ```bash block, one command per block. The reason comes first, in the " + "same reply as the command; a client that can run it shows a Run button on that block. Never leave such a command " + `inline in a sentence, and never give it without the reason.
|
|
110566
110567
|
` + "- Tool-call budget: shell_exec, file-mutating shell, workspace_create/workspace_propose, and spawn_subagent " + "all share ONE small per-turn pool (distinct non-read actions), separate from the much larger read-tool pool. " + (hasGraph ? "search_code/graph_*/memory_search/read_wiki/wiki_*/test_related/health_status/flow_status/repomap/read_file/" : "search_code/read_file/") + "list_dir do NOT touch it. Conserve the small pool: batch multiple shell steps into ONE call with `&&` instead " + "of issuing them one at a time, get a command's arguments right the first time instead of trying variants, and " + "for any check covered by a read tool above, use that tool instead of shelling out to the equivalent `keryx \u2026` " + `CLI command.
|
|
110567
110568
|
` + "- For multi-step work, use **plan_set** to publish a structured plan, **plan_update** after each real status " + "change, and **plan_get** before resolving a revision conflict. Keep stable item ids, at most one " + "`in_progress` item, and do not mark work complete before verification. These tools update session metadata " + "only; `/plan` remains the operator's separate read-only permission mode.\n" + '- When the user names a skill ("use review-orchestrator", "\u043F\u043E \u0441\u043A\u0438\u043B\u043B\u0443 X"), your FIRST tool call is ' + (offered("skill_load") ? "**skill_load** for it" : "read_file on its SKILL.md") + ", before any `keryx` command, and you follow its section for this host. A subcommand that only opens " + "or drafts something (`keryx review start`) is one step of that workflow, never the workflow: do not " + `report the task done or stopped on its output.
|
|
110568
110569
|
` + "- **Publishing a plan FOR APPROVAL is a real, supported stopping point.** Mark the items `proposed`, " + "state the plan in your reply, and END THE TURN \u2014 that is exactly what `proposed` is for. When the " + "operator approves, move those items to `pending`/`in_progress` and continue. Use `pending` (not " + "`proposed`) only when you are going to execute the plan in this same turn.\n" + "- The plan is published so the operator can see progress; it is not what decides when a turn may end. " + "End a turn whenever the user's request is answered, you are genuinely blocked, or the next step needs " + "the operator's input \u2014 regardless of whether plan items are still `pending`/`in_progress`.\n" + "- This session has its own Slate (working-set scratch, not project knowledge): " + "**slate_read** shows the Course (if a Flow is bound) and Seeds recorded so far \u2014 nothing " + "here is auto-injected, so call it if you want to see it. **slate_write_seed** with " + "`{ text, kind? }` records a draft hypothesis/decision/follow-up worth a later human " + "review. WRITE A SEED when you: found a root cause or a bug worth remembering; changed or " + "added code (summarize WHAT changed and WHY); took a design/architecture decision; " + "identified a risk; or discovered a constraint/lesson. Use the `kind` that fits: " + "`decision` (a choice made), `wiki-update` (something a wiki page should say), " + "`memory-entry` (a lesson/constraint), `follow-up` (a TODO for a later session), " + "`risk`, or `contract-change`. Keep each Seed to 2-3 sentences, concrete and specific. " + "Do NOT write Seeds for routine progress notes, one-shot operational requests (e.g. " + '"run git pull", "count files"), or trivia \u2014 those need no workspace and no proposal. ' + "Seeds are the ONLY input wrap-up proposes from: a session whose Slate has zero Seeds " + `produces zero proposals. A Seed is never accepted knowledge by itself.
|
|
@@ -136895,7 +136896,7 @@ function flowExceptionSpec(service = defaultService) {
|
|
|
136895
136896
|
confirmExceptions: async (current, context) => {
|
|
136896
136897
|
if (JSON.stringify(current) !== JSON.stringify(prepared.selected) || JSON.stringify(context) !== JSON.stringify(prepared.context))
|
|
136897
136898
|
throw new CompletionConfirmationError("Refusals changed; ask again.");
|
|
136898
|
-
return { operatorWords: confirmation.answer, confirmedVia: "shell-card" };
|
|
136899
|
+
return { operatorWords: confirmation.answer, confirmedVia: confirmation.confirmedVia === "desktop-card" ? "desktop-card" : "shell-card" };
|
|
136899
136900
|
}
|
|
136900
136901
|
});
|
|
136901
136902
|
return { output: `flow ${prepared.id}: ${result.passed ? "done with exceptions" : "not completed"}`, isError: !result.passed };
|
|
@@ -156088,6 +156089,7 @@ __export(exports_session_attempt, {
|
|
|
156088
156089
|
laterRoundOf: () => laterRoundOf,
|
|
156089
156090
|
readSessionAttempt: () => readSessionAttempt,
|
|
156090
156091
|
registerSessionPackageForProject: () => registerSessionPackageForProject,
|
|
156092
|
+
sessionProjectRoot: () => sessionProjectRoot,
|
|
156091
156093
|
sessionPublication: () => sessionPublication
|
|
156092
156094
|
});
|
|
156093
156095
|
import { createHash as createHash104 } from "crypto";
|
|
@@ -156211,6 +156213,29 @@ async function register(input, store, manifest, pr, headSha, report) {
|
|
|
156211
156213
|
`);
|
|
156212
156214
|
return { record };
|
|
156213
156215
|
}
|
|
156216
|
+
async function gitCommonDir2(dir) {
|
|
156217
|
+
const { execFile } = await import("child_process");
|
|
156218
|
+
const out = await new Promise((resolve) => {
|
|
156219
|
+
execFile("git", ["rev-parse", "--path-format=absolute", "--git-common-dir"], { cwd: dir, timeout: 5000 }, (error, stdout) => resolve(error ? undefined : stdout.trim()));
|
|
156220
|
+
});
|
|
156221
|
+
if (!out)
|
|
156222
|
+
return;
|
|
156223
|
+
return realpath38(out).catch(() => {
|
|
156224
|
+
return;
|
|
156225
|
+
});
|
|
156226
|
+
}
|
|
156227
|
+
async function sessionProjectRoot(cwd, env = process.env) {
|
|
156228
|
+
const root = env["KERYX_REVIEW_SESSION_PROJECT_ROOT"];
|
|
156229
|
+
if (!env["KERYX_REVIEW_SESSION_ID"] || !root)
|
|
156230
|
+
return;
|
|
156231
|
+
const [project, here] = await Promise.all([realpath38(root).catch(() => ""), realpath38(cwd).catch(() => "")]);
|
|
156232
|
+
if (project === "" || here === "")
|
|
156233
|
+
return;
|
|
156234
|
+
if (project === here)
|
|
156235
|
+
return root;
|
|
156236
|
+
const [projectGit, hereGit] = await Promise.all([gitCommonDir2(project), gitCommonDir2(here)]);
|
|
156237
|
+
return projectGit !== undefined && projectGit === hereGit ? root : undefined;
|
|
156238
|
+
}
|
|
156214
156239
|
async function registerSessionPackageForProject(cwd, packageDir, readiness, sessionId, sessionOwner, taskToken) {
|
|
156215
156240
|
const result = await registerSessionPackage({
|
|
156216
156241
|
cwd,
|
|
@@ -181020,7 +181045,7 @@ var init_review_finding_schema = __esm(() => {
|
|
|
181020
181045
|
quote: { type: "string", minLength: 1, description: "The operator's own words: what they typed at the terminal, or the card text they said yes to." },
|
|
181021
181046
|
at: { type: "string", minLength: 1 },
|
|
181022
181047
|
actor: { type: "string", minLength: 1 },
|
|
181023
|
-
confirmedVia: { type: "string", enum: ["tui-card", "remote-card", "terminal", "host-question"] },
|
|
181048
|
+
confirmedVia: { type: "string", enum: ["tui-card", "remote-card", "desktop-card", "terminal", "host-question"] },
|
|
181024
181049
|
hostQuestion: {
|
|
181025
181050
|
type: "object",
|
|
181026
181051
|
additionalProperties: false,
|
|
@@ -189516,7 +189541,7 @@ async function runCreate(mode, args, createSeams = {}) {
|
|
|
189516
189541
|
await writeRoundRecord(result.path, detected.round, detected.priorFindings, detected.identity);
|
|
189517
189542
|
const sessionId = process.env.KERYX_REVIEW_SESSION_ID;
|
|
189518
189543
|
const sessionRoot = process.env.KERYX_REVIEW_SESSION_PROJECT_ROOT;
|
|
189519
|
-
if (mode === "review-flow" && targetKind === "pr" && sessionId && sessionRoot && process.env.KERYX_DESK_REVIEW_SHELL !== "1" && await (
|
|
189544
|
+
if (mode === "review-flow" && targetKind === "pr" && sessionId && sessionRoot && process.env.KERYX_DESK_REVIEW_SHELL !== "1" && await sessionProjectRoot(cwd) !== undefined && (await Promise.resolve().then(() => (init_session(), exports_session))).findSession(sessionRoot, sessionId, process.env.KERYX_REVIEW_SESSION_DATA_DIR || undefined)?.id === sessionId) {
|
|
189520
189545
|
try {
|
|
189521
189546
|
const ownerText = process.env.KERYX_REVIEW_SESSION_OWNER;
|
|
189522
189547
|
const owner = ownerText ? JSON.parse(ownerText) : undefined;
|
|
@@ -189551,7 +189576,7 @@ async function runCreate(mode, args, createSeams = {}) {
|
|
|
189551
189576
|
console.error(`warning: ${registered.warning}`);
|
|
189552
189577
|
if (targetKind === "pr" && process.env.KERYX_DESK_REVIEW_SHELL !== "1" && await (await Promise.resolve().then(() => (init_session_attempt(), exports_session_attempt))).readSessionAttempt(result.path)) {
|
|
189553
189578
|
try {
|
|
189554
|
-
await registerSessionPackageForProject(cwd, result.path);
|
|
189579
|
+
await registerSessionPackageForProject(await sessionProjectRoot(cwd) ?? cwd, result.path);
|
|
189555
189580
|
} catch (error) {
|
|
189556
189581
|
console.error(`warning: review not registered in Desktop (${error instanceof Error ? error.message : String(error)})`);
|
|
189557
189582
|
}
|
|
@@ -191885,7 +191910,7 @@ async function runPublish(args, seams) {
|
|
|
191885
191910
|
return promptYes(`Post this ${kind} review to ${target}? [y/N] `);
|
|
191886
191911
|
});
|
|
191887
191912
|
const readiness = { prLookup: seams?.prLookup ?? trackerPrLookup, prFiles: seams?.prFiles ?? githubPrFiles };
|
|
191888
|
-
const register = seams === undefined ? (dir) => registerSessionPackageForProject(process.cwd(), dir, readiness) : seams.registerSession;
|
|
191913
|
+
const register = seams === undefined ? async (dir) => registerSessionPackageForProject(await sessionProjectRoot(process.cwd()) ?? process.cwd(), dir, readiness) : seams.registerSession;
|
|
191889
191914
|
const publication = await sessionPublication(packageDir, register, (text) => console.error(`warning: ${text}`));
|
|
191890
191915
|
const result = await publishReview(packageDir, {
|
|
191891
191916
|
event,
|
|
@@ -191971,7 +191996,7 @@ async function runComplete2(args, seams) {
|
|
|
191971
191996
|
if (tally.unknown > 0) {
|
|
191972
191997
|
console.log(`${tally.unknown} of ${tally.total} findings read \`unknown\` \u2014 nobody recorded an outcome for them.`);
|
|
191973
191998
|
}
|
|
191974
|
-
const register = seams === undefined ? (dir) => registerSessionPackageForProject(process.cwd(), dir, { prLookup: trackerPrLookup, prFiles: githubPrFiles }) : seams.registerSession;
|
|
191999
|
+
const register = seams === undefined ? async (dir) => registerSessionPackageForProject(await sessionProjectRoot(process.cwd()) ?? process.cwd(), dir, { prLookup: trackerPrLookup, prFiles: githubPrFiles }) : seams.registerSession;
|
|
191975
192000
|
if (register !== undefined) {
|
|
191976
192001
|
const recorded = await sessionPublication(await resolveReviewPackagePath(process.cwd(), ref), register, (text) => console.error(`warning: ${text}`));
|
|
191977
192002
|
if (recorded !== undefined)
|
|
@@ -194098,7 +194123,7 @@ function operatorConfirmTool(spec, binding) {
|
|
|
194098
194123
|
quote: `${entry.card.title}: yes`,
|
|
194099
194124
|
answer: "yes",
|
|
194100
194125
|
at: now().toISOString(),
|
|
194101
|
-
confirmedVia: remote ? "remote-card" : "tui-card",
|
|
194126
|
+
confirmedVia: remote ? "remote-card" : binding.localVia ?? "tui-card",
|
|
194102
194127
|
...remote ? { pressedBy, pressedAt } : {},
|
|
194103
194128
|
subject: entry.card.subject,
|
|
194104
194129
|
card: entry.shown
|
|
@@ -194124,7 +194149,7 @@ var init_operator_confirm_tools = __esm(() => {
|
|
|
194124
194149
|
init_operator_confirm_other();
|
|
194125
194150
|
init_operator_confirm_review();
|
|
194126
194151
|
REMOTE_CARD_TTL_MS = 60 * 60 * 1000;
|
|
194127
|
-
OPERATOR_CONFIRM_NOTE = " The operator ALWAYS sees a yes/no card in the shell and must answer it \u2014 you cannot confirm it, and you " + "must not ask them to run a command in a terminal instead.";
|
|
194152
|
+
OPERATOR_CONFIRM_NOTE = " The operator ALWAYS sees a yes/no card in keryx (the shell, or the Desktop app) and must answer it \u2014 you cannot confirm it, and you " + "must not ask them to run a command in a terminal instead.";
|
|
194128
194153
|
});
|
|
194129
194154
|
|
|
194130
194155
|
// src/harness/tool/builtin/spill-search.ts
|
|
@@ -206924,7 +206949,7 @@ class NextStepSuggestionGate {
|
|
|
206924
206949
|
this.current = undefined;
|
|
206925
206950
|
}
|
|
206926
206951
|
}
|
|
206927
|
-
var NEXT_STEP_SUGGESTION_MAX_LENGTH = 80, NEXT_STEP_SUGGESTION_MAX_WORDS = 20, NEXT_STEP_SUGGESTION_TIMEOUT_MS = 8000, NEXT_STEP_USER_TAIL = 800, NEXT_STEP_ASSISTANT_TAIL = 3000, NEXT_STEP_SYSTEM_PROMPT = "You
|
|
206952
|
+
var NEXT_STEP_SUGGESTION_MAX_LENGTH = 80, NEXT_STEP_SUGGESTION_MAX_WORDS = 20, NEXT_STEP_SUGGESTION_TIMEOUT_MS = 8000, NEXT_STEP_USER_TAIL = 800, NEXT_STEP_ASSISTANT_TAIL = 3000, NEXT_STEP_SYSTEM_PROMPT = "You predict the next message a user will send to a coding assistant in a terminal. Based on the user's last request and the assistant's final reply, write ONE short message in the user's own voice, addressed to the assistant, asking it to do the most natural next step (for example: run the tests, commit this, fix the failing check). It must be something the assistant itself can carry out, never advice or a task for the user to do by hand, and never a reply from the assistant. Imperative, in the language of the user's last request, no quotes, no markdown, at most 80 characters. If no natural next step exists, reply with exactly one dot: .";
|
|
206928
206953
|
|
|
206929
206954
|
// src/lib/version-check.ts
|
|
206930
206955
|
import path440 from "path";
|
|
@@ -229717,16 +229742,10 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
229717
229742
|
if (key.name === "tab" || key.name === "right") {
|
|
229718
229743
|
if (input.value.length === 0) {
|
|
229719
229744
|
input.value = suggestion;
|
|
229720
|
-
|
|
229745
|
+
syncPlaceholder();
|
|
229721
229746
|
key.preventDefault();
|
|
229722
229747
|
key.stopPropagation();
|
|
229723
|
-
return;
|
|
229724
229748
|
}
|
|
229725
|
-
return;
|
|
229726
|
-
}
|
|
229727
|
-
const ch = key.sequence;
|
|
229728
|
-
if (!key.ctrl && !key.meta && typeof ch === "string" && ch.length === 1 && ch >= " ") {
|
|
229729
|
-
clearSuggestion();
|
|
229730
229749
|
}
|
|
229731
229750
|
});
|
|
229732
229751
|
let unsubscribeGeometry;
|
|
@@ -316803,6 +316822,7 @@ ${currentDraft}`;
|
|
|
316803
316822
|
}
|
|
316804
316823
|
return;
|
|
316805
316824
|
}
|
|
316825
|
+
chrome.clearSuggestion();
|
|
316806
316826
|
suggestionGate.cancel("new turn started");
|
|
316807
316827
|
const fromHub = source === "hub";
|
|
316808
316828
|
if (fromHub)
|
|
@@ -335349,7 +335369,7 @@ var init_native_coverage_generated = __esm(() => {
|
|
|
335349
335369
|
registryDigest: "96f6ac176ce1847bcc637495a22b7e217d5f472d7a97651ea1614cfe26bfc27e",
|
|
335350
335370
|
contractDigest: "95fd86252f56e1ddca9e5acc8f3817e1dba30c7a576e7a7130ded3424d23b018",
|
|
335351
335371
|
subjectCatalogueDigest: "0aaa0f567b5b26de53e54af7b8441fd4f475d2e044c127543db635eb47569430",
|
|
335352
|
-
inventoryDigest: "
|
|
335372
|
+
inventoryDigest: "dfc469bbab3296e165c42fb482426383ad57c19c1c270132e44dfb3158d0c0c0",
|
|
335353
335373
|
releaseReady: true,
|
|
335354
335374
|
counts: {
|
|
335355
335375
|
registeredCommands: 76,
|
|
@@ -335629,7 +335649,7 @@ var init_native_coverage_generated = __esm(() => {
|
|
|
335629
335649
|
"workspace.navigate"
|
|
335630
335650
|
],
|
|
335631
335651
|
otherBlockers: [],
|
|
335632
|
-
descriptorDigest: "
|
|
335652
|
+
descriptorDigest: "78f1e39d288370c255be1b365a29c3acbe7daaf0d6fb7cfb6886b069129ebc84"
|
|
335633
335653
|
};
|
|
335634
335654
|
});
|
|
335635
335655
|
|
|
@@ -365348,6 +365368,10 @@ function acpPermissionReasons(meta) {
|
|
|
365348
365368
|
reasons.alwaysAsk = true;
|
|
365349
365369
|
return reasons;
|
|
365350
365370
|
}
|
|
365371
|
+
function acpOperatorCard(card, title) {
|
|
365372
|
+
const heading = title ?? card[0] ?? "";
|
|
365373
|
+
return { title: heading, lines: card[0] === heading ? card.slice(1) : [...card] };
|
|
365374
|
+
}
|
|
365351
365375
|
function permissionOptionsFor(meta) {
|
|
365352
365376
|
if (meta?.mcpTrustAvailable === true) {
|
|
365353
365377
|
return [OPTION_ALLOW_ONCE, OPTION_ALLOW_SESSION, OPTION_REJECT_ONCE, OPTION_REJECT_ALWAYS];
|
|
@@ -365478,7 +365502,7 @@ function createAcpAgentIo(sessionId, send, askPermission, ioOptions = {}) {
|
|
|
365478
365502
|
kind: toolKindFor(tool),
|
|
365479
365503
|
status: "pending",
|
|
365480
365504
|
rawInput: tryParseJson(input),
|
|
365481
|
-
...ioOptions.permissionReasons === true ? { _meta: { keryx: { reasons: acpPermissionReasons(meta) } } } : {}
|
|
365505
|
+
...ioOptions.permissionReasons === true ? { _meta: { keryx: { reasons: acpPermissionReasons(meta), ...meta?.card !== undefined ? { card: acpOperatorCard(meta.card, meta.cardTitle) } : {} } } } : {}
|
|
365482
365506
|
},
|
|
365483
365507
|
options
|
|
365484
365508
|
});
|
|
@@ -366474,6 +366498,10 @@ function prepareReviewTool(requestDraft) {
|
|
|
366474
366498
|
var init_prepare_review = () => {};
|
|
366475
366499
|
|
|
366476
366500
|
// src/acp/shell-roster.ts
|
|
366501
|
+
function clientShowsOperatorCards(capabilities) {
|
|
366502
|
+
const meta = capabilities?._meta?.["keryx"];
|
|
366503
|
+
return typeof meta === "object" && meta !== null && meta["operatorCards"] === true;
|
|
366504
|
+
}
|
|
366477
366505
|
function acpShellDeniedTools(askUserOffered) {
|
|
366478
366506
|
return askUserOffered ? [] : ["ask_user"];
|
|
366479
366507
|
}
|
|
@@ -366488,7 +366516,11 @@ function buildAcpShellSessionTools(input) {
|
|
|
366488
366516
|
jobRegistry: input.jobRegistry,
|
|
366489
366517
|
...input.askUser !== undefined ? { askUser: input.askUser } : {},
|
|
366490
366518
|
...input.mcp !== undefined ? { mcp: input.mcp } : {},
|
|
366491
|
-
denyTools: acpShellDeniedTools(input.askUser !== undefined)
|
|
366519
|
+
denyTools: acpShellDeniedTools(input.askUser !== undefined),
|
|
366520
|
+
...input.operatorCards === true ? {
|
|
366521
|
+
operatorConfirm: { projectRoot: root, localVia: "desktop-card" },
|
|
366522
|
+
schedules: { projectRoot: root, ...input.scheduleDefaults !== undefined ? { defaults: input.scheduleDefaults } : {} }
|
|
366523
|
+
} : {}
|
|
366492
366524
|
});
|
|
366493
366525
|
if (input.requestReviewDraft)
|
|
366494
366526
|
tools.push(prepareReviewTool(input.requestReviewDraft));
|
|
@@ -370887,6 +370919,13 @@ async function runAcpServer(options) {
|
|
|
370887
370919
|
requestReviewDraft: reviewDraftFor(sessionId),
|
|
370888
370920
|
sessionReviews: sessionReviewsTool(() => readVisibleSessionReviews(root, sessionId, true))
|
|
370889
370921
|
} : {},
|
|
370922
|
+
...clientShowsOperatorCards(state.clientCapabilities) ? {
|
|
370923
|
+
operatorCards: true,
|
|
370924
|
+
scheduleDefaults: () => {
|
|
370925
|
+
const { binding } = sessionModel(sessionId, ACP_AGENT_METHODS.sessionPrompt);
|
|
370926
|
+
return { provider: binding.providerId, model: binding.modelId };
|
|
370927
|
+
}
|
|
370928
|
+
} : {},
|
|
370890
370929
|
...mcp !== undefined ? { mcp } : {}
|
|
370891
370930
|
});
|
|
370892
370931
|
}
|
package/dist/core.js
CHANGED
|
@@ -30946,7 +30946,7 @@ import path52 from "path";
|
|
|
30946
30946
|
var OPERATOR_DECISIONS_FILE = "operator-decisions.json";
|
|
30947
30947
|
var OPERATOR_DECISION_KINDS = ["mutation-waiver", "reviewer-override"];
|
|
30948
30948
|
var PREMISE_DECISION_KIND = "premise-question";
|
|
30949
|
-
var VIAS = ["tui-card", "remote-card", "terminal", "host-question"];
|
|
30949
|
+
var VIAS = ["tui-card", "remote-card", "desktop-card", "terminal", "host-question"];
|
|
30950
30950
|
var text = (value) => typeof value === "string" && value.trim().length > 0;
|
|
30951
30951
|
function validPremiseSubject(value) {
|
|
30952
30952
|
if (value === null || typeof value !== "object")
|
|
@@ -32169,7 +32169,7 @@ function readCoverageWaiver(dispatch) {
|
|
|
32169
32169
|
if (waiver === undefined || !text2(waiver.operatorQuote) || !text2(waiver.time))
|
|
32170
32170
|
return;
|
|
32171
32171
|
const files = Array.isArray(waiver.files) ? waiver.files.filter(text2) : [];
|
|
32172
|
-
const via = waiver.confirmedVia === "tui-card" || waiver.confirmedVia === "remote-card" || waiver.confirmedVia === "host-question" ? waiver.confirmedVia : undefined;
|
|
32172
|
+
const via = waiver.confirmedVia === "tui-card" || waiver.confirmedVia === "remote-card" || waiver.confirmedVia === "desktop-card" || waiver.confirmedVia === "host-question" ? waiver.confirmedVia : undefined;
|
|
32173
32173
|
const pressedBy = typeof waiver.pressedBy === "number" && Number.isSafeInteger(waiver.pressedBy) ? waiver.pressedBy : undefined;
|
|
32174
32174
|
const pressedAt = text2(waiver.pressedAt) ? waiver.pressedAt : undefined;
|
|
32175
32175
|
return { operatorQuote: waiver.operatorQuote, time: waiver.time, files, ...via === undefined ? {} : { confirmedVia: via }, ...cardPressFields({ pressedBy, pressedAt }), ...via === "host-question" && isHostQuestion(waiver.hostQuestion) ? { hostQuestion: waiver.hostQuestion } : {} };
|
|
@@ -34153,7 +34153,7 @@ function flowStateSchema() {
|
|
|
34153
34153
|
additionalProperties: true,
|
|
34154
34154
|
required: ["mechanism", "tokenRef", "mintedAt", "consumedAt", "boundTo"],
|
|
34155
34155
|
properties: {
|
|
34156
|
-
mechanism: { type: "string", enum: ["terminal-token", "tui-card-token", "remote-card-token"] },
|
|
34156
|
+
mechanism: { type: "string", enum: ["terminal-token", "tui-card-token", "remote-card-token", "desktop-card-token"] },
|
|
34157
34157
|
tokenRef: { type: "string", description: "A prefix of the stored token hash. Never the token." },
|
|
34158
34158
|
mintedAt: { type: "string" },
|
|
34159
34159
|
consumedAt: { type: "string" },
|
|
@@ -34694,7 +34694,7 @@ async function consumeConfirmationToken(cwd, dir, stored, now) {
|
|
|
34694
34694
|
const consumedAt = now.toISOString();
|
|
34695
34695
|
await writeFileAtomic(confirmTokenPath(cwd, dir), `${JSON.stringify({ ...stored, usedAt: consumedAt }, null, 2)}
|
|
34696
34696
|
`);
|
|
34697
|
-
const mechanism = stored.confirmedVia === "tui-card" ? "tui-card-token" : stored.confirmedVia === "remote-card" ? "remote-card-token" : "terminal-token";
|
|
34697
|
+
const mechanism = stored.confirmedVia === "tui-card" ? "tui-card-token" : stored.confirmedVia === "remote-card" ? "remote-card-token" : stored.confirmedVia === "desktop-card" ? "desktop-card-token" : "terminal-token";
|
|
34698
34698
|
return {
|
|
34699
34699
|
mechanism,
|
|
34700
34700
|
tokenRef: stored.tokenRef,
|
|
@@ -36947,7 +36947,7 @@ function createFlowService(deps) {
|
|
|
36947
36947
|
} else if (selection.exceptions.length && !selection.remaining.length) {
|
|
36948
36948
|
try {
|
|
36949
36949
|
const decision = await confirmExceptions?.(structuredClone(selection.exceptions), structuredClone(exceptionContext));
|
|
36950
|
-
if (!decision || !/^(yes|\u0434\u0430|y)$/iu.test(decision.operatorWords.trim()) || !["host-question", "terminal", "shell-card"].includes(decision.confirmedVia)) {
|
|
36950
|
+
if (!decision || !/^(yes|\u0434\u0430|y)$/iu.test(decision.operatorWords.trim()) || !["host-question", "terminal", "shell-card", "desktop-card"].includes(decision.confirmedVia)) {
|
|
36951
36951
|
confirmationError = "Accepted exceptions require an affirmative operator decision.";
|
|
36952
36952
|
} else if (decision.confirmedVia === "host-question" && (!decision.hostQuestion || flow.completionAttempts?.some((attempt) => attempt.exceptions?.some((item) => item.hostQuestion?.source === decision.hostQuestion?.source && item.hostQuestion?.ref === decision.hostQuestion?.ref)))) {
|
|
36953
36953
|
confirmationError = "Host question is missing or already used; ask a fresh question.";
|
|
@@ -22904,7 +22904,7 @@ var init_operator_decisions = __esm(() => {
|
|
|
22904
22904
|
init_json();
|
|
22905
22905
|
init_types3();
|
|
22906
22906
|
OPERATOR_DECISION_KINDS = ["mutation-waiver", "reviewer-override"];
|
|
22907
|
-
VIAS = ["tui-card", "remote-card", "terminal", "host-question"];
|
|
22907
|
+
VIAS = ["tui-card", "remote-card", "desktop-card", "terminal", "host-question"];
|
|
22908
22908
|
});
|
|
22909
22909
|
|
|
22910
22910
|
// src/lib/git-env.ts
|
|
@@ -24076,7 +24076,7 @@ function readCoverageWaiver(dispatch) {
|
|
|
24076
24076
|
if (waiver === undefined || !text2(waiver.operatorQuote) || !text2(waiver.time))
|
|
24077
24077
|
return;
|
|
24078
24078
|
const files = Array.isArray(waiver.files) ? waiver.files.filter(text2) : [];
|
|
24079
|
-
const via = waiver.confirmedVia === "tui-card" || waiver.confirmedVia === "remote-card" || waiver.confirmedVia === "host-question" ? waiver.confirmedVia : undefined;
|
|
24079
|
+
const via = waiver.confirmedVia === "tui-card" || waiver.confirmedVia === "remote-card" || waiver.confirmedVia === "desktop-card" || waiver.confirmedVia === "host-question" ? waiver.confirmedVia : undefined;
|
|
24080
24080
|
const pressedBy = typeof waiver.pressedBy === "number" && Number.isSafeInteger(waiver.pressedBy) ? waiver.pressedBy : undefined;
|
|
24081
24081
|
const pressedAt = text2(waiver.pressedAt) ? waiver.pressedAt : undefined;
|
|
24082
24082
|
return { operatorQuote: waiver.operatorQuote, time: waiver.time, files, ...via === undefined ? {} : { confirmedVia: via }, ...cardPressFields({ pressedBy, pressedAt }), ...via === "host-question" && isHostQuestion(waiver.hostQuestion) ? { hostQuestion: waiver.hostQuestion } : {} };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrciphersmith/keryx",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.59",
|
|
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": {
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
"quote": { "type": "string", "minLength": 1, "description": "The operator's own words: what they typed at the terminal, or the card text they said yes to." },
|
|
160
160
|
"at": { "type": "string", "minLength": 1 },
|
|
161
161
|
"actor": { "type": "string", "minLength": 1 },
|
|
162
|
-
"confirmedVia": { "type": "string", "enum": ["tui-card", "remote-card", "terminal", "host-question"] },
|
|
162
|
+
"confirmedVia": { "type": "string", "enum": ["tui-card", "remote-card", "desktop-card", "terminal", "host-question"] },
|
|
163
163
|
"hostQuestion": {
|
|
164
164
|
"type": "object",
|
|
165
165
|
"additionalProperties": false,
|