agent-plugkit 0.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/LICENSE +21 -0
- package/README.md +295 -0
- package/dist/adapters/agent-plugins.d.ts +35 -0
- package/dist/adapters/agent-plugins.js +57 -0
- package/dist/adapters/agent-plugins.js.map +1 -0
- package/dist/adapters/claude.d.ts +64 -0
- package/dist/adapters/claude.js +123 -0
- package/dist/adapters/claude.js.map +1 -0
- package/dist/adapters/cli-validation.d.ts +12 -0
- package/dist/adapters/cli-validation.js +31 -0
- package/dist/adapters/cli-validation.js.map +1 -0
- package/dist/adapters/codex.d.ts +62 -0
- package/dist/adapters/codex.js +91 -0
- package/dist/adapters/codex.js.map +1 -0
- package/dist/adapters/marketplace-registration.d.ts +17 -0
- package/dist/adapters/marketplace-registration.js +369 -0
- package/dist/adapters/marketplace-registration.js.map +1 -0
- package/dist/adapters/marketplace.d.ts +11 -0
- package/dist/adapters/marketplace.js +96 -0
- package/dist/adapters/marketplace.js.map +1 -0
- package/dist/adapters/mcp.d.ts +17 -0
- package/dist/adapters/mcp.js +28 -0
- package/dist/adapters/mcp.js.map +1 -0
- package/dist/application/artifact-generation.d.ts +58 -0
- package/dist/application/artifact-generation.js +344 -0
- package/dist/application/artifact-generation.js.map +1 -0
- package/dist/application/local-release.d.ts +122 -0
- package/dist/application/local-release.js +940 -0
- package/dist/application/local-release.js.map +1 -0
- package/dist/application/marketplace-document-contract.d.ts +81 -0
- package/dist/application/marketplace-document-contract.js +2 -0
- package/dist/application/marketplace-document-contract.js.map +1 -0
- package/dist/application/marketplace-document.d.ts +45 -0
- package/dist/application/marketplace-document.js +557 -0
- package/dist/application/marketplace-document.js.map +1 -0
- package/dist/application/marketplace-registration-contract.d.ts +51 -0
- package/dist/application/marketplace-registration-contract.js +11 -0
- package/dist/application/marketplace-registration-contract.js.map +1 -0
- package/dist/application/marketplace-registration.d.ts +20 -0
- package/dist/application/marketplace-registration.js +304 -0
- package/dist/application/marketplace-registration.js.map +1 -0
- package/dist/application/marketplace.d.ts +9 -0
- package/dist/application/marketplace.js +32 -0
- package/dist/application/marketplace.js.map +1 -0
- package/dist/application/plugin-components-contract.d.ts +135 -0
- package/dist/application/plugin-components-contract.js +2 -0
- package/dist/application/plugin-components-contract.js.map +1 -0
- package/dist/application/plugin-components.d.ts +17 -0
- package/dist/application/plugin-components.js +1000 -0
- package/dist/application/plugin-components.js.map +1 -0
- package/dist/application/plugin-document-contract.d.ts +115 -0
- package/dist/application/plugin-document-contract.js +2 -0
- package/dist/application/plugin-document-contract.js.map +1 -0
- package/dist/application/plugin-document.d.ts +69 -0
- package/dist/application/plugin-document.js +1037 -0
- package/dist/application/plugin-document.js.map +1 -0
- package/dist/application/plugin-lifecycle-contract.d.ts +230 -0
- package/dist/application/plugin-lifecycle-contract.js +3 -0
- package/dist/application/plugin-lifecycle-contract.js.map +1 -0
- package/dist/application/plugin-lifecycle.d.ts +8 -0
- package/dist/application/plugin-lifecycle.js +1375 -0
- package/dist/application/plugin-lifecycle.js.map +1 -0
- package/dist/application/plugin-scaffold.d.ts +18 -0
- package/dist/application/plugin-scaffold.js +188 -0
- package/dist/application/plugin-scaffold.js.map +1 -0
- package/dist/application/plugin-source.d.ts +39 -0
- package/dist/application/plugin-source.js +59 -0
- package/dist/application/plugin-source.js.map +1 -0
- package/dist/application/skill-document-contract.d.ts +92 -0
- package/dist/application/skill-document-contract.js +8 -0
- package/dist/application/skill-document-contract.js.map +1 -0
- package/dist/application/skill-document-guided.d.ts +3 -0
- package/dist/application/skill-document-guided.js +53 -0
- package/dist/application/skill-document-guided.js.map +1 -0
- package/dist/application/skill-document.d.ts +19 -0
- package/dist/application/skill-document.js +368 -0
- package/dist/application/skill-document.js.map +1 -0
- package/dist/application/workspace-create-contract.d.ts +50 -0
- package/dist/application/workspace-create-contract.js +16 -0
- package/dist/application/workspace-create-contract.js.map +1 -0
- package/dist/application/workspace-create.d.ts +8 -0
- package/dist/application/workspace-create.js +656 -0
- package/dist/application/workspace-create.js.map +1 -0
- package/dist/application/workspace-health-contract.d.ts +133 -0
- package/dist/application/workspace-health-contract.js +272 -0
- package/dist/application/workspace-health-contract.js.map +1 -0
- package/dist/application/workspace-health.d.ts +10 -0
- package/dist/application/workspace-health.js +1114 -0
- package/dist/application/workspace-health.js.map +1 -0
- package/dist/application/workspace-operation-contract.d.ts +99 -0
- package/dist/application/workspace-operation-contract.js +450 -0
- package/dist/application/workspace-operation-contract.js.map +1 -0
- package/dist/application/workspace-operation.d.ts +42 -0
- package/dist/application/workspace-operation.js +517 -0
- package/dist/application/workspace-operation.js.map +1 -0
- package/dist/cli.d.ts +16 -0
- package/dist/cli.js +136 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add.d.ts +8 -0
- package/dist/commands/add.js +77 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/build.d.ts +7 -0
- package/dist/commands/build.js +29 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/component-scaffold.d.ts +4 -0
- package/dist/commands/component-scaffold.js +14 -0
- package/dist/commands/component-scaffold.js.map +1 -0
- package/dist/commands/import-skill.d.ts +15 -0
- package/dist/commands/import-skill.js +41 -0
- package/dist/commands/import-skill.js.map +1 -0
- package/dist/commands/index-gen.d.ts +12 -0
- package/dist/commands/index-gen.js +33 -0
- package/dist/commands/index-gen.js.map +1 -0
- package/dist/commands/init-repo.d.ts +8 -0
- package/dist/commands/init-repo.js +53 -0
- package/dist/commands/init-repo.js.map +1 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.js +33 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/install-repo.d.ts +20 -0
- package/dist/commands/install-repo.js +200 -0
- package/dist/commands/install-repo.js.map +1 -0
- package/dist/commands/release-local.d.ts +9 -0
- package/dist/commands/release-local.js +27 -0
- package/dist/commands/release-local.js.map +1 -0
- package/dist/commands/validate.d.ts +8 -0
- package/dist/commands/validate.js +45 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/core/errors.d.ts +5 -0
- package/dist/core/errors.js +12 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/generated/skill-content.d.ts +3 -0
- package/dist/generated/skill-content.js +9 -0
- package/dist/generated/skill-content.js.map +1 -0
- package/dist/infrastructure/authorized-path.d.ts +20 -0
- package/dist/infrastructure/authorized-path.js +85 -0
- package/dist/infrastructure/authorized-path.js.map +1 -0
- package/dist/infrastructure/document-commit.d.ts +165 -0
- package/dist/infrastructure/document-commit.js +1352 -0
- package/dist/infrastructure/document-commit.js.map +1 -0
- package/dist/infrastructure/process-runner.d.ts +29 -0
- package/dist/infrastructure/process-runner.js +130 -0
- package/dist/infrastructure/process-runner.js.map +1 -0
- package/dist/infrastructure/vscode-user-settings.d.ts +42 -0
- package/dist/infrastructure/vscode-user-settings.js +509 -0
- package/dist/infrastructure/vscode-user-settings.js.map +1 -0
- package/dist/schema/plugin-yaml.d.ts +89 -0
- package/dist/schema/plugin-yaml.js +241 -0
- package/dist/schema/plugin-yaml.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +30 -0
- package/dist/utils/frontmatter.js +60 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/helpers.d.ts +44 -0
- package/dist/utils/helpers.js +94 -0
- package/dist/utils/helpers.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These names are reserved transaction traces inside an authorized workspace.
|
|
3
|
+
* They are not product state. A valid lock records the only staging token that
|
|
4
|
+
* may be reclaimed after its owner has exited.
|
|
5
|
+
*/
|
|
6
|
+
export declare const WORKSPACE_WRITE_LOCK = ".agent-plugkit-write.lock";
|
|
7
|
+
export declare const DOCUMENT_STAGING_PREFIX = ".agent-plugkit-document-";
|
|
8
|
+
export interface AtomicDocumentCommitRequest {
|
|
9
|
+
readonly directory: string;
|
|
10
|
+
readonly relativePath: string;
|
|
11
|
+
readonly expectedRevision: string;
|
|
12
|
+
readonly nextBytes: Uint8Array;
|
|
13
|
+
}
|
|
14
|
+
export interface AtomicDocumentCreateFile {
|
|
15
|
+
readonly relativePath: string;
|
|
16
|
+
readonly bytes: Uint8Array;
|
|
17
|
+
readonly mode: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A component declaration can require a new canonical scaffold (currently a
|
|
21
|
+
* Skill document or Hook script). The document and those exclusive-create
|
|
22
|
+
* files share the same workspace lock and staging root. Existing user files
|
|
23
|
+
* are never replaced by this operation.
|
|
24
|
+
*/
|
|
25
|
+
export interface AtomicDocumentAndFilesCommitRequest extends AtomicDocumentCommitRequest {
|
|
26
|
+
readonly createFiles: readonly AtomicDocumentCreateFile[];
|
|
27
|
+
}
|
|
28
|
+
export interface AtomicDocumentAndFilesCommitDependencies extends AtomicDocumentCommitDependencies {
|
|
29
|
+
readonly beforeCreateFile?: (stagedPath: string, targetPath: string) => void;
|
|
30
|
+
readonly createFile?: (stagedPath: string, targetPath: string) => void;
|
|
31
|
+
readonly rollbackFile?: (targetPath: string) => void;
|
|
32
|
+
readonly rollbackDocument?: (backupPath: string, targetPath: string) => void;
|
|
33
|
+
}
|
|
34
|
+
export interface AtomicDocumentAndFilesTransactionFacts {
|
|
35
|
+
readonly canonical: "unchanged" | "committed" | "restored" | "uncertain";
|
|
36
|
+
readonly scaffolds: "none" | "committed" | "rolled-back" | "residual";
|
|
37
|
+
readonly cleanupComplete: boolean;
|
|
38
|
+
}
|
|
39
|
+
export type AtomicDocumentAndFilesCommitResult = AtomicDocumentCommitResult & {
|
|
40
|
+
readonly transaction: AtomicDocumentAndFilesTransactionFacts;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* `diskChanged` reports a canonical document replacement or transaction
|
|
44
|
+
* residue left by this call. Successfully reclaimed prior transaction traces
|
|
45
|
+
* and transient no-clobber links do not turn it on.
|
|
46
|
+
*/
|
|
47
|
+
export type AtomicDocumentCommitResult = {
|
|
48
|
+
readonly status: 'committed';
|
|
49
|
+
readonly revision: string;
|
|
50
|
+
readonly diskChanged: true;
|
|
51
|
+
readonly changedPaths: readonly string[];
|
|
52
|
+
readonly cleanupComplete: true;
|
|
53
|
+
} | {
|
|
54
|
+
readonly status: 'verified';
|
|
55
|
+
readonly revision: string;
|
|
56
|
+
readonly diskChanged: false;
|
|
57
|
+
readonly changedPaths: readonly [];
|
|
58
|
+
readonly cleanupComplete: true;
|
|
59
|
+
} | {
|
|
60
|
+
readonly status: 'conflict';
|
|
61
|
+
readonly currentRevision: string;
|
|
62
|
+
readonly diskChanged: false;
|
|
63
|
+
readonly changedPaths: readonly [];
|
|
64
|
+
readonly cleanupComplete: true;
|
|
65
|
+
} | {
|
|
66
|
+
readonly status: 'busy';
|
|
67
|
+
readonly message: string;
|
|
68
|
+
readonly diskChanged: false;
|
|
69
|
+
readonly changedPaths: readonly [];
|
|
70
|
+
readonly cleanupComplete: true;
|
|
71
|
+
} | {
|
|
72
|
+
readonly status: 'failed';
|
|
73
|
+
readonly message: string;
|
|
74
|
+
readonly diskChanged: boolean;
|
|
75
|
+
readonly changedPaths: readonly string[];
|
|
76
|
+
readonly cleanupComplete: boolean;
|
|
77
|
+
};
|
|
78
|
+
export interface AtomicDocumentCommitDependencies {
|
|
79
|
+
readonly createToken?: () => string;
|
|
80
|
+
readonly now?: () => Date;
|
|
81
|
+
readonly isProcessAlive?: (processId: number) => boolean;
|
|
82
|
+
readonly afterReclaimLink?: (lockPath: string, quarantinePath: string) => void;
|
|
83
|
+
readonly beforeLockSync?: (lockPath: string) => void;
|
|
84
|
+
readonly afterLock?: () => void;
|
|
85
|
+
readonly beforeStageWrite?: (stagedPath: string) => void;
|
|
86
|
+
readonly syncStagedFile?: (stagedPath: string) => void;
|
|
87
|
+
readonly afterStageWrite?: (stagedPath: string) => void;
|
|
88
|
+
readonly beforeRevisionRecheck?: (targetPath: string) => void;
|
|
89
|
+
readonly replaceDocument?: (stagedPath: string, targetPath: string) => void;
|
|
90
|
+
readonly syncParentDirectory?: (directory: string) => void;
|
|
91
|
+
readonly afterReplace?: (targetPath: string) => void;
|
|
92
|
+
readonly cleanupStaging?: (stagingRoot: string) => void;
|
|
93
|
+
readonly cleanupLock?: (lockPath: string, token: string) => void;
|
|
94
|
+
}
|
|
95
|
+
export type AtomicArtifactMutation = {
|
|
96
|
+
readonly relativePath: string;
|
|
97
|
+
readonly action: "write";
|
|
98
|
+
readonly bytes: Uint8Array;
|
|
99
|
+
readonly mode?: number;
|
|
100
|
+
} | {
|
|
101
|
+
readonly relativePath: string;
|
|
102
|
+
readonly action: "delete";
|
|
103
|
+
};
|
|
104
|
+
export interface AtomicArtifactExpectation {
|
|
105
|
+
readonly relativePath: string;
|
|
106
|
+
readonly revision: string | "missing";
|
|
107
|
+
}
|
|
108
|
+
export interface AtomicArtifactGroupCommitRequest {
|
|
109
|
+
readonly directory: string;
|
|
110
|
+
readonly expectations: readonly AtomicArtifactExpectation[];
|
|
111
|
+
readonly mutations: readonly AtomicArtifactMutation[];
|
|
112
|
+
}
|
|
113
|
+
export interface AtomicArtifactGroupCommitDependencies extends Pick<AtomicDocumentCommitDependencies, "createToken" | "now" | "isProcessAlive" | "beforeLockSync" | "afterReclaimLink"> {
|
|
114
|
+
readonly beforeMutation?: (relativePath: string) => void;
|
|
115
|
+
readonly replaceArtifact?: (stagedPath: string, targetPath: string) => void;
|
|
116
|
+
readonly beforeRollback?: (relativePath: string) => void;
|
|
117
|
+
readonly removeCreatedDirectory?: (path: string, relativePath: string) => void;
|
|
118
|
+
readonly cleanupStaging?: (stagingRoot: string) => void;
|
|
119
|
+
readonly cleanupLock?: (lockPath: string, token: string) => void;
|
|
120
|
+
}
|
|
121
|
+
export type AtomicArtifactGroupCommitResult = {
|
|
122
|
+
readonly status: "committed" | "verified";
|
|
123
|
+
readonly changedPaths: readonly string[];
|
|
124
|
+
readonly diskChanged: boolean;
|
|
125
|
+
readonly rolledBack: false;
|
|
126
|
+
readonly cleanupComplete: true;
|
|
127
|
+
} | {
|
|
128
|
+
readonly status: "conflict" | "busy";
|
|
129
|
+
readonly message: string;
|
|
130
|
+
readonly changedPaths: readonly [];
|
|
131
|
+
readonly diskChanged: false;
|
|
132
|
+
readonly rolledBack: false;
|
|
133
|
+
readonly cleanupComplete: true;
|
|
134
|
+
} | {
|
|
135
|
+
readonly status: "failed";
|
|
136
|
+
readonly message: string;
|
|
137
|
+
readonly changedPaths: readonly string[];
|
|
138
|
+
readonly diskChanged: boolean;
|
|
139
|
+
readonly rolledBack: boolean;
|
|
140
|
+
readonly cleanupComplete: boolean;
|
|
141
|
+
};
|
|
142
|
+
export declare function documentRevision(bytes: Uint8Array): string;
|
|
143
|
+
/**
|
|
144
|
+
* Commits one already-authorized document with a workspace-wide exclusive
|
|
145
|
+
* lock. Domain ownership and patching stay with the caller. Atomicity means
|
|
146
|
+
* readers see either the old or new target after rename; durability is only
|
|
147
|
+
* reported as committed after both the staged file and its parent directory
|
|
148
|
+
* have been fsynced.
|
|
149
|
+
*/
|
|
150
|
+
export declare function commitAuthorizedDocument(request: AtomicDocumentCommitRequest, dependencies?: AtomicDocumentCommitDependencies): AtomicDocumentCommitResult;
|
|
151
|
+
/**
|
|
152
|
+
* Commits a canonical document plus exclusive-create scaffold files under one
|
|
153
|
+
* existing workspace-wide lock. It deliberately does not support update or
|
|
154
|
+
* deletion of auxiliary files: those objects remain user-owned unless a
|
|
155
|
+
* separate, explicit object-level Trash action is confirmed.
|
|
156
|
+
*/
|
|
157
|
+
export declare function commitAuthorizedDocumentAndFiles(request: AtomicDocumentAndFilesCommitRequest, dependencies?: AtomicDocumentAndFilesCommitDependencies): AtomicDocumentAndFilesCommitResult;
|
|
158
|
+
/**
|
|
159
|
+
* Commits one generated-artifact consistency group under the same
|
|
160
|
+
* workspace-wide lock used by canonical document writes. All bytes and
|
|
161
|
+
* deletions are staged before the first canonical mutation. A failure rolls
|
|
162
|
+
* already-applied members back from private backups; callers must treat any
|
|
163
|
+
* cleanup uncertainty as failure rather than declaring the group successful.
|
|
164
|
+
*/
|
|
165
|
+
export declare function commitAuthorizedArtifactGroup(request: AtomicArtifactGroupCommitRequest, dependencies?: AtomicArtifactGroupCommitDependencies): AtomicArtifactGroupCommitResult;
|