@pellux/goodvibes-agent 1.0.4 → 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.
- package/CHANGELOG.md +11 -0
- package/README.md +3 -3
- package/dist/package/main.js +830 -418
- package/docs/README.md +1 -1
- package/docs/connected-host.md +2 -0
- package/docs/getting-started.md +3 -3
- package/docs/tools-and-commands.md +5 -3
- package/package.json +1 -1
- package/src/tools/agent-harness-connected-host-status.ts +146 -0
- package/src/tools/agent-harness-metadata.ts +1 -0
- package/src/tools/agent-harness-tool-schema.ts +127 -0
- package/src/tools/agent-harness-tool.ts +27 -122
- package/src/tools/agent-harness-ui-surface-metadata.ts +343 -0
- package/src/version.ts +1 -1
package/dist/package/main.js
CHANGED
|
@@ -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
|
|
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 =
|
|
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: () =>
|
|
731509
|
-
stabilizeKnowledgeText: () =>
|
|
731510
|
-
runKnowledgeSemanticSelfImprovement: () =>
|
|
731450
|
+
uniqKnowledgeValues: () => uniq3,
|
|
731451
|
+
stabilizeKnowledgeText: () => stableText2,
|
|
731452
|
+
runKnowledgeSemanticSelfImprovement: () => runKnowledgeSemanticSelfImprovement2,
|
|
731511
731453
|
resolveProjectPlanningSpace: () => resolveProjectPlanningSpace,
|
|
731512
|
-
resolveKnowledgeDbPathFromControlPlaneDir: () =>
|
|
731454
|
+
resolveKnowledgeDbPathFromControlPlaneDir: () => resolveKnowledgeDbPathFromControlPlaneDir2,
|
|
731513
731455
|
renderPacket: () => renderPacket,
|
|
731514
731456
|
renderKnowledgeSchemaSql: () => renderKnowledgeSchemaSql,
|
|
731515
731457
|
renderKnowledgeMap: () => renderKnowledgeMap,
|
|
731516
731458
|
readKnowledgeSearchText: () => readKnowledgeSearchText,
|
|
731517
|
-
readBrowserKnowledgeProfile: () =>
|
|
731459
|
+
readBrowserKnowledgeProfile: () => readBrowserKnowledgeProfile2,
|
|
731518
731460
|
projectPlanningSourceId: () => projectPlanningSourceId,
|
|
731519
731461
|
projectPlanningProjectIdFromPath: () => projectPlanningProjectIdFromPath,
|
|
731520
731462
|
projectPlanningCanonicalUri: () => projectPlanningCanonicalUri,
|
|
731521
731463
|
projectKnowledgeSpaceId: () => projectKnowledgeSpaceId,
|
|
731522
|
-
parseKnowledgeJsonValue: () =>
|
|
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: () =>
|
|
731472
|
+
loadKnowledgeStoreSnapshot: () => loadKnowledgeStoreSnapshot2,
|
|
731531
731473
|
listGeneratedKnowledgePages: () => listGeneratedKnowledgePages,
|
|
731532
|
-
listBrowserKinds: () =>
|
|
731474
|
+
listBrowserKinds: () => listBrowserKinds2,
|
|
731533
731475
|
knowledgeSpaceMetadata: () => knowledgeSpaceMetadata,
|
|
731534
731476
|
knowledgePageSourceWeight: () => knowledgePageSourceWeight,
|
|
731535
|
-
knowledgeNowMs: () =>
|
|
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: () =>
|
|
731556
|
-
discoverBrowserKnowledgeProfiles: () =>
|
|
731497
|
+
evaluateProjectPlanningReadiness: () => evaluateProjectPlanningReadiness2,
|
|
731498
|
+
discoverBrowserKnowledgeProfiles: () => discoverBrowserKnowledgeProfiles2,
|
|
731557
731499
|
createWebKnowledgeGapRepairer: () => createWebKnowledgeGapRepairer,
|
|
731558
731500
|
createProviderBackedKnowledgeSemanticLlm: () => createProviderBackedKnowledgeSemanticLlm,
|
|
731559
731501
|
createMemoryApi: () => createMemoryApi,
|
|
731560
|
-
createKnowledgeSchema: () =>
|
|
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,
|
|
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 ?
|
|
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.
|
|
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
|
|
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
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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:
|
|
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 =
|
|
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 =
|
|
839614
|
+
const time4 = nowMs3();
|
|
839673
839615
|
return {
|
|
839674
839616
|
id: createPlanId(this.options.projectId, this.options.projectRoot),
|
|
839675
839617
|
projectId: this.options.projectId,
|
|
@@ -847775,13 +847717,13 @@ init_state3();
|
|
|
847775
847717
|
|
|
847776
847718
|
// src/input/commands/recall-shared.ts
|
|
847777
847719
|
var VALID_CLASSES = ["decision", "constraint", "incident", "pattern", "fact", "risk", "runbook", "architecture", "ownership"];
|
|
847778
|
-
var
|
|
847720
|
+
var VALID_SCOPES2 = ["session", "project", "team"];
|
|
847779
847721
|
var VALID_REVIEW_STATES = ["fresh", "reviewed", "stale", "contradicted"];
|
|
847780
847722
|
function isValidClass(s4) {
|
|
847781
847723
|
return VALID_CLASSES.includes(s4);
|
|
847782
847724
|
}
|
|
847783
847725
|
function isValidScope(s4) {
|
|
847784
|
-
return
|
|
847726
|
+
return VALID_SCOPES2.includes(s4);
|
|
847785
847727
|
}
|
|
847786
847728
|
function isValidReviewState(s4) {
|
|
847787
847729
|
return VALID_REVIEW_STATES.includes(s4);
|
|
@@ -847824,7 +847766,7 @@ function handleRecallSearch(args2, context) {
|
|
|
847824
847766
|
if (isValidScope(scope))
|
|
847825
847767
|
filter.scope = scope;
|
|
847826
847768
|
else {
|
|
847827
|
-
context.print(`[memory] Unknown scope "${scope}". Valid values ${
|
|
847769
|
+
context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES2.join(", ")}.`);
|
|
847828
847770
|
return;
|
|
847829
847771
|
}
|
|
847830
847772
|
}
|
|
@@ -847999,7 +847941,7 @@ function handleRecallList(args2, context) {
|
|
|
847999
847941
|
if (scopeIdx !== -1 && args2[scopeIdx + 1]) {
|
|
848000
847942
|
const scope = args2[scopeIdx + 1];
|
|
848001
847943
|
if (!isValidScope(scope)) {
|
|
848002
|
-
context.print(`[memory] Unknown scope "${scope}". Valid values ${
|
|
847944
|
+
context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES2.join(", ")}.`);
|
|
848003
847945
|
return;
|
|
848004
847946
|
}
|
|
848005
847947
|
filter.scope = scope;
|
|
@@ -848049,7 +847991,7 @@ async function handleRecallAdd(args2, context) {
|
|
|
848049
847991
|
const tags = tagsRaw ? tagsRaw.split(",").map((token) => token.trim()).filter(Boolean) : [];
|
|
848050
847992
|
const scope = scopeRaw && isValidScope(scopeRaw) ? scopeRaw : "project";
|
|
848051
847993
|
if (scopeRaw && !isValidScope(scopeRaw)) {
|
|
848052
|
-
context.print(`[memory] Invalid scope "${scopeRaw}". Valid values ${
|
|
847994
|
+
context.print(`[memory] Invalid scope "${scopeRaw}". Valid values ${VALID_SCOPES2.join(", ")}.`);
|
|
848053
847995
|
return;
|
|
848054
847996
|
}
|
|
848055
847997
|
const provenance = [];
|
|
@@ -848183,7 +848125,7 @@ function handleRecallExport(args2, context) {
|
|
|
848183
848125
|
if (scopeIdx !== -1 && commandArgs[scopeIdx + 1]) {
|
|
848184
848126
|
const scope = commandArgs[scopeIdx + 1];
|
|
848185
848127
|
if (!isValidScope(scope)) {
|
|
848186
|
-
context.print(`[memory] Unknown scope "${scope}". Valid values ${
|
|
848128
|
+
context.print(`[memory] Unknown scope "${scope}". Valid values ${VALID_SCOPES2.join(", ")}.`);
|
|
848187
848129
|
return;
|
|
848188
848130
|
}
|
|
848189
848131
|
filter.scope = scope;
|
|
@@ -848262,7 +848204,7 @@ function handleRecallHandoffExport(args2, context) {
|
|
|
848262
848204
|
const scopeIdx = commandArgs.indexOf("--scope");
|
|
848263
848205
|
const scopeRaw = scopeIdx !== -1 ? commandArgs[scopeIdx + 1] : "team";
|
|
848264
848206
|
if (!scopeRaw || !isValidScope(scopeRaw)) {
|
|
848265
|
-
context.print(`[memory] Unknown scope "${scopeRaw ?? ""}". Valid values ${
|
|
848207
|
+
context.print(`[memory] Unknown scope "${scopeRaw ?? ""}". Valid values ${VALID_SCOPES2.join(", ")}.`);
|
|
848266
848208
|
return;
|
|
848267
848209
|
}
|
|
848268
848210
|
const bundle = memory.exportBundle({ scope: scopeRaw });
|
|
@@ -848378,7 +848320,7 @@ function handleRecallPromote(args2, context) {
|
|
|
848378
848320
|
const id = parsed.rest[0];
|
|
848379
848321
|
const scope = parsed.rest[1];
|
|
848380
848322
|
if (!id || !scope || !isValidScope(scope)) {
|
|
848381
|
-
context.print(`[memory] Usage: /memory promote <id> <${
|
|
848323
|
+
context.print(`[memory] Usage: /memory promote <id> <${VALID_SCOPES2.join("|")}> --yes`);
|
|
848382
848324
|
return;
|
|
848383
848325
|
}
|
|
848384
848326
|
if (!parsed.yes) {
|
|
@@ -862154,7 +862096,7 @@ import { mkdirSync as mkdirSync64, readFileSync as readFileSync86, writeFileSync
|
|
|
862154
862096
|
import { dirname as dirname63, resolve as resolve39 } from "path";
|
|
862155
862097
|
init_state3();
|
|
862156
862098
|
var VALID_CLASSES2 = ["decision", "constraint", "incident", "pattern", "fact", "risk", "runbook", "architecture", "ownership"];
|
|
862157
|
-
var
|
|
862099
|
+
var VALID_SCOPES4 = ["session", "project", "team"];
|
|
862158
862100
|
var VALID_REVIEW_STATES3 = ["fresh", "reviewed", "stale", "contradicted"];
|
|
862159
862101
|
var VALID_PROVENANCE_KINDS = ["session", "turn", "task", "event", "file"];
|
|
862160
862102
|
var VALUE_OPTIONS = new Set([
|
|
@@ -862254,7 +862196,7 @@ function isMemoryClass2(value) {
|
|
|
862254
862196
|
return VALID_CLASSES2.includes(value);
|
|
862255
862197
|
}
|
|
862256
862198
|
function isMemoryScope2(value) {
|
|
862257
|
-
return
|
|
862199
|
+
return VALID_SCOPES4.includes(value);
|
|
862258
862200
|
}
|
|
862259
862201
|
function isReviewState(value) {
|
|
862260
862202
|
return VALID_REVIEW_STATES3.includes(value);
|
|
@@ -862269,7 +862211,7 @@ function requireClass(value) {
|
|
|
862269
862211
|
}
|
|
862270
862212
|
function requireScope(value) {
|
|
862271
862213
|
if (!value || !isMemoryScope2(value))
|
|
862272
|
-
throw new Error(`Invalid memory scope "${value ?? ""}". Valid values ${
|
|
862214
|
+
throw new Error(`Invalid memory scope "${value ?? ""}". Valid values ${VALID_SCOPES4.join(", ")}`);
|
|
862273
862215
|
return value;
|
|
862274
862216
|
}
|
|
862275
862217
|
function optionalScope(value) {
|
|
@@ -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
|
|
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
|
|
880310
|
+
return readString54(args2.recordId ?? args2.id ?? fields.recordId ?? fields.id);
|
|
880100
880311
|
}
|
|
880101
880312
|
function requireConfirmed(args2, label) {
|
|
880102
|
-
if (!
|
|
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:
|
|
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:
|
|
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
|
|
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 =
|
|
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(`
|
|
@@ -880306,14 +880517,17 @@ function listHarnessModelTools(toolRegistry, args2) {
|
|
|
880306
880517
|
}));
|
|
880307
880518
|
}
|
|
880308
880519
|
|
|
880309
|
-
// src/tools/agent-harness-tool.ts
|
|
880310
|
-
var
|
|
880520
|
+
// src/tools/agent-harness-tool-schema.ts
|
|
880521
|
+
var AGENT_HARNESS_MODES = [
|
|
880311
880522
|
"summary",
|
|
880312
880523
|
"cli_commands",
|
|
880313
880524
|
"cli_command",
|
|
880314
880525
|
"panels",
|
|
880315
880526
|
"panel",
|
|
880316
880527
|
"open_panel",
|
|
880528
|
+
"ui_surfaces",
|
|
880529
|
+
"ui_surface",
|
|
880530
|
+
"open_ui_surface",
|
|
880317
880531
|
"shortcuts",
|
|
880318
880532
|
"keybindings",
|
|
880319
880533
|
"keybinding",
|
|
@@ -880332,15 +880546,451 @@ var MODES = [
|
|
|
880332
880546
|
"workspace_action",
|
|
880333
880547
|
"run_workspace_action",
|
|
880334
880548
|
"tools",
|
|
880335
|
-
"connected_host"
|
|
880549
|
+
"connected_host",
|
|
880550
|
+
"connected_host_status"
|
|
880551
|
+
];
|
|
880552
|
+
var KEY_COMBO_PARAMETER_SCHEMA = {
|
|
880553
|
+
type: "object",
|
|
880554
|
+
properties: { key: { type: "string" }, ctrl: { type: "boolean" }, shift: { type: "boolean" }, alt: { type: "boolean" } },
|
|
880555
|
+
required: ["key"],
|
|
880556
|
+
additionalProperties: false
|
|
880557
|
+
};
|
|
880558
|
+
var AGENT_HARNESS_PARAMETER_PROPERTIES = {
|
|
880559
|
+
mode: {
|
|
880560
|
+
type: "string",
|
|
880561
|
+
enum: AGENT_HARNESS_MODES,
|
|
880562
|
+
description: "Harness operation to perform."
|
|
880563
|
+
},
|
|
880564
|
+
query: {
|
|
880565
|
+
type: "string",
|
|
880566
|
+
description: "Search text for command, setting, tool, or UI surface catalogs."
|
|
880567
|
+
},
|
|
880568
|
+
command: {
|
|
880569
|
+
type: "string",
|
|
880570
|
+
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".'
|
|
880571
|
+
},
|
|
880572
|
+
cliCommand: {
|
|
880573
|
+
type: "string",
|
|
880574
|
+
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.'
|
|
880575
|
+
},
|
|
880576
|
+
commandName: {
|
|
880577
|
+
type: "string",
|
|
880578
|
+
description: "Slash command root without the leading slash for mode command or run_command, or a top-level CLI command token for cli_command."
|
|
880579
|
+
},
|
|
880580
|
+
args: {
|
|
880581
|
+
type: "array",
|
|
880582
|
+
items: { type: "string" },
|
|
880583
|
+
description: "Slash command argument tokens for mode run_command when commandName is used."
|
|
880584
|
+
},
|
|
880585
|
+
categoryId: {
|
|
880586
|
+
type: "string",
|
|
880587
|
+
description: "Agent workspace category id for workspace action filtering or ui surface routing."
|
|
880588
|
+
},
|
|
880589
|
+
surfaceId: {
|
|
880590
|
+
type: "string",
|
|
880591
|
+
description: "UI surface id for ui_surface or open_ui_surface modes."
|
|
880592
|
+
},
|
|
880593
|
+
panelId: {
|
|
880594
|
+
type: "string",
|
|
880595
|
+
description: "Built-in panel id for panel or open_panel modes."
|
|
880596
|
+
},
|
|
880597
|
+
actionId: {
|
|
880598
|
+
type: "string",
|
|
880599
|
+
description: "Agent workspace action id for workspace_action or run_workspace_action, or keybinding action id for keybinding/set_keybinding/reset_keybinding."
|
|
880600
|
+
},
|
|
880601
|
+
fields: {
|
|
880602
|
+
type: "object",
|
|
880603
|
+
additionalProperties: { type: "string" },
|
|
880604
|
+
description: "Field values for run_workspace_action when the workspace action opens an editor form."
|
|
880605
|
+
},
|
|
880606
|
+
combo: {
|
|
880607
|
+
...KEY_COMBO_PARAMETER_SCHEMA,
|
|
880608
|
+
description: 'Single key combo for set_keybinding, for example { "key": "g", "ctrl": true }.'
|
|
880609
|
+
},
|
|
880610
|
+
combos: {
|
|
880611
|
+
type: "array",
|
|
880612
|
+
items: KEY_COMBO_PARAMETER_SCHEMA,
|
|
880613
|
+
description: "Multiple key combos for set_keybinding."
|
|
880614
|
+
},
|
|
880615
|
+
recordId: {
|
|
880616
|
+
type: "string",
|
|
880617
|
+
description: "Selected Agent-local record id for selection-based local workspace operations."
|
|
880618
|
+
},
|
|
880619
|
+
key: {
|
|
880620
|
+
type: "string",
|
|
880621
|
+
description: "Agent setting key for get_setting, set_setting, or reset_setting."
|
|
880622
|
+
},
|
|
880623
|
+
value: {
|
|
880624
|
+
anyOf: [
|
|
880625
|
+
{ type: "string" },
|
|
880626
|
+
{ type: "number" },
|
|
880627
|
+
{ type: "boolean" }
|
|
880628
|
+
],
|
|
880629
|
+
description: "Setting value for set_setting. Strings, booleans, numbers, and enum strings are accepted."
|
|
880630
|
+
},
|
|
880631
|
+
target: {
|
|
880632
|
+
type: "string",
|
|
880633
|
+
description: "Optional UI target, such as a model-picker target or settings target key."
|
|
880634
|
+
},
|
|
880635
|
+
category: {
|
|
880636
|
+
type: "string",
|
|
880637
|
+
description: "Setting category filter such as provider, behavior, tools, ui, tts, permissions, automation, or surfaces."
|
|
880638
|
+
},
|
|
880639
|
+
prefix: {
|
|
880640
|
+
type: "string",
|
|
880641
|
+
description: "Setting key prefix filter such as surfaces.slack."
|
|
880642
|
+
},
|
|
880643
|
+
includeHidden: {
|
|
880644
|
+
type: "boolean",
|
|
880645
|
+
description: "Include settings hidden from the Agent workspace because they are host-owned or non-Agent lifecycle settings."
|
|
880646
|
+
},
|
|
880647
|
+
includeParameters: {
|
|
880648
|
+
type: "boolean",
|
|
880649
|
+
description: "Include model tool JSON schemas in tools mode, or workspace editor field schemas in workspace_actions mode."
|
|
880650
|
+
},
|
|
880651
|
+
limit: {
|
|
880652
|
+
type: "number",
|
|
880653
|
+
description: "Maximum catalog entries to return."
|
|
880654
|
+
},
|
|
880655
|
+
pane: {
|
|
880656
|
+
type: "string",
|
|
880657
|
+
enum: ["top", "bottom"],
|
|
880658
|
+
description: "Preferred panel pane for open_panel when the current shell supports panel routing."
|
|
880659
|
+
},
|
|
880660
|
+
confirm: {
|
|
880661
|
+
type: "boolean",
|
|
880662
|
+
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."
|
|
880663
|
+
},
|
|
880664
|
+
explicitUserRequest: {
|
|
880665
|
+
type: "string",
|
|
880666
|
+
description: "Exact user request or faithful short summary authorizing a setting mutation or harness UI/command invocation."
|
|
880667
|
+
}
|
|
880668
|
+
};
|
|
880669
|
+
|
|
880670
|
+
// src/tools/agent-harness-ui-surface-metadata.ts
|
|
880671
|
+
function readString56(value) {
|
|
880672
|
+
return typeof value === "string" ? value.trim() : "";
|
|
880673
|
+
}
|
|
880674
|
+
function readLimit9(value, fallback) {
|
|
880675
|
+
const parsed = typeof value === "string" && value.trim() ? Number(value) : value;
|
|
880676
|
+
if (typeof parsed !== "number" || !Number.isFinite(parsed))
|
|
880677
|
+
return fallback;
|
|
880678
|
+
return Math.max(1, Math.min(500, Math.trunc(parsed)));
|
|
880679
|
+
}
|
|
880680
|
+
function routeUnavailable(surface) {
|
|
880681
|
+
return {
|
|
880682
|
+
status: "route_unavailable",
|
|
880683
|
+
surface: surface.id,
|
|
880684
|
+
note: "The current runtime did not provide the shell opener for this UI surface."
|
|
880685
|
+
};
|
|
880686
|
+
}
|
|
880687
|
+
function opened(surface, extra = {}) {
|
|
880688
|
+
return {
|
|
880689
|
+
status: "opened",
|
|
880690
|
+
surface: surface.id,
|
|
880691
|
+
kind: surface.kind,
|
|
880692
|
+
...extra,
|
|
880693
|
+
note: "UI routing was handed to the current Agent shell bridge."
|
|
880694
|
+
};
|
|
880695
|
+
}
|
|
880696
|
+
function optionalModelTarget(args2) {
|
|
880697
|
+
const target = readString56(args2.target);
|
|
880698
|
+
return target === "main" || target === "helper" || target === "tool" || target === "tts" ? target : undefined;
|
|
880699
|
+
}
|
|
880700
|
+
function optionalOnboardingMode(args2) {
|
|
880701
|
+
const target = readString56(args2.target);
|
|
880702
|
+
return target === "new" || target === "edit" || target === "reopen" ? target : undefined;
|
|
880703
|
+
}
|
|
880704
|
+
function workspaceCategory(args2) {
|
|
880705
|
+
return readString56(args2.categoryId || args2.category || args2.target) || undefined;
|
|
880706
|
+
}
|
|
880707
|
+
function settingsTarget(args2) {
|
|
880708
|
+
return readString56(args2.target || args2.key || args2.prefix) || undefined;
|
|
880709
|
+
}
|
|
880710
|
+
var UI_SURFACES = [
|
|
880711
|
+
{
|
|
880712
|
+
id: "agent-workspace",
|
|
880713
|
+
label: "Agent Workspace",
|
|
880714
|
+
kind: "workspace",
|
|
880715
|
+
summary: "Fullscreen operator workspace with setup, knowledge, local state, channels, automation, and delegation routes.",
|
|
880716
|
+
command: "/agent",
|
|
880717
|
+
preferredModelRoute: "Use workspace_actions/workspace_action/run_workspace_action for model operation; use open_ui_surface only to visibly navigate.",
|
|
880718
|
+
parameters: ["categoryId"],
|
|
880719
|
+
available: (context) => typeof context.openAgentWorkspace === "function",
|
|
880720
|
+
open: (context, args2) => {
|
|
880721
|
+
const surface = findSurfaceById("agent-workspace");
|
|
880722
|
+
if (!context.openAgentWorkspace)
|
|
880723
|
+
return routeUnavailable(surface);
|
|
880724
|
+
const categoryId = workspaceCategory(args2);
|
|
880725
|
+
context.openAgentWorkspace(categoryId);
|
|
880726
|
+
return opened(surface, { categoryId: categoryId ?? "default" });
|
|
880727
|
+
}
|
|
880728
|
+
},
|
|
880729
|
+
{
|
|
880730
|
+
id: "settings",
|
|
880731
|
+
label: "Settings",
|
|
880732
|
+
kind: "modal",
|
|
880733
|
+
summary: "Fullscreen settings workspace for Agent-owned configuration, subscriptions, secrets, MCP, tools, and surface settings.",
|
|
880734
|
+
command: "/settings",
|
|
880735
|
+
preferredModelRoute: "Use settings/get_setting/set_setting/reset_setting for model operation; use open_ui_surface only to visibly navigate.",
|
|
880736
|
+
parameters: ["target", "key", "prefix"],
|
|
880737
|
+
available: (context) => typeof context.openSettingsModal === "function",
|
|
880738
|
+
open: (context, args2) => {
|
|
880739
|
+
const surface = findSurfaceById("settings");
|
|
880740
|
+
if (!context.openSettingsModal)
|
|
880741
|
+
return routeUnavailable(surface);
|
|
880742
|
+
const target = settingsTarget(args2);
|
|
880743
|
+
context.openSettingsModal(target);
|
|
880744
|
+
return opened(surface, { target: target ?? "default" });
|
|
880745
|
+
}
|
|
880746
|
+
},
|
|
880747
|
+
{
|
|
880748
|
+
id: "mcp-workspace",
|
|
880749
|
+
label: "MCP Workspace",
|
|
880750
|
+
kind: "workspace",
|
|
880751
|
+
summary: "MCP server setup, trust posture, and tool inventory workspace.",
|
|
880752
|
+
command: "/mcp",
|
|
880753
|
+
preferredModelRoute: "Use workspace_actions, tools, and settings modes for model operation.",
|
|
880754
|
+
available: (context) => typeof context.openMcpWorkspace === "function",
|
|
880755
|
+
open: (context) => {
|
|
880756
|
+
const surface = findSurfaceById("mcp-workspace");
|
|
880757
|
+
if (!context.openMcpWorkspace)
|
|
880758
|
+
return routeUnavailable(surface);
|
|
880759
|
+
context.openMcpWorkspace();
|
|
880760
|
+
return opened(surface);
|
|
880761
|
+
}
|
|
880762
|
+
},
|
|
880763
|
+
{
|
|
880764
|
+
id: "model-picker",
|
|
880765
|
+
label: "Model Picker",
|
|
880766
|
+
kind: "picker",
|
|
880767
|
+
summary: "Interactive model picker for main, helper, tool, and TTS model routes.",
|
|
880768
|
+
command: "/model",
|
|
880769
|
+
preferredModelRoute: "Use settings mode for direct provider.model changes, or run_command /model with confirmation when a concrete model id is known.",
|
|
880770
|
+
parameters: ["target"],
|
|
880771
|
+
available: (context) => typeof context.openModelPicker === "function" || typeof context.openModelPickerWithTarget === "function",
|
|
880772
|
+
open: (context, args2) => {
|
|
880773
|
+
const surface = findSurfaceById("model-picker");
|
|
880774
|
+
const target = optionalModelTarget(args2);
|
|
880775
|
+
if (target && context.openModelPickerWithTarget) {
|
|
880776
|
+
const openedForTarget = context.openModelPickerWithTarget(target);
|
|
880777
|
+
return opened(surface, { target, openedForTarget });
|
|
880778
|
+
}
|
|
880779
|
+
if (!context.openModelPicker)
|
|
880780
|
+
return routeUnavailable(surface);
|
|
880781
|
+
context.openModelPicker();
|
|
880782
|
+
return opened(surface, { target: "main" });
|
|
880783
|
+
}
|
|
880784
|
+
},
|
|
880785
|
+
{
|
|
880786
|
+
id: "provider-picker",
|
|
880787
|
+
label: "Provider Picker",
|
|
880788
|
+
kind: "picker",
|
|
880789
|
+
summary: "Interactive provider picker for model route setup.",
|
|
880790
|
+
command: "/provider",
|
|
880791
|
+
preferredModelRoute: "Use settings mode for direct provider routing changes, or run confirmed slash-command mirrors for concrete provider changes.",
|
|
880792
|
+
parameters: ["target"],
|
|
880793
|
+
available: (context) => typeof context.openProviderPicker === "function" || typeof context.openProviderModelPickerWithTarget === "function",
|
|
880794
|
+
open: (context, args2) => {
|
|
880795
|
+
const surface = findSurfaceById("provider-picker");
|
|
880796
|
+
const target = optionalModelTarget(args2);
|
|
880797
|
+
if (target && context.openProviderModelPickerWithTarget) {
|
|
880798
|
+
context.openProviderModelPickerWithTarget(target);
|
|
880799
|
+
return opened(surface, { target });
|
|
880800
|
+
}
|
|
880801
|
+
if (!context.openProviderPicker)
|
|
880802
|
+
return routeUnavailable(surface);
|
|
880803
|
+
context.openProviderPicker();
|
|
880804
|
+
return opened(surface, { target: "main" });
|
|
880805
|
+
}
|
|
880806
|
+
},
|
|
880807
|
+
{
|
|
880808
|
+
id: "session-picker",
|
|
880809
|
+
label: "Session Picker",
|
|
880810
|
+
kind: "picker",
|
|
880811
|
+
summary: "Saved session browser and loader.",
|
|
880812
|
+
command: "/sessions",
|
|
880813
|
+
preferredModelRoute: "Use session slash-command mirrors with confirmation for concrete save/load/export actions.",
|
|
880814
|
+
available: (context) => typeof context.openSessionPicker === "function",
|
|
880815
|
+
open: (context) => {
|
|
880816
|
+
const surface = findSurfaceById("session-picker");
|
|
880817
|
+
if (!context.openSessionPicker)
|
|
880818
|
+
return routeUnavailable(surface);
|
|
880819
|
+
context.openSessionPicker();
|
|
880820
|
+
return opened(surface);
|
|
880821
|
+
}
|
|
880822
|
+
},
|
|
880823
|
+
{
|
|
880824
|
+
id: "profile-picker",
|
|
880825
|
+
label: "Profile Picker",
|
|
880826
|
+
kind: "picker",
|
|
880827
|
+
summary: "Agent profile picker for local isolated profile selection.",
|
|
880828
|
+
command: "/agent-profile",
|
|
880829
|
+
preferredModelRoute: "Use workspace profile actions or profile slash-command mirrors for concrete model operation.",
|
|
880830
|
+
available: (context) => typeof context.openProfilePicker === "function",
|
|
880831
|
+
open: (context) => {
|
|
880832
|
+
const surface = findSurfaceById("profile-picker");
|
|
880833
|
+
if (!context.openProfilePicker)
|
|
880834
|
+
return routeUnavailable(surface);
|
|
880835
|
+
context.openProfilePicker();
|
|
880836
|
+
return opened(surface);
|
|
880837
|
+
}
|
|
880838
|
+
},
|
|
880839
|
+
{
|
|
880840
|
+
id: "bookmark-modal",
|
|
880841
|
+
label: "Bookmarks",
|
|
880842
|
+
kind: "modal",
|
|
880843
|
+
summary: "Transcript bookmark browser.",
|
|
880844
|
+
command: "/bookmarks",
|
|
880845
|
+
preferredModelRoute: "Use slash-command mirrors for concrete bookmark inspection; opening is visible navigation only.",
|
|
880846
|
+
available: (context) => typeof context.openBookmarkModal === "function",
|
|
880847
|
+
open: (context) => {
|
|
880848
|
+
const surface = findSurfaceById("bookmark-modal");
|
|
880849
|
+
if (!context.openBookmarkModal)
|
|
880850
|
+
return routeUnavailable(surface);
|
|
880851
|
+
context.openBookmarkModal();
|
|
880852
|
+
return opened(surface);
|
|
880853
|
+
}
|
|
880854
|
+
},
|
|
880855
|
+
{
|
|
880856
|
+
id: "context-inspector",
|
|
880857
|
+
label: "Context Inspector",
|
|
880858
|
+
kind: "modal",
|
|
880859
|
+
summary: "Context-window usage and token breakdown inspector.",
|
|
880860
|
+
command: "/context",
|
|
880861
|
+
preferredModelRoute: "Use slash-command mirrors for text output; opening is visible navigation only.",
|
|
880862
|
+
available: (context) => typeof context.openContextInspector === "function",
|
|
880863
|
+
open: (context) => {
|
|
880864
|
+
const surface = findSurfaceById("context-inspector");
|
|
880865
|
+
if (!context.openContextInspector)
|
|
880866
|
+
return routeUnavailable(surface);
|
|
880867
|
+
context.openContextInspector();
|
|
880868
|
+
return opened(surface);
|
|
880869
|
+
}
|
|
880870
|
+
},
|
|
880871
|
+
{
|
|
880872
|
+
id: "help-overlay",
|
|
880873
|
+
label: "Help Overlay",
|
|
880874
|
+
kind: "overlay",
|
|
880875
|
+
summary: "Registry-driven command and shortcut help overlay.",
|
|
880876
|
+
command: "/help",
|
|
880877
|
+
preferredModelRoute: "Use commands/command and shortcuts modes for model-readable discovery.",
|
|
880878
|
+
available: (context) => typeof context.openHelpOverlay === "function",
|
|
880879
|
+
open: (context) => {
|
|
880880
|
+
const surface = findSurfaceById("help-overlay");
|
|
880881
|
+
if (!context.openHelpOverlay)
|
|
880882
|
+
return routeUnavailable(surface);
|
|
880883
|
+
context.openHelpOverlay();
|
|
880884
|
+
return opened(surface);
|
|
880885
|
+
}
|
|
880886
|
+
},
|
|
880887
|
+
{
|
|
880888
|
+
id: "shortcuts-overlay",
|
|
880889
|
+
label: "Shortcuts Overlay",
|
|
880890
|
+
kind: "overlay",
|
|
880891
|
+
summary: "Keyboard shortcut reference overlay.",
|
|
880892
|
+
command: "/shortcuts",
|
|
880893
|
+
preferredModelRoute: "Use shortcuts/keybindings modes for model-readable discovery and confirmed keybinding edits.",
|
|
880894
|
+
available: (context) => typeof context.openShortcutsOverlay === "function",
|
|
880895
|
+
open: (context) => {
|
|
880896
|
+
const surface = findSurfaceById("shortcuts-overlay");
|
|
880897
|
+
if (!context.openShortcutsOverlay)
|
|
880898
|
+
return routeUnavailable(surface);
|
|
880899
|
+
context.openShortcutsOverlay();
|
|
880900
|
+
return opened(surface);
|
|
880901
|
+
}
|
|
880902
|
+
},
|
|
880903
|
+
{
|
|
880904
|
+
id: "onboarding",
|
|
880905
|
+
label: "Onboarding Wizard",
|
|
880906
|
+
kind: "modal",
|
|
880907
|
+
summary: "First-run and setup review wizard for Agent readiness.",
|
|
880908
|
+
command: "/setup",
|
|
880909
|
+
preferredModelRoute: "Use workspace setup actions and settings modes for concrete model operation.",
|
|
880910
|
+
parameters: ["target=new|edit|reopen"],
|
|
880911
|
+
available: (context) => typeof context.openOnboardingWizard === "function",
|
|
880912
|
+
open: (context, args2) => {
|
|
880913
|
+
const surface = findSurfaceById("onboarding");
|
|
880914
|
+
if (!context.openOnboardingWizard)
|
|
880915
|
+
return routeUnavailable(surface);
|
|
880916
|
+
const mode = optionalOnboardingMode(args2);
|
|
880917
|
+
context.openOnboardingWizard(mode);
|
|
880918
|
+
return opened(surface, { mode: mode ?? "default" });
|
|
880919
|
+
}
|
|
880920
|
+
}
|
|
880336
880921
|
];
|
|
880922
|
+
function findSurfaceById(surfaceId) {
|
|
880923
|
+
return UI_SURFACES.find((surface) => surface.id === surfaceId);
|
|
880924
|
+
}
|
|
880925
|
+
function surfaceMatches(surface, query2) {
|
|
880926
|
+
if (!query2)
|
|
880927
|
+
return true;
|
|
880928
|
+
return [
|
|
880929
|
+
surface.id,
|
|
880930
|
+
surface.label,
|
|
880931
|
+
surface.kind,
|
|
880932
|
+
surface.summary,
|
|
880933
|
+
surface.command,
|
|
880934
|
+
surface.preferredModelRoute
|
|
880935
|
+
].map((value) => String(value ?? "")).join(`
|
|
880936
|
+
`).toLowerCase().includes(query2.toLowerCase());
|
|
880937
|
+
}
|
|
880938
|
+
function describeSurface(context, surface) {
|
|
880939
|
+
return {
|
|
880940
|
+
id: surface.id,
|
|
880941
|
+
label: surface.label,
|
|
880942
|
+
kind: surface.kind,
|
|
880943
|
+
summary: surface.summary,
|
|
880944
|
+
command: surface.command,
|
|
880945
|
+
preferredModelRoute: surface.preferredModelRoute,
|
|
880946
|
+
parameters: surface.parameters ?? [],
|
|
880947
|
+
available: surface.available(context),
|
|
880948
|
+
policy: {
|
|
880949
|
+
effect: "visible-ui-navigation",
|
|
880950
|
+
confirmation: 'agent_harness mode:"open_ui_surface" requires confirm:true and explicitUserRequest.',
|
|
880951
|
+
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."
|
|
880952
|
+
}
|
|
880953
|
+
};
|
|
880954
|
+
}
|
|
880955
|
+
function totalHarnessUiSurfaces() {
|
|
880956
|
+
return UI_SURFACES.length;
|
|
880957
|
+
}
|
|
880958
|
+
function listHarnessUiSurfaces(context, args2) {
|
|
880959
|
+
const query2 = readString56(args2.query);
|
|
880960
|
+
const limit3 = readLimit9(args2.limit, 200);
|
|
880961
|
+
return UI_SURFACES.map((surface) => describeSurface(context, surface)).filter((surface) => surfaceMatches(surface, query2)).slice(0, limit3);
|
|
880962
|
+
}
|
|
880963
|
+
function describeHarnessUiSurface(context, args2) {
|
|
880964
|
+
const surfaceId = readString56(args2.surfaceId || args2.query);
|
|
880965
|
+
if (!surfaceId)
|
|
880966
|
+
return null;
|
|
880967
|
+
const surface = UI_SURFACES.find((entry) => entry.id === surfaceId || entry.label.toLowerCase() === surfaceId.toLowerCase());
|
|
880968
|
+
return surface ? describeSurface(context, surface) : null;
|
|
880969
|
+
}
|
|
880970
|
+
function openHarnessUiSurface(context, args2) {
|
|
880971
|
+
const surfaceId = readString56(args2.surfaceId || args2.query);
|
|
880972
|
+
const surface = UI_SURFACES.find((entry) => entry.id === surfaceId || entry.label.toLowerCase() === surfaceId.toLowerCase());
|
|
880973
|
+
if (!surface) {
|
|
880974
|
+
return {
|
|
880975
|
+
status: "unknown_ui_surface",
|
|
880976
|
+
surfaceId: surfaceId || "<missing>",
|
|
880977
|
+
availableSurfaces: UI_SURFACES.map((entry) => entry.id)
|
|
880978
|
+
};
|
|
880979
|
+
}
|
|
880980
|
+
return {
|
|
880981
|
+
...surface.open(context, args2),
|
|
880982
|
+
descriptor: describeSurface(context, surface)
|
|
880983
|
+
};
|
|
880984
|
+
}
|
|
880985
|
+
|
|
880986
|
+
// src/tools/agent-harness-tool.ts
|
|
880337
880987
|
function isMode(value) {
|
|
880338
|
-
return typeof value === "string" &&
|
|
880988
|
+
return typeof value === "string" && AGENT_HARNESS_MODES.includes(value);
|
|
880339
880989
|
}
|
|
880340
|
-
function
|
|
880990
|
+
function readString57(value) {
|
|
880341
880991
|
return typeof value === "string" ? value.trim() : "";
|
|
880342
880992
|
}
|
|
880343
|
-
function
|
|
880993
|
+
function readLimit10(value, fallback) {
|
|
880344
880994
|
const parsed = typeof value === "string" && value.trim() ? Number(value) : value;
|
|
880345
880995
|
if (typeof parsed !== "number" || !Number.isFinite(parsed))
|
|
880346
880996
|
return fallback;
|
|
@@ -880365,12 +881015,6 @@ function output7(value) {
|
|
|
880365
881015
|
function error52(message) {
|
|
880366
881016
|
return { success: false, error: message };
|
|
880367
881017
|
}
|
|
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
881018
|
function commandMatches(command8, query2) {
|
|
880375
881019
|
if (!query2)
|
|
880376
881020
|
return true;
|
|
@@ -880427,7 +881071,7 @@ function describeWorkspaceEditor(editor) {
|
|
|
880427
881071
|
}
|
|
880428
881072
|
function selectedRoutineFromArgs(snapshot, args2) {
|
|
880429
881073
|
const fields = readFieldMap3(args2.fields);
|
|
880430
|
-
const routineId =
|
|
881074
|
+
const routineId = readString57(args2.recordId) || readString57(fields.routineId) || readString57(fields.id);
|
|
880431
881075
|
if (!routineId)
|
|
880432
881076
|
return null;
|
|
880433
881077
|
return snapshot.localRoutines.find((routine) => routine.id === routineId || routine.name.toLowerCase() === routineId.toLowerCase()) ?? null;
|
|
@@ -880495,17 +881139,17 @@ function localEditorModelExecution(editorKind) {
|
|
|
880495
881139
|
return "Use the command field, editor schema, or a first-class Agent model tool when available.";
|
|
880496
881140
|
}
|
|
880497
881141
|
function listWorkspaceActions(deps, args2) {
|
|
880498
|
-
const query2 =
|
|
880499
|
-
const categoryId =
|
|
880500
|
-
const limit3 =
|
|
881142
|
+
const query2 = readString57(args2.query);
|
|
881143
|
+
const categoryId = readString57(args2.categoryId || args2.category);
|
|
881144
|
+
const limit3 = readLimit10(args2.limit, 200);
|
|
880501
881145
|
const includeEditor = args2.includeParameters === true;
|
|
880502
881146
|
const editorContext = includeEditor ? buildWorkspaceEditorContext(deps.commandContext, args2) : null;
|
|
880503
881147
|
const source = query2 ? searchAgentWorkspaceActions(AGENT_WORKSPACE_CATEGORIES, query2).map((result2) => ({ category: result2.category, action: result2.action })) : allWorkspaceActions();
|
|
880504
881148
|
return source.filter((entry) => !categoryId || entry.category.id === categoryId).slice(0, limit3).map((entry) => describeWorkspaceAction(entry.category, entry.action, { includeEditor, editorContext }));
|
|
880505
881149
|
}
|
|
880506
881150
|
function findWorkspaceAction(args2) {
|
|
880507
|
-
const actionId =
|
|
880508
|
-
const categoryId =
|
|
881151
|
+
const actionId = readString57(args2.actionId || args2.query);
|
|
881152
|
+
const categoryId = readString57(args2.categoryId || args2.category);
|
|
880509
881153
|
if (!actionId)
|
|
880510
881154
|
return null;
|
|
880511
881155
|
return allWorkspaceActions().find((entry) => {
|
|
@@ -880515,12 +881159,12 @@ function findWorkspaceAction(args2) {
|
|
|
880515
881159
|
}) ?? null;
|
|
880516
881160
|
}
|
|
880517
881161
|
function listCommands(commandRegistry, args2) {
|
|
880518
|
-
const query2 =
|
|
880519
|
-
const limit3 =
|
|
881162
|
+
const query2 = readString57(args2.query);
|
|
881163
|
+
const limit3 = readLimit10(args2.limit, 200);
|
|
880520
881164
|
return commandRegistry.list().filter((command8) => commandMatches(command8, query2)).sort((a4, b3) => a4.name.localeCompare(b3.name)).slice(0, limit3).map(describeCommand);
|
|
880521
881165
|
}
|
|
880522
881166
|
function requireConfirmedAction(args2, action2) {
|
|
880523
|
-
const explicitUserRequest =
|
|
881167
|
+
const explicitUserRequest = readString57(args2.explicitUserRequest);
|
|
880524
881168
|
if (!explicitUserRequest)
|
|
880525
881169
|
return `${action2} requires explicitUserRequest with the user's exact request or a short faithful summary.`;
|
|
880526
881170
|
if (args2.confirm !== true)
|
|
@@ -880528,7 +881172,7 @@ function requireConfirmedAction(args2, action2) {
|
|
|
880528
881172
|
return null;
|
|
880529
881173
|
}
|
|
880530
881174
|
function commandFromArgs(args2) {
|
|
880531
|
-
const rawCommand =
|
|
881175
|
+
const rawCommand = readString57(args2.command);
|
|
880532
881176
|
if (rawCommand) {
|
|
880533
881177
|
const parsed = parseSlashCommand(rawCommand);
|
|
880534
881178
|
if (!parsed.name)
|
|
@@ -880538,7 +881182,7 @@ function commandFromArgs(args2) {
|
|
|
880538
881182
|
args: parsed.args
|
|
880539
881183
|
};
|
|
880540
881184
|
}
|
|
880541
|
-
const commandName =
|
|
881185
|
+
const commandName = readString57(args2.commandName).replace(/^\//, "");
|
|
880542
881186
|
if (!commandName)
|
|
880543
881187
|
return null;
|
|
880544
881188
|
const commandArgs = readStringArray12(args2.args);
|
|
@@ -880726,115 +881370,13 @@ function createAgentHarnessTool(deps) {
|
|
|
880726
881370
|
name: "agent_harness",
|
|
880727
881371
|
description: [
|
|
880728
881372
|
"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.",
|
|
881373
|
+
"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.",
|
|
881374
|
+
"Discovery modes are read-only. Setting/keybinding writes, resets, UI routing, slash command invocation, and workspace action invocation require confirm:true plus explicitUserRequest.",
|
|
880731
881375
|
"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
881376
|
].join(" "),
|
|
880733
881377
|
parameters: {
|
|
880734
881378
|
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
|
-
},
|
|
881379
|
+
properties: AGENT_HARNESS_PARAMETER_PROPERTIES,
|
|
880838
881380
|
required: ["mode"],
|
|
880839
881381
|
additionalProperties: false
|
|
880840
881382
|
},
|
|
@@ -880851,6 +881393,7 @@ function createAgentHarnessTool(deps) {
|
|
|
880851
881393
|
cliCommands: totalHarnessCliCommands(),
|
|
880852
881394
|
blockedCliCommandTokens: blockedHarnessCliCommandTokens(),
|
|
880853
881395
|
panels: totalHarnessPanels(deps.commandContext),
|
|
881396
|
+
uiSurfaces: totalHarnessUiSurfaces(),
|
|
880854
881397
|
shortcuts: totalHarnessShortcuts(deps.commandContext),
|
|
880855
881398
|
keybindings: totalHarnessKeybindings(deps.commandContext),
|
|
880856
881399
|
commands: deps.commandRegistry.list().length,
|
|
@@ -880861,12 +881404,14 @@ function createAgentHarnessTool(deps) {
|
|
|
880861
881404
|
modelAccess: {
|
|
880862
881405
|
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
881406
|
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.',
|
|
881407
|
+
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
881408
|
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
881409
|
slashCommands: 'Use mode:"commands" and mode:"command" to inspect; use mode:"run_command" with confirm:true plus explicitUserRequest to execute.',
|
|
880866
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.',
|
|
880867
881411
|
settings: 'Use mode:"settings", mode:"get_setting", mode:"set_setting", and mode:"reset_setting".',
|
|
880868
881412
|
tools: 'Use mode:"tools" with includeParameters:true to inspect first-class model tool schemas.',
|
|
880869
|
-
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.'
|
|
880870
881415
|
},
|
|
880871
881416
|
settingsPolicy: settingsPolicySummary(),
|
|
880872
881417
|
connectedHost: connectedHostSummary(deps.commandContext, deps.toolRegistry)
|
|
@@ -880896,7 +881441,7 @@ function createAgentHarnessTool(deps) {
|
|
|
880896
881441
|
}
|
|
880897
881442
|
if (args2.mode === "panel") {
|
|
880898
881443
|
const panel = describeHarnessPanel(deps.commandContext, args2);
|
|
880899
|
-
return panel ? output7(panel) : error52(`Unknown panel ${
|
|
881444
|
+
return panel ? output7(panel) : error52(`Unknown panel ${readString57(args2.panelId || args2.query) || "<missing>"}.`);
|
|
880900
881445
|
}
|
|
880901
881446
|
if (args2.mode === "open_panel") {
|
|
880902
881447
|
const confirmationError2 = requireConfirmedAction(args2, "Panel routing");
|
|
@@ -880904,13 +881449,27 @@ function createAgentHarnessTool(deps) {
|
|
|
880904
881449
|
return error52(confirmationError2);
|
|
880905
881450
|
return output7(openHarnessPanel(deps.commandContext, args2));
|
|
880906
881451
|
}
|
|
881452
|
+
if (args2.mode === "ui_surfaces") {
|
|
881453
|
+
const surfaces2 = listHarnessUiSurfaces(deps.commandContext, args2);
|
|
881454
|
+
return output7({ surfaces: surfaces2, returned: surfaces2.length, total: totalHarnessUiSurfaces() });
|
|
881455
|
+
}
|
|
881456
|
+
if (args2.mode === "ui_surface") {
|
|
881457
|
+
const surface = describeHarnessUiSurface(deps.commandContext, args2);
|
|
881458
|
+
return surface ? output7(surface) : error52(`Unknown UI surface ${readString57(args2.surfaceId || args2.query) || "<missing>"}.`);
|
|
881459
|
+
}
|
|
881460
|
+
if (args2.mode === "open_ui_surface") {
|
|
881461
|
+
const confirmationError2 = requireConfirmedAction(args2, "UI surface routing");
|
|
881462
|
+
if (confirmationError2)
|
|
881463
|
+
return error52(confirmationError2);
|
|
881464
|
+
return output7(openHarnessUiSurface(deps.commandContext, args2));
|
|
881465
|
+
}
|
|
880907
881466
|
if (args2.mode === "shortcuts")
|
|
880908
881467
|
return output7(listHarnessShortcuts(deps.commandContext, args2));
|
|
880909
881468
|
if (args2.mode === "keybindings")
|
|
880910
881469
|
return output7(listHarnessKeybindings(deps.commandContext, args2));
|
|
880911
881470
|
if (args2.mode === "keybinding") {
|
|
880912
881471
|
const binding = describeHarnessKeybinding(deps.commandContext, args2);
|
|
880913
|
-
return binding ? output7(binding) : error52(`Unknown keybinding action ${
|
|
881472
|
+
return binding ? output7(binding) : error52(`Unknown keybinding action ${readString57(args2.actionId || args2.key || args2.query) || "<missing>"}.`);
|
|
880914
881473
|
}
|
|
880915
881474
|
if (args2.mode === "set_keybinding") {
|
|
880916
881475
|
const confirmationError2 = requireConfirmedAction(args2, "Keybinding mutation");
|
|
@@ -880929,7 +881488,7 @@ function createAgentHarnessTool(deps) {
|
|
|
880929
881488
|
return output7({ commands: commands3, returned: commands3.length, total: deps.commandRegistry.list().length });
|
|
880930
881489
|
}
|
|
880931
881490
|
if (args2.mode === "command") {
|
|
880932
|
-
const name51 =
|
|
881491
|
+
const name51 = readString57(args2.commandName).replace(/^\//, "");
|
|
880933
881492
|
const command8 = name51 ? deps.commandRegistry.get(name51) : null;
|
|
880934
881493
|
return command8 ? output7(describeCommand(command8)) : error52(`Unknown slash command /${name51 || "<missing>"}.`);
|
|
880935
881494
|
}
|
|
@@ -880937,16 +881496,16 @@ function createAgentHarnessTool(deps) {
|
|
|
880937
881496
|
return runCommand2(deps, args2);
|
|
880938
881497
|
if (args2.mode === "settings") {
|
|
880939
881498
|
const settings = listHarnessSettings(deps.commandContext.platform.configManager, {
|
|
880940
|
-
category:
|
|
880941
|
-
prefix:
|
|
880942
|
-
query:
|
|
881499
|
+
category: readString57(args2.category) || undefined,
|
|
881500
|
+
prefix: readString57(args2.prefix) || undefined,
|
|
881501
|
+
query: readString57(args2.query) || undefined,
|
|
880943
881502
|
includeHidden: args2.includeHidden === true,
|
|
880944
|
-
limit:
|
|
881503
|
+
limit: readLimit10(args2.limit, 100)
|
|
880945
881504
|
});
|
|
880946
881505
|
return output7({ settings, returned: settings.length, policy: settingsPolicySummary() });
|
|
880947
881506
|
}
|
|
880948
881507
|
if (args2.mode === "get_setting") {
|
|
880949
|
-
const key =
|
|
881508
|
+
const key = readString57(args2.key);
|
|
880950
881509
|
const setting = getHarnessSetting(deps.commandContext.platform.configManager, key);
|
|
880951
881510
|
return setting ? output7(setting) : error52(`Unknown setting ${key || "<missing>"}.`);
|
|
880952
881511
|
}
|
|
@@ -880956,7 +881515,7 @@ function createAgentHarnessTool(deps) {
|
|
|
880956
881515
|
return error52(confirmationError2);
|
|
880957
881516
|
if (args2.value === undefined)
|
|
880958
881517
|
return error52("set_setting requires value.");
|
|
880959
|
-
const key =
|
|
881518
|
+
const key = readString57(args2.key);
|
|
880960
881519
|
const result2 = await setHarnessSetting(deps.commandContext.platform.configManager, deps.commandContext.platform.secretsManager, key, args2.value);
|
|
880961
881520
|
return output7(result2);
|
|
880962
881521
|
}
|
|
@@ -880964,7 +881523,7 @@ function createAgentHarnessTool(deps) {
|
|
|
880964
881523
|
const confirmationError2 = requireConfirmedAction(args2, "Setting reset");
|
|
880965
881524
|
if (confirmationError2)
|
|
880966
881525
|
return error52(confirmationError2);
|
|
880967
|
-
const key =
|
|
881526
|
+
const key = readString57(args2.key);
|
|
880968
881527
|
const result2 = await resetHarnessSetting(deps.commandContext.platform.configManager, deps.commandContext.platform.secretsManager, key);
|
|
880969
881528
|
return output7(result2);
|
|
880970
881529
|
}
|
|
@@ -880981,7 +881540,7 @@ function createAgentHarnessTool(deps) {
|
|
|
880981
881540
|
if (args2.mode === "workspace_action") {
|
|
880982
881541
|
const found = findWorkspaceAction(args2);
|
|
880983
881542
|
const editorContext = buildWorkspaceEditorContext(deps.commandContext, args2);
|
|
880984
|
-
return found ? output7(describeWorkspaceAction(found.category, found.action, { includeEditor: true, editorContext })) : error52(`Unknown Agent workspace action ${
|
|
881543
|
+
return found ? output7(describeWorkspaceAction(found.category, found.action, { includeEditor: true, editorContext })) : error52(`Unknown Agent workspace action ${readString57(args2.actionId || args2.query) || "<missing>"}.`);
|
|
880985
881544
|
}
|
|
880986
881545
|
if (args2.mode === "run_workspace_action")
|
|
880987
881546
|
return runWorkspaceAction(deps, args2);
|
|
@@ -880991,6 +881550,8 @@ function createAgentHarnessTool(deps) {
|
|
|
880991
881550
|
}
|
|
880992
881551
|
if (args2.mode === "connected_host")
|
|
880993
881552
|
return output7(connectedHostSummary(deps.commandContext, deps.toolRegistry));
|
|
881553
|
+
if (args2.mode === "connected_host_status")
|
|
881554
|
+
return output7(await connectedHostStatusSummary(deps.commandContext, deps.toolRegistry));
|
|
880994
881555
|
return error52(`Unhandled agent_harness mode: ${args2.mode}`);
|
|
880995
881556
|
} catch (err2) {
|
|
880996
881557
|
return error52(formatHarnessError(err2));
|
|
@@ -882767,7 +883328,7 @@ var MAX_INPUT_LENGTH2 = exports_security2.MAX_INPUT_LENGTH;
|
|
|
882767
883328
|
var MAX_TOKEN_COUNT2 = exports_security2.MAX_TOKEN_COUNT;
|
|
882768
883329
|
|
|
882769
883330
|
// src/runtime/surface-feature-flags.ts
|
|
882770
|
-
function
|
|
883331
|
+
function isRecord43(value) {
|
|
882771
883332
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
882772
883333
|
}
|
|
882773
883334
|
function isFeatureFlagConfigKey(key) {
|
|
@@ -882784,7 +883345,7 @@ function readFeatureFlagConfigValue(config6, key) {
|
|
|
882784
883345
|
}
|
|
882785
883346
|
function mergeFeatureFlagConfigValue(config6, key, value) {
|
|
882786
883347
|
if (key === "featureFlags") {
|
|
882787
|
-
if (!
|
|
883348
|
+
if (!isRecord43(value))
|
|
882788
883349
|
throw new Error("featureFlags expects an object value.");
|
|
882789
883350
|
const patch2 = {};
|
|
882790
883351
|
for (const [flagId, state3] of Object.entries(value)) {
|
|
@@ -882804,8 +883365,8 @@ function mergeFeatureFlagConfigValue(config6, key, value) {
|
|
|
882804
883365
|
|
|
882805
883366
|
// src/runtime/onboarding/verify.ts
|
|
882806
883367
|
init_config8();
|
|
882807
|
-
import { existsSync as
|
|
882808
|
-
import { join as
|
|
883368
|
+
import { existsSync as existsSync84 } from "fs";
|
|
883369
|
+
import { join as join99 } from "path";
|
|
882809
883370
|
function getNow(deps) {
|
|
882810
883371
|
return deps.clock?.() ?? Date.now();
|
|
882811
883372
|
}
|
|
@@ -882886,7 +883447,7 @@ function verifyAuthOperation(_deps, operation) {
|
|
|
882886
883447
|
}
|
|
882887
883448
|
function verifyCreateAgentProfileOperation(deps, operation) {
|
|
882888
883449
|
const resolution2 = resolveAgentRuntimeProfileHome(deps.shellPaths.homeDirectory, operation.name);
|
|
882889
|
-
const ok3 =
|
|
883450
|
+
const ok3 = existsSync84(join99(resolution2.homeDirectory, "profile.json"));
|
|
882890
883451
|
return {
|
|
882891
883452
|
id: `agent-profile:${resolution2.id}`,
|
|
882892
883453
|
status: ok3 ? "pass" : "fail",
|
|
@@ -882984,15 +883545,15 @@ async function verifyOnboardingRequest(deps, request2) {
|
|
|
882984
883545
|
}
|
|
882985
883546
|
|
|
882986
883547
|
// src/runtime/onboarding/apply-file-helpers.ts
|
|
882987
|
-
import { existsSync as
|
|
883548
|
+
import { existsSync as existsSync85, mkdirSync as mkdirSync68, readFileSync as readFileSync91, unlinkSync as unlinkSync11, writeFileSync as writeFileSync59 } from "fs";
|
|
882988
883549
|
import { dirname as dirname67 } from "path";
|
|
882989
883550
|
function isPlainObject3(value) {
|
|
882990
883551
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
882991
883552
|
}
|
|
882992
883553
|
function readJsonObject(path7) {
|
|
882993
|
-
if (!
|
|
883554
|
+
if (!existsSync85(path7))
|
|
882994
883555
|
return {};
|
|
882995
|
-
const parsed = JSON.parse(
|
|
883556
|
+
const parsed = JSON.parse(readFileSync91(path7, "utf-8"));
|
|
882996
883557
|
if (!isPlainObject3(parsed))
|
|
882997
883558
|
throw new Error(`Expected an object JSON payload at ${path7}.`);
|
|
882998
883559
|
return parsed;
|
|
@@ -883020,7 +883581,7 @@ function setNestedValue(root, key, value) {
|
|
|
883020
883581
|
}
|
|
883021
883582
|
function restoreFile(path7, previous, reload) {
|
|
883022
883583
|
if (previous === null) {
|
|
883023
|
-
if (
|
|
883584
|
+
if (existsSync85(path7))
|
|
883024
883585
|
unlinkSync11(path7);
|
|
883025
883586
|
} else {
|
|
883026
883587
|
mkdirSync68(dirname67(path7), { recursive: true });
|
|
@@ -883029,7 +883590,7 @@ function restoreFile(path7, previous, reload) {
|
|
|
883029
883590
|
reload?.();
|
|
883030
883591
|
}
|
|
883031
883592
|
function snapshotFileRollback(path7, reload) {
|
|
883032
|
-
const previous =
|
|
883593
|
+
const previous = existsSync85(path7) ? readFileSync91(path7, "utf-8") : null;
|
|
883033
883594
|
return () => restoreFile(path7, previous, reload);
|
|
883034
883595
|
}
|
|
883035
883596
|
async function runRollbacks(rollbacks) {
|
|
@@ -883148,7 +883709,7 @@ function validateCreateAgentProfileOperation(deps, operation) {
|
|
|
883148
883709
|
if (name51.length === 0)
|
|
883149
883710
|
throw new Error("Agent profile name is required.");
|
|
883150
883711
|
const resolution2 = resolveAgentRuntimeProfileHome(deps.shellPaths.homeDirectory, name51);
|
|
883151
|
-
if (
|
|
883712
|
+
if (existsSync86(resolution2.homeDirectory)) {
|
|
883152
883713
|
throw new Error(`Agent profile already exists: ${resolution2.id}`);
|
|
883153
883714
|
}
|
|
883154
883715
|
const templateId = operation.templateId?.trim();
|
|
@@ -883160,7 +883721,7 @@ function validateSelectAgentProfileOperation(deps, operation) {
|
|
|
883160
883721
|
if (name51.length === 0)
|
|
883161
883722
|
throw new Error("Agent profile name is required.");
|
|
883162
883723
|
const resolution2 = resolveAgentRuntimeProfileHome(deps.shellPaths.homeDirectory, name51);
|
|
883163
|
-
if (!
|
|
883724
|
+
if (!existsSync86(resolution2.homeDirectory)) {
|
|
883164
883725
|
throw new Error(`Agent profile does not exist: ${resolution2.id}`);
|
|
883165
883726
|
}
|
|
883166
883727
|
}
|
|
@@ -883268,7 +883829,7 @@ async function buildSecretRollbackAction(deps, operation) {
|
|
|
883268
883829
|
throw new Error(`Secret storage locations for ${scope} scope are unavailable.`);
|
|
883269
883830
|
const snapshots = locations.map((location) => ({
|
|
883270
883831
|
path: location.path,
|
|
883271
|
-
previous:
|
|
883832
|
+
previous: existsSync86(location.path) ? readFileSync92(location.path, "utf-8") : null
|
|
883272
883833
|
}));
|
|
883273
883834
|
return () => {
|
|
883274
883835
|
for (const snapshot of snapshots)
|
|
@@ -883302,7 +883863,7 @@ async function buildRollbackAction(deps, operation) {
|
|
|
883302
883863
|
if (operation.kind === "create-agent-profile") {
|
|
883303
883864
|
const resolution2 = resolveAgentRuntimeProfileHome(deps.shellPaths.homeDirectory, operation.name);
|
|
883304
883865
|
return () => {
|
|
883305
|
-
if (
|
|
883866
|
+
if (existsSync86(resolution2.homeDirectory))
|
|
883306
883867
|
rmSync10(resolution2.homeDirectory, { recursive: true, force: true });
|
|
883307
883868
|
};
|
|
883308
883869
|
}
|
|
@@ -883638,7 +884199,7 @@ async function applyOnboardingRequest(deps, request2) {
|
|
|
883638
884199
|
};
|
|
883639
884200
|
}
|
|
883640
884201
|
// src/runtime/onboarding/markers.ts
|
|
883641
|
-
import { existsSync as
|
|
884202
|
+
import { existsSync as existsSync87, mkdirSync as mkdirSync69, readFileSync as readFileSync93, writeFileSync as writeFileSync60 } from "fs";
|
|
883642
884203
|
import { dirname as dirname68 } from "path";
|
|
883643
884204
|
var ONBOARDING_CHECK_MARKER_FILE = "onboarding-checked.json";
|
|
883644
884205
|
function resolveMarkerPath(shellPaths3, scope) {
|
|
@@ -883682,10 +884243,10 @@ function getOnboardingCheckMarkerPath(shellPaths3, scope = "user") {
|
|
|
883682
884243
|
}
|
|
883683
884244
|
function readOnboardingCheckMarker(shellPaths3, scope = "user") {
|
|
883684
884245
|
const path7 = resolveMarkerPath(shellPaths3, scope);
|
|
883685
|
-
if (!
|
|
884246
|
+
if (!existsSync87(path7))
|
|
883686
884247
|
return buildMissingMarkerState(scope, path7);
|
|
883687
884248
|
try {
|
|
883688
|
-
const parsed = JSON.parse(
|
|
884249
|
+
const parsed = JSON.parse(readFileSync93(path7, "utf-8"));
|
|
883689
884250
|
if (!isCheckMarkerPayload(parsed)) {
|
|
883690
884251
|
return buildParseErrorState(scope, path7, "Invalid onboarding check marker payload.");
|
|
883691
884252
|
}
|
|
@@ -883727,7 +884288,7 @@ function writeOnboardingCheckMarker(shellPaths3, options = {}) {
|
|
|
883727
884288
|
return readOnboardingCheckMarker(shellPaths3, scope);
|
|
883728
884289
|
}
|
|
883729
884290
|
// src/input/handler-content-actions.ts
|
|
883730
|
-
import { existsSync as
|
|
884291
|
+
import { existsSync as existsSync88, lstatSync as lstatSync3, readFileSync as readFileSync94, readdirSync as readdirSync22 } from "fs";
|
|
883731
884292
|
import { basename as basename6, relative as relative15 } from "path";
|
|
883732
884293
|
var MARKER_REGEX = /\[(TEXT|IMAGE): [^\]]+\]/g;
|
|
883733
884294
|
var IMAGE_PREFIXES = [
|
|
@@ -883787,7 +884348,7 @@ function readContextFileBlock(reference, projectRoot) {
|
|
|
883787
884348
|
logger.debug("expandPrompt: context reference rejected", { reference, error: summarizeError(error53) });
|
|
883788
884349
|
return null;
|
|
883789
884350
|
}
|
|
883790
|
-
if (!
|
|
884351
|
+
if (!existsSync88(resolvedPath3))
|
|
883791
884352
|
return null;
|
|
883792
884353
|
const stat6 = lstatSync3(resolvedPath3);
|
|
883793
884354
|
const label = escapeContextAttribute(relative15(projectRoot, resolvedPath3) || basename6(resolvedPath3));
|
|
@@ -883806,14 +884367,14 @@ function readContextFileBlock(reference, projectRoot) {
|
|
|
883806
884367
|
if (stat6.size > MAX_CONTEXT_FILE_BYTES) {
|
|
883807
884368
|
return [
|
|
883808
884369
|
`<context-file path="${label}" truncated="true" bytes="${stat6.size}">`,
|
|
883809
|
-
|
|
884370
|
+
readFileSync94(resolvedPath3, "utf-8").slice(0, MAX_CONTEXT_FILE_BYTES),
|
|
883810
884371
|
"</context-file>"
|
|
883811
884372
|
].join(`
|
|
883812
884373
|
`);
|
|
883813
884374
|
}
|
|
883814
884375
|
return [
|
|
883815
884376
|
`<context-file path="${label}" bytes="${stat6.size}">`,
|
|
883816
|
-
|
|
884377
|
+
readFileSync94(resolvedPath3, "utf-8"),
|
|
883817
884378
|
"</context-file>"
|
|
883818
884379
|
].join(`
|
|
883819
884380
|
`);
|
|
@@ -883870,8 +884431,8 @@ function registerPaste(state4, content, projectRoot) {
|
|
|
883870
884431
|
if (IMAGE_EXTENSIONS2.some((ext) => trimmed2.toLowerCase().endsWith(ext))) {
|
|
883871
884432
|
try {
|
|
883872
884433
|
const resolvedPath3 = resolveAndValidatePath(trimmed2, projectRoot);
|
|
883873
|
-
if (
|
|
883874
|
-
const data =
|
|
884434
|
+
if (existsSync88(resolvedPath3)) {
|
|
884435
|
+
const data = readFileSync94(resolvedPath3);
|
|
883875
884436
|
const base644 = data.toString("base64");
|
|
883876
884437
|
const ext = trimmed2.slice(trimmed2.lastIndexOf("."));
|
|
883877
884438
|
const mediaType = mediaTypeFromExt(ext);
|
|
@@ -883921,7 +884482,7 @@ function expandPrompt(pasteRegistry, imageRegistry, text, projectRoot) {
|
|
|
883921
884482
|
const filePath = injectMatch[1];
|
|
883922
884483
|
try {
|
|
883923
884484
|
const resolvedPath3 = resolveAndValidatePath(filePath, projectRoot);
|
|
883924
|
-
const content =
|
|
884485
|
+
const content = readFileSync94(resolvedPath3, "utf-8");
|
|
883925
884486
|
expanded = expanded.slice(0, injectMatch.index) + content + expanded.slice(injectMatch.index + injectMatch[0].length);
|
|
883926
884487
|
injectRegex.lastIndex = injectMatch.index + content.length;
|
|
883927
884488
|
} catch (err2) {
|
|
@@ -885259,7 +885820,7 @@ class AutocompleteEngine {
|
|
|
885259
885820
|
|
|
885260
885821
|
// src/input/file-picker.ts
|
|
885261
885822
|
import { readdir as readdir6 } from "fs/promises";
|
|
885262
|
-
import { join as
|
|
885823
|
+
import { join as join100, relative as relative16 } from "path";
|
|
885263
885824
|
|
|
885264
885825
|
class FilePickerModal {
|
|
885265
885826
|
shellPaths;
|
|
@@ -885392,7 +885953,7 @@ class FilePickerModal {
|
|
|
885392
885953
|
continue;
|
|
885393
885954
|
if (entry.name === "node_modules" || entry.name === "dist")
|
|
885394
885955
|
continue;
|
|
885395
|
-
const fullPath =
|
|
885956
|
+
const fullPath = join100(dir, entry.name);
|
|
885396
885957
|
const relPath = relative16(this.shellPaths.workingDirectory, fullPath);
|
|
885397
885958
|
if (entry.isDirectory()) {
|
|
885398
885959
|
files.push(relPath + "/");
|
|
@@ -893194,7 +893755,7 @@ function handleProfilePickerToken(state4, token) {
|
|
|
893194
893755
|
}
|
|
893195
893756
|
|
|
893196
893757
|
// src/input/handler-picker-routes.ts
|
|
893197
|
-
import { readFileSync as
|
|
893758
|
+
import { readFileSync as readFileSync95 } from "fs";
|
|
893198
893759
|
|
|
893199
893760
|
// src/renderer/model-picker-overlay.ts
|
|
893200
893761
|
var MODEL_PICKER_CHROME_LINES = 7;
|
|
@@ -893486,7 +894047,7 @@ function handleFilePickerToken(state4, token) {
|
|
|
893486
894047
|
throw new Error("working directory is unavailable");
|
|
893487
894048
|
}
|
|
893488
894049
|
const resolvedPath3 = resolveAndValidatePath(selected, projectRoot);
|
|
893489
|
-
const data =
|
|
894050
|
+
const data = readFileSync95(resolvedPath3);
|
|
893490
894051
|
const base644 = data.toString("base64");
|
|
893491
894052
|
const mediaType = state4.mediaTypeFromExt(ext);
|
|
893492
894053
|
const filename = selected.split("/").pop() ?? selected;
|
|
@@ -899445,155 +900006,6 @@ function renderOnboardingCliStatus(options) {
|
|
|
899445
900006
|
].join(`
|
|
899446
900007
|
`);
|
|
899447
900008
|
}
|
|
899448
|
-
// src/cli/external-runtime.ts
|
|
899449
|
-
import { existsSync as existsSync88, readFileSync as readFileSync95 } from "fs";
|
|
899450
|
-
import { join as join100 } from "path";
|
|
899451
|
-
function isRecord43(value) {
|
|
899452
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
899453
|
-
}
|
|
899454
|
-
function readString56(record2, key) {
|
|
899455
|
-
const value = record2?.[key];
|
|
899456
|
-
return typeof value === "string" ? value : null;
|
|
899457
|
-
}
|
|
899458
|
-
function resolveBaseUrl2(configManager) {
|
|
899459
|
-
const host = String(configManager.get("controlPlane.host") ?? "127.0.0.1");
|
|
899460
|
-
const port = Number(configManager.get("controlPlane.port") ?? 3421);
|
|
899461
|
-
return `http://${host}:${Number.isFinite(port) ? port : 3421}`;
|
|
899462
|
-
}
|
|
899463
|
-
function readOperatorToken2(homeDirectory) {
|
|
899464
|
-
const path7 = join100(homeDirectory, ".goodvibes", "daemon", "operator-tokens.json");
|
|
899465
|
-
if (!existsSync88(path7))
|
|
899466
|
-
return { token: null, path: path7 };
|
|
899467
|
-
try {
|
|
899468
|
-
const parsed = JSON.parse(readFileSync95(path7, "utf-8"));
|
|
899469
|
-
const token = isRecord43(parsed) && typeof parsed.token === "string" ? parsed.token : null;
|
|
899470
|
-
return { token, path: path7 };
|
|
899471
|
-
} catch {
|
|
899472
|
-
return { token: null, path: path7 };
|
|
899473
|
-
}
|
|
899474
|
-
}
|
|
899475
|
-
async function fetchJson2(url2, token, timeoutMs) {
|
|
899476
|
-
const controller = new AbortController;
|
|
899477
|
-
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
899478
|
-
try {
|
|
899479
|
-
const response5 = await fetch(url2, {
|
|
899480
|
-
headers: token ? { authorization: `Bearer ${token}` } : undefined,
|
|
899481
|
-
signal: controller.signal
|
|
899482
|
-
});
|
|
899483
|
-
const text = await response5.text();
|
|
899484
|
-
let body2 = text;
|
|
899485
|
-
if (text.trim().length > 0) {
|
|
899486
|
-
try {
|
|
899487
|
-
body2 = JSON.parse(text);
|
|
899488
|
-
} catch {
|
|
899489
|
-
body2 = text;
|
|
899490
|
-
}
|
|
899491
|
-
}
|
|
899492
|
-
return { ok: response5.ok, status: response5.status, body: body2 };
|
|
899493
|
-
} finally {
|
|
899494
|
-
clearTimeout(timer);
|
|
899495
|
-
}
|
|
899496
|
-
}
|
|
899497
|
-
async function inspectCliExternalRuntime(options) {
|
|
899498
|
-
const baseUrl = resolveBaseUrl2(options.configManager);
|
|
899499
|
-
const token = readOperatorToken2(options.homeDirectory);
|
|
899500
|
-
const timeoutMs = options.timeoutMs ?? 1500;
|
|
899501
|
-
const route = "/api/goodvibes-agent/knowledge/status";
|
|
899502
|
-
try {
|
|
899503
|
-
const status = await fetchJson2(`${baseUrl}/status`, token.token, timeoutMs);
|
|
899504
|
-
const statusRecord = isRecord43(status.body) ? status.body : {};
|
|
899505
|
-
const version6 = readString56(statusRecord, "version") ?? "unknown";
|
|
899506
|
-
const compatible = status.ok && version6 === SDK_VERSION;
|
|
899507
|
-
if (!status.ok) {
|
|
899508
|
-
return {
|
|
899509
|
-
baseUrl,
|
|
899510
|
-
statusCode: status.status,
|
|
899511
|
-
reachable: false,
|
|
899512
|
-
version: version6,
|
|
899513
|
-
expectedVersion: SDK_VERSION,
|
|
899514
|
-
compatible: false,
|
|
899515
|
-
operatorToken: { present: Boolean(token.token), path: token.path },
|
|
899516
|
-
agentKnowledge: {
|
|
899517
|
-
route,
|
|
899518
|
-
ready: false,
|
|
899519
|
-
kind: status.status === 401 ? "auth_required" : "connected_host_unavailable",
|
|
899520
|
-
statusCode: status.status
|
|
899521
|
-
},
|
|
899522
|
-
error: typeof status.body === "string" ? status.body : `HTTP ${status.status}`
|
|
899523
|
-
};
|
|
899524
|
-
}
|
|
899525
|
-
if (!token.token) {
|
|
899526
|
-
return {
|
|
899527
|
-
baseUrl,
|
|
899528
|
-
statusCode: status.status,
|
|
899529
|
-
reachable: true,
|
|
899530
|
-
version: version6,
|
|
899531
|
-
expectedVersion: SDK_VERSION,
|
|
899532
|
-
compatible,
|
|
899533
|
-
operatorToken: { present: false, path: token.path },
|
|
899534
|
-
agentKnowledge: {
|
|
899535
|
-
route,
|
|
899536
|
-
ready: false,
|
|
899537
|
-
kind: "auth_required",
|
|
899538
|
-
statusCode: null
|
|
899539
|
-
},
|
|
899540
|
-
error: null
|
|
899541
|
-
};
|
|
899542
|
-
}
|
|
899543
|
-
if (!compatible) {
|
|
899544
|
-
return {
|
|
899545
|
-
baseUrl,
|
|
899546
|
-
statusCode: status.status,
|
|
899547
|
-
reachable: true,
|
|
899548
|
-
version: version6,
|
|
899549
|
-
expectedVersion: SDK_VERSION,
|
|
899550
|
-
compatible: false,
|
|
899551
|
-
operatorToken: { present: true, path: token.path },
|
|
899552
|
-
agentKnowledge: {
|
|
899553
|
-
route,
|
|
899554
|
-
ready: false,
|
|
899555
|
-
kind: "version_mismatch",
|
|
899556
|
-
statusCode: null
|
|
899557
|
-
},
|
|
899558
|
-
error: null
|
|
899559
|
-
};
|
|
899560
|
-
}
|
|
899561
|
-
const knowledge2 = await fetchJson2(`${baseUrl}${route}`, token.token, timeoutMs);
|
|
899562
|
-
return {
|
|
899563
|
-
baseUrl,
|
|
899564
|
-
statusCode: status.status,
|
|
899565
|
-
reachable: true,
|
|
899566
|
-
version: version6,
|
|
899567
|
-
expectedVersion: SDK_VERSION,
|
|
899568
|
-
compatible,
|
|
899569
|
-
operatorToken: { present: true, path: token.path },
|
|
899570
|
-
agentKnowledge: {
|
|
899571
|
-
route,
|
|
899572
|
-
ready: knowledge2.ok,
|
|
899573
|
-
kind: knowledge2.ok ? "ok" : knowledge2.status === 401 ? "auth_required" : knowledge2.status === 404 ? "connected_host_route_unavailable" : "connected_host_error",
|
|
899574
|
-
statusCode: knowledge2.status
|
|
899575
|
-
},
|
|
899576
|
-
error: knowledge2.ok ? null : typeof knowledge2.body === "string" ? knowledge2.body : `HTTP ${knowledge2.status}`
|
|
899577
|
-
};
|
|
899578
|
-
} catch (error53) {
|
|
899579
|
-
return {
|
|
899580
|
-
baseUrl,
|
|
899581
|
-
statusCode: null,
|
|
899582
|
-
reachable: false,
|
|
899583
|
-
version: "unknown",
|
|
899584
|
-
expectedVersion: SDK_VERSION,
|
|
899585
|
-
compatible: false,
|
|
899586
|
-
operatorToken: { present: Boolean(token.token), path: token.path },
|
|
899587
|
-
agentKnowledge: {
|
|
899588
|
-
route,
|
|
899589
|
-
ready: false,
|
|
899590
|
-
kind: "connected_host_unavailable",
|
|
899591
|
-
statusCode: null
|
|
899592
|
-
},
|
|
899593
|
-
error: summarizeError(error53)
|
|
899594
|
-
};
|
|
899595
|
-
}
|
|
899596
|
-
}
|
|
899597
900009
|
// src/cli/completion.ts
|
|
899598
900010
|
var COMMANDS = [
|
|
899599
900011
|
"run",
|