@mulmoclaude/collection-plugin 0.5.7 → 0.5.9

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 (106) hide show
  1. package/dist/style.css +3 -250
  2. package/dist/vue/collectionViewMode.d.ts +1 -1
  3. package/dist/vue/collectionViewMode.d.ts.map +1 -1
  4. package/dist/vue/components/CollectionCalendarView.vue.d.ts +1 -2
  5. package/dist/vue/components/CollectionCalendarView.vue.d.ts.map +1 -1
  6. package/dist/vue/components/CollectionCustomView.vue.d.ts +1 -1
  7. package/dist/vue/components/CollectionCustomView.vue.d.ts.map +1 -1
  8. package/dist/vue/components/CollectionDayView.vue.d.ts +1 -2
  9. package/dist/vue/components/CollectionDayView.vue.d.ts.map +1 -1
  10. package/dist/vue/components/CollectionEmbedView.vue.d.ts +1 -1
  11. package/dist/vue/components/CollectionEmbedView.vue.d.ts.map +1 -1
  12. package/dist/vue/components/CollectionKanbanView.vue.d.ts +1 -2
  13. package/dist/vue/components/CollectionKanbanView.vue.d.ts.map +1 -1
  14. package/dist/vue/components/CollectionRecordPanel.vue.d.ts +5 -6
  15. package/dist/vue/components/CollectionRecordPanel.vue.d.ts.map +1 -1
  16. package/dist/vue/components/CollectionView.vue.d.ts.map +1 -1
  17. package/dist/vue/components/CollectionViewConfigModal.vue.d.ts +1 -1
  18. package/dist/vue/components/CollectionViewConfigModal.vue.d.ts.map +1 -1
  19. package/dist/vue/index.d.ts +1 -1
  20. package/dist/vue/index.d.ts.map +1 -1
  21. package/dist/vue/uiContext.d.ts +1 -2
  22. package/dist/vue/uiContext.d.ts.map +1 -1
  23. package/dist/vue/useCollectionRendering.d.ts +1 -2
  24. package/dist/vue/useCollectionRendering.d.ts.map +1 -1
  25. package/dist/vue.cjs +86 -66
  26. package/dist/vue.cjs.map +1 -1
  27. package/dist/vue.js +3 -4
  28. package/dist/vue.js.map +1 -1
  29. package/package.json +8 -18
  30. package/dist/chunk-CKQMccvm.cjs +0 -28
  31. package/dist/core/actionVisible.d.ts +0 -35
  32. package/dist/core/actionVisible.d.ts.map +0 -1
  33. package/dist/core/calendarGrid.d.ts +0 -121
  34. package/dist/core/calendarGrid.d.ts.map +0 -1
  35. package/dist/core/deriveAll.d.ts +0 -39
  36. package/dist/core/deriveAll.d.ts.map +0 -1
  37. package/dist/core/derivedFormula.d.ts +0 -19
  38. package/dist/core/derivedFormula.d.ts.map +0 -1
  39. package/dist/core/draft.d.ts +0 -19
  40. package/dist/core/draft.d.ts.map +0 -1
  41. package/dist/core/enumColors.d.ts +0 -34
  42. package/dist/core/enumColors.d.ts.map +0 -1
  43. package/dist/core/errorMessage.d.ts +0 -5
  44. package/dist/core/errorMessage.d.ts.map +0 -1
  45. package/dist/core/itemLabel.d.ts +0 -13
  46. package/dist/core/itemLabel.d.ts.map +0 -1
  47. package/dist/core/presentCollection.d.ts +0 -14
  48. package/dist/core/presentCollection.d.ts.map +0 -1
  49. package/dist/core/promptSafety.d.ts +0 -2
  50. package/dist/core/promptSafety.d.ts.map +0 -1
  51. package/dist/core/schema.d.ts +0 -356
  52. package/dist/core/schema.d.ts.map +0 -1
  53. package/dist/core/shortHexId.d.ts +0 -9
  54. package/dist/core/shortHexId.d.ts.map +0 -1
  55. package/dist/core/sortItems.d.ts +0 -30
  56. package/dist/core/sortItems.d.ts.map +0 -1
  57. package/dist/core/uiTypes.d.ts +0 -107
  58. package/dist/core/uiTypes.d.ts.map +0 -1
  59. package/dist/deriveAll-BHcs1erT.js +0 -342
  60. package/dist/deriveAll-BHcs1erT.js.map +0 -1
  61. package/dist/deriveAll-BJ0Lvm1Q.cjs +0 -359
  62. package/dist/deriveAll-BJ0Lvm1Q.cjs.map +0 -1
  63. package/dist/index.cjs +0 -57
  64. package/dist/index.d.ts +0 -15
  65. package/dist/index.d.ts.map +0 -1
  66. package/dist/index.js +0 -4
  67. package/dist/promptSafety-B0pPJkfQ.cjs +0 -1020
  68. package/dist/promptSafety-B0pPJkfQ.cjs.map +0 -1
  69. package/dist/promptSafety-DIQ2yDca.js +0 -739
  70. package/dist/promptSafety-DIQ2yDca.js.map +0 -1
  71. package/dist/schema-5P5ZJPrY.cjs +0 -42
  72. package/dist/schema-5P5ZJPrY.cjs.map +0 -1
  73. package/dist/schema-BcnitlL8.js +0 -25
  74. package/dist/schema-BcnitlL8.js.map +0 -1
  75. package/dist/server/atomic.d.ts +0 -2
  76. package/dist/server/atomic.d.ts.map +0 -1
  77. package/dist/server/delete.d.ts +0 -39
  78. package/dist/server/delete.d.ts.map +0 -1
  79. package/dist/server/derive.d.ts +0 -9
  80. package/dist/server/derive.d.ts.map +0 -1
  81. package/dist/server/discoveredCollection.d.ts +0 -19
  82. package/dist/server/discoveredCollection.d.ts.map +0 -1
  83. package/dist/server/discovery.d.ts +0 -228
  84. package/dist/server/discovery.d.ts.map +0 -1
  85. package/dist/server/host.d.ts +0 -78
  86. package/dist/server/host.d.ts.map +0 -1
  87. package/dist/server/index.d.ts +0 -12
  88. package/dist/server/index.d.ts.map +0 -1
  89. package/dist/server/io.d.ts +0 -115
  90. package/dist/server/io.d.ts.map +0 -1
  91. package/dist/server/paths.d.ts +0 -53
  92. package/dist/server/paths.d.ts.map +0 -1
  93. package/dist/server/spawn.d.ts +0 -56
  94. package/dist/server/spawn.d.ts.map +0 -1
  95. package/dist/server/templatePath.d.ts +0 -26
  96. package/dist/server/templatePath.d.ts.map +0 -1
  97. package/dist/server/util.d.ts +0 -4
  98. package/dist/server/util.d.ts.map +0 -1
  99. package/dist/server/validate.d.ts +0 -20
  100. package/dist/server/validate.d.ts.map +0 -1
  101. package/dist/server/views.d.ts +0 -21
  102. package/dist/server/views.d.ts.map +0 -1
  103. package/dist/server.cjs +0 -1759
  104. package/dist/server.cjs.map +0 -1
  105. package/dist/server.js +0 -1709
  106. package/dist/server.js.map +0 -1
