pi-harness-runtime 1.1.411 → 1.1.413
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/harness/notification-settings.ts +130 -0
- package/harness/skill-remote-source.ts +157 -0
- package/harness/skill-sync.ts +74 -22
- package/harness/skills-startup.ts +229 -0
- package/harness/startup-report.ts +98 -56
- package/harness-startup-status.ts +31 -2
- package/index.ts +125 -31
- package/package.json +1 -1
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/agent-policy/package.json +1 -1
- package/packages/architecture-generator/package.json +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-refactor/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/cache-strategy/package.json +1 -1
- package/packages/capability-registry/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/cli-plugin-sdk/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/clipboard-plugin/package.json +1 -1
- package/packages/code-generation/package.json +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/codex-adapter/package.json +1 -1
- package/packages/codex-watcher/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/connection-runtime/package.json +1 -1
- package/packages/context-compiler/package.json +1 -1
- package/packages/context-discovery/package.json +1 -1
- package/packages/context-manager/package.json +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cost-optimizer/package.json +1 -1
- package/packages/dependency-analyzer/package.json +1 -1
- package/packages/django-plugin/package.json +1 -1
- package/packages/doc-generator/package.json +1 -1
- package/packages/durable-review/package.json +1 -1
- package/packages/e2e-tester/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/evaluation-runner/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-sink/package.json +1 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/feedback-collector/package.json +1 -1
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/framework-detector/package.json +1 -1
- package/packages/framework-plugin-sdk/package.json +1 -1
- package/packages/frappe-plugin/package.json +1 -1
- package/packages/generic-web-plugin/package.json +1 -1
- package/packages/health-monitor/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/knowledge-graph/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/laravel-plugin/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/logging/package.json +1 -1
- package/packages/mcp-adapter/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/milestone-manager/package.json +1 -1
- package/packages/model-registry/package.json +1 -1
- package/packages/nextjs-plugin/package.json +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/observability/package.json +1 -1
- package/packages/okf-indexer/package.json +1 -1
- package/packages/paperclip-integration/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/permission-mode/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/package.json +1 -1
- package/packages/project-bootstrap/package.json +1 -1
- package/packages/projection-engine/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/prompt-versioning/package.json +1 -1
- package/packages/provider-adapter-sdk/package.json +1 -1
- package/packages/provider-router/package.json +1 -1
- package/packages/provider-selector/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/qdrant-skills/dist/client.d.ts +10 -0
- package/packages/qdrant-skills/dist/client.d.ts.map +1 -1
- package/packages/qdrant-skills/dist/client.js +41 -9
- package/packages/qdrant-skills/dist/client.js.map +1 -1
- package/packages/qdrant-skills/dist/embedder.d.ts +10 -0
- package/packages/qdrant-skills/dist/embedder.d.ts.map +1 -1
- package/packages/qdrant-skills/dist/embedder.js +12 -2
- package/packages/qdrant-skills/dist/embedder.js.map +1 -1
- package/packages/qdrant-skills/dist/index.d.ts +2 -2
- package/packages/qdrant-skills/dist/index.d.ts.map +1 -1
- package/packages/qdrant-skills/dist/index.js +2 -2
- package/packages/qdrant-skills/dist/index.js.map +1 -1
- package/packages/qdrant-skills/package.json +1 -1
- package/packages/qdrant-skills/src/client.ts +38 -9
- package/packages/qdrant-skills/src/embedder.ts +14 -2
- package/packages/qdrant-skills/src/index.ts +3 -0
- package/packages/qdrant-skills/test/collection-info.test.ts +165 -0
- package/packages/quota-manager/package.json +1 -1
- package/packages/rate-limiter/package.json +1 -1
- package/packages/react-vite-plugin/package.json +1 -1
- package/packages/relay/package.json +1 -1
- package/packages/release-manager/package.json +1 -1
- package/packages/requirement-compiler/package.json +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/scheduler/package.json +1 -1
- package/packages/scheduler-adapter/package.json +1 -1
- package/packages/session/package.json +1 -1
- package/packages/session-api/package.json +1 -1
- package/packages/session-export/package.json +1 -1
- package/packages/shared-context/package.json +1 -1
- package/packages/skill-mcp-client/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/skills/dist/index.d.ts +14 -1
- package/packages/skills/dist/index.d.ts.map +1 -1
- package/packages/skills/dist/index.js +3 -1
- package/packages/skills/dist/index.js.map +1 -1
- package/packages/skills/dist/loader.d.ts +209 -0
- package/packages/skills/dist/loader.d.ts.map +1 -1
- package/packages/skills/dist/loader.js +386 -15
- package/packages/skills/dist/loader.js.map +1 -1
- package/packages/skills/dist/remote-source.d.ts +107 -0
- package/packages/skills/dist/remote-source.d.ts.map +1 -0
- package/packages/skills/dist/remote-source.js +79 -0
- package/packages/skills/dist/remote-source.js.map +1 -0
- package/packages/skills/dist/vector-schema.d.ts +58 -0
- package/packages/skills/dist/vector-schema.d.ts.map +1 -0
- package/packages/skills/dist/vector-schema.js +55 -0
- package/packages/skills/dist/vector-schema.js.map +1 -0
- package/packages/skills/package.json +1 -1
- package/packages/skills/src/index.ts +16 -2
- package/packages/skills/src/loader.ts +532 -39
- package/packages/skills/src/remote-source.ts +148 -0
- package/packages/skills/src/vector-schema.ts +72 -0
- package/packages/skills/test/remote-skills.test.ts +292 -0
- package/packages/skills/test/remote-source.test.ts +248 -0
- package/packages/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/package.json +1 -1
- package/packages/telegram/package.json +1 -1
- package/packages/tencentdb-memory/package.json +1 -1
- package/packages/tencentdb-sync/package.json +1 -1
- package/packages/test-data-generator/package.json +1 -1
- package/packages/test-generator/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/tooling-preference/package.json +1 -1
- package/packages/trajectory/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/two-phase-review/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/voice-api/package.json +1 -1
- package/packages/webmcp-tester/package.json +1 -1
- package/packages/wiki/package.json +1 -1
- package/packages/workflow-events/package.json +1 -1
- package/packages/workspace-scanner/package.json +1 -1
- package/packages/worktree/package.json +1 -1
- package/packages/write-review/package.json +1 -1
- package/scripts/sync-to-qdrant.ts +79 -14
package/index.ts
CHANGED
|
@@ -19,7 +19,7 @@ import type {
|
|
|
19
19
|
ExtensionCommandContext,
|
|
20
20
|
ExtensionContext,
|
|
21
21
|
} from "@earendil-works/pi-coding-agent";
|
|
22
|
-
import { HarnessStartupStatus, harnessStatusMarker } from "./harness-startup-status.ts";
|
|
22
|
+
import { HarnessStartupStatus, harnessStatusMarker, type HarnessStatus } from "./harness-startup-status.ts";
|
|
23
23
|
import {
|
|
24
24
|
auditKeyFiles,
|
|
25
25
|
fallbackKeyFileFixes,
|
|
@@ -38,6 +38,8 @@ import {
|
|
|
38
38
|
relayEndpointReport,
|
|
39
39
|
relayShouldBeReported,
|
|
40
40
|
} from "./harness/startup-report.ts";
|
|
41
|
+
import { localSkillsReport, skillsReport } from "./harness/skills-startup.ts";
|
|
42
|
+
import { isChannelDisabled, setChannelDisabled } from "./harness/notification-settings.ts";
|
|
41
43
|
import { UsageTracker } from "./tracker.ts";
|
|
42
44
|
import { MirrorStore, type MirrorRecord } from "./mirror.ts";
|
|
43
45
|
import { MiniMaxQuotaScraper } from "./harness/e2e/minimax-quota-scraper.js";
|
|
@@ -2102,7 +2104,14 @@ async function initTelegram(pi: ExtensionAPI): Promise<void> {
|
|
|
2102
2104
|
if (center.isChannelHealthy("line")) {
|
|
2103
2105
|
lineChannelState = "started";
|
|
2104
2106
|
lineChannelDiagnostic = null;
|
|
2105
|
-
|
|
2107
|
+
// The LINE line belongs directly after the Telegram line: the
|
|
2108
|
+
// two notification channels are one topic.
|
|
2109
|
+
addHarnessMessageAfter(
|
|
2110
|
+
"Telegram",
|
|
2111
|
+
"LINE",
|
|
2112
|
+
"configured and enabled (tap Toggle LINE to disable)",
|
|
2113
|
+
"ok",
|
|
2114
|
+
);
|
|
2106
2115
|
} else {
|
|
2107
2116
|
lineChannelState = "failed";
|
|
2108
2117
|
// Keep the reason: "the token is wrong" and "LINE is down"
|
|
@@ -2199,8 +2208,14 @@ async function initTelegram(pi: ExtensionAPI): Promise<void> {
|
|
|
2199
2208
|
} else if (parsed.action === "toggle_line") {
|
|
2200
2209
|
const lineEnabled = (center as any).isChannelEnabled?.("line") ?? true;
|
|
2201
2210
|
(center as any).setChannelEnabled?.("line", !lineEnabled);
|
|
2211
|
+
// The decision must survive a restart: the startup
|
|
2212
|
+
// summary has to know that the channel was turned off
|
|
2213
|
+
// on purpose.
|
|
2214
|
+
persistChannelDecision("line", !lineEnabled);
|
|
2202
2215
|
logToFile("[TelegramCallback]", `LINE ${!lineEnabled ? "enabled" : "disabled"}`);
|
|
2203
2216
|
await acknowledge(`LINE notifications ${!lineEnabled ? "enabled" : "disabled"}`);
|
|
2217
|
+
// The startup line must tell the truth.
|
|
2218
|
+
reportLineConfiguration();
|
|
2204
2219
|
} else {
|
|
2205
2220
|
logToFile("[TelegramCallback]", `Unknown action: ${parsed.action}`);
|
|
2206
2221
|
}
|
|
@@ -2223,8 +2238,14 @@ async function initTelegram(pi: ExtensionAPI): Promise<void> {
|
|
|
2223
2238
|
const targetChannels = channel === "all" ? ["telegram", "line"] : [channel];
|
|
2224
2239
|
for (const ch of targetChannels) {
|
|
2225
2240
|
(center as any).setChannelEnabled?.(ch, isEnabled);
|
|
2241
|
+
// The decision must survive a restart.
|
|
2242
|
+
persistChannelDecision(ch, isEnabled);
|
|
2226
2243
|
logToFile("[NotifySettings]", `Set ${ch} to ${isEnabled ? "enabled" : "disabled"}`);
|
|
2227
2244
|
}
|
|
2245
|
+
if (targetChannels.includes("line")) {
|
|
2246
|
+
// The startup line must tell the truth.
|
|
2247
|
+
reportLineConfiguration();
|
|
2248
|
+
}
|
|
2228
2249
|
}
|
|
2229
2250
|
|
|
2230
2251
|
// Show current status
|
|
@@ -2506,6 +2527,48 @@ function reportRelayConfiguration(): void {
|
|
|
2506
2527
|
addHarnessMessage(report.label, report.text, report.status, report.details);
|
|
2507
2528
|
}
|
|
2508
2529
|
|
|
2530
|
+
/**
|
|
2531
|
+
* Put a startup line directly after another one.
|
|
2532
|
+
*
|
|
2533
|
+
* The notification channels belong together: the Telegram line and the LINE
|
|
2534
|
+
* line must not be separated by a line that another feature added in
|
|
2535
|
+
* between.
|
|
2536
|
+
*/
|
|
2537
|
+
function addHarnessMessageAfter(
|
|
2538
|
+
anchorLabel: string,
|
|
2539
|
+
label: string,
|
|
2540
|
+
text: string,
|
|
2541
|
+
status: HarnessStatus = "wait",
|
|
2542
|
+
details?: string[],
|
|
2543
|
+
): void {
|
|
2544
|
+
startupStatus.updateAfter(anchorLabel, label, text, status, details);
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2547
|
+
/**
|
|
2548
|
+
* Remember an explicit channel decision.
|
|
2549
|
+
*
|
|
2550
|
+
* The notification center keeps the state in memory (and in its own
|
|
2551
|
+
* database). The startup summary needs the decision BEFORE any channel is
|
|
2552
|
+
* initialized, and it must survive a restart - so it is written to the
|
|
2553
|
+
* notification settings.
|
|
2554
|
+
*/
|
|
2555
|
+
function persistChannelDecision(channel: string, enabled: boolean): void {
|
|
2556
|
+
if (!setChannelDisabled(channel, !enabled)) {
|
|
2557
|
+
logToFile("[NotifySettings]", `Could not persist the ${channel} decision`);
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2561
|
+
/**
|
|
2562
|
+
* Did the user explicitly turn the LINE channel off?
|
|
2563
|
+
*
|
|
2564
|
+
* Only an explicit decision counts. A missing key file means the channel
|
|
2565
|
+
* was never configured - that is a different state with a different
|
|
2566
|
+
* meaning, and it must not be shown as "disabled".
|
|
2567
|
+
*/
|
|
2568
|
+
function lineIsExplicitlyDisabled(): boolean {
|
|
2569
|
+
return isChannelDisabled("line");
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2509
2572
|
/**
|
|
2510
2573
|
* Report the LINE configuration in the startup summary.
|
|
2511
2574
|
*
|
|
@@ -2514,20 +2577,23 @@ function reportRelayConfiguration(): void {
|
|
|
2514
2577
|
* configured - that is exactly the fresh-install case where the user needs
|
|
2515
2578
|
* the instructions. The "configured" line stays with initTelegram, which owns
|
|
2516
2579
|
* the channel.
|
|
2580
|
+
*
|
|
2581
|
+
* The line is always reported: a fresh install must show that LINE is one
|
|
2582
|
+
* of the two notification channels, together with the steps that make it
|
|
2583
|
+
* work.
|
|
2517
2584
|
*/
|
|
2518
2585
|
function reportLineConfiguration(): void {
|
|
2519
|
-
// A user who never touched LINE must not see a warning on every start.
|
|
2520
|
-
// The line appears as soon as a LINE client key file exists.
|
|
2521
2586
|
const report = lineConfigurationReport({
|
|
2522
2587
|
audit: getKeyFileAudit(),
|
|
2523
|
-
|
|
2588
|
+
// An explicit opt-out is the only thing that makes the channel
|
|
2589
|
+
// "disabled".
|
|
2590
|
+
disabled: lineIsExplicitlyDisabled(),
|
|
2524
2591
|
channelState: lineChannelState,
|
|
2525
2592
|
telegramConfigured: telegramIsConfigured(),
|
|
2526
|
-
//
|
|
2527
|
-
//
|
|
2528
|
-
//
|
|
2529
|
-
|
|
2530
|
-
fixes: keyFileFixesOrFallback("LINE", ["channel access token"]),
|
|
2593
|
+
// Both credentials are named: a LINE channel needs the access token
|
|
2594
|
+
// AND the user id. The fallback makes sure that a warning always
|
|
2595
|
+
// carries a command, even when the audit could not answer.
|
|
2596
|
+
fixes: keyFileFixesOrFallback("LINE", ["channel access token", "user id"]),
|
|
2531
2597
|
// The startup check validates the access token - the user id is only
|
|
2532
2598
|
// the recipient, so it must not be named as the cause.
|
|
2533
2599
|
accessTokenFixes: keyFileFixesOrFallback("LINE", ["channel access token"]),
|
|
@@ -2538,7 +2604,7 @@ function reportLineConfiguration(): void {
|
|
|
2538
2604
|
telegramFixes: keyFileFixesOrFallback("Telegram", ["bot token", "chat id"]),
|
|
2539
2605
|
});
|
|
2540
2606
|
if (!report) return;
|
|
2541
|
-
|
|
2607
|
+
addHarnessMessageAfter("Telegram", report.label, report.text, report.status, report.details);
|
|
2542
2608
|
}
|
|
2543
2609
|
|
|
2544
2610
|
/**
|
|
@@ -2576,24 +2642,6 @@ function hasAnyRelayKeyFile(): boolean {
|
|
|
2576
2642
|
}
|
|
2577
2643
|
}
|
|
2578
2644
|
|
|
2579
|
-
/**
|
|
2580
|
-
* Does the key directory hold a LINE client credential?
|
|
2581
|
-
*
|
|
2582
|
-
* The LINE warning is only relevant for a user who started to set LINE up
|
|
2583
|
-
* (a line-access-token.txt or a line-user-id.txt file exists) but did not
|
|
2584
|
-
* finish. The channel secret (line-channel-secret.txt) does not count: it
|
|
2585
|
-
* is only needed on the host that runs the webhook server.
|
|
2586
|
-
*/
|
|
2587
|
-
function hasLineClientKeyFile(): boolean {
|
|
2588
|
-
try {
|
|
2589
|
-
return readdirSync(harnessKeysDir()).some(
|
|
2590
|
-
(entry) => entry === "line-access-token.txt" || entry === "line-user-id.txt",
|
|
2591
|
-
);
|
|
2592
|
-
} catch {
|
|
2593
|
-
return false;
|
|
2594
|
-
}
|
|
2595
|
-
}
|
|
2596
|
-
|
|
2597
2645
|
/**
|
|
2598
2646
|
* Initialize relay streaming for real-time callback delivery.
|
|
2599
2647
|
* Connects to the relay WebSocket server and forwards Telegram callbacks
|
|
@@ -3416,8 +3464,54 @@ async function initHermesSkills(pi: ExtensionAPI): Promise<void> {
|
|
|
3416
3464
|
|
|
3417
3465
|
// Scan skills from default locations
|
|
3418
3466
|
const result = initSkills();
|
|
3419
|
-
|
|
3420
|
-
|
|
3467
|
+
const localCount = result.skills.length;
|
|
3468
|
+
logStartup(`[pi-harness] Scanned ${localCount} local skills`);
|
|
3469
|
+
// The line carries the local count AND the count of the vector
|
|
3470
|
+
// store: a machine without local skill files can still reach a
|
|
3471
|
+
// shared skill, and a single "N discovered" hides that difference.
|
|
3472
|
+
const local = localSkillsReport(localCount);
|
|
3473
|
+
addHarnessMessage("Skills", local.text, local.status, local.details);
|
|
3474
|
+
// The server-held skills. The service holds the authoritative
|
|
3475
|
+
// files, so a machine without a local copy can still use a skill.
|
|
3476
|
+
// It is only used when it is configured - a client without a
|
|
3477
|
+
// service never calls out.
|
|
3478
|
+
let remoteConfigured = false;
|
|
3479
|
+
try {
|
|
3480
|
+
const { isSkillSyncConfigured } = await import(
|
|
3481
|
+
"./harness/skill-sync.js"
|
|
3482
|
+
);
|
|
3483
|
+
remoteConfigured = isSkillSyncConfigured();
|
|
3484
|
+
if (remoteConfigured) {
|
|
3485
|
+
const { SkillServiceSource } = await import(
|
|
3486
|
+
"./harness/skill-remote-source.js"
|
|
3487
|
+
);
|
|
3488
|
+
result.registry.setRemoteSource(new SkillServiceSource());
|
|
3489
|
+
}
|
|
3490
|
+
} catch (err) {
|
|
3491
|
+
logStartup(
|
|
3492
|
+
`[pi-harness] Could not prepare the skill service: ${err instanceof Error ? err.message : String(err)}`,
|
|
3493
|
+
);
|
|
3494
|
+
}
|
|
3495
|
+
|
|
3496
|
+
// The count of the vector store needs the cluster, so it is fetched
|
|
3497
|
+
// in the background - the startup must not wait for the network.
|
|
3498
|
+
void (async () => {
|
|
3499
|
+
const stats = await result.registry.getQdrantStats();
|
|
3500
|
+
// The service is asked for its own state, so a refused
|
|
3501
|
+
// service and an unreachable one stay apart.
|
|
3502
|
+
const remote = remoteConfigured
|
|
3503
|
+
? await result.registry.getRemoteStats().catch(() => ({
|
|
3504
|
+
state: "unavailable" as const,
|
|
3505
|
+
count: 0,
|
|
3506
|
+
}))
|
|
3507
|
+
: undefined;
|
|
3508
|
+
const report = skillsReport(localCount, stats, remote);
|
|
3509
|
+
addHarnessMessage("Skills", report.text, report.status, report.details);
|
|
3510
|
+
})().catch((err) => {
|
|
3511
|
+
logStartup(
|
|
3512
|
+
`[pi-harness] Could not read the skill vector store: ${err instanceof Error ? err.message : String(err)}`,
|
|
3513
|
+
);
|
|
3514
|
+
});
|
|
3421
3515
|
|
|
3422
3516
|
// Register /skill commands
|
|
3423
3517
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/capability-registry",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.413",
|
|
4
4
|
"description": "Capability Registry for pi-harness-runtime — tracks model capabilities and enables capability-based routing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|