@pellux/goodvibes-agent 1.1.2 → 1.1.3
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 +5 -0
- package/README.md +1 -1
- package/dist/package/main.js +276 -218
- package/docs/channels-remote-and-api.md +1 -1
- package/docs/connected-host.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/knowledge-artifacts-and-multimodal.md +1 -1
- package/docs/tools-and-commands.md +1 -1
- package/package.json +2 -2
- package/release/release-notes.md +1 -1
- package/release/release-readiness.json +4 -4
- package/src/agent/knowledge-scope-alias.ts +56 -0
- package/src/cli/agent-knowledge-runtime.ts +25 -9
- package/src/version.ts +1 -1
package/dist/package/main.js
CHANGED
|
@@ -3884,7 +3884,7 @@ var init_mcp = __esm(() => {
|
|
|
3884
3884
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/version.js
|
|
3885
3885
|
import { readFileSync as readFileSync3 } from "fs";
|
|
3886
3886
|
import { join as join4 } from "path";
|
|
3887
|
-
var version = "0.33.
|
|
3887
|
+
var version = "0.33.37", VERSION2;
|
|
3888
3888
|
var init_version = __esm(() => {
|
|
3889
3889
|
try {
|
|
3890
3890
|
const pkg = JSON.parse(readFileSync3(join4(import.meta.dir, "..", "..", "package.json"), "utf-8"));
|
|
@@ -258777,7 +258777,7 @@ var FOUNDATION_METADATA;
|
|
|
258777
258777
|
var init_foundation_metadata = __esm(() => {
|
|
258778
258778
|
FOUNDATION_METADATA = {
|
|
258779
258779
|
productId: "goodvibes",
|
|
258780
|
-
productVersion: "0.33.
|
|
258780
|
+
productVersion: "0.33.37",
|
|
258781
258781
|
operatorMethodCount: 279,
|
|
258782
258782
|
operatorEventCount: 30,
|
|
258783
258783
|
peerEndpointCount: 6
|
|
@@ -258792,7 +258792,7 @@ var init_operator_contract = __esm(() => {
|
|
|
258792
258792
|
product: {
|
|
258793
258793
|
id: "goodvibes",
|
|
258794
258794
|
surface: "operator",
|
|
258795
|
-
version: "0.33.
|
|
258795
|
+
version: "0.33.37"
|
|
258796
258796
|
},
|
|
258797
258797
|
auth: {
|
|
258798
258798
|
modes: [
|
|
@@ -450372,6 +450372,23 @@ function createSchema2(db) {
|
|
|
450372
450372
|
`);
|
|
450373
450373
|
db.run(`CREATE INDEX IF NOT EXISTS idx_knowledge_schedules_job_id ON knowledge_schedules(job_id)`);
|
|
450374
450374
|
}
|
|
450375
|
+
function getKnowledgeSchemaStatements() {
|
|
450376
|
+
const statements = [];
|
|
450377
|
+
createSchema2({
|
|
450378
|
+
run(sql) {
|
|
450379
|
+
const normalized = sql.trim();
|
|
450380
|
+
if (normalized.length > 0)
|
|
450381
|
+
statements.push(normalized);
|
|
450382
|
+
}
|
|
450383
|
+
});
|
|
450384
|
+
return statements;
|
|
450385
|
+
}
|
|
450386
|
+
function renderKnowledgeSchemaSql() {
|
|
450387
|
+
return `${getKnowledgeSchemaStatements().map((statement) => statement.endsWith(";") ? statement : `${statement};`).join(`
|
|
450388
|
+
|
|
450389
|
+
`)}
|
|
450390
|
+
`;
|
|
450391
|
+
}
|
|
450375
450392
|
function rowObject(columns, values2) {
|
|
450376
450393
|
return Object.fromEntries(columns.map((column, index) => [column, values2[index]]));
|
|
450377
450394
|
}
|
|
@@ -763654,6 +763671,9 @@ var init_ingest = __esm(() => {
|
|
|
763654
763671
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/browser-history/index.js
|
|
763655
763672
|
var init_browser_history = __esm(() => {
|
|
763656
763673
|
init_ingest();
|
|
763674
|
+
init_discover();
|
|
763675
|
+
init_readers();
|
|
763676
|
+
init_paths2();
|
|
763657
763677
|
});
|
|
763658
763678
|
|
|
763659
763679
|
// node_modules/graphql/jsutils/devAssert.mjs
|
|
@@ -781293,6 +781313,7 @@ var init_semantic = __esm(() => {
|
|
|
781293
781313
|
init_llm();
|
|
781294
781314
|
init_gap_repair();
|
|
781295
781315
|
init_service4();
|
|
781316
|
+
init_self_improvement();
|
|
781296
781317
|
});
|
|
781297
781318
|
|
|
781298
781319
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/home-graph/helpers.js
|
|
@@ -785261,8 +785282,40 @@ var init_map_view = __esm(() => {
|
|
|
785261
785282
|
});
|
|
785262
785283
|
|
|
785263
785284
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/home-graph/types.js
|
|
785264
|
-
var HOME_GRAPH_CAPABILITIES;
|
|
785285
|
+
var HOME_GRAPH_NODE_KINDS, HOME_GRAPH_RELATIONS, HOME_GRAPH_CAPABILITIES;
|
|
785265
785286
|
var init_types15 = __esm(() => {
|
|
785287
|
+
HOME_GRAPH_NODE_KINDS = [
|
|
785288
|
+
"ha_home",
|
|
785289
|
+
"ha_entity",
|
|
785290
|
+
"ha_device",
|
|
785291
|
+
"ha_area",
|
|
785292
|
+
"ha_automation",
|
|
785293
|
+
"ha_script",
|
|
785294
|
+
"ha_scene",
|
|
785295
|
+
"ha_label",
|
|
785296
|
+
"ha_integration",
|
|
785297
|
+
"ha_room",
|
|
785298
|
+
"ha_device_passport",
|
|
785299
|
+
"ha_maintenance_item",
|
|
785300
|
+
"ha_troubleshooting_case",
|
|
785301
|
+
"ha_purchase",
|
|
785302
|
+
"ha_network_node"
|
|
785303
|
+
];
|
|
785304
|
+
HOME_GRAPH_RELATIONS = [
|
|
785305
|
+
"controls",
|
|
785306
|
+
"located_in",
|
|
785307
|
+
"belongs_to_device",
|
|
785308
|
+
"has_manual",
|
|
785309
|
+
"has_receipt",
|
|
785310
|
+
"has_warranty",
|
|
785311
|
+
"has_issue",
|
|
785312
|
+
"fixed_by",
|
|
785313
|
+
"uses_battery",
|
|
785314
|
+
"connected_via",
|
|
785315
|
+
"part_of_network",
|
|
785316
|
+
"mentioned_by",
|
|
785317
|
+
"source_for"
|
|
785318
|
+
];
|
|
785266
785319
|
HOME_GRAPH_CAPABILITIES = [
|
|
785267
785320
|
"knowledge-space-isolation",
|
|
785268
785321
|
"snapshot-sync",
|
|
@@ -786669,6 +786722,7 @@ var init_service5 = __esm(() => {
|
|
|
786669
786722
|
var init_home_graph = __esm(() => {
|
|
786670
786723
|
init_service5();
|
|
786671
786724
|
init_extension();
|
|
786725
|
+
init_types15();
|
|
786672
786726
|
});
|
|
786673
786727
|
|
|
786674
786728
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/store-refinement.js
|
|
@@ -788996,10 +789050,14 @@ var init_service6 = __esm(() => {
|
|
|
788996
789050
|
var init_project_planning = __esm(() => {
|
|
788997
789051
|
init_service6();
|
|
788998
789052
|
init_helpers3();
|
|
789053
|
+
init_readiness();
|
|
788999
789054
|
});
|
|
789000
789055
|
|
|
789001
789056
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/persistence.js
|
|
789002
|
-
var init_persistence = () => {
|
|
789057
|
+
var init_persistence = __esm(() => {
|
|
789058
|
+
init_store_schema();
|
|
789059
|
+
init_store_load();
|
|
789060
|
+
});
|
|
789003
789061
|
|
|
789004
789062
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/knowledge/projections.js
|
|
789005
789063
|
class KnowledgeProjectionService {
|
|
@@ -792507,21 +792565,21 @@ var init_service7 = __esm(() => {
|
|
|
792507
792565
|
var exports_knowledge = {};
|
|
792508
792566
|
__export(exports_knowledge, {
|
|
792509
792567
|
withKnowledgeSpace: () => withKnowledgeSpace,
|
|
792510
|
-
uniqKnowledgeValues: () =>
|
|
792511
|
-
stabilizeKnowledgeText: () =>
|
|
792512
|
-
runKnowledgeSemanticSelfImprovement: () =>
|
|
792568
|
+
uniqKnowledgeValues: () => uniq2,
|
|
792569
|
+
stabilizeKnowledgeText: () => stableText,
|
|
792570
|
+
runKnowledgeSemanticSelfImprovement: () => runKnowledgeSemanticSelfImprovement,
|
|
792513
792571
|
resolveProjectPlanningSpace: () => resolveProjectPlanningSpace,
|
|
792514
|
-
resolveKnowledgeDbPathFromControlPlaneDir: () =>
|
|
792572
|
+
resolveKnowledgeDbPathFromControlPlaneDir: () => resolveKnowledgeDbPathFromControlPlaneDir,
|
|
792515
792573
|
renderPacket: () => renderPacket,
|
|
792516
792574
|
renderKnowledgeSchemaSql: () => renderKnowledgeSchemaSql,
|
|
792517
792575
|
renderKnowledgeMap: () => renderKnowledgeMap,
|
|
792518
792576
|
readKnowledgeSearchText: () => readKnowledgeSearchText,
|
|
792519
|
-
readBrowserKnowledgeProfile: () =>
|
|
792577
|
+
readBrowserKnowledgeProfile: () => readBrowserKnowledgeProfile,
|
|
792520
792578
|
projectPlanningSourceId: () => projectPlanningSourceId,
|
|
792521
792579
|
projectPlanningProjectIdFromPath: () => projectPlanningProjectIdFromPath,
|
|
792522
792580
|
projectPlanningCanonicalUri: () => projectPlanningCanonicalUri,
|
|
792523
792581
|
projectKnowledgeSpaceId: () => projectKnowledgeSpaceId,
|
|
792524
|
-
parseKnowledgeJsonValue: () =>
|
|
792582
|
+
parseKnowledgeJsonValue: () => parseJsonValue,
|
|
792525
792583
|
normalizeProjectId: () => normalizeProjectId,
|
|
792526
792584
|
normalizeKnowledgeSpaceId: () => normalizeKnowledgeSpaceId,
|
|
792527
792585
|
normalizeHomeAssistantInstallationId: () => normalizeHomeAssistantInstallationId,
|
|
@@ -792529,12 +792587,12 @@ __export(exports_knowledge, {
|
|
|
792529
792587
|
materializeGeneratedKnowledgeProjection: () => materializeGeneratedKnowledgeProjection,
|
|
792530
792588
|
looksLikeRawPdfPayload: () => looksLikeRawPdfPayload,
|
|
792531
792589
|
looksBinaryLikeText: () => looksBinaryLikeText,
|
|
792532
|
-
loadKnowledgeStoreSnapshot: () =>
|
|
792590
|
+
loadKnowledgeStoreSnapshot: () => loadKnowledgeStoreSnapshot,
|
|
792533
792591
|
listGeneratedKnowledgePages: () => listGeneratedKnowledgePages,
|
|
792534
|
-
listBrowserKinds: () =>
|
|
792592
|
+
listBrowserKinds: () => listBrowserKinds,
|
|
792535
792593
|
knowledgeSpaceMetadata: () => knowledgeSpaceMetadata,
|
|
792536
792594
|
knowledgePageSourceWeight: () => knowledgePageSourceWeight,
|
|
792537
|
-
knowledgeNowMs: () =>
|
|
792595
|
+
knowledgeNowMs: () => nowMs,
|
|
792538
792596
|
knowledgeExtractionNeedsRefresh: () => knowledgeExtractionNeedsRefresh,
|
|
792539
792597
|
isUsefulKnowledgePageSourceCandidate: () => isUsefulKnowledgePageSourceCandidate,
|
|
792540
792598
|
isUsefulKnowledgePageSource: () => isUsefulKnowledgePageSource,
|
|
@@ -792554,12 +792612,12 @@ __export(exports_knowledge, {
|
|
|
792554
792612
|
generatedKnowledgeSourceId: () => generatedKnowledgeSourceId,
|
|
792555
792613
|
generatedKnowledgeCanonicalUri: () => generatedKnowledgeCanonicalUri,
|
|
792556
792614
|
extractKnowledgeArtifact: () => extractKnowledgeArtifact,
|
|
792557
|
-
evaluateProjectPlanningReadiness: () =>
|
|
792558
|
-
discoverBrowserKnowledgeProfiles: () =>
|
|
792615
|
+
evaluateProjectPlanningReadiness: () => evaluateProjectPlanningReadiness,
|
|
792616
|
+
discoverBrowserKnowledgeProfiles: () => discoverBrowserKnowledgeProfiles,
|
|
792559
792617
|
createWebKnowledgeGapRepairer: () => createWebKnowledgeGapRepairer,
|
|
792560
792618
|
createProviderBackedKnowledgeSemanticLlm: () => createProviderBackedKnowledgeSemanticLlm,
|
|
792561
792619
|
createMemoryApi: () => createMemoryApi,
|
|
792562
|
-
createKnowledgeSchema: () =>
|
|
792620
|
+
createKnowledgeSchema: () => createSchema2,
|
|
792563
792621
|
createKnowledgeApi: () => createKnowledgeApi,
|
|
792564
792622
|
createDefaultKnowledgeConnectorRegistry: () => createDefaultKnowledgeConnectorRegistry,
|
|
792565
792623
|
compareKnowledgePageSources: () => compareKnowledgePageSources,
|
|
@@ -794998,7 +795056,7 @@ var init_delivery_manager = __esm(() => {
|
|
|
794998
795056
|
});
|
|
794999
795057
|
|
|
795000
795058
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/automation/scheduler-capacity.js
|
|
795001
|
-
function computeSchedulerCapacity(slotsTotal, runs,
|
|
795059
|
+
function computeSchedulerCapacity(slotsTotal, runs, nowMs2 = Date.now()) {
|
|
795002
795060
|
let slotsInUse = 0;
|
|
795003
795061
|
const queuedRuns = [];
|
|
795004
795062
|
for (const run7 of runs) {
|
|
@@ -795008,7 +795066,7 @@ function computeSchedulerCapacity(slotsTotal, runs, nowMs3 = Date.now()) {
|
|
|
795008
795066
|
queuedRuns.push(run7);
|
|
795009
795067
|
}
|
|
795010
795068
|
const queueDepth = queuedRuns.length;
|
|
795011
|
-
const oldestQueuedAgeMs = queueDepth > 0 ?
|
|
795069
|
+
const oldestQueuedAgeMs = queueDepth > 0 ? nowMs2 - Math.min(...queuedRuns.map((r6) => r6.queuedAt)) : null;
|
|
795012
795070
|
return { slotsTotal, slotsInUse, queueDepth, oldestQueuedAgeMs };
|
|
795013
795071
|
}
|
|
795014
795072
|
|
|
@@ -800211,8 +800269,8 @@ async function dispatchOpenAICompatibleRoutes(request2, context, pathPrefix = OP
|
|
|
800211
800269
|
function handleListModels(context) {
|
|
800212
800270
|
const created = Math.floor(Date.now() / 1000);
|
|
800213
800271
|
const models = context.providerRegistry.listModels();
|
|
800214
|
-
const current =
|
|
800215
|
-
const ids = new Set(
|
|
800272
|
+
const current = context.providerRegistry.getCurrentModel();
|
|
800273
|
+
const ids = new Set(["goodvibes/current"]);
|
|
800216
800274
|
for (const model of models) {
|
|
800217
800275
|
ids.add(model.registryKey);
|
|
800218
800276
|
}
|
|
@@ -800222,7 +800280,7 @@ function handleListModels(context) {
|
|
|
800222
800280
|
id,
|
|
800223
800281
|
object: "model",
|
|
800224
800282
|
created,
|
|
800225
|
-
owned_by: id.startsWith("goodvibes/") ? "goodvibes" : modelOwnerFor(id, models, current
|
|
800283
|
+
owned_by: id.startsWith("goodvibes/") ? "goodvibes" : modelOwnerFor(id, models, current.provider)
|
|
800226
800284
|
}))
|
|
800227
800285
|
});
|
|
800228
800286
|
}
|
|
@@ -800270,12 +800328,12 @@ async function handleChatCompletions(request2, context) {
|
|
|
800270
800328
|
}
|
|
800271
800329
|
}
|
|
800272
800330
|
function resolveModel(registry3, requested) {
|
|
800331
|
+
const current = registry3.getCurrentModel();
|
|
800273
800332
|
const raw = requested?.trim();
|
|
800274
800333
|
if (!raw) {
|
|
800275
800334
|
throw new Error("Missing required field: model.");
|
|
800276
800335
|
}
|
|
800277
800336
|
if (raw === "goodvibes/current") {
|
|
800278
|
-
const current = registry3.getCurrentModel();
|
|
800279
800337
|
return {
|
|
800280
800338
|
provider: registry3.getForModel(current.registryKey, current.provider),
|
|
800281
800339
|
providerId: current.provider,
|
|
@@ -800295,13 +800353,6 @@ function resolveModel(registry3, requested) {
|
|
|
800295
800353
|
}
|
|
800296
800354
|
throw new Error(raw.includes(":") ? `Model '${raw}' not found.` : `Model '${raw}' must be requested as a provider-qualified registryKey.`);
|
|
800297
800355
|
}
|
|
800298
|
-
function tryGetCurrentModel(registry3) {
|
|
800299
|
-
try {
|
|
800300
|
-
return registry3.getCurrentModel();
|
|
800301
|
-
} catch {
|
|
800302
|
-
return null;
|
|
800303
|
-
}
|
|
800304
|
-
}
|
|
800305
800356
|
function prepareChatRequest(input) {
|
|
800306
800357
|
const systemParts = [];
|
|
800307
800358
|
const messages = [];
|
|
@@ -801311,58 +801362,14 @@ class DaemonHttpRouter {
|
|
|
801311
801362
|
return handleGenericWebhookSurface(req, this.context.buildGenericWebhookAdapterContext());
|
|
801312
801363
|
}
|
|
801313
801364
|
}
|
|
801314
|
-
function
|
|
801315
|
-
if (Array.isArray(value))
|
|
801316
|
-
return value.map(normalizeAgentKnowledgeAliasPayload);
|
|
801317
|
-
if (!value || typeof value !== "object")
|
|
801318
|
-
return value;
|
|
801319
|
-
const output = {};
|
|
801320
|
-
let changed = false;
|
|
801321
|
-
for (const [key, nested] of Object.entries(value)) {
|
|
801322
|
-
if (AGENT_KNOWLEDGE_SCOPE_FIELDS.has(key) && nested === DEFAULT_KNOWLEDGE_SPACE_ID) {
|
|
801323
|
-
output[key] = AGENT_KNOWLEDGE_PUBLIC_SPACE_ID;
|
|
801324
|
-
changed = true;
|
|
801325
|
-
continue;
|
|
801326
|
-
}
|
|
801327
|
-
const normalized = normalizeAgentKnowledgeAliasPayload(nested);
|
|
801328
|
-
output[key] = normalized;
|
|
801329
|
-
if (normalized !== nested)
|
|
801330
|
-
changed = true;
|
|
801331
|
-
}
|
|
801332
|
-
return changed ? output : value;
|
|
801333
|
-
}
|
|
801334
|
-
async function normalizeAgentKnowledgeAliasResponse(response5) {
|
|
801335
|
-
const contentType = response5.headers.get("content-type") ?? "";
|
|
801336
|
-
if (!contentType.toLowerCase().includes("application/json"))
|
|
801337
|
-
return response5;
|
|
801338
|
-
let parsed;
|
|
801339
|
-
try {
|
|
801340
|
-
parsed = await response5.clone().json();
|
|
801341
|
-
} catch {
|
|
801342
|
-
return response5;
|
|
801343
|
-
}
|
|
801344
|
-
const normalized = normalizeAgentKnowledgeAliasPayload(parsed);
|
|
801345
|
-
if (normalized === parsed)
|
|
801346
|
-
return response5;
|
|
801347
|
-
const headers = new Headers(response5.headers);
|
|
801348
|
-
headers.delete("content-length");
|
|
801349
|
-
headers.set("content-type", "application/json");
|
|
801350
|
-
return Response.json(normalized, {
|
|
801351
|
-
status: response5.status,
|
|
801352
|
-
statusText: response5.statusText,
|
|
801353
|
-
headers
|
|
801354
|
-
});
|
|
801355
|
-
}
|
|
801356
|
-
async function dispatchAliasedKnowledgeRoutes(req, aliasPrefix, handlers) {
|
|
801365
|
+
function dispatchAliasedKnowledgeRoutes(req, aliasPrefix, handlers) {
|
|
801357
801366
|
const url2 = new URL(req.url);
|
|
801358
801367
|
if (!url2.pathname.startsWith(aliasPrefix))
|
|
801359
801368
|
return null;
|
|
801360
801369
|
const suffix = url2.pathname.slice(aliasPrefix.length);
|
|
801361
801370
|
url2.pathname = `/api/knowledge${suffix}`;
|
|
801362
|
-
|
|
801363
|
-
return response5 ? normalizeAgentKnowledgeAliasResponse(response5) : null;
|
|
801371
|
+
return dispatchDaemonApiRoutes(new Request(url2.toString(), req), handlers);
|
|
801364
801372
|
}
|
|
801365
|
-
var AGENT_KNOWLEDGE_PUBLIC_SPACE_ID, AGENT_KNOWLEDGE_SCOPE_FIELDS;
|
|
801366
801373
|
var init_router = __esm(() => {
|
|
801367
801374
|
init_schema();
|
|
801368
801375
|
init_http_auth();
|
|
@@ -801397,8 +801404,6 @@ var init_router = __esm(() => {
|
|
|
801397
801404
|
init_home_graph_routes();
|
|
801398
801405
|
init_openai_compatible_routes();
|
|
801399
801406
|
init_router_request_body();
|
|
801400
|
-
AGENT_KNOWLEDGE_PUBLIC_SPACE_ID = goodVibesAgentKnowledgeSpaceId();
|
|
801401
|
-
AGENT_KNOWLEDGE_SCOPE_FIELDS = new Set(["spaceId", "knowledgeSpaceId", "namespace"]);
|
|
801402
801407
|
});
|
|
801403
801408
|
|
|
801404
801409
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/companion/companion-chat-persistence.js
|
|
@@ -817087,7 +817092,7 @@ var createStyledCell = (char, overrides = {}) => ({
|
|
|
817087
817092
|
// src/version.ts
|
|
817088
817093
|
import { readFileSync } from "fs";
|
|
817089
817094
|
import { join } from "path";
|
|
817090
|
-
var _version = "1.1.
|
|
817095
|
+
var _version = "1.1.3";
|
|
817091
817096
|
try {
|
|
817092
817097
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, "..", "package.json"), "utf-8"));
|
|
817093
817098
|
_version = typeof pkg.version === "string" ? pkg.version : _version;
|
|
@@ -839600,7 +839605,7 @@ var WORK_PLAN_STATUSES = [
|
|
|
839600
839605
|
"failed",
|
|
839601
839606
|
"cancelled"
|
|
839602
839607
|
];
|
|
839603
|
-
function
|
|
839608
|
+
function nowMs2() {
|
|
839604
839609
|
return Date.now();
|
|
839605
839610
|
}
|
|
839606
839611
|
function isObject4(value) {
|
|
@@ -839706,7 +839711,7 @@ class WorkPlanStore {
|
|
|
839706
839711
|
if (!normalizedTitle)
|
|
839707
839712
|
throw new Error("Work plan item title is required.");
|
|
839708
839713
|
const plan = this.readPlan();
|
|
839709
|
-
const time4 =
|
|
839714
|
+
const time4 = nowMs2();
|
|
839710
839715
|
const item = {
|
|
839711
839716
|
id: createItemId(),
|
|
839712
839717
|
title: normalizedTitle,
|
|
@@ -839730,7 +839735,7 @@ class WorkPlanStore {
|
|
|
839730
839735
|
updateItem(idOrPrefix, patch2) {
|
|
839731
839736
|
const plan = this.readPlan();
|
|
839732
839737
|
const item = this.resolveItem(plan, idOrPrefix);
|
|
839733
|
-
const time4 =
|
|
839738
|
+
const time4 = nowMs2();
|
|
839734
839739
|
const nextStatus = patch2.status ?? item.status;
|
|
839735
839740
|
const next = this.pruneItem({
|
|
839736
839741
|
...item,
|
|
@@ -839763,7 +839768,7 @@ class WorkPlanStore {
|
|
|
839763
839768
|
removeItem(idOrPrefix) {
|
|
839764
839769
|
const plan = this.readPlan();
|
|
839765
839770
|
const item = this.resolveItem(plan, idOrPrefix);
|
|
839766
|
-
const time4 =
|
|
839771
|
+
const time4 = nowMs2();
|
|
839767
839772
|
const remaining = plan.items.filter((candidate) => candidate.id !== item.id);
|
|
839768
839773
|
this.writePlan({
|
|
839769
839774
|
...plan,
|
|
@@ -839783,7 +839788,7 @@ class WorkPlanStore {
|
|
|
839783
839788
|
...plan,
|
|
839784
839789
|
items: remaining,
|
|
839785
839790
|
activeItemId: remaining[0]?.id,
|
|
839786
|
-
updatedAt:
|
|
839791
|
+
updatedAt: nowMs2()
|
|
839787
839792
|
});
|
|
839788
839793
|
return removed;
|
|
839789
839794
|
}
|
|
@@ -839822,7 +839827,7 @@ class WorkPlanStore {
|
|
|
839822
839827
|
const parsed = JSON.parse(raw);
|
|
839823
839828
|
if (!isObject4(parsed))
|
|
839824
839829
|
return this.createEmptyPlan();
|
|
839825
|
-
const time4 =
|
|
839830
|
+
const time4 = nowMs2();
|
|
839826
839831
|
const createdAt = typeof parsed.createdAt === "number" ? parsed.createdAt : time4;
|
|
839827
839832
|
const updatedAt = typeof parsed.updatedAt === "number" ? parsed.updatedAt : createdAt;
|
|
839828
839833
|
const items = Array.isArray(parsed.items) ? parsed.items.map((item) => normalizeItem(item, createdAt)).filter((item) => item !== null) : [];
|
|
@@ -839841,7 +839846,7 @@ class WorkPlanStore {
|
|
|
839841
839846
|
};
|
|
839842
839847
|
}
|
|
839843
839848
|
createEmptyPlan() {
|
|
839844
|
-
const time4 =
|
|
839849
|
+
const time4 = nowMs2();
|
|
839845
839850
|
return {
|
|
839846
839851
|
id: createPlanId(this.options.projectId, this.options.projectRoot),
|
|
839847
839852
|
projectId: this.options.projectId,
|
|
@@ -843045,11 +843050,50 @@ function createBrowserAgentSdk(options = {}) {
|
|
|
843045
843050
|
return createBrowserKnowledgeSdkFromRoutes(AGENT_BROWSER_ROUTES, options);
|
|
843046
843051
|
}
|
|
843047
843052
|
|
|
843053
|
+
// src/agent/knowledge-scope-alias.ts
|
|
843054
|
+
init_knowledge2();
|
|
843055
|
+
var AGENT_KNOWLEDGE_PUBLIC_SPACE_ID = goodVibesAgentKnowledgeSpaceId();
|
|
843056
|
+
var AGENT_KNOWLEDGE_SCOPE_FIELDS = new Set(["spaceId", "knowledgeSpaceId", "namespace"]);
|
|
843057
|
+
function isRecord23(value) {
|
|
843058
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
843059
|
+
}
|
|
843060
|
+
function isDefaultScopeValue(value) {
|
|
843061
|
+
return typeof value === "string" && value.trim().toLowerCase() === DEFAULT_KNOWLEDGE_SPACE_ID;
|
|
843062
|
+
}
|
|
843063
|
+
function normalizeAgentKnowledgeScopeAliases(value) {
|
|
843064
|
+
if (Array.isArray(value)) {
|
|
843065
|
+
let changed2 = false;
|
|
843066
|
+
const normalized = value.map((item) => {
|
|
843067
|
+
const next = normalizeAgentKnowledgeScopeAliases(item);
|
|
843068
|
+
if (next !== item)
|
|
843069
|
+
changed2 = true;
|
|
843070
|
+
return next;
|
|
843071
|
+
});
|
|
843072
|
+
return changed2 ? normalized : value;
|
|
843073
|
+
}
|
|
843074
|
+
if (!isRecord23(value))
|
|
843075
|
+
return value;
|
|
843076
|
+
let changed = false;
|
|
843077
|
+
const output2 = {};
|
|
843078
|
+
for (const [key, nested] of Object.entries(value)) {
|
|
843079
|
+
if (AGENT_KNOWLEDGE_SCOPE_FIELDS.has(key) && isDefaultScopeValue(nested)) {
|
|
843080
|
+
output2[key] = AGENT_KNOWLEDGE_PUBLIC_SPACE_ID;
|
|
843081
|
+
changed = true;
|
|
843082
|
+
continue;
|
|
843083
|
+
}
|
|
843084
|
+
const normalized = normalizeAgentKnowledgeScopeAliases(nested);
|
|
843085
|
+
output2[key] = normalized;
|
|
843086
|
+
if (normalized !== nested)
|
|
843087
|
+
changed = true;
|
|
843088
|
+
}
|
|
843089
|
+
return changed ? output2 : value;
|
|
843090
|
+
}
|
|
843091
|
+
|
|
843048
843092
|
// src/runtime/connected-host-auth.ts
|
|
843049
843093
|
import { createHash as createHash20 } from "crypto";
|
|
843050
843094
|
import { existsSync as existsSync64, readFileSync as readFileSync68 } from "fs";
|
|
843051
843095
|
import { join as join84 } from "path";
|
|
843052
|
-
function
|
|
843096
|
+
function isRecord24(value) {
|
|
843053
843097
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
843054
843098
|
}
|
|
843055
843099
|
function connectedHostOperatorTokenPath(homeDirectory) {
|
|
@@ -843077,7 +843121,7 @@ function readConnectedHostOperatorToken(homeDirectory) {
|
|
|
843077
843121
|
return { path: path7, present: false, token: null };
|
|
843078
843122
|
try {
|
|
843079
843123
|
const parsed = JSON.parse(readFileSync68(path7, "utf-8"));
|
|
843080
|
-
const token =
|
|
843124
|
+
const token = isRecord24(parsed) && typeof parsed.token === "string" && parsed.token.trim().length > 0 ? parsed.token : null;
|
|
843081
843125
|
return { path: path7, present: true, token };
|
|
843082
843126
|
} catch (error51) {
|
|
843083
843127
|
return { path: path7, present: true, token: null, error: error51 instanceof Error ? error51.message : String(error51) };
|
|
@@ -843097,7 +843141,7 @@ function connectedHostTokenRequiredMessage(path7) {
|
|
|
843097
843141
|
}
|
|
843098
843142
|
|
|
843099
843143
|
// src/cli/agent-knowledge-runtime.ts
|
|
843100
|
-
function
|
|
843144
|
+
function isRecord25(value) {
|
|
843101
843145
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
843102
843146
|
}
|
|
843103
843147
|
function readPackageMetadata() {
|
|
@@ -843151,17 +843195,30 @@ async function classifyKnowledgeError(error51, connection5, route) {
|
|
|
843151
843195
|
}
|
|
843152
843196
|
return { ok: false, kind: "connected_host_error", error: message, baseUrl: connection5.baseUrl, route };
|
|
843153
843197
|
}
|
|
843198
|
+
function normalizeAgentKnowledgeData(data) {
|
|
843199
|
+
return normalizeAgentKnowledgeScopeAliases(data);
|
|
843200
|
+
}
|
|
843154
843201
|
function createAgentSdk(connection5) {
|
|
843155
|
-
|
|
843202
|
+
const sdk = createBrowserAgentSdk({
|
|
843156
843203
|
baseUrl: connection5.baseUrl,
|
|
843157
843204
|
authToken: connection5.token
|
|
843158
843205
|
});
|
|
843206
|
+
return {
|
|
843207
|
+
...sdk,
|
|
843208
|
+
knowledge: {
|
|
843209
|
+
...sdk.knowledge,
|
|
843210
|
+
ask: async (input) => normalizeAgentKnowledgeData(await sdk.knowledge.ask(input)),
|
|
843211
|
+
search: async (input) => normalizeAgentKnowledgeData(await sdk.knowledge.search(input)),
|
|
843212
|
+
status: async (input) => normalizeAgentKnowledgeData(await sdk.knowledge.status(input)),
|
|
843213
|
+
map: async (input) => normalizeAgentKnowledgeData(await sdk.knowledge.map(input))
|
|
843214
|
+
}
|
|
843215
|
+
};
|
|
843159
843216
|
}
|
|
843160
|
-
var AGENT_KNOWLEDGE_SCOPE_KEYS = new Set(["spaceid", "knowledgespaceid"]);
|
|
843217
|
+
var AGENT_KNOWLEDGE_SCOPE_KEYS = new Set(["spaceid", "knowledgespaceid", "namespace"]);
|
|
843161
843218
|
var AGENT_KNOWLEDGE_SCOPE_TEXT_PATTERNS = [
|
|
843162
843219
|
{
|
|
843163
843220
|
label: "default knowledge scope id",
|
|
843164
|
-
pattern: /["']?(?:knowledge[-_\s]*space[-_\s]*id|knowledgespaceid|space[-_\s]*id|spaceid)["']?\s*[:=]\s*["']?default["']?/i
|
|
843221
|
+
pattern: /["']?(?:knowledge[-_\s]*space[-_\s]*id|knowledgespaceid|space[-_\s]*id|spaceid|namespace)["']?\s*[:=]\s*["']?default["']?/i
|
|
843165
843222
|
},
|
|
843166
843223
|
{ label: "host assistant payload marker", pattern: /home\s*assistant/i },
|
|
843167
843224
|
{ label: "host graph payload marker", pattern: /home\s*graph|homegraph/i }
|
|
@@ -843223,10 +843280,11 @@ function agentKnowledgeScopeContaminationFailure(connection5, route, finding) {
|
|
|
843223
843280
|
};
|
|
843224
843281
|
}
|
|
843225
843282
|
function validateAgentKnowledgeData(data, connection5, method) {
|
|
843226
|
-
const
|
|
843283
|
+
const normalized = normalizeAgentKnowledgeData(data);
|
|
843284
|
+
const contamination = findAgentKnowledgeScopeContamination(normalized);
|
|
843227
843285
|
if (contamination)
|
|
843228
843286
|
return agentKnowledgeScopeContaminationFailure(connection5, method.route, contamination);
|
|
843229
|
-
return { ok: true, kind: method.kind, route: method.route, data };
|
|
843287
|
+
return { ok: true, kind: method.kind, route: method.route, data: normalized };
|
|
843230
843288
|
}
|
|
843231
843289
|
async function postAgentKnowledgeJson(connection5, route, body2) {
|
|
843232
843290
|
const response5 = await fetch(`${connection5.baseUrl}${route}`, {
|
|
@@ -843247,10 +843305,10 @@ async function postAgentKnowledgeJson(connection5, route, body2) {
|
|
|
843247
843305
|
}
|
|
843248
843306
|
}
|
|
843249
843307
|
if (!response5.ok) {
|
|
843250
|
-
const detail =
|
|
843308
|
+
const detail = isRecord25(parsed) && typeof parsed.error === "string" ? parsed.error : text;
|
|
843251
843309
|
throw new Error(`HTTP ${response5.status} ${response5.statusText}${detail ? `: ${detail}` : ""}`);
|
|
843252
843310
|
}
|
|
843253
|
-
return parsed;
|
|
843311
|
+
return normalizeAgentKnowledgeData(parsed);
|
|
843254
843312
|
}
|
|
843255
843313
|
function queryRoute(route, query2) {
|
|
843256
843314
|
const params = new URLSearchParams;
|
|
@@ -843287,10 +843345,10 @@ async function getAgentKnowledgeJson(connection5, route, query2 = {}) {
|
|
|
843287
843345
|
}
|
|
843288
843346
|
}
|
|
843289
843347
|
if (!response5.ok) {
|
|
843290
|
-
const detail =
|
|
843348
|
+
const detail = isRecord25(parsed) && typeof parsed.error === "string" ? parsed.error : text;
|
|
843291
843349
|
throw new Error(`HTTP ${response5.status} ${response5.statusText}${detail ? `: ${detail}` : ""}`);
|
|
843292
843350
|
}
|
|
843293
|
-
return parsed;
|
|
843351
|
+
return normalizeAgentKnowledgeData(parsed);
|
|
843294
843352
|
}
|
|
843295
843353
|
function findDisallowedKnowledgeScopeFlag(args2) {
|
|
843296
843354
|
const disallowed = [
|
|
@@ -843419,7 +843477,7 @@ var DELEGATION_METHOD = {
|
|
|
843419
843477
|
};
|
|
843420
843478
|
|
|
843421
843479
|
// src/cli/agent-knowledge-format.ts
|
|
843422
|
-
function
|
|
843480
|
+
function isRecord26(value) {
|
|
843423
843481
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
843424
843482
|
}
|
|
843425
843483
|
function readString31(record2, key) {
|
|
@@ -843460,14 +843518,14 @@ function formatAgentKnowledgeFailureKind(kind2) {
|
|
|
843460
843518
|
return kind2.replace(/[_-]+/g, " ");
|
|
843461
843519
|
}
|
|
843462
843520
|
function sourceLine(value) {
|
|
843463
|
-
const record2 =
|
|
843521
|
+
const record2 = isRecord26(value) ? value : {};
|
|
843464
843522
|
const title = cleanInline(record2.title) || cleanInline(record2.canonicalUri) || cleanInline(record2.sourceUri) || cleanInline(record2.url) || cleanInline(record2.id) || "untitled";
|
|
843465
843523
|
const type = cleanInline(record2.sourceType) || cleanInline(record2.type) || "source";
|
|
843466
843524
|
const url2 = cleanInline(record2.canonicalUri) || cleanInline(record2.sourceUri) || cleanInline(record2.url);
|
|
843467
843525
|
return url2 && url2 !== title ? `[${type}] ${title} (${url2})` : `[${type}] ${title}`;
|
|
843468
843526
|
}
|
|
843469
843527
|
function resultLine(value) {
|
|
843470
|
-
const record2 =
|
|
843528
|
+
const record2 = isRecord26(value) ? value : {};
|
|
843471
843529
|
const title = cleanInline(record2.title) || cleanInline(record2.id) || "untitled";
|
|
843472
843530
|
const id = cleanInline(record2.id);
|
|
843473
843531
|
const type = cleanInline(record2.type) || cleanInline(record2.kind) || cleanInline(record2.sourceType) || "result";
|
|
@@ -843484,7 +843542,7 @@ function resultLine(value) {
|
|
|
843484
843542
|
${snippet}` : parts2.join(" ");
|
|
843485
843543
|
}
|
|
843486
843544
|
function nodeLine(value) {
|
|
843487
|
-
const record2 =
|
|
843545
|
+
const record2 = isRecord26(value) ? value : {};
|
|
843488
843546
|
const id = cleanInline(record2.id);
|
|
843489
843547
|
const kind2 = cleanInline(record2.kind) || "node";
|
|
843490
843548
|
const title = cleanInline(record2.title) || id || "untitled";
|
|
@@ -843501,7 +843559,7 @@ function nodeLine(value) {
|
|
|
843501
843559
|
${summary}` : parts2.join(" ");
|
|
843502
843560
|
}
|
|
843503
843561
|
function issueLine(value) {
|
|
843504
|
-
const record2 =
|
|
843562
|
+
const record2 = isRecord26(value) ? value : {};
|
|
843505
843563
|
const id = cleanInline(record2.id) || "issue";
|
|
843506
843564
|
const severity = cleanInline(record2.severity) || "unknown";
|
|
843507
843565
|
const code2 = cleanInline(record2.code) || "issue";
|
|
@@ -843511,7 +843569,7 @@ function issueLine(value) {
|
|
|
843511
843569
|
return ` - ${id} [${severity}] ${code2}${suffix}${message ? ` - ${message}` : ""}`;
|
|
843512
843570
|
}
|
|
843513
843571
|
function connectorLine(value) {
|
|
843514
|
-
const record2 =
|
|
843572
|
+
const record2 = isRecord26(value) ? value : {};
|
|
843515
843573
|
const id = cleanInline(record2.id) || "connector";
|
|
843516
843574
|
const name51 = cleanInline(record2.displayName) || id;
|
|
843517
843575
|
const sourceType = cleanInline(record2.sourceType);
|
|
@@ -843524,7 +843582,7 @@ function relatedKnowledgeCountsLine(relatedEdges, linkedSources, linkedNodes) {
|
|
|
843524
843582
|
return ` related edges ${relatedEdges} linked sources ${linkedSources} linked nodes ${linkedNodes}`;
|
|
843525
843583
|
}
|
|
843526
843584
|
function formatStatus2(data) {
|
|
843527
|
-
const record2 =
|
|
843585
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843528
843586
|
const ready = readBoolean7(record2, "ready");
|
|
843529
843587
|
const sourceCount = readNumber8(record2, "sourceCount");
|
|
843530
843588
|
const nodeCount = readNumber8(record2, "nodeCount");
|
|
@@ -843544,7 +843602,7 @@ function formatStatus2(data) {
|
|
|
843544
843602
|
`);
|
|
843545
843603
|
}
|
|
843546
843604
|
function formatEntityList(data, kind2, limit3) {
|
|
843547
|
-
const record2 =
|
|
843605
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843548
843606
|
const values2 = readArray2(record2, kind2);
|
|
843549
843607
|
if (values2.length === 0) {
|
|
843550
843608
|
return [
|
|
@@ -843563,7 +843621,7 @@ function formatEntityList(data, kind2, limit3) {
|
|
|
843563
843621
|
`);
|
|
843564
843622
|
}
|
|
843565
843623
|
function formatItem(data, id) {
|
|
843566
|
-
const record2 =
|
|
843624
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843567
843625
|
const source = record2.source;
|
|
843568
843626
|
const node = record2.node;
|
|
843569
843627
|
const issue2 = record2.issue;
|
|
@@ -843605,7 +843663,7 @@ function formatItem(data, id) {
|
|
|
843605
843663
|
`);
|
|
843606
843664
|
}
|
|
843607
843665
|
function formatMap2(data) {
|
|
843608
|
-
const record2 =
|
|
843666
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843609
843667
|
const sources = readArray2(record2, "sources");
|
|
843610
843668
|
const nodes = readArray2(record2, "nodes");
|
|
843611
843669
|
const edges = readArray2(record2, "edges");
|
|
@@ -843621,7 +843679,7 @@ function formatMap2(data) {
|
|
|
843621
843679
|
`);
|
|
843622
843680
|
}
|
|
843623
843681
|
function formatConnectors(data) {
|
|
843624
|
-
const record2 =
|
|
843682
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843625
843683
|
const connectors = readArray2(record2, "connectors");
|
|
843626
843684
|
if (connectors.length === 0) {
|
|
843627
843685
|
return [
|
|
@@ -843639,8 +843697,8 @@ function formatConnectors(data) {
|
|
|
843639
843697
|
`);
|
|
843640
843698
|
}
|
|
843641
843699
|
function formatConnector(data, id) {
|
|
843642
|
-
const record2 =
|
|
843643
|
-
const connector =
|
|
843700
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843701
|
+
const connector = isRecord26(record2.connector) ? record2.connector : record2;
|
|
843644
843702
|
const connectorId = cleanInline(connector.id) || id;
|
|
843645
843703
|
const name51 = cleanInline(connector.displayName) || connectorId;
|
|
843646
843704
|
const description = cleanInline(connector.description);
|
|
@@ -843659,7 +843717,7 @@ function formatConnector(data, id) {
|
|
|
843659
843717
|
`);
|
|
843660
843718
|
}
|
|
843661
843719
|
function formatConnectorDoctor(data, id) {
|
|
843662
|
-
const record2 =
|
|
843720
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843663
843721
|
const ready = readBoolean7(record2, "ready");
|
|
843664
843722
|
const summary = cleanInline(record2.summary);
|
|
843665
843723
|
const checks3 = readArray2(record2, "checks");
|
|
@@ -843670,7 +843728,7 @@ function formatConnectorDoctor(data, id) {
|
|
|
843670
843728
|
summary ? ` summary ${summary}` : null,
|
|
843671
843729
|
checks3.length > 0 ? " checks" : null,
|
|
843672
843730
|
...checks3.slice(0, 10).map((check2) => {
|
|
843673
|
-
const item =
|
|
843731
|
+
const item = isRecord26(check2) ? check2 : {};
|
|
843674
843732
|
const checkId = cleanInline(item.id) || "check";
|
|
843675
843733
|
const status = cleanInline(item.status) || "unknown";
|
|
843676
843734
|
const label = cleanInline(item.label);
|
|
@@ -843684,8 +843742,8 @@ function formatConnectorDoctor(data, id) {
|
|
|
843684
843742
|
`);
|
|
843685
843743
|
}
|
|
843686
843744
|
function formatAsk(data, query2) {
|
|
843687
|
-
const record2 =
|
|
843688
|
-
const answer =
|
|
843745
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843746
|
+
const answer = isRecord26(record2.answer) ? record2.answer : record2;
|
|
843689
843747
|
const text = cleanInline(answer.text) || cleanInline(record2.answer) || "No answer returned.";
|
|
843690
843748
|
const confidence = readNumber8(answer, "confidence") ?? readNumber8(record2, "confidence");
|
|
843691
843749
|
const synthesized = readBoolean7(answer, "synthesized");
|
|
@@ -843710,7 +843768,7 @@ function formatAsk(data, query2) {
|
|
|
843710
843768
|
`);
|
|
843711
843769
|
}
|
|
843712
843770
|
function formatSearch(data, query2) {
|
|
843713
|
-
const record2 =
|
|
843771
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843714
843772
|
const items = readArray2(record2, "items");
|
|
843715
843773
|
const results = items.length > 0 ? items : readArray2(record2, "results");
|
|
843716
843774
|
if (results.length === 0) {
|
|
@@ -843729,8 +843787,8 @@ function formatSearch(data, query2) {
|
|
|
843729
843787
|
`);
|
|
843730
843788
|
}
|
|
843731
843789
|
function formatIngest(data, target, label = "ingest-url", route = "/api/goodvibes-agent/knowledge/ingest/url", targetLabel = "url") {
|
|
843732
|
-
const record2 =
|
|
843733
|
-
const source =
|
|
843790
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843791
|
+
const source = isRecord26(record2.source) ? record2.source : record2;
|
|
843734
843792
|
const sourceId = cleanInline(source.id);
|
|
843735
843793
|
const canonicalUri = cleanInline(source.canonicalUri) || cleanInline(source.sourceUri) || target;
|
|
843736
843794
|
const artifactId = cleanInline(record2.artifactId);
|
|
@@ -843744,7 +843802,7 @@ function formatIngest(data, target, label = "ingest-url", route = "/api/goodvibe
|
|
|
843744
843802
|
`);
|
|
843745
843803
|
}
|
|
843746
843804
|
function formatBatchIngest(data, label) {
|
|
843747
|
-
const record2 =
|
|
843805
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843748
843806
|
const imported = readNumber8(record2, "imported");
|
|
843749
843807
|
const failed = readNumber8(record2, "failed");
|
|
843750
843808
|
const sources = readArray2(record2, "sources");
|
|
@@ -843760,8 +843818,8 @@ function formatBatchIngest(data, label) {
|
|
|
843760
843818
|
`);
|
|
843761
843819
|
}
|
|
843762
843820
|
function formatReindex(data) {
|
|
843763
|
-
const record2 =
|
|
843764
|
-
const status =
|
|
843821
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843822
|
+
const status = isRecord26(record2.status) ? record2.status : {};
|
|
843765
843823
|
return [
|
|
843766
843824
|
"Agent Knowledge reindex complete",
|
|
843767
843825
|
` sources ${readNumber8(status, "sourceCount") ?? "unknown"}`,
|
|
@@ -844307,7 +844365,7 @@ var SECRET_PATTERNS2 = [
|
|
|
844307
844365
|
/\bgh[pousr]_[A-Za-z0-9_]{16,}\b/i,
|
|
844308
844366
|
/\b(?:password|passwd|api[_-]?key|token|secret)\s*[:=]\s*\S{6,}/i
|
|
844309
844367
|
];
|
|
844310
|
-
function
|
|
844368
|
+
function isRecord27(value) {
|
|
844311
844369
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
844312
844370
|
}
|
|
844313
844371
|
function readString34(value, fallback = "") {
|
|
@@ -844352,7 +844410,7 @@ function assertNoSecretLikeText(fields, ownerLabel = "Agent local records") {
|
|
|
844352
844410
|
}
|
|
844353
844411
|
}
|
|
844354
844412
|
function parsePersona(value) {
|
|
844355
|
-
if (!
|
|
844413
|
+
if (!isRecord27(value))
|
|
844356
844414
|
return null;
|
|
844357
844415
|
const id = readString34(value.id).trim();
|
|
844358
844416
|
const name51 = normalizeName(readString34(value.name));
|
|
@@ -844382,7 +844440,7 @@ function parsePersona(value) {
|
|
|
844382
844440
|
}
|
|
844383
844441
|
function parseStore(raw) {
|
|
844384
844442
|
const parsed = JSON.parse(raw);
|
|
844385
|
-
if (!
|
|
844443
|
+
if (!isRecord27(parsed))
|
|
844386
844444
|
return { version: STORE_VERSION, activePersonaId: null, personas: [] };
|
|
844387
844445
|
const personas = Array.isArray(parsed.personas) ? parsed.personas.map(parsePersona).filter((entry) => entry !== null) : [];
|
|
844388
844446
|
const activePersonaId = readString34(parsed.activePersonaId).trim() || null;
|
|
@@ -844621,7 +844679,7 @@ function buildActivePersonaPrompt(shellPaths) {
|
|
|
844621
844679
|
import { existsSync as existsSync66, mkdirSync as mkdirSync48, readFileSync as readFileSync70, renameSync as renameSync13, writeFileSync as writeFileSync42 } from "fs";
|
|
844622
844680
|
import { dirname as dirname49 } from "path";
|
|
844623
844681
|
var STORE_VERSION2 = 1;
|
|
844624
|
-
function
|
|
844682
|
+
function isRecord28(value) {
|
|
844625
844683
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
844626
844684
|
}
|
|
844627
844685
|
function readString35(value, fallback = "") {
|
|
@@ -844665,7 +844723,7 @@ function assertNoNoteSecretLikeText(fields) {
|
|
|
844665
844723
|
}
|
|
844666
844724
|
}
|
|
844667
844725
|
function parseNote(value) {
|
|
844668
|
-
if (!
|
|
844726
|
+
if (!isRecord28(value))
|
|
844669
844727
|
return null;
|
|
844670
844728
|
const id = readString35(value.id).trim();
|
|
844671
844729
|
const title = normalizeTitle(readString35(value.title));
|
|
@@ -844694,7 +844752,7 @@ function parseNote(value) {
|
|
|
844694
844752
|
}
|
|
844695
844753
|
function parseStore2(raw) {
|
|
844696
844754
|
const parsed = JSON.parse(raw);
|
|
844697
|
-
if (!
|
|
844755
|
+
if (!isRecord28(parsed))
|
|
844698
844756
|
return { version: STORE_VERSION2, notes: [] };
|
|
844699
844757
|
return {
|
|
844700
844758
|
version: STORE_VERSION2,
|
|
@@ -844899,7 +844957,7 @@ import { dirname as dirname51 } from "path";
|
|
|
844899
844957
|
import { accessSync, constants as constants4, existsSync as existsSync67, mkdirSync as mkdirSync49, readFileSync as readFileSync71, renameSync as renameSync14, writeFileSync as writeFileSync43 } from "fs";
|
|
844900
844958
|
import { delimiter, dirname as dirname50, join as join85 } from "path";
|
|
844901
844959
|
var STORE_VERSION3 = 1;
|
|
844902
|
-
function
|
|
844960
|
+
function isRecord29(value) {
|
|
844903
844961
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
844904
844962
|
}
|
|
844905
844963
|
function readString36(value, fallback = "") {
|
|
@@ -844967,7 +845025,7 @@ function normalizeRequirements(values2) {
|
|
|
844967
845025
|
function parseRequirements(value) {
|
|
844968
845026
|
if (!Array.isArray(value))
|
|
844969
845027
|
return [];
|
|
844970
|
-
return normalizeRequirements(value.filter(
|
|
845028
|
+
return normalizeRequirements(value.filter(isRecord29).map((entry) => ({
|
|
844971
845029
|
kind: readRequirementKind(entry.kind) ?? "env",
|
|
844972
845030
|
name: readString36(entry.name).trim(),
|
|
844973
845031
|
description: readString36(entry.description).trim()
|
|
@@ -844994,7 +845052,7 @@ function commandExists(command8, pathValue) {
|
|
|
844994
845052
|
return pathValue.split(delimiter).filter(Boolean).some((pathEntry) => canExecute(join85(pathEntry, command8)));
|
|
844995
845053
|
}
|
|
844996
845054
|
function parseSkill(value) {
|
|
844997
|
-
if (!
|
|
845055
|
+
if (!isRecord29(value))
|
|
844998
845056
|
return null;
|
|
844999
845057
|
const id = readString36(value.id).trim();
|
|
845000
845058
|
const name51 = normalizeName2(readString36(value.name));
|
|
@@ -845025,7 +845083,7 @@ function parseSkill(value) {
|
|
|
845025
845083
|
};
|
|
845026
845084
|
}
|
|
845027
845085
|
function parseBundle(value) {
|
|
845028
|
-
if (!
|
|
845086
|
+
if (!isRecord29(value))
|
|
845029
845087
|
return null;
|
|
845030
845088
|
const id = readString36(value.id).trim();
|
|
845031
845089
|
const name51 = normalizeName2(readString36(value.name));
|
|
@@ -845054,7 +845112,7 @@ function parseBundle(value) {
|
|
|
845054
845112
|
}
|
|
845055
845113
|
function parseStore3(raw) {
|
|
845056
845114
|
const parsed = JSON.parse(raw);
|
|
845057
|
-
if (!
|
|
845115
|
+
if (!isRecord29(parsed))
|
|
845058
845116
|
return { version: STORE_VERSION3, skills: [], bundles: [] };
|
|
845059
845117
|
return {
|
|
845060
845118
|
version: STORE_VERSION3,
|
|
@@ -845544,7 +845602,7 @@ function buildEnabledSkillsPrompt(shellPaths) {
|
|
|
845544
845602
|
|
|
845545
845603
|
// src/agent/routine-registry.ts
|
|
845546
845604
|
var STORE_VERSION4 = 1;
|
|
845547
|
-
function
|
|
845605
|
+
function isRecord30(value) {
|
|
845548
845606
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
845549
845607
|
}
|
|
845550
845608
|
function readString37(value, fallback = "") {
|
|
@@ -845558,7 +845616,7 @@ function readStringArray11(value) {
|
|
|
845558
845616
|
function readRequirementArray(value) {
|
|
845559
845617
|
if (!Array.isArray(value))
|
|
845560
845618
|
return [];
|
|
845561
|
-
const requirements = value.filter(
|
|
845619
|
+
const requirements = value.filter(isRecord30).map((entry) => ({
|
|
845562
845620
|
kind: entry.kind === "command" ? "command" : "env",
|
|
845563
845621
|
name: readString37(entry.name).trim(),
|
|
845564
845622
|
description: readString37(entry.description).trim() || undefined
|
|
@@ -845595,7 +845653,7 @@ function nowIso4() {
|
|
|
845595
845653
|
return new Date().toISOString();
|
|
845596
845654
|
}
|
|
845597
845655
|
function parseRoutine(value) {
|
|
845598
|
-
if (!
|
|
845656
|
+
if (!isRecord30(value))
|
|
845599
845657
|
return null;
|
|
845600
845658
|
const id = readString37(value.id).trim();
|
|
845601
845659
|
const name51 = normalizeName3(readString37(value.name));
|
|
@@ -845630,7 +845688,7 @@ function parseRoutine(value) {
|
|
|
845630
845688
|
}
|
|
845631
845689
|
function parseStore4(raw) {
|
|
845632
845690
|
const parsed = JSON.parse(raw);
|
|
845633
|
-
if (!
|
|
845691
|
+
if (!isRecord30(parsed))
|
|
845634
845692
|
return { version: STORE_VERSION4, routines: [] };
|
|
845635
845693
|
return {
|
|
845636
845694
|
version: STORE_VERSION4,
|
|
@@ -846944,7 +847002,7 @@ function registerAgentMediaGenerateTool(registry5, mediaProviderRegistry, artifa
|
|
|
846944
847002
|
}
|
|
846945
847003
|
|
|
846946
847004
|
// src/tools/agent-notify-tool.ts
|
|
846947
|
-
function
|
|
847005
|
+
function isRecord31(value) {
|
|
846948
847006
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
846949
847007
|
}
|
|
846950
847008
|
function readString40(value) {
|
|
@@ -846955,7 +847013,7 @@ function readBoolean10(value) {
|
|
|
846955
847013
|
}
|
|
846956
847014
|
function configuredWebhookUrls(configManager) {
|
|
846957
847015
|
const category = configManager.getCategory("notifications");
|
|
846958
|
-
if (!
|
|
847016
|
+
if (!isRecord31(category) || !Array.isArray(category.webhookUrls))
|
|
846959
847017
|
return [];
|
|
846960
847018
|
return category.webhookUrls.filter((url2) => typeof url2 === "string").map((url2) => url2.trim()).filter((url2) => url2.length > 0);
|
|
846961
847019
|
}
|
|
@@ -847107,7 +847165,7 @@ var OPERATOR_ACTIONS = {
|
|
|
847107
847165
|
}
|
|
847108
847166
|
};
|
|
847109
847167
|
var OPERATOR_ACTION_IDS = Object.keys(OPERATOR_ACTIONS);
|
|
847110
|
-
function
|
|
847168
|
+
function isRecord32(value) {
|
|
847111
847169
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
847112
847170
|
}
|
|
847113
847171
|
function readOperatorActionString(value) {
|
|
@@ -847149,7 +847207,7 @@ function requestBody(args2, action2) {
|
|
|
847149
847207
|
return Object.keys(out2).length > 0 ? out2 : null;
|
|
847150
847208
|
}
|
|
847151
847209
|
function buildOperatorActionRequest(rawArgs) {
|
|
847152
|
-
if (!
|
|
847210
|
+
if (!isRecord32(rawArgs))
|
|
847153
847211
|
return { ok: false, error: "Operator action arguments must be an object." };
|
|
847154
847212
|
const args2 = rawArgs;
|
|
847155
847213
|
if (!isOperatorActionId(args2.action)) {
|
|
@@ -847187,7 +847245,7 @@ function summarizeError2(error51) {
|
|
|
847187
847245
|
return error51 instanceof Error ? error51.message : String(error51);
|
|
847188
847246
|
}
|
|
847189
847247
|
function classifyHttpFailure(methodId, path7, status, body2) {
|
|
847190
|
-
const detail =
|
|
847248
|
+
const detail = isRecord32(body2) && typeof body2.error === "string" ? body2.error : "";
|
|
847191
847249
|
return {
|
|
847192
847250
|
ok: false,
|
|
847193
847251
|
methodId,
|
|
@@ -847241,13 +847299,13 @@ async function postOperatorAction(connection5, request2) {
|
|
|
847241
847299
|
}
|
|
847242
847300
|
}
|
|
847243
847301
|
function statusFromOperatorActionBody(body2) {
|
|
847244
|
-
if (!
|
|
847302
|
+
if (!isRecord32(body2))
|
|
847245
847303
|
return "ok";
|
|
847246
847304
|
const approval = body2.approval;
|
|
847247
|
-
if (
|
|
847305
|
+
if (isRecord32(approval) && typeof approval.status === "string")
|
|
847248
847306
|
return approval.status;
|
|
847249
847307
|
const run7 = body2.run;
|
|
847250
|
-
if (
|
|
847308
|
+
if (isRecord32(run7) && typeof run7.status === "string")
|
|
847251
847309
|
return run7.status;
|
|
847252
847310
|
if (typeof body2.status === "string")
|
|
847253
847311
|
return body2.status;
|
|
@@ -847371,7 +847429,7 @@ function createAgentOperatorActionTool(shellPaths, configManager) {
|
|
|
847371
847429
|
if (!request2.ok) {
|
|
847372
847430
|
return { success: false, error: request2.error };
|
|
847373
847431
|
}
|
|
847374
|
-
const args2 =
|
|
847432
|
+
const args2 = isRecord32(rawArgs) ? rawArgs : {};
|
|
847375
847433
|
const explicitUserRequest = readOperatorActionString(args2.explicitUserRequest);
|
|
847376
847434
|
if (!explicitUserRequest) {
|
|
847377
847435
|
return {
|
|
@@ -847414,23 +847472,23 @@ var OPERATOR_BRIEFING_ROUTES = [
|
|
|
847414
847472
|
{ id: "schedules.list", path: "/api/automation/schedules" },
|
|
847415
847473
|
{ id: "scheduler.capacity", path: "/api/runtime/scheduler" }
|
|
847416
847474
|
];
|
|
847417
|
-
function
|
|
847475
|
+
function isRecord33(value) {
|
|
847418
847476
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
847419
847477
|
}
|
|
847420
847478
|
function readRecord20(value, key) {
|
|
847421
|
-
return
|
|
847479
|
+
return isRecord33(value) && isRecord33(value[key]) ? value[key] : {};
|
|
847422
847480
|
}
|
|
847423
847481
|
function readArray3(value, key) {
|
|
847424
|
-
return
|
|
847482
|
+
return isRecord33(value) && Array.isArray(value[key]) ? value[key] : [];
|
|
847425
847483
|
}
|
|
847426
847484
|
function readNumber9(value, key) {
|
|
847427
|
-
if (!
|
|
847485
|
+
if (!isRecord33(value))
|
|
847428
847486
|
return null;
|
|
847429
847487
|
const candidate = value[key];
|
|
847430
847488
|
return typeof candidate === "number" && Number.isFinite(candidate) ? candidate : null;
|
|
847431
847489
|
}
|
|
847432
847490
|
function readString41(value, key) {
|
|
847433
|
-
if (!
|
|
847491
|
+
if (!isRecord33(value))
|
|
847434
847492
|
return null;
|
|
847435
847493
|
const candidate = value[key];
|
|
847436
847494
|
return typeof candidate === "string" ? candidate : null;
|
|
@@ -847449,7 +847507,7 @@ async function readResponseBody2(response5) {
|
|
|
847449
847507
|
}
|
|
847450
847508
|
}
|
|
847451
847509
|
function classifyHttpFailure2(route, status, body2) {
|
|
847452
|
-
const detail =
|
|
847510
|
+
const detail = isRecord33(body2) && typeof body2.error === "string" ? body2.error : "";
|
|
847453
847511
|
return {
|
|
847454
847512
|
ok: false,
|
|
847455
847513
|
route,
|
|
@@ -847483,7 +847541,7 @@ function formatWorkPlan(body2) {
|
|
|
847483
847541
|
function formatApprovals(body2) {
|
|
847484
847542
|
const approvals = readArray3(body2, "approvals");
|
|
847485
847543
|
const pending = approvals.filter((entry) => readString41(entry, "status") === "pending").length;
|
|
847486
|
-
return ` approvals: pending ${pending}; total ${approvals.length}; mode ${readString41(body2, "mode") ?? "unknown"}; awaiting decision ${readString41(body2, "awaitingDecision") ?? String(Boolean(
|
|
847544
|
+
return ` approvals: pending ${pending}; total ${approvals.length}; mode ${readString41(body2, "mode") ?? "unknown"}; awaiting decision ${readString41(body2, "awaitingDecision") ?? String(Boolean(isRecord33(body2) && body2.awaitingDecision))}`;
|
|
847487
847545
|
}
|
|
847488
847546
|
function formatAutomation(body2) {
|
|
847489
847547
|
const totals = readRecord20(body2, "totals");
|
|
@@ -847493,7 +847551,7 @@ function formatAutomation(body2) {
|
|
|
847493
847551
|
function formatSchedules(body2) {
|
|
847494
847552
|
const jobs = readArray3(body2, "jobs");
|
|
847495
847553
|
const runs = readArray3(body2, "runs");
|
|
847496
|
-
const enabled = jobs.filter((entry) =>
|
|
847554
|
+
const enabled = jobs.filter((entry) => isRecord33(entry) && entry.enabled === true).length;
|
|
847497
847555
|
return ` schedules: jobs ${jobs.length}; enabled ${enabled}; runs ${runs.length}`;
|
|
847498
847556
|
}
|
|
847499
847557
|
function formatCapacity(body2) {
|
|
@@ -847959,7 +848017,7 @@ function resolveReminderConnectedHostConnection(configManager, homeDirectory) {
|
|
|
847959
848017
|
}
|
|
847960
848018
|
|
|
847961
848019
|
// src/agent/reminder-schedule-format.ts
|
|
847962
|
-
function
|
|
848020
|
+
function isRecord34(value) {
|
|
847963
848021
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
847964
848022
|
}
|
|
847965
848023
|
function readString42(record2, key) {
|
|
@@ -848005,7 +848063,7 @@ function formatReminderSchedulePreview(preview4) {
|
|
|
848005
848063
|
`);
|
|
848006
848064
|
}
|
|
848007
848065
|
function formatReminderScheduleSuccess(result2) {
|
|
848008
|
-
const record2 =
|
|
848066
|
+
const record2 = isRecord34(result2.schedule) ? result2.schedule : {};
|
|
848009
848067
|
const id = readString42(record2, "id") ?? "(unknown)";
|
|
848010
848068
|
const status = readString42(record2, "status") ?? (record2.enabled === false ? "paused" : "enabled");
|
|
848011
848069
|
return [
|
|
@@ -850525,7 +850583,7 @@ var recallCommand = {
|
|
|
850525
850583
|
var KNOWLEDGE_REVIEW_ACTIONS = ["accept", "reject", "resolve", "reopen", "edit", "forget"];
|
|
850526
850584
|
var BROWSER_KINDS = ["chrome", "chromium", "brave", "edge", "vivaldi", "arc", "opera", "firefox", "zen", "librewolf", "waterfox", "floorp", "safari", "orion", "epiphany"];
|
|
850527
850585
|
var BROWSER_SOURCE_KINDS = ["history", "bookmark"];
|
|
850528
|
-
function
|
|
850586
|
+
function isRecord35(value) {
|
|
850529
850587
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
850530
850588
|
}
|
|
850531
850589
|
function requireAgentKnowledgeApi(context) {
|
|
@@ -850625,7 +850683,7 @@ function readJsonObjectFlag(args2, name51) {
|
|
|
850625
850683
|
return;
|
|
850626
850684
|
try {
|
|
850627
850685
|
const parsed = JSON.parse(value);
|
|
850628
|
-
return
|
|
850686
|
+
return isRecord35(parsed) ? parsed : null;
|
|
850629
850687
|
} catch {
|
|
850630
850688
|
return null;
|
|
850631
850689
|
}
|
|
@@ -852071,7 +852129,7 @@ function parseRoutineSchedulePromotionArgs(args2) {
|
|
|
852071
852129
|
}
|
|
852072
852130
|
|
|
852073
852131
|
// src/agent/routine-schedule-format.ts
|
|
852074
|
-
function
|
|
852132
|
+
function isRecord36(value) {
|
|
852075
852133
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
852076
852134
|
}
|
|
852077
852135
|
function readString45(record2, key) {
|
|
@@ -852123,7 +852181,7 @@ function formatRoutineSchedulePreview(preview4) {
|
|
|
852123
852181
|
`);
|
|
852124
852182
|
}
|
|
852125
852183
|
function formatRoutineScheduleSuccess(result2) {
|
|
852126
|
-
const record2 =
|
|
852184
|
+
const record2 = isRecord36(result2.schedule) ? result2.schedule : {};
|
|
852127
852185
|
const id = readString45(record2, "id") ?? "(unknown)";
|
|
852128
852186
|
const status = readString45(record2, "status") ?? (record2.enabled === false ? "paused" : "enabled");
|
|
852129
852187
|
return [
|
|
@@ -852244,7 +852302,7 @@ import { existsSync as existsSync69, mkdirSync as mkdirSync52, readFileSync as r
|
|
|
852244
852302
|
import { dirname as dirname53 } from "path";
|
|
852245
852303
|
init_automation2();
|
|
852246
852304
|
var RECEIPT_STORE_VERSION = 1;
|
|
852247
|
-
function
|
|
852305
|
+
function isRecord37(value) {
|
|
852248
852306
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
852249
852307
|
}
|
|
852250
852308
|
function readString46(record2, key) {
|
|
@@ -852297,7 +852355,7 @@ function normalizeFailureKind(value) {
|
|
|
852297
852355
|
return;
|
|
852298
852356
|
}
|
|
852299
852357
|
function readReceipt(value) {
|
|
852300
|
-
if (!
|
|
852358
|
+
if (!isRecord37(value))
|
|
852301
852359
|
return null;
|
|
852302
852360
|
const id = readString46(value, "id")?.trim();
|
|
852303
852361
|
const createdAt = readString46(value, "createdAt")?.trim();
|
|
@@ -852306,9 +852364,9 @@ function readReceipt(value) {
|
|
|
852306
852364
|
const status = value.status === "created" || value.status === "failed" ? value.status : null;
|
|
852307
852365
|
const scheduleKind = value.scheduleKind === "cron" || value.scheduleKind === "every" || value.scheduleKind === "at" ? value.scheduleKind : null;
|
|
852308
852366
|
const scheduleValue2 = readString46(value, "scheduleValue")?.trim();
|
|
852309
|
-
const target =
|
|
852367
|
+
const target = isRecord37(value.target) ? value.target : {};
|
|
852310
852368
|
const deliveryTargets = Array.isArray(value.deliveryTargets) ? value.deliveryTargets.map((target2) => {
|
|
852311
|
-
if (!
|
|
852369
|
+
if (!isRecord37(target2))
|
|
852312
852370
|
return null;
|
|
852313
852371
|
const kind2 = target2.kind === "webhook" || target2.kind === "surface" || target2.kind === "integration" || target2.kind === "link" ? target2.kind : null;
|
|
852314
852372
|
if (!kind2)
|
|
@@ -852356,7 +852414,7 @@ function readReceipt(value) {
|
|
|
852356
852414
|
}
|
|
852357
852415
|
function parseReceiptStore(raw) {
|
|
852358
852416
|
const parsed = JSON.parse(raw);
|
|
852359
|
-
if (!
|
|
852417
|
+
if (!isRecord37(parsed))
|
|
852360
852418
|
return { version: RECEIPT_STORE_VERSION, receipts: [] };
|
|
852361
852419
|
return {
|
|
852362
852420
|
version: RECEIPT_STORE_VERSION,
|
|
@@ -852393,7 +852451,7 @@ function scheduleKind(payload) {
|
|
|
852393
852451
|
throw new Error("Routine schedule payload is missing a schedule kind.");
|
|
852394
852452
|
}
|
|
852395
852453
|
function targetSummary(payload) {
|
|
852396
|
-
return
|
|
852454
|
+
return isRecord37(payload.target) ? {
|
|
852397
852455
|
kind: typeof payload.target.kind === "string" ? payload.target.kind : undefined,
|
|
852398
852456
|
surfaceKind: typeof payload.target.surfaceKind === "string" ? payload.target.surfaceKind : undefined,
|
|
852399
852457
|
preserveThread: typeof payload.target.preserveThread === "boolean" ? payload.target.preserveThread : undefined,
|
|
@@ -852401,10 +852459,10 @@ function targetSummary(payload) {
|
|
|
852401
852459
|
} : {};
|
|
852402
852460
|
}
|
|
852403
852461
|
function deliveryMode(payload) {
|
|
852404
|
-
return
|
|
852462
|
+
return isRecord37(payload.delivery) && typeof payload.delivery.mode === "string" ? payload.delivery.mode : undefined;
|
|
852405
852463
|
}
|
|
852406
852464
|
function resultScheduleRecord(result2) {
|
|
852407
|
-
return result2.ok &&
|
|
852465
|
+
return result2.ok && isRecord37(result2.schedule) ? result2.schedule : {};
|
|
852408
852466
|
}
|
|
852409
852467
|
function buildReceipt(existing, connection5, preview4, result2) {
|
|
852410
852468
|
const createdAt = nowIso5();
|
|
@@ -852492,7 +852550,7 @@ function isoTime(value) {
|
|
|
852492
852550
|
return Number.isFinite(time4) ? new Date(time4).toISOString() : null;
|
|
852493
852551
|
}
|
|
852494
852552
|
function readLiveScheduleDefinition(value) {
|
|
852495
|
-
if (!
|
|
852553
|
+
if (!isRecord37(value))
|
|
852496
852554
|
return {};
|
|
852497
852555
|
if (value.kind === "cron") {
|
|
852498
852556
|
return {
|
|
@@ -852518,7 +852576,7 @@ function readLiveScheduleDefinition(value) {
|
|
|
852518
852576
|
return {};
|
|
852519
852577
|
}
|
|
852520
852578
|
function readLiveScheduleRecord(value) {
|
|
852521
|
-
if (!
|
|
852579
|
+
if (!isRecord37(value))
|
|
852522
852580
|
return null;
|
|
852523
852581
|
const id = readString46(value, "id")?.trim();
|
|
852524
852582
|
const name51 = readString46(value, "name")?.trim();
|
|
@@ -852541,7 +852599,7 @@ function readLiveScheduleRecord(value) {
|
|
|
852541
852599
|
};
|
|
852542
852600
|
}
|
|
852543
852601
|
function readLiveSchedules(output6) {
|
|
852544
|
-
const record2 =
|
|
852602
|
+
const record2 = isRecord37(output6) ? output6 : {};
|
|
852545
852603
|
const jobs = Array.isArray(record2.jobs) ? record2.jobs : [];
|
|
852546
852604
|
return jobs.map(readLiveScheduleRecord).filter((schedule) => schedule !== null);
|
|
852547
852605
|
}
|
|
@@ -859127,7 +859185,7 @@ var STARTER_TEMPLATES = [
|
|
|
859127
859185
|
var PROFILE_CREATED_FILE = "profile.json";
|
|
859128
859186
|
var PROFILE_SELECTION_FILE = "profile-selection.json";
|
|
859129
859187
|
var PROFILE_ID_PATTERN = /^[a-z0-9](?:[a-z0-9._-]{0,62}[a-z0-9])?$/;
|
|
859130
|
-
function
|
|
859188
|
+
function isRecord38(value) {
|
|
859131
859189
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
859132
859190
|
}
|
|
859133
859191
|
function normalizeAgentRuntimeProfileId(value) {
|
|
@@ -859166,7 +859224,7 @@ function readAgentRuntimeProfileSelection(baseHomeDirectory) {
|
|
|
859166
859224
|
return null;
|
|
859167
859225
|
try {
|
|
859168
859226
|
const raw = JSON.parse(readFileSync81(path7, "utf-8"));
|
|
859169
|
-
if (!
|
|
859227
|
+
if (!isRecord38(raw))
|
|
859170
859228
|
return null;
|
|
859171
859229
|
const profileId = raw.profileId;
|
|
859172
859230
|
if (typeof profileId !== "string")
|
|
@@ -859211,10 +859269,10 @@ function readProfileStarterTemplate(homeDirectory) {
|
|
|
859211
859269
|
return {};
|
|
859212
859270
|
try {
|
|
859213
859271
|
const raw = JSON.parse(readFileSync81(path7, "utf-8"));
|
|
859214
|
-
if (!
|
|
859272
|
+
if (!isRecord38(raw))
|
|
859215
859273
|
return {};
|
|
859216
859274
|
const starter = raw.starterTemplate;
|
|
859217
|
-
if (!
|
|
859275
|
+
if (!isRecord38(starter))
|
|
859218
859276
|
return {};
|
|
859219
859277
|
const id = starter.id;
|
|
859220
859278
|
const name51 = starter.name;
|
|
@@ -859332,7 +859390,7 @@ function readTemplateTextBlock(value, field) {
|
|
|
859332
859390
|
return value.trim();
|
|
859333
859391
|
}
|
|
859334
859392
|
function readTemplateObject(value, field) {
|
|
859335
|
-
if (!
|
|
859393
|
+
if (!isRecord38(value))
|
|
859336
859394
|
throw new Error(`Starter template ${field} must be an object.`);
|
|
859337
859395
|
return value;
|
|
859338
859396
|
}
|
|
@@ -861556,7 +861614,7 @@ var CHANNEL_FAILURE_LABELS = {
|
|
|
861556
861614
|
connected_host_route_unavailable: "connected host route unavailable",
|
|
861557
861615
|
connected_host_error: "connected host error"
|
|
861558
861616
|
};
|
|
861559
|
-
function
|
|
861617
|
+
function isRecord39(value) {
|
|
861560
861618
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
861561
861619
|
}
|
|
861562
861620
|
function readString47(record2, key, fallback = "") {
|
|
@@ -861569,7 +861627,7 @@ function readBoolean14(record2, key, fallback = false) {
|
|
|
861569
861627
|
}
|
|
861570
861628
|
function readRecordArray(record2, key) {
|
|
861571
861629
|
const value = record2[key];
|
|
861572
|
-
return Array.isArray(value) ? value.filter(
|
|
861630
|
+
return Array.isArray(value) ? value.filter(isRecord39) : [];
|
|
861573
861631
|
}
|
|
861574
861632
|
function readFlagValue3(args2, index, flag, errors4) {
|
|
861575
861633
|
const value = args2[index + 1];
|
|
@@ -861638,7 +861696,7 @@ function resolveChannelConnectedHostConnection(context) {
|
|
|
861638
861696
|
return { baseUrl: `http://${host}:${port}`, token: null, tokenPath };
|
|
861639
861697
|
try {
|
|
861640
861698
|
const parsed = JSON.parse(readFileSync82(tokenPath, "utf-8"));
|
|
861641
|
-
const token =
|
|
861699
|
+
const token = isRecord39(parsed) && typeof parsed.token === "string" ? parsed.token : null;
|
|
861642
861700
|
return { baseUrl: `http://${host}:${port}`, token, tokenPath };
|
|
861643
861701
|
} catch {
|
|
861644
861702
|
return { baseUrl: `http://${host}:${port}`, token: null, tokenPath };
|
|
@@ -861669,7 +861727,7 @@ async function fetchChannelRoute(context, route) {
|
|
|
861669
861727
|
}
|
|
861670
861728
|
}
|
|
861671
861729
|
if (!response5.ok) {
|
|
861672
|
-
const detail =
|
|
861730
|
+
const detail = isRecord39(body2) && typeof body2.error === "string" ? body2.error : text;
|
|
861673
861731
|
return {
|
|
861674
861732
|
ok: false,
|
|
861675
861733
|
route,
|
|
@@ -861759,7 +861817,7 @@ function printChannelDetail(print2, channel) {
|
|
|
861759
861817
|
`));
|
|
861760
861818
|
}
|
|
861761
861819
|
function formatChannelAccounts(body2) {
|
|
861762
|
-
const root =
|
|
861820
|
+
const root = isRecord39(body2) ? body2 : {};
|
|
861763
861821
|
const accounts = readRecordArray(root, "accounts");
|
|
861764
861822
|
const lines = [
|
|
861765
861823
|
"Channel Accounts",
|
|
@@ -861785,7 +861843,7 @@ function formatChannelAccounts(body2) {
|
|
|
861785
861843
|
`);
|
|
861786
861844
|
}
|
|
861787
861845
|
function formatChannelPolicies(body2) {
|
|
861788
|
-
const root =
|
|
861846
|
+
const root = isRecord39(body2) ? body2 : {};
|
|
861789
861847
|
const policies = readRecordArray(root, "policies");
|
|
861790
861848
|
const lines = [
|
|
861791
861849
|
"Channel Policies",
|
|
@@ -861810,7 +861868,7 @@ function formatChannelPolicies(body2) {
|
|
|
861810
861868
|
`);
|
|
861811
861869
|
}
|
|
861812
861870
|
function formatChannelStatus(body2) {
|
|
861813
|
-
const root =
|
|
861871
|
+
const root = isRecord39(body2) ? body2 : {};
|
|
861814
861872
|
const channels = readRecordArray(root, "channels");
|
|
861815
861873
|
const lines = [
|
|
861816
861874
|
"Connected Channel Status",
|
|
@@ -861834,7 +861892,7 @@ function formatChannelStatus(body2) {
|
|
|
861834
861892
|
`);
|
|
861835
861893
|
}
|
|
861836
861894
|
function formatChannelDoctor(surface, body2) {
|
|
861837
|
-
const root =
|
|
861895
|
+
const root = isRecord39(body2) ? body2 : {};
|
|
861838
861896
|
const checks3 = readRecordArray(root, "checks");
|
|
861839
861897
|
const repairActions = readRecordArray(root, "repairActions");
|
|
861840
861898
|
const lines = [
|
|
@@ -861858,7 +861916,7 @@ function formatChannelDoctor(surface, body2) {
|
|
|
861858
861916
|
`);
|
|
861859
861917
|
}
|
|
861860
861918
|
function formatChannelSetup(surface, body2) {
|
|
861861
|
-
const root =
|
|
861919
|
+
const root = isRecord39(body2) ? body2 : {};
|
|
861862
861920
|
const fields = readRecordArray(root, "fields");
|
|
861863
861921
|
const secretTargets = readRecordArray(root, "secretTargets");
|
|
861864
861922
|
const lines = [
|
|
@@ -864575,13 +864633,13 @@ function getNestedValue(source, key) {
|
|
|
864575
864633
|
}
|
|
864576
864634
|
return cursor;
|
|
864577
864635
|
}
|
|
864578
|
-
function
|
|
864636
|
+
function isRecord40(value) {
|
|
864579
864637
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
864580
864638
|
}
|
|
864581
864639
|
function readJsonFile2(path7) {
|
|
864582
864640
|
try {
|
|
864583
864641
|
const value = JSON.parse(readFileSync87(path7, "utf-8"));
|
|
864584
|
-
if (!
|
|
864642
|
+
if (!isRecord40(value))
|
|
864585
864643
|
return { ok: false, error: "Bundle file must contain a JSON object." };
|
|
864586
864644
|
return { ok: true, value };
|
|
864587
864645
|
} catch (error51) {
|
|
@@ -866782,29 +866840,29 @@ function usage() {
|
|
|
866782
866840
|
].join(`
|
|
866783
866841
|
`);
|
|
866784
866842
|
}
|
|
866785
|
-
function
|
|
866843
|
+
function isRecord41(value) {
|
|
866786
866844
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
866787
866845
|
}
|
|
866788
866846
|
function isStringArray6(value) {
|
|
866789
866847
|
return Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
866790
866848
|
}
|
|
866791
866849
|
function isProvenanceLink(value) {
|
|
866792
|
-
if (!
|
|
866850
|
+
if (!isRecord41(value))
|
|
866793
866851
|
return false;
|
|
866794
866852
|
return typeof value.ref === "string" && typeof value.kind === "string" && isProvenanceKind(value.kind);
|
|
866795
866853
|
}
|
|
866796
866854
|
function isMemoryRecord(value) {
|
|
866797
|
-
if (!
|
|
866855
|
+
if (!isRecord41(value))
|
|
866798
866856
|
return false;
|
|
866799
866857
|
return typeof value.id === "string" && typeof value.scope === "string" && isMemoryScope2(value.scope) && typeof value.cls === "string" && isMemoryClass2(value.cls) && typeof value.summary === "string" && (value.detail === undefined || typeof value.detail === "string") && isStringArray6(value.tags) && Array.isArray(value.provenance) && value.provenance.every(isProvenanceLink) && typeof value.reviewState === "string" && isReviewState(value.reviewState) && typeof value.confidence === "number" && typeof value.createdAt === "number" && typeof value.updatedAt === "number";
|
|
866800
866858
|
}
|
|
866801
866859
|
function isMemoryLink(value) {
|
|
866802
|
-
if (!
|
|
866860
|
+
if (!isRecord41(value))
|
|
866803
866861
|
return false;
|
|
866804
866862
|
return typeof value.fromId === "string" && typeof value.toId === "string" && typeof value.relation === "string" && typeof value.createdAt === "number";
|
|
866805
866863
|
}
|
|
866806
866864
|
function isMemoryBundle(value) {
|
|
866807
|
-
if (!
|
|
866865
|
+
if (!isRecord41(value))
|
|
866808
866866
|
return false;
|
|
866809
866867
|
return value.schemaVersion === "v1" && typeof value.exportedAt === "number" && (value.scope === "all" || typeof value.scope === "string" && isMemoryScope2(value.scope)) && typeof value.recordCount === "number" && typeof value.linkCount === "number" && Array.isArray(value.records) && value.records.every(isMemoryRecord) && Array.isArray(value.links) && value.links.every(isMemoryLink);
|
|
866810
866868
|
}
|
|
@@ -869250,7 +869308,7 @@ async function handleDelegateCommand(runtime2) {
|
|
|
869250
869308
|
surfaceKind: "goodvibes-agent",
|
|
869251
869309
|
surfaceId: "goodvibes-agent-cli"
|
|
869252
869310
|
});
|
|
869253
|
-
const sessionId =
|
|
869311
|
+
const sessionId = isRecord25(created.session) && typeof created.session.id === "string" ? created.session.id : null;
|
|
869254
869312
|
if (!sessionId)
|
|
869255
869313
|
throw new Error("sessions.create returned no session id.");
|
|
869256
869314
|
const message = await sdk.operator.invoke("sessions.messages.create", {
|
|
@@ -887128,11 +887186,11 @@ function readLimit19(value, fallback) {
|
|
|
887128
887186
|
return fallback;
|
|
887129
887187
|
return Math.max(1, Math.min(100, Math.trunc(parsed)));
|
|
887130
887188
|
}
|
|
887131
|
-
function
|
|
887189
|
+
function isRecord42(value) {
|
|
887132
887190
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
887133
887191
|
}
|
|
887134
887192
|
function asRecord4(value) {
|
|
887135
|
-
return
|
|
887193
|
+
return isRecord42(value) ? value : {};
|
|
887136
887194
|
}
|
|
887137
887195
|
function normalized(value) {
|
|
887138
887196
|
return value.toLowerCase();
|
|
@@ -887227,7 +887285,7 @@ function summarizeJsonArtifact(artifactId, parsed) {
|
|
|
887227
887285
|
};
|
|
887228
887286
|
}
|
|
887229
887287
|
if (artifactId === "release-readiness") {
|
|
887230
|
-
const items = Array.isArray(root.items) ? root.items.filter(
|
|
887288
|
+
const items = Array.isArray(root.items) ? root.items.filter(isRecord42) : [];
|
|
887231
887289
|
return {
|
|
887232
887290
|
gate: root.gate,
|
|
887233
887291
|
checkedAt: root.checkedAt,
|
|
@@ -887398,7 +887456,7 @@ var QUALITY_DIMENSIONS = [
|
|
|
887398
887456
|
"safetyBoundary",
|
|
887399
887457
|
"releaseEvidence"
|
|
887400
887458
|
];
|
|
887401
|
-
function
|
|
887459
|
+
function isRecord43(value) {
|
|
887402
887460
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
887403
887461
|
}
|
|
887404
887462
|
function readString65(value) {
|
|
@@ -887417,7 +887475,7 @@ function loadReleaseReadiness() {
|
|
|
887417
887475
|
try {
|
|
887418
887476
|
const source = readFileSync92(RELEASE_READINESS_PATH, "utf-8");
|
|
887419
887477
|
const parsed = JSON.parse(source);
|
|
887420
|
-
if (!
|
|
887478
|
+
if (!isRecord43(parsed))
|
|
887421
887479
|
return { status: "unavailable", reason: `${RELEASE_READINESS_RELATIVE_PATH} must contain a JSON object.` };
|
|
887422
887480
|
return { status: "available", root: parsed, source };
|
|
887423
887481
|
} catch (error52) {
|
|
@@ -887426,10 +887484,10 @@ function loadReleaseReadiness() {
|
|
|
887426
887484
|
}
|
|
887427
887485
|
}
|
|
887428
887486
|
function releaseReadinessItems(root) {
|
|
887429
|
-
return Array.isArray(root.items) ? root.items.filter(
|
|
887487
|
+
return Array.isArray(root.items) ? root.items.filter(isRecord43) : [];
|
|
887430
887488
|
}
|
|
887431
887489
|
function releaseReadinessSources(root) {
|
|
887432
|
-
return Array.isArray(root.sources) ? root.sources.filter(
|
|
887490
|
+
return Array.isArray(root.sources) ? root.sources.filter(isRecord43) : [];
|
|
887433
887491
|
}
|
|
887434
887492
|
function normalized2(value) {
|
|
887435
887493
|
return value.toLowerCase();
|
|
@@ -887441,7 +887499,7 @@ function itemSearchText(item) {
|
|
|
887441
887499
|
if (typeof value === "string")
|
|
887442
887500
|
fields.push(value);
|
|
887443
887501
|
}
|
|
887444
|
-
if (
|
|
887502
|
+
if (isRecord43(item.quality)) {
|
|
887445
887503
|
fields.push(...Object.values(item.quality).filter((value) => typeof value === "string"));
|
|
887446
887504
|
}
|
|
887447
887505
|
return fields.join(`
|
|
@@ -887470,7 +887528,7 @@ function countBy2(items, key) {
|
|
|
887470
887528
|
}
|
|
887471
887529
|
function qualityDimensionCount(item) {
|
|
887472
887530
|
const quality = item.quality;
|
|
887473
|
-
if (!
|
|
887531
|
+
if (!isRecord43(quality))
|
|
887474
887532
|
return 0;
|
|
887475
887533
|
return QUALITY_DIMENSIONS.filter((dimension2) => readString65(quality[dimension2])).length;
|
|
887476
887534
|
}
|
|
@@ -887707,11 +887765,11 @@ function readLimit21(value, fallback) {
|
|
|
887707
887765
|
return fallback;
|
|
887708
887766
|
return Math.max(1, Math.min(500, Math.trunc(parsed)));
|
|
887709
887767
|
}
|
|
887710
|
-
function
|
|
887768
|
+
function isRecord44(value) {
|
|
887711
887769
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
887712
887770
|
}
|
|
887713
887771
|
function readRecordArray2(value) {
|
|
887714
|
-
return Array.isArray(value) ? value.filter(
|
|
887772
|
+
return Array.isArray(value) ? value.filter(isRecord44) : [];
|
|
887715
887773
|
}
|
|
887716
887774
|
function readArray4(value) {
|
|
887717
887775
|
return Array.isArray(value) ? value : [];
|
|
@@ -887719,7 +887777,7 @@ function readArray4(value) {
|
|
|
887719
887777
|
function readNestedValue(source, path7) {
|
|
887720
887778
|
let cursor = source;
|
|
887721
887779
|
for (const part of path7.split(".")) {
|
|
887722
|
-
if (!
|
|
887780
|
+
if (!isRecord44(cursor))
|
|
887723
887781
|
return;
|
|
887724
887782
|
cursor = cursor[part];
|
|
887725
887783
|
}
|
|
@@ -887798,11 +887856,11 @@ function describeFinding(finding, includeParameters, lookup) {
|
|
|
887798
887856
|
};
|
|
887799
887857
|
}
|
|
887800
887858
|
function buildTokenFindings(securitySnapshot) {
|
|
887801
|
-
const audit =
|
|
887859
|
+
const audit = isRecord44(securitySnapshot?.audit) ? securitySnapshot.audit : null;
|
|
887802
887860
|
const results = readRecordArray2(audit?.results);
|
|
887803
887861
|
return results.map((result2, index) => {
|
|
887804
|
-
const scope =
|
|
887805
|
-
const rotation =
|
|
887862
|
+
const scope = isRecord44(result2.scope) ? result2.scope : {};
|
|
887863
|
+
const rotation = isRecord44(result2.rotation) ? result2.rotation : {};
|
|
887806
887864
|
const label = safeText(result2.label, `token-${index + 1}`);
|
|
887807
887865
|
const scopeOutcome = safeText(scope.outcome);
|
|
887808
887866
|
const rotationOutcome = safeText(rotation.outcome);
|
|
@@ -887852,7 +887910,7 @@ function buildPolicyFindings(context) {
|
|
|
887852
887910
|
}
|
|
887853
887911
|
};
|
|
887854
887912
|
});
|
|
887855
|
-
const preflight =
|
|
887913
|
+
const preflight = isRecord44(policySnapshot.lastPreflightReview) ? policySnapshot.lastPreflightReview : null;
|
|
887856
887914
|
if (!preflight || safeText(preflight.status, "ok") === "ok")
|
|
887857
887915
|
return findings;
|
|
887858
887916
|
return [
|
|
@@ -887874,7 +887932,7 @@ function buildPolicyFindings(context) {
|
|
|
887874
887932
|
function buildMcpFindings(securitySnapshot) {
|
|
887875
887933
|
const mcpServers = readRecordArray2(securitySnapshot?.mcpServers);
|
|
887876
887934
|
const recentMcpDecisions = readArray4(securitySnapshot?.recentMcpDecisions);
|
|
887877
|
-
const attackPathReview =
|
|
887935
|
+
const attackPathReview = isRecord44(securitySnapshot?.attackPathReview) ? securitySnapshot.attackPathReview : buildMcpAttackPathReview2({ servers: mcpServers, recentDecisions: recentMcpDecisions });
|
|
887878
887936
|
const attackFindings = readRecordArray2(attackPathReview.findings).map((finding, index) => {
|
|
887879
887937
|
const serverName = safeText(finding.serverName, `server-${index + 1}`);
|
|
887880
887938
|
const severityRaw = safeText(finding.severity, "warn").toLowerCase();
|
|
@@ -887978,7 +888036,7 @@ function buildIncidentFindings(securitySnapshot) {
|
|
|
887978
888036
|
function readSecuritySnapshot(context) {
|
|
887979
888037
|
try {
|
|
887980
888038
|
const snapshot2 = context.platform.readModels?.security.getSnapshot();
|
|
887981
|
-
return
|
|
888039
|
+
return isRecord44(snapshot2) ? snapshot2 : null;
|
|
887982
888040
|
} catch {
|
|
887983
888041
|
return null;
|
|
887984
888042
|
}
|
|
@@ -888016,8 +888074,8 @@ async function securityPostureSummary(context, args2) {
|
|
|
888016
888074
|
policy: "Security read models are unavailable in this Agent context."
|
|
888017
888075
|
};
|
|
888018
888076
|
}
|
|
888019
|
-
const audit =
|
|
888020
|
-
const policy =
|
|
888077
|
+
const audit = isRecord44(securitySnapshot.audit) ? securitySnapshot.audit : {};
|
|
888078
|
+
const policy = isRecord44(securitySnapshot.policy) ? securitySnapshot.policy : {};
|
|
888021
888079
|
const mcpServers = readRecordArray2(securitySnapshot.mcpServers);
|
|
888022
888080
|
const plugins2 = readRecordArray2(securitySnapshot.plugins);
|
|
888023
888081
|
const subscriptions = context.platform.subscriptionManager;
|
|
@@ -888053,7 +888111,7 @@ async function securityPostureSummary(context, args2) {
|
|
|
888053
888111
|
servers: mcpServers.length,
|
|
888054
888112
|
quarantined: countByString(mcpServers, "schemaFreshness", "quarantined"),
|
|
888055
888113
|
elevated: countByString(mcpServers, "trustMode", "allow-all"),
|
|
888056
|
-
attackPathFindings: readRecordArray2(
|
|
888114
|
+
attackPathFindings: readRecordArray2(isRecord44(securitySnapshot.attackPathReview) ? securitySnapshot.attackPathReview.findings : []).length
|
|
888057
888115
|
},
|
|
888058
888116
|
plugins: {
|
|
888059
888117
|
total: plugins2.length,
|
|
@@ -888186,11 +888244,11 @@ function timestampForBundle(bundle) {
|
|
|
888186
888244
|
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
888187
888245
|
}
|
|
888188
888246
|
function summarizeSupportBundle(path7, bundle) {
|
|
888189
|
-
const redaction =
|
|
888190
|
-
const diagnostics =
|
|
888247
|
+
const redaction = isRecord44(bundle.redaction) ? bundle.redaction : {};
|
|
888248
|
+
const diagnostics = isRecord44(bundle.diagnostics) ? bundle.diagnostics : {};
|
|
888191
888249
|
const timestamp2 = timestampForBundle(bundle);
|
|
888192
|
-
const mcpSummary =
|
|
888193
|
-
const pluginSummary =
|
|
888250
|
+
const mcpSummary = isRecord44(bundle.mcpSummary) ? bundle.mcpSummary : {};
|
|
888251
|
+
const pluginSummary = isRecord44(bundle.pluginSummary) ? bundle.pluginSummary : {};
|
|
888194
888252
|
return {
|
|
888195
888253
|
path: path7,
|
|
888196
888254
|
type: summarizeBundleType(bundle),
|
|
@@ -888243,7 +888301,7 @@ function describeHarnessSupportBundle(context, args2) {
|
|
|
888243
888301
|
usage: `Invalid bundle JSON at ${path7}: ${error52 instanceof Error ? error52.message : String(error52)}`
|
|
888244
888302
|
};
|
|
888245
888303
|
}
|
|
888246
|
-
if (!
|
|
888304
|
+
if (!isRecord44(parsed)) {
|
|
888247
888305
|
return {
|
|
888248
888306
|
status: "missing_lookup",
|
|
888249
888307
|
usage: `Invalid bundle JSON at ${path7}: expected a JSON object.`
|