@kanonak-protocol/cli 1.4.0 → 1.6.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/agents/AgentDeploymentHandler.d.ts +19 -0
- package/dist/agents/AgentLock.d.ts +15 -0
- package/dist/agents/AgentPaths.d.ts +23 -0
- package/dist/capabilities/DeploymentHandlerRegistry.d.ts +14 -3
- package/dist/index.js +114 -47
- package/dist/skills/SkillDeploymentHandler.d.ts +8 -6
- package/dist/skills/SkillPaths.d.ts +23 -10
- package/dist/transformations/CompiledTransformation.d.ts +146 -0
- package/dist/transformations/DocAst.d.ts +84 -0
- package/dist/transformations/ExpressionEngine.d.ts +28 -0
- package/dist/transformations/ReferenceResolver.d.ts +20 -0
- package/dist/transformations/TransformationLoader.d.ts +20 -0
- package/dist/transformations/TransformationRunner.d.ts +57 -0
- package/dist/transformations/UriConstants.d.ts +145 -0
- package/dist/transformations/backends/HtmlBackend.d.ts +7 -0
- package/dist/transformations/backends/IDocumentAstBackend.d.ts +16 -0
- package/dist/transformations/backends/JsonBackend.d.ts +12 -0
- package/dist/transformations/backends/MarkdownFrontmatterBackend.d.ts +7 -0
- package/dist/transformations/backends/SimpleMarkdownRenderer.d.ts +17 -0
- package/dist/transformations/backends/SvgBackend.d.ts +7 -0
- package/dist/transformations/backends/TomlBackend.d.ts +7 -0
- package/package.json +6 -4
- package/dist/skills/SkillTransformer.d.ts +0 -19
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DeploymentContext, DeploymentHandler, DeployedInstance, OperationContext } from '../capabilities/DeploymentHandlerRegistry.js';
|
|
2
|
+
/**
|
|
3
|
+
* Deployment handler for the `AgentInstanceDeployment` DeploymentTarget.
|
|
4
|
+
*
|
|
5
|
+
* Transforms `kanonak.org/agents/Agent` instances into the target
|
|
6
|
+
* client's on-disk file format (markdown-with-frontmatter for
|
|
7
|
+
* Claude Code and Gemini CLI, TOML for Codex) and writes each one
|
|
8
|
+
* into the directory declared by the named Client instance selected
|
|
9
|
+
* via the `--client` option (defaulting to the "agents"
|
|
10
|
+
* cross-client layout).
|
|
11
|
+
*/
|
|
12
|
+
export declare class AgentDeploymentHandler implements DeploymentHandler {
|
|
13
|
+
private readonly parser;
|
|
14
|
+
private readonly objectParser;
|
|
15
|
+
private readonly runner;
|
|
16
|
+
deploy(context: DeploymentContext): Promise<void>;
|
|
17
|
+
undeploy(name: string, context: OperationContext): Promise<void>;
|
|
18
|
+
list(context: OperationContext): Promise<DeployedInstance[]>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface AgentLockEntry {
|
|
2
|
+
publisher: string;
|
|
3
|
+
package_: string;
|
|
4
|
+
version: string;
|
|
5
|
+
resolved: string;
|
|
6
|
+
integrity: string;
|
|
7
|
+
fileName: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AgentLockFile {
|
|
10
|
+
version: string;
|
|
11
|
+
lastUpdated: string;
|
|
12
|
+
agents: Record<string, AgentLockEntry>;
|
|
13
|
+
}
|
|
14
|
+
export declare function loadAgentLock(agentsDir: string): AgentLockFile;
|
|
15
|
+
export declare function saveAgentLock(agentsDir: string, lock: AgentLockFile): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IKanonakDocumentRepository } from '@kanonak-protocol/sdk';
|
|
2
|
+
export type AgentFileFormat = 'markdown-frontmatter' | 'toml';
|
|
3
|
+
export interface AgentPathOptions {
|
|
4
|
+
client?: string;
|
|
5
|
+
scope?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ResolvedAgentDeployment {
|
|
8
|
+
agentsDir: string;
|
|
9
|
+
format: AgentFileFormat;
|
|
10
|
+
fileExtension: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function detectClient(): string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Resolve the agent deployment settings for the requested client
|
|
15
|
+
* and scope: the target directory plus the on-disk format to write.
|
|
16
|
+
*
|
|
17
|
+
* Goes through the SDK object model: agent-skills is parsed, Client
|
|
18
|
+
* instances are looked up by clientId, the selected Client's
|
|
19
|
+
* projectAgentDir / userAgentDir and agentFileFormat are read, and
|
|
20
|
+
* the AgentFileFormat reference is followed to extract the local
|
|
21
|
+
* name (markdown-frontmatter / toml).
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveAgentDeployment(options: AgentPathOptions, repository: IKanonakDocumentRepository): Promise<ResolvedAgentDeployment>;
|
|
@@ -20,7 +20,8 @@ export interface DeployedInstance {
|
|
|
20
20
|
*
|
|
21
21
|
* `repository` is the broader repository (local cache + HTTP) that the
|
|
22
22
|
* handler can use to fetch entities from other packages when needed
|
|
23
|
-
* (e.g. a `Tool` instance defined in
|
|
23
|
+
* (e.g. a `Tool` instance or `Client` instance defined in
|
|
24
|
+
* `agent-skills`).
|
|
24
25
|
*/
|
|
25
26
|
export interface DeploymentContext {
|
|
26
27
|
instances: SubjectKanonak[];
|
|
@@ -28,6 +29,16 @@ export interface DeploymentContext {
|
|
|
28
29
|
repository: IKanonakDocumentRepository;
|
|
29
30
|
options: Record<string, string>;
|
|
30
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Context passed to a deployment handler for lifecycle operations
|
|
34
|
+
* that are NOT about deploying a fresh instance (undeploy, list).
|
|
35
|
+
* Carries the broader repository so handlers can still resolve
|
|
36
|
+
* ontology entities like `Client` for per-product skill paths.
|
|
37
|
+
*/
|
|
38
|
+
export interface OperationContext {
|
|
39
|
+
repository: IKanonakDocumentRepository;
|
|
40
|
+
options: Record<string, string>;
|
|
41
|
+
}
|
|
31
42
|
/**
|
|
32
43
|
* Handler that deploys/undeploys instances of a managed type to the
|
|
33
44
|
* local system.
|
|
@@ -39,8 +50,8 @@ export interface DeploymentContext {
|
|
|
39
50
|
*/
|
|
40
51
|
export interface DeploymentHandler {
|
|
41
52
|
deploy(context: DeploymentContext): Promise<void>;
|
|
42
|
-
undeploy(name: string,
|
|
43
|
-
list(
|
|
53
|
+
undeploy(name: string, context: OperationContext): Promise<void>;
|
|
54
|
+
list(context: OperationContext): Promise<DeployedInstance[]>;
|
|
44
55
|
}
|
|
45
56
|
/**
|
|
46
57
|
* Registry that maps a DeploymentTarget URI key to its handler.
|