@@ -1,228 +0,0 @@
1
- import { z } from "zod";
2
- import type { LoadedCollection } from "./discoveredCollection";
3
- import type { CollectionDetail, CollectionSchema, CollectionSource, CollectionSummary } from "../core/schema";
4
- export declare const CollectionSchemaZ: z.ZodObject<{
5
- title: z.ZodString;
6
- icon: z.ZodString;
7
- dataPath: z.ZodString;
8
- primaryKey: z.ZodString;
9
- singleton: z.ZodOptional<z.ZodString>;
10
- fields: z.ZodRecord<z.ZodString, z.ZodObject<{
11
- type: z.ZodEnum<{
12
- string: "string";
13
- number: "number";
14
- boolean: "boolean";
15
- text: "text";
16
- email: "email";
17
- date: "date";
18
- datetime: "datetime";
19
- markdown: "markdown";
20
- ref: "ref";
21
- money: "money";
22
- enum: "enum";
23
- table: "table";
24
- derived: "derived";
25
- embed: "embed";
26
- image: "image";
27
- file: "file";
28
- toggle: "toggle";
29
- }>;
30
- label: z.ZodString;
31
- primary: z.ZodOptional<z.ZodBoolean>;
32
- required: z.ZodOptional<z.ZodBoolean>;
33
- to: z.ZodOptional<z.ZodString>;
34
- id: z.ZodOptional<z.ZodString>;
35
- currency: z.ZodOptional<z.ZodString>;
36
- currencyField: z.ZodOptional<z.ZodString>;
37
- values: z.ZodOptional<z.ZodArray<z.ZodString>>;
38
- field: z.ZodOptional<z.ZodString>;
39
- onValue: z.ZodOptional<z.ZodString>;
40
- offValue: z.ZodOptional<z.ZodString>;
41
- of: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
42
- type: z.ZodEnum<{
43
- string: "string";
44
- number: "number";
45
- boolean: "boolean";
46
- text: "text";
47
- email: "email";
48
- date: "date";
49
- datetime: "datetime";
50
- markdown: "markdown";
51
- ref: "ref";
52
- money: "money";
53
- enum: "enum";
54
- }>;
55
- label: z.ZodString;
56
- required: z.ZodOptional<z.ZodBoolean>;
57
- to: z.ZodOptional<z.ZodString>;
58
- currency: z.ZodOptional<z.ZodString>;
59
- currencyField: z.ZodOptional<z.ZodString>;
60
- values: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
- }, z.core.$strip>>>;
62
- formula: z.ZodOptional<z.ZodString>;
63
- display: z.ZodOptional<z.ZodEnum<{
64
- string: "string";
65
- number: "number";
66
- date: "date";
67
- money: "money";
68
- }>>;
69
- when: z.ZodOptional<z.ZodObject<{
70
- field: z.ZodString;
71
- in: z.ZodArray<z.ZodString>;
72
- }, z.core.$strip>>;
73
- }, z.core.$strip>>;
74
- actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
75
- id: z.ZodString;
76
- label: z.ZodString;
77
- icon: z.ZodOptional<z.ZodString>;
78
- kind: z.ZodEnum<{
79
- chat: "chat";
80
- }>;
81
- role: z.ZodString;
82
- template: z.ZodString;
83
- when: z.ZodOptional<z.ZodObject<{
84
- field: z.ZodString;
85
- in: z.ZodArray<z.ZodString>;
86
- }, z.core.$strip>>;
87
- }, z.core.$strip>>>;
88
- collectionActions: z.ZodOptional<z.ZodArray<z.ZodObject<{
89
- id: z.ZodString;
90
- label: z.ZodString;
91
- icon: z.ZodOptional<z.ZodString>;
92
- kind: z.ZodEnum<{
93
- chat: "chat";
94
- }>;
95
- role: z.ZodString;
96
- template: z.ZodString;
97
- when: z.ZodOptional<z.ZodObject<{
98
- field: z.ZodString;
99
- in: z.ZodArray<z.ZodString>;
100
- }, z.core.$strip>>;
101
- }, z.core.$strip>>>;
102
- completionField: z.ZodOptional<z.ZodString>;
103
- completionDoneValues: z.ZodOptional<z.ZodArray<z.ZodString>>;
104
- displayField: z.ZodOptional<z.ZodString>;
105
- triggerField: z.ZodOptional<z.ZodString>;
106
- triggerLeadDays: z.ZodOptional<z.ZodNumber>;
107
- spawn: z.ZodOptional<z.ZodObject<{
108
- when: z.ZodOptional<z.ZodObject<{
109
- field: z.ZodString;
110
- in: z.ZodArray<z.ZodString>;
111
- }, z.core.$strip>>;
112
- every: z.ZodUnion<readonly [z.ZodObject<{
113
- unit: z.ZodEnum<{
114
- day: "day";
115
- week: "week";
116
- month: "month";
117
- year: "year";
118
- }>;
119
- interval: z.ZodNumber;
120
- dayOfMonth: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"last">]>>;
121
- }, z.core.$strict>, z.ZodObject<{
122
- fromField: z.ZodString;
123
- map: z.ZodRecord<z.ZodString, z.ZodObject<{
124
- unit: z.ZodEnum<{
125
- day: "day";
126
- week: "week";
127
- month: "month";
128
- year: "year";
129
- }>;
130
- interval: z.ZodNumber;
131
- dayOfMonth: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"last">]>>;
132
- }, z.core.$strict>>;
133
- }, z.core.$strict>]>;
134
- carry: z.ZodOptional<z.ZodArray<z.ZodString>>;
135
- set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
136
- }, z.core.$strip>>;
137
- calendarField: z.ZodOptional<z.ZodString>;
138
- calendarEndField: z.ZodOptional<z.ZodString>;
139
- calendarTimeField: z.ZodOptional<z.ZodString>;
140
- kanbanField: z.ZodOptional<z.ZodString>;
141
- views: z.ZodOptional<z.ZodArray<z.ZodObject<{
142
- id: z.ZodString;
143
- label: z.ZodString;
144
- icon: z.ZodOptional<z.ZodString>;
145
- file: z.ZodString;
146
- capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
147
- read: "read";
148
- write: "write";
149
- }>>>;
150
- }, z.core.$strip>>>;
151
- notifyWhen: z.ZodOptional<z.ZodObject<{
152
- field: z.ZodString;
153
- in: z.ZodArray<z.ZodString>;
154
- }, z.core.$strip>>;
155
- ingest: z.ZodOptional<z.ZodObject<{
156
- kind: z.ZodEnum<{
157
- rss: "rss";
158
- atom: "atom";
159
- "http-json": "http-json";
160
- }>;
161
- url: z.ZodString;
162
- schedule: z.ZodEnum<{
163
- hourly: "hourly";
164
- daily: "daily";
165
- weekly: "weekly";
166
- "on-demand": "on-demand";
167
- }>;
168
- itemsAt: z.ZodOptional<z.ZodString>;
169
- map: z.ZodRecord<z.ZodString, z.ZodString>;
170
- idFrom: z.ZodOptional<z.ZodString>;
171
- maxItems: z.ZodOptional<z.ZodNumber>;
172
- }, z.core.$strip>>;
173
- }, z.core.$strip>;
174
- /** Result of the post-Zod acceptance gates: the resolved record dir on
175
- * success, or a one-line reason discovery would skip the schema. */
176
- export type SchemaAcceptance = {
177
- ok: true;
178
- dataDir: string;
179
- } | {
180
- ok: false;
181
- reason: string;
182
- };
183
- /** The acceptance gates discovery applies AFTER `CollectionSchemaZ` parses,
184
- * before a schema becomes a live collection:
185
- *
186
- * - the `primaryKey` must be a declared field flagged `primary: true` —
187
- * without the flag CollectionView renders the field editable, and a
188
- * rename is silently pinned back to the URL itemId on save, so the user's
189
- * edit is dropped with no error;
190
- * - a `feed` schema must declare an `ingest` block (else it's a dead,
191
- * non-refreshable card);
192
- * - `dataPath` must resolve INSIDE the workspace.
193
- *
194
- * Exported so `manageCollection`'s `putSchema` can run the SAME gates before
195
- * it reports success — a schema that passes `CollectionSchemaZ` but fails one
196
- * of these would otherwise write cleanly yet be skipped on the next discovery,
197
- * hiding the collection (the exact failure that tool exists to prevent). */
198
- export declare function acceptParsedSchema(schema: CollectionSchema, opts: {
199
- source: CollectionSource;
200
- workspaceRoot: string;
201
- }): SchemaAcceptance;
202
- export interface DiscoveryOptions {
203
- /** Override the workspace root for project-scope skill discovery.
204
- * Default: the live `workspacePath`. Tests point this at a
205
- * `mkdtempSync` tree so they don't touch the user's real
206
- * `~/mulmoclaude/`. Mirrors the pattern in
207
- * `server/workspace/skills/catalog.ts#CatalogOptions`. */
208
- workspaceRoot?: string;
209
- /** Override `~/.claude/skills/` for tests. Production callers
210
- * leave this unset. Without an override, even a test-scoped
211
- * workspaceRoot still scans the real user home — which can leak
212
- * unrelated skills into the result. */
213
- userSkillsDir?: string;
214
- }
215
- /** Discover every schema-driven collection available to this
216
- * workspace. Project-scope collections override user-scope on slug
217
- * collision. The `workspaceRoot` override also flows into each
218
- * collection's dataDir resolution so a tmpdir-scoped test gets
219
- * dataDirs under the same tmpdir (Codex P1 review on PR #1489 —
220
- * previously dataDir was always rooted at the live workspacePath
221
- * regardless of override). */
222
- export declare function discoverCollections(opts?: DiscoveryOptions): Promise<LoadedCollection[]>;
223
- /** Load one collection by slug. Returns null if the slug is invalid,
224
- * no matching skill exists, or the schema is malformed. */
225
- export declare function loadCollection(slug: string, opts?: DiscoveryOptions): Promise<LoadedCollection | null>;
226
- export declare function toSummary(collection: LoadedCollection): CollectionSummary;
227
- export declare function toDetail(collection: LoadedCollection): CollectionDetail;
228
- //# sourceMappingURL=discovery.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/server/discovery.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAA8B,gBAAgB,EAAE,gBAAgB,EAAwB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AA+YhK,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmR1B,CAAC;AAmBL;qEACqE;AACrE,MAAM,MAAM,gBAAgB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7F;;;;;;;;;;;;;;6EAc6E;AAC7E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,gBAAgB,CAQxI;AA+ED,MAAM,WAAW,gBAAgB;IAC/B;;;;+DAI2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;4CAGwC;IACxC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;+BAM+B;AAC/B,wBAAsB,mBAAmB,CAAC,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAgBlG;AAED;4DAC4D;AAC5D,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAchH;AAED,wBAAgB,SAAS,CAAC,UAAU,EAAE,gBAAgB,GAAG,iBAAiB,CAEzE;AAED,wBAAgB,QAAQ,CAAC,UAAU,EAAE,gBAAgB,GAAG,gBAAgB,CAEvE"}
@@ -1,78 +0,0 @@
1
- /** Logger shape the engine logs through — matches the host `Logger`
2
- * (prefix, message, optional structured data). */
3
- export interface CollectionLogger {
4
- error: (prefix: string, message: string, data?: Record<string, unknown>) => void;
5
- warn: (prefix: string, message: string, data?: Record<string, unknown>) => void;
6
- info: (prefix: string, message: string, data?: Record<string, unknown>) => void;
7
- debug: (prefix: string, message: string, data?: Record<string, unknown>) => void;
8
- }
9
- export interface CollectionHost {
10
- /** Absolute path to the host workspace root (e.g. `~/mulmoclaude`). The
11
- * default root for every path/containment check that isn't given an
12
- * explicit override. */
13
- workspaceRoot: string;
14
- /** Host logger; the engine logs under the `"collections"` prefix. */
15
- log: CollectionLogger;
16
- /** Host workspace layout — supplied as the host's own path helpers so the
17
- * package owns no layout literals and works against a test/alt root. */
18
- paths: {
19
- /** Absolute user-scope skills dir (host-specific, e.g. `~/.claude/skills`). */
20
- userSkillsDir: string;
21
- /** Absolute project-scope skills dir for a workspace (`<root>/.claude/skills`). */
22
- projectSkillsDir: (workspaceRoot: string) => string;
23
- /** Absolute feeds-registry root for a workspace (`<root>/data/feeds`). */
24
- feedsRoot: (workspaceRoot: string) => string;
25
- /** Absolute project-skills *staging* dir for a workspace (`<root>/data/skills`). */
26
- skillsStagingDir: (workspaceRoot: string) => string;
27
- /** Workspace-relative archive dir (a removed collection's files move here). */
28
- archiveDir: string;
29
- };
30
- /** True for a preset-skill slug (host-owned naming convention). */
31
- isPresetSlug: (slug: string) => boolean;
32
- }
33
- /** A collection's records changed on disk. Carries the `slug` so the host can
34
- * publish on a per-collection channel; `ids` lists the affected record ids
35
- * when known (a consumer may ignore them and refetch the whole collection),
36
- * and `op` is advisory. Deliberately carries NO record bodies — this is a
37
- * "refetch" ping, not a data feed, so it stays cheap and leaks nothing when a
38
- * host relays it into an opaque-origin custom-view iframe. */
39
- export interface CollectionChangePayload {
40
- slug: string;
41
- ids?: string[];
42
- op?: "upsert" | "delete";
43
- }
44
- type CollectionChangePublisher = (payload: CollectionChangePayload) => void;
45
- /** Wire the engine to a host. Call once at server startup, before any
46
- * collection storage operation. Re-binding to a *different* host throws —
47
- * silently redirecting later filesystem operations to another workspace
48
- * would be a bug, not a feature. Re-calling with the same host is a no-op. */
49
- export declare function configureCollectionHost(host: CollectionHost): void;
50
- /** Wire a publisher that broadcasts record-change events; the host bridges it
51
- * to its pubsub. Kept SEPARATE from `configureCollectionHost` because the
52
- * host's pubsub instance isn't ready at host-binding time (the binding is set
53
- * at the top of server startup, the pubsub later). Optional: left unset, every
54
- * write is silent — the default for tests and for a host that doesn't want
55
- * live view updates. Pass `null` to detach (test teardown). */
56
- export declare function setCollectionChangePublisher(publish: CollectionChangePublisher | null): void;
57
- /** Broadcast a record-change event if a publisher is wired (no-op otherwise).
58
- * Called from the write path (`writeItem`/`deleteItem`). The wired publisher is
59
- * expected to be fire-and-forget (it wraps its own pubsub call in try/catch),
60
- * so this stays a thin pass-through and never throws into the write. */
61
- export declare function publishCollectionChange(payload: CollectionChangePayload): void;
62
- /** The configured workspace root. Throws if the host never configured one. */
63
- export declare function getWorkspaceRoot(): string;
64
- export declare function userSkillsDir(): string;
65
- export declare function projectSkillsDir(workspaceRoot: string): string;
66
- export declare function feedsRoot(workspaceRoot: string): string;
67
- export declare function skillsStagingDir(workspaceRoot: string): string;
68
- export declare function archiveDir(): string;
69
- export declare function isPresetSlug(slug: string): boolean;
70
- /** Logger proxy so engine modules can `import { log }` and use it exactly like
71
- * the host logger — each call forwards to the live host binding. Logging is
72
- * non-critical, so calls before the host configures a binding (e.g. unit tests
73
- * that exercise pure logic) are dropped rather than throwing — unlike
74
- * `getWorkspaceRoot()`, which fails loudly because the engine cannot operate
75
- * without a workspace root. */
76
- export declare const log: CollectionLogger;
77
- export {};
78
- //# sourceMappingURL=host.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/server/host.ts"],"names":[],"mappings":"AAUA;mDACmD;AACnD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACjF,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAChF,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAChF,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAClF;AAED,MAAM,WAAW,cAAc;IAC7B;;6BAEyB;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,GAAG,EAAE,gBAAgB,CAAC;IACtB;6EACyE;IACzE,KAAK,EAAE;QACL,+EAA+E;QAC/E,aAAa,EAAE,MAAM,CAAC;QACtB,mFAAmF;QACnF,gBAAgB,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;QACpD,0EAA0E;QAC1E,SAAS,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;QAC7C,oFAAoF;QACpF,gBAAgB,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;QACpD,+EAA+E;QAC/E,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,mEAAmE;IACnE,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACzC;AAED;;;;;+DAK+D;AAC/D,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,EAAE,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC1B;AAED,KAAK,yBAAyB,GAAG,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,CAAC;AAK5E;;;+EAG+E;AAC/E,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAKlE;AAED;;;;;gEAKgE;AAChE,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,yBAAyB,GAAG,IAAI,GAAG,IAAI,CAE5F;AAED;;;yEAGyE;AACzE,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,uBAAuB,GAAG,IAAI,CAE9E;AASD,8EAA8E;AAC9E,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAKD,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AACD,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE9D;AACD,wBAAgB,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEvD;AACD,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE9D;AACD,wBAAgB,UAAU,IAAI,MAAM,CAEnC;AACD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;;;gCAKgC;AAChC,eAAO,MAAM,GAAG,EAAE,gBAKjB,CAAC"}
@@ -1,12 +0,0 @@
1
- export { configureCollectionHost, getWorkspaceRoot, log, setCollectionChangePublisher, publishCollectionChange, type CollectionHost, type CollectionLogger, type CollectionChangePayload, } from "./host";
2
- export type { LoadedCollection } from "./discoveredCollection";
3
- export * from "./paths";
4
- export * from "./templatePath";
5
- export * from "./io";
6
- export * from "./validate";
7
- export * from "./discovery";
8
- export * from "./derive";
9
- export * from "./spawn";
10
- export * from "./delete";
11
- export * from "./views";
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,GAAG,EACH,4BAA4B,EAC5B,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,GAC7B,MAAM,QAAQ,CAAC;AAChB,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,MAAM,CAAC;AACrB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
@@ -1,115 +0,0 @@
1
- import type { CollectionItem, CollectionSchema } from "../core/schema";
2
- import type { LoadedCollection } from "./discoveredCollection";
3
- export interface IoOptions {
4
- /** Override the workspace root for containment checks. Default:
5
- * the live `workspacePath`. Tests point this at a `mkdtempSync`
6
- * tree so the realpath-based escape detection can be exercised
7
- * without touching `~/mulmoclaude/`. Same pattern as
8
- * `server/workspace/skills/catalog.ts#CatalogOptions`. */
9
- workspaceRoot?: string;
10
- /** Collection slug this write/delete belongs to. When provided, a
11
- * successful write/delete publishes a record-change event (see
12
- * `publishCollectionChange`) so live views refetch. `writeItem` has no
13
- * slug of its own (it's keyed by `dataDir`), so callers thread it through;
14
- * omitting it just means no event is published (internal / test writes). */
15
- slug?: string;
16
- }
17
- /** Read every record under `dataDir`. Returns [] if the dir doesn't
18
- * exist yet (legitimate first-use state). Malformed JSON files and
19
- * symlinked records are skipped (the latter is a file-disclosure
20
- * defense — see `isRegularFile`). Re-validates the realpath
21
- * containment to defend against a symlinked data dir appearing
22
- * between discovery and use. */
23
- export declare function listItems(dataDir: string, opts?: IoOptions): Promise<CollectionItem[]>;
24
- /** Read one record by id. Returns null when the file is missing,
25
- * when the resolved path escapes the workspace via a symlink, or
26
- * when the record file itself is a symlink (file-disclosure
27
- * defense — see `isRegularFile`). */
28
- export declare function readItem(dataDir: string, itemId: string, opts?: IoOptions): Promise<CollectionItem | null>;
29
- export interface WriteItemOptions extends IoOptions {
30
- /** When true (POST/create), refuse to overwrite an existing file
31
- * and return `kind: "conflict"`. Update flow (PUT) leaves it false. */
32
- refuseOverwrite?: boolean;
33
- }
34
- export type WriteItemResult = {
35
- kind: "ok";
36
- itemId: string;
37
- item: CollectionItem;
38
- } | {
39
- kind: "invalid-id";
40
- itemId: string;
41
- } | {
42
- kind: "conflict";
43
- itemId: string;
44
- } | {
45
- kind: "path-escape";
46
- itemId: string;
47
- };
48
- /** Write a record. Ensures the directory exists, validates the id,
49
- * re-checks symlink containment after mkdir, and writes atomically.
50
- *
51
- * Create path (`refuseOverwrite: true`) uses an O_EXCL `wx` open
52
- * rather than `stat` + `writeFileAtomic` to close a check-then-write
53
- * race: two concurrent POSTs would otherwise both pass the existence
54
- * check and one would silently overwrite the other. The trade-off
55
- * is that the create path is not crash-atomic (a partial file could
56
- * remain if the process dies mid-write); acceptable here because
57
- * records are small JSON blobs and the next read either parses or
58
- * is skipped via the "malformed JSON" branch in `listItems`.
59
- *
60
- * Update path (`refuseOverwrite: false`) uses `writeFileAtomic` so
61
- * PUT remains crash-atomic. No race there — the URL pins the id. */
62
- export declare function writeItem(dataDir: string, itemId: string, item: CollectionItem, opts?: WriteItemOptions): Promise<WriteItemResult>;
63
- export type DeleteItemResult = {
64
- kind: "ok";
65
- itemId: string;
66
- } | {
67
- kind: "invalid-id";
68
- itemId: string;
69
- } | {
70
- kind: "not-found";
71
- itemId: string;
72
- } | {
73
- kind: "path-escape";
74
- itemId: string;
75
- };
76
- export declare function deleteItem(dataDir: string, itemId: string, opts?: IoOptions): Promise<DeleteItemResult>;
77
- /** Generate a short random hex id. Used by POST when the form doesn't
78
- * carry a primary-key value (UI shortcut — Claude normally derives a
79
- * semantic id from the record's name). */
80
- export declare function generateItemId(): string;
81
- /** Read a collection's custom-view HTML, path-safely. `viewFile` is a
82
- * schema-validated `views/*.html` path, resolved with realpath containment.
83
- * Returns the HTML, or null when the path is unsafe or the file is missing.
84
- *
85
- * The base dir is source-aware: a **project** collection authors views in the
86
- * `data/skills/<slug>/` staging dir (custom-view HTML is staging-only — NOT
87
- * mirrored to `.claude/skills`, because rendering is host-side; see
88
- * plans/feat-collections-custom-views.md), whereas a **user** / **feed**
89
- * collection is authored directly in its own discovered `skillDir`. Reading
90
- * relative to the wrong tree would 404 a perfectly valid view. */
91
- export declare function readCustomViewHtml(collection: Pick<LoadedCollection, "slug" | "source" | "skillDir">, viewFile: string, opts?: IoOptions): Promise<string | null>;
92
- /** The item id a CREATE should use for `schema`, or null when the
93
- * caller should generate one. A singleton collection pins every
94
- * create to its fixed `schema.singleton` id, so the "at most one
95
- * record" contract is enforced server-side (a second create targets
96
- * the same file and hits `writeItem`'s refuseOverwrite conflict) —
97
- * not only in the UI. Otherwise the record's own primaryKey value
98
- * wins, falling back to a generated id (null = "generate"). */
99
- export declare function resolveCreateItemId(schema: CollectionSchema, record: CollectionItem): string | null;
100
- /** Read an action's template file from `skillDir`, path-safely. Returns
101
- * the file contents, or null when the path escapes the skill dir, the
102
- * resolved target isn't a regular file, or the read fails. */
103
- export declare function readSkillTemplate(skillDir: string, templateRelPath: string): Promise<string | null>;
104
- /** Build the seed prompt for a `kind: "chat"` action: a security-
105
- * boundary instruction + the record as a sanitized JSON data block +
106
- * the template text verbatim. Pure + exported for tests. Domain-free —
107
- * the template (skill-owned) carries every specific instruction; the
108
- * host only injects the record's own data. */
109
- export declare function buildActionSeedPrompt(record: CollectionItem, templateText: string): string;
110
- /** Build the seed prompt for a collection-level `kind: "chat"` action: a
111
- * security-boundary instruction + a compact progress summary of every
112
- * record (see `progressSummary`) + the template verbatim. Pure +
113
- * exported for tests. Domain-free — the template carries the specifics. */
114
- export declare function buildCollectionActionSeedPrompt(items: CollectionItem[], schema: CollectionSchema, templateText: string): string;
115
- //# sourceMappingURL=io.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../src/server/io.ts"],"names":[],"mappings":"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"}
@@ -1,53 +0,0 @@
1
- export declare const SCHEMA_FILE = "schema.json";
2
- /** Sanitise a user-supplied slug into a safe directory-name leaf.
3
- * Returns null for anything that fails the slug whitelist OR isn't a
4
- * basename (i.e. survives `path.basename` round-trip unchanged).
5
- * The basename round-trip is the pattern CodeQL recognises as a
6
- * `js/path-injection` sanitiser. */
7
- export declare function safeSlugName(slug: string): string | null;
8
- /** Sanitise a user-supplied record id into a safe filename stem. Like
9
- * `safeSlugName` but tolerates interior dots (so natural keys work),
10
- * while still rejecting any `..` substring, path separators, and
11
- * leading/trailing dots. The `path.basename` round-trip is the same
12
- * `js/path-injection` sanitiser CodeQL recognises on `safeSlugName`. */
13
- export declare function safeRecordId(recordId: string): string | null;
14
- /** True iff the realpath'd closest existing ancestor of `absPath`
15
- * resolves under `rootPath`'s realpath. Pure helper, takes both
16
- * paths explicitly so tests can drive it against a `mkdtempSync`
17
- * root without touching the user's workspace. Defends against the
18
- * data dir or any ancestor being a symlink to a directory outside
19
- * the workspace — lexical-only checks (`path.resolve` + prefix
20
- * match) would miss this case, which is the class of bug the rest
21
- * of this codebase uses realpath-based containment to avoid (see
22
- * `server/utils/files/safe.ts#resolveWithinRoot`). */
23
- export declare function isContainedInRoot(absPath: string, rootPath: string): boolean;
24
- /** Workspace-bound convenience over `isContainedInRoot`. Production
25
- * callers use this; the tests exercise the pure helper. */
26
- export declare function isContainedInWorkspace(absPath: string): boolean;
27
- /** Resolve a schema-declared dataPath against `rootPath` (default:
28
- * the live workspace), refusing anything that escapes — absolute
29
- * paths, `..`-segments, empty string, or symlinks pointing outside
30
- * the root. Returns the absolute path on success, null on refusal.
31
- * Does NOT require the directory to exist; the caller may create it
32
- * on first write. The realpath containment check covers the symlink
33
- * case at discovery time; io operations re-check before each write
34
- * to defend against symlinks introduced between discovery and use.
35
- *
36
- * `rootPath` exists as an optional override so a test (or a tool
37
- * driving discovery against a `mkdtempSync` tree) gets a dataDir
38
- * rooted at the same place it asked to scan, not the real workspace.
39
- * Without this, `discoverApps({ workspaceRoot: tmpdir })` would
40
- * discover skills in tmpdir but resolve every app's dataDir against
41
- * `~/mulmoclaude/`, breaking isolation. */
42
- export declare function resolveDataDir(dataPath: string, rootPath?: string): string | null;
43
- /** Compose the absolute path to a single record file. Both arguments
44
- * must have been passed through `safeSlugName` / `resolveDataDir`
45
- * before reaching here so the join can't escape. */
46
- export declare function itemFilePath(dataDir: string, itemId: string): string;
47
- /** Resolve an action's skill-relative `template` path against
48
- * `skillDir`, refusing escapes — absolute paths, `..`-segments, or a
49
- * symlink pointing outside the skill dir. Mirrors `resolveDataDir`;
50
- * the realpath containment is the hard guarantee. Returns the
51
- * absolute path on success, null on refusal. */
52
- export declare function resolveTemplatePath(skillDir: string, templateRelPath: string): string | null;
53
- //# sourceMappingURL=paths.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/server/paths.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,gBAAgB,CAAC;AAQzC;;;;qCAIqC;AACrC,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMxD;AAaD;;;;yEAIyE;AACzE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO5D;AAwBD;;;;;;;;uDAQuD;AACvD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAW5E;AAED;4DAC4D;AAC5D,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED;;;;;;;;;;;;;;4CAc4C;AAC5C,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAE,MAA2B,GAAG,MAAM,GAAG,IAAI,CAQrG;AAED;;qDAEqD;AACrD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;;;iDAIiD;AACjD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ5F"}
@@ -1,56 +0,0 @@
1
- import { type IoOptions } from "./io";
2
- import type { CollectionEvery, CollectionItem, CollectionSchema, CollectionSpawnEvery } from "../core/schema";
3
- /** A timezone-free calendar date. `m` is 1-12. */
4
- export interface CivilDate {
5
- y: number;
6
- m: number;
7
- d: number;
8
- }
9
- /** Days in `month` (1-12) of `year`, leap-year-aware. `new Date(y, m, 0)`
10
- * is day 0 of the *next* month = the last day of `month`; `.getDate()`
11
- * reads the civil day regardless of timezone. */
12
- export declare function daysInMonth(year: number, month: number): number;
13
- /** Parse a `YYYY-MM-DD` string into a CivilDate, or null when the value
14
- * isn't a well-formed in-range calendar date. */
15
- export declare function parseCivil(raw: unknown): CivilDate | null;
16
- /** `YYYY-MM-DD` for storage in a `date` field. */
17
- export declare function formatCivil(date: CivilDate): string;
18
- /** Advance a civil date by one `every` step. Month/year units preserve
19
- * the rule's day-of-month anchor, clamped to the target month's length
20
- * (no drift); day/week units do civil day arithmetic. */
21
- export declare function advanceTriggerDate(source: CivilDate, every: CollectionEvery): CivilDate;
22
- /** True iff `now`'s civil date (local timezone) has reached the fire date
23
- * for `triggerRaw` — i.e. the trigger date minus `leadDays` (so a 10-day
24
- * lead fires 10 days early). Returns null when `triggerRaw` isn't a
25
- * parseable date — callers treat that as "don't fire" and warn. */
26
- export declare function isTriggerDue(triggerRaw: unknown, now: Date, leadDays?: number): boolean | null;
27
- /** Deterministic successor id: `<stem>-<YYYYMMDD>`, where `<stem>` is the
28
- * source id with a trailing `-YYYYMMDD` stripped if present. So a chain
29
- * shares one stem and each instance is dated:
30
- * `rent` → `rent-20260610`
31
- * `rent-20260610` → `rent-20260710`
32
- * Slug-safe (alphanumeric + hyphen) and a pure function of the inputs,
33
- * which is what makes create-if-absent idempotent. */
34
- export declare function successorId(sourceId: string, next: CivilDate): string;
35
- /** Resolve the literal `every` that applies to `sourceItem`. Literal-arm
36
- * `spawn.every` passes through unchanged. Field-driven `spawn.every` reads
37
- * `sourceItem[fromField]` and looks it up in `map`; an empty field or a
38
- * value with no map entry yields null (caller skips + logs — see plan §5).
39
- * Discovery rejects a map that doesn't cover the enum's values, so null
40
- * here means a record that predates a map/enum edit. */
41
- export declare function resolveEvery(every: CollectionSpawnEvery, sourceItem: CollectionItem): CollectionEvery | null;
42
- export interface ComputedSuccessor {
43
- id: string;
44
- record: CollectionItem;
45
- }
46
- /** Build the successor record purely from (schema, source record, source
47
- * id). Returns null when the schema has no spawn/triggerField or the
48
- * source's trigger date is unparseable. */
49
- export declare function computeSuccessor(schema: CollectionSchema, sourceItem: CollectionItem, sourceId: string): ComputedSuccessor | null;
50
- /** Idempotently create the successor for `sourceItem` when it matches the
51
- * spawn predicate. No-op when the schema declares no spawn, the
52
- * predicate doesn't match, the trigger date is unparseable, or the
53
- * successor already exists (create-if-absent). Never overwrites an
54
- * existing successor — protects any edits the user made to it. */
55
- export declare function maybeSpawnSuccessor(slug: string, schema: CollectionSchema, dataDir: string, sourceItem: CollectionItem, sourceId: string, ioOpts?: IoOptions): Promise<void>;
56
- //# sourceMappingURL=spawn.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../src/server/spawn.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,EAAkB,MAAM,gBAAgB,CAAC;AAE9H,kDAAkD;AAClD,MAAM,WAAW,SAAS;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAYD;;kDAEkD;AAClD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;kDACkD;AAClD,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAUzD;AAED,kDAAkD;AAClD,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEnD;AAeD;;0DAE0D;AAC1D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,GAAG,SAAS,CAYvF;AAED;;;oEAGoE;AACpE,wBAAgB,YAAY,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,SAAI,GAAG,OAAO,GAAG,IAAI,CAMzF;AAID;;;;;;uDAMuD;AACvD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAGrE;AAiBD;;;;;yDAKyD;AACzD,wBAAgB,YAAY,CAAC,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,cAAc,GAAG,eAAe,GAAG,IAAI,CAK5G;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,cAAc,CAAC;CACxB;AAED;;4CAE4C;AAC5C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAiBjI;AAoBD;;;;mEAImE;AACnE,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,SAAc,GACrB,OAAO,CAAC,IAAI,CAAC,CAiCf"}
@@ -1,26 +0,0 @@
1
- /**
2
- * A safe skill-relative path: non-empty, no backslash, not absolute,
3
- * and every `/`-separated segment is a plain `[A-Za-z0-9._-]+` token
4
- * that isn't `.` / `..` (no traversal). Multi-segment (nested) paths
5
- * are allowed. The reader's realpath containment is the hard
6
- * guarantee; this fails a bad path fast.
7
- */
8
- export declare function isSafeTemplatePath(value: string): boolean;
9
- /**
10
- * An action `template` value: a safe path that lives under the skill's
11
- * `templates/` subdir. This is the canonical contract — the schema
12
- * validator rejects anything else up front, and the bridge mirrors
13
- * exactly these. Nested paths (`templates/mail/welcome.md`) and any
14
- * extension are allowed as long as the path is otherwise safe.
15
- */
16
- export declare function isSafeActionTemplatePath(value: string): boolean;
17
- /**
18
- * A custom-view `file` value: a safe path under the skill's `views/`
19
- * subdir that ends in `.html`. Custom views are LLM-authored HTML the
20
- * host renders in a sandboxed iframe; constraining them to `views/*.html`
21
- * keeps the data folder and the schema/template files off-limits to the
22
- * view-file reader. Same per-segment safety as templates; the reader's
23
- * realpath containment is the hard guarantee.
24
- */
25
- export declare function isSafeCustomViewPath(value: string): boolean;
26
- //# sourceMappingURL=templatePath.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"templatePath.d.ts","sourceRoot":"","sources":["../../src/server/templatePath.ts"],"names":[],"mappings":"AAcA;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGzD;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE/D;AAKD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE3D"}
@@ -1,4 +0,0 @@
1
- /** Human-readable message from an unknown thrown value. */
2
- export declare function errorMessage(err: unknown): string;
3
- export declare const ONE_DAY_MS: number;
4
- //# sourceMappingURL=util.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/server/util.ts"],"names":[],"mappings":"AAGA,2DAA2D;AAC3D,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAEjD;AAED,eAAO,MAAM,UAAU,QAAsB,CAAC"}
@@ -1,20 +0,0 @@
1
- import type { LoadedCollection } from "./discoveredCollection";
2
- import type { CollectionItem, CollectionSchema } from "../core/schema";
3
- export interface RecordIssue {
4
- /** Record filename, e.g. `lesson-003.json`. */
5
- file: string;
6
- /** Human-readable problem, written to be actionable by the LLM. */
7
- problem: string;
8
- }
9
- export declare const COMPUTED_TYPES: ReadonlySet<string>;
10
- export declare function validateCollectionRecords(collection: LoadedCollection, opts?: {
11
- workspaceRoot?: string;
12
- }): Promise<RecordIssue[]>;
13
- /** First schema problem on an in-memory record (primaryKey↔id mismatch,
14
- * missing required, bad enum value), or null when it's fine. One issue
15
- * per record keeps the report short and the fix obvious. Pure +
16
- * exported so write paths (manageCollection putItems) can gate on the
17
- * SAME rules the post-hoc file scan reports — `itemId` is the id the
18
- * record is (or would be) stored under. */
19
- export declare function validateRecordObject(record: CollectionItem, itemId: string, schema: CollectionSchema): string | null;
20
- //# sourceMappingURL=validate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/server/validate.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvE,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAA2C,CAAC;AAsB3F,wBAAsB,yBAAyB,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,GAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAW3I;AAoCD;;;;;4CAK4C;AAC5C,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAepH"}