@cat-factory/integrations 0.32.0 → 0.34.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.
Files changed (59) hide show
  1. package/dist/index.d.ts +4 -3
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +4 -3
  4. package/dist/index.js.map +1 -1
  5. package/dist/modules/documents/ConfluenceProvider.d.ts +1 -2
  6. package/dist/modules/documents/ConfluenceProvider.d.ts.map +1 -1
  7. package/dist/modules/documents/DocumentConnectionService.d.ts +11 -28
  8. package/dist/modules/documents/DocumentConnectionService.d.ts.map +1 -1
  9. package/dist/modules/documents/DocumentConnectionService.js +12 -71
  10. package/dist/modules/documents/DocumentConnectionService.js.map +1 -1
  11. package/dist/modules/documents/DocumentImportService.d.ts +4 -7
  12. package/dist/modules/documents/DocumentImportService.d.ts.map +1 -1
  13. package/dist/modules/documents/DocumentImportService.js +6 -9
  14. package/dist/modules/documents/DocumentImportService.js.map +1 -1
  15. package/dist/modules/documents/FigmaProvider.d.ts +4 -5
  16. package/dist/modules/documents/FigmaProvider.d.ts.map +1 -1
  17. package/dist/modules/documents/FigmaProvider.js +22 -21
  18. package/dist/modules/documents/FigmaProvider.js.map +1 -1
  19. package/dist/modules/documents/GitHubDocsProvider.d.ts +1 -2
  20. package/dist/modules/documents/GitHubDocsProvider.d.ts.map +1 -1
  21. package/dist/modules/documents/LinearDocumentProvider.d.ts +1 -2
  22. package/dist/modules/documents/LinearDocumentProvider.d.ts.map +1 -1
  23. package/dist/modules/documents/NotionProvider.d.ts +1 -2
  24. package/dist/modules/documents/NotionProvider.d.ts.map +1 -1
  25. package/dist/modules/documents/{ClaudeDesignProvider.d.ts → ZeplinProvider.d.ts} +12 -11
  26. package/dist/modules/documents/ZeplinProvider.d.ts.map +1 -0
  27. package/dist/modules/documents/ZeplinProvider.js +126 -0
  28. package/dist/modules/documents/ZeplinProvider.js.map +1 -0
  29. package/dist/modules/documents/design.logic.d.ts +60 -0
  30. package/dist/modules/documents/design.logic.d.ts.map +1 -0
  31. package/dist/modules/documents/design.logic.js +0 -0
  32. package/dist/modules/documents/design.logic.js.map +1 -0
  33. package/dist/modules/documents/figma.logic.d.ts +30 -9
  34. package/dist/modules/documents/figma.logic.d.ts.map +1 -1
  35. package/dist/modules/documents/figma.logic.js +51 -36
  36. package/dist/modules/documents/figma.logic.js.map +1 -1
  37. package/dist/modules/documents/zeplin.logic.d.ts +102 -0
  38. package/dist/modules/documents/zeplin.logic.d.ts.map +1 -0
  39. package/dist/modules/documents/zeplin.logic.js +193 -0
  40. package/dist/modules/documents/zeplin.logic.js.map +1 -0
  41. package/dist/modules/environments/EnvironmentProvisioningService.d.ts +19 -0
  42. package/dist/modules/environments/EnvironmentProvisioningService.d.ts.map +1 -1
  43. package/dist/modules/environments/EnvironmentProvisioningService.js +82 -12
  44. package/dist/modules/environments/EnvironmentProvisioningService.js.map +1 -1
  45. package/dist/modules/kubernetes/KubernetesRunnerTransport.d.ts.map +1 -1
  46. package/dist/modules/kubernetes/KubernetesRunnerTransport.js +22 -4
  47. package/dist/modules/kubernetes/KubernetesRunnerTransport.js.map +1 -1
  48. package/dist/modules/kubernetes/kubernetes.logic.d.ts +29 -0
  49. package/dist/modules/kubernetes/kubernetes.logic.d.ts.map +1 -1
  50. package/dist/modules/kubernetes/kubernetes.logic.js +121 -0
  51. package/dist/modules/kubernetes/kubernetes.logic.js.map +1 -1
  52. package/package.json +3 -3
  53. package/dist/modules/documents/ClaudeDesignProvider.d.ts.map +0 -1
  54. package/dist/modules/documents/ClaudeDesignProvider.js +0 -163
  55. package/dist/modules/documents/ClaudeDesignProvider.js.map +0 -1
  56. package/dist/modules/documents/claudeDesign.logic.d.ts +0 -88
  57. package/dist/modules/documents/claudeDesign.logic.d.ts.map +0 -1
  58. package/dist/modules/documents/claudeDesign.logic.js +0 -317
  59. package/dist/modules/documents/claudeDesign.logic.js.map +0 -1
