@pellux/goodvibes-agent 1.0.5 → 1.0.6

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.5";
816511
+ var _version = "1.0.6";
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"));
@@ -821197,7 +821139,7 @@ var INBOUND_EVENT_SURFACE_KINDS = new Set([
821197
821139
  ]);
821198
821140
  // src/runtime/onboarding/apply.ts
821199
821141
  init_config8();
821200
- import { existsSync as existsSync85, readFileSync as readFileSync91, rmSync as rmSync10 } from "fs";
821142
+ import { existsSync as existsSync86, readFileSync as readFileSync92, rmSync as rmSync10 } from "fs";
821201
821143
 
821202
821144
  // src/agent/runtime-profile.ts
821203
821145
  import { existsSync as existsSync43, mkdirSync as mkdirSync32, readFileSync as readFileSync48, readdirSync as readdirSync15, rmSync as rmSync5, statSync as statSync13, writeFileSync as writeFileSync29 } from "fs";
@@ -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,
@@ -879549,6 +879491,7 @@ function connectedHostSummary(context, toolRegistry) {
879549
879491
  tokenPath: connection5.tokenPath,
879550
879492
  ownership: "external-connected-host",
879551
879493
  lifecycle: "GoodVibes Agent can use public connected-host operator routes, but does not start, stop, restart, install, expose, or mutate the host listener.",
879494
+ statusMode: 'Use agent_harness mode:"connected_host_status" for live read-only reachability, SDK compatibility, token posture, and Agent Knowledge route readiness.',
879552
879495
  routeFamilies: connectedHostRouteFamilies(),
879553
879496
  capabilities: connectedHostCapabilityMap(toolRegistry),
879554
879497
  blockedCapabilities: blockedConnectedHostCapabilities()
@@ -880062,6 +880005,274 @@ function openHarnessPanel(context, args2) {
880062
880005
  };
880063
880006
  }
880064
880007
 
