@pellux/goodvibes-agent 1.0.14 → 1.0.16

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.
@@ -389257,23 +389257,6 @@ function createSchema2(db) {
389257
389257
  `);
389258
389258
  db.run(`CREATE INDEX IF NOT EXISTS idx_knowledge_schedules_job_id ON knowledge_schedules(job_id)`);
389259
389259
  }
389260
- function getKnowledgeSchemaStatements() {
389261
- const statements = [];
389262
- createSchema2({
389263
- run(sql) {
389264
- const normalized = sql.trim();
389265
- if (normalized.length > 0)
389266
- statements.push(normalized);
389267
- }
389268
- });
389269
- return statements;
389270
- }
389271
- function renderKnowledgeSchemaSql() {
389272
- return `${getKnowledgeSchemaStatements().map((statement) => statement.endsWith(";") ? statement : `${statement};`).join(`
389273
-
389274
- `)}
389275
- `;
389276
- }
389277
389260
  function rowObject(columns, values2) {
389278
389261
  return Object.fromEntries(columns.map((column, index) => [column, values2[index]]));
389279
389262
  }
@@ -702611,9 +702594,6 @@ var init_ingest = __esm(() => {
702611
702594
  // node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/browser-history/index.js
702612
702595
  var init_browser_history = __esm(() => {
702613
702596
  init_ingest();
702614
- init_discover();
702615
- init_readers();
702616
- init_paths2();
702617
702597
  });
702618
702598
 
702619
702599
  // node_modules/graphql/jsutils/devAssert.mjs
@@ -720253,7 +720233,6 @@ var init_semantic = __esm(() => {
720253
720233
  init_llm();
720254
720234
  init_gap_repair();
720255
720235
  init_service4();
720256
- init_self_improvement();
720257
720236
  });
720258
720237
 
720259
720238
  // node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/home-graph/helpers.js
@@ -724222,40 +724201,8 @@ var init_map_view = __esm(() => {
724222
724201
  });
724223
724202
 
724224
724203
  // node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/home-graph/types.js
724225
- var HOME_GRAPH_NODE_KINDS, HOME_GRAPH_RELATIONS, HOME_GRAPH_CAPABILITIES;
724204
+ var HOME_GRAPH_CAPABILITIES;
724226
724205
  var init_types6 = __esm(() => {
724227
- HOME_GRAPH_NODE_KINDS = [
724228
- "ha_home",
724229
- "ha_entity",
724230
- "ha_device",
724231
- "ha_area",
724232
- "ha_automation",
724233
- "ha_script",
724234
- "ha_scene",
724235
- "ha_label",
724236
- "ha_integration",
724237
- "ha_room",
724238
- "ha_device_passport",
724239
- "ha_maintenance_item",
724240
- "ha_troubleshooting_case",
724241
- "ha_purchase",
724242
- "ha_network_node"
724243
- ];
724244
- HOME_GRAPH_RELATIONS = [
724245
- "controls",
724246
- "located_in",
724247
- "belongs_to_device",
724248
- "has_manual",
724249
- "has_receipt",
724250
- "has_warranty",
724251
- "has_issue",
724252
- "fixed_by",
724253
- "uses_battery",
724254
- "connected_via",
724255
- "part_of_network",
724256
- "mentioned_by",
724257
- "source_for"
724258
- ];
724259
724206
  HOME_GRAPH_CAPABILITIES = [
724260
724207
  "knowledge-space-isolation",
724261
724208
  "snapshot-sync",
@@ -725662,7 +725609,6 @@ var init_service5 = __esm(() => {
725662
725609
  var init_home_graph = __esm(() => {
725663
725610
  init_service5();
725664
725611
  init_extension();
725665
- init_types6();
725666
725612
  });
725667
725613
 
725668
725614
  // node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/store-refinement.js
@@ -727990,14 +727936,10 @@ var init_service6 = __esm(() => {
727990
727936
  var init_project_planning = __esm(() => {
727991
727937
  init_service6();
727992
727938
  init_helpers3();
727993
- init_readiness();
727994
727939
  });
727995
727940
 
727996
727941
  // node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/persistence.js
727997
- var init_persistence = __esm(() => {
727998
- init_store_schema();
727999
- init_store_load();
728000
- });
727942
+ var init_persistence = () => {};
728001
727943
 
728002
727944
  // node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/projections.js
728003
727945
  class KnowledgeProjectionService {
@@ -731505,21 +731447,21 @@ var init_service7 = __esm(() => {
731505
731447
  var exports_knowledge = {};
731506
731448
  __export(exports_knowledge, {
731507
731449
  withKnowledgeSpace: () => withKnowledgeSpace,
731508
- uniqKnowledgeValues: () => uniq2,
731509
- stabilizeKnowledgeText: () => stableText,
731510
- runKnowledgeSemanticSelfImprovement: () => runKnowledgeSemanticSelfImprovement,
731450
+ uniqKnowledgeValues: () => uniq3,
731451
+ stabilizeKnowledgeText: () => stableText2,
731452
+ runKnowledgeSemanticSelfImprovement: () => runKnowledgeSemanticSelfImprovement2,
731511
731453
  resolveProjectPlanningSpace: () => resolveProjectPlanningSpace,
731512
- resolveKnowledgeDbPathFromControlPlaneDir: () => resolveKnowledgeDbPathFromControlPlaneDir,
731454
+ resolveKnowledgeDbPathFromControlPlaneDir: () => resolveKnowledgeDbPathFromControlPlaneDir2,
731513
731455
  renderPacket: () => renderPacket,
731514
731456
  renderKnowledgeSchemaSql: () => renderKnowledgeSchemaSql,
731515
731457
  renderKnowledgeMap: () => renderKnowledgeMap,
731516
731458
  readKnowledgeSearchText: () => readKnowledgeSearchText,
731517
- readBrowserKnowledgeProfile: () => readBrowserKnowledgeProfile,
731459
+ readBrowserKnowledgeProfile: () => readBrowserKnowledgeProfile2,
731518
731460
  projectPlanningSourceId: () => projectPlanningSourceId,
731519
731461
  projectPlanningProjectIdFromPath: () => projectPlanningProjectIdFromPath,
731520
731462
  projectPlanningCanonicalUri: () => projectPlanningCanonicalUri,
731521
731463
  projectKnowledgeSpaceId: () => projectKnowledgeSpaceId,
731522
- parseKnowledgeJsonValue: () => parseJsonValue,
731464
+ parseKnowledgeJsonValue: () => parseJsonValue2,
731523
731465
  normalizeProjectId: () => normalizeProjectId,
731524
731466
  normalizeKnowledgeSpaceId: () => normalizeKnowledgeSpaceId,
731525
731467
  normalizeHomeAssistantInstallationId: () => normalizeHomeAssistantInstallationId,
@@ -731527,12 +731469,12 @@ __export(exports_knowledge, {
731527
731469
  materializeGeneratedKnowledgeProjection: () => materializeGeneratedKnowledgeProjection,
731528
731470
  looksLikeRawPdfPayload: () => looksLikeRawPdfPayload,
731529
731471
  looksBinaryLikeText: () => looksBinaryLikeText,
731530
- loadKnowledgeStoreSnapshot: () => loadKnowledgeStoreSnapshot,
731472
+ loadKnowledgeStoreSnapshot: () => loadKnowledgeStoreSnapshot2,
731531
731473
  listGeneratedKnowledgePages: () => listGeneratedKnowledgePages,
731532
- listBrowserKinds: () => listBrowserKinds,
731474
+ listBrowserKinds: () => listBrowserKinds2,
731533
731475
  knowledgeSpaceMetadata: () => knowledgeSpaceMetadata,
731534
731476
  knowledgePageSourceWeight: () => knowledgePageSourceWeight,
731535
- knowledgeNowMs: () => nowMs,
731477
+ knowledgeNowMs: () => nowMs2,
731536
731478
  knowledgeExtractionNeedsRefresh: () => knowledgeExtractionNeedsRefresh,
731537
731479
  isUsefulKnowledgePageSourceCandidate: () => isUsefulKnowledgePageSourceCandidate,
731538
731480
  isUsefulKnowledgePageSource: () => isUsefulKnowledgePageSource,
@@ -731552,12 +731494,12 @@ __export(exports_knowledge, {
731552
731494
  generatedKnowledgeSourceId: () => generatedKnowledgeSourceId,
731553
731495
  generatedKnowledgeCanonicalUri: () => generatedKnowledgeCanonicalUri,
731554
731496
  extractKnowledgeArtifact: () => extractKnowledgeArtifact,
731555
- evaluateProjectPlanningReadiness: () => evaluateProjectPlanningReadiness,
731556
- discoverBrowserKnowledgeProfiles: () => discoverBrowserKnowledgeProfiles,
731497
+ evaluateProjectPlanningReadiness: () => evaluateProjectPlanningReadiness2,
731498
+ discoverBrowserKnowledgeProfiles: () => discoverBrowserKnowledgeProfiles2,
731557
731499
  createWebKnowledgeGapRepairer: () => createWebKnowledgeGapRepairer,
731558
731500
  createProviderBackedKnowledgeSemanticLlm: () => createProviderBackedKnowledgeSemanticLlm,
731559
731501
  createMemoryApi: () => createMemoryApi,
731560
- createKnowledgeSchema: () => createSchema2,
731502
+ createKnowledgeSchema: () => createSchema3,
731561
731503
  createKnowledgeApi: () => createKnowledgeApi,
731562
731504
  createDefaultKnowledgeConnectorRegistry: () => createDefaultKnowledgeConnectorRegistry,
731563
731505
  compareKnowledgePageSources: () => compareKnowledgePageSources,
@@ -733995,7 +733937,7 @@ var init_delivery_manager = __esm(() => {
733995
733937
  });
733996
733938
 
733997
733939
  // node_modules/@pellux/goodvibes-sdk/dist/platform/automation/scheduler-capacity.js
733998
- function computeSchedulerCapacity(slotsTotal, runs, nowMs2 = Date.now()) {
733940
+ function computeSchedulerCapacity(slotsTotal, runs, nowMs3 = Date.now()) {
733999
733941
  let slotsInUse = 0;
734000
733942
  const queuedRuns = [];
734001
733943
  for (const run7 of runs) {
@@ -734005,7 +733947,7 @@ function computeSchedulerCapacity(slotsTotal, runs, nowMs2 = Date.now()) {
734005
733947
  queuedRuns.push(run7);
734006
733948
  }
734007
733949
  const queueDepth = queuedRuns.length;
734008
- const oldestQueuedAgeMs = queueDepth > 0 ? nowMs2 - Math.min(...queuedRuns.map((r5) => r5.queuedAt)) : null;
733950
+ const oldestQueuedAgeMs = queueDepth > 0 ? nowMs3 - Math.min(...queuedRuns.map((r5) => r5.queuedAt)) : null;
734009
733951
  return { slotsTotal, slotsInUse, queueDepth, oldestQueuedAgeMs };
734010
733952
  }
734011
733953
 
@@ -816566,7 +816508,7 @@ var createStyledCell = (char, overrides = {}) => ({
816566
816508
  // src/version.ts
816567
816509
  import { readFileSync } from "fs";
816568
816510
  import { join } from "path";
816569
- var _version = "1.0.14";
816511
+ var _version = "1.0.16";
816570
816512
  var _sdkVersion = "0.33.35";
816571
816513
  try {
816572
816514
  const pkg = JSON.parse(readFileSync(join(import.meta.dir, "..", "package.json"), "utf-8"));
@@ -839428,7 +839370,7 @@ var WORK_PLAN_STATUSES = [
839428
839370
  "failed",
839429
839371
  "cancelled"
839430
839372
  ];
839431
- function nowMs2() {
839373
+ function nowMs3() {
839432
839374
  return Date.now();
839433
839375
  }
839434
839376
  function isObject5(value) {
@@ -839534,7 +839476,7 @@ class WorkPlanStore {
839534
839476
  if (!normalizedTitle)
839535
839477
  throw new Error("Work plan item title is required.");
839536
839478
  const plan = this.readPlan();
839537
- const time4 = nowMs2();
839479
+ const time4 = nowMs3();
839538
839480
  const item = {
839539
839481
  id: createItemId(),
839540
839482
  title: normalizedTitle,
@@ -839558,7 +839500,7 @@ class WorkPlanStore {
839558
839500
  updateItem(idOrPrefix, patch2) {
839559
839501
  const plan = this.readPlan();
839560
839502
  const item = this.resolveItem(plan, idOrPrefix);
839561
- const time4 = nowMs2();
839503
+ const time4 = nowMs3();
839562
839504
  const nextStatus = patch2.status ?? item.status;
839563
839505
  const next = this.pruneItem({
839564
839506
  ...item,
@@ -839591,7 +839533,7 @@ class WorkPlanStore {
839591
839533
  removeItem(idOrPrefix) {
839592
839534
  const plan = this.readPlan();
839593
839535
  const item = this.resolveItem(plan, idOrPrefix);
839594
- const time4 = nowMs2();
839536
+ const time4 = nowMs3();
839595
839537
  const remaining = plan.items.filter((candidate) => candidate.id !== item.id);
839596
839538
  this.writePlan({
839597
839539
  ...plan,
@@ -839611,7 +839553,7 @@ class WorkPlanStore {
839611
839553
  ...plan,
839612
839554
  items: remaining,
839613
839555
  activeItemId: remaining[0]?.id,
839614
- updatedAt: nowMs2()
839556
+ updatedAt: nowMs3()
839615
839557
  });
839616
839558
  return removed;
839617
839559
  }
@@ -839650,7 +839592,7 @@ class WorkPlanStore {
839650
839592
  const parsed = JSON.parse(raw);
839651
839593
  if (!isObject5(parsed))
839652
839594
  return this.createEmptyPlan();
839653
- const time4 = nowMs2();
839595
+ const time4 = nowMs3();
839654
839596
  const createdAt = typeof parsed.createdAt === "number" ? parsed.createdAt : time4;
839655
839597
  const updatedAt = typeof parsed.updatedAt === "number" ? parsed.updatedAt : createdAt;
839656
839598
  const items = Array.isArray(parsed.items) ? parsed.items.map((item) => normalizeItem(item, createdAt)).filter((item) => item !== null) : [];
@@ -839669,7 +839611,7 @@ class WorkPlanStore {
839669
839611
  };
839670
839612
  }
839671
839613
  createEmptyPlan() {
839672
- const time4 = nowMs2();
839614
+ const time4 = nowMs3();
839673
839615
  return {
839674
839616
  id: createPlanId(this.options.projectId, this.options.projectRoot),
839675
839617
  projectId: this.options.projectId,
@@ -847775,13 +847717,13 @@ init_state3();
847775
847717
 
847776
847718
  // src/input/commands/recall-shared.ts
847777
847719
  var VALID_CLASSES = ["decision", "constraint", "incident", "pattern", "fact", "risk", "runbook", "architecture", "ownership"];
847778
- var VALID_SCOPES = ["session", "project", "team"];
847720
+ var VALID_SCOPES2 = ["session", "project", "team"];
847779
847721
  var VALID_REVIEW_STATES = ["fresh", "reviewed", "stale", "contradicted"];
847780
847722
  function isValidClass(s4) {
847781
847723
  return VALID_CLASSES.includes(s4);
847782
847724
  }
847783
847725
  function isValidScope(s4) {
847784
- return VALID_SCOPES.includes(s4);
847726
+ return VALID_SCOPES2.includes(s4);
847785
847727
  }
847786
847728
  function isValidReviewState(s4) {
847787
847729
  return VALID_REVIEW_STATES.includes(s4);
@@ -847824,7 +847766,7 @@ function handleRecallSearch(args2, context) {
847824
847766
  if (isValidScope(scope))
847825
847767
  filter.scope = scope;
847826
847768
  else {
847827
- context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES.join(", ")}.`);
847769
+ context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES2.join(", ")}.`);
847828
847770
  return;
847829
847771
  }
847830
847772
  }
@@ -847999,7 +847941,7 @@ function handleRecallList(args2, context) {
847999
847941
  if (scopeIdx !== -1 && args2[scopeIdx + 1]) {
848000
847942
  const scope = args2[scopeIdx + 1];
848001
847943
  if (!isValidScope(scope)) {
848002
- context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES.join(", ")}.`);
847944
+ context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES2.join(", ")}.`);
848003
847945
  return;
848004
847946
  }
848005
847947
  filter.scope = scope;
@@ -848049,7 +847991,7 @@ async function handleRecallAdd(args2, context) {
848049
847991
  const tags = tagsRaw ? tagsRaw.split(",").map((token) => token.trim()).filter(Boolean) : [];
848050
847992
  const scope = scopeRaw && isValidScope(scopeRaw) ? scopeRaw : "project";
848051
847993
  if (scopeRaw && !isValidScope(scopeRaw)) {
848052
- context.print(`[memory] Invalid scope "${scopeRaw}". Valid values ${VALID_SCOPES.join(", ")}.`);
847994
+ context.print(`[memory] Invalid scope "${scopeRaw}". Valid values ${VALID_SCOPES2.join(", ")}.`);
848053
847995
  return;
848054
847996
  }
848055
847997
  const provenance = [];
@@ -848183,7 +848125,7 @@ function handleRecallExport(args2, context) {
848183
848125
  if (scopeIdx !== -1 && commandArgs[scopeIdx + 1]) {
848184
848126
  const scope = commandArgs[scopeIdx + 1];
848185
848127
  if (!isValidScope(scope)) {
848186
- context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES.join(", ")}.`);
848128
+ context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES2.join(", ")}.`);
848187
848129
  return;
848188
848130
  }
848189
848131
  filter.scope = scope;
@@ -848262,7 +848204,7 @@ function handleRecallHandoffExport(args2, context) {
848262
848204
  const scopeIdx = commandArgs.indexOf("--scope");
848263
848205
  const scopeRaw = scopeIdx !== -1 ? commandArgs[scopeIdx + 1] : "team";
848264
848206
  if (!scopeRaw || !isValidScope(scopeRaw)) {
848265
- context.print(`[memory] Unknown scope "${scopeRaw ?? ""}". Valid values ${VALID_SCOPES.join(", ")}.`);
848207
+ context.print(`[memory] Unknown scope "${scopeRaw ?? ""}". Valid values ${VALID_SCOPES2.join(", ")}.`);
848266
848208
  return;
848267
848209
  }
848268
848210
  const bundle = memory.exportBundle({ scope: scopeRaw });
@@ -848378,7 +848320,7 @@ function handleRecallPromote(args2, context) {
848378
848320
  const id = parsed.rest[0];
848379
848321
  const scope = parsed.rest[1];
848380
848322
  if (!id || !scope || !isValidScope(scope)) {
848381
- context.print(`[memory] Usage: /memory promote <id> <${VALID_SCOPES.join("|")}> --yes`);
848323
+ context.print(`[memory] Usage: /memory promote <id> <${VALID_SCOPES2.join("|")}> --yes`);
848382
848324
  return;
848383
848325
  }
848384
848326
  if (!parsed.yes) {
@@ -862223,7 +862165,7 @@ import { mkdirSync as mkdirSync64, readFileSync as readFileSync86, writeFileSync
862223
862165
  import { dirname as dirname63, resolve as resolve39 } from "path";
862224
862166
  init_state3();
862225
862167
  var VALID_CLASSES2 = ["decision", "constraint", "incident", "pattern", "fact", "risk", "runbook", "architecture", "ownership"];
862226
- var VALID_SCOPES3 = ["session", "project", "team"];
862168
+ var VALID_SCOPES4 = ["session", "project", "team"];
862227
862169
  var VALID_REVIEW_STATES3 = ["fresh", "reviewed", "stale", "contradicted"];
862228
862170
  var VALID_PROVENANCE_KINDS = ["session", "turn", "task", "event", "file"];
862229
862171
  var VALUE_OPTIONS = new Set([
@@ -862323,7 +862265,7 @@ function isMemoryClass2(value) {
862323
862265
  return VALID_CLASSES2.includes(value);
862324
862266
  }
862325
862267
  function isMemoryScope2(value) {
862326
- return VALID_SCOPES3.includes(value);
862268
+ return VALID_SCOPES4.includes(value);
862327
862269
  }
862328
862270
  function isReviewState(value) {
862329
862271
  return VALID_REVIEW_STATES3.includes(value);
@@ -862338,7 +862280,7 @@ function requireClass(value) {
862338
862280
  }
862339
862281
  function requireScope(value) {
862340
862282
  if (!value || !isMemoryScope2(value))
862341
- throw new Error(`Invalid memory scope "${value ?? ""}". Valid values ${VALID_SCOPES3.join(", ")}`);
862283
+ throw new Error(`Invalid memory scope "${value ?? ""}". Valid values ${VALID_SCOPES4.join(", ")}`);
862342
862284
  return value;
862343
862285
  }
862344
862286
  function optionalScope(value) {
@@ -879834,6 +879776,126 @@ function describeHarnessCliCommand(args2) {
879834
879776
  };
879835
879777
  }
879836
879778
 
879779
+ // src/tools/agent-harness-command-catalog.ts
879780
+ function readString51(value) {
879781
+ return typeof value === "string" ? value.trim() : "";
879782
+ }
879783
+ function readLimit6(value, fallback) {
879784
+ const parsed = typeof value === "string" && value.trim() ? Number(value) : value;
879785
+ if (typeof parsed !== "number" || !Number.isFinite(parsed))
879786
+ return fallback;
879787
+ return Math.max(1, Math.min(500, Math.trunc(parsed)));
879788
+ }
879789
+ function readStringArray12(value) {
879790
+ if (!Array.isArray(value))
879791
+ return [];
879792
+ return value.map((entry) => typeof entry === "string" ? entry : String(entry));
879793
+ }
879794
+ function commandMatches(command8, query2) {
879795
+ if (!query2)
879796
+ return true;
879797
+ const haystack = [
879798
+ command8.name,
879799
+ ...command8.aliases ?? [],
879800
+ command8.description,
879801
+ command8.usage ?? "",
879802
+ command8.argsHint ?? ""
879803
+ ].join(`
879804
+ `).toLowerCase();
879805
+ return haystack.includes(query2.toLowerCase());
879806
+ }
879807
+ function describeCommand(command8, lookup) {
879808
+ return {
879809
+ name: command8.name,
879810
+ slash: `/${command8.name}`,
879811
+ aliases: command8.aliases ?? [],
879812
+ description: command8.description,
879813
+ usage: command8.usage ?? "",
879814
+ argsHint: command8.argsHint ?? command8.usage ?? "",
879815
+ ...lookup ? {
879816
+ lookup: {
879817
+ source: lookup.source,
879818
+ input: lookup.input,
879819
+ parsedName: lookup.parsedName,
879820
+ parsedArgs: lookup.parsedArgs,
879821
+ resolvedBy: lookup.resolvedBy
879822
+ }
879823
+ } : {},
879824
+ policy: describeCommandPolicy(command8.name)
879825
+ };
879826
+ }
879827
+ function commandDetailLookupFromArgs(args2) {
879828
+ const rawCommand = readString51(args2.command);
879829
+ if (rawCommand) {
879830
+ const parsed = parseSlashCommand(rawCommand);
879831
+ return { source: "command", input: rawCommand, parsedName: parsed.name, parsedArgs: parsed.args };
879832
+ }
879833
+ const rawCommandName = readString51(args2.commandName);
879834
+ if (rawCommandName) {
879835
+ const parsed = parseSlashCommand(rawCommandName);
879836
+ const explicitArgs = readStringArray12(args2.args);
879837
+ return {
879838
+ source: "commandName",
879839
+ input: rawCommandName,
879840
+ parsedName: parsed.name,
879841
+ parsedArgs: explicitArgs.length > 0 ? explicitArgs : parsed.args
879842
+ };
879843
+ }
879844
+ const rawTarget = readString51(args2.target);
879845
+ if (rawTarget) {
879846
+ const parsed = parseSlashCommand(rawTarget);
879847
+ return { source: "target", input: rawTarget, parsedName: parsed.name, parsedArgs: parsed.args };
879848
+ }
879849
+ const rawQuery = readString51(args2.query);
879850
+ if (rawQuery) {
879851
+ const parsed = parseSlashCommand(rawQuery);
879852
+ return { source: "query", input: rawQuery, parsedName: parsed.name, parsedArgs: parsed.args };
879853
+ }
879854
+ return null;
879855
+ }
879856
+ function resolveCommandDetail(commandRegistry, args2) {
879857
+ const lookup = commandDetailLookupFromArgs(args2);
879858
+ if (!lookup?.parsedName)
879859
+ return null;
879860
+ const direct = commandRegistry.get(lookup.parsedName);
879861
+ if (direct) {
879862
+ return {
879863
+ command: direct,
879864
+ lookup: {
879865
+ ...lookup,
879866
+ resolvedBy: direct.name === lookup.parsedName ? "name" : "alias"
879867
+ }
879868
+ };
879869
+ }
879870
+ const normalized = lookup.parsedName.toLowerCase();
879871
+ for (const command8 of commandRegistry.list()) {
879872
+ if (command8.name.toLowerCase() === normalized) {
879873
+ return { command: command8, lookup: { ...lookup, resolvedBy: "case-insensitive-name" } };
879874
+ }
879875
+ if ((command8.aliases ?? []).some((alias) => alias.toLowerCase() === normalized)) {
879876
+ return { command: command8, lookup: { ...lookup, resolvedBy: "case-insensitive-alias" } };
879877
+ }
879878
+ }
879879
+ const descriptionMatches = commandRegistry.list().filter((command8) => commandMatches(command8, lookup.input));
879880
+ if (descriptionMatches.length === 1) {
879881
+ return { command: descriptionMatches[0], lookup: { ...lookup, resolvedBy: "description" } };
879882
+ }
879883
+ const prefixMatches = commandRegistry.fuzzyMatch(lookup.parsedName).filter((entry) => entry.score >= 80);
879884
+ if (prefixMatches.length === 1) {
879885
+ return { command: prefixMatches[0].command, lookup: { ...lookup, resolvedBy: "prefix" } };
879886
+ }
879887
+ return null;
879888
+ }
879889
+ function listHarnessCommands(commandRegistry, args2) {
879890
+ const query2 = readString51(args2.query);
879891
+ const limit3 = readLimit6(args2.limit, 200);
879892
+ return commandRegistry.list().filter((command8) => commandMatches(command8, query2)).sort((a4, b3) => a4.name.localeCompare(b3.name)).slice(0, limit3).map((command8) => describeCommand(command8));
879893
+ }
879894
+ function describeHarnessCommand(commandRegistry, args2) {
879895
+ const detail = resolveCommandDetail(commandRegistry, args2);
879896
+ return detail ? describeCommand(detail.command, detail.lookup) : null;
879897
+ }
879898
+
879837
879899
  // src/tools/agent-harness-keybinding-metadata.ts
879838
879900
  import { existsSync as existsSync82, mkdirSync as mkdirSync67, readFileSync as readFileSync89, writeFileSync as writeFileSync58 } from "fs";
879839
879901
  import { dirname as dirname66 } from "path";
@@ -879847,10 +879909,10 @@ var FIXED_SHORTCUTS = [
879847
879909
  { key: "F2 / /shortcuts", description: "Open keyboard shortcut reference" },
879848
879910
  { key: "/keybindings", description: "List configurable keybindings and config path" }
879849
879911
  ];
879850
- function readString51(value) {
879912
+ function readString52(value) {
879851
879913
  return typeof value === "string" ? value.trim() : "";
879852
879914
  }
879853
- function readLimit6(value, fallback) {
879915
+ function readLimit7(value, fallback) {
879854
879916
  const parsed = typeof value === "string" && value.trim() ? Number(value) : value;
879855
879917
  if (typeof parsed !== "number" || !Number.isFinite(parsed))
879856
879918
  return fallback;
@@ -879871,7 +879933,7 @@ function isKeyAction2(action2) {
879871
879933
  return Object.hasOwn(ACTION_DESCRIPTIONS, action2);
879872
879934
  }
879873
879935
  function actionFromArgs(args2) {
879874
- const action2 = readString51(args2.actionId || args2.key || args2.query);
879936
+ const action2 = readString52(args2.actionId || args2.key || args2.query);
879875
879937
  return action2 && isKeyAction2(action2) ? action2 : null;
879876
879938
  }
879877
879939
  function readBoolean15(value) {
@@ -879890,7 +879952,7 @@ function normalizeCombo(value) {
879890
879952
  if (typeof value !== "object" || value === null || Array.isArray(value))
879891
879953
  return null;
879892
879954
  const raw = value;
879893
- const key = readString51(raw.key);
879955
+ const key = readString52(raw.key);
879894
879956
  if (!key)
879895
879957
  return null;
879896
879958
  const combo = { key };
@@ -879940,7 +880002,7 @@ function combosFromArgs(args2) {
879940
880002
  const fieldCombo = normalizeCombo(fields);
879941
880003
  if (fieldCombo)
879942
880004
  return [fieldCombo];
879943
- const labelCombo = parseComboLabel(readString51(args2.value));
880005
+ const labelCombo = parseComboLabel(readString52(args2.value));
879944
880006
  if (labelCombo)
879945
880007
  return [labelCombo];
879946
880008
  throw new Error('set_keybinding requires combo, combos, fields.key, or a value such as "Ctrl+G".');
@@ -880008,9 +880070,9 @@ function totalHarnessShortcuts(context) {
880008
880070
  }
880009
880071
  function listHarnessShortcuts(context, args2) {
880010
880072
  const keybindings = listHarnessKeybindings(context, args2);
880011
- const query2 = readString51(args2.query).toLowerCase();
880073
+ const query2 = readString52(args2.query).toLowerCase();
880012
880074
  const fixed = FIXED_SHORTCUTS.filter((shortcut) => !query2 || `${shortcut.key}