@@ -41,6 +41,35 @@ export declare function buildPodManifest(config: KubernetesRunnerConfig, runId:
41
41
  export type PodReadiness = 'ready' | 'pending' | 'gone';
42
42
  /** Classify a pod's status JSON: ready to serve, still pending, or terminally gone. */
43
43
  export declare function classifyPodReadiness(pod: unknown): PodReadiness;
44
+ /**
45
+ * One pass over a pod's container statuses + conditions, yielding BOTH readings the readiness
46
+ * loop needs so the pod JSON isn't walked (and the two views aren't kept in sync) twice:
47
+ * - `terminal`: the first container whose `state.waiting.reason` is a known-unrecoverable
48
+ * start-up failure (bad image / config / crash loop), formatted as `"<reason>: <message>"`,
49
+ * else null — drives the transport's fail-fast path.
50
+ * - `detail`: a short human-readable reason the pod isn't ready (the first waiting/terminated
51
+ * container reason, else a failed pod condition), '' when nothing useful is present — enriches
52
+ * an otherwise root-cause-less "terminated"/"not ready in time" error.
53
+ */
54
+ export declare function analyzePodStatus(pod: unknown): {
55
+ terminal: string | null;
56
+ detail: string;
57
+ };
58
+ /**
59
+ * A terminal, unrecoverable container start-up failure (a bad image / config / crash
60
+ * loop), formatted as `"<reason>: <message>"`, or null when the pod is just still coming
61
+ * up. Drives the transport's fail-fast path so a doomed pod surfaces its real reason
62
+ * (e.g. `ImagePullBackOff: Back-off pulling image "…"`) at once instead of after the
63
+ * 120s readiness timeout.
64
+ */
65
+ export declare function classifyPodStartupFailure(pod: unknown): string | null;
66
+ /**
67
+ * Best-effort short, human-readable detail of WHY a pod isn't ready — a waiting
68
+ * container's `reason: message`, else the pod's failed/unready condition message — for
69
+ * enriching an otherwise root-cause-less "terminated"/"not ready in time" error. Returns
70
+ * '' when nothing useful is present.
71
+ */
72
+ export declare function describePodStatus(pod: unknown): string;
44
73
  /**
45
74
  * Validate the apiserver URL at the write boundary. Unlike the manifest pool's
46
75
  * STRICT policy (no private hosts), a kube-apiserver is routinely a private IP or
@@ -1 +1 @@
1
- {"version":3,"file":"kubernetes.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/kubernetes/kubernetes.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBA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CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,SAAS,CAcpF;AASD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,sBAAsB,EAC9B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,qBAAqB,GAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA+BzB;AAUD,mDAAmD;AACnD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAEvD,uFAAuF;AACvF,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,CAU/D;AA+DD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAoC1F;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAErE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEtD;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAa3D"}
@@ -142,6 +142,127 @@ export function classifyPodReadiness(pod) {
142
142
  const ready = conditions.find((c) => c.type === 'Ready');
143
143
  return ready?.status === 'True' ? 'ready' : 'pending';
144
144
  }
145
+ /**
146
+ * Container `state.waiting.reason`s that will NOT self-heal within the readiness window:
147
+ * a bad/unpullable image, a malformed container config, a failed lifecycle hook, or a
148
+ * container that keeps crashing on boot. These are deterministic — re-driving the same pod
149
+ * just hangs the full window again — so the transport must FAIL FAST and NON-recoverably on
150
+ * them (a `dispatch` failure with the root cause), not poll until the generic timeout and
151
+ * then mis-tag it as a recoverable eviction.
152
+ *
153
+ * This is an explicit ALLOW-LIST of known-terminal kubelet reasons, NOT a deny-list of the
154
+ * transient ones, ON PURPOSE: the genuinely-transient set is just `ContainerCreating` /
155
+ * `PodInitializing`, but inverting (treat every other reason as terminal) would kill pods on
156
+ * any unrecognised or genuinely-transient reason a newer kubelet introduces. A reason we fail
157
+ * to enumerate here degrades GRACEFULLY — it falls through to the readiness DEADLINE, which
158
+ * still bounds the wait (it just costs the full window before failing, rather than failing at
159
+ * once) — whereas a false-terminal would mis-kill a pod that would have recovered. So keep
160
+ * this list current as kubelet adds reasons, but a miss is a latency cost, not a correctness
161
+ * bug.
162
+ */
163
+ const TERMINAL_WAITING_REASONS = new Set([
164
+ 'ImagePullBackOff',
165
+ 'ErrImagePull',
166
+ 'ErrImageNeverPull',
167
+ 'ErrInvalidImageName',
168
+ 'InvalidImageName',
169
+ 'ImageInspectError',
170
+ 'RegistryUnavailable',
171
+ 'CreateContainerConfigError',
172
+ 'CreateContainerError',
173
+ 'PreStartHookError',
174
+ 'PostStartHookError',
175
+ 'CrashLoopBackOff',
176
+ 'RunContainerError',
177
+ ]);
178
+ function statusOf(pod) {
179
+ return pod?.status;
180
+ }
181
+ function containerStatuses(status) {
182
+ return Array.isArray(status?.containerStatuses)
183
+ ? status.containerStatuses
184
+ : [];
185
+ }
186
+ function waitingOf(cs) {
187
+ const state = cs.state;
188
+ const waiting = state?.waiting;
189
+ if (!waiting)
190
+ return undefined;
191
+ return {
192
+ reason: typeof waiting.reason === 'string' ? waiting.reason : undefined,
193
+ message: typeof waiting.message === 'string' ? waiting.message : undefined,
194
+ };
195
+ }
196
+ /** Format a kubelet `reason`/`message` pair as `"<reason>: <message>"` (bare reason if no message). */
197
+ function joinReasonMessage(reason, message) {
198
+ return message ? `${reason}: ${message}` : reason;
199
+ }
200
+ /**
201
+ * One pass over a pod's container statuses + conditions, yielding BOTH readings the readiness
202
+ * loop needs so the pod JSON isn't walked (and the two views aren't kept in sync) twice:
203
+ * - `terminal`: the first container whose `state.waiting.reason` is a known-unrecoverable
204
+ * start-up failure (bad image / config / crash loop), formatted as `"<reason>: <message>"`,
205
+ * else null — drives the transport's fail-fast path.
206
+ * - `detail`: a short human-readable reason the pod isn't ready (the first waiting/terminated
207
+ * container reason, else a failed pod condition), '' when nothing useful is present — enriches
208
+ * an otherwise root-cause-less "terminated"/"not ready in time" error.
209
+ */
210
+ export function analyzePodStatus(pod) {
211
+ const status = statusOf(pod);
212
+ let terminal = null;
213
+ let detail = '';
214
+ for (const cs of containerStatuses(status)) {
215
+ const waiting = waitingOf(cs);
216
+ if (waiting?.reason) {
217
+ const formatted = joinReasonMessage(waiting.reason, waiting.message);
218
+ if (!detail)
219
+ detail = formatted;
220
+ if (!terminal && TERMINAL_WAITING_REASONS.has(waiting.reason))
221
+ terminal = formatted;
222
+ continue;
223
+ }
224
+ if (!detail) {
225
+ const terminated = cs.state
226
+ ?.terminated;
227
+ if (terminated && typeof terminated.reason === 'string') {
228
+ const msg = typeof terminated.message === 'string' ? terminated.message : undefined;
229
+ detail = joinReasonMessage(terminated.reason, msg);
230
+ }
231
+ }
232
+ }
233
+ if (!detail) {
234
+ const conditions = Array.isArray(status?.conditions)
235
+ ? status.conditions
236
+ : [];
237
+ const failing = conditions.find((c) => c.status === 'False' && typeof c.message === 'string' && c.message);
238
+ if (failing && typeof failing.message === 'string') {
239
+ detail =
240
+ typeof failing.reason === 'string'
241
+ ? `${failing.reason}: ${failing.message}`
242
+ : failing.message;
243
+ }
244
+ }
245
+ return { terminal, detail };
246
+ }
247
+ /**
248
+ * A terminal, unrecoverable container start-up failure (a bad image / config / crash
249
+ * loop), formatted as `"<reason>: <message>"`, or null when the pod is just still coming
250
+ * up. Drives the transport's fail-fast path so a doomed pod surfaces its real reason
251
+ * (e.g. `ImagePullBackOff: Back-off pulling image "…"`) at once instead of after the
252
+ * 120s readiness timeout.
253
+ */
254
+ export function classifyPodStartupFailure(pod) {
255
+ return analyzePodStatus(pod).terminal;
256
+ }
257
+ /**
258
+ * Best-effort short, human-readable detail of WHY a pod isn't ready — a waiting
259
+ * container's `reason: message`, else the pod's failed/unready condition message — for
260
+ * enriching an otherwise root-cause-less "terminated"/"not ready in time" error. Returns
261
+ * '' when nothing useful is present.
262
+ */
263
+ export function describePodStatus(pod) {
264
+ return analyzePodStatus(pod).detail;
265
+ }
145
266
  /**
146
267
  * Validate the apiserver URL at the write boundary. Unlike the manifest pool's
147
268
  * STRICT policy (no private hosts), a kube-apiserver is routinely a private IP or
@@ -1 +1 @@
1
- {"version":3,"file":"kubernetes.logic.js","sourceRoot":"","sources":["../../../src/modules/kubernetes/kubernetes.logic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,kCAAkC,EAAE,MAAM,wBAAwB,CAAA;AAE3E,2EAA2E;AAC3E,iFAAiF;AACjF,4EAA4E;AAC5E,wEAAwE;AAExE;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,kCAAkC,CAAA;AAEtE,+EAA+E;AAC/E,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAA;AAExC,+EAA+E;AAC/E,MAAM,UAAU,OAAO,CAAC,KAAa;IACnC,MAAM,SAAS,GAAG,KAAK;SACpB,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;IAC1B,oFAAoF;IACpF,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,KAAK,CAAA;IACnF,OAAO,UAAU,IAAI,EAAE,CAAA;AACzB,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU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CAAC,OAAO,EAAE;oBACzC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;QACvB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;AAC7B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CAAC,GAAY;IACpD,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAA;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAY;IAC5C,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,MAAM,CAAA;AACrC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,IAAI,GAAQ,CAAA;IACZ,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAA;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,qCAAqC,MAAM,EAAE,CAAC,CAAA;IAChE,CAAC;IACD,IAAI,GAAG,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;IAC7D,CAAC;IACD,IAAI,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAA;IAC1F,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cat-factory/integrations",
3
- "version": "0.32.0",
3
+ "version": "0.34.0",
4
4
  "description": "External-system integration domain logic for the Agent Architecture Board (GitHub, documents, tasks, environments, runners).",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,8 +25,8 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "ai": "^6.0.209",
28
- "@cat-factory/contracts": "0.48.0",
29
- "@cat-factory/kernel": "0.49.0"
28
+ "@cat-factory/contracts": "0.50.0",
29
+ "@cat-factory/kernel": "0.51.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "typescript": "7.0.1-rc",
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClaudeDesignProvider.d.ts","sourceRoot":"","sources":["../../../src/modules/documents/ClaudeDesignProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAA;AA8C5B,qBAAa,oBAAqB,YAAW,sBAAsB;IACjE,QAAQ,CAAC,IAAI,EAAG,eAAe,CAAS;IACxC,QAAQ,CAAC,UAAU;;;;;;;;;;;;;;;MAA2B;IAE9C,mBAAmB,CAAC,KAAK,EAAE,mBAAmB,GAAG,oBAAoB,CAMpE;IAED,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAErC;IAEK,aAAa,CACjB,WAAW,EAAE,mBAAmB,EAChC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,eAAe,CAAC,CAmB1B;IAED,0FAA0F;YAC5E,iBAAiB;IAoC/B,2FAA2F;YAC7E,SAAS;IA+BvB,yFAAyF;IACzF,OAAO,CAAC,UAAU;IAkBlB,OAAO,CAAC,OAAO;YAQD,GAAG;CAiBlB"}
@@ -1,163 +0,0 @@
1
- import { ValidationError, } from '@cat-factory/kernel';
2
- import { CLAUDE_DESIGN_API_HOST, CLAUDE_DESIGN_DESCRIPTOR, DS_MANIFEST_PATH, claudeDesignUrlFor, parseClaudeDesignRef, renderClaudeDesignProject, splitClaudeDesignExternalId, } from './claudeDesign.logic.js';
3
- import { DocumentHttpError, createHostPinnedFetch, readCappedText } from './http.js';
4
- // ClaudeDesignProvider: the document-source provider for Anthropic's Claude Design. It
5
- // authenticates with a **per-user** personal access token (the credential is stored
6
- // keyed by user id, not shared across the workspace — see the descriptor's
7
- // `credentialScope: 'user'`), reads a design-system project's files over the REST API,
8
- // and renders the component inventory + design tokens to the Markdown the planner +
9
- // `.cat-context/` materialisation consume. All Claude-Design-specific *pure* logic (ref
10
- // parsing, the host-pin guard, the HTML/manifest → Markdown normalizer) lives in
11
- // `claudeDesign.logic.ts`; this class is the thin `fetch` shell.
12
- //
13
- // PROVISIONAL API SHAPE: the endpoint paths/headers below target the per-user-PAT read
14
- // the product is moving toward (today the design-system read is claude.ai-login-bound).
15
- // The host is pinned; re-verify the exact endpoints against the current API when the
16
- // credentialed read ships — they are the intended shape, not a frozen contract. The
17
- // normalizer they feed is solid and fully unit-tested regardless.
18
- const API_BASE = `https://${CLAUDE_DESIGN_API_HOST}/v1`;
19
- const USER_AGENT = 'cat-factory';
20
- /** Hard cap on the bytes read off any response body, to protect the isolate. */
21
- const MAX_RESPONSE_BYTES = 5_000_000;
22
- /** Bound how many project files we pull for a whole-project import. */
23
- const MAX_PROJECT_FILES = 12;
24
- /**
25
- * `fetch` pinned to the Claude Design host, following redirects by hand so the SSRF host
26
- * guard runs against every hop (a 302 can't chase the PAT off-host). Shared transport.
27
- */
28
- const safeFetch = createHostPinnedFetch({ host: CLAUDE_DESIGN_API_HOST, label: 'Claude Design' });
29
- export class ClaudeDesignProvider {
30
- kind = 'claude-design';
31
- descriptor = CLAUDE_DESIGN_DESCRIPTOR;
32
- normalizeConnection(input) {
33
- const apiToken = input.apiToken?.trim();
34
- if (!apiToken) {
35
- throw new ValidationError('Claude Design requires a personal access token');
36
- }
37
- return { credentials: { apiToken }, label: 'Claude Design' };
38
- }
39
- parseRef(input) {
40
- return parseClaudeDesignRef(input);
41
- }
42
- async fetchDocument(credentials, externalId) {
43
- const { projectId, filePath } = splitClaudeDesignExternalId(externalId);
44
- if (!projectId) {
45
- throw new DocumentHttpError(400, `Claude Design ref is missing a project id: ${externalId}`);
46
- }
47
- const files = filePath
48
- ? [{ path: filePath, content: await this.fetchFile(credentials, projectId, filePath) }]
49
- : await this.fetchProjectFiles(credentials, projectId);
50
- const projectName = this.deriveName(projectId, filePath, files);
51
- const body = renderClaudeDesignProject(projectName, files);
52
- return {
53
- externalId,
54
- title: projectName,
55
- url: claudeDesignUrlFor(externalId),
56
- body,
57
- };
58
- }
59
- /** List a project's files, then fetch the manifest + a bounded slice of HTML previews. */
60
- async fetchProjectFiles(credentials, projectId) {
61
- const listed = await this.get(credentials, `/design/projects/${encodeURIComponent(projectId)}/files`);
62
- const paths = normalizePaths(listed);
63
- if (paths.length === 0) {
64
- throw new DocumentHttpError(404, `Claude Design project ${projectId} has no readable files`);
65
- }
66
- // The manifest is the authoritative index; then prefer component-preview HTML and any
67
- // stylesheet (for tokens), bounded so a huge project can't stall the import.
68
- const manifest = paths.filter((p) => p.endsWith(DS_MANIFEST_PATH));
69
- const styles = paths.filter((p) => /\.css$/i.test(p));
70
- const html = paths.filter((p) => /\.html?$/i.test(p));
71
- const chosen = [...manifest, ...styles, ...html].slice(0, MAX_PROJECT_FILES);
72
- const out = [];
73
- for (const path of chosen) {
74
- try {
75
- out.push({ path, content: await this.fetchFile(credentials, projectId, path) });
76
- }
77
- catch {
78
- // A single unreadable file shouldn't fail the whole import — skip it.
79
- }
80
- }
81
- if (out.length === 0) {
82
- throw new DocumentHttpError(502, `Claude Design project ${projectId} returned no file content`);
83
- }
84
- return out;
85
- }
86
- /** Fetch one file's textual content (raw, or unwrapped from a `{ content }` JSON body). */
87
- async fetchFile(credentials, projectId, path) {
88
- const url = `${API_BASE}/design/projects/${encodeURIComponent(projectId)}/files/${path
89
- .split('/')
90
- .map(encodeURIComponent)
91
- .join('/')}`;
92
- const res = await safeFetch(url, { method: 'GET', headers: this.headers(credentials) });
93
- if (!res.ok) {
94
- const text = await readCappedText(res, MAX_RESPONSE_BYTES, 'Claude Design').catch(() => '');
95
- throw new DocumentHttpError(res.status, `Claude Design GET ${url} → ${res.status}: ${text.slice(0, 300)}`);
96
- }
97
- const text = await readCappedText(res, MAX_RESPONSE_BYTES, 'Claude Design');
98
- // The files endpoint may return raw file bytes or a `{ content }` JSON envelope.
99
- const contentType = res.headers.get('content-type') ?? '';
100
- if (contentType.includes('application/json')) {
101
- try {
102
- const json = JSON.parse(text);
103
- if (typeof json.content === 'string')
104
- return json.content;
105
- }
106
- catch {
107
- // Not a JSON envelope after all — fall through and use the raw text.
108
- }
109
- }
110
- return text;
111
- }
112
- /** Name the document: the manifest's `name`, else the file path, else the project id. */
113
- deriveName(projectId, filePath, files) {
114
- const manifest = files.find((f) => f.path.endsWith(DS_MANIFEST_PATH));
115
- if (manifest) {
116
- try {
117
- const json = JSON.parse(manifest.content);
118
- if (typeof json.name === 'string' && json.name.trim())
119
- return json.name.trim();
120
- }
121
- catch {
122
- // ignore — fall through
123
- }
124
- }
125
- if (filePath)
126
- return `${projectId} — ${filePath}`;
127
- return projectId;
128
- }
129
- headers(credentials) {
130
- return {
131
- authorization: `Bearer ${credentials.apiToken ?? ''}`,
132
- accept: 'application/json',
133
- 'user-agent': USER_AGENT,
134
- };
135
- }
136
- async get(credentials, path) {
137
- const url = `${API_BASE}${path}`;
138
- const res = await safeFetch(url, { method: 'GET', headers: this.headers(credentials) });
139
- if (!res.ok) {
140
- const text = await readCappedText(res, MAX_RESPONSE_BYTES, 'Claude Design').catch(() => '');
141
- throw new DocumentHttpError(res.status, `Claude Design GET ${url} → ${res.status}: ${text.slice(0, 300)}`);
142
- }
143
- const text = await readCappedText(res, MAX_RESPONSE_BYTES, 'Claude Design');
144
- try {
145
- return JSON.parse(text);
146
- }
147
- catch {
148
- throw new DocumentHttpError(502, `Claude Design returned an unparseable body for ${path}`);
149
- }
150
- }
151
- }
152
- /** Flatten the file-list response into a clean string[] of paths. */
153
- function normalizePaths(listed) {
154
- const raw = listed.files ?? listed.paths ?? [];
155
- const out = [];
156
- for (const entry of raw) {
157
- const path = typeof entry === 'string' ? entry : entry?.path;
158
- if (typeof path === 'string' && path.trim())
159
- out.push(path.trim());
160
- }
161
- return out;
162
- }
163
- //# sourceMappingURL=ClaudeDesignProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClaudeDesignProvider.js","sourceRoot":"","sources":["../../../src/modules/documents/ClaudeDesignProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAKhB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,2BAA2B,GAE5B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEpF,uFAAuF;AACvF,oFAAoF;AACpF,2EAA2E;AAC3E,uFAAuF;AACvF,oFAAoF;AACpF,wFAAwF;AACxF,iFAAiF;AACjF,iEAAiE;AACjE,EAAE;AACF,uFAAuF;AACvF,wFAAwF;AACxF,qFAAqF;AACrF,oFAAoF;AACpF,kEAAkE;AAElE,MAAM,QAAQ,GAAG,WAAW,sBAAsB,KAAK,CAAA;AACvD,MAAM,UAAU,GAAG,aAAa,CAAA;AAChC,gFAAgF;AAChF,MAAM,kBAAkB,GAAG,SAAS,CAAA;AACpC,uEAAuE;AACvE,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAE5B;;;GAGG;AACH,MAAM,SAAS,GAAG,qBAAqB,CAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAA;AAOjG,MAAM,OAAO,oBAAoB;IACtB,IAAI,GAAG,eAAwB,CAAA;IAC/B,UAAU,GAAG,wBAAwB,CAAA;IAE9C,mBAAmB,CAAC,KAA0B;QAC5C,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAA;QACvC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,eAAe,CAAC,gDAAgD,CAAC,CAAA;QAC7E,CAAC;QACD,OAAO,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,EAAE,KAAK,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C,CAAA;YAC3F,MAAM,IAAI,iBAAiB,CACzB,GAAG,CAAC,MAAM,EACV,qBAAqB,GAAG,MAAM,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAClE,CAAA;QACH,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,GAAG,EAAE,kBAAkB,EAAE,eAAe,CAAC,CAAA;QAC3E,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAA;QAC9B,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,iBAAiB,CAAC,GAAG,EAAE,kDAAkD,IAAI,EAAE,CAAC,CAAA;QAC5F,CAAC;IACH,CAAC;CACF;AAED,qEAAqE;AACrE,SAAS,cAAc,CAAC,MAAwB;IAC9C,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE,CAAA;IAC9C,MAAM,GAAG,GAAa,EAAE,CAAA;IACxB,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC;QACxB,MAAM,IAAI,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAA;QAC5D,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE;YAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;IACpE,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
@@ -1,88 +0,0 @@
1
- import type { DocumentSourceDescriptor } from '@cat-factory/kernel';
2
- /**
3
- * Claude Design's programmatic-read host. PROVISIONAL: today the design-system read is
4
- * bound to a claude.ai login; this provider targets the per-user-PAT API shape the
5
- * product is moving toward. The host is pinned (see {@link assertSafeClaudeDesignUrl})
6
- * and the exact endpoints in `ClaudeDesignProvider` should be re-verified against the
7
- * current API when the credentialed read ships — treat them as the intended shape, not a
8
- * frozen contract.
9
- */
10
- export declare const CLAUDE_DESIGN_API_HOST = "api.claude.com";
11
- /** Where a human opens the project (the canonical URL stored on imported documents). */
12
- export declare const CLAUDE_DESIGN_APP_HOST = "claude.ai";
13
- /** What the connect UI renders, and which credentials the provider needs. */
14
- export declare const CLAUDE_DESIGN_DESCRIPTOR: DocumentSourceDescriptor;
15
- /**
16
- * The Claude Design read host is fixed, so any request/redirect must stay on it over
17
- * https. A redirect off-host (e.g. to a link-local metadata address) is rejected as an
18
- * SSRF attempt. Delegates to the shared host-pin guard; throws a plain `Error` the
19
- * provider maps to a `DocumentHttpError`. Kept pure so it is unit-testable without a
20
- * network.
21
- */
22
- export declare function assertSafeClaudeDesignUrl(url: string): void;
23
- /**
24
- * Resolve a Claude Design reference from raw user input into the stable composite
25
- * external id this provider stores: `"<projectId>"` for a whole project, or
26
- * `"<projectId>::<filePath>"` for a single component/file. Accepts a
27
- * `claude.ai/design/<projectId>` URL (optionally `…/files/<path>` or `?file=<path>`), a
28
- * bare project id, or the composite form. Returns null when no project id is found.
29
- *
30
- * Deterministic (same input → same external id), which the
31
- * `(workspace, source, externalId)` document key relies on for de-duplication.
32
- */
33
- export declare function parseClaudeDesignRef(input: string): string | null;
34
- /** Split a composite external id back into its project id and optional file path. */
35
- export declare function splitClaudeDesignExternalId(externalId: string): {
36
- projectId: string;
37
- filePath?: string;
38
- };
39
- /** Build the canonical web URL stored on the imported document (matched by `getByUrl`). */
40
- export declare function claudeDesignUrlFor(externalId: string): string;
41
- /** A single component card, as recorded by Claude Design's `@dsCard` markers/manifest. */
42
- export interface DsCard {
43
- name?: string;
44
- group?: string;
45
- subtitle?: string;
46
- path?: string;
47
- }
48
- /** One fetched project file (path + raw textual content). */
49
- export interface ClaudeDesignFile {
50
- path: string;
51
- content: string;
52
- }
53
- /** The manifest file name Claude Design compiles its card index into. */
54
- export declare const DS_MANIFEST_PATH = "_ds_manifest.json";
55
- /**
56
- * Parse a `_ds_manifest.json` payload (a bare array of cards, or `{ cards: [...] }`)
57
- * into a lenient {@link DsCard} list. Unknown shapes yield `[]` so the caller falls
58
- * back to per-file HTML extraction.
59
- */
60
- export declare function parseDsManifest(json: unknown): DsCard[];
61
- /**
62
- * Read the first-line `<!-- @dsCard group="…" name="…" subtitle="…" -->` marker Claude
63
- * Design writes at the top of each component-preview HTML. Returns null when absent.
64
- */
65
- export declare function parseDsCardComment(html: string): DsCard | null;
66
- /**
67
- * Extract CSS custom properties (`--token: value`) from a stylesheet/HTML blob as design
68
- * tokens, deduped (last value wins) and sorted. These are Claude Design's design tokens —
69
- * the analogue of Figma variables.
70
- */
71
- export declare function extractCssTokens(content: string): string[];
72
- /** Strip `<script>`/`<style>` blocks and all tags, returning collapsed visible text. */
73
- export declare function htmlToText(html: string): string;
74
- /** Render a grouped component inventory from a card list (`### <group>` → `- <name>`). */
75
- export declare function dsCardsToMarkdown(cards: DsCard[]): string;
76
- /**
77
- * Normalize a whole Claude Design project's fetched files into the lightweight Markdown a
78
- * frontend agent consumes. Strategy:
79
- * 1. If a `_ds_manifest.json` is present, it is the authoritative component index →
80
- * `### Components` grouped inventory.
81
- * 2. Otherwise, recover the inventory from each preview HTML's `@dsCard` marker.
82
- * 3. Design tokens are unioned from the CSS custom properties across all files.
83
- * 4. A bounded slice of visible text gives the agent a sense of the content.
84
- *
85
- * `projectName` titles the document. Pure: no network, fully unit-testable.
86
- */
87
- export declare function renderClaudeDesignProject(projectName: string, files: ClaudeDesignFile[]): string;
88
- //# sourceMappingURL=claudeDesign.logic.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claudeDesign.logic.d.ts","sourceRoot":"","sources":["../../../src/modules/documents/claudeDesign.logic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAmBnE;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,mBAAmB,CAAA;AAEtD,wFAAwF;AAC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