880008
+ // src/cli/external-runtime.ts
880009
+ import { existsSync as existsSync83, readFileSync as readFileSync90 } from "fs";
880010
+ import { join as join98 } from "path";
880011
+ function isRecord42(value) {
880012
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
880013
+ }
880014
+ function readString53(record2, key) {
880015
+ const value = record2?.[key];
880016
+ return typeof value === "string" ? value : null;
880017
+ }
880018
+ function resolveBaseUrl2(configManager) {
880019
+ const host = String(configManager.get("controlPlane.host") ?? "127.0.0.1");
880020
+ const port = Number(configManager.get("controlPlane.port") ?? 3421);
880021
+ return `http://${host}:${Number.isFinite(port) ? port : 3421}`;
880022
+ }
880023
+ function readOperatorToken2(homeDirectory) {
880024
+ const path7 = join98(homeDirectory, ".goodvibes", "daemon", "operator-tokens.json");
880025
+ if (!existsSync83(path7))
880026
+ return { token: null, path: path7 };
880027
+ try {
880028
+ const parsed = JSON.parse(readFileSync90(path7, "utf-8"));
880029
+ const token = isRecord42(parsed) && typeof parsed.token === "string" ? parsed.token : null;
880030
+ return { token, path: path7 };
880031
+ } catch {
880032
+ return { token: null, path: path7 };
880033
+ }
880034
+ }
880035
+ async function fetchJson2(url2, token, timeoutMs) {
880036
+ const controller = new AbortController;
880037
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
880038
+ try {
880039
+ const response5 = await fetch(url2, {
880040
+ headers: token ? { authorization: `Bearer ${token}` } : undefined,
880041
+ signal: controller.signal
880042
+ });
880043
+ const text = await response5.text();
880044
+ let body2 = text;
880045
+ if (text.trim().length > 0) {
880046
+ try {
880047
+ body2 = JSON.parse(text);
880048
+ } catch {
880049
+ body2 = text;
880050
+ }
880051
+ }
880052
+ return { ok: response5.ok, status: response5.status, body: body2 };
880053
+ } finally {
880054
+ clearTimeout(timer);
880055
+ }
880056
+ }
880057
+ async function inspectCliExternalRuntime(options) {
880058
+ const baseUrl = resolveBaseUrl2(options.configManager);
880059
+ const token = readOperatorToken2(options.homeDirectory);
880060
+ const timeoutMs = options.timeoutMs ?? 1500;
880061
+ const route = "/api/goodvibes-agent/knowledge/status";
880062
+ try {
880063
+ const status = await fetchJson2(`${baseUrl}/status`, token.token, timeoutMs);
880064
+ const statusRecord = isRecord42(status.body) ? status.body : {};
880065
+ const version6 = readString53(statusRecord, "version") ?? "unknown";
880066
+ const compatible = status.ok && version6 === SDK_VERSION;
880067
+ if (!status.ok) {
880068
+ return {
880069
+ baseUrl,
880070
+ statusCode: status.status,
880071
+ reachable: false,
880072
+ version: version6,
880073
+ expectedVersion: SDK_VERSION,
880074
+ compatible: false,
880075
+ operatorToken: { present: Boolean(token.token), path: token.path },
880076
+ agentKnowledge: {
880077
+ route,
880078
+ ready: false,
880079
+ kind: status.status === 401 ? "auth_required" : "connected_host_unavailable",
880080
+ statusCode: status.status
880081
+ },
880082
+ error: typeof status.body === "string" ? status.body : `HTTP ${status.status}`
880083
+ };
880084
+ }
880085
+ if (!token.token) {
880086
+ return {
880087
+ baseUrl,
880088
+ statusCode: status.status,
880089
+ reachable: true,
880090
+ version: version6,
880091
+ expectedVersion: SDK_VERSION,
880092
+ compatible,
880093
+ operatorToken: { present: false, path: token.path },
880094
+ agentKnowledge: {
880095
+ route,
880096
+ ready: false,
880097
+ kind: "auth_required",
880098
+ statusCode: null
880099
+ },
880100
+ error: null
880101
+ };
880102
+ }
880103
+ if (!compatible) {
880104
+ return {
880105
+ baseUrl,
880106
+ statusCode: status.status,
880107
+ reachable: true,
880108
+ version: version6,
880109
+ expectedVersion: SDK_VERSION,
880110
+ compatible: false,
880111
+ operatorToken: { present: true, path: token.path },
880112
+ agentKnowledge: {
880113
+ route,
880114
+ ready: false,
880115
+ kind: "version_mismatch",
880116
+ statusCode: null
880117
+ },
880118
+ error: null
880119
+ };
880120
+ }
880121
+ const knowledge2 = await fetchJson2(`${baseUrl}${route}`, token.token, timeoutMs);
880122
+ return {
880123
+ baseUrl,
880124
+ statusCode: status.status,
880125
+ reachable: true,
880126
+ version: version6,
880127
+ expectedVersion: SDK_VERSION,
880128
+ compatible,
880129
+ operatorToken: { present: true, path: token.path },
880130
+ agentKnowledge: {
880131
+ route,
880132
+ ready: knowledge2.ok,
880133
+ kind: knowledge2.ok ? "ok" : knowledge2.status === 401 ? "auth_required" : knowledge2.status === 404 ? "connected_host_route_unavailable" : "connected_host_error",
880134
+ statusCode: knowledge2.status
880135
+ },
880136
+ error: knowledge2.ok ? null : typeof knowledge2.body === "string" ? knowledge2.body : `HTTP ${knowledge2.status}`
880137
+ };
880138
+ } catch (error51) {
880139
+ return {
880140
+ baseUrl,
880141
+ statusCode: null,
880142
+ reachable: false,
880143
+ version: "unknown",
880144
+ expectedVersion: SDK_VERSION,
880145
+ compatible: false,
880146
+ operatorToken: { present: Boolean(token.token), path: token.path },
880147
+ agentKnowledge: {
880148
+ route,
880149
+ ready: false,
880150
+ kind: "connected_host_unavailable",
880151
+ statusCode: null
880152
+ },
880153
+ error: summarizeError(error51)
880154
+ };
880155
+ }
880156
+ }
880157
+
880158
+ // src/tools/agent-harness-connected-host-status.ts
880159
+ var CONNECTED_HOST_STATUS_TIMEOUT_MS = 1500;
880160
+ function resolveHomeDirectory(context) {
880161
+ return context.workspace.shellPaths?.homeDirectory ?? context.platform.configManager.getHomeDirectory() ?? "";
880162
+ }
880163
+ function resolveWorkingDirectory(context) {
880164
+ return context.workspace.shellPaths?.workingDirectory ?? context.platform.configManager.getWorkingDirectory() ?? "";
880165
+ }
880166
+ function connectedHostFindings(runtime3, tokenUsable) {
880167
+ const findings = [];
880168
+ if (!runtime3.reachable) {
880169
+ findings.push({
880170
+ id: "connected-host-unreachable",
880171
+ severity: "warning",
880172
+ summary: "Connected host is not reachable.",
880173
+ cause: runtime3.error ?? `No response from ${runtime3.baseUrl}.`,
880174
+ action: "Start or repair the owning GoodVibes host outside Agent, then recheck connected-host status."
880175
+ });
880176
+ } else if (!runtime3.compatible) {
880177
+ findings.push({
880178
+ id: "connected-host-version-mismatch",
880179
+ severity: "warning",
880180
+ summary: "Connected host SDK version does not match Agent.",
880181
+ cause: `Connected host reports SDK ${runtime3.version}; Agent expects ${runtime3.expectedVersion}.`,
880182
+ action: "Update the owning GoodVibes host so its /status route reports the Agent SDK pin."
880183
+ });
880184
+ }
880185
+ if (!tokenUsable) {
880186
+ findings.push({
880187
+ id: "connected-host-token-missing",
880188
+ severity: "warning",
880189
+ summary: "Connected-host operator token is missing or unreadable.",
880190
+ cause: `No usable operator token was found at ${runtime3.operatorToken.path}.`,
880191
+ action: "Provision or repair connected-host access through the owning GoodVibes host."
880192
+ });
880193
+ }
880194
+ if (runtime3.reachable && tokenUsable && !runtime3.agentKnowledge.ready) {
880195
+ findings.push({
880196
+ id: "agent-knowledge-route-not-ready",
880197
+ severity: "warning",
880198
+ summary: "Isolated Agent Knowledge route is not ready.",
880199
+ cause: `${runtime3.agentKnowledge.route} returned ${runtime3.agentKnowledge.kind}${runtime3.agentKnowledge.statusCode === null ? "" : ` (${runtime3.agentKnowledge.statusCode})`}.`,
880200
+ action: "Update or repair the connected host, then recheck Agent Knowledge compatibility."
880201
+ });
880202
+ }
880203
+ return findings;
880204
+ }
880205
+ async function connectedHostStatusSummary(context, toolRegistry) {
880206
+ const homeDirectory = resolveHomeDirectory(context);
880207
+ const workingDirectory = resolveWorkingDirectory(context);
880208
+ const token = readConnectedHostOperatorToken(homeDirectory);
880209
+ const runtime3 = await inspectCliExternalRuntime({
880210
+ configManager: context.platform.configManager,
880211
+ homeDirectory,
880212
+ timeoutMs: CONNECTED_HOST_STATUS_TIMEOUT_MS
880213
+ });
880214
+ const tokenUsable = Boolean(token.token);
880215
+ return {
880216
+ ownership: "external-connected-host",
880217
+ readOnly: true,
880218
+ timeoutMs: CONNECTED_HOST_STATUS_TIMEOUT_MS,
880219
+ lifecycle: "GoodVibes Agent can inspect connected-host readiness and use public operator routes, but does not start, stop, restart, install, expose, or mutate the host listener.",
880220
+ paths: {
880221
+ workingDirectory,
880222
+ homeDirectory
880223
+ },
880224
+ endpoints: {
880225
+ controlPlane: {
880226
+ enabled: context.platform.configManager.get("controlPlane.enabled"),
880227
+ ...resolveRuntimeEndpointBinding(context.platform.configManager, "controlPlane")
880228
+ },
880229
+ httpListener: {
880230
+ enabled: context.platform.configManager.get("danger.httpListener"),
880231
+ ...resolveRuntimeEndpointBinding(context.platform.configManager, "httpListener")
880232
+ },
880233
+ web: {
880234
+ enabled: context.platform.configManager.get("web.enabled"),
880235
+ ...resolveRuntimeEndpointBinding(context.platform.configManager, "web")
880236
+ }
880237
+ },
880238
+ operatorToken: {
880239
+ present: token.present,
880240
+ usable: tokenUsable,
880241
+ path: token.path,
880242
+ fingerprint: token.token ? `sha256:${connectedHostOperatorTokenFingerprint(token.token)}` : null,
880243
+ error: token.error ?? null
880244
+ },
880245
+ liveStatus: runtime3,
880246
+ routeReadiness: [
880247
+ {
880248
+ id: "status",
880249
+ route: "/status",
880250
+ reachable: runtime3.reachable,
880251
+ statusCode: runtime3.statusCode,
880252
+ sdkVersion: runtime3.version,
880253
+ expectedSdkVersion: runtime3.expectedVersion,
880254
+ compatible: runtime3.compatible
880255
+ },
880256
+ {
880257
+ id: "agent-knowledge",
880258
+ route: runtime3.agentKnowledge.route,
880259
+ ready: runtime3.agentKnowledge.ready,
880260
+ kind: runtime3.agentKnowledge.kind,
880261
+ statusCode: runtime3.agentKnowledge.statusCode
880262
+ }
880263
+ ],
880264
+ findings: connectedHostFindings(runtime3, tokenUsable),
880265
+ modelAccess: {
880266
+ diagnostics: 'Use mode:"connected_host_status" for live read-only host readiness. Use mode:"connected_host" for capability and boundary inventory.',
880267
+ cliMirrors: ["goodvibes-agent status --json", "goodvibes-agent doctor", "goodvibes-agent compat"],
880268
+ tuiMirrors: ["Agent Workspace -> Home -> Host compatibility", "Agent Workspace -> Home -> Doctor diagnostics", "Agent Workspace -> Home -> Review health"]
880269
+ },
880270
+ routeFamilies: connectedHostRouteFamilies(),
880271
+ capabilities: connectedHostCapabilityMap(toolRegistry),
880272
+ blockedCapabilities: blockedConnectedHostCapabilities()
880273
+ };
880274
+ }
880275
+
880065
880276
  // src/tools/agent-harness-local-operations.ts
