@pellux/goodvibes-agent 1.0.17 → 1.0.18

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,6 +389257,23 @@ 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
+ }
389260
389277
  function rowObject(columns, values2) {
389261
389278
  return Object.fromEntries(columns.map((column, index) => [column, values2[index]]));
389262
389279
  }
@@ -702594,6 +702611,9 @@ var init_ingest = __esm(() => {
702594
702611
  // node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/browser-history/index.js
702595
702612
  var init_browser_history = __esm(() => {
702596
702613
  init_ingest();
702614
+ init_discover();
702615
+ init_readers();
702616
+ init_paths2();
702597
702617
  });
702598
702618
 
702599
702619
  // node_modules/graphql/jsutils/devAssert.mjs
@@ -720233,6 +720253,7 @@ var init_semantic = __esm(() => {
720233
720253
  init_llm();
720234
720254
  init_gap_repair();
720235
720255
  init_service4();
720256
+ init_self_improvement();
720236
720257
  });
720237
720258
 
720238
720259
  // node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/home-graph/helpers.js
@@ -724201,8 +724222,40 @@ var init_map_view = __esm(() => {
724201
724222
  });
724202
724223
 
724203
724224
  // node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/home-graph/types.js
724204
- var HOME_GRAPH_CAPABILITIES;
724225
+ var HOME_GRAPH_NODE_KINDS, HOME_GRAPH_RELATIONS, HOME_GRAPH_CAPABILITIES;
724205
724226
  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
+ ];
724206
724259
  HOME_GRAPH_CAPABILITIES = [
724207
724260
  "knowledge-space-isolation",
724208
724261
  "snapshot-sync",
@@ -725609,6 +725662,7 @@ var init_service5 = __esm(() => {
725609
725662
  var init_home_graph = __esm(() => {
725610
725663
  init_service5();
725611
725664
  init_extension();
725665
+ init_types6();
725612
725666
  });
725613
725667
 
725614
725668
  // node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/store-refinement.js
@@ -727936,10 +727990,14 @@ var init_service6 = __esm(() => {
727936
727990
  var init_project_planning = __esm(() => {
727937
727991
  init_service6();
727938
727992
  init_helpers3();
727993
+ init_readiness();
727939
727994
  });
727940
727995
 
727941
727996
  // node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/persistence.js
727942
- var init_persistence = () => {};
727997
+ var init_persistence = __esm(() => {
727998
+ init_store_schema();
727999
+ init_store_load();
728000
+ });
727943
728001
 
727944
728002
  // node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/projections.js
727945
728003
  class KnowledgeProjectionService {
@@ -731447,21 +731505,21 @@ var init_service7 = __esm(() => {
731447
731505
  var exports_knowledge = {};
731448
731506
  __export(exports_knowledge, {
731449
731507
  withKnowledgeSpace: () => withKnowledgeSpace,
731450
- uniqKnowledgeValues: () => uniq3,
731451
- stabilizeKnowledgeText: () => stableText2,
731452
- runKnowledgeSemanticSelfImprovement: () => runKnowledgeSemanticSelfImprovement2,
731508
+ uniqKnowledgeValues: () => uniq2,
731509
+ stabilizeKnowledgeText: () => stableText,
731510
+ runKnowledgeSemanticSelfImprovement: () => runKnowledgeSemanticSelfImprovement,
731453
731511
  resolveProjectPlanningSpace: () => resolveProjectPlanningSpace,
731454
- resolveKnowledgeDbPathFromControlPlaneDir: () => resolveKnowledgeDbPathFromControlPlaneDir2,
731512
+ resolveKnowledgeDbPathFromControlPlaneDir: () => resolveKnowledgeDbPathFromControlPlaneDir,
731455
731513
  renderPacket: () => renderPacket,
731456
731514
  renderKnowledgeSchemaSql: () => renderKnowledgeSchemaSql,
731457
731515
  renderKnowledgeMap: () => renderKnowledgeMap,
731458
731516
  readKnowledgeSearchText: () => readKnowledgeSearchText,
731459
- readBrowserKnowledgeProfile: () => readBrowserKnowledgeProfile2,
731517
+ readBrowserKnowledgeProfile: () => readBrowserKnowledgeProfile,
731460
731518
  projectPlanningSourceId: () => projectPlanningSourceId,
731461
731519
  projectPlanningProjectIdFromPath: () => projectPlanningProjectIdFromPath,
731462
731520
  projectPlanningCanonicalUri: () => projectPlanningCanonicalUri,
731463
731521
  projectKnowledgeSpaceId: () => projectKnowledgeSpaceId,
731464
- parseKnowledgeJsonValue: () => parseJsonValue2,
731522
+ parseKnowledgeJsonValue: () => parseJsonValue,
731465
731523
  normalizeProjectId: () => normalizeProjectId,
731466
731524
  normalizeKnowledgeSpaceId: () => normalizeKnowledgeSpaceId,
731467
731525
  normalizeHomeAssistantInstallationId: () => normalizeHomeAssistantInstallationId,
@@ -731469,12 +731527,12 @@ __export(exports_knowledge, {
731469
731527
  materializeGeneratedKnowledgeProjection: () => materializeGeneratedKnowledgeProjection,
731470
731528
  looksLikeRawPdfPayload: () => looksLikeRawPdfPayload,
731471
731529
  looksBinaryLikeText: () => looksBinaryLikeText,
731472
- loadKnowledgeStoreSnapshot: () => loadKnowledgeStoreSnapshot2,
731530
+ loadKnowledgeStoreSnapshot: () => loadKnowledgeStoreSnapshot,
731473
731531
  listGeneratedKnowledgePages: () => listGeneratedKnowledgePages,
731474
- listBrowserKinds: () => listBrowserKinds2,
731532
+ listBrowserKinds: () => listBrowserKinds,
731475
731533
  knowledgeSpaceMetadata: () => knowledgeSpaceMetadata,
731476
731534
  knowledgePageSourceWeight: () => knowledgePageSourceWeight,
731477
- knowledgeNowMs: () => nowMs2,
731535
+ knowledgeNowMs: () => nowMs,
731478
731536
  knowledgeExtractionNeedsRefresh: () => knowledgeExtractionNeedsRefresh,
731479
731537
  isUsefulKnowledgePageSourceCandidate: () => isUsefulKnowledgePageSourceCandidate,
731480
731538
  isUsefulKnowledgePageSource: () => isUsefulKnowledgePageSource,
@@ -731494,12 +731552,12 @@ __export(exports_knowledge, {
731494
731552
  generatedKnowledgeSourceId: () => generatedKnowledgeSourceId,
731495
731553
  generatedKnowledgeCanonicalUri: () => generatedKnowledgeCanonicalUri,
731496
731554
  extractKnowledgeArtifact: () => extractKnowledgeArtifact,
731497
- evaluateProjectPlanningReadiness: () => evaluateProjectPlanningReadiness2,
731498
- discoverBrowserKnowledgeProfiles: () => discoverBrowserKnowledgeProfiles2,
731555
+ evaluateProjectPlanningReadiness: () => evaluateProjectPlanningReadiness,
731556
+ discoverBrowserKnowledgeProfiles: () => discoverBrowserKnowledgeProfiles,
731499
731557
  createWebKnowledgeGapRepairer: () => createWebKnowledgeGapRepairer,
731500
731558
  createProviderBackedKnowledgeSemanticLlm: () => createProviderBackedKnowledgeSemanticLlm,
731501
731559
  createMemoryApi: () => createMemoryApi,
731502
- createKnowledgeSchema: () => createSchema3,
731560
+ createKnowledgeSchema: () => createSchema2,
731503
731561
  createKnowledgeApi: () => createKnowledgeApi,
731504
731562
  createDefaultKnowledgeConnectorRegistry: () => createDefaultKnowledgeConnectorRegistry,
731505
731563
  compareKnowledgePageSources: () => compareKnowledgePageSources,
@@ -733937,7 +733995,7 @@ var init_delivery_manager = __esm(() => {
733937
733995
  });
733938
733996
 
733939
733997
  // node_modules/@pellux/goodvibes-sdk/dist/platform/automation/scheduler-capacity.js
733940
- function computeSchedulerCapacity(slotsTotal, runs, nowMs3 = Date.now()) {
733998
+ function computeSchedulerCapacity(slotsTotal, runs, nowMs2 = Date.now()) {
733941
733999
  let slotsInUse = 0;
733942
734000
  const queuedRuns = [];
733943
734001
  for (const run7 of runs) {
@@ -733947,7 +734005,7 @@ function computeSchedulerCapacity(slotsTotal, runs, nowMs3 = Date.now()) {
733947
734005
  queuedRuns.push(run7);
733948
734006
  }
733949
734007
  const queueDepth = queuedRuns.length;
733950
- const oldestQueuedAgeMs = queueDepth > 0 ? nowMs3 - Math.min(...queuedRuns.map((r5) => r5.queuedAt)) : null;
734008
+ const oldestQueuedAgeMs = queueDepth > 0 ? nowMs2 - Math.min(...queuedRuns.map((r5) => r5.queuedAt)) : null;
733951
734009
  return { slotsTotal, slotsInUse, queueDepth, oldestQueuedAgeMs };
733952
734010
  }
733953
734011
 
@@ -816508,7 +816566,7 @@ var createStyledCell = (char, overrides = {}) => ({
816508
816566
  // src/version.ts
816509
816567
  import { readFileSync } from "fs";
816510
816568
  import { join } from "path";
816511
- var _version = "1.0.17";
816569
+ var _version = "1.0.18";
816512
816570
  var _sdkVersion = "0.33.35";
816513
816571
  try {
816514
816572
  const pkg = JSON.parse(readFileSync(join(import.meta.dir, "..", "package.json"), "utf-8"));
@@ -839370,7 +839428,7 @@ var WORK_PLAN_STATUSES = [
839370
839428
  "failed",
839371
839429
  "cancelled"
839372
839430
  ];
839373
- function nowMs3() {
839431
+ function nowMs2() {
839374
839432
  return Date.now();
839375
839433
  }
839376
839434
  function isObject5(value) {
@@ -839476,7 +839534,7 @@ class WorkPlanStore {
839476
839534
  if (!normalizedTitle)
839477
839535
  throw new Error("Work plan item title is required.");
839478
839536
  const plan = this.readPlan();
839479
- const time4 = nowMs3();
839537
+ const time4 = nowMs2();
839480
839538
  const item = {
839481
839539
  id: createItemId(),
839482
839540
  title: normalizedTitle,
@@ -839500,7 +839558,7 @@ class WorkPlanStore {
839500
839558
  updateItem(idOrPrefix, patch2) {
839501
839559
  const plan = this.readPlan();
839502
839560
  const item = this.resolveItem(plan, idOrPrefix);
839503
- const time4 = nowMs3();
839561
+ const time4 = nowMs2();
839504
839562
  const nextStatus = patch2.status ?? item.status;
839505
839563
  const next = this.pruneItem({
839506
839564
  ...item,
@@ -839533,7 +839591,7 @@ class WorkPlanStore {
839533
839591
  removeItem(idOrPrefix) {
839534
839592
  const plan = this.readPlan();
839535
839593
  const item = this.resolveItem(plan, idOrPrefix);
839536
- const time4 = nowMs3();
839594
+ const time4 = nowMs2();
839537
839595
  const remaining = plan.items.filter((candidate) => candidate.id !== item.id);
839538
839596
  this.writePlan({
839539
839597
  ...plan,
@@ -839553,7 +839611,7 @@ class WorkPlanStore {
839553
839611
  ...plan,
839554
839612
  items: remaining,
839555
839613
  activeItemId: remaining[0]?.id,
839556
- updatedAt: nowMs3()
839614
+ updatedAt: nowMs2()
839557
839615
  });
839558
839616
  return removed;
839559
839617
  }
@@ -839592,7 +839650,7 @@ class WorkPlanStore {
839592
839650
  const parsed = JSON.parse(raw);
839593
839651
  if (!isObject5(parsed))
839594
839652
  return this.createEmptyPlan();
839595
- const time4 = nowMs3();
839653
+ const time4 = nowMs2();
839596
839654
  const createdAt = typeof parsed.createdAt === "number" ? parsed.createdAt : time4;
839597
839655
  const updatedAt = typeof parsed.updatedAt === "number" ? parsed.updatedAt : createdAt;
839598
839656
  const items = Array.isArray(parsed.items) ? parsed.items.map((item) => normalizeItem(item, createdAt)).filter((item) => item !== null) : [];
@@ -839611,7 +839669,7 @@ class WorkPlanStore {
839611
839669
  };
839612
839670
  }
839613
839671
  createEmptyPlan() {
839614
- const time4 = nowMs3();
839672
+ const time4 = nowMs2();
839615
839673
  return {
839616
839674
  id: createPlanId(this.options.projectId, this.options.projectRoot),
839617
839675
  projectId: this.options.projectId,
@@ -880020,10 +880078,6 @@ function requireKeybindingsManager2(context) {
880020
880078
  function isKeyAction2(action2) {
880021
880079
  return Object.hasOwn(ACTION_DESCRIPTIONS, action2);
880022
880080
  }
880023
- function actionFromArgs(args2) {
880024
- const action2 = readString52(args2.actionId || args2.key || args2.query);
880025
- return action2 && isKeyAction2(action2) ? action2 : null;
880026
- }
880027
880081
  function readBoolean15(value) {
880028
880082
  if (typeof value === "boolean")
880029
880083
  return value;
@@ -880112,23 +880166,70 @@ function describeCombo(manager5, combo) {
880112
880166
  label: manager5.formatCombo(combo)
880113
880167
  };
880114
880168
  }
880115
- function bindingMatches(entry, query2) {
880116
- if (!query2)
880117
- return true;
880118
- const haystack = [
880169
+ function keybindingLookupFromArgs(args2) {
880170
+ const actionId = readString52(args2.actionId);
880171
+ if (actionId)
880172
+ return { source: "actionId", input: actionId };
880173
+ const target = readString52(args2.target);
880174
+ if (target)
880175
+ return { source: "target", input: target };
880176
+ const key = readString52(args2.key);
880177
+ if (key)
880178
+ return { source: "key", input: key };
880179
+ const query2 = readString52(args2.query);
880180
+ if (query2)
880181
+ return { source: "query", input: query2 };
880182
+ return null;
880183
+ }
880184
+ function bindingSearchText(manager5, entry) {
880185
+ return [
880119
880186
  entry.action,
880120
880187
  entry.description,
880121
- ...entry.combos.map((combo) => comboFingerprint(combo))
880188
+ ...entry.combos.map((combo) => comboFingerprint(combo)),
880189
+ ...entry.combos.map((combo) => manager5.formatCombo(combo))
880122
880190
  ].join(`
880123
880191
  `).toLowerCase();
880124
- return haystack.includes(query2.toLowerCase());
880125
880192
  }
880126
- function describeBinding(manager5, action2, combos) {
880193
+ function bindingCandidate(manager5, entry) {
880194
+ return {
880195
+ action: entry.action,
880196
+ description: entry.description,
880197
+ labels: entry.combos.map((combo) => manager5.formatCombo(combo))
880198
+ };
880199
+ }
880200
+ function bindingMatches(manager5, entry, query2) {
880201
+ if (!query2)
880202
+ return true;
880203
+ return bindingSearchText(manager5, entry).includes(query2.toLowerCase());
880204
+ }
880205
+ function resolveHarnessKeybinding(context, args2) {
880206
+ const manager5 = requireKeybindingsManager2(context);
880207
+ const lookup = keybindingLookupFromArgs(args2);
880208
+ if (!lookup)
880209
+ return null;
880210
+ const entries = manager5.getAll();
880211
+ if (isKeyAction2(lookup.input))
880212
+ return { status: "found", action: lookup.input, lookup: { ...lookup, resolvedBy: "action" } };
880213
+ const inputLower = lookup.input.toLowerCase();
880214
+ const ciActions = entries.filter((entry) => entry.action.toLowerCase() === inputLower);
880215
+ if (ciActions.length === 1)
880216
+ return { status: "found", action: ciActions[0].action, lookup: { ...lookup, resolvedBy: "case-insensitive-action" } };
880217
+ if (ciActions.length > 1)
880218
+ return { status: "ambiguous", input: lookup.input, candidates: ciActions.map((entry) => bindingCandidate(manager5, entry)).slice(0, 8) };
880219
+ const matches = entries.filter((entry) => bindingMatches(manager5, entry, lookup.input));
880220
+ if (matches.length === 1)
880221
+ return { status: "found", action: matches[0].action, lookup: { ...lookup, resolvedBy: "search" } };
880222
+ if (matches.length > 1)
880223
+ return { status: "ambiguous", input: lookup.input, candidates: matches.map((entry) => bindingCandidate(manager5, entry)).slice(0, 8) };
880224
+ return null;
880225
+ }
880226
+ function describeBinding(manager5, action2, combos, lookup) {
880127
880227
  const defaults3 = DEFAULT_KEYBINDINGS[action2];
880128
880228
  const customized = !combosEqual(combos, defaults3);
880129
880229
  return {
880130
880230
  action: action2,
880131
880231
  description: ACTION_DESCRIPTIONS[action2],
880232
+ ...lookup ? { lookup } : {},
880132
880233
  bindings: combos.map((combo) => describeCombo(manager5, combo)),
880133
880234
  labels: combos.map((combo) => manager5.formatCombo(combo)),
880134
880235
  defaultBindings: defaults3.map((combo) => describeCombo(manager5, combo)),
@@ -880173,7 +880274,7 @@ ${shortcut.description}`.toLowerCase().includes(query2)).slice(0, readLimit7(arg
880173
880274
  function listHarnessKeybindings(context, args2) {
880174
880275
  const manager5 = requireKeybindingsManager2(context);
880175
880276
  const query2 = readString52(args2.query);
880176
- const entries = manager5.getAll().filter((entry) => bindingMatches(entry, query2)).slice(0, readLimit7(args2.limit, 200)).map((entry) => describeBinding(manager5, entry.action, entry.combos));
880277
+ const entries = manager5.getAll().filter((entry) => bindingMatches(manager5, entry, query2)).slice(0, readLimit7(args2.limit, 200)).map((entry) => describeBinding(manager5, entry.action, entry.combos));
880177
880278
  return {
880178
880279
  configPath: manager5.getConfigPath(),
880179
880280
  keybindings: entries,
@@ -880184,46 +880285,54 @@ function listHarnessKeybindings(context, args2) {
880184
880285
  }
880185
880286
  function describeHarnessKeybinding(context, args2) {
880186
880287
  const manager5 = requireKeybindingsManager2(context);
880187
- const action2 = actionFromArgs(args2);
880188
- if (!action2)
880288
+ const resolved = resolveHarnessKeybinding(context, args2);
880289
+ if (resolved?.status === "ambiguous")
880290
+ return { status: "ambiguous", input: resolved.input, candidates: resolved.candidates };
880291
+ if (!resolved)
880189
880292
  return null;
880190
- const entry = manager5.getAll().find((candidate) => candidate.action === action2);
880293
+ const entry = manager5.getAll().find((candidate) => candidate.action === resolved.action);
880191
880294
  return entry ? {
880192
880295
  configPath: manager5.getConfigPath(),
880193
- ...describeBinding(manager5, entry.action, entry.combos)
880296
+ ...describeBinding(manager5, entry.action, entry.combos, resolved.lookup)
880194
880297
  } : null;
880195
880298
  }
880196
880299
  function setHarnessKeybinding(context, args2) {
880197
880300
  const manager5 = requireKeybindingsManager2(context);
880198
- const action2 = actionFromArgs(args2);
880199
- if (!action2)
880200
- throw new Error("set_keybinding requires a valid keybinding action id.");
880301
+ const resolved = resolveHarnessKeybinding(context, args2);
880302
+ if (resolved?.status === "ambiguous")
880303
+ throw new Error(`Ambiguous keybinding action ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
880304
+ if (!resolved)
880305
+ throw new Error("set_keybinding requires a valid keybinding action id, target, or query.");
880201
880306
  const combos = combosFromArgs(args2);
880202
880307
  const configPath = manager5.getConfigPath();
880203
880308
  const overrides = readOverrideFile(configPath);
880204
- overrides[action2] = combos.length === 1 ? combos[0] : combos;
880309
+ overrides[resolved.action] = combos.length === 1 ? combos[0] : combos;
880205
880310
  writeOverrideFile(configPath, overrides);
880206
880311
  manager5.loadFromDisk();
880207
880312
  return {
880208
880313
  status: "updated",
880209
880314
  configPath,
880210
- keybinding: describeHarnessKeybinding(context, { actionId: action2 })
880315
+ keybinding: describeHarnessKeybinding(context, { actionId: resolved.action }),
880316
+ lookup: resolved.lookup
880211
880317
  };
880212
880318
  }
880213
880319
  function resetHarnessKeybinding(context, args2) {
880214
880320
  const manager5 = requireKeybindingsManager2(context);
880215
- const action2 = actionFromArgs(args2);
880216
- if (!action2)
880217
- throw new Error("reset_keybinding requires a valid keybinding action id.");
880321
+ const resolved = resolveHarnessKeybinding(context, args2);
880322
+ if (resolved?.status === "ambiguous")
880323
+ throw new Error(`Ambiguous keybinding action ${resolved.input}. Candidates: ${JSON.stringify(resolved.candidates)}`);
880324
+ if (!resolved)
880325
+ throw new Error("reset_keybinding requires a valid keybinding action id, target, or query.");
880218
880326
  const configPath = manager5.getConfigPath();
880219
880327
  const overrides = readOverrideFile(configPath);
880220
- delete overrides[action2];
880328
+ delete overrides[resolved.action];
880221
880329
  writeOverrideFile(configPath, overrides);
880222
880330
  manager5.loadFromDisk();
880223
880331
  return {
880224
880332
  status: "reset",
880225
880333
  configPath,
880226
- keybinding: describeHarnessKeybinding(context, { actionId: action2 })
880334
+ keybinding: describeHarnessKeybinding(context, { actionId: resolved.action }),
880335
+ lookup: resolved.lookup
880227
880336
  };
880228
880337
  }
880229
880338
 
@@ -880249,10 +880358,69 @@ function panelMatches(panel, query2) {
880249
880358
  panel.category,
880250
880359
  panel.description,
880251
880360
  panel.workspaceRoute
880252
- ].map((value) => String(value ?? "")).join(`
880361
+ ].map((value) => typeof value === "object" ? JSON.stringify(value) : String(value ?? "")).join(`
880253
880362
  `).toLowerCase().includes(query2.toLowerCase());
880254
880363
  }
880255
- function describePanelRegistration(context, registration) {
880364
+ function panelLookupFromArgs(args2) {
880365
+ const panelId = readString53(args2.panelId);
880366
+ if (panelId)
880367
+ return { source: "panelId", input: panelId };
880368
+ const target = readString53(args2.target);
880369
+ if (target)
880370
+ return { source: "target", input: target };
880371
+ const query2 = readString53(args2.query);
880372
+ if (query2)
880373
+ return { source: "query", input: query2 };
880374
+ return null;
880375
+ }
880376
+ function panelCandidate(registration) {
880377
+ return {
880378
+ id: registration.id,
880379
+ name: registration.name,
880380
+ category: registration.category,
880381
+ description: registration.description,
880382
+ workspaceRoute: {
880383
+ categoryId: agentWorkspaceCategoryForPanel(registration.id),
880384
+ command: agentWorkspaceCommandForPanel(registration.id)
880385
+ }
880386
+ };
880387
+ }
880388
+ function resolveHarnessPanel(context, args2) {
880389
+ const manager5 = panelManager(context);
880390
+ const lookup = panelLookupFromArgs(args2);
880391
+ if (!manager5 || !lookup)
880392
+ return null;
880393
+ const registrations = manager5.getRegisteredTypes();
880394
+ const exactId = registrations.find((panel) => panel.id === lookup.input);
880395
+ if (exactId)
880396
+ return { status: "found", registration: exactId, lookup: { ...lookup, resolvedBy: "id" } };
880397
+ const inputLower = lookup.input.toLowerCase();
880398
+ const exactName = registrations.find((panel) => panel.name === lookup.input);
880399
+ if (exactName)
880400
+ return { status: "found", registration: exactName, lookup: { ...lookup, resolvedBy: "name" } };
880401
+ const ciId = registrations.filter((panel) => panel.id.toLowerCase() === inputLower);
880402
+ if (ciId.length === 1)
880403
+ return { status: "found", registration: ciId[0], lookup: { ...lookup, resolvedBy: "case-insensitive-id" } };
880404
+ if (ciId.length > 1)
880405
+ return { status: "ambiguous", input: lookup.input, candidates: ciId.map(panelCandidate).slice(0, 8) };
880406
+ const ciName = registrations.filter((panel) => panel.name.toLowerCase() === inputLower);
880407
+ if (ciName.length === 1)
880408
+ return { status: "found", registration: ciName[0], lookup: { ...lookup, resolvedBy: "case-insensitive-name" } };
880409
+ if (ciName.length > 1)
880410
+ return { status: "ambiguous", input: lookup.input, candidates: ciName.map(panelCandidate).slice(0, 8) };
880411
+ const category = readString53(args2.category);
880412
+ const search2 = registrations.filter((registration) => {
880413
+ if (category && registration.category !== category)
880414
+ return false;
880415
+ return panelMatches(panelCandidate(registration), lookup.input);
880416
+ });
880417
+ if (search2.length === 1)
880418
+ return { status: "found", registration: search2[0], lookup: { ...lookup, resolvedBy: "search" } };
880419
+ if (search2.length > 1)
880420
+ return { status: "ambiguous", input: lookup.input, candidates: search2.map(panelCandidate).slice(0, 8) };
880421
+ return null;
880422
+ }
880423
+ function describePanelRegistration(context, registration, lookup) {
880256
880424
  const manager5 = panelManager(context);
880257
880425
  const openPanel = manager5?.getPanel(registration.id) ?? null;
880258
880426
  const pane = manager5?.getPaneOf(registration.id) ?? null;
@@ -880263,6 +880431,7 @@ function describePanelRegistration(context, registration) {
880263
880431
  icon: registration.icon,
880264
880432
  category: registration.category,
880265
880433
  description: registration.description,
880434
+ ...lookup ? { lookup } : {},
880266
880435
  preload: registration.preload === true,
880267
880436
  open: openPanel !== null,
880268
880437
  pane,
@@ -880292,24 +880461,27 @@ function listHarnessPanels(context, args2) {
880292
880461
  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);
880293
880462
  }
880294
880463
  function describeHarnessPanel(context, args2) {
880295
- const manager5 = panelManager(context);
880296
- if (!manager5)
880297
- return null;
880298
- const panelId = readString53(args2.panelId || args2.query);
880299
- if (!panelId)
880300
- return null;
880301
- const registration = manager5.getRegisteredTypes().find((panel) => panel.id === panelId || panel.name.toLowerCase() === panelId.toLowerCase());
880302
- return registration ? describePanelRegistration(context, registration) : null;
880464
+ const resolved = resolveHarnessPanel(context, args2);
880465
+ if (resolved?.status === "found")
880466
+ return describePanelRegistration(context, resolved.registration, resolved.lookup);
880467
+ if (resolved?.status === "ambiguous") {
880468
+ return { status: "ambiguous", input: resolved.input, candidates: resolved.candidates };
880469
+ }
880470
+ return null;
880303
880471
  }
880304
880472
  function openHarnessPanel(context, args2) {
880305
- const panel = describeHarnessPanel(context, args2);
880306
- if (!panel) {
880473
+ const resolved = resolveHarnessPanel(context, args2);
880474
+ if (resolved?.status === "ambiguous") {
880475
+ return { status: "ambiguous_panel", input: resolved.input, candidates: resolved.candidates };
880476
+ }
880477
+ if (!resolved) {
880307
880478
  return {
880308
880479
  status: "unknown_panel",
880309
- panelId: readString53(args2.panelId || args2.query) || "<missing>",
880480
+ panelId: readString53(args2.panelId || args2.target || args2.query) || "<missing>",
880310
880481
  availablePanels: listHarnessPanels(context, { limit: 50 }).map((entry) => entry.id)
880311
880482
  };
880312
880483
  }
880484
+ const panel = describePanelRegistration(context, resolved.registration, resolved.lookup);
880313
880485
  const requestedPane = readString53(args2.pane);
880314
880486
  const pane = requestedPane === "bottom" || requestedPane === "top" ? requestedPane : undefined;
880315
880487
  if (!context.showPanel) {
@@ -880927,7 +881099,7 @@ var AGENT_HARNESS_PARAMETER_PROPERTIES = {
880927
881099
  },
880928
881100
  query: {
880929
881101
  type: "string",
880930
- description: "Search text for command, workspace action, setting, tool, or UI surface catalogs; also a slash-command lookup for mode command or setting lookup for get_setting/set_setting/reset_setting."
881102
+ description: "Search text for command, panel, UI surface, keybinding, workspace action, setting, or tool catalogs; also slash-command, setting, panel, UI surface, or keybinding lookup for single-item modes."
880931
881103
  },
880932
881104
  command: {
880933
881105
  type: "string",
@@ -880952,15 +881124,15 @@ var AGENT_HARNESS_PARAMETER_PROPERTIES = {
880952
881124
  },
880953
881125
  surfaceId: {
880954
881126
  type: "string",
880955
- description: "UI surface id for ui_surface or open_ui_surface modes."
881127
+ description: "UI surface id for ui_surface or open_ui_surface modes. target or query can also look up one UI surface when the exact id is not known."
880956
881128
  },
880957
881129
  panelId: {
880958
881130
  type: "string",
880959
- description: "Built-in panel id for panel or open_panel modes."
881131
+ description: "Built-in panel id for panel or open_panel modes. target or query can also look up one panel when the exact id is not known."
880960
881132
  },
880961
881133
  actionId: {
880962
881134
  type: "string",
880963
- description: "Agent workspace action id for workspace_action or run_workspace_action, or keybinding action id for keybinding/set_keybinding/reset_keybinding."
881135
+ description: "Agent workspace action id for workspace_action or run_workspace_action, or keybinding action id for keybinding/set_keybinding/reset_keybinding. target or query can also look up one keybinding action."
880964
881136
  },
880965
881137
  fields: {
880966
881138
  type: "object",
@@ -880994,7 +881166,7 @@ var AGENT_HARNESS_PARAMETER_PROPERTIES = {
880994
881166
  },
880995
881167
  target: {
880996
881168
  type: "string",
880997
- description: "Optional lookup target, such as a model-picker target, workspace action id/search text, slash command root or invocation, setting key/search text, model tool name, or connected-host capability id."
881169
+ description: "Optional lookup target, such as a model-picker target, panel id/search text, UI surface id/search text, workspace action id/search text, slash command root or invocation, setting key/search text, keybinding action/search text, model tool name, or connected-host capability id."
880998
881170
  },
880999
881171
  capabilityId: {
881000
881172
  type: "string",
@@ -881744,13 +881916,64 @@ function surfaceMatches(surface, query2) {
881744
881916
  ].map((value) => String(value ?? "")).join(`
881745
881917
  `).toLowerCase().includes(query2.toLowerCase());
881746
881918
  }
881747
- function describeSurface(context, surface) {
881919
+ function surfaceLookupFromArgs(args2) {
881920
+ const surfaceId = readString57(args2.surfaceId);
881921
+ if (surfaceId)
881922
+ return { source: "surfaceId", input: surfaceId };
881923
+ const query2 = readString57(args2.query);
881924
+ if (query2)
881925
+ return { source: "query", input: query2 };
881926
+ const target = readString57(args2.target);
881927
+ if (target)
881928
+ return { source: "target", input: target };
881929
+ return null;
881930
+ }
881931
+ function surfaceCandidate(surface) {
881932
+ return {
881933
+ id: surface.id,
881934
+ label: surface.label,
881935
+ kind: surface.kind,
881936
+ summary: surface.summary,
881937
+ command: surface.command,
881938
+ preferredModelRoute: surface.preferredModelRoute
881939
+ };
881940
+ }
881941
+ function resolveHarnessUiSurface(args2) {
881942
+ const lookup = surfaceLookupFromArgs(args2);
881943
+ if (!lookup)
881944
+ return null;
881945
+ const exactId = UI_SURFACES.find((surface) => surface.id === lookup.input);
881946
+ if (exactId)
881947
+ return { status: "found", surface: exactId, lookup: { ...lookup, resolvedBy: "id" } };
881948
+ const exactLabel = UI_SURFACES.find((surface) => surface.label === lookup.input);
881949
+ if (exactLabel)
881950
+ return { status: "found", surface: exactLabel, lookup: { ...lookup, resolvedBy: "label" } };
881951
+ const inputLower = lookup.input.toLowerCase();
881952
+ const ciId = UI_SURFACES.filter((surface) => surface.id.toLowerCase() === inputLower);
881953
+ if (ciId.length === 1)
881954
+ return { status: "found", surface: ciId[0], lookup: { ...lookup, resolvedBy: "case-insensitive-id" } };
881955
+ if (ciId.length > 1)
881956
+ return { status: "ambiguous", input: lookup.input, candidates: ciId.map(surfaceCandidate).slice(0, 8) };
881957
+ const ciLabel = UI_SURFACES.filter((surface) => surface.label.toLowerCase() === inputLower);
881958
+ if (ciLabel.length === 1)
881959
+ return { status: "found", surface: ciLabel[0], lookup: { ...lookup, resolvedBy: "case-insensitive-label" } };
881960
+ if (ciLabel.length > 1)
881961
+ return { status: "ambiguous", input: lookup.input, candidates: ciLabel.map(surfaceCandidate).slice(0, 8) };
881962
+ const search2 = UI_SURFACES.filter((surface) => surfaceMatches(surfaceCandidate(surface), lookup.input));
881963
+ if (search2.length === 1)
881964
+ return { status: "found", surface: search2[0], lookup: { ...lookup, resolvedBy: "search" } };
881965
+ if (search2.length > 1)
881966
+ return { status: "ambiguous", input: lookup.input, candidates: search2.map(surfaceCandidate).slice(0, 8) };
881967
+ return null;
881968
+ }
881969
+ function describeSurface(context, surface, lookup) {
881748
881970
  return {
881749
881971
  id: surface.id,
881750
881972
  label: surface.label,
881751
881973
  kind: surface.kind,
881752
881974
  summary: surface.summary,
881753
881975
  command: surface.command,
881976
+ ...lookup ? { lookup } : {},
881754
881977
  preferredModelRoute: surface.preferredModelRoute,
881755
881978
  parameters: surface.parameters ?? [],
881756
881979
  available: surface.available(context),
@@ -881770,26 +881993,30 @@ function listHarnessUiSurfaces(context, args2) {
881770
881993
  return UI_SURFACES.map((surface) => describeSurface(context, surface)).filter((surface) => surfaceMatches(surface, query2)).slice(0, limit3);
881771
881994
  }
881772
881995
  function describeHarnessUiSurface(context, args2) {
881773
- const surfaceId = readString57(args2.surfaceId || args2.query);
881774
- if (!surfaceId)
881775
- return null;
881776
- const surface = UI_SURFACES.find((entry) => entry.id === surfaceId || entry.label.toLowerCase() === surfaceId.toLowerCase());
881777
- return surface ? describeSurface(context, surface) : null;
881996
+ const resolved = resolveHarnessUiSurface(args2);
881997
+ if (resolved?.status === "found")
881998
+ return describeSurface(context, resolved.surface, resolved.lookup);
881999
+ if (resolved?.status === "ambiguous") {
882000
+ return { status: "ambiguous", input: resolved.input, candidates: resolved.candidates };
882001
+ }
882002
+ return null;
881778
882003
  }
881779
882004
  async function openHarnessUiSurface(context, args2) {
881780
- const surfaceId = readString57(args2.surfaceId || args2.query);
881781
- const surface = UI_SURFACES.find((entry) => entry.id === surfaceId || entry.label.toLowerCase() === surfaceId.toLowerCase());
881782
- if (!surface) {
882005
+ const resolved = resolveHarnessUiSurface(args2);
882006
+ if (resolved?.status === "ambiguous") {
882007
+ return { status: "ambiguous_ui_surface", input: resolved.input, candidates: resolved.candidates };
882008
+ }
882009
+ if (!resolved) {
881783
882010
  return {
881784
882011
  status: "unknown_ui_surface",
881785
- surfaceId: surfaceId || "<missing>",
882012
+ surfaceId: readString57(args2.surfaceId || args2.query || args2.target) || "<missing>",
881786
882013
  availableSurfaces: UI_SURFACES.map((entry) => entry.id)
881787
882014
  };
881788
882015
  }
881789
- const routed = await surface.open(context, args2);
882016
+ const routed = await resolved.surface.open(context, args2);
881790
882017
  return {
881791
882018
  ...routed,
881792
- descriptor: describeSurface(context, surface)
882019
+ descriptor: describeSurface(context, resolved.surface, resolved.lookup)
881793
882020
  };
881794
882021
  }
881795
882022
 
@@ -882249,9 +882476,9 @@ function createAgentHarnessTool(deps) {
882249
882476
  tools: deps.toolRegistry.getToolDefinitions().length,
882250
882477
  modelAccess: {
882251
882478
  cliCommands: 'Use mode:"cli_commands" and mode:"cli_command" to inspect package CLI mirrors and their preferred in-process model routes. CLI modes are discovery-only.',
882252
- 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.',
882253
- 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.',
882254
- 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.',
882479
+ panels: 'Use mode:"panels" to list and mode:"panel" with panelId, target, or query to inspect built-in panel catalog/open state; use mode:"open_panel" with confirm:true plus explicitUserRequest to route a visible panel/workspace change.',
882480
+ uiSurfaces: 'Use mode:"ui_surfaces" to list and mode:"ui_surface" with surfaceId, target, or query to inspect modal/overlay/picker/workspace surfaces; use mode:"open_ui_surface" with confirm:true plus explicitUserRequest to route visible UI navigation.',
882481
+ shortcuts: 'Use mode:"shortcuts" to inspect fixed shortcuts plus configurable keybindings. Use mode:"keybinding" with actionId, target, key, or query; use mode:"set_keybinding" and mode:"reset_keybinding" with confirm:true plus explicitUserRequest to edit the same config file the user edits.',
882255
882482
  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.',
882256
882483
  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.',
882257
882484
  settings: 'Use mode:"settings" to list and mode:"get_setting" with key, target, or query for one setting. Use mode:"set_setting" or mode:"reset_setting" with key, target, or query plus confirm:true and explicitUserRequest.',
@@ -882287,7 +882514,7 @@ function createAgentHarnessTool(deps) {
882287
882514
  }
882288
882515
  if (args2.mode === "panel") {
882289
882516
  const panel = describeHarnessPanel(deps.commandContext, args2);
882290
- return panel ? output7(panel) : error52(`Unknown panel ${readString58(args2.panelId || args2.query) || "<missing>"}.`);
882517
+ return panel ? output7(panel) : error52(`Unknown panel ${readString58(args2.panelId || args2.target || args2.query) || "<missing>"}.`);
882291
882518
  }
882292
882519
  if (args2.mode === "open_panel") {
882293
882520
  const confirmationError2 = requireConfirmedAction(args2, "Panel routing");
@@ -882301,7 +882528,7 @@ function createAgentHarnessTool(deps) {
882301
882528
  }
882302
882529
  if (args2.mode === "ui_surface") {
882303
882530
  const surface = describeHarnessUiSurface(deps.commandContext, args2);
882304
- return surface ? output7(surface) : error52(`Unknown UI surface ${readString58(args2.surfaceId || args2.query) || "<missing>"}.`);
882531
+ return surface ? output7(surface) : error52(`Unknown UI surface ${readString58(args2.surfaceId || args2.query || args2.target) || "<missing>"}.`);
882305
882532
  }
882306
882533
  if (args2.mode === "open_ui_surface") {
882307
882534
  const confirmationError2 = requireConfirmedAction(args2, "UI surface routing");
@@ -882315,7 +882542,7 @@ function createAgentHarnessTool(deps) {
882315
882542
  return output7(listHarnessKeybindings(deps.commandContext, args2));
882316
882543
  if (args2.mode === "keybinding") {
882317
882544
  const binding = describeHarnessKeybinding(deps.commandContext, args2);
882318
- return binding ? output7(binding) : error52(`Unknown keybinding action ${readString58(args2.actionId || args2.key || args2.query) || "<missing>"}.`);
882545
+ return binding ? output7(binding) : error52(`Unknown keybinding action ${readString58(args2.actionId || args2.target || args2.key || args2.query) || "<missing>"}.`);
882319
882546
  }
882320
882547
  if (args2.mode === "set_keybinding") {
882321
882548
  const confirmationError2 = requireConfirmedAction(args2, "Keybinding mutation");