vana-cli 0.24.5 → 0.25.0
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/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +91 -12
- package/dist/cli/index.js.map +1 -1
- package/dist/connectors/registry.d.ts +2 -0
- package/dist/connectors/registry.d.ts.map +1 -1
- package/dist/connectors/registry.js +18 -2
- package/dist/connectors/registry.js.map +1 -1
- package/dist/core/cli-types.d.ts +44 -0
- package/dist/core/cli-types.d.ts.map +1 -1
- package/dist/core/cli-types.js +14 -0
- package/dist/core/cli-types.js.map +1 -1
- package/dist/core/state-store.d.ts +6 -0
- package/dist/core/state-store.d.ts.map +1 -1
- package/dist/core/state-store.js.map +1 -1
- package/dist/pdpp/host.d.ts +66 -0
- package/dist/pdpp/host.d.ts.map +1 -0
- package/dist/pdpp/host.js +283 -0
- package/dist/pdpp/host.js.map +1 -0
- package/dist/pdpp/installer.d.ts +17 -0
- package/dist/pdpp/installer.d.ts.map +1 -0
- package/dist/pdpp/installer.js +117 -0
- package/dist/pdpp/installer.js.map +1 -0
- package/dist/pdpp/local.d.ts +14 -0
- package/dist/pdpp/local.d.ts.map +1 -0
- package/dist/pdpp/local.js +76 -0
- package/dist/pdpp/local.js.map +1 -0
- package/dist/pdpp/pins.d.ts +23 -0
- package/dist/pdpp/pins.d.ts.map +1 -0
- package/dist/pdpp/pins.js +18 -0
- package/dist/pdpp/pins.js.map +1 -0
- package/dist/pdpp/profile.d.ts +49 -0
- package/dist/pdpp/profile.d.ts.map +1 -0
- package/dist/pdpp/profile.js +17 -0
- package/dist/pdpp/profile.js.map +1 -0
- package/dist/pdpp/protocol.d.ts +79 -0
- package/dist/pdpp/protocol.d.ts.map +1 -0
- package/dist/pdpp/protocol.js +372 -0
- package/dist/pdpp/protocol.js.map +1 -0
- package/dist/pdpp/runtime.d.ts +43 -0
- package/dist/pdpp/runtime.d.ts.map +1 -0
- package/dist/pdpp/runtime.js +387 -0
- package/dist/pdpp/runtime.js.map +1 -0
- package/dist/pdpp/store.d.ts +43 -0
- package/dist/pdpp/store.d.ts.map +1 -0
- package/dist/pdpp/store.js +100 -0
- package/dist/pdpp/store.js.map +1 -0
- package/dist/runtime/core/contracts.d.ts +2 -0
- package/dist/runtime/core/contracts.d.ts.map +1 -1
- package/dist/runtime/managed-playwright.d.ts +7 -0
- package/dist/runtime/managed-playwright.d.ts.map +1 -1
- package/dist/runtime/managed-playwright.js +7 -0
- package/dist/runtime/managed-playwright.js.map +1 -1
- package/dist/vendor/pdpp-connector-manager/LICENSE +202 -0
- package/dist/vendor/pdpp-connector-manager/NOTICE +2 -0
- package/dist/vendor/pdpp-connector-manager/VENDOR.md +27 -0
- package/dist/vendor/pdpp-connector-manager/catalog-schema-data.mjs +168 -0
- package/dist/vendor/pdpp-connector-manager/catalog-schema.mjs +62 -0
- package/dist/vendor/pdpp-connector-manager/index.d.mts +49 -0
- package/dist/vendor/pdpp-connector-manager/index.mjs +1646 -0
- package/dist/vendor/pdpp-connector-manager/oci-catalog.mjs +93 -0
- package/dist/vendor/pdpp-connector-manager/oci-registry.mjs +1002 -0
- package/dist/vendor/pdpp-connector-manager/oci-verify.mjs +515 -0
- package/dist/vendor/pdpp-connector-manager/package.json +51 -0
- package/dist/vendor/pdpp-connector-manager/retry.mjs +142 -0
- package/dist/vendor/pdpp-connector-manager/tar-stream.mjs +685 -0
- package/package.json +7 -2
package/dist/cli/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ interface SourceMetadataMap {
|
|
|
11
11
|
company?: string;
|
|
12
12
|
description?: string;
|
|
13
13
|
authMode?: "automated" | "interactive" | "legacy";
|
|
14
|
+
runtime?: "legacy" | "pdpp";
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
type RenderTone = "accent" | "success" | "warning" | "error" | "muted" | "info";
|
|
@@ -63,6 +64,7 @@ export declare function createSourceMetadataMap(sources: Array<{
|
|
|
63
64
|
company?: string;
|
|
64
65
|
description?: string;
|
|
65
66
|
authMode?: "automated" | "interactive" | "legacy";
|
|
67
|
+
runtime?: "legacy" | "pdpp";
|
|
66
68
|
}>): SourceMetadataMap;
|
|
67
69
|
export declare function getSourceStatusPresentation(source: SourceStatus): {
|
|
68
70
|
label: string;
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAQL,YAAY,EAIb,MAAM,kBAAkB,CAAC;AAY1B,OAAO,KAAK,EACV,UAAU,EAEV,gBAAgB,EAEhB,SAAS,EACT,YAAY,EACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAQL,YAAY,EAIb,MAAM,kBAAkB,CAAC;AAY1B,OAAO,KAAK,EACV,UAAU,EAEV,gBAAgB,EAEhB,SAAS,EACT,YAAY,EACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAgKjE,UAAU,cAAc;IACtB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED,UAAU,iBAAiB;IACzB,CAAC,MAAM,EAAE,MAAM,GAAG;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC;QAClD,OAAO,C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BAAmB,CACjC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B;IAAE,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAoD5B;AA6BD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUrD;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE;IACJ,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB,EACD,KAAK,EAAE;IACL,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB,GACA,MAAM,CAaR;AAsBD,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC,GAAG,IAAI,GAAG,SAAS,GACtD,OAAO,CAOT;AAqMD,qBAAa,2BAA4B,SAAQ,KAAK;CAAG;AAEzD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,GAAE,gBAAwC,EACvD,QAAQ,SAAmB,EAC3B,WAAW,SAAkB,GAC5B,MAAM,EAAE,CAkBV;AAgDD,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EAAE,EACrB,eAAe,EAAE,MAAM,GACtB,MAAM,CA+BR"}
|
package/dist/cli/index.js
CHANGED
|
@@ -36,6 +36,8 @@ import { lookupRegisteredServers } from "../personal-server/registered.js";
|
|
|
36
36
|
import { fetchConnectorToCache, listAvailableSources, readCachedConnectorMetadata, } from "../connectors/registry.js";
|
|
37
37
|
import { detectPersonalServerTarget, ingestResult, personalServerOwnerMismatch, resolvePersonalServerAuthConfig, } from "../personal-server/index.js";
|
|
38
38
|
import { findDataConnectorsDir, ManagedPlaywrightRuntime, } from "../runtime/index.js";
|
|
39
|
+
import { getPdppProfileRoot } from "../pdpp/host.js";
|
|
40
|
+
import { isPdppSource, PdppRuntime } from "../pdpp/runtime.js";
|
|
39
41
|
import { listAvailableSkills, installSkill, readInstalledSkills, } from "../skills/index.js";
|
|
40
42
|
import { queryStatus, querySources, queryDataList, queryDataShow, queryDoctor, } from "./queries.js";
|
|
41
43
|
import { checkForUpdate, readUpdateCheck, isNewerVersion, } from "./update-check.js";
|
|
@@ -227,13 +229,18 @@ More:
|
|
|
227
229
|
.option("--yes", "Approve safe setup prompts automatically")
|
|
228
230
|
.option("--quiet", "Reduce non-essential output")
|
|
229
231
|
.option("--detach", "Run in the background")
|
|
230
|
-
.
|
|
232
|
+
.option("--from <checkout>", "Run a Collection Profile connector from a data-connectors checkout")
|
|
233
|
+
.action(async (source, commandOptions) => {
|
|
231
234
|
process.exitCode = await runCommandWithTelemetry({ ...telemetryBaseContext, command: "connect", source }, async () => {
|
|
235
|
+
if (commandOptions.from && (!source || parsedOptions.detach)) {
|
|
236
|
+
process.stderr.write("--from needs a source and cannot be combined with --detach.\n");
|
|
237
|
+
return CliExitCode.USAGE;
|
|
238
|
+
}
|
|
232
239
|
if (parsedOptions.detach && source) {
|
|
233
240
|
return runDetached("connect", source, parsedOptions);
|
|
234
241
|
}
|
|
235
242
|
return source
|
|
236
|
-
? runConnect(source, parsedOptions)
|
|
243
|
+
? runConnect(source, parsedOptions, { from: commandOptions.from })
|
|
237
244
|
: runConnectEntry(parsedOptions);
|
|
238
245
|
});
|
|
239
246
|
});
|
|
@@ -243,6 +250,7 @@ Examples:
|
|
|
243
250
|
vana connect github
|
|
244
251
|
vana connect github --json --no-input
|
|
245
252
|
vana connect github --json --ipc
|
|
253
|
+
vana connect instinct --from ~/src/data-connectors
|
|
246
254
|
`);
|
|
247
255
|
const sourcesCommand = program
|
|
248
256
|
.command("sources [source]")
|
|
@@ -801,9 +809,9 @@ export async function withPhaseProgress(renderer, label, work, delayMs = PHASE_P
|
|
|
801
809
|
throw error;
|
|
802
810
|
}
|
|
803
811
|
}
|
|
804
|
-
async function runConnect(rawSource, options) {
|
|
812
|
+
async function runConnect(rawSource, options, connectOptions = {}) {
|
|
805
813
|
const source = rawSource.toLowerCase();
|
|
806
|
-
const
|
|
814
|
+
const isPdpp = isPdppSource(source, { from: connectOptions.from });
|
|
807
815
|
const emit = createEmitter(options);
|
|
808
816
|
const renderer = !options.json && !options.quiet ? createConnectRenderer() : null;
|
|
809
817
|
const registrySources = await loadRegistrySources();
|
|
@@ -844,6 +852,14 @@ async function runConnect(rawSource, options) {
|
|
|
844
852
|
}
|
|
845
853
|
}
|
|
846
854
|
}
|
|
855
|
+
// Collection Profile state is kept per server owner, so it has to be
|
|
856
|
+
// settled here, after the server is known.
|
|
857
|
+
const runtime = isPdpp
|
|
858
|
+
? new PdppRuntime({
|
|
859
|
+
from: connectOptions.from,
|
|
860
|
+
owner: target.health?.owner ?? loadCredentials()?.account?.address,
|
|
861
|
+
})
|
|
862
|
+
: new ManagedPlaywrightRuntime();
|
|
847
863
|
// --- Phase 1: Runtime check (silent if installed) ---
|
|
848
864
|
if (runtime.state !== "installed") {
|
|
849
865
|
if (options.noInput) {
|
|
@@ -858,10 +874,11 @@ async function runConnect(rawSource, options) {
|
|
|
858
874
|
if (!options.yes) {
|
|
859
875
|
renderer?.cleanup();
|
|
860
876
|
process.stderr.write("\n");
|
|
861
|
-
process.stderr.write("Vana Connect needs a local
|
|
877
|
+
process.stderr.write("Vana Connect needs a local runtime.\n\n");
|
|
862
878
|
process.stderr.write("This will install:\n");
|
|
863
|
-
|
|
864
|
-
|
|
879
|
+
for (const line of runtime.installSummary.lines) {
|
|
880
|
+
process.stderr.write(` \u2022 ${line}\n`);
|
|
881
|
+
}
|
|
865
882
|
process.stderr.write(" \u2022 Local files under ~/.vana/\n\n");
|
|
866
883
|
process.stderr.write("Your credentials stay on this machine.\n\n");
|
|
867
884
|
const shouldContinue = await confirm({
|
|
@@ -884,7 +901,7 @@ async function runConnect(rawSource, options) {
|
|
|
884
901
|
trackActiveTelemetryEvent("runtime_install_started", { source });
|
|
885
902
|
let installResult;
|
|
886
903
|
try {
|
|
887
|
-
installResult = await withPhaseProgress(renderer,
|
|
904
|
+
installResult = await withPhaseProgress(renderer, runtime.installSummary.phase, () => runtime.ensureInstalled(Boolean(options.yes)));
|
|
888
905
|
}
|
|
889
906
|
catch (error) {
|
|
890
907
|
trackActiveTelemetryEvent("runtime_install_failed", {
|
|
@@ -919,7 +936,9 @@ async function runConnect(rawSource, options) {
|
|
|
919
936
|
firstMessage.toLowerCase().includes("mismatch");
|
|
920
937
|
// Auto-retry on stale cache: clear cached connector and re-fetch
|
|
921
938
|
// from remote (skip local data-connectors dir which may be stale).
|
|
922
|
-
|
|
939
|
+
// Collection Profiles verify against a signed digest instead, and a
|
|
940
|
+
// failure there must never fall back to the legacy cache.
|
|
941
|
+
if (isChecksumError && !isPdpp) {
|
|
923
942
|
try {
|
|
924
943
|
const cacheDir = getConnectorCacheDir();
|
|
925
944
|
const sourceCacheDir = path.join(cacheDir, source);
|
|
@@ -1003,7 +1022,9 @@ async function runConnect(rawSource, options) {
|
|
|
1003
1022
|
connectorVersion: fetched.version,
|
|
1004
1023
|
});
|
|
1005
1024
|
// --- Phase 3: Pre-connection validation (silent) ---
|
|
1006
|
-
const profilePath =
|
|
1025
|
+
const profilePath = isPdpp
|
|
1026
|
+
? path.join(getPdppProfileRoot(), source)
|
|
1027
|
+
: path.join(getBrowserProfilesDir(), `${path.basename(resolution.connectorPath, path.extname(resolution.connectorPath))}`);
|
|
1007
1028
|
if (sourceDetails?.authMode === "legacy" &&
|
|
1008
1029
|
!options.noInput &&
|
|
1009
1030
|
process.platform === "linux" &&
|
|
@@ -1041,6 +1062,7 @@ async function runConnect(rawSource, options) {
|
|
|
1041
1062
|
let resultPath = getSourceResultPath(source);
|
|
1042
1063
|
let collectedResult = false;
|
|
1043
1064
|
let blockedByRequiredInput = false;
|
|
1065
|
+
const skippedStreams = [];
|
|
1044
1066
|
let ingestScopeResults;
|
|
1045
1067
|
// Chromium start-up and the first page load happen before a connector
|
|
1046
1068
|
// reports anything, which is the longest silent stretch of a warm run.
|
|
@@ -1054,6 +1076,31 @@ async function runConnect(rawSource, options) {
|
|
|
1054
1076
|
// Settle first: a spinner repaint would overwrite the prompt.
|
|
1055
1077
|
launchProgress.settle();
|
|
1056
1078
|
renderer?.pauseForPrompt();
|
|
1079
|
+
// A manual step happens in the browser window the connector opened;
|
|
1080
|
+
// the prompt only waits for the person to say it is done.
|
|
1081
|
+
if (needInput.kind === "manual_action") {
|
|
1082
|
+
process.stderr.write(`\n${needInput.message ?? `Sign in to ${displayName} in the browser window.`}\n\n`);
|
|
1083
|
+
let finished;
|
|
1084
|
+
try {
|
|
1085
|
+
finished = await confirm({
|
|
1086
|
+
message: "Done in the browser?",
|
|
1087
|
+
default: true,
|
|
1088
|
+
...vanaPromptTheme,
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
catch (error) {
|
|
1092
|
+
if (isPromptCancelled(error)) {
|
|
1093
|
+
throw new Error("__vana_prompt_cancelled__");
|
|
1094
|
+
}
|
|
1095
|
+
throw error;
|
|
1096
|
+
}
|
|
1097
|
+
if (!finished) {
|
|
1098
|
+
throw new Error("__vana_prompt_cancelled__");
|
|
1099
|
+
}
|
|
1100
|
+
process.stderr.write("\n");
|
|
1101
|
+
renderer?.resumeAfterPrompt();
|
|
1102
|
+
return {};
|
|
1103
|
+
}
|
|
1057
1104
|
// Show connector’s prompt message
|
|
1058
1105
|
if (renderer) {
|
|
1059
1106
|
const promptMessage = needInput.message ?? `${displayName} needs your login.`;
|
|
@@ -1062,7 +1109,9 @@ async function runConnect(rawSource, options) {
|
|
|
1062
1109
|
const values = {};
|
|
1063
1110
|
try {
|
|
1064
1111
|
for (const field of needInput.fields) {
|
|
1065
|
-
const
|
|
1112
|
+
const fieldSchema = needInput.schema?.properties?.[field];
|
|
1113
|
+
const isPasswordField = field.toLowerCase().includes("password") ||
|
|
1114
|
+
fieldSchema?.format === "password";
|
|
1066
1115
|
if (isPasswordField) {
|
|
1067
1116
|
values[field] = await password({
|
|
1068
1117
|
message: humanizeField(field),
|
|
@@ -1148,6 +1197,14 @@ async function runConnect(rawSource, options) {
|
|
|
1148
1197
|
// Status updates are silent in the new design
|
|
1149
1198
|
continue;
|
|
1150
1199
|
}
|
|
1200
|
+
if (event.type === "stream-skipped") {
|
|
1201
|
+
skippedStreams.push({
|
|
1202
|
+
stream: event.stream,
|
|
1203
|
+
reason: event.reason,
|
|
1204
|
+
message: event.message,
|
|
1205
|
+
});
|
|
1206
|
+
continue;
|
|
1207
|
+
}
|
|
1151
1208
|
if (event.type === "runtime-error") {
|
|
1152
1209
|
await updateSourceState(resolution.source, {
|
|
1153
1210
|
lastRunAt: new Date().toISOString(),
|
|
@@ -1324,6 +1381,7 @@ async function runConnect(rawSource, options) {
|
|
|
1324
1381
|
connectionHealthReason: pendingExitCode !== null ? undefined : "collection-complete",
|
|
1325
1382
|
connectionHealthRetryable: undefined,
|
|
1326
1383
|
ingestScopes: ingestScopeResults,
|
|
1384
|
+
skippedStreams: skippedStreams.length > 0 ? skippedStreams : undefined,
|
|
1327
1385
|
});
|
|
1328
1386
|
// Build scope-aware success summary
|
|
1329
1387
|
const storedCount = ingestScopeResults?.filter((r) => r.status === "stored").length ?? 0;
|
|
@@ -1355,6 +1413,9 @@ async function runConnect(rawSource, options) {
|
|
|
1355
1413
|
// --- Phase 7: Success summary ---
|
|
1356
1414
|
renderer?.success(`Connected ${displayName}.`);
|
|
1357
1415
|
renderer?.detail(successSummary);
|
|
1416
|
+
for (const skip of skippedStreams) {
|
|
1417
|
+
renderer?.detail(`Skipped ${skip.stream ?? "part of the run"}: ${skip.message ?? skip.reason ?? "no reason given"}. Earlier data for it was kept.`);
|
|
1418
|
+
}
|
|
1358
1419
|
// Partial sync guidance
|
|
1359
1420
|
if (failedCount > 0 && storedCount > 0) {
|
|
1360
1421
|
renderer?.detail(`Retry: vana server sync`);
|
|
@@ -1550,6 +1611,9 @@ async function runList(options) {
|
|
|
1550
1611
|
else {
|
|
1551
1612
|
badges.push({ text: "local", tone: "muted" });
|
|
1552
1613
|
}
|
|
1614
|
+
if (source.runtime === "pdpp") {
|
|
1615
|
+
badges.push({ text: "collection profile", tone: "muted" });
|
|
1616
|
+
}
|
|
1553
1617
|
emit.sourceTitle(source.name, badges);
|
|
1554
1618
|
emit.detail(`Inspect with ${emit.code(`vana data show ${source.id}`)}.`);
|
|
1555
1619
|
}
|
|
@@ -1562,6 +1626,9 @@ async function runList(options) {
|
|
|
1562
1626
|
recommendedSource.authMode !== "legacy") {
|
|
1563
1627
|
badges.push({ text: "recommended", tone: "accent" });
|
|
1564
1628
|
}
|
|
1629
|
+
if (source.runtime === "pdpp") {
|
|
1630
|
+
badges.push({ text: "collection profile", tone: "muted" });
|
|
1631
|
+
}
|
|
1565
1632
|
emit.sourceTitle(source.name, badges);
|
|
1566
1633
|
if (source.description) {
|
|
1567
1634
|
emit.detail(cleanDescription(source.description));
|
|
@@ -1759,6 +1826,12 @@ function formatHumanStatusDetail(source) {
|
|
|
1759
1826
|
if (source.lastRunOutcome === CliOutcomeStatus.CONNECTOR_UNAVAILABLE) {
|
|
1760
1827
|
return "No connector available. Run `vana sources`.";
|
|
1761
1828
|
}
|
|
1829
|
+
if (source.skippedStreams && source.skippedStreams.length > 0) {
|
|
1830
|
+
const streams = source.skippedStreams
|
|
1831
|
+
.map((skip) => skip.stream ?? "the whole run")
|
|
1832
|
+
.join(", ");
|
|
1833
|
+
return `Skipped last run: ${streams}. Earlier data for them was kept. Details: \`vana logs ${source.source}\`.`;
|
|
1834
|
+
}
|
|
1762
1835
|
return null;
|
|
1763
1836
|
}
|
|
1764
1837
|
function formatSyncFailureSummary(source) {
|
|
@@ -3115,8 +3188,11 @@ export async function gatherSourceStatuses(storedSources, metadata = {}) {
|
|
|
3115
3188
|
return [...sourceNames]
|
|
3116
3189
|
.map((source) => {
|
|
3117
3190
|
const stored = storedSources[source] ?? {};
|
|
3118
|
-
const installed = installedFiles.some((file) => file.source === source);
|
|
3119
3191
|
const details = metadata[source];
|
|
3192
|
+
// Collection Profiles live outside the legacy connector cache, so their
|
|
3193
|
+
// install is known only from the last connect.
|
|
3194
|
+
const installed = installedFiles.some((file) => file.source === source) ||
|
|
3195
|
+
(details?.runtime === "pdpp" && stored.connectorInstalled === true);
|
|
3120
3196
|
const dataState = stored.dataState === "ingested_personal_server"
|
|
3121
3197
|
? "ingested_personal_server"
|
|
3122
3198
|
: stored.dataState === "ingest_unavailable"
|
|
@@ -3142,6 +3218,7 @@ export async function gatherSourceStatuses(storedSources, metadata = {}) {
|
|
|
3142
3218
|
company: details?.company,
|
|
3143
3219
|
description: details?.description,
|
|
3144
3220
|
authMode: details?.authMode ?? inferInstalledAuthMode(installedFiles, source),
|
|
3221
|
+
runtime: details?.runtime,
|
|
3145
3222
|
connectorVersion: stored.connectorVersion,
|
|
3146
3223
|
exportFrequency: stored.exportFrequency,
|
|
3147
3224
|
lastCollectedAt: stored.lastCollectedAt,
|
|
@@ -3158,6 +3235,7 @@ export async function gatherSourceStatuses(storedSources, metadata = {}) {
|
|
|
3158
3235
|
lastResultPath: stored.lastResultPath ?? null,
|
|
3159
3236
|
lastLogPath: stored.lastLogPath ?? null,
|
|
3160
3237
|
ingestScopes,
|
|
3238
|
+
skippedStreams: stored.skippedStreams,
|
|
3161
3239
|
syncedScopeCount: syncedScopeCount > 0 ? syncedScopeCount : undefined,
|
|
3162
3240
|
failedScopeCount: failedScopeCount > 0 ? failedScopeCount : undefined,
|
|
3163
3241
|
suggestedNextCollectionAt,
|
|
@@ -3741,6 +3819,7 @@ export function createSourceMetadataMap(sources) {
|
|
|
3741
3819
|
company: source.company,
|
|
3742
3820
|
description: source.description,
|
|
3743
3821
|
authMode: source.authMode,
|
|
3822
|
+
runtime: source.runtime,
|
|
3744
3823
|
},
|
|
3745
3824
|
]));
|
|
3746
3825
|
}
|