joycraft 0.7.13 → 0.7.15
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/README.md +25 -11
- package/dist/chunk-7BPB2IKY.js +255 -0
- package/dist/chunk-7BPB2IKY.js.map +1 -0
- package/dist/chunk-B73DPYYC.js +377 -0
- package/dist/chunk-B73DPYYC.js.map +1 -0
- package/dist/{chunk-EFHJI5KD.js → chunk-JYPBXPGD.js} +114 -112
- package/dist/chunk-JYPBXPGD.js.map +1 -0
- package/dist/{chunk-LKWD25KJ.js → chunk-KKDKC4FM.js} +8 -71
- package/dist/chunk-KKDKC4FM.js.map +1 -0
- package/dist/chunk-OMFGDJW4.js +97 -0
- package/dist/chunk-OMFGDJW4.js.map +1 -0
- package/dist/chunk-PR4QDKPL.js +3755 -0
- package/dist/chunk-PR4QDKPL.js.map +1 -0
- package/dist/chunk-Z5JFEGWG.js +563 -0
- package/dist/chunk-Z5JFEGWG.js.map +1 -0
- package/dist/cli.js +387 -54
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +235 -1
- package/dist/index.js +691 -1
- package/dist/index.js.map +1 -1
- package/dist/init-S5JU5BHL.js +60 -0
- package/dist/init-S5JU5BHL.js.map +1 -0
- package/dist/{init-autofix-E7DSPUSC.js → init-autofix-WSKUT2HN.js} +4 -3
- package/dist/{init-autofix-E7DSPUSC.js.map → init-autofix-WSKUT2HN.js.map} +1 -1
- package/dist/install-manifest-EQHT4474.js +37 -0
- package/dist/joycraft-release.json +8 -0
- package/dist/release-artifact-4TL5L2ZY.js +14 -0
- package/dist/release-artifact-4TL5L2ZY.js.map +1 -0
- package/dist/release-resolver-P2H46QTU.js +293 -0
- package/dist/release-resolver-P2H46QTU.js.map +1 -0
- package/dist/update-HNTXCEKB.js +19 -0
- package/dist/update-HNTXCEKB.js.map +1 -0
- package/dist/update-check-YT765NE7.js +36 -0
- package/dist/update-check-YT765NE7.js.map +1 -0
- package/dist/upgrade-LZOND7OZ.js +28 -0
- package/dist/upgrade-LZOND7OZ.js.map +1 -0
- package/package.json +5 -2
- package/dist/chunk-EFHJI5KD.js.map +0 -1
- package/dist/chunk-J6GDQ55S.js +0 -91
- package/dist/chunk-J6GDQ55S.js.map +0 -1
- package/dist/chunk-LKWD25KJ.js.map +0 -1
- package/dist/chunk-Q2ZQ6RGD.js +0 -243
- package/dist/chunk-Q2ZQ6RGD.js.map +0 -1
- package/dist/init-YSFURLGT.js +0 -1330
- package/dist/init-YSFURLGT.js.map +0 -1
- package/dist/upgrade-PELFI26D.js +0 -650
- package/dist/upgrade-PELFI26D.js.map +0 -1
- package/dist/version-J7MOKNJR.js +0 -28
- /package/dist/{version-J7MOKNJR.js.map → install-manifest-EQHT4474.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -18,4 +18,238 @@ interface StackInfo {
|
|
|
18
18
|
}
|
|
19
19
|
declare function detectStack(dir: string): Promise<StackInfo>;
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
declare const CHECK_CACHE_PATH = "docs/.joycraft/local/check-cache.json";
|
|
22
|
+
declare const CHECK_SETTINGS_PATH = "docs/.joycraft/local/settings.json";
|
|
23
|
+
declare const CHECK_LOCK_PATH = "docs/.joycraft/local/check.lock";
|
|
24
|
+
declare const CHECK_CACHE_TTL_MS: number;
|
|
25
|
+
declare const CHECK_DEFAULT_DEADLINE_MS = 3000;
|
|
26
|
+
declare const CHECK_LOCK_TTL_MS = 10000;
|
|
27
|
+
type CheckPolicy = 'notify' | 'auto-safe' | 'off';
|
|
28
|
+
type CheckStatus = 'available' | 'current' | 'postponed' | 'pending-conflicts' | 'unknown';
|
|
29
|
+
interface CheckMetadata {
|
|
30
|
+
version: string;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
interface InstallationCheckState {
|
|
34
|
+
schemaVersion: 1;
|
|
35
|
+
fetchedAt: number;
|
|
36
|
+
version: string;
|
|
37
|
+
failureCount?: number;
|
|
38
|
+
nextRetryAt?: number;
|
|
39
|
+
lastFailureAt?: number;
|
|
40
|
+
lastError?: string;
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
}
|
|
43
|
+
interface CheckResult {
|
|
44
|
+
status: CheckStatus;
|
|
45
|
+
installedVersion?: string;
|
|
46
|
+
availableVersion?: string;
|
|
47
|
+
policy: CheckPolicy;
|
|
48
|
+
display: boolean;
|
|
49
|
+
explicit: boolean;
|
|
50
|
+
fromCache: boolean;
|
|
51
|
+
diagnostics: string[];
|
|
52
|
+
conflicts: string[];
|
|
53
|
+
/** An agent may attempt this only at a workflow boundary; the candidate still enforces every safety gate. */
|
|
54
|
+
automaticUpdate?: {
|
|
55
|
+
verificationRequired: true;
|
|
56
|
+
command: string[];
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
interface UpdateCheckOptions {
|
|
60
|
+
now?: number | (() => number);
|
|
61
|
+
sessionId?: string;
|
|
62
|
+
explicit?: boolean;
|
|
63
|
+
deadlineMs?: number;
|
|
64
|
+
fetchLatest?: (signal: AbortSignal) => Promise<unknown>;
|
|
65
|
+
installedVersion?: string;
|
|
66
|
+
}
|
|
67
|
+
/** Resolve the stable identity used to suppress duplicate notices in one session. */
|
|
68
|
+
declare function resolveCheckSessionId(explicit?: string): string;
|
|
69
|
+
interface ResolveStatusInput {
|
|
70
|
+
installedVersion?: string;
|
|
71
|
+
availableVersion?: string;
|
|
72
|
+
policy?: CheckPolicy;
|
|
73
|
+
explicit?: boolean;
|
|
74
|
+
pendingConflicts?: boolean;
|
|
75
|
+
postponedRelease?: string;
|
|
76
|
+
acknowledgedRelease?: string;
|
|
77
|
+
acknowledgedSession?: string;
|
|
78
|
+
sessionId?: string;
|
|
79
|
+
fromCache?: boolean;
|
|
80
|
+
diagnostics?: string[];
|
|
81
|
+
}
|
|
82
|
+
interface ResolvedStatus {
|
|
83
|
+
status: CheckStatus;
|
|
84
|
+
display: boolean;
|
|
85
|
+
diagnostics: string[];
|
|
86
|
+
autoSafeCandidate?: boolean;
|
|
87
|
+
}
|
|
88
|
+
/** Compare stable numeric versions. A null result means at least one input is prerelease/malformed. */
|
|
89
|
+
declare function compareStableVersions(left: string, right: string): number | null;
|
|
90
|
+
/** Read the same validated, project-local policy used by discovery without network work. */
|
|
91
|
+
declare function readUpdatePolicy(root: string): CheckPolicy;
|
|
92
|
+
/** A deliberate local preference change; shared installation state is never an authorization source. */
|
|
93
|
+
declare function setUpdatePolicy(root: string, value: CheckPolicy): boolean;
|
|
94
|
+
declare function resolveUpdateStatus(input: ResolveStatusInput): ResolvedStatus;
|
|
95
|
+
declare function checkForUpdate(root: string, options?: UpdateCheckOptions): Promise<CheckResult>;
|
|
96
|
+
declare function acknowledgeUpdate(root: string, input: {
|
|
97
|
+
release: string;
|
|
98
|
+
session: string;
|
|
99
|
+
}): boolean;
|
|
100
|
+
declare function postponeUpdate(root: string, release: string): boolean;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The AI coding harnesses Joycraft can install into a project. Each maps to a
|
|
104
|
+
* config dir:
|
|
105
|
+
* - claude → .claude/ (Claude Code)
|
|
106
|
+
* - codex → .agents/ (OpenAI Codex)
|
|
107
|
+
* - pi → .pi/ (Pi)
|
|
108
|
+
* - copilot → .github/ (GitHub Copilot)
|
|
109
|
+
* - omp → .omp/ (Oh My Pi)
|
|
110
|
+
*
|
|
111
|
+
* Single source of truth: the menu, the parser, and the install gates in
|
|
112
|
+
* init.ts all derive from this list so a new harness can't leave a path stale.
|
|
113
|
+
*/
|
|
114
|
+
declare const HARNESSES: readonly ["claude", "codex", "pi", "copilot", "omp"];
|
|
115
|
+
type Harness = (typeof HARNESSES)[number];
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* How much of the Joycraft harness is tracked in git.
|
|
119
|
+
* - `shared` — commit skills/agents/pi so teammates get the workflow (default).
|
|
120
|
+
* - `private` — gitignore .claude/, .agents/, .pi/; track only CLAUDE.md,
|
|
121
|
+
* AGENTS.md, and docs/.
|
|
122
|
+
*/
|
|
123
|
+
type GitignoreProfile = 'shared' | 'private';
|
|
124
|
+
|
|
125
|
+
type ManifestFileKind = 'vendor' | 'create-once' | 'config-patch';
|
|
126
|
+
type ManifestOwnership = 'verified' | 'unknown';
|
|
127
|
+
interface InstallationFile {
|
|
128
|
+
vendorVersion: string;
|
|
129
|
+
/** SHA-256 of the canonical LF-normalized vendor text. */
|
|
130
|
+
vendorHash: string;
|
|
131
|
+
kind: ManifestFileKind;
|
|
132
|
+
ownership: ManifestOwnership;
|
|
133
|
+
/** The owned JSON key for a config patch, when applicable. */
|
|
134
|
+
ownedKey?: string;
|
|
135
|
+
/** The owned marker/region for a config patch, when applicable. */
|
|
136
|
+
ownedRegion?: string;
|
|
137
|
+
}
|
|
138
|
+
interface InstallationManifest {
|
|
139
|
+
schemaVersion: 1;
|
|
140
|
+
targetVersion: string;
|
|
141
|
+
bundleIntegrity: string;
|
|
142
|
+
harnesses: Harness[];
|
|
143
|
+
profile: GitignoreProfile;
|
|
144
|
+
files: Record<string, InstallationFile>;
|
|
145
|
+
[key: string]: unknown;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
type SnapshotContent = string | Buffer;
|
|
149
|
+
type UpdateActionKind = 'reconcile' | 'replace' | 'preserve' | 'conflict' | 'repair' | 'create' | 'adopt' | 'delete' | 'orphan';
|
|
150
|
+
interface PlannedUpdateAction {
|
|
151
|
+
path: string;
|
|
152
|
+
kind: UpdateActionKind;
|
|
153
|
+
selected: boolean;
|
|
154
|
+
resolution?: 'replace' | 'repair' | 'preserve';
|
|
155
|
+
reason: string;
|
|
156
|
+
content?: SnapshotContent;
|
|
157
|
+
preservedContent?: SnapshotContent;
|
|
158
|
+
diff?: string;
|
|
159
|
+
rawPrecondition?: string;
|
|
160
|
+
rawTargetHash?: string;
|
|
161
|
+
mode?: number;
|
|
162
|
+
currentPresent: boolean;
|
|
163
|
+
targetPresent: boolean;
|
|
164
|
+
/** For config patches, identifies the fragments calculated in content. */
|
|
165
|
+
patch?: {
|
|
166
|
+
ownedKey?: string;
|
|
167
|
+
ownedRegion?: string;
|
|
168
|
+
};
|
|
169
|
+
/** A preserved known document that needs no user-facing action or status. */
|
|
170
|
+
nonActionable?: boolean;
|
|
171
|
+
}
|
|
172
|
+
interface UpdatePlan {
|
|
173
|
+
actions: PlannedUpdateAction[];
|
|
174
|
+
/** Convenience view of all preserved current bytes, including conflicts. */
|
|
175
|
+
preserved: Array<{
|
|
176
|
+
path: string;
|
|
177
|
+
content: SnapshotContent;
|
|
178
|
+
reason: string;
|
|
179
|
+
}>;
|
|
180
|
+
conflicts: PlannedUpdateAction[];
|
|
181
|
+
diagnostics: string[];
|
|
182
|
+
nextManifest: InstallationManifest;
|
|
183
|
+
/** Digest of the authority read during planning; null explicitly requires a missing authority. */
|
|
184
|
+
baseManifestDigest?: string | null;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
interface ExactRelease {
|
|
188
|
+
packageName: string;
|
|
189
|
+
version: string;
|
|
190
|
+
/** npm's canonical Subresource Integrity value, e.g. sha512-<base64>. */
|
|
191
|
+
integrity: string;
|
|
192
|
+
tarballUrl: string;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** The descriptor shipped inside a Joycraft package. */
|
|
196
|
+
interface ReleaseDescriptor {
|
|
197
|
+
readonly schemaVersion: 1;
|
|
198
|
+
readonly releaseVersion: string;
|
|
199
|
+
readonly manifestSchemas: readonly number[];
|
|
200
|
+
readonly autoSafeEligible: boolean;
|
|
201
|
+
}
|
|
202
|
+
/** Opaque proof that a release's exact tarball and descriptor were verified. */
|
|
203
|
+
interface VerifiedReleaseArtifact {
|
|
204
|
+
readonly release: ExactRelease;
|
|
205
|
+
readonly descriptor: ReleaseDescriptor;
|
|
206
|
+
/** A fresh byte snapshot is returned on each access. */
|
|
207
|
+
readonly tarball: Readonly<Uint8Array>;
|
|
208
|
+
}
|
|
209
|
+
type ReleaseTarballFetcher = (url: string, init?: RequestInit) => Promise<unknown>;
|
|
210
|
+
interface FetchVerifiedReleaseArtifactOptions {
|
|
211
|
+
fetchTarball?: ReleaseTarballFetcher;
|
|
212
|
+
timeoutMs?: number;
|
|
213
|
+
maxBytes?: number;
|
|
214
|
+
}
|
|
215
|
+
/** Parse and validate the reviewed descriptor for one exact package version. */
|
|
216
|
+
declare function parseReleaseDescriptor(data: unknown, exactVersion: string): ReleaseDescriptor;
|
|
217
|
+
/** Verify an exact artifact's outer digest, package identity, and descriptor. */
|
|
218
|
+
declare function verifyReleaseArtifact(release: ExactRelease, tarball: Uint8Array): VerifiedReleaseArtifact;
|
|
219
|
+
/** Check the verifier-issued proof without trusting a caller-supplied boolean. */
|
|
220
|
+
declare function isVerifiedReleaseArtifact(value: unknown): value is VerifiedReleaseArtifact;
|
|
221
|
+
/** Download one exact tarball and return it only after local artifact verification. */
|
|
222
|
+
declare function fetchVerifiedReleaseArtifact(release: ExactRelease, options?: FetchVerifiedReleaseArtifactOptions): Promise<VerifiedReleaseArtifact>;
|
|
223
|
+
|
|
224
|
+
interface AutoSafeEligibilityInput {
|
|
225
|
+
/** The policy read from project-local checker state. */
|
|
226
|
+
policy: CheckPolicy;
|
|
227
|
+
/** A verifier-issued proof for the exact candidate package artifact. */
|
|
228
|
+
candidate?: VerifiedReleaseArtifact;
|
|
229
|
+
/** Facts from the bundle that is actually about to execute. */
|
|
230
|
+
executingVersion: string;
|
|
231
|
+
executingIntegrity?: string;
|
|
232
|
+
executingDescriptor?: unknown;
|
|
233
|
+
manifestSchema?: number;
|
|
234
|
+
plan: UpdatePlan;
|
|
235
|
+
existingManifest?: InstallationManifest;
|
|
236
|
+
replaceCustomized?: readonly string[];
|
|
237
|
+
repair?: readonly string[];
|
|
238
|
+
migration?: boolean;
|
|
239
|
+
legacyBridge?: boolean;
|
|
240
|
+
setupChanges?: boolean;
|
|
241
|
+
profileChanges?: boolean;
|
|
242
|
+
localOperations?: boolean;
|
|
243
|
+
authorityTransition?: boolean;
|
|
244
|
+
}
|
|
245
|
+
interface AutoSafeEligibility {
|
|
246
|
+
eligible: boolean;
|
|
247
|
+
diagnostics: string[];
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Evaluate the complete automatic-update contract without I/O, prompts, or
|
|
251
|
+
* mutation. A true result requires every independent proof to be present.
|
|
252
|
+
*/
|
|
253
|
+
declare function evaluateAutoSafeEligibility(input: AutoSafeEligibilityInput): AutoSafeEligibility;
|
|
254
|
+
|
|
255
|
+
export { type AutoSafeEligibility, type AutoSafeEligibilityInput, CHECK_CACHE_PATH, CHECK_CACHE_TTL_MS, CHECK_DEFAULT_DEADLINE_MS, CHECK_LOCK_PATH, CHECK_LOCK_TTL_MS, CHECK_SETTINGS_PATH, type CheckMetadata, type CheckPolicy, type CheckResult, type CheckStatus, type FetchVerifiedReleaseArtifactOptions, type InstallationCheckState, type ReleaseDescriptor, type ResolveStatusInput, type ResolvedStatus, type StackInfo, type UpdateCheckOptions, type VerifiedReleaseArtifact, acknowledgeUpdate, checkForUpdate, compareStableVersions, detectStack, evaluateAutoSafeEligibility, fetchVerifiedReleaseArtifact, isVerifiedReleaseArtifact, parseReleaseDescriptor, postponeUpdate, readUpdatePolicy, resolveCheckSessionId, resolveUpdateStatus, setUpdatePolicy, verifyReleaseArtifact };
|