cyber-agentkit 0.7.1 → 1.1.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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/dist/cli.js +680 -65
- package/dist/commands.d.ts +7 -1
- package/dist/commands.js +469 -48
- package/dist/index.d.ts +29 -16
- package/dist/index.js +33 -20
- package/dist/{reference-where-BhymfNgA.js → reference-where-C84J6MsR.js} +3839 -3649
- package/dist/{resolve-reference-Cis-Ye6T.d.ts → resolve-reference-D62VJZc0.d.ts} +17 -3
- package/package.json +91 -92
- package/plugin.json +3 -2
- package/readme.md +3 -3
- package/references/plugin-dependencies.md +1 -1
- package/skills/asset/README.md +14 -0
- package/skills/asset/SKILL.md +52 -0
- package/skills/asset/scripts/asset.mjs +199 -0
- package/skills/reference/README.md +3 -3
- package/skills/reference/SKILL.md +3 -3
- package/skills/reference/scripts/reference.mjs +56 -56
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
import { n as harnessIds, t as HarnessId } from "./harness-id-BgKL-x6C.js";
|
|
2
|
-
import { A as FoundSkill, C as defaultLayer, D as ReferenceCode, E as userReferencesDir, M as skillsIn, N as Platform, O as ReferenceWarning, S as SkillDefaults, T as referenceLayers, _ as ReferenceLayer, a as ReferenceTrace, b as ReferencePlugin, c as ReferenceTraceSection, d as referenceNames, f as resolveReference, g as SectionSource, h as MergeOperation, i as ReferenceStatus, j as skillName, k as ReferenceWarningCode, l as ResolveOptions, m as parseReferenceName, n as ExtendsStep, o as ReferenceTraceContribution, p as ReferenceName, r as OperationSource, s as ReferenceTraceLayer, t as AmbiguousCause, u as ResolvedReference, v as ReferenceLayerOptions, w as projectReferencesDir, x as ReferenceTier, y as ReferenceLayers } from "./resolve-reference-
|
|
2
|
+
import { A as FoundSkill, C as defaultLayer, D as ReferenceCode, E as userReferencesDir, M as skillsIn, N as Platform, O as ReferenceWarning, S as SkillDefaults, T as referenceLayers, _ as ReferenceLayer, a as ReferenceTrace, b as ReferencePlugin, c as ReferenceTraceSection, d as referenceNames, f as resolveReference, g as SectionSource, h as MergeOperation, i as ReferenceStatus, j as skillName, k as ReferenceWarningCode, l as ResolveOptions, m as parseReferenceName, n as ExtendsStep, o as ReferenceTraceContribution, p as ReferenceName, r as OperationSource, s as ReferenceTraceLayer, t as AmbiguousCause, u as ResolvedReference, v as ReferenceLayerOptions, w as projectReferencesDir, x as ReferenceTier, y as ReferenceLayers } from "./resolve-reference-D62VJZc0.js";
|
|
3
|
+
//#region src/references/load-reference.d.ts
|
|
4
|
+
/** `referenceLayers`' options, with the machine's own home directory, platform, and environment by default. */
|
|
5
|
+
type LoadReferenceOptions = Omit<ReferenceLayerOptions, 'home' | 'platform' | 'folder'> & {
|
|
6
|
+
home?: string | undefined;
|
|
7
|
+
platform?: Platform | undefined;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Resolves one reference for `root` the way `reference show` does, returning the full record: every
|
|
11
|
+
* field `show` prints with `--metadata` and `--trace`. A name that is not a reference name comes back
|
|
12
|
+
* `invalid`, and one no contribution answers `missing`; neither throws.
|
|
13
|
+
*/
|
|
14
|
+
export declare function loadReference(name: string, options: LoadReferenceOptions & {
|
|
15
|
+
folder?: ReferenceLayerOptions['folder'];
|
|
16
|
+
}): Promise<ResolvedReference>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/assets/load-asset.d.ts
|
|
19
|
+
/**
|
|
20
|
+
* Resolves one asset by name the way `asset load` does: the reference engine, reading `assets/` where
|
|
21
|
+
* it reads `references/`. A data file answers whole from the highest tier holding the name; the skill's
|
|
22
|
+
* own `assets/<name>.<ext>` (`defaultSkill`) is the lowest.
|
|
23
|
+
*/
|
|
24
|
+
export declare function loadAsset(name: string, options: LoadReferenceOptions): Promise<ResolvedReference>;
|
|
25
|
+
//#endregion
|
|
3
26
|
//#region src/harness/harness-environment.d.ts
|
|
4
27
|
/**
|
|
5
28
|
* The parts of the running process a harness query depends on. Every field defaults to the
|
|
@@ -38,7 +61,7 @@ interface PluginDependenciesRead {
|
|
|
38
61
|
readonly error?: string;
|
|
39
62
|
}
|
|
40
63
|
/**
|
|
41
|
-
* Read what the plugin at `pluginRoot` declares: `dependencies` under `extensions["
|
|
64
|
+
* Read what the plugin at `pluginRoot` declares: `dependencies` under `extensions["io.github.cyber-uni.plugin-manager"]`,
|
|
42
65
|
* else under `extensions["org.cyberuni.universal-plugin"]` in the root `plugin.json`, else `dependencies` in
|
|
43
66
|
* `.claude-plugin/plugin.json` (E-DEP-1, E-DEP-6, E-DEP-7).
|
|
44
67
|
*/
|
|
@@ -403,22 +426,10 @@ interface PluginStorage {
|
|
|
403
426
|
*/
|
|
404
427
|
export declare function pluginStorage(harness: HarnessId, environment?: HarnessEnvironment): PluginStorage;
|
|
405
428
|
//#endregion
|
|
406
|
-
//#region src/references/load-reference.d.ts
|
|
407
|
-
/** `referenceLayers`' options, with the machine's own home directory, platform, and environment by default. */
|
|
408
|
-
type LoadReferenceOptions = Omit<ReferenceLayerOptions, 'home' | 'platform'> & {
|
|
409
|
-
home?: string | undefined;
|
|
410
|
-
platform?: Platform | undefined;
|
|
411
|
-
};
|
|
412
|
-
/**
|
|
413
|
-
* Resolves one reference for `root` the way `reference show` does, returning the full record: every
|
|
414
|
-
* field `show` prints with `--metadata` and `--trace`. A name that is not a reference name comes back
|
|
415
|
-
* `invalid`, and one no contribution answers `missing`; neither throws.
|
|
416
|
-
*/
|
|
417
|
-
export declare function loadReference(name: string, options: LoadReferenceOptions): Promise<ResolvedReference>;
|
|
418
|
-
//#endregion
|
|
419
429
|
//#region src/references/reference-catalog.d.ts
|
|
420
430
|
/** One row per name. */
|
|
421
431
|
type ReferenceListRow = {
|
|
432
|
+
format?: string;
|
|
422
433
|
name: string;
|
|
423
434
|
description: string;
|
|
424
435
|
status: ReferenceStatus;
|
|
@@ -604,9 +615,11 @@ type WhereOptions = {
|
|
|
604
615
|
root: string;
|
|
605
616
|
/** How a path outside the project is shown, such as with the home directory collapsed to `~`. */
|
|
606
617
|
display?: ((path: string) => string) | undefined;
|
|
618
|
+
/** An assets call: the project write goes to `.agents/assets/`. */
|
|
619
|
+
assets?: boolean | undefined;
|
|
607
620
|
};
|
|
608
621
|
/** The project and user files a customization of `name` is written to, with the document below each. */
|
|
609
|
-
export declare function whereReference(input: string | ReferenceName, source: ReferenceLayers | readonly ReferenceLayer[], { root, display }: WhereOptions): ReferenceWhereReport;
|
|
622
|
+
export declare function whereReference(input: string | ReferenceName, source: ReferenceLayers | readonly ReferenceLayer[], { root, display, assets }: WhereOptions): ReferenceWhereReport;
|
|
610
623
|
//#endregion
|
|
611
624
|
//#region src/skills/harness-skill-folders.d.ts
|
|
612
625
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { join } from "node:path";
|
|
1
|
+
import { A as skillName, B as declaredDependencies, D as pluginStorage, E as enabledPlugins, F as pluginSkillFolders, H as isRecord, I as skillFoldersVerified, L as skillsDirectories, N as adminSkillFolders, O as managedPolicyLocations, P as harnessSkillFolders, R as pluginManifestName, S as referenceLayers, T as installedPlugins, U as readText, V as packageDir, W as stripJsonComments, b as defaultLayer, d as parseReferenceName, j as skillsIn, k as detectHarness, l as referenceNames, n as referenceImplementations, o as listReferences, r as checkReferences, s as searchReferences, t as whereReference, u as resolveReference, w as userReferencesDir, x as projectReferencesDir, z as pluginManifestPaths } from "./reference-where-C84J6MsR.js";
|
|
3
2
|
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
//#region src/references/load-reference.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolves one reference for `root` the way `reference show` does, returning the full record: every
|
|
7
|
+
* field `show` prints with `--metadata` and `--trace`. A name that is not a reference name comes back
|
|
8
|
+
* `invalid`, and one no contribution answers `missing`; neither throws.
|
|
9
|
+
*/
|
|
10
|
+
async function loadReference(name, options) {
|
|
11
|
+
const layers = await referenceLayers({
|
|
12
|
+
...options,
|
|
13
|
+
home: options.home ?? homedir(),
|
|
14
|
+
platform: options.platform ?? process.platform
|
|
15
|
+
});
|
|
16
|
+
return resolveReference(name, layers);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/assets/load-asset.ts
|
|
20
|
+
/**
|
|
21
|
+
* Resolves one asset by name the way `asset load` does: the reference engine, reading `assets/` where
|
|
22
|
+
* it reads `references/`. A data file answers whole from the highest tier holding the name; the skill's
|
|
23
|
+
* own `assets/<name>.<ext>` (`defaultSkill`) is the lowest.
|
|
24
|
+
*/
|
|
25
|
+
async function loadAsset(name, options) {
|
|
26
|
+
return loadReference(name, {
|
|
27
|
+
...options,
|
|
28
|
+
folder: "assets"
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
4
32
|
//#region src/plugins/plugin-dependencies.ts
|
|
5
33
|
/**
|
|
6
34
|
* Whether a harness lets a plugin declare other plugins it depends on. Only Claude Code does, via
|
|
@@ -39,9 +67,9 @@ function declaredPluginDependencies(manifest) {
|
|
|
39
67
|
}
|
|
40
68
|
const nonEmpty = (value) => typeof value === "string" && value !== "" ? value : void 0;
|
|
41
69
|
/** The extension namespaces a root `plugin.json` may author its dependency list under, newest first (E-DEP-6, E-DEP-7). */
|
|
42
|
-
const extensionNamespaces = ["
|
|
70
|
+
const extensionNamespaces = ["io.github.cyber-uni.plugin-manager", "org.cyberuni.universal-plugin"];
|
|
43
71
|
/**
|
|
44
|
-
* Read what the plugin at `pluginRoot` declares: `dependencies` under `extensions["
|
|
72
|
+
* Read what the plugin at `pluginRoot` declares: `dependencies` under `extensions["io.github.cyber-uni.plugin-manager"]`,
|
|
45
73
|
* else under `extensions["org.cyberuni.universal-plugin"]` in the root `plugin.json`, else `dependencies` in
|
|
46
74
|
* `.claude-plugin/plugin.json` (E-DEP-1, E-DEP-6, E-DEP-7).
|
|
47
75
|
*/
|
|
@@ -559,21 +587,6 @@ function headlessCommand(harness, options) {
|
|
|
559
587
|
};
|
|
560
588
|
}
|
|
561
589
|
//#endregion
|
|
562
|
-
//#region src/references/load-reference.ts
|
|
563
|
-
/**
|
|
564
|
-
* Resolves one reference for `root` the way `reference show` does, returning the full record: every
|
|
565
|
-
* field `show` prints with `--metadata` and `--trace`. A name that is not a reference name comes back
|
|
566
|
-
* `invalid`, and one no contribution answers `missing`; neither throws.
|
|
567
|
-
*/
|
|
568
|
-
async function loadReference(name, options) {
|
|
569
|
-
const layers = await referenceLayers({
|
|
570
|
-
...options,
|
|
571
|
-
home: options.home ?? homedir(),
|
|
572
|
-
platform: options.platform ?? process.platform
|
|
573
|
-
});
|
|
574
|
-
return resolveReference(name, layers);
|
|
575
|
-
}
|
|
576
|
-
//#endregion
|
|
577
590
|
//#region src/skills/skill-invocation.ts
|
|
578
591
|
/**
|
|
579
592
|
* How a user invokes a plugin's skill in a harness.
|
|
@@ -649,4 +662,4 @@ function skillInvocation(harness, { plugin, skill }) {
|
|
|
649
662
|
}
|
|
650
663
|
}
|
|
651
664
|
//#endregion
|
|
652
|
-
export { adminSkillFolders, checkPluginDependencies, checkReferences, declaredDependencies, declaredPluginDependencies, defaultLayer, detectHarness, enabledPlugins, harnessIds, harnessSkillFolders, headlessCommand, headlessInvocation, installedPlugins, listReferences, loadReference, managedPolicyLocations, packageDir, parseReferenceName, pluginManifestName, pluginManifestPaths, pluginSkillFolders, pluginStorage, projectReferencesDir, readPluginDependencies, referenceImplementations, referenceLayers, referenceNames, resolveReference, searchReferences, skillFoldersVerified, skillInvocation, skillName, skillsDirectories, skillsIn, supportsPluginDependencies, userReferencesDir, whereReference };
|
|
665
|
+
export { adminSkillFolders, checkPluginDependencies, checkReferences, declaredDependencies, declaredPluginDependencies, defaultLayer, detectHarness, enabledPlugins, harnessIds, harnessSkillFolders, headlessCommand, headlessInvocation, installedPlugins, listReferences, loadAsset, loadReference, managedPolicyLocations, packageDir, parseReferenceName, pluginManifestName, pluginManifestPaths, pluginSkillFolders, pluginStorage, projectReferencesDir, readPluginDependencies, referenceImplementations, referenceLayers, referenceNames, resolveReference, searchReferences, skillFoldersVerified, skillInvocation, skillName, skillsDirectories, skillsIn, supportsPluginDependencies, userReferencesDir, whereReference };
|