880066
880277
  function output6(value) {
880067
880278
  return { success: true, output: typeof value === "string" ? value : JSON.stringify(value, null, 2) };
@@ -880069,7 +880280,7 @@ function output6(value) {
880069
880280
  function error51(message) {
880070
880281
  return { success: false, error: message };
880071
880282
  }
880072
- function readString53(value) {
880283
+ function readString54(value) {
880073
880284
  return typeof value === "string" ? value.trim() : "";
880074
880285
  }
880075
880286
  function readFieldMap2(value) {
@@ -880096,10 +880307,10 @@ function describeEditor(editor) {
880096
880307
  }
880097
880308
  function readRecordId(args2) {
880098
880309
  const fields = readFieldMap2(args2.fields);
880099
- return readString53(args2.recordId ?? args2.id ?? fields.recordId ?? fields.id);
880310
+ return readString54(args2.recordId ?? args2.id ?? fields.recordId ?? fields.id);
880100
880311
  }
880101
880312
  function requireConfirmed(args2, label) {
880102
- if (!readString53(args2.explicitUserRequest))
880313
+ if (!readString54(args2.explicitUserRequest))
880103
880314
  return `${label} requires explicitUserRequest with the user's exact request or a short faithful summary.`;
880104
880315
  if (args2.confirm !== true)
880105
880316
  return `${label} requires confirm:true after an explicit user request.`;
@@ -880227,7 +880438,7 @@ function localRegistryArgsForTarget(target, args2, recordId) {
880227
880438
  ...base2,
880228
880439
  ...edit,
880229
880440
  ...target.action === "stale" && fields.reason ? { reason: fields.reason } : {},
880230
- ...target.action === "delete" ? { confirm: args2.confirm, explicitUserRequest: readString53(args2.explicitUserRequest) } : {}
880441
+ ...target.action === "delete" ? { confirm: args2.confirm, explicitUserRequest: readString54(args2.explicitUserRequest) } : {}
880231
880442
  };
880232
880443
  }
880233
880444
  async function executeTool(toolRegistry, name51, toolArgs) {
@@ -880272,7 +880483,7 @@ async function runLocalWorkspaceAction(deps, action2, args2) {
880272
880483
  if (missing.length > 0)
880273
880484
  return output6({ status: "missing_required_fields", missing, action: action2.id, editor: describeEditor(editor) });
880274
880485
  if (editor.kind === "knowledge-url")
880275
- 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: readString53(args2.explicitUserRequest) });
880486
+ 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) });
880276
880487
  return executeTool(deps.toolRegistry, "agent_local_registry", localRegistryArgsFromEditor(editor, fields, recordId));
880277
880488
  }
880278
880489
  if (!target)
@@ -880281,7 +880492,7 @@ async function runLocalWorkspaceAction(deps, action2, args2) {
880281
880492
  }
880282
880493
 
880283
880494
  // src/tools/agent-harness-model-tool-catalog.ts
