@penpair/core 0.1.3 → 0.3.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/adapters.d.ts +16 -1
- package/dist/adapters.js +62 -19
- package/dist/approvals.d.ts +32 -0
- package/dist/approvals.js +213 -0
- package/dist/atomic-output.d.ts +5 -0
- package/dist/atomic-output.js +33 -0
- package/dist/audit-rules.d.ts +60 -0
- package/dist/audit-rules.js +443 -0
- package/dist/backup-note.d.ts +4 -0
- package/dist/backup-note.js +49 -0
- package/dist/baseline-coverage.d.ts +25 -0
- package/dist/baseline-coverage.js +248 -0
- package/dist/baselines-config.d.ts +25 -0
- package/dist/baselines-config.js +150 -11
- package/dist/baselines.d.ts +37 -8
- package/dist/baselines.js +362 -59
- package/dist/cli-arguments.d.ts +7 -0
- package/dist/cli-arguments.js +47 -0
- package/dist/cli-main.d.ts +13 -1
- package/dist/cli-main.js +2107 -247
- package/dist/client.d.ts +30 -6
- package/dist/client.js +160 -35
- package/dist/command-result.d.ts +159 -0
- package/dist/command-result.js +468 -0
- package/dist/coordination.d.ts +15 -0
- package/dist/coordination.js +184 -0
- package/dist/credentials.d.ts +21 -0
- package/dist/credentials.js +105 -0
- package/dist/deep-check.js +57 -9
- package/dist/design-spec.d.ts +55 -0
- package/dist/design-spec.js +275 -0
- package/dist/endpoint.d.ts +8 -1
- package/dist/endpoint.js +133 -21
- package/dist/errors.d.ts +2 -1
- package/dist/errors.js +8 -4
- package/dist/export.d.ts +18 -0
- package/dist/export.js +113 -10
- package/dist/file-archive.d.ts +16 -0
- package/dist/file-archive.js +58 -0
- package/dist/file-guard.d.ts +8 -0
- package/dist/file-guard.js +58 -0
- package/dist/formats.d.ts +4 -0
- package/dist/formats.js +229 -0
- package/dist/index.d.ts +34 -1
- package/dist/index.js +34 -1
- package/dist/inspection.d.ts +106 -0
- package/dist/inspection.js +657 -0
- package/dist/instance/config-schema.d.ts +422 -0
- package/dist/instance/config-schema.js +435 -0
- package/dist/instance/config.d.ts +29 -0
- package/dist/instance/config.js +191 -29
- package/dist/instance/connect.d.ts +10 -1
- package/dist/instance/connect.js +178 -30
- package/dist/instance/connection.d.ts +39 -4
- package/dist/instance/connection.js +198 -14
- package/dist/instance/gitignore.js +5 -2
- package/dist/instance/init.js +32 -7
- package/dist/instance/runner.js +32 -10
- package/dist/instance/setup.js +46 -13
- package/dist/instance/tty.js +28 -8
- package/dist/journal.d.ts +87 -0
- package/dist/journal.js +423 -0
- package/dist/kit-smoke.d.ts +31 -0
- package/dist/kit-smoke.js +145 -0
- package/dist/kit-source.d.ts +2 -0
- package/dist/kit-source.js +279 -0
- package/dist/kit.d.ts +25 -0
- package/dist/kit.js +158 -0
- package/dist/layout-policy.d.ts +2 -0
- package/dist/layout-policy.js +86 -0
- package/dist/layout.d.ts +21 -0
- package/dist/layout.js +36 -0
- package/dist/live-smoke.d.ts +8 -0
- package/dist/live-smoke.js +23 -0
- package/dist/local-profile.js +2 -1
- package/dist/mcp-server.d.ts +12 -0
- package/dist/mcp-server.js +415 -0
- package/dist/native-api.d.ts +15 -0
- package/dist/native-api.js +78 -0
- package/dist/onboard.d.ts +10 -0
- package/dist/onboard.js +41 -0
- package/dist/operation.d.ts +22 -3
- package/dist/operation.js +341 -31
- package/dist/page-session.d.ts +23 -0
- package/dist/page-session.js +142 -0
- package/dist/png.d.ts +5 -0
- package/dist/png.js +22 -0
- package/dist/portable-tokens.d.ts +22 -0
- package/dist/portable-tokens.js +331 -0
- package/dist/probe.d.ts +6 -2
- package/dist/probe.js +64 -11
- package/dist/project-input.d.ts +6 -0
- package/dist/project-input.js +65 -0
- package/dist/project-snippets.js +29 -12
- package/dist/project-status.d.ts +24 -0
- package/dist/project-status.js +188 -0
- package/dist/registry.d.ts +2 -1
- package/dist/registry.js +224 -53
- package/dist/run-file.d.ts +26 -0
- package/dist/run-file.js +199 -0
- package/dist/shots.d.ts +43 -0
- package/dist/shots.js +172 -0
- package/dist/skill-instructions.d.ts +13 -0
- package/dist/skill-instructions.js +144 -0
- package/dist/skills.d.ts +7 -0
- package/dist/skills.js +163 -46
- package/dist/snippet.d.ts +3 -2
- package/dist/snippet.js +33 -9
- package/dist/snippets/archive.d.ts +9 -0
- package/dist/snippets/archive.js +10 -4
- package/dist/snippets/read.d.ts +1 -1
- package/dist/snippets/read.js +78 -41
- package/dist/structure-snapshot.d.ts +85 -0
- package/dist/structure-snapshot.js +525 -0
- package/dist/token-edit.d.ts +53 -0
- package/dist/token-edit.js +352 -0
- package/dist/token-projection.d.ts +56 -0
- package/dist/token-projection.js +286 -0
- package/dist/tokens-diff.d.ts +19 -6
- package/dist/tokens-diff.js +182 -18
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/skills/penpair-design/SKILL.md +20 -45
- package/skills/penpair-design/references/penpot-plugin-gotchas.md +58 -2
- package/skills/penpair-design/references/project-facts.md +3 -1
- package/skills/penpair-design/references/write-protocol.md +15 -3
- package/skills/penpair-handoff/SKILL.md +16 -0
- package/skills/penpair-handoff/references/comparison-companion.md +13 -0
- package/skills/penpair-handoff/references/handoff-flow.md +13 -0
- package/skills/penpair-recipes/SKILL.md +21 -0
- package/skills/penpair-recipes/references/build-flow.md +11 -0
- package/skills/penpair-setup/SKILL.md +8 -2
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -3
- package/dist/docker/lifecycle.d.ts +0 -96
- package/dist/docker/lifecycle.js +0 -273
- package/dist/docker/secrets.d.ts +0 -11
- package/dist/docker/secrets.js +0 -38
- package/dist/docker/template.d.ts +0 -8
- package/dist/docker/template.js +0 -158
- package/dist/docker-profile.d.ts +0 -114
- package/dist/docker-profile.js +0 -18
- package/dist/instance/lifecycle.d.ts +0 -129
- package/dist/instance/lifecycle.js +0 -336
- package/dist/instance/secrets.d.ts +0 -11
- package/dist/instance/secrets.js +0 -38
- package/dist/instance/template.d.ts +0 -8
- package/dist/instance/template.js +0 -158
package/dist/formats.js
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { projectConfigSchema } from "./instance/config-schema.js";
|
|
2
|
+
import { validateProjectConfig } from "./instance/config.js";
|
|
3
|
+
import { commandResultSchema } from "./command-result.js";
|
|
4
|
+
const string = {
|
|
5
|
+
type: "string",
|
|
6
|
+
};
|
|
7
|
+
const array = {
|
|
8
|
+
type: "array",
|
|
9
|
+
};
|
|
10
|
+
const schema = (name, version, kind, properties, required = Object.keys(properties)) => ({
|
|
11
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
12
|
+
$id: `urn:penpair:schema:v${version}:${name}`,
|
|
13
|
+
title: `${name} v${version}`,
|
|
14
|
+
type: "object",
|
|
15
|
+
required: [
|
|
16
|
+
"schemaVersion",
|
|
17
|
+
...(kind
|
|
18
|
+
? [
|
|
19
|
+
"kind",
|
|
20
|
+
]
|
|
21
|
+
: []),
|
|
22
|
+
...required,
|
|
23
|
+
],
|
|
24
|
+
properties: {
|
|
25
|
+
schemaVersion: {
|
|
26
|
+
const: version,
|
|
27
|
+
},
|
|
28
|
+
...(kind
|
|
29
|
+
? {
|
|
30
|
+
kind: {
|
|
31
|
+
const: kind,
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
: {}),
|
|
35
|
+
...properties,
|
|
36
|
+
},
|
|
37
|
+
additionalProperties: true,
|
|
38
|
+
});
|
|
39
|
+
/** Public envelope schemas; runtime validators additionally enforce hashes, identities, hierarchy and budgets. */
|
|
40
|
+
export const artifactSchemas = {
|
|
41
|
+
"project-config": {
|
|
42
|
+
...projectConfigSchema,
|
|
43
|
+
$id: "urn:penpair:schema:v1:project-config",
|
|
44
|
+
},
|
|
45
|
+
"command-result": {
|
|
46
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
47
|
+
$id: "urn:penpair:schema:v1:command-result",
|
|
48
|
+
...commandResultSchema,
|
|
49
|
+
},
|
|
50
|
+
inspection: schema("inspection", 1, undefined, {
|
|
51
|
+
kind: {
|
|
52
|
+
enum: [
|
|
53
|
+
"shape-inspection",
|
|
54
|
+
"token-inspection",
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
fileId: string,
|
|
58
|
+
pageId: {
|
|
59
|
+
type: [
|
|
60
|
+
"string",
|
|
61
|
+
"null",
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
revision: {
|
|
65
|
+
type: "integer",
|
|
66
|
+
minimum: 0,
|
|
67
|
+
},
|
|
68
|
+
complete: {
|
|
69
|
+
type: "boolean",
|
|
70
|
+
},
|
|
71
|
+
counts: {
|
|
72
|
+
type: "object",
|
|
73
|
+
},
|
|
74
|
+
reasons: array,
|
|
75
|
+
producer: {
|
|
76
|
+
type: "object",
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
"component-map": schema("component-map", 1, undefined, {
|
|
80
|
+
components: {
|
|
81
|
+
type: "array",
|
|
82
|
+
maxItems: 1000,
|
|
83
|
+
items: {
|
|
84
|
+
type: "object",
|
|
85
|
+
required: [
|
|
86
|
+
"libraryId",
|
|
87
|
+
"componentId",
|
|
88
|
+
"codeComponent",
|
|
89
|
+
],
|
|
90
|
+
properties: {
|
|
91
|
+
libraryId: string,
|
|
92
|
+
componentId: string,
|
|
93
|
+
codeComponent: string,
|
|
94
|
+
props: {
|
|
95
|
+
type: "object",
|
|
96
|
+
},
|
|
97
|
+
textProps: {
|
|
98
|
+
type: "object",
|
|
99
|
+
additionalProperties: string,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
}),
|
|
105
|
+
"design-spec": schema("design-spec", 1, "design-spec", {
|
|
106
|
+
source: {
|
|
107
|
+
type: "object",
|
|
108
|
+
},
|
|
109
|
+
mappingHash: string,
|
|
110
|
+
nodes: array,
|
|
111
|
+
unknowns: array,
|
|
112
|
+
}),
|
|
113
|
+
approvals: schema("approvals", 1, "design-approvals", {
|
|
114
|
+
records: {
|
|
115
|
+
type: "array",
|
|
116
|
+
maxItems: 10000,
|
|
117
|
+
},
|
|
118
|
+
}),
|
|
119
|
+
"structural-manifest": schema("structural-manifest", 1, "structural-snapshot-manifest", {
|
|
120
|
+
fileId: string,
|
|
121
|
+
revision: {
|
|
122
|
+
type: "integer",
|
|
123
|
+
},
|
|
124
|
+
producer: string,
|
|
125
|
+
fidelity: {
|
|
126
|
+
const: "review-only",
|
|
127
|
+
},
|
|
128
|
+
pages: {
|
|
129
|
+
type: "array",
|
|
130
|
+
minItems: 1,
|
|
131
|
+
maxItems: 100,
|
|
132
|
+
},
|
|
133
|
+
tokens: {
|
|
134
|
+
type: "object",
|
|
135
|
+
},
|
|
136
|
+
hash: string,
|
|
137
|
+
}),
|
|
138
|
+
"baseline-manifest": schema("baseline-manifest", 2, undefined, {
|
|
139
|
+
complete: {
|
|
140
|
+
type: "boolean",
|
|
141
|
+
},
|
|
142
|
+
fileId: string,
|
|
143
|
+
pageId: string,
|
|
144
|
+
captureId: string,
|
|
145
|
+
frames: {
|
|
146
|
+
type: "array",
|
|
147
|
+
maxItems: 1000,
|
|
148
|
+
},
|
|
149
|
+
}),
|
|
150
|
+
"projected-theme-preview": schema("projected-theme-preview", 1, "projected-theme-preview", {
|
|
151
|
+
sourceHash: string,
|
|
152
|
+
theme: {
|
|
153
|
+
type: "object",
|
|
154
|
+
},
|
|
155
|
+
sets: array,
|
|
156
|
+
resolved: array,
|
|
157
|
+
unknowns: array,
|
|
158
|
+
complete: {
|
|
159
|
+
type: "boolean",
|
|
160
|
+
},
|
|
161
|
+
nativeBindings: {
|
|
162
|
+
const: false,
|
|
163
|
+
},
|
|
164
|
+
}),
|
|
165
|
+
"portable-tokens": schema("portable-tokens", 1, "portable-tokens", {
|
|
166
|
+
format: {
|
|
167
|
+
const: "dtcg-2025.10-subset",
|
|
168
|
+
},
|
|
169
|
+
tokens: {
|
|
170
|
+
type: "array",
|
|
171
|
+
minItems: 1,
|
|
172
|
+
maxItems: 10000,
|
|
173
|
+
items: {
|
|
174
|
+
type: "object",
|
|
175
|
+
required: [
|
|
176
|
+
"path",
|
|
177
|
+
"type",
|
|
178
|
+
"value",
|
|
179
|
+
],
|
|
180
|
+
properties: {
|
|
181
|
+
path: {
|
|
182
|
+
type: "array",
|
|
183
|
+
minItems: 1,
|
|
184
|
+
maxItems: 32,
|
|
185
|
+
items: string,
|
|
186
|
+
},
|
|
187
|
+
type: {
|
|
188
|
+
enum: [
|
|
189
|
+
"color",
|
|
190
|
+
"dimension",
|
|
191
|
+
"number",
|
|
192
|
+
"fontFamily",
|
|
193
|
+
"fontWeight",
|
|
194
|
+
"typography",
|
|
195
|
+
],
|
|
196
|
+
},
|
|
197
|
+
value: {},
|
|
198
|
+
description: string,
|
|
199
|
+
extensions: {
|
|
200
|
+
type: "object",
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
groups: {
|
|
206
|
+
type: "object",
|
|
207
|
+
},
|
|
208
|
+
losses: {
|
|
209
|
+
type: "array",
|
|
210
|
+
maxItems: 0,
|
|
211
|
+
},
|
|
212
|
+
}),
|
|
213
|
+
};
|
|
214
|
+
/** Legacy unversioned config is v1; preserve every extension block and require explicit new output for persistence. */
|
|
215
|
+
export function migrateProjectConfig(raw) {
|
|
216
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
217
|
+
throw new Error("Config migration requires a JSON object");
|
|
218
|
+
}
|
|
219
|
+
const v = raw;
|
|
220
|
+
if (v.schemaVersion !== undefined && v.schemaVersion !== 1) {
|
|
221
|
+
throw new Error("Unsupported project config major version; use the producer's documented migration before opening it");
|
|
222
|
+
}
|
|
223
|
+
const migrated = {
|
|
224
|
+
...structuredClone(v),
|
|
225
|
+
schemaVersion: 1,
|
|
226
|
+
};
|
|
227
|
+
validateProjectConfig(migrated);
|
|
228
|
+
return migrated;
|
|
229
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
export { version } from "./version.js";
|
|
2
2
|
export * from "./adapters.js";
|
|
3
3
|
export * from "./baselines.js";
|
|
4
|
-
export { runCli } from "./cli-main.js";
|
|
4
|
+
export { runCommand, runCli } from "./cli-main.js";
|
|
5
5
|
export * from "./client.js";
|
|
6
|
+
export { guardFile } from "./file-guard.js";
|
|
6
7
|
export * from "./deep-check.js";
|
|
8
|
+
export { runLiveSmoke } from "./live-smoke.js";
|
|
9
|
+
export * from "./layout.js";
|
|
10
|
+
export * from "./native-api.js";
|
|
11
|
+
export * from "./file-archive.js";
|
|
12
|
+
export { backupNoteCheck } from "./backup-note.js";
|
|
13
|
+
export * from "./journal.js";
|
|
7
14
|
export * from "./local-profile.js";
|
|
8
15
|
export * from "./endpoint.js";
|
|
9
16
|
export * from "./errors.js";
|
|
@@ -18,8 +25,34 @@ export * from "./snippets/archive.js";
|
|
|
18
25
|
export * from "./snippets/read.js";
|
|
19
26
|
export * from "./tokens-diff.js";
|
|
20
27
|
export * from "./instance/config.js";
|
|
28
|
+
export { projectConfigSchema } from "./instance/config-schema.js";
|
|
21
29
|
export * from "./instance/connection.js";
|
|
22
30
|
export * from "./instance/gitignore.js";
|
|
23
31
|
export { defaultInstanceName, init } from "./instance/init.js";
|
|
24
32
|
export type { InitOptions, InitResult } from "./instance/init.js";
|
|
25
33
|
export * from "./instance/runner.js";
|
|
34
|
+
export { writeCoordinator, guardRevision, type WriteLease, type CoordinationOptions, } from "./coordination.js";
|
|
35
|
+
export { onboardingChecklist } from "./onboard.js";
|
|
36
|
+
export { atomicWriteFile } from "./atomic-output.js";
|
|
37
|
+
export { commandSleep, withCleanupDeadline, commandResultSchema, collectCommand, commandOutput, type CommandResult, type CommandFailure, type CommandOutput, } from "./command-result.js";
|
|
38
|
+
export { resolveProjectInput, resolveProjectOutput, designDataBlock } from "./project-input.js";
|
|
39
|
+
export { planSkillInstructions, applySkillInstructions, type InstructionReport, } from "./skill-instructions.js";
|
|
40
|
+
export { parseCommandArgs, CommandArgumentError } from "./cli-arguments.js";
|
|
41
|
+
export { findShapesByName, exportShapeByName, captureShots, type ShapeLookup, type ShapeMatch, type ShotsReport, } from "./shots.js";
|
|
42
|
+
export * from "./inspection.js";
|
|
43
|
+
export { tokenTypes, validateEditableToken, validateTokenEdit, planTokenEdit, tokenEditOperation, type EditableToken, type TokenEdit, type TokenEditState, type TokenEditPlan, } from "./token-edit.js";
|
|
44
|
+
export { ensureGitignoreEntry } from "./instance/gitignore.js";
|
|
45
|
+
export { prepareFileScript, runFileScript, type FileScriptOptions, type PreparedFileScript, } from "./run-file.js";
|
|
46
|
+
export { kit, coreKit, checkKits, loadKits, type BuildKit, type RecipeInfo } from "./kit.js";
|
|
47
|
+
export { runKitSmoke, kitSmokeOperation } from "./kit-smoke.js";
|
|
48
|
+
export { baselineCoverage, readBaselineCoverage, designCaseKey, type BaselineCoverage, type CoverageRow, } from "./baseline-coverage.js";
|
|
49
|
+
export * from "./design-spec.js";
|
|
50
|
+
export * from "./mcp-server.js";
|
|
51
|
+
export * from "./approvals.js";
|
|
52
|
+
export * from "./structure-snapshot.js";
|
|
53
|
+
export * from "./portable-tokens.js";
|
|
54
|
+
export * from "./formats.js";
|
|
55
|
+
export * from "./project-status.js";
|
|
56
|
+
export * from "./audit-rules.js";
|
|
57
|
+
export * from "./credentials.js";
|
|
58
|
+
export * from "./token-projection.js";
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
export { version } from "./version.js";
|
|
2
2
|
export * from "./adapters.js";
|
|
3
3
|
export * from "./baselines.js";
|
|
4
|
-
export { runCli } from "./cli-main.js";
|
|
4
|
+
export { runCommand, runCli } from "./cli-main.js";
|
|
5
5
|
export * from "./client.js";
|
|
6
|
+
export { guardFile } from "./file-guard.js";
|
|
6
7
|
export * from "./deep-check.js";
|
|
8
|
+
export { runLiveSmoke } from "./live-smoke.js";
|
|
9
|
+
export * from "./layout.js";
|
|
10
|
+
export * from "./native-api.js";
|
|
11
|
+
export * from "./file-archive.js";
|
|
12
|
+
export { backupNoteCheck } from "./backup-note.js";
|
|
13
|
+
export * from "./journal.js";
|
|
7
14
|
export * from "./local-profile.js";
|
|
8
15
|
export * from "./endpoint.js";
|
|
9
16
|
export * from "./errors.js";
|
|
@@ -18,7 +25,33 @@ export * from "./snippets/archive.js";
|
|
|
18
25
|
export * from "./snippets/read.js";
|
|
19
26
|
export * from "./tokens-diff.js";
|
|
20
27
|
export * from "./instance/config.js";
|
|
28
|
+
export { projectConfigSchema } from "./instance/config-schema.js";
|
|
21
29
|
export * from "./instance/connection.js";
|
|
22
30
|
export * from "./instance/gitignore.js";
|
|
23
31
|
export { defaultInstanceName, init } from "./instance/init.js";
|
|
24
32
|
export * from "./instance/runner.js";
|
|
33
|
+
export { writeCoordinator, guardRevision, } from "./coordination.js";
|
|
34
|
+
export { onboardingChecklist } from "./onboard.js";
|
|
35
|
+
export { atomicWriteFile } from "./atomic-output.js";
|
|
36
|
+
export { commandSleep, withCleanupDeadline, commandResultSchema, collectCommand, commandOutput, } from "./command-result.js";
|
|
37
|
+
export { resolveProjectInput, resolveProjectOutput, designDataBlock } from "./project-input.js";
|
|
38
|
+
export { planSkillInstructions, applySkillInstructions, } from "./skill-instructions.js";
|
|
39
|
+
export { parseCommandArgs, CommandArgumentError } from "./cli-arguments.js";
|
|
40
|
+
export { findShapesByName, exportShapeByName, captureShots, } from "./shots.js";
|
|
41
|
+
export * from "./inspection.js";
|
|
42
|
+
export { tokenTypes, validateEditableToken, validateTokenEdit, planTokenEdit, tokenEditOperation, } from "./token-edit.js";
|
|
43
|
+
export { ensureGitignoreEntry } from "./instance/gitignore.js";
|
|
44
|
+
export { prepareFileScript, runFileScript, } from "./run-file.js";
|
|
45
|
+
export { kit, coreKit, checkKits, loadKits } from "./kit.js";
|
|
46
|
+
export { runKitSmoke, kitSmokeOperation } from "./kit-smoke.js";
|
|
47
|
+
export { baselineCoverage, readBaselineCoverage, designCaseKey, } from "./baseline-coverage.js";
|
|
48
|
+
export * from "./design-spec.js";
|
|
49
|
+
export * from "./mcp-server.js";
|
|
50
|
+
export * from "./approvals.js";
|
|
51
|
+
export * from "./structure-snapshot.js";
|
|
52
|
+
export * from "./portable-tokens.js";
|
|
53
|
+
export * from "./formats.js";
|
|
54
|
+
export * from "./project-status.js";
|
|
55
|
+
export * from "./audit-rules.js";
|
|
56
|
+
export * from "./credentials.js";
|
|
57
|
+
export * from "./token-projection.js";
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { type ExecutionMetrics, type PenpotToolClient } from "./client.js";
|
|
2
|
+
export declare const inspectionFields: readonly ["geometry", "text", "layout", "component", "tokens", "style", "metadata"];
|
|
3
|
+
export type InspectionField = (typeof inspectionFields)[number];
|
|
4
|
+
export interface InspectionQuery {
|
|
5
|
+
kind?: "shape" | "tokens";
|
|
6
|
+
shapeId?: string;
|
|
7
|
+
page?: string;
|
|
8
|
+
fields?: InspectionField[];
|
|
9
|
+
depth?: number;
|
|
10
|
+
maxNodes?: number;
|
|
11
|
+
responseBytes?: number;
|
|
12
|
+
timeBudgetMs?: number;
|
|
13
|
+
documentBytes?: number;
|
|
14
|
+
cursor?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface InspectionChunk {
|
|
17
|
+
schemaVersion: 1;
|
|
18
|
+
kind: "inspection-chunk";
|
|
19
|
+
fileId: string;
|
|
20
|
+
pageId: string | null;
|
|
21
|
+
revision: number;
|
|
22
|
+
queryHash: string;
|
|
23
|
+
digest: string;
|
|
24
|
+
digestAlgorithm: "cyrb53-change-detector";
|
|
25
|
+
sourceComplete: boolean;
|
|
26
|
+
offset: number;
|
|
27
|
+
nextOffset: number | null;
|
|
28
|
+
totalCodeUnits: number;
|
|
29
|
+
chunk: string;
|
|
30
|
+
nextCursor: string | null;
|
|
31
|
+
complete: boolean;
|
|
32
|
+
counts: Record<string, number | null>;
|
|
33
|
+
observationMs: number;
|
|
34
|
+
metrics: ExecutionMetrics;
|
|
35
|
+
}
|
|
36
|
+
export interface InspectionDocument {
|
|
37
|
+
schemaVersion: 1;
|
|
38
|
+
kind: "shape-inspection" | "token-inspection";
|
|
39
|
+
fileId: string;
|
|
40
|
+
pageId: string | null;
|
|
41
|
+
revision: number;
|
|
42
|
+
complete: boolean;
|
|
43
|
+
counts: Record<string, number | null>;
|
|
44
|
+
reasons: string[];
|
|
45
|
+
producer: {
|
|
46
|
+
name: string;
|
|
47
|
+
version: string;
|
|
48
|
+
};
|
|
49
|
+
nodes?: Record<string, unknown>[];
|
|
50
|
+
sets?: Record<string, unknown>[];
|
|
51
|
+
themes?: Record<string, unknown>[];
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
}
|
|
54
|
+
export interface InspectionMetrics {
|
|
55
|
+
calls: number;
|
|
56
|
+
requestSnippetBytes: number;
|
|
57
|
+
responsePayloadBytes: number;
|
|
58
|
+
maxRequestSnippetBytes: number;
|
|
59
|
+
maxResponsePayloadBytes: number;
|
|
60
|
+
assembledBytes: number;
|
|
61
|
+
durationMs: number;
|
|
62
|
+
}
|
|
63
|
+
export type InspectionCapture = InspectionDocument & {
|
|
64
|
+
capturedAt: string;
|
|
65
|
+
sha256: string;
|
|
66
|
+
metrics: InspectionMetrics;
|
|
67
|
+
};
|
|
68
|
+
export interface PartialInspection {
|
|
69
|
+
schemaVersion: 1;
|
|
70
|
+
kind: "inspection-partial";
|
|
71
|
+
fileId: string | null;
|
|
72
|
+
pageId: string | null;
|
|
73
|
+
complete: false;
|
|
74
|
+
reason: string;
|
|
75
|
+
chunks: InspectionChunk[];
|
|
76
|
+
nextCursor: string | null;
|
|
77
|
+
metrics: InspectionMetrics;
|
|
78
|
+
}
|
|
79
|
+
export interface CaptureBudget {
|
|
80
|
+
maxCalls?: number;
|
|
81
|
+
maxTotalBytes?: number;
|
|
82
|
+
timeoutMs?: number;
|
|
83
|
+
}
|
|
84
|
+
export declare function validateInspectionQuery(query: InspectionQuery): {
|
|
85
|
+
queryHash: string;
|
|
86
|
+
producerVersion: string;
|
|
87
|
+
kind: "tokens" | "shape";
|
|
88
|
+
shapeId: string | undefined;
|
|
89
|
+
page: string | undefined;
|
|
90
|
+
fields: ("text" | "geometry" | "layout" | "component" | "tokens" | "style" | "metadata")[];
|
|
91
|
+
depth: number;
|
|
92
|
+
maxNodes: number;
|
|
93
|
+
responseBytes: number;
|
|
94
|
+
timeBudgetMs: number;
|
|
95
|
+
documentBytes: number;
|
|
96
|
+
};
|
|
97
|
+
export declare function inspectChunk(client: PenpotToolClient, query: InspectionQuery, requestTimeoutMs?: number): Promise<InspectionChunk>;
|
|
98
|
+
/** Validate structural evidence independently of the transport envelope. Unknown API fields remain explicit nulls. */
|
|
99
|
+
export declare function validateInspectionDocument(input: unknown): InspectionDocument;
|
|
100
|
+
export declare function reassembleInspection(chunks: InspectionChunk[]): InspectionDocument;
|
|
101
|
+
export declare function validateCaptureBudget(budget?: CaptureBudget): {
|
|
102
|
+
maxCalls: number;
|
|
103
|
+
maxTotalBytes: number;
|
|
104
|
+
timeoutMs: number;
|
|
105
|
+
};
|
|
106
|
+
export declare function captureInspection(client: PenpotToolClient, query: InspectionQuery, budget?: CaptureBudget): Promise<InspectionCapture | PartialInspection>;
|