880013
- ${shortcut.description}`.toLowerCase().includes(query2)).slice(0, readLimit6(args2.limit, 200)).map((shortcut) => ({ ...shortcut, source: "fixed", userEditable: false }));
880075
+ ${shortcut.description}`.toLowerCase().includes(query2)).slice(0, readLimit7(args2.limit, 200)).map((shortcut) => ({ ...shortcut, source: "fixed", userEditable: false }));
880014
880076
  return {
880015
880077
  configPath: keybindings.configPath,
880016
880078
  fixedShortcuts: fixed,
@@ -880022,8 +880084,8 @@ ${shortcut.description}`.toLowerCase().includes(query2)).slice(0, readLimit6(arg
880022
880084
  }
880023
880085
  function listHarnessKeybindings(context, args2) {
880024
880086
  const manager5 = requireKeybindingsManager2(context);
880025
- const query2 = readString51(args2.query);
880026
- const entries = manager5.getAll().filter((entry) => bindingMatches(entry, query2)).slice(0, readLimit6(args2.limit, 200)).map((entry) => describeBinding(manager5, entry.action, entry.combos));
880087
+ const query2 = readString52(args2.query);
880088
+ const entries = manager5.getAll().filter((entry) => bindingMatches(entry, query2)).slice(0, readLimit7(args2.limit, 200)).map((entry) => describeBinding(manager5, entry.action, entry.combos));
880027
880089
  return {
880028
880090
  configPath: manager5.getConfigPath(),
880029
880091
  keybindings: entries,
@@ -880078,10 +880140,10 @@ function resetHarnessKeybinding(context, args2) {
880078
880140
  }
880079
880141
 
880080
880142
  // src/tools/agent-harness-panel-metadata.ts
880081
- function readString52(value) {
880143
+ function readString53(value) {
880082
880144
  return typeof value === "string" ? value.trim() : "";
880083
880145
  }
880084
- function readLimit7(value, fallback) {
880146
+ function readLimit8(value, fallback) {
880085
880147
  const parsed = typeof value === "string" && value.trim() ? Number(value) : value;
880086
880148
  if (typeof parsed !== "number" || !Number.isFinite(parsed))
880087
880149
  return fallback;
@@ -880136,16 +880198,16 @@ function listHarnessPanels(context, args2) {
880136
880198
  const manager5 = panelManager(context);
880137
880199
  if (!manager5)
880138
880200
  return [];
880139
- const query2 = readString52(args2.query);
880140
- const category = readString52(args2.category);
880141
- const limit3 = readLimit7(args2.limit, 200);
880201
+ const query2 = readString53(args2.query);
880202
+ const category = readString53(args2.category);
880203
+ const limit3 = readLimit8(args2.limit, 200);
880142
880204
  return manager5.getRegisteredTypes().map((registration) => describePanelRegistration(context, registration)).filter((panel) => !category || panel.category === category).filter((panel) => panelMatches(panel, query2)).sort((a4, b3) => String(a4.id).localeCompare(String(b3.id))).slice(0, limit3);
880143
880205
  }
880144
880206
  function describeHarnessPanel(context, args2) {
880145
880207
  const manager5 = panelManager(context);
880146
880208
  if (!manager5)
880147
880209
  return null;
880148
- const panelId = readString52(args2.panelId || args2.query);
880210
+ const panelId = readString53(args2.panelId || args2.query);
880149
880211
  if (!panelId)
880150
880212
  return null;
880151
880213
  const registration = manager5.getRegisteredTypes().find((panel) => panel.id === panelId || panel.name.toLowerCase() === panelId.toLowerCase());
@@ -880156,11 +880218,11 @@ function openHarnessPanel(context, args2) {
880156
880218
  if (!panel) {
880157
880219
  return {
880158
880220
  status: "unknown_panel",
880159
- panelId: readString52(args2.panelId || args2.query) || "<missing>",
880221
+ panelId: readString53(args2.panelId || args2.query) || "<missing>",
880160
880222
  availablePanels: listHarnessPanels(context, { limit: 50 }).map((entry) => entry.id)
880161
880223
  };
880162
880224
  }
880163
- const requestedPane = readString52(args2.pane);
880225
+ const requestedPane = readString53(args2.pane);
880164
880226
  const pane = requestedPane === "bottom" || requestedPane === "top" ? requestedPane : undefined;
880165
880227
  if (!context.showPanel) {
880166
880228
  return {
@@ -880184,7 +880246,7 @@ import { join as join98 } from "path";
880184
880246
  function isRecord42(value) {
880185
880247
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
880186
880248
  }
880187
- function readString53(record2, key) {
880249
+ function readString54(record2, key) {
880188
880250
  const value = record2?.[key];
880189
880251
  return typeof value === "string" ? value : null;
880190
880252
  }
@@ -880235,7 +880297,7 @@ async function inspectCliExternalRuntime(options) {
880235
880297
  try {
880236
880298
  const status = await fetchJson2(`${baseUrl}/status`, token.token, timeoutMs);
880237
880299
  const statusRecord = isRecord42(status.body) ? status.body : {};
880238
- const version6 = readString53(statusRecord, "version") ?? "unknown";
880300
+ const version6 = readString54(statusRecord, "version") ?? "unknown";
880239
880301
  const compatible = status.ok && version6 === SDK_VERSION;
880240
880302
  if (!status.ok) {
880241
880303
  return {
@@ -880453,7 +880515,7 @@ function output6(value) {
880453
880515
  function error51(message) {
880454
880516
  return { success: false, error: message };
880455
880517
  }
880456
- function readString54(value) {
880518
+ function readString55(value) {
880457
880519
  return typeof value === "string" ? value.trim() : "";
880458
880520
  }
880459
880521
  function readFieldMap2(value) {
@@ -880480,10 +880542,10 @@ function describeEditor(editor) {
880480
880542
  }
880481
880543
  function readRecordId(args2) {
880482
880544
  const fields = readFieldMap2(args2.fields);
880483
- return readString54(args2.recordId ?? args2.id ?? fields.recordId ?? fields.id);
880545
+ return readString55(args2.recordId ?? args2.id ?? fields.recordId ?? fields.id);
880484
880546
  }
880485
880547
  function requireConfirmed(args2, label) {
880486
- if (!readString54(args2.explicitUserRequest))
880548
+ if (!readString55(args2.explicitUserRequest))
880487
880549
  return `${label} requires explicitUserRequest with the user's exact request or a short faithful summary.`;
880488
880550
  if (args2.confirm !== true)
880489
880551
  return `${label} requires confirm:true after an explicit user request.`;
@@ -880611,7 +880673,7 @@ function localRegistryArgsForTarget(target, args2, recordId) {
880611
880673
  ...base2,
880612
880674
  ...edit,
880613
880675
  ...target.action === "stale" && fields.reason ? { reason: fields.reason } : {},
880614
- ...target.action === "delete" ? { confirm: args2.confirm, explicitUserRequest: readString54(args2.explicitUserRequest) } : {}
880676
+ ...target.action === "delete" ? { confirm: args2.confirm, explicitUserRequest: readString55(args2.explicitUserRequest) } : {}
880615
880677
  };
880616
880678
  }
