pi-harness-runtime 1.1.411 → 1.1.412
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 +202 -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.map +1 -1
- package/packages/qdrant-skills/dist/client.js +21 -8
- 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 +1 -1
- package/packages/qdrant-skills/dist/index.d.ts.map +1 -1
- package/packages/qdrant-skills/dist/index.js +1 -1
- 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 +19 -8
- package/packages/qdrant-skills/src/embedder.ts +14 -2
- package/packages/qdrant-skills/src/index.ts +2 -0
- package/packages/qdrant-skills/test/collection-info.test.ts +129 -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 +179 -0
- package/packages/skills/dist/loader.d.ts.map +1 -1
- package/packages/skills/dist/loader.js +337 -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 +458 -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 +242 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-source.d.ts","sourceRoot":"","sources":["../src/remote-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,gCAAgC;AAChC,MAAM,WAAW,WAAW;IAC3B,4CAA4C;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,8CAA8C;AAC9C,M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|
|
4
|
+
* The vector store holds an INDEX: the name, the description and a
|
|
5
|
+
* truncated body. That is enough to FIND a skill, but not to use it - a
|
|
6
|
+
* complete SKILL.md (with its references and examples) is larger than a
|
|
7
|
+
* vector store payload should be.
|
|
8
|
+
*
|
|
9
|
+
* The remote source is therefore the authoritative store of the complete
|
|
10
|
+
* skill content. It is reached through an authenticated service, so the
|
|
11
|
+
* SERVER decides which skills this user may see. A client never decides
|
|
12
|
+
* that on its own.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* A skill from a remote record.
|
|
16
|
+
*
|
|
17
|
+
* The record carries the content, so the skill is usable without a local
|
|
18
|
+
* copy. The path stays empty: a server skill has no directory on this
|
|
19
|
+
* machine.
|
|
20
|
+
*/
|
|
21
|
+
export function skillFromRemote(record) {
|
|
22
|
+
const version = record.version;
|
|
23
|
+
return {
|
|
24
|
+
id: record.id,
|
|
25
|
+
path: "",
|
|
26
|
+
frontmatter: {
|
|
27
|
+
name: record.name,
|
|
28
|
+
description: record.description,
|
|
29
|
+
...(version ? { version } : {}),
|
|
30
|
+
},
|
|
31
|
+
body: record.content ?? "",
|
|
32
|
+
references: [],
|
|
33
|
+
examples: [],
|
|
34
|
+
metadata: {
|
|
35
|
+
name: record.name,
|
|
36
|
+
description: record.description,
|
|
37
|
+
...(version ? { version } : {}),
|
|
38
|
+
...(record.updatedAt ? { updated_at: record.updatedAt } : {}),
|
|
39
|
+
},
|
|
40
|
+
loaded: true,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The version of a cached remote skill.
|
|
45
|
+
*
|
|
46
|
+
* A skill without a version cannot be compared - the cache keeps it.
|
|
47
|
+
*/
|
|
48
|
+
export function remoteVersion(skill) {
|
|
49
|
+
return skill?.frontmatter.version ?? skill?.metadata.version;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The safe reason of a failed call.
|
|
53
|
+
*
|
|
54
|
+
* The message never carries a credential: a token that a service echoed
|
|
55
|
+
* back is removed before the message leaves the process.
|
|
56
|
+
*/
|
|
57
|
+
export function describeRemoteFailure(error) {
|
|
58
|
+
const raw = error instanceof Error ? error.message : String(error ?? "");
|
|
59
|
+
const safe = raw
|
|
60
|
+
.replace(/bearer\s+\S+/gi, "bearer <redacted>")
|
|
61
|
+
.replace(/\b[A-Za-z0-9_-]{32,}\b/g, "<redacted>")
|
|
62
|
+
.replace(/\s+/g, " ")
|
|
63
|
+
.trim();
|
|
64
|
+
return safe.slice(0, 200) || "the service could not be reached";
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Whether the cached skill is older than the record.
|
|
68
|
+
*
|
|
69
|
+
* A record without a version never replaces a cached skill: an unknown
|
|
70
|
+
* version is not evidence of a change.
|
|
71
|
+
*/
|
|
72
|
+
export function isStale(cached, record) {
|
|
73
|
+
if (!cached)
|
|
74
|
+
return true;
|
|
75
|
+
if (!record.version)
|
|
76
|
+
return false;
|
|
77
|
+
return remoteVersion(cached) !== record.version;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=remote-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-source.js","sourceRoot":"","sources":["../src/remote-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAsEH;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,MAAmB;IAClD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC/B,OAAO;QACN,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,IAAI,EAAE,EAAE;QACR,WAAW,EAAE;YACZ,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/B;QACD,IAAI,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE;QAC1B,UAAU,EAAE,EAAE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C,OAAO,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vector schema of the skill collection.
|
|
3
|
+
*
|
|
4
|
+
* A Qdrant collection holds vectors of exactly ONE size. Two different
|
|
5
|
+
* embedding models produce two different vector sizes, so they must never
|
|
6
|
+
* write into the same collection: the second writer is rejected by the
|
|
7
|
+
* server with a dimension error, and the data of the first writer becomes
|
|
8
|
+
* unsearchable by the second.
|
|
9
|
+
*
|
|
10
|
+
* The collection name carries the model and a version, so a change of the
|
|
11
|
+
* model leads to a NEW collection instead of a silent mix of two vector
|
|
12
|
+
* spaces.
|
|
13
|
+
*
|
|
14
|
+
* The model itself lives in the Qdrant package (the embedder owns it). This
|
|
15
|
+
* module owns the collection - that is a decision of the skills domain, not
|
|
16
|
+
* of the vector store.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* The collection the runtime indexes into and searches.
|
|
20
|
+
*
|
|
21
|
+
* `QDRANT_COLLECTION` overrides it, so a cluster that already holds a
|
|
22
|
+
* collection under another name keeps working.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SKILL_COLLECTION = "pi-harness-skills-openai-v1";
|
|
25
|
+
/**
|
|
26
|
+
* The collection that was used before the schema was versioned.
|
|
27
|
+
*
|
|
28
|
+
* It holds 384-dimensional vectors - the model that
|
|
29
|
+
* `scripts/sync-to-qdrant.ts` used - and is NOT compatible with the
|
|
30
|
+
* runtime. It is named here so a mismatch can name the real cause instead
|
|
31
|
+
* of only the numbers.
|
|
32
|
+
*/
|
|
33
|
+
export declare const LEGACY_SKILL_COLLECTION = "pi-harness-skills";
|
|
34
|
+
/** The model of the legacy collection. */
|
|
35
|
+
export declare const LEGACY_SKILL_COLLECTION_MODEL = "sentence-transformers/all-MiniLM-L6-v2";
|
|
36
|
+
/** The vector size of the legacy collection. */
|
|
37
|
+
export declare const LEGACY_SKILL_COLLECTION_DIMENSIONS = 384;
|
|
38
|
+
/** The schema a skill collection is expected to have. */
|
|
39
|
+
export interface SkillVectorSchema {
|
|
40
|
+
/** The vector size. */
|
|
41
|
+
dimensions: number;
|
|
42
|
+
/** The distance metric. */
|
|
43
|
+
distance: string;
|
|
44
|
+
/** The embedding model, when it is known. */
|
|
45
|
+
model?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Why the collection does not match the expected schema - or null when it
|
|
49
|
+
* does.
|
|
50
|
+
*
|
|
51
|
+
* The message names the numbers, so the reader can tell WHICH schema the
|
|
52
|
+
* collection was built with.
|
|
53
|
+
*/
|
|
54
|
+
export declare function describeSkillSchemaMismatch(actual: {
|
|
55
|
+
dimensions?: number;
|
|
56
|
+
distance?: string;
|
|
57
|
+
}, expected: SkillVectorSchema): string | null;
|
|
58
|
+
//# sourceMappingURL=vector-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector-schema.d.ts","sourceRoot":"","sources":["../src/vector-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,gCAAgC,CAAC;AAE9D;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAE3D,0CAA0C;AAC1C,eAAO,MAAM,6BAA6B,2CAA2C,CAAC;AAEtF,gDAAgD;AAChD,eAAO,MAAM,kCAAkC,MAAM,CAAC;AAEtD,yDAAyD;AACzD,MAAM,WAAW,iBAAiB;IACjC,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAC1C,MAAM,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,EAClD,QAAQ,EAAE,iBAAiB,GACzB,MAAM,GAAG,IAAI,CASf"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The vector schema of the skill collection.
|
|
3
|
+
*
|
|
4
|
+
* A Qdrant collection holds vectors of exactly ONE size. Two different
|
|
5
|
+
* embedding models produce two different vector sizes, so they must never
|
|
6
|
+
* write into the same collection: the second writer is rejected by the
|
|
7
|
+
* server with a dimension error, and the data of the first writer becomes
|
|
8
|
+
* unsearchable by the second.
|
|
9
|
+
*
|
|
10
|
+
* The collection name carries the model and a version, so a change of the
|
|
11
|
+
* model leads to a NEW collection instead of a silent mix of two vector
|
|
12
|
+
* spaces.
|
|
13
|
+
*
|
|
14
|
+
* The model itself lives in the Qdrant package (the embedder owns it). This
|
|
15
|
+
* module owns the collection - that is a decision of the skills domain, not
|
|
16
|
+
* of the vector store.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* The collection the runtime indexes into and searches.
|
|
20
|
+
*
|
|
21
|
+
* `QDRANT_COLLECTION` overrides it, so a cluster that already holds a
|
|
22
|
+
* collection under another name keeps working.
|
|
23
|
+
*/
|
|
24
|
+
export const SKILL_COLLECTION = "pi-harness-skills-openai-v1";
|
|
25
|
+
/**
|
|
26
|
+
* The collection that was used before the schema was versioned.
|
|
27
|
+
*
|
|
28
|
+
* It holds 384-dimensional vectors - the model that
|
|
29
|
+
* `scripts/sync-to-qdrant.ts` used - and is NOT compatible with the
|
|
30
|
+
* runtime. It is named here so a mismatch can name the real cause instead
|
|
31
|
+
* of only the numbers.
|
|
32
|
+
*/
|
|
33
|
+
export const LEGACY_SKILL_COLLECTION = "pi-harness-skills";
|
|
34
|
+
/** The model of the legacy collection. */
|
|
35
|
+
export const LEGACY_SKILL_COLLECTION_MODEL = "sentence-transformers/all-MiniLM-L6-v2";
|
|
36
|
+
/** The vector size of the legacy collection. */
|
|
37
|
+
export const LEGACY_SKILL_COLLECTION_DIMENSIONS = 384;
|
|
38
|
+
/**
|
|
39
|
+
* Why the collection does not match the expected schema - or null when it
|
|
40
|
+
* does.
|
|
41
|
+
*
|
|
42
|
+
* The message names the numbers, so the reader can tell WHICH schema the
|
|
43
|
+
* collection was built with.
|
|
44
|
+
*/
|
|
45
|
+
export function describeSkillSchemaMismatch(actual, expected) {
|
|
46
|
+
if (actual.dimensions !== undefined && actual.dimensions !== expected.dimensions) {
|
|
47
|
+
const model = expected.model ? ` (${expected.model})` : "";
|
|
48
|
+
return `the collection holds ${actual.dimensions}-dimensional vectors, the runtime embeds with ${expected.dimensions}${model}`;
|
|
49
|
+
}
|
|
50
|
+
if (actual.distance !== undefined && actual.distance !== expected.distance) {
|
|
51
|
+
return `the collection uses the ${actual.distance} distance, the runtime expects ${expected.distance}`;
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=vector-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vector-schema.js","sourceRoot":"","sources":["../src/vector-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,6BAA6B,CAAC;AAE9D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAE3D,0CAA0C;AAC1C,MAAM,CAAC,MAAM,6BAA6B,GAAG,wCAAwC,CAAC;AAEtF,gDAAgD;AAChD,MAAM,CAAC,MAAM,kCAAkC,GAAG,GAAG,CAAC;AAYtD;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CAC1C,MAAkD,EAClD,QAA2B;IAE3B,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,IAAI,MAAM,CAAC,UAAU,KAAK,QAAQ,CAAC,UAAU,EAAE,CAAC;QAClF,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,OAAO,wBAAwB,MAAM,CAAC,UAAU,iDAAiD,QAAQ,CAAC,UAAU,GAAG,KAAK,EAAE,CAAC;IAChI,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAC5E,OAAO,2BAA2B,MAAM,CAAC,QAAQ,kCAAkC,QAAQ,CAAC,QAAQ,EAAE,CAAC;IACxG,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -13,6 +13,8 @@ export * from "./types.js";
|
|
|
13
13
|
export * from "./parser.js";
|
|
14
14
|
export * from "./scanner.js";
|
|
15
15
|
export * from "./loader.js";
|
|
16
|
+
export * from "./vector-schema.js";
|
|
17
|
+
export * from "./remote-source.js";
|
|
16
18
|
export * from "./skill-commands.js";
|
|
17
19
|
export * from "./skill-tool.js";
|
|
18
20
|
export * from "./skill-versioning.js";
|
|
@@ -22,6 +24,18 @@ import type { SkillsConfig, ScanResult, ScanOptions } from "./types.js";
|
|
|
22
24
|
import { scanForSkillsSync } from "./scanner.js";
|
|
23
25
|
import { getGlobalSkillRegistry, type SkillRegistry } from "./loader.js";
|
|
24
26
|
|
|
27
|
+
/**
|
|
28
|
+
* The result of the skill initialization.
|
|
29
|
+
*
|
|
30
|
+
* The registry is part of the result so a caller can ask the vector store
|
|
31
|
+
* about its state (how many skills it holds) without reaching for the
|
|
32
|
+
* global registry.
|
|
33
|
+
*/
|
|
34
|
+
export interface SkillsInitResult extends ScanResult {
|
|
35
|
+
/** The registry the skills were registered in. */
|
|
36
|
+
registry: SkillRegistry;
|
|
37
|
+
}
|
|
38
|
+
|
|
25
39
|
/**
|
|
26
40
|
* Initialize skills system
|
|
27
41
|
*
|
|
@@ -36,7 +50,7 @@ export function initSkills(
|
|
|
36
50
|
registry?: SkillRegistry;
|
|
37
51
|
}
|
|
38
52
|
>
|
|
39
|
-
):
|
|
53
|
+
): SkillsInitResult {
|
|
40
54
|
const registry = config?.registry ?? getGlobalSkillRegistry();
|
|
41
55
|
|
|
42
56
|
// Scan for skills
|
|
@@ -58,7 +72,7 @@ export function initSkills(
|
|
|
58
72
|
// Hint: if ~/.pi-harness-runtime/skills/ is empty, suggest the sync script
|
|
59
73
|
checkEmptySkillsDir();
|
|
60
74
|
|
|
61
|
-
return result;
|
|
75
|
+
return { ...result, registry };
|
|
62
76
|
}
|
|
63
77
|
|
|
64
78
|
/** Show sync hint if the harness skills dir is empty. */
|