@pellux/goodvibes-agent 1.0.4 → 1.0.5

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.
@@ -816566,7 +816566,7 @@ var createStyledCell = (char, overrides = {}) => ({
816566
816566
  // src/version.ts
816567
816567
  import { readFileSync } from "fs";
816568
816568
  import { join } from "path";
816569
- var _version = "1.0.4";
816569
+ var _version = "1.0.5";
816570
816570
  var _sdkVersion = "0.33.35";
816571
816571
  try {
816572
816572
  const pkg = JSON.parse(readFileSync(join(import.meta.dir, "..", "package.json"), "utf-8"));
@@ -847775,13 +847775,13 @@ init_state3();
847775
847775
 
847776
847776
  // src/input/commands/recall-shared.ts
847777
847777
  var VALID_CLASSES = ["decision", "constraint", "incident", "pattern", "fact", "risk", "runbook", "architecture", "ownership"];
847778
- var VALID_SCOPES = ["session", "project", "team"];
847778
+ var VALID_SCOPES2 = ["session", "project", "team"];
847779
847779
  var VALID_REVIEW_STATES = ["fresh", "reviewed", "stale", "contradicted"];
847780
847780
  function isValidClass(s4) {
847781
847781
  return VALID_CLASSES.includes(s4);
847782
847782
  }
847783
847783
  function isValidScope(s4) {
847784
- return VALID_SCOPES.includes(s4);
847784
+ return VALID_SCOPES2.includes(s4);
847785
847785
  }
847786
847786
  function isValidReviewState(s4) {
847787
847787
  return VALID_REVIEW_STATES.includes(s4);
@@ -847824,7 +847824,7 @@ function handleRecallSearch(args2, context) {
847824
847824
  if (isValidScope(scope))
847825
847825
  filter.scope = scope;
847826
847826
  else {
847827
- context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES.join(", ")}.`);
847827
+ context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES2.join(", ")}.`);
847828
847828
  return;
847829
847829
  }
847830
847830
  }
@@ -847999,7 +847999,7 @@ function handleRecallList(args2, context) {
847999
847999
  if (scopeIdx !== -1 && args2[scopeIdx + 1]) {
848000
848000
  const scope = args2[scopeIdx + 1];
848001
848001
  if (!isValidScope(scope)) {
848002
- context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES.join(", ")}.`);
848002
+ context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES2.join(", ")}.`);
848003
848003
  return;
848004
848004
  }
848005
848005
  filter.scope = scope;
@@ -848049,7 +848049,7 @@ async function handleRecallAdd(args2, context) {
848049
848049
  const tags = tagsRaw ? tagsRaw.split(",").map((token) => token.trim()).filter(Boolean) : [];
848050
848050
  const scope = scopeRaw && isValidScope(scopeRaw) ? scopeRaw : "project";
848051
848051
  if (scopeRaw && !isValidScope(scopeRaw)) {
848052
- context.print(`[memory] Invalid scope "${scopeRaw}". Valid values ${VALID_SCOPES.join(", ")}.`);
848052
+ context.print(`[memory] Invalid scope "${scopeRaw}". Valid values ${VALID_SCOPES2.join(", ")}.`);
848053
848053
  return;
848054
848054
  }
848055
848055
  const provenance = [];
@@ -848183,7 +848183,7 @@ function handleRecallExport(args2, context) {
848183
848183
  if (scopeIdx !== -1 && commandArgs[scopeIdx + 1]) {
848184
848184
  const scope = commandArgs[scopeIdx + 1];
848185
848185
  if (!isValidScope(scope)) {
848186
- context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES.join(", ")}.`);
848186
+ context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES2.join(", ")}.`);
848187
848187
  return;
848188
848188
  }
848189
848189
  filter.scope = scope;
@@ -848262,7 +848262,7 @@ function handleRecallHandoffExport(args2, context) {
848262
848262
  const scopeIdx = commandArgs.indexOf("--scope");
848263
848263
  const scopeRaw = scopeIdx !== -1 ? commandArgs[scopeIdx + 1] : "team";
848264
848264
  if (!scopeRaw || !isValidScope(scopeRaw)) {
848265
- context.print(`[memory] Unknown scope "${scopeRaw ?? ""}". Valid values ${VALID_SCOPES.join(", ")}.`);
848265
+ context.print(`[memory] Unknown scope "${scopeRaw ?? ""}". Valid values ${VALID_SCOPES2.join(", ")}.`);
848266
848266
  return;
848267
848267
  }
848268
848268
  const bundle = memory.exportBundle({ scope: scopeRaw });
@@ -848378,7 +848378,7 @@ function handleRecallPromote(args2, context) {
848378
848378
  const id = parsed.rest[0];
848379
848379
  const scope = parsed.rest[1];
848380
848380
  if (!id || !scope || !isValidScope(scope)) {
848381
- context.print(`[memory] Usage: /memory promote <id> <${VALID_SCOPES.join("|")}> --yes`);
848381
+ context.print(`[memory] Usage: /memory promote <id> <${VALID_SCOPES2.join("|")}> --yes`);
848382
848382
  return;
848383
848383
  }
848384
848384
  if (!parsed.yes) {
@@ -862154,7 +862154,7 @@ import { mkdirSync as mkdirSync64, readFileSync as readFileSync86, writeFileSync
862154
862154
  import { dirname as dirname63, resolve as resolve39 } from "path";
862155
862155
  init_state3();
862156
862156
  var VALID_CLASSES2 = ["decision", "constraint", "incident", "pattern", "fact", "risk", "runbook", "architecture", "ownership"];
862157
- var VALID_SCOPES3 = ["session", "project", "team"];
862157
+ var VALID_SCOPES4 = ["session", "project", "team"];
862158
862158
  var VALID_REVIEW_STATES3 = ["fresh", "reviewed", "stale", "contradicted"];
862159
862159
  var VALID_PROVENANCE_KINDS = ["session", "turn", "task", "event", "file"];
862160
862160
  var VALUE_OPTIONS = new Set([
@@ -862254,7 +862254,7 @@ function isMemoryClass2(value) {
862254
862254
  return VALID_CLASSES2.includes(value);
862255
862255
  }
862256
862256
  function isMemoryScope2(value) {
862257
- return VALID_SCOPES3.includes(value);
862257
+ return VALID_SCOPES4.includes(value);
862258
862258
  }
862259
862259
  function isReviewState(value) {
862260
862260
  return VALID_REVIEW_STATES3.includes(value);
@@ -862269,7 +862269,7 @@ function requireClass(value) {
862269
862269
  }
862270
862270
  function requireScope(value) {
862271
862271
  if (!value || !isMemoryScope2(value))
862272
- throw new Error(`Invalid memory scope "${value ?? ""}". Valid values ${VALID_SCOPES3.join(", ")}`);
862272
+ throw new Error(`Invalid memory scope "${value ?? ""}". Valid values ${VALID_SCOPES4.join(", ")}`);
862273
862273
  return value;
862274
862274
  }
862275
862275
  function optionalScope(value) {
@@ -880306,14 +880306,17 @@ function listHarnessModelTools(toolRegistry, args2) {
880306
880306
  }));
880307
880307
  }
880308
880308
 
880309
- // src/tools/agent-harness-tool.ts
880310
- var MODES = [
880309
+ // src/tools/agent-harness-tool-schema.ts
880310
+ var AGENT_HARNESS_MODES = [
880311
880311
  "summary",
880312
880312
  "cli_commands",
880313
880313
  "cli_command",
880314
880314
  "panels",
880315
880315
  "panel",
880316
880316
  "open_panel",
880317
+ "ui_surfaces",
880318
+ "ui_surface",
880319
+ "open_ui_surface",
880317
880320
  "shortcuts",
880318
880321
  "keybindings",
880319
880322
  "keybinding",
@@ -880334,9 +880337,125 @@ var MODES = [
880334
880337
  "tools",
880335
880338
  "connected_host"
880336
880339
  ];
880337
- function isMode(value) {
880338
- return typeof value === "string" && MODES.includes(value);
880339
- }
880340
+ var KEY_COMBO_PARAMETER_SCHEMA = {
880341
+ type: "object",
880342
+ properties: { key: { type: "string" }, ctrl: { type: "boolean" }, shift: { type: "boolean" }, alt: { type: "boolean" } },
880343
+ required: ["key"],
880344
+ additionalProperties: false
880345
+ };
880346
+ var AGENT_HARNESS_PARAMETER_PROPERTIES = {
880347
+ mode: {
880348
+ type: "string",
880349
+ enum: AGENT_HARNESS_MODES,
880350
+ description: "Harness operation to perform."
880351
+ },
880352
+ query: {
880353
+ type: "string",
880354
+ description: "Search text for command, setting, tool, or UI surface catalogs."
880355
+ },
880356
+ command: {
880357
+ type: "string",
880358
+ 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".'
880359
+ },
880360
+ cliCommand: {
880361
+ type: "string",
880362
+ description: 'Top-level CLI command string for mode cli_command, for example "goodvibes-agent status --json" or "profiles list". This mode is read-only metadata/parse inspection.'
880363
+ },
880364
+ commandName: {
880365
+ type: "string",
880366
+ description: "Slash command root without the leading slash for mode command or run_command, or a top-level CLI command token for cli_command."
880367
+ },
880368
+ args: {
880369
+ type: "array",
880370
+ items: { type: "string" },
880371
+ description: "Slash command argument tokens for mode run_command when commandName is used."
880372
+ },
880373
+ categoryId: {
880374
+ type: "string",
880375
+ description: "Agent workspace category id for workspace action filtering or ui surface routing."
880376
+ },
880377
+ surfaceId: {
880378
+ type: "string",
880379
+ description: "UI surface id for ui_surface or open_ui_surface modes."
880380
+ },
880381
+ panelId: {
880382
+ type: "string",
880383
+ description: "Built-in panel id for panel or open_panel modes."
880384
+ },
880385
+ actionId: {
880386
+ type: "string",
880387
+ description: "Agent workspace action id for workspace_action or run_workspace_action, or keybinding action id for keybinding/set_keybinding/reset_keybinding."
880388
+ },
880389
+ fields: {
880390
+ type: "object",
880391
+ additionalProperties: { type: "string" },
880392
+ description: "Field values for run_workspace_action when the workspace action opens an editor form."
880393
+ },
880394
+ combo: {
880395
+ ...KEY_COMBO_PARAMETER_SCHEMA,
880396
+ description: 'Single key combo for set_keybinding, for example { "key": "g", "ctrl": true }.'
880397
+ },
880398
+ combos: {
880399
+ type: "array",
880400
+ items: KEY_COMBO_PARAMETER_SCHEMA,
880401
+ description: "Multiple key combos for set_keybinding."
880402
+ },
880403
+ recordId: {
880404
+ type: "string",
880405
+ description: "Selected Agent-local record id for selection-based local workspace operations."
880406
+ },
880407
+ key: {
880408
+ type: "string",
880409
+ description: "Agent setting key for get_setting, set_setting, or reset_setting."
880410
+ },
880411
+ value: {
880412
+ anyOf: [
880413
+ { type: "string" },
880414
+ { type: "number" },
880415
+ { type: "boolean" }
880416
+ ],
880417
+ description: "Setting value for set_setting. Strings, booleans, numbers, and enum strings are accepted."
880418
+ },
880419
+ target: {
880420
+ type: "string",
880421
+ description: "Optional UI target, such as a model-picker target or settings target key."
880422
+ },
880423
+ category: {
880424
+ type: "string",
880425
+ description: "Setting category filter such as provider, behavior, tools, ui, tts, permissions, automation, or surfaces."
880426
+ },
880427
+ prefix: {
880428
+ type: "string",
880429
+ description: "Setting key prefix filter such as surfaces.slack."
880430
+ },
880431
+ includeHidden: {
880432
+ type: "boolean",
880433
+ description: "Include settings hidden from the Agent workspace because they are host-owned or non-Agent lifecycle settings."
880434
+ },
880435
+ includeParameters: {
880436
+ type: "boolean",
880437
+ description: "Include model tool JSON schemas in tools mode, or workspace editor field schemas in workspace_actions mode."
880438
+ },
880439
+ limit: {
880440
+ type: "number",
880441
+ description: "Maximum catalog entries to return."
880442
+ },
880443
+ pane: {
880444
+ type: "string",
880445
+ enum: ["top", "bottom"],
880446
+ description: "Preferred panel pane for open_panel when the current shell supports panel routing."
880447
+ },
880448
+ confirm: {
880449
+ type: "boolean",
880450
+ description: "Required true for set_setting, reset_setting, run_command, open_panel, open_ui_surface, and mutating run_workspace_action calls after an explicit user request."
880451
+ },
880452
+ explicitUserRequest: {
880453
+ type: "string",
880454
+ description: "Exact user request or faithful short summary authorizing a setting mutation or harness UI/command invocation."
880455
+ }
880456
+ };
880457
+
880458
+ // src/tools/agent-harness-ui-surface-metadata.ts
880340
880459
  function readString55(value) {
880341
880460
  return typeof value === "string" ? value.trim() : "";
880342
880461
  }
@@ -880346,6 +880465,325 @@ function readLimit9(value, fallback) {
880346
880465
  return fallback;
880347
880466
  return Math.max(1, Math.min(500, Math.trunc(parsed)));
880348
880467
  }
880468
+ function routeUnavailable(surface) {
880469
+ return {
880470
+ status: "route_unavailable",
880471
+ surface: surface.id,
880472
+ note: "The current runtime did not provide the shell opener for this UI surface."
880473
+ };
880474
+ }
880475
+ function opened(surface, extra = {}) {
880476
+ return {
880477
+ status: "opened",
880478
+ surface: surface.id,
880479
+ kind: surface.kind,
880480
+ ...extra,
880481
+ note: "UI routing was handed to the current Agent shell bridge."
880482
+ };
880483
+ }
880484
+ function optionalModelTarget(args2) {
880485
+ const target = readString55(args2.target);
880486
+ return target === "main" || target === "helper" || target === "tool" || target === "tts" ? target : undefined;
880487
+ }
880488
+ function optionalOnboardingMode(args2) {
880489
+ const target = readString55(args2.target);
880490
+ return target === "new" || target === "edit" || target === "reopen" ? target : undefined;
880491
+ }
880492
+ function workspaceCategory(args2) {
880493
+ return readString55(args2.categoryId || args2.category || args2.target) || undefined;
880494
+ }
880495
+ function settingsTarget(args2) {
880496
+ return readString55(args2.target || args2.key || args2.prefix) || undefined;
880497
+ }
880498
+ var UI_SURFACES = [
880499
+ {
880500
+ id: "agent-workspace",
880501
+ label: "Agent Workspace",
880502
+ kind: "workspace",
880503
+ summary: "Fullscreen operator workspace with setup, knowledge, local state, channels, automation, and delegation routes.",
880504
+ command: "/agent",
880505
+ preferredModelRoute: "Use workspace_actions/workspace_action/run_workspace_action for model operation; use open_ui_surface only to visibly navigate.",
880506
+ parameters: ["categoryId"],
880507
+ available: (context) => typeof context.openAgentWorkspace === "function",
880508
+ open: (context, args2) => {
880509
+ const surface = findSurfaceById("agent-workspace");
880510
+ if (!context.openAgentWorkspace)
880511
+ return routeUnavailable(surface);
880512
+ const categoryId = workspaceCategory(args2);
880513
+ context.openAgentWorkspace(categoryId);
880514
+ return opened(surface, { categoryId: categoryId ?? "default" });
880515
+ }
880516
+ },
880517
+ {
880518
+ id: "settings",
880519
+ label: "Settings",
880520
+ kind: "modal",
880521
+ summary: "Fullscreen settings workspace for Agent-owned configuration, subscriptions, secrets, MCP, tools, and surface settings.",
880522
+ command: "/settings",
880523
+ preferredModelRoute: "Use settings/get_setting/set_setting/reset_setting for model operation; use open_ui_surface only to visibly navigate.",
880524
+ parameters: ["target", "key", "prefix"],
880525
+ available: (context) => typeof context.openSettingsModal === "function",
880526
+ open: (context, args2) => {
880527
+ const surface = findSurfaceById("settings");
880528
+ if (!context.openSettingsModal)
880529
+ return routeUnavailable(surface);
880530
+ const target = settingsTarget(args2);
880531
+ context.openSettingsModal(target);
880532
+ return opened(surface, { target: target ?? "default" });
880533
+ }
880534
+ },
880535
+ {
880536
+ id: "mcp-workspace",
880537
+ label: "MCP Workspace",
880538
+ kind: "workspace",
880539
+ summary: "MCP server setup, trust posture, and tool inventory workspace.",
880540
+ command: "/mcp",
880541
+ preferredModelRoute: "Use workspace_actions, tools, and settings modes for model operation.",
880542
+ available: (context) => typeof context.openMcpWorkspace === "function",
880543
+ open: (context) => {
880544
+ const surface = findSurfaceById("mcp-workspace");
880545
+ if (!context.openMcpWorkspace)
880546
+ return routeUnavailable(surface);
880547
+ context.openMcpWorkspace();
880548
+ return opened(surface);
880549
+ }
880550
+ },
880551
+ {
880552
+ id: "model-picker",
880553
+ label: "Model Picker",
880554
+ kind: "picker",
880555
+ summary: "Interactive model picker for main, helper, tool, and TTS model routes.",
880556
+ command: "/model",
880557
+ preferredModelRoute: "Use settings mode for direct provider.model changes, or run_command /model with confirmation when a concrete model id is known.",
880558
+ parameters: ["target"],
880559
+ available: (context) => typeof context.openModelPicker === "function" || typeof context.openModelPickerWithTarget === "function",
880560
+ open: (context, args2) => {
880561
+ const surface = findSurfaceById("model-picker");
880562
+ const target = optionalModelTarget(args2);
880563
+ if (target && context.openModelPickerWithTarget) {
880564
+ const openedForTarget = context.openModelPickerWithTarget(target);
880565
+ return opened(surface, { target, openedForTarget });
880566
+ }
880567
+ if (!context.openModelPicker)
880568
+ return routeUnavailable(surface);
880569
+ context.openModelPicker();
880570
+ return opened(surface, { target: "main" });
880571
+ }
880572
+ },
880573
+ {
880574
+ id: "provider-picker",
880575
+ label: "Provider Picker",
880576
+ kind: "picker",
880577
+ summary: "Interactive provider picker for model route setup.",
880578
+ command: "/provider",
880579
+ preferredModelRoute: "Use settings mode for direct provider routing changes, or run confirmed slash-command mirrors for concrete provider changes.",
880580
+ parameters: ["target"],
880581
+ available: (context) => typeof context.openProviderPicker === "function" || typeof context.openProviderModelPickerWithTarget === "function",
880582
+ open: (context, args2) => {
880583
+ const surface = findSurfaceById("provider-picker");
880584
+ const target = optionalModelTarget(args2);
880585
+ if (target && context.openProviderModelPickerWithTarget) {
880586
+ context.openProviderModelPickerWithTarget(target);
880587
+ return opened(surface, { target });
880588
+ }
880589
+ if (!context.openProviderPicker)
880590
+ return routeUnavailable(surface);
880591
+ context.openProviderPicker();
880592
+ return opened(surface, { target: "main" });
880593
+ }
880594
+ },
880595
+ {
880596
+ id: "session-picker",
880597
+ label: "Session Picker",
880598
+ kind: "picker",
880599
+ summary: "Saved session browser and loader.",
880600
+ command: "/sessions",
880601
+ preferredModelRoute: "Use session slash-command mirrors with confirmation for concrete save/load/export actions.",
880602
+ available: (context) => typeof context.openSessionPicker === "function",
880603
+ open: (context) => {
880604
+ const surface = findSurfaceById("session-picker");
880605
+ if (!context.openSessionPicker)
880606
+ return routeUnavailable(surface);
880607
+ context.openSessionPicker();
880608
+ return opened(surface);
880609
+ }
880610
+ },
880611
+ {
880612
+ id: "profile-picker",
880613
+ label: "Profile Picker",
880614
+ kind: "picker",
880615
+ summary: "Agent profile picker for local isolated profile selection.",
880616
+ command: "/agent-profile",
880617
+ preferredModelRoute: "Use workspace profile actions or profile slash-command mirrors for concrete model operation.",
880618
+ available: (context) => typeof context.openProfilePicker === "function",
880619
+ open: (context) => {
880620
+ const surface = findSurfaceById("profile-picker");
880621
+ if (!context.openProfilePicker)
880622
+ return routeUnavailable(surface);
880623
+ context.openProfilePicker();
880624
+ return opened(surface);
880625
+ }
880626
+ },
880627
+ {
880628
+ id: "bookmark-modal",
880629
+ label: "Bookmarks",
880630
+ kind: "modal",
880631
+ summary: "Transcript bookmark browser.",
880632
+ command: "/bookmarks",
880633
+ preferredModelRoute: "Use slash-command mirrors for concrete bookmark inspection; opening is visible navigation only.",
880634
+ available: (context) => typeof context.openBookmarkModal === "function",
880635
+ open: (context) => {
880636
+ const surface = findSurfaceById("bookmark-modal");
880637
+ if (!context.openBookmarkModal)
880638
+ return routeUnavailable(surface);
880639
+ context.openBookmarkModal();
880640
+ return opened(surface);
880641
+ }
880642
+ },
880643
+ {
880644
+ id: "context-inspector",
880645
+ label: "Context Inspector",
880646
+ kind: "modal",
880647
+ summary: "Context-window usage and token breakdown inspector.",
880648
+ command: "/context",
880649
+ preferredModelRoute: "Use slash-command mirrors for text output; opening is visible navigation only.",
880650
+ available: (context) => typeof context.openContextInspector === "function",
880651
+ open: (context) => {
880652
+ const surface = findSurfaceById("context-inspector");
880653
+ if (!context.openContextInspector)
880654
+ return routeUnavailable(surface);
880655
+ context.openContextInspector();
880656
+ return opened(surface);
880657
+ }
880658
+ },
880659
+ {
880660
+ id: "help-overlay",
880661
+ label: "Help Overlay",
880662
+ kind: "overlay",
880663
+ summary: "Registry-driven command and shortcut help overlay.",
880664
+ command: "/help",
880665
+ preferredModelRoute: "Use commands/command and shortcuts modes for model-readable discovery.",
880666
+ available: (context) => typeof context.openHelpOverlay === "function",
880667
+ open: (context) => {
880668
+ const surface = findSurfaceById("help-overlay");
880669
+ if (!context.openHelpOverlay)
880670
+ return routeUnavailable(surface);
880671
+ context.openHelpOverlay();
880672
+ return opened(surface);
880673
+ }
880674
+ },
880675
+ {
880676
+ id: "shortcuts-overlay",
880677
+ label: "Shortcuts Overlay",
880678
+ kind: "overlay",
880679
+ summary: "Keyboard shortcut reference overlay.",
880680
+ command: "/shortcuts",
880681
+ preferredModelRoute: "Use shortcuts/keybindings modes for model-readable discovery and confirmed keybinding edits.",
880682
+ available: (context) => typeof context.openShortcutsOverlay === "function",
880683
+ open: (context) => {
880684
+ const surface = findSurfaceById("shortcuts-overlay");
880685
+ if (!context.openShortcutsOverlay)
880686
+ return routeUnavailable(surface);
880687
+ context.openShortcutsOverlay();
880688
+ return opened(surface);
880689
+ }
880690
+ },
880691
+ {
880692
+ id: "onboarding",
880693
+ label: "Onboarding Wizard",
880694
+ kind: "modal",
880695
+ summary: "First-run and setup review wizard for Agent readiness.",
880696
+ command: "/setup",
880697
+ preferredModelRoute: "Use workspace setup actions and settings modes for concrete model operation.",
880698
+ parameters: ["target=new|edit|reopen"],
880699
+ available: (context) => typeof context.openOnboardingWizard === "function",
880700
+ open: (context, args2) => {
880701
+ const surface = findSurfaceById("onboarding");
880702
+ if (!context.openOnboardingWizard)
880703
+ return routeUnavailable(surface);
880704
+ const mode = optionalOnboardingMode(args2);
880705
+ context.openOnboardingWizard(mode);
880706
+ return opened(surface, { mode: mode ?? "default" });
880707
+ }
880708
+ }
880709
+ ];
880710
+ function findSurfaceById(surfaceId) {
880711
+ return UI_SURFACES.find((surface) => surface.id === surfaceId);
880712
+ }
880713
+ function surfaceMatches(surface, query2) {
880714
+ if (!query2)
880715
+ return true;
880716
+ return [
880717
+ surface.id,
880718
+ surface.label,
880719
+ surface.kind,
880720
+ surface.summary,
880721
+ surface.command,
880722
+ surface.preferredModelRoute
880723
+ ].map((value) => String(value ?? "")).join(`
880724
+ `).toLowerCase().includes(query2.toLowerCase());
880725
+ }
880726
+ function describeSurface(context, surface) {
880727
+ return {
880728
+ id: surface.id,
880729
+ label: surface.label,
880730
+ kind: surface.kind,
880731
+ summary: surface.summary,
880732
+ command: surface.command,
880733
+ preferredModelRoute: surface.preferredModelRoute,
880734
+ parameters: surface.parameters ?? [],
880735
+ available: surface.available(context),
880736
+ policy: {
880737
+ effect: "visible-ui-navigation",
880738
+ confirmation: 'agent_harness mode:"open_ui_surface" requires confirm:true and explicitUserRequest.',
880739
+ boundary: "UI surface routing opens the same visible Agent shell surface the user can open. Use first-class model tools, settings modes, workspace actions, or confirmed slash-command mirrors for actual operations."
880740
+ }
880741
+ };
880742
+ }
880743
+ function totalHarnessUiSurfaces() {
880744
+ return UI_SURFACES.length;
880745
+ }
880746
+ function listHarnessUiSurfaces(context, args2) {
880747
+ const query2 = readString55(args2.query);
880748
+ const limit3 = readLimit9(args2.limit, 200);
880749
+ return UI_SURFACES.map((surface) => describeSurface(context, surface)).filter((surface) => surfaceMatches(surface, query2)).slice(0, limit3);
880750
+ }
880751
+ function describeHarnessUiSurface(context, args2) {
880752
+ const surfaceId = readString55(args2.surfaceId || args2.query);
880753
+ if (!surfaceId)
880754
+ return null;
880755
+ const surface = UI_SURFACES.find((entry) => entry.id === surfaceId || entry.label.toLowerCase() === surfaceId.toLowerCase());
880756
+ return surface ? describeSurface(context, surface) : null;
880757
+ }
880758
+ function openHarnessUiSurface(context, args2) {
880759
+ const surfaceId = readString55(args2.surfaceId || args2.query);
880760
+ const surface = UI_SURFACES.find((entry) => entry.id === surfaceId || entry.label.toLowerCase() === surfaceId.toLowerCase());
880761
+ if (!surface) {
880762
+ return {
880763
+ status: "unknown_ui_surface",
880764
+ surfaceId: surfaceId || "<missing>",
880765
+ availableSurfaces: UI_SURFACES.map((entry) => entry.id)
880766
+ };
880767
+ }
880768
+ return {
880769
+ ...surface.open(context, args2),
880770
+ descriptor: describeSurface(context, surface)
880771
+ };
880772
+ }
880773
+
880774
+ // src/tools/agent-harness-tool.ts
880775
+ function isMode(value) {
880776
+ return typeof value === "string" && AGENT_HARNESS_MODES.includes(value);
880777
+ }
880778
+ function readString56(value) {
880779
+ return typeof value === "string" ? value.trim() : "";
880780
+ }
880781
+ function readLimit10(value, fallback) {
880782
+ const parsed = typeof value === "string" && value.trim() ? Number(value) : value;
880783
+ if (typeof parsed !== "number" || !Number.isFinite(parsed))
880784
+ return fallback;
880785
+ return Math.max(1, Math.min(500, Math.trunc(parsed)));
880786
+ }
880349
880787
  function readStringArray12(value) {
880350
880788
  if (!Array.isArray(value))
880351
880789
  return [];
@@ -880365,12 +880803,6 @@ function output7(value) {
880365
880803
  function error52(message) {
880366
880804
  return { success: false, error: message };
880367
880805
  }
880368
- var KEY_COMBO_PARAMETER_SCHEMA = {
880369
- type: "object",
880370
- properties: { key: { type: "string" }, ctrl: { type: "boolean" }, shift: { type: "boolean" }, alt: { type: "boolean" } },
880371
- required: ["key"],
880372
- additionalProperties: false
880373
- };
880374
880806
  function commandMatches(command8, query2) {
880375
880807
  if (!query2)
880376
880808
  return true;
@@ -880427,7 +880859,7 @@ function describeWorkspaceEditor(editor) {
880427
880859
  }
880428
880860
  function selectedRoutineFromArgs(snapshot, args2) {
880429
880861
  const fields = readFieldMap3(args2.fields);
880430
- const routineId = readString55(args2.recordId) || readString55(fields.routineId) || readString55(fields.id);
880862
+ const routineId = readString56(args2.recordId) || readString56(fields.routineId) || readString56(fields.id);
880431
880863
  if (!routineId)
880432
880864
  return null;
880433
880865
  return snapshot.localRoutines.find((routine) => routine.id === routineId || routine.name.toLowerCase() === routineId.toLowerCase()) ?? null;
@@ -880495,17 +880927,17 @@ function localEditorModelExecution(editorKind) {
880495
880927
  return "Use the command field, editor schema, or a first-class Agent model tool when available.";
880496
880928
  }
880497
880929
  function listWorkspaceActions(deps, args2) {
880498
- const query2 = readString55(args2.query);
880499
- const categoryId = readString55(args2.categoryId || args2.category);
880500
- const limit3 = readLimit9(args2.limit, 200);
880930
+ const query2 = readString56(args2.query);
880931
+ const categoryId = readString56(args2.categoryId || args2.category);
880932
+ const limit3 = readLimit10(args2.limit, 200);
880501
880933
  const includeEditor = args2.includeParameters === true;
880502
880934
  const editorContext = includeEditor ? buildWorkspaceEditorContext(deps.commandContext, args2) : null;
880503
880935
  const source = query2 ? searchAgentWorkspaceActions(AGENT_WORKSPACE_CATEGORIES, query2).map((result2) => ({ category: result2.category, action: result2.action })) : allWorkspaceActions();
880504
880936
  return source.filter((entry) => !categoryId || entry.category.id === categoryId).slice(0, limit3).map((entry) => describeWorkspaceAction(entry.category, entry.action, { includeEditor, editorContext }));
880505
880937
  }
880506
880938
  function findWorkspaceAction(args2) {
880507
- const actionId = readString55(args2.actionId || args2.query);
880508
- const categoryId = readString55(args2.categoryId || args2.category);
880939
+ const actionId = readString56(args2.actionId || args2.query);
880940
+ const categoryId = readString56(args2.categoryId || args2.category);
880509
880941
  if (!actionId)
880510
880942
  return null;
880511
880943
  return allWorkspaceActions().find((entry) => {
@@ -880515,12 +880947,12 @@ function findWorkspaceAction(args2) {
880515
880947
  }) ?? null;
880516
880948
  }
880517
880949
  function listCommands(commandRegistry, args2) {
880518
- const query2 = readString55(args2.query);
880519
- const limit3 = readLimit9(args2.limit, 200);
880950
+ const query2 = readString56(args2.query);
880951
+ const limit3 = readLimit10(args2.limit, 200);
880520
880952
  return commandRegistry.list().filter((command8) => commandMatches(command8, query2)).sort((a4, b3) => a4.name.localeCompare(b3.name)).slice(0, limit3).map(describeCommand);
880521
880953
  }
880522
880954
  function requireConfirmedAction(args2, action2) {
880523
- const explicitUserRequest = readString55(args2.explicitUserRequest);
880955
+ const explicitUserRequest = readString56(args2.explicitUserRequest);
880524
880956
  if (!explicitUserRequest)
880525
880957
  return `${action2} requires explicitUserRequest with the user's exact request or a short faithful summary.`;
880526
880958
  if (args2.confirm !== true)
@@ -880528,7 +880960,7 @@ function requireConfirmedAction(args2, action2) {
880528
880960
  return null;
880529
880961
  }
880530
880962
  function commandFromArgs(args2) {
880531
- const rawCommand = readString55(args2.command);
880963
+ const rawCommand = readString56(args2.command);
880532
880964
  if (rawCommand) {
880533
880965
  const parsed = parseSlashCommand(rawCommand);
880534
880966
  if (!parsed.name)
@@ -880538,7 +880970,7 @@ function commandFromArgs(args2) {
880538
880970
  args: parsed.args
880539
880971
  };
880540
880972
  }
880541
- const commandName = readString55(args2.commandName).replace(/^\//, "");
880973
+ const commandName = readString56(args2.commandName).replace(/^\//, "");
880542
880974
  if (!commandName)
880543
880975
  return null;
880544
880976
  const commandArgs = readStringArray12(args2.args);
@@ -880726,115 +881158,13 @@ function createAgentHarnessTool(deps) {
880726
881158
  name: "agent_harness",
880727
881159
  description: [
880728
881160
  "Discover and operate the GoodVibes Agent harness from the main conversation.",
880729
- "Use this tool to inspect Agent workspace actions, built-in panels, top-level CLI mirrors, keybindings, slash commands with policy metadata, model tools, connected-host capabilities, and Agent settings, or to invoke a workspace action/command through the same in-process command registry the user uses in the TUI.",
880730
- "Discovery modes are read-only. Setting/keybinding writes, resets, slash command invocation, and workspace action invocation require confirm:true plus explicitUserRequest.",
881161
+ "Use this tool to inspect Agent workspace actions, built-in panels, top-level CLI mirrors, UI surfaces, keybindings, slash commands with policy metadata, model tools, connected-host capabilities, and Agent settings, or to invoke a workspace action/command through the same in-process command registry the user uses in the TUI.",
881162
+ "Discovery modes are read-only. Setting/keybinding writes, resets, UI routing, slash command invocation, and workspace action invocation require confirm:true plus explicitUserRequest.",
880731
881163
  "This tool preserves Agent product boundaries: connected-host lifecycle and listener posture stay externally owned, connected-host mode reports allowed and blocked route families, and secret-backed settings store raw values through the secret manager while config receives only a secret reference."
880732
881164
  ].join(" "),
880733
881165
  parameters: {
880734
881166
  type: "object",
880735
- properties: {
880736
- mode: {
880737
- type: "string",
880738
- enum: MODES,
880739
- description: "Harness operation to perform."
880740
- },
880741
- query: {
880742
- type: "string",
880743
- description: "Search text for command, setting, or tool catalogs."
880744
- },
880745
- command: {
880746
- type: "string",
880747
- 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".'
880748
- },
880749
- cliCommand: {
880750
- type: "string",
880751
- description: 'Top-level CLI command string for mode cli_command, for example "goodvibes-agent status --json" or "profiles list". This mode is read-only metadata/parse inspection.'
880752
- },
880753
- commandName: {
880754
- type: "string",
880755
- description: "Slash command root without the leading slash for mode command or run_command, or a top-level CLI command token for cli_command."
880756
- },
880757
- args: {
880758
- type: "array",
880759
- items: { type: "string" },
880760
- description: "Slash command argument tokens for mode run_command when commandName is used."
880761
- },
880762
- categoryId: {
880763
- type: "string",
880764
- description: "Agent workspace category id for workspace action filtering."
880765
- },
880766
- panelId: {
880767
- type: "string",
880768
- description: "Built-in panel id for panel or open_panel modes."
880769
- },
880770
- actionId: {
880771
- type: "string",
880772
- description: "Agent workspace action id for workspace_action or run_workspace_action, or keybinding action id for keybinding/set_keybinding/reset_keybinding."
880773
- },
880774
- fields: {
880775
- type: "object",
880776
- additionalProperties: { type: "string" },
880777
- description: "Field values for run_workspace_action when the workspace action opens an editor form."
880778
- },
880779
- combo: {
880780
- ...KEY_COMBO_PARAMETER_SCHEMA,
880781
- description: 'Single key combo for set_keybinding, for example { "key": "g", "ctrl": true }.'
880782
- },
880783
- combos: {
880784
- type: "array",
880785
- items: KEY_COMBO_PARAMETER_SCHEMA,
880786
- description: "Multiple key combos for set_keybinding."
880787
- },
880788
- recordId: {
880789
- type: "string",
880790
- description: "Selected Agent-local record id for selection-based local workspace operations."
880791
- },
880792
- key: {
880793
- type: "string",
880794
- description: "Agent setting key for get_setting, set_setting, or reset_setting."
880795
- },
880796
- value: {
880797
- anyOf: [
880798
- { type: "string" },
880799
- { type: "number" },
880800
- { type: "boolean" }
880801
- ],
880802
- description: "Setting value for set_setting. Strings, booleans, numbers, and enum strings are accepted."
880803
- },
880804
- category: {
880805
- type: "string",
880806
- description: "Setting category filter such as provider, behavior, tools, ui, tts, permissions, automation, or surfaces."
880807
- },
880808
- prefix: {
880809
- type: "string",
880810
- description: "Setting key prefix filter such as surfaces.slack."
880811
- },
880812
- includeHidden: {
880813
- type: "boolean",
880814
- description: "Include settings hidden from the Agent workspace because they are host-owned or non-Agent lifecycle settings."
880815
- },
880816
- includeParameters: {
880817
- type: "boolean",
880818
- description: "Include model tool JSON schemas in tools mode, or workspace editor field schemas in workspace_actions mode."
880819
- },
880820
- limit: {
880821
- type: "number",
880822
- description: "Maximum catalog entries to return."
880823
- },
880824
- pane: {
880825
- type: "string",
880826
- enum: ["top", "bottom"],
880827
- description: "Preferred panel pane for open_panel when the current shell supports panel routing."
880828
- },
880829
- confirm: {
880830
- type: "boolean",
880831
- description: "Required true for set_setting, reset_setting, run_command, open_panel, and mutating run_workspace_action calls after an explicit user request."
880832
- },
880833
- explicitUserRequest: {
880834
- type: "string",
880835
- description: "Exact user request or faithful short summary authorizing a setting mutation or slash command invocation."
880836
- }
880837
- },
881167
+ properties: AGENT_HARNESS_PARAMETER_PROPERTIES,
880838
881168
  required: ["mode"],
880839
881169
  additionalProperties: false
880840
881170
  },
@@ -880851,6 +881181,7 @@ function createAgentHarnessTool(deps) {
880851
881181
  cliCommands: totalHarnessCliCommands(),
880852
881182
  blockedCliCommandTokens: blockedHarnessCliCommandTokens(),
880853
881183
  panels: totalHarnessPanels(deps.commandContext),
881184
+ uiSurfaces: totalHarnessUiSurfaces(),
880854
881185
  shortcuts: totalHarnessShortcuts(deps.commandContext),
880855
881186
  keybindings: totalHarnessKeybindings(deps.commandContext),
880856
881187
  commands: deps.commandRegistry.list().length,
@@ -880861,6 +881192,7 @@ function createAgentHarnessTool(deps) {
880861
881192
  modelAccess: {
880862
881193
  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.',
880863
881194
  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.',
881195
+ 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.',
880864
881196
  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.',
880865
881197
  slashCommands: 'Use mode:"commands" and mode:"command" to inspect; use mode:"run_command" with confirm:true plus explicitUserRequest to execute.',
880866
881198
  workspace: 'Use mode:"workspace_actions" to list and mode:"workspace_action" for editor schemas; set includeParameters:true on workspace_actions to inline editor schemas.',
@@ -880896,7 +881228,7 @@ function createAgentHarnessTool(deps) {
880896
881228
  }
880897
881229
  if (args2.mode === "panel") {
880898
881230
  const panel = describeHarnessPanel(deps.commandContext, args2);
880899
- return panel ? output7(panel) : error52(`Unknown panel ${readString55(args2.panelId || args2.query) || "<missing>"}.`);
881231
+ return panel ? output7(panel) : error52(`Unknown panel ${readString56(args2.panelId || args2.query) || "<missing>"}.`);
880900
881232
  }
880901
881233
  if (args2.mode === "open_panel") {
880902
881234
  const confirmationError2 = requireConfirmedAction(args2, "Panel routing");
@@ -880904,13 +881236,27 @@ function createAgentHarnessTool(deps) {
880904
881236
  return error52(confirmationError2);
880905
881237
  return output7(openHarnessPanel(deps.commandContext, args2));
880906
881238
  }
881239
+ if (args2.mode === "ui_surfaces") {
881240
+ const surfaces2 = listHarnessUiSurfaces(deps.commandContext, args2);
881241
+ return output7({ surfaces: surfaces2, returned: surfaces2.length, total: totalHarnessUiSurfaces() });
881242
+ }
881243
+ if (args2.mode === "ui_surface") {
881244
+ const surface = describeHarnessUiSurface(deps.commandContext, args2);
881245
+ return surface ? output7(surface) : error52(`Unknown UI surface ${readString56(args2.surfaceId || args2.query) || "<missing>"}.`);
881246
+ }
881247
+ if (args2.mode === "open_ui_surface") {
881248
+ const confirmationError2 = requireConfirmedAction(args2, "UI surface routing");
881249
+ if (confirmationError2)
881250
+ return error52(confirmationError2);
881251
+ return output7(openHarnessUiSurface(deps.commandContext, args2));
881252
+ }
880907
881253
  if (args2.mode === "shortcuts")
880908
881254
  return output7(listHarnessShortcuts(deps.commandContext, args2));
880909
881255
  if (args2.mode === "keybindings")
880910
881256
  return output7(listHarnessKeybindings(deps.commandContext, args2));
880911
881257
  if (args2.mode === "keybinding") {
880912
881258
  const binding = describeHarnessKeybinding(deps.commandContext, args2);
880913
- return binding ? output7(binding) : error52(`Unknown keybinding action ${readString55(args2.actionId || args2.key || args2.query) || "<missing>"}.`);
881259
+ return binding ? output7(binding) : error52(`Unknown keybinding action ${readString56(args2.actionId || args2.key || args2.query) || "<missing>"}.`);
880914
881260
  }
880915
881261
  if (args2.mode === "set_keybinding") {
880916
881262
  const confirmationError2 = requireConfirmedAction(args2, "Keybinding mutation");
@@ -880929,7 +881275,7 @@ function createAgentHarnessTool(deps) {
880929
881275
  return output7({ commands: commands3, returned: commands3.length, total: deps.commandRegistry.list().length });
880930
881276
  }
880931
881277
  if (args2.mode === "command") {
880932
- const name51 = readString55(args2.commandName).replace(/^\//, "");
881278
+ const name51 = readString56(args2.commandName).replace(/^\//, "");
880933
881279
  const command8 = name51 ? deps.commandRegistry.get(name51) : null;
880934
881280
  return command8 ? output7(describeCommand(command8)) : error52(`Unknown slash command /${name51 || "<missing>"}.`);
880935
881281
  }
@@ -880937,16 +881283,16 @@ function createAgentHarnessTool(deps) {
880937
881283
  return runCommand2(deps, args2);
880938
881284
  if (args2.mode === "settings") {
880939
881285
  const settings = listHarnessSettings(deps.commandContext.platform.configManager, {
880940
- category: readString55(args2.category) || undefined,
880941
- prefix: readString55(args2.prefix) || undefined,
880942
- query: readString55(args2.query) || undefined,
881286
+ category: readString56(args2.category) || undefined,
881287
+ prefix: readString56(args2.prefix) || undefined,
881288
+ query: readString56(args2.query) || undefined,
880943
881289
  includeHidden: args2.includeHidden === true,
880944
- limit: readLimit9(args2.limit, 100)
881290
+ limit: readLimit10(args2.limit, 100)
880945
881291
  });
880946
881292
  return output7({ settings, returned: settings.length, policy: settingsPolicySummary() });
880947
881293
  }
880948
881294
  if (args2.mode === "get_setting") {
880949
- const key = readString55(args2.key);
881295
+ const key = readString56(args2.key);
880950
881296
  const setting = getHarnessSetting(deps.commandContext.platform.configManager, key);
880951
881297
  return setting ? output7(setting) : error52(`Unknown setting ${key || "<missing>"}.`);
880952
881298
  }
@@ -880956,7 +881302,7 @@ function createAgentHarnessTool(deps) {
880956
881302
  return error52(confirmationError2);
880957
881303
  if (args2.value === undefined)
880958
881304
  return error52("set_setting requires value.");
880959
- const key = readString55(args2.key);
881305
+ const key = readString56(args2.key);
880960
881306
  const result2 = await setHarnessSetting(deps.commandContext.platform.configManager, deps.commandContext.platform.secretsManager, key, args2.value);
880961
881307
  return output7(result2);
880962
881308
  }
@@ -880964,7 +881310,7 @@ function createAgentHarnessTool(deps) {
880964
881310
  const confirmationError2 = requireConfirmedAction(args2, "Setting reset");
880965
881311
  if (confirmationError2)
880966
881312
  return error52(confirmationError2);
880967
- const key = readString55(args2.key);
881313
+ const key = readString56(args2.key);
880968
881314
  const result2 = await resetHarnessSetting(deps.commandContext.platform.configManager, deps.commandContext.platform.secretsManager, key);
880969
881315
  return output7(result2);
880970
881316
  }
@@ -880981,7 +881327,7 @@ function createAgentHarnessTool(deps) {
880981
881327
  if (args2.mode === "workspace_action") {
880982
881328
  const found = findWorkspaceAction(args2);
880983
881329
  const editorContext = buildWorkspaceEditorContext(deps.commandContext, args2);
880984
- return found ? output7(describeWorkspaceAction(found.category, found.action, { includeEditor: true, editorContext })) : error52(`Unknown Agent workspace action ${readString55(args2.actionId || args2.query) || "<missing>"}.`);
881330
+ return found ? output7(describeWorkspaceAction(found.category, found.action, { includeEditor: true, editorContext })) : error52(`Unknown Agent workspace action ${readString56(args2.actionId || args2.query) || "<missing>"}.`);
880985
881331
  }
880986
881332
  if (args2.mode === "run_workspace_action")
880987
881333
  return runWorkspaceAction(deps, args2);
@@ -899451,7 +899797,7 @@ import { join as join100 } from "path";
899451
899797
  function isRecord43(value) {
899452
899798
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
899453
899799
  }
899454
- function readString56(record2, key) {
899800
+ function readString57(record2, key) {
899455
899801
  const value = record2?.[key];
899456
899802
  return typeof value === "string" ? value : null;
899457
899803
  }
@@ -899502,7 +899848,7 @@ async function inspectCliExternalRuntime(options) {
899502
899848
  try {
899503
899849
  const status = await fetchJson2(`${baseUrl}/status`, token.token, timeoutMs);
899504
899850
  const statusRecord = isRecord43(status.body) ? status.body : {};
899505
- const version6 = readString56(statusRecord, "version") ?? "unknown";
899851
+ const version6 = readString57(statusRecord, "version") ?? "unknown";
899506
899852
  const compatible = status.ok && version6 === SDK_VERSION;
899507
899853
  if (!status.ok) {
899508
899854
  return {