@pellux/goodvibes-agent 1.1.1 → 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 +9 -0
- package/README.md +1 -1
- package/dist/package/main.js +196 -197
- 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/input/agent-workspace-categories.ts +0 -1
- 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: [
|
|
@@ -800269,8 +800269,8 @@ async function dispatchOpenAICompatibleRoutes(request2, context, pathPrefix = OP
|
|
|
800269
800269
|
function handleListModels(context) {
|
|
800270
800270
|
const created = Math.floor(Date.now() / 1000);
|
|
800271
800271
|
const models = context.providerRegistry.listModels();
|
|
800272
|
-
const current =
|
|
800273
|
-
const ids = new Set(
|
|
800272
|
+
const current = context.providerRegistry.getCurrentModel();
|
|
800273
|
+
const ids = new Set(["goodvibes/current"]);
|
|
800274
800274
|
for (const model of models) {
|
|
800275
800275
|
ids.add(model.registryKey);
|
|
800276
800276
|
}
|
|
@@ -800280,7 +800280,7 @@ function handleListModels(context) {
|
|
|
800280
800280
|
id,
|
|
800281
800281
|
object: "model",
|
|
800282
800282
|
created,
|
|
800283
|
-
owned_by: id.startsWith("goodvibes/") ? "goodvibes" : modelOwnerFor(id, models, current
|
|
800283
|
+
owned_by: id.startsWith("goodvibes/") ? "goodvibes" : modelOwnerFor(id, models, current.provider)
|
|
800284
800284
|
}))
|
|
800285
800285
|
});
|
|
800286
800286
|
}
|
|
@@ -800328,12 +800328,12 @@ async function handleChatCompletions(request2, context) {
|
|
|
800328
800328
|
}
|
|
800329
800329
|
}
|
|
800330
800330
|
function resolveModel(registry3, requested) {
|
|
800331
|
+
const current = registry3.getCurrentModel();
|
|
800331
800332
|
const raw = requested?.trim();
|
|
800332
800333
|
if (!raw) {
|
|
800333
800334
|
throw new Error("Missing required field: model.");
|
|
800334
800335
|
}
|
|
800335
800336
|
if (raw === "goodvibes/current") {
|
|
800336
|
-
const current = registry3.getCurrentModel();
|
|
800337
800337
|
return {
|
|
800338
800338
|
provider: registry3.getForModel(current.registryKey, current.provider),
|
|
800339
800339
|
providerId: current.provider,
|
|
@@ -800353,13 +800353,6 @@ function resolveModel(registry3, requested) {
|
|
|
800353
800353
|
}
|
|
800354
800354
|
throw new Error(raw.includes(":") ? `Model '${raw}' not found.` : `Model '${raw}' must be requested as a provider-qualified registryKey.`);
|
|
800355
800355
|
}
|
|
800356
|
-
function tryGetCurrentModel(registry3) {
|
|
800357
|
-
try {
|
|
800358
|
-
return registry3.getCurrentModel();
|
|
800359
|
-
} catch {
|
|
800360
|
-
return null;
|
|
800361
|
-
}
|
|
800362
|
-
}
|
|
800363
800356
|
function prepareChatRequest(input) {
|
|
800364
800357
|
const systemParts = [];
|
|
800365
800358
|
const messages = [];
|
|
@@ -801369,58 +801362,14 @@ class DaemonHttpRouter {
|
|
|
801369
801362
|
return handleGenericWebhookSurface(req, this.context.buildGenericWebhookAdapterContext());
|
|
801370
801363
|
}
|
|
801371
801364
|
}
|
|
801372
|
-
function
|
|
801373
|
-
if (Array.isArray(value))
|
|
801374
|
-
return value.map(normalizeAgentKnowledgeAliasPayload);
|
|
801375
|
-
if (!value || typeof value !== "object")
|
|
801376
|
-
return value;
|
|
801377
|
-
const output = {};
|
|
801378
|
-
let changed = false;
|
|
801379
|
-
for (const [key, nested] of Object.entries(value)) {
|
|
801380
|
-
if (AGENT_KNOWLEDGE_SCOPE_FIELDS.has(key) && nested === DEFAULT_KNOWLEDGE_SPACE_ID) {
|
|
801381
|
-
output[key] = AGENT_KNOWLEDGE_PUBLIC_SPACE_ID;
|
|
801382
|
-
changed = true;
|
|
801383
|
-
continue;
|
|
801384
|
-
}
|
|
801385
|
-
const normalized = normalizeAgentKnowledgeAliasPayload(nested);
|
|
801386
|
-
output[key] = normalized;
|
|
801387
|
-
if (normalized !== nested)
|
|
801388
|
-
changed = true;
|
|
801389
|
-
}
|
|
801390
|
-
return changed ? output : value;
|
|
801391
|
-
}
|
|
801392
|
-
async function normalizeAgentKnowledgeAliasResponse(response5) {
|
|
801393
|
-
const contentType = response5.headers.get("content-type") ?? "";
|
|
801394
|
-
if (!contentType.toLowerCase().includes("application/json"))
|
|
801395
|
-
return response5;
|
|
801396
|
-
let parsed;
|
|
801397
|
-
try {
|
|
801398
|
-
parsed = await response5.clone().json();
|
|
801399
|
-
} catch {
|
|
801400
|
-
return response5;
|
|
801401
|
-
}
|
|
801402
|
-
const normalized = normalizeAgentKnowledgeAliasPayload(parsed);
|
|
801403
|
-
if (normalized === parsed)
|
|
801404
|
-
return response5;
|
|
801405
|
-
const headers = new Headers(response5.headers);
|
|
801406
|
-
headers.delete("content-length");
|
|
801407
|
-
headers.set("content-type", "application/json");
|
|
801408
|
-
return Response.json(normalized, {
|
|
801409
|
-
status: response5.status,
|
|
801410
|
-
statusText: response5.statusText,
|
|
801411
|
-
headers
|
|
801412
|
-
});
|
|
801413
|
-
}
|
|
801414
|
-
async function dispatchAliasedKnowledgeRoutes(req, aliasPrefix, handlers) {
|
|
801365
|
+
function dispatchAliasedKnowledgeRoutes(req, aliasPrefix, handlers) {
|
|
801415
801366
|
const url2 = new URL(req.url);
|
|
801416
801367
|
if (!url2.pathname.startsWith(aliasPrefix))
|
|
801417
801368
|
return null;
|
|
801418
801369
|
const suffix = url2.pathname.slice(aliasPrefix.length);
|
|
801419
801370
|
url2.pathname = `/api/knowledge${suffix}`;
|
|
801420
|
-
|
|
801421
|
-
return response5 ? normalizeAgentKnowledgeAliasResponse(response5) : null;
|
|
801371
|
+
return dispatchDaemonApiRoutes(new Request(url2.toString(), req), handlers);
|
|
801422
801372
|
}
|
|
801423
|
-
var AGENT_KNOWLEDGE_PUBLIC_SPACE_ID, AGENT_KNOWLEDGE_SCOPE_FIELDS;
|
|
801424
801373
|
var init_router = __esm(() => {
|
|
801425
801374
|
init_schema();
|
|
801426
801375
|
init_http_auth();
|
|
@@ -801455,8 +801404,6 @@ var init_router = __esm(() => {
|
|
|
801455
801404
|
init_home_graph_routes();
|
|
801456
801405
|
init_openai_compatible_routes();
|
|
801457
801406
|
init_router_request_body();
|
|
801458
|
-
AGENT_KNOWLEDGE_PUBLIC_SPACE_ID = goodVibesAgentKnowledgeSpaceId();
|
|
801459
|
-
AGENT_KNOWLEDGE_SCOPE_FIELDS = new Set(["spaceId", "knowledgeSpaceId", "namespace"]);
|
|
801460
801407
|
});
|
|
801461
801408
|
|
|
801462
801409
|
// node_modules/@pellux/goodvibes-sdk/dist/platform/companion/companion-chat-persistence.js
|
|
@@ -817145,7 +817092,7 @@ var createStyledCell = (char, overrides = {}) => ({
|
|
|
817145
817092
|
// src/version.ts
|
|
817146
817093
|
import { readFileSync } from "fs";
|
|
817147
817094
|
import { join } from "path";
|
|
817148
|
-
var _version = "1.1.
|
|
817095
|
+
var _version = "1.1.3";
|
|
817149
817096
|
try {
|
|
817150
817097
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, "..", "package.json"), "utf-8"));
|
|
817151
817098
|
_version = typeof pkg.version === "string" ? pkg.version : _version;
|
|
@@ -843103,11 +843050,50 @@ function createBrowserAgentSdk(options = {}) {
|
|
|
843103
843050
|
return createBrowserKnowledgeSdkFromRoutes(AGENT_BROWSER_ROUTES, options);
|
|
843104
843051
|
}
|
|
843105
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
|
+
|
|
843106
843092
|
// src/runtime/connected-host-auth.ts
|
|
843107
843093
|
import { createHash as createHash20 } from "crypto";
|
|
843108
843094
|
import { existsSync as existsSync64, readFileSync as readFileSync68 } from "fs";
|
|
843109
843095
|
import { join as join84 } from "path";
|
|
843110
|
-
function
|
|
843096
|
+
function isRecord24(value) {
|
|
843111
843097
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
843112
843098
|
}
|
|
843113
843099
|
function connectedHostOperatorTokenPath(homeDirectory) {
|
|
@@ -843135,7 +843121,7 @@ function readConnectedHostOperatorToken(homeDirectory) {
|
|
|
843135
843121
|
return { path: path7, present: false, token: null };
|
|
843136
843122
|
try {
|
|
843137
843123
|
const parsed = JSON.parse(readFileSync68(path7, "utf-8"));
|
|
843138
|
-
const token =
|
|
843124
|
+
const token = isRecord24(parsed) && typeof parsed.token === "string" && parsed.token.trim().length > 0 ? parsed.token : null;
|
|
843139
843125
|
return { path: path7, present: true, token };
|
|
843140
843126
|
} catch (error51) {
|
|
843141
843127
|
return { path: path7, present: true, token: null, error: error51 instanceof Error ? error51.message : String(error51) };
|
|
@@ -843155,7 +843141,7 @@ function connectedHostTokenRequiredMessage(path7) {
|
|
|
843155
843141
|
}
|
|
843156
843142
|
|
|
843157
843143
|
// src/cli/agent-knowledge-runtime.ts
|
|
843158
|
-
function
|
|
843144
|
+
function isRecord25(value) {
|
|
843159
843145
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
843160
843146
|
}
|
|
843161
843147
|
function readPackageMetadata() {
|
|
@@ -843209,17 +843195,30 @@ async function classifyKnowledgeError(error51, connection5, route) {
|
|
|
843209
843195
|
}
|
|
843210
843196
|
return { ok: false, kind: "connected_host_error", error: message, baseUrl: connection5.baseUrl, route };
|
|
843211
843197
|
}
|
|
843198
|
+
function normalizeAgentKnowledgeData(data) {
|
|
843199
|
+
return normalizeAgentKnowledgeScopeAliases(data);
|
|
843200
|
+
}
|
|
843212
843201
|
function createAgentSdk(connection5) {
|
|
843213
|
-
|
|
843202
|
+
const sdk = createBrowserAgentSdk({
|
|
843214
843203
|
baseUrl: connection5.baseUrl,
|
|
843215
843204
|
authToken: connection5.token
|
|
843216
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
|
+
};
|
|
843217
843216
|
}
|
|
843218
|
-
var AGENT_KNOWLEDGE_SCOPE_KEYS = new Set(["spaceid", "knowledgespaceid"]);
|
|
843217
|
+
var AGENT_KNOWLEDGE_SCOPE_KEYS = new Set(["spaceid", "knowledgespaceid", "namespace"]);
|
|
843219
843218
|
var AGENT_KNOWLEDGE_SCOPE_TEXT_PATTERNS = [
|
|
843220
843219
|
{
|
|
843221
843220
|
label: "default knowledge scope id",
|
|
843222
|
-
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
|
|
843223
843222
|
},
|
|
843224
843223
|
{ label: "host assistant payload marker", pattern: /home\s*assistant/i },
|
|
843225
843224
|
{ label: "host graph payload marker", pattern: /home\s*graph|homegraph/i }
|
|
@@ -843281,10 +843280,11 @@ function agentKnowledgeScopeContaminationFailure(connection5, route, finding) {
|
|
|
843281
843280
|
};
|
|
843282
843281
|
}
|
|
843283
843282
|
function validateAgentKnowledgeData(data, connection5, method) {
|
|
843284
|
-
const
|
|
843283
|
+
const normalized = normalizeAgentKnowledgeData(data);
|
|
843284
|
+
const contamination = findAgentKnowledgeScopeContamination(normalized);
|
|
843285
843285
|
if (contamination)
|
|
843286
843286
|
return agentKnowledgeScopeContaminationFailure(connection5, method.route, contamination);
|
|
843287
|
-
return { ok: true, kind: method.kind, route: method.route, data };
|
|
843287
|
+
return { ok: true, kind: method.kind, route: method.route, data: normalized };
|
|
843288
843288
|
}
|
|
843289
843289
|
async function postAgentKnowledgeJson(connection5, route, body2) {
|
|
843290
843290
|
const response5 = await fetch(`${connection5.baseUrl}${route}`, {
|
|
@@ -843305,10 +843305,10 @@ async function postAgentKnowledgeJson(connection5, route, body2) {
|
|
|
843305
843305
|
}
|
|
843306
843306
|
}
|
|
843307
843307
|
if (!response5.ok) {
|
|
843308
|
-
const detail =
|
|
843308
|
+
const detail = isRecord25(parsed) && typeof parsed.error === "string" ? parsed.error : text;
|
|
843309
843309
|
throw new Error(`HTTP ${response5.status} ${response5.statusText}${detail ? `: ${detail}` : ""}`);
|
|
843310
843310
|
}
|
|
843311
|
-
return parsed;
|
|
843311
|
+
return normalizeAgentKnowledgeData(parsed);
|
|
843312
843312
|
}
|
|
843313
843313
|
function queryRoute(route, query2) {
|
|
843314
843314
|
const params = new URLSearchParams;
|
|
@@ -843345,10 +843345,10 @@ async function getAgentKnowledgeJson(connection5, route, query2 = {}) {
|
|
|
843345
843345
|
}
|
|
843346
843346
|
}
|
|
843347
843347
|
if (!response5.ok) {
|
|
843348
|
-
const detail =
|
|
843348
|
+
const detail = isRecord25(parsed) && typeof parsed.error === "string" ? parsed.error : text;
|
|
843349
843349
|
throw new Error(`HTTP ${response5.status} ${response5.statusText}${detail ? `: ${detail}` : ""}`);
|
|
843350
843350
|
}
|
|
843351
|
-
return parsed;
|
|
843351
|
+
return normalizeAgentKnowledgeData(parsed);
|
|
843352
843352
|
}
|
|
843353
843353
|
function findDisallowedKnowledgeScopeFlag(args2) {
|
|
843354
843354
|
const disallowed = [
|
|
@@ -843477,7 +843477,7 @@ var DELEGATION_METHOD = {
|
|
|
843477
843477
|
};
|
|
843478
843478
|
|
|
843479
843479
|
// src/cli/agent-knowledge-format.ts
|
|
843480
|
-
function
|
|
843480
|
+
function isRecord26(value) {
|
|
843481
843481
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
843482
843482
|
}
|
|
843483
843483
|
function readString31(record2, key) {
|
|
@@ -843518,14 +843518,14 @@ function formatAgentKnowledgeFailureKind(kind2) {
|
|
|
843518
843518
|
return kind2.replace(/[_-]+/g, " ");
|
|
843519
843519
|
}
|
|
843520
843520
|
function sourceLine(value) {
|
|
843521
|
-
const record2 =
|
|
843521
|
+
const record2 = isRecord26(value) ? value : {};
|
|
843522
843522
|
const title = cleanInline(record2.title) || cleanInline(record2.canonicalUri) || cleanInline(record2.sourceUri) || cleanInline(record2.url) || cleanInline(record2.id) || "untitled";
|
|
843523
843523
|
const type = cleanInline(record2.sourceType) || cleanInline(record2.type) || "source";
|
|
843524
843524
|
const url2 = cleanInline(record2.canonicalUri) || cleanInline(record2.sourceUri) || cleanInline(record2.url);
|
|
843525
843525
|
return url2 && url2 !== title ? `[${type}] ${title} (${url2})` : `[${type}] ${title}`;
|
|
843526
843526
|
}
|
|
843527
843527
|
function resultLine(value) {
|
|
843528
|
-
const record2 =
|
|
843528
|
+
const record2 = isRecord26(value) ? value : {};
|
|
843529
843529
|
const title = cleanInline(record2.title) || cleanInline(record2.id) || "untitled";
|
|
843530
843530
|
const id = cleanInline(record2.id);
|
|
843531
843531
|
const type = cleanInline(record2.type) || cleanInline(record2.kind) || cleanInline(record2.sourceType) || "result";
|
|
@@ -843542,7 +843542,7 @@ function resultLine(value) {
|
|
|
843542
843542
|
${snippet}` : parts2.join(" ");
|
|
843543
843543
|
}
|
|
843544
843544
|
function nodeLine(value) {
|
|
843545
|
-
const record2 =
|
|
843545
|
+
const record2 = isRecord26(value) ? value : {};
|
|
843546
843546
|
const id = cleanInline(record2.id);
|
|
843547
843547
|
const kind2 = cleanInline(record2.kind) || "node";
|
|
843548
843548
|
const title = cleanInline(record2.title) || id || "untitled";
|
|
@@ -843559,7 +843559,7 @@ function nodeLine(value) {
|
|
|
843559
843559
|
${summary}` : parts2.join(" ");
|
|
843560
843560
|
}
|
|
843561
843561
|
function issueLine(value) {
|
|
843562
|
-
const record2 =
|
|
843562
|
+
const record2 = isRecord26(value) ? value : {};
|
|
843563
843563
|
const id = cleanInline(record2.id) || "issue";
|
|
843564
843564
|
const severity = cleanInline(record2.severity) || "unknown";
|
|
843565
843565
|
const code2 = cleanInline(record2.code) || "issue";
|
|
@@ -843569,7 +843569,7 @@ function issueLine(value) {
|
|
|
843569
843569
|
return ` - ${id} [${severity}] ${code2}${suffix}${message ? ` - ${message}` : ""}`;
|
|
843570
843570
|
}
|
|
843571
843571
|
function connectorLine(value) {
|
|
843572
|
-
const record2 =
|
|
843572
|
+
const record2 = isRecord26(value) ? value : {};
|
|
843573
843573
|
const id = cleanInline(record2.id) || "connector";
|
|
843574
843574
|
const name51 = cleanInline(record2.displayName) || id;
|
|
843575
843575
|
const sourceType = cleanInline(record2.sourceType);
|
|
@@ -843582,7 +843582,7 @@ function relatedKnowledgeCountsLine(relatedEdges, linkedSources, linkedNodes) {
|
|
|
843582
843582
|
return ` related edges ${relatedEdges} linked sources ${linkedSources} linked nodes ${linkedNodes}`;
|
|
843583
843583
|
}
|
|
843584
843584
|
function formatStatus2(data) {
|
|
843585
|
-
const record2 =
|
|
843585
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843586
843586
|
const ready = readBoolean7(record2, "ready");
|
|
843587
843587
|
const sourceCount = readNumber8(record2, "sourceCount");
|
|
843588
843588
|
const nodeCount = readNumber8(record2, "nodeCount");
|
|
@@ -843602,7 +843602,7 @@ function formatStatus2(data) {
|
|
|
843602
843602
|
`);
|
|
843603
843603
|
}
|
|
843604
843604
|
function formatEntityList(data, kind2, limit3) {
|
|
843605
|
-
const record2 =
|
|
843605
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843606
843606
|
const values2 = readArray2(record2, kind2);
|
|
843607
843607
|
if (values2.length === 0) {
|
|
843608
843608
|
return [
|
|
@@ -843621,7 +843621,7 @@ function formatEntityList(data, kind2, limit3) {
|
|
|
843621
843621
|
`);
|
|
843622
843622
|
}
|
|
843623
843623
|
function formatItem(data, id) {
|
|
843624
|
-
const record2 =
|
|
843624
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843625
843625
|
const source = record2.source;
|
|
843626
843626
|
const node = record2.node;
|
|
843627
843627
|
const issue2 = record2.issue;
|
|
@@ -843663,7 +843663,7 @@ function formatItem(data, id) {
|
|
|
843663
843663
|
`);
|
|
843664
843664
|
}
|
|
843665
843665
|
function formatMap2(data) {
|
|
843666
|
-
const record2 =
|
|
843666
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843667
843667
|
const sources = readArray2(record2, "sources");
|
|
843668
843668
|
const nodes = readArray2(record2, "nodes");
|
|
843669
843669
|
const edges = readArray2(record2, "edges");
|
|
@@ -843679,7 +843679,7 @@ function formatMap2(data) {
|
|
|
843679
843679
|
`);
|
|
843680
843680
|
}
|
|
843681
843681
|
function formatConnectors(data) {
|
|
843682
|
-
const record2 =
|
|
843682
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843683
843683
|
const connectors = readArray2(record2, "connectors");
|
|
843684
843684
|
if (connectors.length === 0) {
|
|
843685
843685
|
return [
|
|
@@ -843697,8 +843697,8 @@ function formatConnectors(data) {
|
|
|
843697
843697
|
`);
|
|
843698
843698
|
}
|
|
843699
843699
|
function formatConnector(data, id) {
|
|
843700
|
-
const record2 =
|
|
843701
|
-
const connector =
|
|
843700
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843701
|
+
const connector = isRecord26(record2.connector) ? record2.connector : record2;
|
|
843702
843702
|
const connectorId = cleanInline(connector.id) || id;
|
|
843703
843703
|
const name51 = cleanInline(connector.displayName) || connectorId;
|
|
843704
843704
|
const description = cleanInline(connector.description);
|
|
@@ -843717,7 +843717,7 @@ function formatConnector(data, id) {
|
|
|
843717
843717
|
`);
|
|
843718
843718
|
}
|
|
843719
843719
|
function formatConnectorDoctor(data, id) {
|
|
843720
|
-
const record2 =
|
|
843720
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843721
843721
|
const ready = readBoolean7(record2, "ready");
|
|
843722
843722
|
const summary = cleanInline(record2.summary);
|
|
843723
843723
|
const checks3 = readArray2(record2, "checks");
|
|
@@ -843728,7 +843728,7 @@ function formatConnectorDoctor(data, id) {
|
|
|
843728
843728
|
summary ? ` summary ${summary}` : null,
|
|
843729
843729
|
checks3.length > 0 ? " checks" : null,
|
|
843730
843730
|
...checks3.slice(0, 10).map((check2) => {
|
|
843731
|
-
const item =
|
|
843731
|
+
const item = isRecord26(check2) ? check2 : {};
|
|
843732
843732
|
const checkId = cleanInline(item.id) || "check";
|
|
843733
843733
|
const status = cleanInline(item.status) || "unknown";
|
|
843734
843734
|
const label = cleanInline(item.label);
|
|
@@ -843742,8 +843742,8 @@ function formatConnectorDoctor(data, id) {
|
|
|
843742
843742
|
`);
|
|
843743
843743
|
}
|
|
843744
843744
|
function formatAsk(data, query2) {
|
|
843745
|
-
const record2 =
|
|
843746
|
-
const answer =
|
|
843745
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843746
|
+
const answer = isRecord26(record2.answer) ? record2.answer : record2;
|
|
843747
843747
|
const text = cleanInline(answer.text) || cleanInline(record2.answer) || "No answer returned.";
|
|
843748
843748
|
const confidence = readNumber8(answer, "confidence") ?? readNumber8(record2, "confidence");
|
|
843749
843749
|
const synthesized = readBoolean7(answer, "synthesized");
|
|
@@ -843768,7 +843768,7 @@ function formatAsk(data, query2) {
|
|
|
843768
843768
|
`);
|
|
843769
843769
|
}
|
|
843770
843770
|
function formatSearch(data, query2) {
|
|
843771
|
-
const record2 =
|
|
843771
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843772
843772
|
const items = readArray2(record2, "items");
|
|
843773
843773
|
const results = items.length > 0 ? items : readArray2(record2, "results");
|
|
843774
843774
|
if (results.length === 0) {
|
|
@@ -843787,8 +843787,8 @@ function formatSearch(data, query2) {
|
|
|
843787
843787
|
`);
|
|
843788
843788
|
}
|
|
843789
843789
|
function formatIngest(data, target, label = "ingest-url", route = "/api/goodvibes-agent/knowledge/ingest/url", targetLabel = "url") {
|
|
843790
|
-
const record2 =
|
|
843791
|
-
const source =
|
|
843790
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843791
|
+
const source = isRecord26(record2.source) ? record2.source : record2;
|
|
843792
843792
|
const sourceId = cleanInline(source.id);
|
|
843793
843793
|
const canonicalUri = cleanInline(source.canonicalUri) || cleanInline(source.sourceUri) || target;
|
|
843794
843794
|
const artifactId = cleanInline(record2.artifactId);
|
|
@@ -843802,7 +843802,7 @@ function formatIngest(data, target, label = "ingest-url", route = "/api/goodvibe
|
|
|
843802
843802
|
`);
|
|
843803
843803
|
}
|
|
843804
843804
|
function formatBatchIngest(data, label) {
|
|
843805
|
-
const record2 =
|
|
843805
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843806
843806
|
const imported = readNumber8(record2, "imported");
|
|
843807
843807
|
const failed = readNumber8(record2, "failed");
|
|
843808
843808
|
const sources = readArray2(record2, "sources");
|
|
@@ -843818,8 +843818,8 @@ function formatBatchIngest(data, label) {
|
|
|
843818
843818
|
`);
|
|
843819
843819
|
}
|
|
843820
843820
|
function formatReindex(data) {
|
|
843821
|
-
const record2 =
|
|
843822
|
-
const status =
|
|
843821
|
+
const record2 = isRecord26(data) ? data : {};
|
|
843822
|
+
const status = isRecord26(record2.status) ? record2.status : {};
|
|
843823
843823
|
return [
|
|
843824
843824
|
"Agent Knowledge reindex complete",
|
|
843825
843825
|
` sources ${readNumber8(status, "sourceCount") ?? "unknown"}`,
|
|
@@ -844365,7 +844365,7 @@ var SECRET_PATTERNS2 = [
|
|
|
844365
844365
|
/\bgh[pousr]_[A-Za-z0-9_]{16,}\b/i,
|
|
844366
844366
|
/\b(?:password|passwd|api[_-]?key|token|secret)\s*[:=]\s*\S{6,}/i
|
|
844367
844367
|
];
|
|
844368
|
-
function
|
|
844368
|
+
function isRecord27(value) {
|
|
844369
844369
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
844370
844370
|
}
|
|
844371
844371
|
function readString34(value, fallback = "") {
|
|
@@ -844410,7 +844410,7 @@ function assertNoSecretLikeText(fields, ownerLabel = "Agent local records") {
|
|
|
844410
844410
|
}
|
|
844411
844411
|
}
|
|
844412
844412
|
function parsePersona(value) {
|
|
844413
|
-
if (!
|
|
844413
|
+
if (!isRecord27(value))
|
|
844414
844414
|
return null;
|
|
844415
844415
|
const id = readString34(value.id).trim();
|
|
844416
844416
|
const name51 = normalizeName(readString34(value.name));
|
|
@@ -844440,7 +844440,7 @@ function parsePersona(value) {
|
|
|
844440
844440
|
}
|
|
844441
844441
|
function parseStore(raw) {
|
|
844442
844442
|
const parsed = JSON.parse(raw);
|
|
844443
|
-
if (!
|
|
844443
|
+
if (!isRecord27(parsed))
|
|
844444
844444
|
return { version: STORE_VERSION, activePersonaId: null, personas: [] };
|
|
844445
844445
|
const personas = Array.isArray(parsed.personas) ? parsed.personas.map(parsePersona).filter((entry) => entry !== null) : [];
|
|
844446
844446
|
const activePersonaId = readString34(parsed.activePersonaId).trim() || null;
|
|
@@ -844679,7 +844679,7 @@ function buildActivePersonaPrompt(shellPaths) {
|
|
|
844679
844679
|
import { existsSync as existsSync66, mkdirSync as mkdirSync48, readFileSync as readFileSync70, renameSync as renameSync13, writeFileSync as writeFileSync42 } from "fs";
|
|
844680
844680
|
import { dirname as dirname49 } from "path";
|
|
844681
844681
|
var STORE_VERSION2 = 1;
|
|
844682
|
-
function
|
|
844682
|
+
function isRecord28(value) {
|
|
844683
844683
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
844684
844684
|
}
|
|
844685
844685
|
function readString35(value, fallback = "") {
|
|
@@ -844723,7 +844723,7 @@ function assertNoNoteSecretLikeText(fields) {
|
|
|
844723
844723
|
}
|
|
844724
844724
|
}
|
|
844725
844725
|
function parseNote(value) {
|
|
844726
|
-
if (!
|
|
844726
|
+
if (!isRecord28(value))
|
|
844727
844727
|
return null;
|
|
844728
844728
|
const id = readString35(value.id).trim();
|
|
844729
844729
|
const title = normalizeTitle(readString35(value.title));
|
|
@@ -844752,7 +844752,7 @@ function parseNote(value) {
|
|
|
844752
844752
|
}
|
|
844753
844753
|
function parseStore2(raw) {
|
|
844754
844754
|
const parsed = JSON.parse(raw);
|
|
844755
|
-
if (!
|
|
844755
|
+
if (!isRecord28(parsed))
|
|
844756
844756
|
return { version: STORE_VERSION2, notes: [] };
|
|
844757
844757
|
return {
|
|
844758
844758
|
version: STORE_VERSION2,
|
|
@@ -844957,7 +844957,7 @@ import { dirname as dirname51 } from "path";
|
|
|
844957
844957
|
import { accessSync, constants as constants4, existsSync as existsSync67, mkdirSync as mkdirSync49, readFileSync as readFileSync71, renameSync as renameSync14, writeFileSync as writeFileSync43 } from "fs";
|
|
844958
844958
|
import { delimiter, dirname as dirname50, join as join85 } from "path";
|
|
844959
844959
|
var STORE_VERSION3 = 1;
|
|
844960
|
-
function
|
|
844960
|
+
function isRecord29(value) {
|
|
844961
844961
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
844962
844962
|
}
|
|
844963
844963
|
function readString36(value, fallback = "") {
|
|
@@ -845025,7 +845025,7 @@ function normalizeRequirements(values2) {
|
|
|
845025
845025
|
function parseRequirements(value) {
|
|
845026
845026
|
if (!Array.isArray(value))
|
|
845027
845027
|
return [];
|
|
845028
|
-
return normalizeRequirements(value.filter(
|
|
845028
|
+
return normalizeRequirements(value.filter(isRecord29).map((entry) => ({
|
|
845029
845029
|
kind: readRequirementKind(entry.kind) ?? "env",
|
|
845030
845030
|
name: readString36(entry.name).trim(),
|
|
845031
845031
|
description: readString36(entry.description).trim()
|
|
@@ -845052,7 +845052,7 @@ function commandExists(command8, pathValue) {
|
|
|
845052
845052
|
return pathValue.split(delimiter).filter(Boolean).some((pathEntry) => canExecute(join85(pathEntry, command8)));
|
|
845053
845053
|
}
|
|
845054
845054
|
function parseSkill(value) {
|
|
845055
|
-
if (!
|
|
845055
|
+
if (!isRecord29(value))
|
|
845056
845056
|
return null;
|
|
845057
845057
|
const id = readString36(value.id).trim();
|
|
845058
845058
|
const name51 = normalizeName2(readString36(value.name));
|
|
@@ -845083,7 +845083,7 @@ function parseSkill(value) {
|
|
|
845083
845083
|
};
|
|
845084
845084
|
}
|
|
845085
845085
|
function parseBundle(value) {
|
|
845086
|
-
if (!
|
|
845086
|
+
if (!isRecord29(value))
|
|
845087
845087
|
return null;
|
|
845088
845088
|
const id = readString36(value.id).trim();
|
|
845089
845089
|
const name51 = normalizeName2(readString36(value.name));
|
|
@@ -845112,7 +845112,7 @@ function parseBundle(value) {
|
|
|
845112
845112
|
}
|
|
845113
845113
|
function parseStore3(raw) {
|
|
845114
845114
|
const parsed = JSON.parse(raw);
|
|
845115
|
-
if (!
|
|
845115
|
+
if (!isRecord29(parsed))
|
|
845116
845116
|
return { version: STORE_VERSION3, skills: [], bundles: [] };
|
|
845117
845117
|
return {
|
|
845118
845118
|
version: STORE_VERSION3,
|
|
@@ -845602,7 +845602,7 @@ function buildEnabledSkillsPrompt(shellPaths) {
|
|
|
845602
845602
|
|
|
845603
845603
|
// src/agent/routine-registry.ts
|
|
845604
845604
|
var STORE_VERSION4 = 1;
|
|
845605
|
-
function
|
|
845605
|
+
function isRecord30(value) {
|
|
845606
845606
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
845607
845607
|
}
|
|
845608
845608
|
function readString37(value, fallback = "") {
|
|
@@ -845616,7 +845616,7 @@ function readStringArray11(value) {
|
|
|
845616
845616
|
function readRequirementArray(value) {
|
|
845617
845617
|
if (!Array.isArray(value))
|
|
845618
845618
|
return [];
|
|
845619
|
-
const requirements = value.filter(
|
|
845619
|
+
const requirements = value.filter(isRecord30).map((entry) => ({
|
|
845620
845620
|
kind: entry.kind === "command" ? "command" : "env",
|
|
845621
845621
|
name: readString37(entry.name).trim(),
|
|
845622
845622
|
description: readString37(entry.description).trim() || undefined
|
|
@@ -845653,7 +845653,7 @@ function nowIso4() {
|
|
|
845653
845653
|
return new Date().toISOString();
|
|
845654
845654
|
}
|
|
845655
845655
|
function parseRoutine(value) {
|
|
845656
|
-
if (!
|
|
845656
|
+
if (!isRecord30(value))
|
|
845657
845657
|
return null;
|
|
845658
845658
|
const id = readString37(value.id).trim();
|
|
845659
845659
|
const name51 = normalizeName3(readString37(value.name));
|
|
@@ -845688,7 +845688,7 @@ function parseRoutine(value) {
|
|
|
845688
845688
|
}
|
|
845689
845689
|
function parseStore4(raw) {
|
|
845690
845690
|
const parsed = JSON.parse(raw);
|
|
845691
|
-
if (!
|
|
845691
|
+
if (!isRecord30(parsed))
|
|
845692
845692
|
return { version: STORE_VERSION4, routines: [] };
|
|
845693
845693
|
return {
|
|
845694
845694
|
version: STORE_VERSION4,
|
|
@@ -847002,7 +847002,7 @@ function registerAgentMediaGenerateTool(registry5, mediaProviderRegistry, artifa
|
|
|
847002
847002
|
}
|
|
847003
847003
|
|
|
847004
847004
|
// src/tools/agent-notify-tool.ts
|
|
847005
|
-
function
|
|
847005
|
+
function isRecord31(value) {
|
|
847006
847006
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
847007
847007
|
}
|
|
847008
847008
|
function readString40(value) {
|
|
@@ -847013,7 +847013,7 @@ function readBoolean10(value) {
|
|
|
847013
847013
|
}
|
|
847014
847014
|
function configuredWebhookUrls(configManager) {
|
|
847015
847015
|
const category = configManager.getCategory("notifications");
|
|
847016
|
-
if (!
|
|
847016
|
+
if (!isRecord31(category) || !Array.isArray(category.webhookUrls))
|
|
847017
847017
|
return [];
|
|
847018
847018
|
return category.webhookUrls.filter((url2) => typeof url2 === "string").map((url2) => url2.trim()).filter((url2) => url2.length > 0);
|
|
847019
847019
|
}
|
|
@@ -847165,7 +847165,7 @@ var OPERATOR_ACTIONS = {
|
|
|
847165
847165
|
}
|
|
847166
847166
|
};
|
|
847167
847167
|
var OPERATOR_ACTION_IDS = Object.keys(OPERATOR_ACTIONS);
|
|
847168
|
-
function
|
|
847168
|
+
function isRecord32(value) {
|
|
847169
847169
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
847170
847170
|
}
|
|
847171
847171
|
function readOperatorActionString(value) {
|
|
@@ -847207,7 +847207,7 @@ function requestBody(args2, action2) {
|
|
|
847207
847207
|
return Object.keys(out2).length > 0 ? out2 : null;
|
|
847208
847208
|
}
|
|
847209
847209
|
function buildOperatorActionRequest(rawArgs) {
|
|
847210
|
-
if (!
|
|
847210
|
+
if (!isRecord32(rawArgs))
|
|
847211
847211
|
return { ok: false, error: "Operator action arguments must be an object." };
|
|
847212
847212
|
const args2 = rawArgs;
|
|
847213
847213
|
if (!isOperatorActionId(args2.action)) {
|
|
@@ -847245,7 +847245,7 @@ function summarizeError2(error51) {
|
|
|
847245
847245
|
return error51 instanceof Error ? error51.message : String(error51);
|
|
847246
847246
|
}
|
|
847247
847247
|
function classifyHttpFailure(methodId, path7, status, body2) {
|
|
847248
|
-
const detail =
|
|
847248
|
+
const detail = isRecord32(body2) && typeof body2.error === "string" ? body2.error : "";
|
|
847249
847249
|
return {
|
|
847250
847250
|
ok: false,
|
|
847251
847251
|
methodId,
|
|
@@ -847299,13 +847299,13 @@ async function postOperatorAction(connection5, request2) {
|
|
|
847299
847299
|
}
|
|
847300
847300
|
}
|
|
847301
847301
|
function statusFromOperatorActionBody(body2) {
|
|
847302
|
-
if (!
|
|
847302
|
+
if (!isRecord32(body2))
|
|
847303
847303
|
return "ok";
|
|
847304
847304
|
const approval = body2.approval;
|
|
847305
|
-
if (
|
|
847305
|
+
if (isRecord32(approval) && typeof approval.status === "string")
|
|
847306
847306
|
return approval.status;
|
|
847307
847307
|
const run7 = body2.run;
|
|
847308
|
-
if (
|
|
847308
|
+
if (isRecord32(run7) && typeof run7.status === "string")
|
|
847309
847309
|
return run7.status;
|
|
847310
847310
|
if (typeof body2.status === "string")
|
|
847311
847311
|
return body2.status;
|
|
@@ -847429,7 +847429,7 @@ function createAgentOperatorActionTool(shellPaths, configManager) {
|
|
|
847429
847429
|
if (!request2.ok) {
|
|
847430
847430
|
return { success: false, error: request2.error };
|
|
847431
847431
|
}
|
|
847432
|
-
const args2 =
|
|
847432
|
+
const args2 = isRecord32(rawArgs) ? rawArgs : {};
|
|
847433
847433
|
const explicitUserRequest = readOperatorActionString(args2.explicitUserRequest);
|
|
847434
847434
|
if (!explicitUserRequest) {
|
|
847435
847435
|
return {
|
|
@@ -847472,23 +847472,23 @@ var OPERATOR_BRIEFING_ROUTES = [
|
|
|
847472
847472
|
{ id: "schedules.list", path: "/api/automation/schedules" },
|
|
847473
847473
|
{ id: "scheduler.capacity", path: "/api/runtime/scheduler" }
|
|
847474
847474
|
];
|
|
847475
|
-
function
|
|
847475
|
+
function isRecord33(value) {
|
|
847476
847476
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
847477
847477
|
}
|
|
847478
847478
|
function readRecord20(value, key) {
|
|
847479
|
-
return
|
|
847479
|
+
return isRecord33(value) && isRecord33(value[key]) ? value[key] : {};
|
|
847480
847480
|
}
|
|
847481
847481
|
function readArray3(value, key) {
|
|
847482
|
-
return
|
|
847482
|
+
return isRecord33(value) && Array.isArray(value[key]) ? value[key] : [];
|
|
847483
847483
|
}
|
|
847484
847484
|
function readNumber9(value, key) {
|
|
847485
|
-
if (!
|
|
847485
|
+
if (!isRecord33(value))
|
|
847486
847486
|
return null;
|
|
847487
847487
|
const candidate = value[key];
|
|
847488
847488
|
return typeof candidate === "number" && Number.isFinite(candidate) ? candidate : null;
|
|
847489
847489
|
}
|
|
847490
847490
|
function readString41(value, key) {
|
|
847491
|
-
if (!
|
|
847491
|
+
if (!isRecord33(value))
|
|
847492
847492
|
return null;
|
|
847493
847493
|
const candidate = value[key];
|
|
847494
847494
|
return typeof candidate === "string" ? candidate : null;
|
|
@@ -847507,7 +847507,7 @@ async function readResponseBody2(response5) {
|
|
|
847507
847507
|
}
|
|
847508
847508
|
}
|
|
847509
847509
|
function classifyHttpFailure2(route, status, body2) {
|
|
847510
|
-
const detail =
|
|
847510
|
+
const detail = isRecord33(body2) && typeof body2.error === "string" ? body2.error : "";
|
|
847511
847511
|
return {
|
|
847512
847512
|
ok: false,
|
|
847513
847513
|
route,
|
|
@@ -847541,7 +847541,7 @@ function formatWorkPlan(body2) {
|
|
|
847541
847541
|
function formatApprovals(body2) {
|
|
847542
847542
|
const approvals = readArray3(body2, "approvals");
|
|
847543
847543
|
const pending = approvals.filter((entry) => readString41(entry, "status") === "pending").length;
|
|
847544
|
-
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))}`;
|
|
847545
847545
|
}
|
|
847546
847546
|
function formatAutomation(body2) {
|
|
847547
847547
|
const totals = readRecord20(body2, "totals");
|
|
@@ -847551,7 +847551,7 @@ function formatAutomation(body2) {
|
|
|
847551
847551
|
function formatSchedules(body2) {
|
|
847552
847552
|
const jobs = readArray3(body2, "jobs");
|
|
847553
847553
|
const runs = readArray3(body2, "runs");
|
|
847554
|
-
const enabled = jobs.filter((entry) =>
|
|
847554
|
+
const enabled = jobs.filter((entry) => isRecord33(entry) && entry.enabled === true).length;
|
|
847555
847555
|
return ` schedules: jobs ${jobs.length}; enabled ${enabled}; runs ${runs.length}`;
|
|
847556
847556
|
}
|
|
847557
847557
|
function formatCapacity(body2) {
|
|
@@ -848017,7 +848017,7 @@ function resolveReminderConnectedHostConnection(configManager, homeDirectory) {
|
|
|
848017
848017
|
}
|
|
848018
848018
|
|
|
848019
848019
|
// src/agent/reminder-schedule-format.ts
|
|
848020
|
-
function
|
|
848020
|
+
function isRecord34(value) {
|
|
848021
848021
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
848022
848022
|
}
|
|
848023
848023
|
function readString42(record2, key) {
|
|
@@ -848063,7 +848063,7 @@ function formatReminderSchedulePreview(preview4) {
|
|
|
848063
848063
|
`);
|
|
848064
848064
|
}
|
|
848065
848065
|
function formatReminderScheduleSuccess(result2) {
|
|
848066
|
-
const record2 =
|
|
848066
|
+
const record2 = isRecord34(result2.schedule) ? result2.schedule : {};
|
|
848067
848067
|
const id = readString42(record2, "id") ?? "(unknown)";
|
|
848068
848068
|
const status = readString42(record2, "status") ?? (record2.enabled === false ? "paused" : "enabled");
|
|
848069
848069
|
return [
|
|
@@ -850583,7 +850583,7 @@ var recallCommand = {
|
|
|
850583
850583
|
var KNOWLEDGE_REVIEW_ACTIONS = ["accept", "reject", "resolve", "reopen", "edit", "forget"];
|
|
850584
850584
|
var BROWSER_KINDS = ["chrome", "chromium", "brave", "edge", "vivaldi", "arc", "opera", "firefox", "zen", "librewolf", "waterfox", "floorp", "safari", "orion", "epiphany"];
|
|
850585
850585
|
var BROWSER_SOURCE_KINDS = ["history", "bookmark"];
|
|
850586
|
-
function
|
|
850586
|
+
function isRecord35(value) {
|
|
850587
850587
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
850588
850588
|
}
|
|
850589
850589
|
function requireAgentKnowledgeApi(context) {
|
|
@@ -850683,7 +850683,7 @@ function readJsonObjectFlag(args2, name51) {
|
|
|
850683
850683
|
return;
|
|
850684
850684
|
try {
|
|
850685
850685
|
const parsed = JSON.parse(value);
|
|
850686
|
-
return
|
|
850686
|
+
return isRecord35(parsed) ? parsed : null;
|
|
850687
850687
|
} catch {
|
|
850688
850688
|
return null;
|
|
850689
850689
|
}
|
|
@@ -852129,7 +852129,7 @@ function parseRoutineSchedulePromotionArgs(args2) {
|
|
|
852129
852129
|
}
|
|
852130
852130
|
|
|
852131
852131
|
// src/agent/routine-schedule-format.ts
|
|
852132
|
-
function
|
|
852132
|
+
function isRecord36(value) {
|
|
852133
852133
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
852134
852134
|
}
|
|
852135
852135
|
function readString45(record2, key) {
|
|
@@ -852181,7 +852181,7 @@ function formatRoutineSchedulePreview(preview4) {
|
|
|
852181
852181
|
`);
|
|
852182
852182
|
}
|
|
852183
852183
|
function formatRoutineScheduleSuccess(result2) {
|
|
852184
|
-
const record2 =
|
|
852184
|
+
const record2 = isRecord36(result2.schedule) ? result2.schedule : {};
|
|
852185
852185
|
const id = readString45(record2, "id") ?? "(unknown)";
|
|
852186
852186
|
const status = readString45(record2, "status") ?? (record2.enabled === false ? "paused" : "enabled");
|
|
852187
852187
|
return [
|
|
@@ -852302,7 +852302,7 @@ import { existsSync as existsSync69, mkdirSync as mkdirSync52, readFileSync as r
|
|
|
852302
852302
|
import { dirname as dirname53 } from "path";
|
|
852303
852303
|
init_automation2();
|
|
852304
852304
|
var RECEIPT_STORE_VERSION = 1;
|
|
852305
|
-
function
|
|
852305
|
+
function isRecord37(value) {
|
|
852306
852306
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
852307
852307
|
}
|
|
852308
852308
|
function readString46(record2, key) {
|
|
@@ -852355,7 +852355,7 @@ function normalizeFailureKind(value) {
|
|
|
852355
852355
|
return;
|
|
852356
852356
|
}
|
|
852357
852357
|
function readReceipt(value) {
|
|
852358
|
-
if (!
|
|
852358
|
+
if (!isRecord37(value))
|
|
852359
852359
|
return null;
|
|
852360
852360
|
const id = readString46(value, "id")?.trim();
|
|
852361
852361
|
const createdAt = readString46(value, "createdAt")?.trim();
|
|
@@ -852364,9 +852364,9 @@ function readReceipt(value) {
|
|
|
852364
852364
|
const status = value.status === "created" || value.status === "failed" ? value.status : null;
|
|
852365
852365
|
const scheduleKind = value.scheduleKind === "cron" || value.scheduleKind === "every" || value.scheduleKind === "at" ? value.scheduleKind : null;
|
|
852366
852366
|
const scheduleValue2 = readString46(value, "scheduleValue")?.trim();
|
|
852367
|
-
const target =
|
|
852367
|
+
const target = isRecord37(value.target) ? value.target : {};
|
|
852368
852368
|
const deliveryTargets = Array.isArray(value.deliveryTargets) ? value.deliveryTargets.map((target2) => {
|
|
852369
|
-
if (!
|
|
852369
|
+
if (!isRecord37(target2))
|
|
852370
852370
|
return null;
|
|
852371
852371
|
const kind2 = target2.kind === "webhook" || target2.kind === "surface" || target2.kind === "integration" || target2.kind === "link" ? target2.kind : null;
|
|
852372
852372
|
if (!kind2)
|
|
@@ -852414,7 +852414,7 @@ function readReceipt(value) {
|
|
|
852414
852414
|
}
|
|
852415
852415
|
function parseReceiptStore(raw) {
|
|
852416
852416
|
const parsed = JSON.parse(raw);
|
|
852417
|
-
if (!
|
|
852417
|
+
if (!isRecord37(parsed))
|
|
852418
852418
|
return { version: RECEIPT_STORE_VERSION, receipts: [] };
|
|
852419
852419
|
return {
|
|
852420
852420
|
version: RECEIPT_STORE_VERSION,
|
|
@@ -852451,7 +852451,7 @@ function scheduleKind(payload) {
|
|
|
852451
852451
|
throw new Error("Routine schedule payload is missing a schedule kind.");
|
|
852452
852452
|
}
|
|
852453
852453
|
function targetSummary(payload) {
|
|
852454
|
-
return
|
|
852454
|
+
return isRecord37(payload.target) ? {
|
|
852455
852455
|
kind: typeof payload.target.kind === "string" ? payload.target.kind : undefined,
|
|
852456
852456
|
surfaceKind: typeof payload.target.surfaceKind === "string" ? payload.target.surfaceKind : undefined,
|
|
852457
852457
|
preserveThread: typeof payload.target.preserveThread === "boolean" ? payload.target.preserveThread : undefined,
|
|
@@ -852459,10 +852459,10 @@ function targetSummary(payload) {
|
|
|
852459
852459
|
} : {};
|
|
852460
852460
|
}
|
|
852461
852461
|
function deliveryMode(payload) {
|
|
852462
|
-
return
|
|
852462
|
+
return isRecord37(payload.delivery) && typeof payload.delivery.mode === "string" ? payload.delivery.mode : undefined;
|
|
852463
852463
|
}
|
|
852464
852464
|
function resultScheduleRecord(result2) {
|
|
852465
|
-
return result2.ok &&
|
|
852465
|
+
return result2.ok && isRecord37(result2.schedule) ? result2.schedule : {};
|
|
852466
852466
|
}
|
|
852467
852467
|
function buildReceipt(existing, connection5, preview4, result2) {
|
|
852468
852468
|
const createdAt = nowIso5();
|
|
@@ -852550,7 +852550,7 @@ function isoTime(value) {
|
|
|
852550
852550
|
return Number.isFinite(time4) ? new Date(time4).toISOString() : null;
|
|
852551
852551
|
}
|
|
852552
852552
|
function readLiveScheduleDefinition(value) {
|
|
852553
|
-
if (!
|
|
852553
|
+
if (!isRecord37(value))
|
|
852554
852554
|
return {};
|
|
852555
852555
|
if (value.kind === "cron") {
|
|
852556
852556
|
return {
|
|
@@ -852576,7 +852576,7 @@ function readLiveScheduleDefinition(value) {
|
|
|
852576
852576
|
return {};
|
|
852577
852577
|
}
|
|
852578
852578
|
function readLiveScheduleRecord(value) {
|
|
852579
|
-
if (!
|
|
852579
|
+
if (!isRecord37(value))
|
|
852580
852580
|
return null;
|
|
852581
852581
|
const id = readString46(value, "id")?.trim();
|
|
852582
852582
|
const name51 = readString46(value, "name")?.trim();
|
|
@@ -852599,7 +852599,7 @@ function readLiveScheduleRecord(value) {
|
|
|
852599
852599
|
};
|
|
852600
852600
|
}
|
|
852601
852601
|
function readLiveSchedules(output6) {
|
|
852602
|
-
const record2 =
|
|
852602
|
+
const record2 = isRecord37(output6) ? output6 : {};
|
|
852603
852603
|
const jobs = Array.isArray(record2.jobs) ? record2.jobs : [];
|
|
852604
852604
|
return jobs.map(readLiveScheduleRecord).filter((schedule) => schedule !== null);
|
|
852605
852605
|
}
|
|
@@ -859185,7 +859185,7 @@ var STARTER_TEMPLATES = [
|
|
|
859185
859185
|
var PROFILE_CREATED_FILE = "profile.json";
|
|
859186
859186
|
var PROFILE_SELECTION_FILE = "profile-selection.json";
|
|
859187
859187
|
var PROFILE_ID_PATTERN = /^[a-z0-9](?:[a-z0-9._-]{0,62}[a-z0-9])?$/;
|
|
859188
|
-
function
|
|
859188
|
+
function isRecord38(value) {
|
|
859189
859189
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
859190
859190
|
}
|
|
859191
859191
|
function normalizeAgentRuntimeProfileId(value) {
|
|
@@ -859224,7 +859224,7 @@ function readAgentRuntimeProfileSelection(baseHomeDirectory) {
|
|
|
859224
859224
|
return null;
|
|
859225
859225
|
try {
|
|
859226
859226
|
const raw = JSON.parse(readFileSync81(path7, "utf-8"));
|
|
859227
|
-
if (!
|
|
859227
|
+
if (!isRecord38(raw))
|
|
859228
859228
|
return null;
|
|
859229
859229
|
const profileId = raw.profileId;
|
|
859230
859230
|
if (typeof profileId !== "string")
|
|
@@ -859269,10 +859269,10 @@ function readProfileStarterTemplate(homeDirectory) {
|
|
|
859269
859269
|
return {};
|
|
859270
859270
|
try {
|
|
859271
859271
|
const raw = JSON.parse(readFileSync81(path7, "utf-8"));
|
|
859272
|
-
if (!
|
|
859272
|
+
if (!isRecord38(raw))
|
|
859273
859273
|
return {};
|
|
859274
859274
|
const starter = raw.starterTemplate;
|
|
859275
|
-
if (!
|
|
859275
|
+
if (!isRecord38(starter))
|
|
859276
859276
|
return {};
|
|
859277
859277
|
const id = starter.id;
|
|
859278
859278
|
const name51 = starter.name;
|
|
@@ -859390,7 +859390,7 @@ function readTemplateTextBlock(value, field) {
|
|
|
859390
859390
|
return value.trim();
|
|
859391
859391
|
}
|
|
859392
859392
|
function readTemplateObject(value, field) {
|
|
859393
|
-
if (!
|
|
859393
|
+
if (!isRecord38(value))
|
|
859394
859394
|
throw new Error(`Starter template ${field} must be an object.`);
|
|
859395
859395
|
return value;
|
|
859396
859396
|
}
|
|
@@ -861614,7 +861614,7 @@ var CHANNEL_FAILURE_LABELS = {
|
|
|
861614
861614
|
connected_host_route_unavailable: "connected host route unavailable",
|
|
861615
861615
|
connected_host_error: "connected host error"
|
|
861616
861616
|
};
|
|
861617
|
-
function
|
|
861617
|
+
function isRecord39(value) {
|
|
861618
861618
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
861619
861619
|
}
|
|
861620
861620
|
function readString47(record2, key, fallback = "") {
|
|
@@ -861627,7 +861627,7 @@ function readBoolean14(record2, key, fallback = false) {
|
|
|
861627
861627
|
}
|
|
861628
861628
|
function readRecordArray(record2, key) {
|
|
861629
861629
|
const value = record2[key];
|
|
861630
|
-
return Array.isArray(value) ? value.filter(
|
|
861630
|
+
return Array.isArray(value) ? value.filter(isRecord39) : [];
|
|
861631
861631
|
}
|
|
861632
861632
|
function readFlagValue3(args2, index, flag, errors4) {
|
|
861633
861633
|
const value = args2[index + 1];
|
|
@@ -861696,7 +861696,7 @@ function resolveChannelConnectedHostConnection(context) {
|
|
|
861696
861696
|
return { baseUrl: `http://${host}:${port}`, token: null, tokenPath };
|
|
861697
861697
|
try {
|
|
861698
861698
|
const parsed = JSON.parse(readFileSync82(tokenPath, "utf-8"));
|
|
861699
|
-
const token =
|
|
861699
|
+
const token = isRecord39(parsed) && typeof parsed.token === "string" ? parsed.token : null;
|
|
861700
861700
|
return { baseUrl: `http://${host}:${port}`, token, tokenPath };
|
|
861701
861701
|
} catch {
|
|
861702
861702
|
return { baseUrl: `http://${host}:${port}`, token: null, tokenPath };
|
|
@@ -861727,7 +861727,7 @@ async function fetchChannelRoute(context, route) {
|
|
|
861727
861727
|
}
|
|
861728
861728
|
}
|
|
861729
861729
|
if (!response5.ok) {
|
|
861730
|
-
const detail =
|
|
861730
|
+
const detail = isRecord39(body2) && typeof body2.error === "string" ? body2.error : text;
|
|
861731
861731
|
return {
|
|
861732
861732
|
ok: false,
|
|
861733
861733
|
route,
|
|
@@ -861817,7 +861817,7 @@ function printChannelDetail(print2, channel) {
|
|
|
861817
861817
|
`));
|
|
861818
861818
|
}
|
|
861819
861819
|
function formatChannelAccounts(body2) {
|
|
861820
|
-
const root =
|
|
861820
|
+
const root = isRecord39(body2) ? body2 : {};
|
|
861821
861821
|
const accounts = readRecordArray(root, "accounts");
|
|
861822
861822
|
const lines = [
|
|
861823
861823
|
"Channel Accounts",
|
|
@@ -861843,7 +861843,7 @@ function formatChannelAccounts(body2) {
|
|
|
861843
861843
|
`);
|
|
861844
861844
|
}
|
|
861845
861845
|
function formatChannelPolicies(body2) {
|
|
861846
|
-
const root =
|
|
861846
|
+
const root = isRecord39(body2) ? body2 : {};
|
|
861847
861847
|
const policies = readRecordArray(root, "policies");
|
|
861848
861848
|
const lines = [
|
|
861849
861849
|
"Channel Policies",
|
|
@@ -861868,7 +861868,7 @@ function formatChannelPolicies(body2) {
|
|
|
861868
861868
|
`);
|
|
861869
861869
|
}
|
|
861870
861870
|
function formatChannelStatus(body2) {
|
|
861871
|
-
const root =
|
|
861871
|
+
const root = isRecord39(body2) ? body2 : {};
|
|
861872
861872
|
const channels = readRecordArray(root, "channels");
|
|
861873
861873
|
const lines = [
|
|
861874
861874
|
"Connected Channel Status",
|
|
@@ -861892,7 +861892,7 @@ function formatChannelStatus(body2) {
|
|
|
861892
861892
|
`);
|
|
861893
861893
|
}
|
|
861894
861894
|
function formatChannelDoctor(surface, body2) {
|
|
861895
|
-
const root =
|
|
861895
|
+
const root = isRecord39(body2) ? body2 : {};
|
|
861896
861896
|
const checks3 = readRecordArray(root, "checks");
|
|
861897
861897
|
const repairActions = readRecordArray(root, "repairActions");
|
|
861898
861898
|
const lines = [
|
|
@@ -861916,7 +861916,7 @@ function formatChannelDoctor(surface, body2) {
|
|
|
861916
861916
|
`);
|
|
861917
861917
|
}
|
|
861918
861918
|
function formatChannelSetup(surface, body2) {
|
|
861919
|
-
const root =
|
|
861919
|
+
const root = isRecord39(body2) ? body2 : {};
|
|
861920
861920
|
const fields = readRecordArray(root, "fields");
|
|
861921
861921
|
const secretTargets = readRecordArray(root, "secretTargets");
|
|
861922
861922
|
const lines = [
|
|
@@ -864633,13 +864633,13 @@ function getNestedValue(source, key) {
|
|
|
864633
864633
|
}
|
|
864634
864634
|
return cursor;
|
|
864635
864635
|
}
|
|
864636
|
-
function
|
|
864636
|
+
function isRecord40(value) {
|
|
864637
864637
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
864638
864638
|
}
|
|
864639
864639
|
function readJsonFile2(path7) {
|
|
864640
864640
|
try {
|
|
864641
864641
|
const value = JSON.parse(readFileSync87(path7, "utf-8"));
|
|
864642
|
-
if (!
|
|
864642
|
+
if (!isRecord40(value))
|
|
864643
864643
|
return { ok: false, error: "Bundle file must contain a JSON object." };
|
|
864644
864644
|
return { ok: true, value };
|
|
864645
864645
|
} catch (error51) {
|
|
@@ -866840,29 +866840,29 @@ function usage() {
|
|
|
866840
866840
|
].join(`
|
|
866841
866841
|
`);
|
|
866842
866842
|
}
|
|
866843
|
-
function
|
|
866843
|
+
function isRecord41(value) {
|
|
866844
866844
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
866845
866845
|
}
|
|
866846
866846
|
function isStringArray6(value) {
|
|
866847
866847
|
return Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
866848
866848
|
}
|
|
866849
866849
|
function isProvenanceLink(value) {
|
|
866850
|
-
if (!
|
|
866850
|
+
if (!isRecord41(value))
|
|
866851
866851
|
return false;
|
|
866852
866852
|
return typeof value.ref === "string" && typeof value.kind === "string" && isProvenanceKind(value.kind);
|
|
866853
866853
|
}
|
|
866854
866854
|
function isMemoryRecord(value) {
|
|
866855
|
-
if (!
|
|
866855
|
+
if (!isRecord41(value))
|
|
866856
866856
|
return false;
|
|
866857
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";
|
|
866858
866858
|
}
|
|
866859
866859
|
function isMemoryLink(value) {
|
|
866860
|
-
if (!
|
|
866860
|
+
if (!isRecord41(value))
|
|
866861
866861
|
return false;
|
|
866862
866862
|
return typeof value.fromId === "string" && typeof value.toId === "string" && typeof value.relation === "string" && typeof value.createdAt === "number";
|
|
866863
866863
|
}
|
|
866864
866864
|
function isMemoryBundle(value) {
|
|
866865
|
-
if (!
|
|
866865
|
+
if (!isRecord41(value))
|
|
866866
866866
|
return false;
|
|
866867
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);
|
|
866868
866868
|
}
|
|
@@ -869308,7 +869308,7 @@ async function handleDelegateCommand(runtime2) {
|
|
|
869308
869308
|
surfaceKind: "goodvibes-agent",
|
|
869309
869309
|
surfaceId: "goodvibes-agent-cli"
|
|
869310
869310
|
});
|
|
869311
|
-
const sessionId =
|
|
869311
|
+
const sessionId = isRecord25(created.session) && typeof created.session.id === "string" ? created.session.id : null;
|
|
869312
869312
|
if (!sessionId)
|
|
869313
869313
|
throw new Error("sessions.create returned no session id.");
|
|
869314
869314
|
const message = await sdk.operator.invoke("sessions.messages.create", {
|
|
@@ -887186,11 +887186,11 @@ function readLimit19(value, fallback) {
|
|
|
887186
887186
|
return fallback;
|
|
887187
887187
|
return Math.max(1, Math.min(100, Math.trunc(parsed)));
|
|
887188
887188
|
}
|
|
887189
|
-
function
|
|
887189
|
+
function isRecord42(value) {
|
|
887190
887190
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
887191
887191
|
}
|
|
887192
887192
|
function asRecord4(value) {
|
|
887193
|
-
return
|
|
887193
|
+
return isRecord42(value) ? value : {};
|
|
887194
887194
|
}
|
|
887195
887195
|
function normalized(value) {
|
|
887196
887196
|
return value.toLowerCase();
|
|
@@ -887285,7 +887285,7 @@ function summarizeJsonArtifact(artifactId, parsed) {
|
|
|
887285
887285
|
};
|
|
887286
887286
|
}
|
|
887287
887287
|
if (artifactId === "release-readiness") {
|
|
887288
|
-
const items = Array.isArray(root.items) ? root.items.filter(
|
|
887288
|
+
const items = Array.isArray(root.items) ? root.items.filter(isRecord42) : [];
|
|
887289
887289
|
return {
|
|
887290
887290
|
gate: root.gate,
|
|
887291
887291
|
checkedAt: root.checkedAt,
|
|
@@ -887456,7 +887456,7 @@ var QUALITY_DIMENSIONS = [
|
|
|
887456
887456
|
"safetyBoundary",
|
|
887457
887457
|
"releaseEvidence"
|
|
887458
887458
|
];
|
|
887459
|
-
function
|
|
887459
|
+
function isRecord43(value) {
|
|
887460
887460
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
887461
887461
|
}
|
|
887462
887462
|
function readString65(value) {
|
|
@@ -887475,7 +887475,7 @@ function loadReleaseReadiness() {
|
|
|
887475
887475
|
try {
|
|
887476
887476
|
const source = readFileSync92(RELEASE_READINESS_PATH, "utf-8");
|
|
887477
887477
|
const parsed = JSON.parse(source);
|
|
887478
|
-
if (!
|
|
887478
|
+
if (!isRecord43(parsed))
|
|
887479
887479
|
return { status: "unavailable", reason: `${RELEASE_READINESS_RELATIVE_PATH} must contain a JSON object.` };
|
|
887480
887480
|
return { status: "available", root: parsed, source };
|
|
887481
887481
|
} catch (error52) {
|
|
@@ -887484,10 +887484,10 @@ function loadReleaseReadiness() {
|
|
|
887484
887484
|
}
|
|
887485
887485
|
}
|
|
887486
887486
|
function releaseReadinessItems(root) {
|
|
887487
|
-
return Array.isArray(root.items) ? root.items.filter(
|
|
887487
|
+
return Array.isArray(root.items) ? root.items.filter(isRecord43) : [];
|
|
887488
887488
|
}
|
|
887489
887489
|
function releaseReadinessSources(root) {
|
|
887490
|
-
return Array.isArray(root.sources) ? root.sources.filter(
|
|
887490
|
+
return Array.isArray(root.sources) ? root.sources.filter(isRecord43) : [];
|
|
887491
887491
|
}
|
|
887492
887492
|
function normalized2(value) {
|
|
887493
887493
|
return value.toLowerCase();
|
|
@@ -887499,7 +887499,7 @@ function itemSearchText(item) {
|
|
|
887499
887499
|
if (typeof value === "string")
|
|
887500
887500
|
fields.push(value);
|
|
887501
887501
|
}
|
|
887502
|
-
if (
|
|
887502
|
+
if (isRecord43(item.quality)) {
|
|
887503
887503
|
fields.push(...Object.values(item.quality).filter((value) => typeof value === "string"));
|
|
887504
887504
|
}
|
|
887505
887505
|
return fields.join(`
|
|
@@ -887528,7 +887528,7 @@ function countBy2(items, key) {
|
|
|
887528
887528
|
}
|
|
887529
887529
|
function qualityDimensionCount(item) {
|
|
887530
887530
|
const quality = item.quality;
|
|
887531
|
-
if (!
|
|
887531
|
+
if (!isRecord43(quality))
|
|
887532
887532
|
return 0;
|
|
887533
887533
|
return QUALITY_DIMENSIONS.filter((dimension2) => readString65(quality[dimension2])).length;
|
|
887534
887534
|
}
|
|
@@ -887765,11 +887765,11 @@ function readLimit21(value, fallback) {
|
|
|
887765
887765
|
return fallback;
|
|
887766
887766
|
return Math.max(1, Math.min(500, Math.trunc(parsed)));
|
|
887767
887767
|
}
|
|
887768
|
-
function
|
|
887768
|
+
function isRecord44(value) {
|
|
887769
887769
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
887770
887770
|
}
|
|
887771
887771
|
function readRecordArray2(value) {
|
|
887772
|
-
return Array.isArray(value) ? value.filter(
|
|
887772
|
+
return Array.isArray(value) ? value.filter(isRecord44) : [];
|
|
887773
887773
|
}
|
|
887774
887774
|
function readArray4(value) {
|
|
887775
887775
|
return Array.isArray(value) ? value : [];
|
|
@@ -887777,7 +887777,7 @@ function readArray4(value) {
|
|
|
887777
887777
|
function readNestedValue(source, path7) {
|
|
887778
887778
|
let cursor = source;
|
|
887779
887779
|
for (const part of path7.split(".")) {
|
|
887780
|
-
if (!
|
|
887780
|
+
if (!isRecord44(cursor))
|
|
887781
887781
|
return;
|
|
887782
887782
|
cursor = cursor[part];
|
|
887783
887783
|
}
|
|
@@ -887856,11 +887856,11 @@ function describeFinding(finding, includeParameters, lookup) {
|
|
|
887856
887856
|
};
|
|
887857
887857
|
}
|
|
887858
887858
|
function buildTokenFindings(securitySnapshot) {
|
|
887859
|
-
const audit =
|
|
887859
|
+
const audit = isRecord44(securitySnapshot?.audit) ? securitySnapshot.audit : null;
|
|
887860
887860
|
const results = readRecordArray2(audit?.results);
|
|
887861
887861
|
return results.map((result2, index) => {
|
|
887862
|
-
const scope =
|
|
887863
|
-
const rotation =
|
|
887862
|
+
const scope = isRecord44(result2.scope) ? result2.scope : {};
|
|
887863
|
+
const rotation = isRecord44(result2.rotation) ? result2.rotation : {};
|
|
887864
887864
|
const label = safeText(result2.label, `token-${index + 1}`);
|
|
887865
887865
|
const scopeOutcome = safeText(scope.outcome);
|
|
887866
887866
|
const rotationOutcome = safeText(rotation.outcome);
|
|
@@ -887910,7 +887910,7 @@ function buildPolicyFindings(context) {
|
|
|
887910
887910
|
}
|
|
887911
887911
|
};
|
|
887912
887912
|
});
|
|
887913
|
-
const preflight =
|
|
887913
|
+
const preflight = isRecord44(policySnapshot.lastPreflightReview) ? policySnapshot.lastPreflightReview : null;
|
|
887914
887914
|
if (!preflight || safeText(preflight.status, "ok") === "ok")
|
|
887915
887915
|
return findings;
|
|
887916
887916
|
return [
|
|
@@ -887932,7 +887932,7 @@ function buildPolicyFindings(context) {
|
|
|
887932
887932
|
function buildMcpFindings(securitySnapshot) {
|
|
887933
887933
|
const mcpServers = readRecordArray2(securitySnapshot?.mcpServers);
|
|
887934
887934
|
const recentMcpDecisions = readArray4(securitySnapshot?.recentMcpDecisions);
|
|
887935
|
-
const attackPathReview =
|
|
887935
|
+
const attackPathReview = isRecord44(securitySnapshot?.attackPathReview) ? securitySnapshot.attackPathReview : buildMcpAttackPathReview2({ servers: mcpServers, recentDecisions: recentMcpDecisions });
|
|
887936
887936
|
const attackFindings = readRecordArray2(attackPathReview.findings).map((finding, index) => {
|
|
887937
887937
|
const serverName = safeText(finding.serverName, `server-${index + 1}`);
|
|
887938
887938
|
const severityRaw = safeText(finding.severity, "warn").toLowerCase();
|
|
@@ -888036,7 +888036,7 @@ function buildIncidentFindings(securitySnapshot) {
|
|
|
888036
888036
|
function readSecuritySnapshot(context) {
|
|
888037
888037
|
try {
|
|
888038
888038
|
const snapshot2 = context.platform.readModels?.security.getSnapshot();
|
|
888039
|
-
return
|
|
888039
|
+
return isRecord44(snapshot2) ? snapshot2 : null;
|
|
888040
888040
|
} catch {
|
|
888041
888041
|
return null;
|
|
888042
888042
|
}
|
|
@@ -888074,8 +888074,8 @@ async function securityPostureSummary(context, args2) {
|
|
|
888074
888074
|
policy: "Security read models are unavailable in this Agent context."
|
|
888075
888075
|
};
|
|
888076
888076
|
}
|
|
888077
|
-
const audit =
|
|
888078
|
-
const policy =
|
|
888077
|
+
const audit = isRecord44(securitySnapshot.audit) ? securitySnapshot.audit : {};
|
|
888078
|
+
const policy = isRecord44(securitySnapshot.policy) ? securitySnapshot.policy : {};
|
|
888079
888079
|
const mcpServers = readRecordArray2(securitySnapshot.mcpServers);
|
|
888080
888080
|
const plugins2 = readRecordArray2(securitySnapshot.plugins);
|
|
888081
888081
|
const subscriptions = context.platform.subscriptionManager;
|
|
@@ -888111,7 +888111,7 @@ async function securityPostureSummary(context, args2) {
|
|
|
888111
888111
|
servers: mcpServers.length,
|
|
888112
888112
|
quarantined: countByString(mcpServers, "schemaFreshness", "quarantined"),
|
|
888113
888113
|
elevated: countByString(mcpServers, "trustMode", "allow-all"),
|
|
888114
|
-
attackPathFindings: readRecordArray2(
|
|
888114
|
+
attackPathFindings: readRecordArray2(isRecord44(securitySnapshot.attackPathReview) ? securitySnapshot.attackPathReview.findings : []).length
|
|
888115
888115
|
},
|
|
888116
888116
|
plugins: {
|
|
888117
888117
|
total: plugins2.length,
|
|
@@ -888244,11 +888244,11 @@ function timestampForBundle(bundle) {
|
|
|
888244
888244
|
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
888245
888245
|
}
|
|
888246
888246
|
function summarizeSupportBundle(path7, bundle) {
|
|
888247
|
-
const redaction =
|
|
888248
|
-
const diagnostics =
|
|
888247
|
+
const redaction = isRecord44(bundle.redaction) ? bundle.redaction : {};
|
|
888248
|
+
const diagnostics = isRecord44(bundle.diagnostics) ? bundle.diagnostics : {};
|
|
888249
888249
|
const timestamp2 = timestampForBundle(bundle);
|
|
888250
|
-
const mcpSummary =
|
|
888251
|
-
const pluginSummary =
|
|
888250
|
+
const mcpSummary = isRecord44(bundle.mcpSummary) ? bundle.mcpSummary : {};
|
|
888251
|
+
const pluginSummary = isRecord44(bundle.pluginSummary) ? bundle.pluginSummary : {};
|
|
888252
888252
|
return {
|
|
888253
888253
|
path: path7,
|
|
888254
888254
|
type: summarizeBundleType(bundle),
|
|
@@ -888301,7 +888301,7 @@ function describeHarnessSupportBundle(context, args2) {
|
|
|
888301
888301
|
usage: `Invalid bundle JSON at ${path7}: ${error52 instanceof Error ? error52.message : String(error52)}`
|
|
888302
888302
|
};
|
|
888303
888303
|
}
|
|
888304
|
-
if (!
|
|
888304
|
+
if (!isRecord44(parsed)) {
|
|
888305
888305
|
return {
|
|
888306
888306
|
status: "missing_lookup",
|
|
888307
888307
|
usage: `Invalid bundle JSON at ${path7}: expected a JSON object.`
|
|
@@ -891067,8 +891067,7 @@ var AGENT_WORKSPACE_CATEGORIES = [
|
|
|
891067
891067
|
summary: "Acknowledge setup and close onboarding.",
|
|
891068
891068
|
detail: "Use this final step after reviewing setup. Apply & close writes the user onboarding completion marker so normal future launches start in the main conversation.",
|
|
891069
891069
|
actions: [
|
|
891070
|
-
{ id: "onboarding-apply-close", label: "Apply & close", detail: "Acknowledge onboarding as finished, persist the user completion marker, and close the fullscreen Agent workspace.", kind: "onboarding-complete", safety: "safe" }
|
|
891071
|
-
{ id: "finish-review-setup", label: "Review setup first", detail: "Jump back to setup before acknowledging onboarding as finished.", targetCategoryId: "setup", kind: "workspace", safety: "safe" }
|
|
891070
|
+
{ id: "onboarding-apply-close", label: "Apply & close", detail: "Acknowledge onboarding as finished, persist the user completion marker, and close the fullscreen Agent workspace.", kind: "onboarding-complete", safety: "safe" }
|
|
891072
891071
|
]
|
|
891073
891072
|
}
|
|
891074
891073
|
];
|