880284
- function readString54(value) {
880495
+ function readString55(value) {
880285
880496
  return typeof value === "string" ? value.trim() : "";
880286
880497
  }
880287
880498
  function readLimit8(value, fallback) {
@@ -880291,7 +880502,7 @@ function readLimit8(value, fallback) {
880291
880502
  return Math.max(1, Math.min(500, Math.trunc(parsed)));
880292
880503
  }
880293
880504
  function listHarnessModelTools(toolRegistry, args2) {
880294
- const query2 = readString54(args2.query).toLowerCase();
880505
+ const query2 = readString55(args2.query).toLowerCase();
880295
880506
  const includeParameters = args2.includeParameters === true;
880296
880507
  const limit3 = readLimit8(args2.limit, 200);
880297
880508
  return toolRegistry.getToolDefinitions().filter((tool2) => !query2 || [tool2.name, tool2.description, ...tool2.sideEffects ?? []].join(`
@@ -880335,7 +880546,8 @@ var AGENT_HARNESS_MODES = [
880335
880546
  "workspace_action",
880336
880547
  "run_workspace_action",
880337
880548
  "tools",
880338
- "connected_host"
880549
+ "connected_host",
880550
+ "connected_host_status"
880339
880551
  ];
880340
880552
  var KEY_COMBO_PARAMETER_SCHEMA = {
880341
880553
  type: "object",
@@ -880456,7 +880668,7 @@ var AGENT_HARNESS_PARAMETER_PROPERTIES = {
880456
880668
  };
880457
880669
 
880458
880670
  // src/tools/agent-harness-ui-surface-metadata.ts
880459
- function readString55(value) {
880671
+ function readString56(value) {
880460
880672
  return typeof value === "string" ? value.trim() : "";
880461
880673
  }
880462
880674
  function readLimit9(value, fallback) {
@@ -880482,18 +880694,18 @@ function opened(surface, extra = {}) {
880482
880694
  };
880483
880695
  }
880484
880696
  function optionalModelTarget(args2) {
880485
- const target = readString55(args2.target);
880697
+ const target = readString56(args2.target);
880486
880698
  return target === "main" || target === "helper" || target === "tool" || target === "tts" ? target : undefined;
880487
880699
  }
880488
880700
  function optionalOnboardingMode(args2) {
880489
- const target = readString55(args2.target);
880701
+ const target = readString56(args2.target);
880490
880702
  return target === "new" || target === "edit" || target === "reopen" ? target : undefined;
880491
880703
  }
880492
880704
  function workspaceCategory(args2) {
880493
- return readString55(args2.categoryId || args2.category || args2.target) || undefined;
880705
+ return readString56(args2.categoryId || args2.category || args2.target) || undefined;
880494
880706
  }
880495
880707
  function settingsTarget(args2) {
880496
- return readString55(args2.target || args2.key || args2.prefix) || undefined;
880708
+ return readString56(args2.target || args2.key || args2.prefix) || undefined;
880497
880709
  }
880498
880710
  var UI_SURFACES = [
880499
880711
  {
@@ -880744,19 +880956,19 @@ function totalHarnessUiSurfaces() {
880744
880956
  return UI_SURFACES.length;
880745
880957
  }
880746
880958
  function listHarnessUiSurfaces(context, args2) {
880747
- const query2 = readString55(args2.query);
880959
+ const query2 = readString56(args2.query);
880748
880960
  const limit3 = readLimit9(args2.limit, 200);
880749
880961
  return UI_SURFACES.map((surface) => describeSurface(context, surface)).filter((surface) => surfaceMatches(surface, query2)).slice(0, limit3);
880750
880962
  }
880751
880963
  function describeHarnessUiSurface(context, args2) {
880752
- const surfaceId = readString55(args2.surfaceId || args2.query);
880964
+ const surfaceId = readString56(args2.surfaceId || args2.query);
880753
880965
  if (!surfaceId)
880754
880966
  return null;
880755
880967
  const surface = UI_SURFACES.find((entry) => entry.id === surfaceId || entry.label.toLowerCase() === surfaceId.toLowerCase());
880756
880968
  return surface ? describeSurface(context, surface) : null;
880757
880969
  }
880758
880970
  function openHarnessUiSurface(context, args2) {
880759
- const surfaceId = readString55(args2.surfaceId || args2.query);
880971
+ const surfaceId = readString56(args2.surfaceId || args2.query);
880760
880972
  const surface = UI_SURFACES.find((entry) => entry.id === surfaceId || entry.label.toLowerCase() === surfaceId.toLowerCase());
880761
880973
  if (!surface) {
880762
880974
  return {
@@ -880775,7 +880987,7 @@ function openHarnessUiSurface(context, args2) {
880775
880987
  function isMode(value) {
880776
880988
  return typeof value === "string" && AGENT_HARNESS_MODES.includes(value);
880777
880989
  }
880778
- function readString56(value) {
880990
+ function readString57(value) {
880779
880991
  return typeof value === "string" ? value.trim() : "";
880780
880992
  }
880781
880993
  function readLimit10(value, fallback) {
@@ -880859,7 +881071,7 @@ function describeWorkspaceEditor(editor) {
880859
881071
  }
880860
881072
  function selectedRoutineFromArgs(snapshot, args2) {
880861
881073
  const fields = readFieldMap3(args2.fields);
880862
- const routineId = readString56(args2.recordId) || readString56(fields.routineId) || readString56(fields.id);
881074
+ const routineId = readString57(args2.recordId) || readString57(fields.routineId) || readString57(fields.id);
880863
881075
  if (!routineId)
880864
881076
  return null;
880865
881077
  return snapshot.localRoutines.find((routine) => routine.id === routineId || routine.name.toLowerCase() === routineId.toLowerCase()) ?? null;
@@ -880927,8 +881139,8 @@ function localEditorModelExecution(editorKind) {
880927
881139
  return "Use the command field, editor schema, or a first-class Agent model tool when available.";
880928
881140
  }
880929
881141
  function listWorkspaceActions(deps, args2) {
880930
- const query2 = readString56(args2.query);
880931
- const categoryId = readString56(args2.categoryId || args2.category);
881142
+ const query2 = readString57(args2.query);
881143
+ const categoryId = readString57(args2.categoryId || args2.category);
880932
881144
  const limit3 = readLimit10(args2.limit, 200);
880933
881145
  const includeEditor = args2.includeParameters === true;
880934
881146
  const editorContext = includeEditor ? buildWorkspaceEditorContext(deps.commandContext, args2) : null;
@@ -880936,8 +881148,8 @@ function listWorkspaceActions(deps, args2) {
880936
881148
  return source.filter((entry) => !categoryId || entry.category.id === categoryId).slice(0, limit3).map((entry) => describeWorkspaceAction(entry.category, entry.action, { includeEditor, editorContext }));
880937
881149
  }
880938
881150
  function findWorkspaceAction(args2) {
880939
- const actionId = readString56(args2.actionId || args2.query);
880940
- const categoryId = readString56(args2.categoryId || args2.category);
881151
+ const actionId = readString57(args2.actionId || args2.query);
881152
+ const categoryId = readString57(args2.categoryId || args2.category);
880941
881153
  if (!actionId)
880942
881154
  return null;
880943
881155
  return allWorkspaceActions().find((entry) => {
@@ -880947,12 +881159,12 @@ function findWorkspaceAction(args2) {
880947
881159
  }) ?? null;
880948
881160
  }
880949
881161
  function listCommands(commandRegistry, args2) {
880950
- const query2 = readString56(args2.query);
881162
+ const query2 = readString57(args2.query);
880951
881163
  const limit3 = readLimit10(args2.limit, 200);
880952
881164
  return commandRegistry.list().filter((command8) => commandMatches(command8, query2)).sort((a4, b3) => a4.name.localeCompare(b3.name)).slice(0, limit3).map(describeCommand);
880953
881165
  }
880954
881166
  function requireConfirmedAction(args2, action2) {
880955
- const explicitUserRequest = readString56(args2.explicitUserRequest);
881167
+ const explicitUserRequest = readString57(args2.explicitUserRequest);
880956
881168
  if (!explicitUserRequest)
880957
881169
  return `${action2} requires explicitUserRequest with the user's exact request or a short faithful summary.`;
880958
881170
  if (args2.confirm !== true)
@@ -880960,7 +881172,7 @@ function requireConfirmedAction(args2, action2) {
880960
881172
  return null;
880961
881173
  }
880962
881174
  function commandFromArgs(args2) {
880963
- const rawCommand = readString56(args2.command);
881175
+ const rawCommand = readString57(args2.command);
880964
881176
  if (rawCommand) {
880965
881177
  const parsed = parseSlashCommand(rawCommand);
880966
881178
  if (!parsed.name)
@@ -880970,7 +881182,7 @@ function commandFromArgs(args2) {
880970
881182
  args: parsed.args
880971
881183
  };
880972
881184
  }
880973
- const commandName = readString56(args2.commandName).replace(/^\//, "");
881185
+ const commandName = readString57(args2.commandName).replace(/^\//, "");
880974
881186
  if (!commandName)
880975
881187
  return null;
880976
881188
  const commandArgs = readStringArray12(args2.args);
@@ -881198,7 +881410,8 @@ function createAgentHarnessTool(deps) {
881198
881410
  workspace: 'Use mode:"workspace_actions" to list and mode:"workspace_action" for editor schemas; set includeParameters:true on workspace_actions to inline editor schemas.',
881199
881411
  settings: 'Use mode:"settings", mode:"get_setting", mode:"set_setting", and mode:"reset_setting".',
881200
881412
  tools: 'Use mode:"tools" with includeParameters:true to inspect first-class model tool schemas.',
881201
- connectedHost: 'Use mode:"connected_host" for the connected-host capability map and blocked boundaries.'
881413
+ connectedHost: 'Use mode:"connected_host" for the connected-host capability map and blocked boundaries.',
881414
+ connectedHostStatus: 'Use mode:"connected_host_status" for live read-only host reachability, SDK compatibility, token posture, and Agent Knowledge route readiness.'
881202
881415
  },
881203
881416
  settingsPolicy: settingsPolicySummary(),
881204
881417
  connectedHost: connectedHostSummary(deps.commandContext, deps.toolRegistry)
@@ -881228,7 +881441,7 @@ function createAgentHarnessTool(deps) {
881228
881441
  }
881229
881442
  if (args2.mode === "panel") {
881230
881443
  const panel = describeHarnessPanel(deps.commandContext, args2);
881231
- return panel ? output7(panel) : error52(`Unknown panel ${readString56(args2.panelId || args2.query) || "<missing>"}.`);
881444
+ return panel ? output7(panel) : error52(`Unknown panel ${readString57(args2.panelId || args2.query) || "<missing>"}.`);
881232
881445
  }
881233
881446
  if (args2.mode === "open_panel") {
881234
881447
  const confirmationError2 = requireConfirmedAction(args2, "Panel routing");
@@ -881242,7 +881455,7 @@ function createAgentHarnessTool(deps) {
881242
881455
  }
881243
881456
  if (args2.mode === "ui_surface") {
881244
881457
  const surface = describeHarnessUiSurface(deps.commandContext, args2);
881245
- return surface ? output7(surface) : error52(`Unknown UI surface ${readString56(args2.surfaceId || args2.query) || "<missing>"}.`);
881458
+ return surface ? output7(surface) : error52(`Unknown UI surface ${readString57(args2.surfaceId || args2.query) || "<missing>"}.`);
881246
881459
  }
881247
881460
  if (args2.mode === "open_ui_surface") {
881248
881461
  const confirmationError2 = requireConfirmedAction(args2, "UI surface routing");
@@ -881256,7 +881469,7 @@ function createAgentHarnessTool(deps) {
881256
881469
  return output7(listHarnessKeybindings(deps.commandContext, args2));
881257
881470
  if (args2.mode === "keybinding") {
881258
881471
  const binding = describeHarnessKeybinding(deps.commandContext, args2);
881259
- return binding ? output7(binding) : error52(`Unknown keybinding action ${readString56(args2.actionId || args2.key || args2.query) || "<missing>"}.`);
881472
+ return binding ? output7(binding) : error52(`Unknown keybinding action ${readString57(args2.actionId || args2.key || args2.query) || "<missing>"}.`);
881260
881473
  }
881261
881474
  if (args2.mode === "set_keybinding") {
881262
881475
  const confirmationError2 = requireConfirmedAction(args2, "Keybinding mutation");
@@ -881275,7 +881488,7 @@ function createAgentHarnessTool(deps) {
881275
881488
  return output7({ commands: commands3, returned: commands3.length, total: deps.commandRegistry.list().length });
881276
881489
  }
881277
881490
  if (args2.mode === "command") {
881278
- const name51 = readString56(args2.commandName).replace(/^\//, "");
881491
+ const name51 = readString57(args2.commandName).replace(/^\//, "");
881279
881492
  const command8 = name51 ? deps.commandRegistry.get(name51) : null;
881280
881493
  return command8 ? output7(describeCommand(command8)) : error52(`Unknown slash command /${name51 || "<missing>"}.`);
881281
881494
  }
@@ -881283,16 +881496,16 @@ function createAgentHarnessTool(deps) {
881283
881496
  return runCommand2(deps, args2);
881284
881497
  if (args2.mode === "settings") {
881285
881498
  const settings = listHarnessSettings(deps.commandContext.platform.configManager, {
881286
- category: readString56(args2.category) || undefined,
881287
- prefix: readString56(args2.prefix) || undefined,
881288
- query: readString56(args2.query) || undefined,
881499
+ category: readString57(args2.category) || undefined,
881500
+ prefix: readString57(args2.prefix) || undefined,
881501
+ query: readString57(args2.query) || undefined,
881289
881502
  includeHidden: args2.includeHidden === true,
881290
881503
  limit: readLimit10(args2.limit, 100)
881291
881504
  });
881292
881505
  return output7({ settings, returned: settings.length, policy: settingsPolicySummary() });
881293
881506
  }
881294
881507
  if (args2.mode === "get_setting") {
881295
- const key = readString56(args2.key);
881508
+ const key = readString57(args2.key);
881296
881509
  const setting = getHarnessSetting(deps.commandContext.platform.configManager, key);
881297
881510
  return setting ? output7(setting) : error52(`Unknown setting ${key || "<missing>"}.`);
881298
881511
  }
@@ -881302,7 +881515,7 @@ function createAgentHarnessTool(deps) {
881302
881515
  return error52(confirmationError2);
881303
881516
  if (args2.value === undefined)
881304
881517
  return error52("set_setting requires value.");
881305
- const key = readString56(args2.key);
881518
+ const key = readString57(args2.key);
881306
881519
  const result2 = await setHarnessSetting(deps.commandContext.platform.configManager, deps.commandContext.platform.secretsManager, key, args2.value);
881307
881520
  return output7(result2);
881308
881521
  }
@@ -881310,7 +881523,7 @@ function createAgentHarnessTool(deps) {
881310
881523
  const confirmationError2 = requireConfirmedAction(args2, "Setting reset");
881311
881524
  if (confirmationError2)
881312
881525
  return error52(confirmationError2);
881313
- const key = readString56(args2.key);
881526
+ const key = readString57(args2.key);
881314
881527
  const result2 = await resetHarnessSetting(deps.commandContext.platform.configManager, deps.commandContext.platform.secretsManager, key);
881315
881528
  return output7(result2);
881316
881529
  }
@@ -881327,7 +881540,7 @@ function createAgentHarnessTool(deps) {
881327
881540
  if (args2.mode === "workspace_action") {
881328
881541
  const found = findWorkspaceAction(args2);
881329
881542
  const editorContext = buildWorkspaceEditorContext(deps.commandContext, args2);
881330
- return found ? output7(describeWorkspaceAction(found.category, found.action, { includeEditor: true, editorContext })) : error52(`Unknown Agent workspace action ${readString56(args2.actionId || args2.query) || "<missing>"}.`);
881543
+ return found ? output7(describeWorkspaceAction(found.category, found.action, { includeEditor: true, editorContext })) : error52(`Unknown Agent workspace action ${readString57(args2.actionId || args2.query) || "<missing>"}.`);
881331
881544
  }
881332
881545
  if (args2.mode === "run_workspace_action")
881333
881546
  return runWorkspaceAction(deps, args2);
@@ -881337,6 +881550,8 @@ function createAgentHarnessTool(deps) {
881337
881550
  }
881338
881551
  if (args2.mode === "connected_host")
881339
881552
  return output7(connectedHostSummary(deps.commandContext, deps.toolRegistry));
881553
+ if (args2.mode === "connected_host_status")
881554
+ return output7(await connectedHostStatusSummary(deps.commandContext, deps.toolRegistry));
881340
881555
  return error52(`Unhandled agent_harness mode: ${args2.mode}`);
881341
881556
  } catch (err2) {
881342
881557
  return error52(formatHarnessError(err2));
@@ -883113,7 +883328,7 @@ var MAX_INPUT_LENGTH2 = exports_security2.MAX_INPUT_LENGTH;
883113
883328
  var MAX_TOKEN_COUNT2 = exports_security2.MAX_TOKEN_COUNT;
883114
883329
 
883115
883330
  // src/runtime/surface-feature-flags.ts
883116
- function isRecord42(value) {
883331
+ function isRecord43(value) {
883117
883332
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
883118
883333
  }
883119
883334
  function isFeatureFlagConfigKey(key) {
@@ -883130,7 +883345,7 @@ function readFeatureFlagConfigValue(config6, key) {
883130
883345
  }
883131
883346
  function mergeFeatureFlagConfigValue(config6, key, value) {
883132
883347
  if (key === "featureFlags") {
883133
- if (!isRecord42(value))
883348
+ if (!isRecord43(value))
883134
883349
  throw new Error("featureFlags expects an object value.");
883135
883350
  const patch2 = {};
883136
883351
  for (const [flagId, state3] of Object.entries(value)) {
@@ -883150,8 +883365,8 @@ function mergeFeatureFlagConfigValue(config6, key, value) {
883150
883365
 
883151
883366
  // src/runtime/onboarding/verify.ts
883152
883367
  init_config8();
883153
- import { existsSync as existsSync83 } from "fs";
883154
- import { join as join98 } from "path";
883368
+ import { existsSync as existsSync84 } from "fs";
883369
+ import { join as join99 } from "path";
883155
883370
  function getNow(deps) {
883156
883371
  return deps.clock?.() ?? Date.now();
883157
883372
  }
@@ -883232,7 +883447,7 @@ function verifyAuthOperation(_deps, operation) {
883232
883447
  }
883233
883448
  function verifyCreateAgentProfileOperation(deps, operation) {
883234
883449
  const resolution2 = resolveAgentRuntimeProfileHome(deps.shellPaths.homeDirectory, operation.name);
883235
- const ok3 = existsSync83(join98(resolution2.homeDirectory, "profile.json"));
883450
+ const ok3 = existsSync84(join99(resolution2.homeDirectory, "profile.json"));
883236
883451
  return {
883237
883452
  id: `agent-profile:${resolution2.id}`,
883238
883453
  status: ok3 ? "pass" : "fail",
@@ -883330,15 +883545,15 @@ async function verifyOnboardingRequest(deps, request2) {
883330
883545
  }
883331
883546
 
883332
883547
  // src/runtime/onboarding/apply-file-helpers.ts
883333
- import { existsSync as existsSync84, mkdirSync as mkdirSync68, readFileSync as readFileSync90, unlinkSync as unlinkSync11, writeFileSync as writeFileSync59 } from "fs";
883548
+ import { existsSync as existsSync85, mkdirSync as mkdirSync68, readFileSync as readFileSync91, unlinkSync as unlinkSync11, writeFileSync as writeFileSync59 } from "fs";
883334
883549
  import { dirname as dirname67 } from "path";
883335
883550
  function isPlainObject3(value) {
883336
883551
  return typeof value === "object" && value !== null && !Array.isArray(value);
883337
883552
  }
883338
883553
  function readJsonObject(path7) {
883339
- if (!existsSync84(path7))
883554
+ if (!existsSync85(path7))
883340
883555
  return {};
883341
- const parsed = JSON.parse(readFileSync90(path7, "utf-8"));
883556
+ const parsed = JSON.parse(readFileSync91(path7, "utf-8"));
883342
883557
  if (!isPlainObject3(parsed))
883343
883558
  throw new Error(`Expected an object JSON payload at ${path7}.`);
883344
883559
  return parsed;
@@ -883366,7 +883581,7 @@ function setNestedValue(root, key, value) {
883366
883581
  }
883367
883582
  function restoreFile(path7, previous, reload) {
883368
883583
  if (previous === null) {
883369
- if (existsSync84(path7))
883584
+ if (existsSync85(path7))
883370
883585
  unlinkSync11(path7);
883371
883586
  } else {
883372
883587
  mkdirSync68(dirname67(path7), { recursive: true });
@@ -883375,7 +883590,7 @@ function restoreFile(path7, previous, reload) {
883375
883590
  reload?.();
883376
883591
  }
883377
883592
  function snapshotFileRollback(path7, reload) {
883378
- const previous = existsSync84(path7) ? readFileSync90(path7, "utf-8") : null;
883593
+ const previous = existsSync85(path7) ? readFileSync91(path7, "utf-8") : null;
883379
883594
  return () => restoreFile(path7, previous, reload);
883380
883595
  }
883381
883596
  async function runRollbacks(rollbacks) {
@@ -883494,7 +883709,7 @@ function validateCreateAgentProfileOperation(deps, operation) {
883494
883709
  if (name51.length === 0)
883495
883710
  throw new Error("Agent profile name is required.");
883496
883711
  const resolution2 = resolveAgentRuntimeProfileHome(deps.shellPaths.homeDirectory, name51);
883497
- if (existsSync85(resolution2.homeDirectory)) {
883712
+ if (existsSync86(resolution2.homeDirectory)) {
883498
883713
  throw new Error(`Agent profile already exists: ${resolution2.id}`);
883499
883714
  }
883500
883715
  const templateId = operation.templateId?.trim();
@@ -883506,7 +883721,7 @@ function validateSelectAgentProfileOperation(deps, operation) {
883506
883721
  if (name51.length === 0)
883507
883722
  throw new Error("Agent profile name is required.");
883508
883723
  const resolution2 = resolveAgentRuntimeProfileHome(deps.shellPaths.homeDirectory, name51);
883509
- if (!existsSync85(resolution2.homeDirectory)) {
883724
+ if (!existsSync86(resolution2.homeDirectory)) {
883510
883725
  throw new Error(`Agent profile does not exist: ${resolution2.id}`);
883511
883726
  }
883512
883727
  }
@@ -883614,7 +883829,7 @@ async function buildSecretRollbackAction(deps, operation) {
883614
883829
  throw new Error(`Secret storage locations for ${scope} scope are unavailable.`);
883615
883830
  const snapshots = locations.map((location) => ({
883616
883831
  path: location.path,
883617
- previous: existsSync85(location.path) ? readFileSync91(location.path, "utf-8") : null
883832
+ previous: existsSync86(location.path) ? readFileSync92(location.path, "utf-8") : null
883618
883833
  }));
883619
883834
  return () => {
883620
883835
  for (const snapshot of snapshots)
@@ -883648,7 +883863,7 @@ async function buildRollbackAction(deps, operation) {
883648
883863
  if (operation.kind === "create-agent-profile") {
883649
883864
  const resolution2 = resolveAgentRuntimeProfileHome(deps.shellPaths.homeDirectory, operation.name);
883650
883865
  return () => {
883651
- if (existsSync85(resolution2.homeDirectory))
883866
+ if (existsSync86(resolution2.homeDirectory))
883652
883867
  rmSync10(resolution2.homeDirectory, { recursive: true, force: true });
883653
883868
  };
883654
883869
  }
@@ -883984,7 +884199,7 @@ async function applyOnboardingRequest(deps, request2) {
883984
884199
  };
883985
884200
  }
883986
884201
  // src/runtime/onboarding/markers.ts
883987
- import { existsSync as existsSync86, mkdirSync as mkdirSync69, readFileSync as readFileSync92, writeFileSync as writeFileSync60 } from "fs";
884202
+ import { existsSync as existsSync87, mkdirSync as mkdirSync69, readFileSync as readFileSync93, writeFileSync as writeFileSync60 } from "fs";
883988
884203
  import { dirname as dirname68 } from "path";
883989
884204
  var ONBOARDING_CHECK_MARKER_FILE = "onboarding-checked.json";
883990
884205
  function resolveMarkerPath(shellPaths3, scope) {
@@ -884028,10 +884243,10 @@ function getOnboardingCheckMarkerPath(shellPaths3, scope = "user") {
884028
884243
  }
884029
884244
  function readOnboardingCheckMarker(shellPaths3, scope = "user") {
884030
884245
  const path7 = resolveMarkerPath(shellPaths3, scope);
884031
- if (!existsSync86(path7))
884246
+ if (!existsSync87(path7))
884032
884247
  return buildMissingMarkerState(scope, path7);
884033
884248
  try {
884034
- const parsed = JSON.parse(readFileSync92(path7, "utf-8"));
884249
+ const parsed = JSON.parse(readFileSync93(path7, "utf-8"));
884035
884250
  if (!isCheckMarkerPayload(parsed)) {
884036
884251
  return buildParseErrorState(scope, path7, "Invalid onboarding check marker payload.");
884037
884252
  }
@@ -884073,7 +884288,7 @@ function writeOnboardingCheckMarker(shellPaths3, options = {}) {
884073
884288
  return readOnboardingCheckMarker(shellPaths3, scope);
884074
884289
  }
884075
884290
  // src/input/handler-content-actions.ts
884076
- import { existsSync as existsSync87, lstatSync as lstatSync3, readFileSync as readFileSync93, readdirSync as readdirSync22 } from "fs";
884291
+ import { existsSync as existsSync88, lstatSync as lstatSync3, readFileSync as readFileSync94, readdirSync as readdirSync22 } from "fs";
884077
884292
  import { basename as basename6, relative as relative15 } from "path";
884078
884293
  var MARKER_REGEX = /\[(TEXT|IMAGE): [^\]]+\]/g;
884079
884294
  var IMAGE_PREFIXES = [
@@ -884133,7 +884348,7 @@ function readContextFileBlock(reference, projectRoot) {
884133
884348
  logger.debug("expandPrompt: context reference rejected", { reference, error: summarizeError(error53) });
884134
884349
  return null;
884135
884350
  }
884136
- if (!existsSync87(resolvedPath3))
884351
+ if (!existsSync88(resolvedPath3))
884137
884352
  return null;
884138
884353
  const stat6 = lstatSync3(resolvedPath3);
884139
884354
  const label = escapeContextAttribute(relative15(projectRoot, resolvedPath3) || basename6(resolvedPath3));
@@ -884152,14 +884367,14 @@ function readContextFileBlock(reference, projectRoot) {
884152
884367
  if (stat6.size > MAX_CONTEXT_FILE_BYTES) {
884153
884368
  return [
884154
884369
  `<context-file path="${label}" truncated="true" bytes="${stat6.size}">`,
884155
- readFileSync93(resolvedPath3, "utf-8").slice(0, MAX_CONTEXT_FILE_BYTES),
884370
+ readFileSync94(resolvedPath3, "utf-8").slice(0, MAX_CONTEXT_FILE_BYTES),
884156
884371
  "</context-file>"
884157
884372
  ].join(`
884158
884373
  `);
884159
884374
  }
884160
884375
  return [
884161
884376
  `<context-file path="${label}" bytes="${stat6.size}">`,
884162
- readFileSync93(resolvedPath3, "utf-8"),
884377
+ readFileSync94(resolvedPath3, "utf-8"),
884163
884378
  "</context-file>"
884164
884379
  ].join(`
884165
884380
  `);
@@ -884216,8 +884431,8 @@ function registerPaste(state4, content, projectRoot) {
884216
884431
  if (IMAGE_EXTENSIONS2.some((ext) => trimmed2.toLowerCase().endsWith(ext))) {
884217
884432
  try {
884218
884433
  const resolvedPath3 = resolveAndValidatePath(trimmed2, projectRoot);
884219
- if (existsSync87(resolvedPath3)) {
884220
- const data = readFileSync93(resolvedPath3);
884434
+ if (existsSync88(resolvedPath3)) {
884435
+ const data = readFileSync94(resolvedPath3);
884221
884436
  const base644 = data.toString("base64");
884222
884437
  const ext = trimmed2.slice(trimmed2.lastIndexOf("."));
884223
884438
  const mediaType = mediaTypeFromExt(ext);
@@ -884267,7 +884482,7 @@ function expandPrompt(pasteRegistry, imageRegistry, text, projectRoot) {
884267
884482
  const filePath = injectMatch[1];
884268
884483
  try {
884269
884484
  const resolvedPath3 = resolveAndValidatePath(filePath, projectRoot);
884270
- const content = readFileSync93(resolvedPath3, "utf-8");
884485
+ const content = readFileSync94(resolvedPath3, "utf-8");
884271
884486
  expanded = expanded.slice(0, injectMatch.index) + content + expanded.slice(injectMatch.index + injectMatch[0].length);
884272
884487
  injectRegex.lastIndex = injectMatch.index + content.length;
884273
884488
  } catch (err2) {
@@ -885605,7 +885820,7 @@ class AutocompleteEngine {
885605
885820
 
885606
885821
  // src/input/file-picker.ts
885607
885822
  import { readdir as readdir6 } from "fs/promises";
885608
- import { join as join99, relative as relative16 } from "path";
885823
+ import { join as join100, relative as relative16 } from "path";
885609
885824
 
885610
885825
  class FilePickerModal {
885611
885826
  shellPaths;
@@ -885738,7 +885953,7 @@ class FilePickerModal {
885738
885953
  continue;
885739
885954
  if (entry.name === "node_modules" || entry.name === "dist")
885740
885955
  continue;
885741
- const fullPath = join99(dir, entry.name);
885956
+ const fullPath = join100(dir, entry.name);
885742
885957
  const relPath = relative16(this.shellPaths.workingDirectory, fullPath);
885743
885958
  if (entry.isDirectory()) {
885744
885959
  files.push(relPath + "/");
@@ -893540,7 +893755,7 @@ function handleProfilePickerToken(state4, token) {
893540
893755
  }
893541
893756
 
893542
893757
  // src/input/handler-picker-routes.ts
893543
- import { readFileSync as readFileSync94 } from "fs";
893758
+ import { readFileSync as readFileSync95 } from "fs";
893544
893759
 
893545
893760
  // src/renderer/model-picker-overlay.ts
893546
893761
  var MODEL_PICKER_CHROME_LINES = 7;
@@ -893832,7 +894047,7 @@ function handleFilePickerToken(state4, token) {
893832
894047
  throw new Error("working directory is unavailable");
893833
894048
  }
893834
894049
  const resolvedPath3 = resolveAndValidatePath(selected, projectRoot);
893835
- const data = readFileSync94(resolvedPath3);
894050
+ const data = readFileSync95(resolvedPath3);
893836
894051
  const base644 = data.toString("base64");
893837
894052
  const mediaType = state4.mediaTypeFromExt(ext);
893838
894053
  const filename = selected.split("/").pop() ?? selected;
@@ -899791,155 +900006,6 @@ function renderOnboardingCliStatus(options) {
899791
900006
  ].join(`
899792
900007
  `);
899793
900008
  }
899794
- // src/cli/external-runtime.ts
899795
- import { existsSync as existsSync88, readFileSync as readFileSync95 } from "fs";
899796
- import { join as join100 } from "path";
899797
- function isRecord43(value) {
899798
- return Boolean(value) && typeof value === "object" && !Array.isArray(value);
899799
- }
899800
- function readString57(record2, key) {
899801
- const value = record2?.[key];
899802
- return typeof value === "string" ? value : null;
899803
- }
899804
- function resolveBaseUrl2(configManager) {
899805
- const host = String(configManager.get("controlPlane.host") ?? "127.0.0.1");
899806
- const port = Number(configManager.get("controlPlane.port") ?? 3421);
899807
- return `http://${host}:${Number.isFinite(port) ? port : 3421}`;
899808
- }
899809
- function readOperatorToken2(homeDirectory) {
899810
- const path7 = join100(homeDirectory, ".goodvibes", "daemon", "operator-tokens.json");
899811
- if (!existsSync88(path7))
899812
- return { token: null, path: path7 };
899813
- try {
899814
- const parsed = JSON.parse(readFileSync95(path7, "utf-8"));
899815
- const token = isRecord43(parsed) && typeof parsed.token === "string" ? parsed.token : null;
899816
- return { token, path: path7 };
899817
- } catch {
899818
- return { token: null, path: path7 };
899819
- }
899820
- }
899821
- async function fetchJson2(url2, token, timeoutMs) {
899822
- const controller = new AbortController;
899823
- const timer = setTimeout(() => controller.abort(), timeoutMs);
899824
- try {
899825
- const response5 = await fetch(url2, {
899826
- headers: token ? { authorization: `Bearer ${token}` } : undefined,
899827
- signal: controller.signal
899828
- });
899829
- const text = await response5.text();
899830
- let body2 = text;
899831
- if (text.trim().length > 0) {
899832
- try {
899833
- body2 = JSON.parse(text);
899834
- } catch {
899835
- body2 = text;
899836
- }
899837
- }
899838
- return { ok: response5.ok, status: response5.status, body: body2 };
899839
- } finally {
899840
- clearTimeout(timer);
899841
- }
899842
- }
899843
- async function inspectCliExternalRuntime(options) {
899844
- const baseUrl = resolveBaseUrl2(options.configManager);
899845
- const token = readOperatorToken2(options.homeDirectory);
899846
- const timeoutMs = options.timeoutMs ?? 1500;
899847
- const route = "/api/goodvibes-agent/knowledge/status";
899848
- try {
899849
- const status = await fetchJson2(`${baseUrl}/status`, token.token, timeoutMs);
899850
- const statusRecord = isRecord43(status.body) ? status.body : {};
899851
- const version6 = readString57(statusRecord, "version") ?? "unknown";
899852
- const compatible = status.ok && version6 === SDK_VERSION;
899853
- if (!status.ok) {
899854
- return {
899855
- baseUrl,
899856
- statusCode: status.status,
899857
- reachable: false,
899858
- version: version6,
899859
- expectedVersion: SDK_VERSION,
899860
- compatible: false,
899861
- operatorToken: { present: Boolean(token.token), path: token.path },
899862
- agentKnowledge: {
899863
- route,
899864
- ready: false,
899865
- kind: status.status === 401 ? "auth_required" : "connected_host_unavailable",
899866
- statusCode: status.status
899867
- },
899868
- error: typeof status.body === "string" ? status.body : `HTTP ${status.status}`
899869
- };
899870
- }
899871
- if (!token.token) {
899872
- return {
899873
- baseUrl,
899874
- statusCode: status.status,
899875
- reachable: true,
899876
- version: version6,
899877
- expectedVersion: SDK_VERSION,
899878
- compatible,
899879
- operatorToken: { present: false, path: token.path },
899880
- agentKnowledge: {
899881
- route,
899882
- ready: false,
899883
- kind: "auth_required",
899884
- statusCode: null
899885
- },
899886
- error: null
899887
- };
899888
- }
899889
- if (!compatible) {
899890
- return {
899891
- baseUrl,
899892
- statusCode: status.status,
899893
- reachable: true,
899894
- version: version6,
899895
- expectedVersion: SDK_VERSION,
899896
- compatible: false,
899897
- operatorToken: { present: true, path: token.path },
899898
- agentKnowledge: {
899899
- route,
899900
- ready: false,
899901
- kind: "version_mismatch",
899902
- statusCode: null
899903
- },
899904
- error: null
899905
- };
899906
- }
899907
- const knowledge2 = await fetchJson2(`${baseUrl}${route}`, token.token, timeoutMs);
899908
- return {
899909
- baseUrl,
899910
- statusCode: status.status,
899911
- reachable: true,
899912
- version: version6,
899913
- expectedVersion: SDK_VERSION,
899914
- compatible,
899915
- operatorToken: { present: true, path: token.path },
899916
- agentKnowledge: {
899917
- route,
899918
- ready: knowledge2.ok,
899919
- kind: knowledge2.ok ? "ok" : knowledge2.status === 401 ? "auth_required" : knowledge2.status === 404 ? "connected_host_route_unavailable" : "connected_host_error",
899920
- statusCode: knowledge2.status
899921
- },
899922
- error: knowledge2.ok ? null : typeof knowledge2.body === "string" ? knowledge2.body : `HTTP ${knowledge2.status}`
899923
- };
899924
- } catch (error53) {
899925
- return {
899926
- baseUrl,
899927
- statusCode: null,
899928
- reachable: false,
899929
- version: "unknown",
899930
- expectedVersion: SDK_VERSION,
899931
- compatible: false,
899932
- operatorToken: { present: Boolean(token.token), path: token.path },
899933
- agentKnowledge: {
899934
- route,
899935
- ready: false,
899936
- kind: "connected_host_unavailable",
899937
- statusCode: null
899938
- },
899939
- error: summarizeError(error53)
899940
- };
899941
- }
899942
- }
899943
900009
  // src/cli/completion.ts
899944
900010
  var COMMANDS = [
899945
900011
  "run",