880617
880679
  async function executeTool(toolRegistry, name51, toolArgs) {
@@ -880677,7 +880739,7 @@ async function runLocalWorkspaceAction(deps, action2, args2) {
880677
880739
  if (missing.length > 0)
880678
880740
  return output6({ status: "missing_required_fields", missing, action: action2.id, editor: describeEditor(editor) });
880679
880741
  if (editor.kind === "knowledge-url")
880680
- return executeTool(deps.toolRegistry, "agent_knowledge_ingest", { sourceKind: "url", url: fieldReader(editor, fields)("url"), tags: splitList5(fieldReader(editor, fields)("tags")), folderPath: fieldReader(editor, fields)("folder"), confirm: args2.confirm, explicitUserRequest: readString54(args2.explicitUserRequest) });
880742
+ return executeTool(deps.toolRegistry, "agent_knowledge_ingest", { sourceKind: "url", url: fieldReader(editor, fields)("url"), tags: splitList5(fieldReader(editor, fields)("tags")), folderPath: fieldReader(editor, fields)("folder"), confirm: args2.confirm, explicitUserRequest: readString55(args2.explicitUserRequest) });
880681
880743
  return executeTool(deps.toolRegistry, "agent_local_registry", localRegistryArgsFromEditor(editor, fields, recordId));
880682
880744
  }
880683
880745
  if (!target)
@@ -880686,19 +880748,19 @@ async function runLocalWorkspaceAction(deps, action2, args2) {
880686
880748
  }
880687
880749
 
880688
880750
  // src/tools/agent-harness-model-tool-catalog.ts
880689
- function readString55(value) {
880751
+ function readString56(value) {
880690
880752
  return typeof value === "string" ? value.trim() : "";
880691
880753
  }
880692
- function readLimit8(value, fallback) {
880754
+ function readLimit9(value, fallback) {
880693
880755
  const parsed = typeof value === "string" && value.trim() ? Number(value) : value;
880694
880756
  if (typeof parsed !== "number" || !Number.isFinite(parsed))
880695
880757
  return fallback;
880696
880758
  return Math.max(1, Math.min(500, Math.trunc(parsed)));
880697
880759
  }
880698
880760
  function listHarnessModelTools(toolRegistry, args2) {
880699
- const query2 = readString55(args2.query).toLowerCase();
880761
+ const query2 = readString56(args2.query).toLowerCase();
880700
880762
  const includeParameters = args2.includeParameters === true;
880701
- const limit3 = readLimit8(args2.limit, 200);
880763
+ const limit3 = readLimit9(args2.limit, 200);
880702
880764
  return toolRegistry.getToolDefinitions().filter((tool2) => !query2 || [tool2.name, tool2.description, ...tool2.sideEffects ?? []].join(`
880703
880765
  `).toLowerCase().includes(query2)).sort((a4, b3) => a4.name.localeCompare(b3.name)).slice(0, limit3).map((tool2) => ({
880704
880766
  name: tool2.name,
@@ -880711,7 +880773,7 @@ function listHarnessModelTools(toolRegistry, args2) {
880711
880773
  }));
880712
880774
  }
880713
880775
  function describeHarnessModelTool(toolRegistry, args2) {
880714
- const query2 = readString55(args2.toolName || args2.target || args2.query).toLowerCase();
880776
+ const query2 = readString56(args2.toolName || args2.target || args2.query).toLowerCase();
880715
880777
  if (!query2)
880716
880778
  return null;
880717
880779
  const tool2 = toolRegistry.getToolDefinitions().find((candidate) => candidate.name.toLowerCase() === query2 || candidate.name.toLowerCase().includes(query2));
@@ -880777,11 +880839,11 @@ var AGENT_HARNESS_PARAMETER_PROPERTIES = {
880777
880839
  },
880778
880840
  query: {
880779
880841
  type: "string",
880780
- description: "Search text for command, setting, tool, or UI surface catalogs."
880842
+ description: "Search text for command, workspace action, setting, tool, or UI surface catalogs; also a slash-command lookup for mode command."
880781
880843
  },
880782
880844
  command: {
880783
880845
  type: "string",
880784
- description: 'Full slash command string for mode run_command, for example "/settings get provider.model". In cli_command mode this may also hold a top-level CLI string such as "goodvibes-agent status --json".'
880846
+ description: 'Full slash command string for mode command, workspace_action lookup, or run_command, for example "/settings get provider.model". In cli_command mode this may also hold a top-level CLI string such as "goodvibes-agent status --json".'
880785
880847
  },
880786
880848
  cliCommand: {
880787
880849
  type: "string",
@@ -880844,7 +880906,7 @@ var AGENT_HARNESS_PARAMETER_PROPERTIES = {
880844
880906
  },
880845
880907
  target: {
880846
880908
  type: "string",
880847
- description: "Optional lookup target, such as a model-picker target, settings key, model tool name, or connected-host capability id."
880909
+ description: "Optional lookup target, such as a model-picker target, workspace action id/search text, slash command root or invocation, settings key, model tool name, or connected-host capability id."
880848
880910
  },
880849
880911
  capabilityId: {
880850
880912
  type: "string",
@@ -880985,10 +881047,10 @@ async function openTtsVoicePicker(ctx, providerArg) {
880985
881047
  }
880986
881048
 
880987
881049
  // src/tools/agent-harness-ui-surface-metadata.ts
880988
- function readString56(value) {
881050
+ function readString57(value) {
880989
881051
  return typeof value === "string" ? value.trim() : "";
880990
881052
  }
880991
- function readLimit9(value, fallback) {
881053
+ function readLimit10(value, fallback) {
880992
881054
  const parsed = typeof value === "string" && value.trim() ? Number(value) : value;
880993
881055
  if (typeof parsed !== "number" || !Number.isFinite(parsed))
880994
881056
  return fallback;
@@ -881011,35 +881073,35 @@ function opened(surface, extra = {}) {
881011
881073
  };
881012
881074
  }
881013
881075
  function optionalModelTarget(args2) {
881014
- const target = readString56(args2.target);
881076
+ const target = readString57(args2.target);
881015
881077
  return target === "main" || target === "helper" || target === "tool" || target === "tts" ? target : undefined;
881016
881078
  }
881017
881079
  function optionalOnboardingMode(args2) {
881018
- const target = readString56(args2.target);
881080
+ const target = readString57(args2.target);
881019
881081
  return target === "new" || target === "edit" || target === "reopen" ? target : undefined;
881020
881082
  }
881021
881083
  function workspaceCategory(args2) {
881022
- return readString56(args2.categoryId || args2.category || args2.target) || undefined;
881084
+ return readString57(args2.categoryId || args2.category || args2.target) || undefined;
881023
881085
  }
881024
881086
  function settingsTarget(args2) {
881025
- return readString56(args2.target || args2.key || args2.prefix) || undefined;
881087
+ return readString57(args2.target || args2.key || args2.prefix) || undefined;
881026
881088
  }
881027
881089
  function providerTarget(args2) {
881028
- return readString56(args2.target || args2.key || args2.prefix) || undefined;
881090
+ return readString57(args2.target || args2.key || args2.prefix) || undefined;
881029
881091
  }
881030
881092
  function optionalPane(args2) {
881031
- const pane = readString56(args2.pane);
881093
+ const pane = readString57(args2.pane);
881032
881094
  return pane === "top" || pane === "bottom" ? pane : undefined;
881033
881095
  }
881034
881096
  function surfaceInputText(args2) {
881035
- return readString56(args2.prefix || args2.key || (args2.surfaceId ? args2.query : undefined) || args2.target) || undefined;
881097
+ return readString57(args2.prefix || args2.key || (args2.surfaceId ? args2.query : undefined) || args2.target) || undefined;
881036
881098
  }
881037
881099
  function filePickerOptions(args2) {
881038
- const target = readString56(args2.target).toLowerCase();
881100
+ const target = readString57(args2.target).toLowerCase();
881039
881101
  const injectMode = target === "inject" || target === "inject-mode" || target === "!@";
881040
881102
  return {
881041
881103
  injectMode,
881042
- query: readString56(args2.prefix || args2.key || (args2.surfaceId ? args2.query : undefined)) || undefined
881104
+ query: readString57(args2.prefix || args2.key || (args2.surfaceId ? args2.query : undefined)) || undefined
881043
881105
  };
881044
881106
  }
881045
881107
  function openAgentWorkspaceCategory(context, surface, categoryId, extra = {}) {
@@ -881615,19 +881677,19 @@ function totalHarnessUiSurfaces() {
881615
881677
  return UI_SURFACES.length;
881616
881678
  }
881617
881679
  function listHarnessUiSurfaces(context, args2) {
881618
- const query2 = readString56(args2.query);
881619
- const limit3 = readLimit9(args2.limit, 200);
881680
+ const query2 = readString57(args2.query);
881681
+ const limit3 = readLimit10(args2.limit, 200);
881620
881682
  return UI_SURFACES.map((surface) => describeSurface(context, surface)).filter((surface) => surfaceMatches(surface, query2)).slice(0, limit3);
881621
881683
  }
881622
881684
  function describeHarnessUiSurface(context, args2) {
881623
- const surfaceId = readString56(args2.surfaceId || args2.query);
881685
+ const surfaceId = readString57(args2.surfaceId || args2.query);
881624
881686
  if (!surfaceId)
881625
881687
  return null;
881626
881688
  const surface = UI_SURFACES.find((entry) => entry.id === surfaceId || entry.label.toLowerCase() === surfaceId.toLowerCase());
881627
881689
  return surface ? describeSurface(context, surface) : null;
881628
881690
  }
881629
881691
  async function openHarnessUiSurface(context, args2) {
881630
- const surfaceId = readString56(args2.surfaceId || args2.query);
881692
+ const surfaceId = readString57(args2.surfaceId || args2.query);
881631
881693
  const surface = UI_SURFACES.find((entry) => entry.id === surfaceId || entry.label.toLowerCase() === surfaceId.toLowerCase());
881632
881694
  if (!surface) {
881633
881695
  return {
@@ -881647,16 +881709,16 @@ async function openHarnessUiSurface(context, args2) {
881647
881709
  function isMode(value) {
881648
881710
  return typeof value === "string" && AGENT_HARNESS_MODES.includes(value);
881649
881711
  }
881650
- function readString57(value) {
881712
+ function readString58(value) {
881651
881713
  return typeof value === "string" ? value.trim() : "";
881652
881714
  }
881653
- function readLimit10(value, fallback) {
881715
+ function readLimit11(value, fallback) {
881654
881716
  const parsed = typeof value === "string" && value.trim() ? Number(value) : value;
881655
881717
  if (typeof parsed !== "number" || !Number.isFinite(parsed))
881656
881718
  return fallback;
881657
881719
  return Math.max(1, Math.min(500, Math.trunc(parsed)));
881658
881720
  }
881659
- function readStringArray12(value) {
881721
+ function readStringArray13(value) {
881660
881722
  if (!Array.isArray(value))
881661
881723
  return [];
881662
881724
  return value.map((entry) => typeof entry === "string" ? entry : String(entry));
@@ -881675,30 +881737,6 @@ function output7(value) {
881675
881737
  function error52(message) {
881676
881738
  return { success: false, error: message };
881677
881739
  }
881678
- function commandMatches(command8, query2) {
881679
- if (!query2)
881680
- return true;
881681
- const haystack = [
881682
- command8.name,
881683
- ...command8.aliases ?? [],
881684
- command8.description,
881685
- command8.usage ?? "",
881686
- command8.argsHint ?? ""
881687
- ].join(`
881688
- `).toLowerCase();
881689
- return haystack.includes(query2.toLowerCase());
881690
- }
881691
- function describeCommand(command8) {
881692
- return {
881693
- name: command8.name,
881694
- slash: `/${command8.name}`,
881695
- aliases: command8.aliases ?? [],
881696
- description: command8.description,
881697
- usage: command8.usage ?? "",
881698
- argsHint: command8.argsHint ?? command8.usage ?? "",
881699
- policy: describeCommandPolicy(command8.name)
881700
- };
881701
- }
881702
881740
  function allWorkspaceActions() {
881703
881741
  return AGENT_WORKSPACE_CATEGORIES.flatMap((category) => category.actions.map((action2) => ({ category, action: action2 })));
881704
881742
  }
@@ -881731,7 +881769,7 @@ function describeWorkspaceEditor(editor) {
881731
881769
  }
881732
881770
  function selectedRoutineFromArgs(snapshot, args2) {
881733
881771
  const fields = readFieldMap3(args2.fields);
881734
- const routineId = readString57(args2.recordId) || readString57(fields.routineId) || readString57(fields.id);
881772
+ const routineId = readString58(args2.recordId) || readString58(fields.routineId) || readString58(fields.id);
881735
881773
  if (!routineId)
881736
881774
  return null;
881737
881775
  return snapshot.localRoutines.find((routine) => routine.id === routineId || routine.name.toLowerCase() === routineId.toLowerCase()) ?? null;
@@ -881772,6 +881810,7 @@ function describeWorkspaceAction(category, action2, options = {}) {
881772
881810
  ...action2.editorKind ? { editorKind: action2.editorKind } : {},
881773
881811
  ...action2.localKind ? { localKind: action2.localKind } : {},
881774
881812
  ...action2.localOperation ? { localOperation: action2.localOperation } : {},
881813
+ ...options.lookup ? { lookup: options.lookup } : {},
881775
881814
  ...editor ? { editor: describeWorkspaceEditor(editor) } : {},
881776
881815
  ...action2.kind === "local-selection" || action2.kind === "local-operation" ? {
881777
881816
  modelExecution: describeLocalWorkspaceModelExecution(action2)
@@ -881799,17 +881838,17 @@ function localEditorModelExecution(editorKind) {
881799
881838
  return "Use the command field, editor schema, or a first-class Agent model tool when available.";
881800
881839
  }
881801
881840
  function listWorkspaceActions(deps, args2) {
881802
- const query2 = readString57(args2.query);
881803
- const categoryId = readString57(args2.categoryId || args2.category);
881804
- const limit3 = readLimit10(args2.limit, 200);
881841
+ const query2 = readString58(args2.query);
881842
+ const categoryId = readString58(args2.categoryId || args2.category);
881843
+ const limit3 = readLimit11(args2.limit, 200);
881805
881844
  const includeEditor = args2.includeParameters === true;
881806
881845
  const editorContext = includeEditor ? buildWorkspaceEditorContext(deps.commandContext, args2) : null;
881807
881846
  const source = query2 ? searchAgentWorkspaceActions(AGENT_WORKSPACE_CATEGORIES, query2).map((result2) => ({ category: result2.category, action: result2.action })) : allWorkspaceActions();
881808
881847
  return source.filter((entry) => !categoryId || entry.category.id === categoryId).slice(0, limit3).map((entry) => describeWorkspaceAction(entry.category, entry.action, { includeEditor, editorContext }));
881809
881848
  }
881810
881849
  function findWorkspaceAction(args2) {
881811
- const actionId = readString57(args2.actionId || args2.query);
881812
- const categoryId = readString57(args2.categoryId || args2.category);
881850
+ const actionId = readString58(args2.actionId || args2.query);
881851
+ const categoryId = readString58(args2.categoryId || args2.category);
881813
881852
  if (!actionId)
881814
881853
  return null;
881815
881854
  return allWorkspaceActions().find((entry) => {
@@ -881818,13 +881857,59 @@ function findWorkspaceAction(args2) {
881818
881857
  return entry.action.id === actionId || entry.action.label.toLowerCase() === actionId.toLowerCase();
881819
881858
  }) ?? null;
881820
881859
  }
881821
- function listCommands(commandRegistry, args2) {
881822
- const query2 = readString57(args2.query);
881823
- const limit3 = readLimit10(args2.limit, 200);
881824
- return commandRegistry.list().filter((command8) => commandMatches(command8, query2)).sort((a4, b3) => a4.name.localeCompare(b3.name)).slice(0, limit3).map(describeCommand);
881860
+ function workspaceActionLookupFromArgs(args2) {
881861
+ const actionId = readString58(args2.actionId);
881862
+ if (actionId)
881863
+ return { source: "actionId", input: actionId };
881864
+ const command8 = readString58(args2.command);
881865
+ if (command8)
881866
+ return { source: "command", input: command8 };
881867
+ const target = readString58(args2.target);
881868
+ if (target)
881869
+ return { source: "target", input: target };
881870
+ const query2 = readString58(args2.query);
881871
+ return query2 ? { source: "query", input: query2 } : null;
881872
+ }
881873
+ function describeWorkspaceActionCandidates(entries) {
881874
+ return entries.slice(0, 8).map((entry) => ({
881875
+ actionId: entry.action.id,
881876
+ categoryId: entry.category.id,
881877
+ label: entry.action.label,
881878
+ ...entry.action.command ? { command: entry.action.command } : {}
881879
+ }));
881880
+ }
881881
+ function resolveWorkspaceActionDetail(args2) {
881882
+ const lookup = workspaceActionLookupFromArgs(args2);
881883
+ const categoryId = readString58(args2.categoryId || args2.category);
881884
+ if (!lookup)
881885
+ return null;
881886
+ const entries = allWorkspaceActions().filter((entry) => !categoryId || entry.category.id === categoryId);
881887
+ const normalized = lookup.input.toLowerCase();
881888
+ const commandInput = lookup.source === "command" ? lookup.input.trim() : "";
881889
+ const exactId = entries.find((entry) => entry.action.id === lookup.input);
881890
+ if (exactId)
881891
+ return { status: "found", ...exactId, lookup: { ...lookup, resolvedBy: "id" } };
881892
+ const exactLabel = entries.find((entry) => entry.action.label === lookup.input);
881893
+ if (exactLabel)
881894
+ return { status: "found", ...exactLabel, lookup: { ...lookup, resolvedBy: "label" } };
881895
+ const exactCommand = commandInput ? entries.find((entry) => entry.action.command === commandInput) : null;
881896
+ if (exactCommand)
881897
+ return { status: "found", ...exactCommand, lookup: { ...lookup, resolvedBy: "command" } };
881898
+ const insensitiveId = entries.find((entry) => entry.action.id.toLowerCase() === normalized);
881899
+ if (insensitiveId)
881900
+ return { status: "found", ...insensitiveId, lookup: { ...lookup, resolvedBy: "case-insensitive-id" } };
881901
+ const insensitiveLabel = entries.find((entry) => entry.action.label.toLowerCase() === normalized);
881902
+ if (insensitiveLabel)
881903
+ return { status: "found", ...insensitiveLabel, lookup: { ...lookup, resolvedBy: "case-insensitive-label" } };
881904
+ const searched = searchAgentWorkspaceActions(AGENT_WORKSPACE_CATEGORIES, lookup.input).map((result2) => ({ category: result2.category, action: result2.action })).filter((entry) => !categoryId || entry.category.id === categoryId);
881905
+ if (searched.length === 1)
881906
+ return { status: "found", ...searched[0], lookup: { ...lookup, resolvedBy: "search" } };
881907
+ if (searched.length > 1)
881908
+ return { status: "ambiguous", input: lookup.input, candidates: describeWorkspaceActionCandidates(searched) };
881909
+ return null;
881825
881910
  }
881826
881911
  function requireConfirmedAction(args2, action2) {
881827
- const explicitUserRequest = readString57(args2.explicitUserRequest);
881912
+ const explicitUserRequest = readString58(args2.explicitUserRequest);
881828
881913
  if (!explicitUserRequest)
881829
881914
  return `${action2} requires explicitUserRequest with the user's exact request or a short faithful summary.`;
881830
881915
  if (args2.confirm !== true)
@@ -881832,7 +881917,7 @@ function requireConfirmedAction(args2, action2) {
881832
881917
  return null;
881833
881918
  }
881834
881919
  function commandFromArgs(args2) {
881835
- const rawCommand = readString57(args2.command);
881920
+ const rawCommand = readString58(args2.command);
881836
881921
  if (rawCommand) {
881837
881922
  const parsed = parseSlashCommand(rawCommand);
881838
881923
  if (!parsed.name)
@@ -881842,10 +881927,10 @@ function commandFromArgs(args2) {
881842
881927
  args: parsed.args
881843
881928
  };
881844
881929
  }
881845
- const commandName = readString57(args2.commandName).replace(/^\//, "");
881930
+ const commandName = readString58(args2.commandName).replace(/^\//, "");
881846
881931
  if (!commandName)
881847
881932
  return null;
881848
- const commandArgs = readStringArray12(args2.args);
881933
+ const commandArgs = readStringArray13(args2.args);
881849
881934
  return {
881850
881935
  name: commandName,
881851
881936
  args: commandArgs
@@ -882069,8 +882154,8 @@ function createAgentHarnessTool(deps) {
882069
882154
  panels: 'Use mode:"panels" and mode:"panel" to inspect built-in panel catalog/open state; use mode:"open_panel" with confirm:true plus explicitUserRequest to route a visible panel/workspace change.',
882070
882155
  uiSurfaces: 'Use mode:"ui_surfaces" and mode:"ui_surface" to inspect modal/overlay/picker/workspace surfaces; use mode:"open_ui_surface" with confirm:true plus explicitUserRequest to route visible UI navigation.',
882071
882156
  shortcuts: 'Use mode:"shortcuts" to inspect fixed shortcuts plus configurable keybindings. Use mode:"set_keybinding" and mode:"reset_keybinding" with confirm:true plus explicitUserRequest to edit the same config file the user edits.',
882072
- slashCommands: 'Use mode:"commands" and mode:"command" to inspect; use mode:"run_command" with confirm:true plus explicitUserRequest to execute.',
882073
- workspace: 'Use mode:"workspace_actions" to list and mode:"workspace_action" for editor schemas; set includeParameters:true on workspace_actions to inline editor schemas.',
882157
+ slashCommands: 'Use mode:"commands" to list slash commands and mode:"command" with command, commandName, target, or query to inspect one command; use mode:"run_command" with confirm:true plus explicitUserRequest to execute.',
882158
+ workspace: 'Use mode:"workspace_actions" to list and mode:"workspace_action" with actionId, command, target, or query for one action and editor schema; set includeParameters:true on workspace_actions to inline editor schemas.',
882074
882159
  settings: 'Use mode:"settings", mode:"get_setting", mode:"set_setting", and mode:"reset_setting".',
882075
882160
  tools: 'Use mode:"tools" to list first-class model tools, or mode:"tool" with toolName, target, or query to inspect one schema.',
882076
882161
  connectedHost: 'Use mode:"connected_host" for the connected-host capability map and blocked boundaries. Use mode:"connected_host_capability" with capabilityId, target, or query for one allowed or blocked capability.',
@@ -882104,7 +882189,7 @@ function createAgentHarnessTool(deps) {
882104
882189
  }
882105
882190
  if (args2.mode === "panel") {
882106
882191
  const panel = describeHarnessPanel(deps.commandContext, args2);
882107
- return panel ? output7(panel) : error52(`Unknown panel ${readString57(args2.panelId || args2.query) || "<missing>"}.`);
882192
+ return panel ? output7(panel) : error52(`Unknown panel ${readString58(args2.panelId || args2.query) || "<missing>"}.`);
882108
882193
  }
882109
882194
  if (args2.mode === "open_panel") {
882110
882195
  const confirmationError2 = requireConfirmedAction(args2, "Panel routing");
@@ -882118,7 +882203,7 @@ function createAgentHarnessTool(deps) {
882118
882203
  }
882119
882204
  if (args2.mode === "ui_surface") {
882120
882205
  const surface = describeHarnessUiSurface(deps.commandContext, args2);
882121
- return surface ? output7(surface) : error52(`Unknown UI surface ${readString57(args2.surfaceId || args2.query) || "<missing>"}.`);
882206
+ return surface ? output7(surface) : error52(`Unknown UI surface ${readString58(args2.surfaceId || args2.query) || "<missing>"}.`);
882122
882207
  }
882123
882208
  if (args2.mode === "open_ui_surface") {
882124
882209
  const confirmationError2 = requireConfirmedAction(args2, "UI surface routing");
@@ -882132,7 +882217,7 @@ function createAgentHarnessTool(deps) {
882132
882217
  return output7(listHarnessKeybindings(deps.commandContext, args2));
882133
882218
  if (args2.mode === "keybinding") {
882134
882219
  const binding = describeHarnessKeybinding(deps.commandContext, args2);
882135
- return binding ? output7(binding) : error52(`Unknown keybinding action ${readString57(args2.actionId || args2.key || args2.query) || "<missing>"}.`);
882220
+ return binding ? output7(binding) : error52(`Unknown keybinding action ${readString58(args2.actionId || args2.key || args2.query) || "<missing>"}.`);
882136
882221
  }
882137
882222
  if (args2.mode === "set_keybinding") {
882138
882223
  const confirmationError2 = requireConfirmedAction(args2, "Keybinding mutation");
@@ -882147,28 +882232,28 @@ function createAgentHarnessTool(deps) {
882147
882232
  return output7(resetHarnessKeybinding(deps.commandContext, args2));
882148
882233
  }
882149
882234
  if (args2.mode === "commands") {
882150
- const commands3 = listCommands(deps.commandRegistry, args2);
882235
+ const commands3 = listHarnessCommands(deps.commandRegistry, args2);
882151
882236
  return output7({ commands: commands3, returned: commands3.length, total: deps.commandRegistry.list().length });
882152
882237
  }
882153
882238
  if (args2.mode === "command") {
882154
- const name51 = readString57(args2.commandName).replace(/^\//, "");
882155
- const command8 = name51 ? deps.commandRegistry.get(name51) : null;
882156
- return command8 ? output7(describeCommand(command8)) : error52(`Unknown slash command /${name51 || "<missing>"}.`);
882239
+ const detail = describeHarnessCommand(deps.commandRegistry, args2);
882240
+ const query2 = readString58(args2.command || args2.commandName || args2.target || args2.query);
882241
+ return detail ? output7(detail) : error52(`Unknown slash command ${query2 || "<missing>"}. Use mode:"commands" to inspect available commands.`);
882157
882242
  }
882158
882243
  if (args2.mode === "run_command")
882159
882244
  return runCommand2(deps, args2);
882160
882245
  if (args2.mode === "settings") {
882161
882246
  const settings = listHarnessSettings(deps.commandContext.platform.configManager, {
882162
- category: readString57(args2.category) || undefined,
882163
- prefix: readString57(args2.prefix) || undefined,
882164
- query: readString57(args2.query) || undefined,
882247
+ category: readString58(args2.category) || undefined,
882248
+ prefix: readString58(args2.prefix) || undefined,
882249
+ query: readString58(args2.query) || undefined,
882165
882250
  includeHidden: args2.includeHidden === true,
882166
- limit: readLimit10(args2.limit, 100)
882251
+ limit: readLimit11(args2.limit, 100)
882167
882252
  });
882168
882253
  return output7({ settings, returned: settings.length, policy: settingsPolicySummary() });
882169
882254
  }
882170
882255
  if (args2.mode === "get_setting") {
882171
- const key = readString57(args2.key);
882256
+ const key = readString58(args2.key);
882172
882257
  const setting = getHarnessSetting(deps.commandContext.platform.configManager, key);
882173
882258
  return setting ? output7(setting) : error52(`Unknown setting ${key || "<missing>"}.`);
882174
882259
  }
@@ -882178,7 +882263,7 @@ function createAgentHarnessTool(deps) {
882178
882263
  return error52(confirmationError2);
882179
882264
  if (args2.value === undefined)
882180
882265
  return error52("set_setting requires value.");
882181
- const key = readString57(args2.key);
882266
+ const key = readString58(args2.key);
882182
882267
  const result2 = await setHarnessSetting(deps.commandContext.platform.configManager, deps.commandContext.platform.secretsManager, key, args2.value);
882183
882268
  return output7(result2);
882184
882269
  }
@@ -882186,7 +882271,7 @@ function createAgentHarnessTool(deps) {
882186
882271
  const confirmationError2 = requireConfirmedAction(args2, "Setting reset");
882187
882272
  if (confirmationError2)
882188
882273
  return error52(confirmationError2);
882189
- const key = readString57(args2.key);
882274
+ const key = readString58(args2.key);
882190
882275
  const result2 = await resetHarnessSetting(deps.commandContext.platform.configManager, deps.commandContext.platform.secretsManager, key);
882191
882276
  return output7(result2);
882192
882277
  }
@@ -882201,9 +882286,15 @@ function createAgentHarnessTool(deps) {
882201
882286
  return output7({ actions, returned: actions.length, total: allWorkspaceActions().length });
882202
882287
  }
882203
882288
  if (args2.mode === "workspace_action") {
882204
- const found = findWorkspaceAction(args2);
882289
+ const resolved = resolveWorkspaceActionDetail(args2);
882205
882290
  const editorContext = buildWorkspaceEditorContext(deps.commandContext, args2);
882206
- return found ? output7(describeWorkspaceAction(found.category, found.action, { includeEditor: true, editorContext })) : error52(`Unknown Agent workspace action ${readString57(args2.actionId || args2.query) || "<missing>"}.`);
882291
+ if (resolved?.status === "found") {
882292
+ return output7(describeWorkspaceAction(resolved.category, resolved.action, { includeEditor: true, editorContext, lookup: resolved.lookup }));
882293
+ }
882294
+ if (resolved?.status === "ambiguous") {
882295
+ return error52(`Ambiguous Agent workspace action ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
882296
+ }
882297
+ return error52(`Unknown Agent workspace action ${readString58(args2.actionId || args2.command || args2.target || args2.query) || "<missing>"}. Use mode:"workspace_actions" to inspect available actions.`);
882207
882298
  }
882208
882299
  if (args2.mode === "run_workspace_action")
882209
882300
  return runWorkspaceAction(deps, args2);
@@ -882212,14 +882303,14 @@ function createAgentHarnessTool(deps) {
882212
882303
  return output7({ tools: tools3, returned: tools3.length, total: deps.toolRegistry.getToolDefinitions().length });
882213
882304
  }
882214
882305
  if (args2.mode === "tool") {
882215
- const query2 = readString57(args2.toolName || args2.target || args2.query);
882306
+ const query2 = readString58(args2.toolName || args2.target || args2.query);
882216
882307
  const tool2 = describeHarnessModelTool(deps.toolRegistry, args2);
882217
882308
  return tool2 ? output7(tool2) : error52(`Unknown model tool ${query2 || "<missing>"}. Use mode:"tools" to inspect available model tools.`);
882218
882309
  }
882219
882310
  if (args2.mode === "connected_host")
882220
882311
  return output7(connectedHostSummary(deps.commandContext, deps.toolRegistry));
882221
882312
  if (args2.mode === "connected_host_capability") {
882222
- const query2 = readString57(args2.capabilityId || args2.target || args2.query);
882313
+ const query2 = readString58(args2.capabilityId || args2.target || args2.query);
882223
882314
  const capability = describeConnectedHostCapability(deps.toolRegistry, query2);
882224
882315
  return capability ? output7(capability) : error52(`Unknown connected-host capability ${query2 || "<missing>"}. Use mode:"connected_host" to inspect allowed and blocked capability ids.`);
882225
882316
  }