@mulmoclaude/core 0.13.1 → 0.14.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 (51) hide show
  1. package/assets/helps/billing-clients-worklog.md +15 -12
  2. package/assets/helps/collection-skills.md +42 -19
  3. package/assets/helps/todo-collection.md +13 -7
  4. package/dist/{deriveAll-CMFXDQ_G.js → calendarGrid-C1rfCXJ3.cjs} +468 -3
  5. package/dist/calendarGrid-C1rfCXJ3.cjs.map +1 -0
  6. package/dist/{deriveAll-BQ_p5HSB.cjs → calendarGrid-kO6rGfm0.js} +289 -74
  7. package/dist/calendarGrid-kO6rGfm0.js.map +1 -0
  8. package/dist/collection/core/ids.d.ts +12 -0
  9. package/dist/collection/core/recordZ.d.ts +25 -0
  10. package/dist/collection/core/schema.d.ts +65 -418
  11. package/dist/collection/core/schemaZ.d.ts +846 -0
  12. package/dist/collection/core/templatePath.d.ts +34 -0
  13. package/dist/collection/core/where.d.ts +9 -15
  14. package/dist/collection/index.cjs +34 -295
  15. package/dist/collection/index.cjs.map +1 -1
  16. package/dist/collection/index.d.ts +1 -0
  17. package/dist/collection/index.js +5 -270
  18. package/dist/collection/index.js.map +1 -1
  19. package/dist/collection/paths.cjs +1 -1
  20. package/dist/collection/paths.cjs.map +1 -1
  21. package/dist/collection/paths.js +1 -1
  22. package/dist/collection/paths.js.map +1 -1
  23. package/dist/collection/registry/server/index.cjs +1 -1
  24. package/dist/collection/registry/server/index.js +1 -1
  25. package/dist/collection/server/discovery.d.ts +2 -244
  26. package/dist/collection/server/index.cjs +3 -1
  27. package/dist/collection/server/index.js +2 -2
  28. package/dist/collection/server/templatePath.d.ts +1 -34
  29. package/dist/collection/server/validate.d.ts +11 -7
  30. package/dist/collection-watchers/index.cjs +1 -1
  31. package/dist/collection-watchers/index.js +1 -1
  32. package/dist/feeds/index.cjs +4 -4
  33. package/dist/feeds/index.js +2 -2
  34. package/dist/feeds/ingestTypes.d.ts +15 -40
  35. package/dist/feeds/server/index.cjs +5 -5
  36. package/dist/feeds/server/index.js +3 -3
  37. package/dist/{ingestTypes-C7EheYZX.cjs → ingestTypes-BIFXlw7M.cjs} +3 -3
  38. package/dist/ingestTypes-BIFXlw7M.cjs.map +1 -0
  39. package/dist/{ingestTypes-CmJeOUJc.js → ingestTypes-KuYPX9Ea.js} +2 -2
  40. package/dist/ingestTypes-KuYPX9Ea.js.map +1 -0
  41. package/dist/{server-DKXXFTbw.js → server-Cc6XcyOA.js} +417 -187
  42. package/dist/server-Cc6XcyOA.js.map +1 -0
  43. package/dist/{server-G6GtOdaW.cjs → server-Cd5WdM8a.cjs} +440 -198
  44. package/dist/server-Cd5WdM8a.cjs.map +1 -0
  45. package/package.json +1 -1
  46. package/dist/deriveAll-BQ_p5HSB.cjs.map +0 -1
  47. package/dist/deriveAll-CMFXDQ_G.js.map +0 -1
  48. package/dist/ingestTypes-C7EheYZX.cjs.map +0 -1
  49. package/dist/ingestTypes-CmJeOUJc.js.map +0 -1
  50. package/dist/server-DKXXFTbw.js.map +0 -1
  51. package/dist/server-G6GtOdaW.cjs.map +0 -1
@@ -1,34 +1 @@
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
- /**
27
- * A custom-view `i18n` value: the JSON dictionary file authors ship next to
28
- * their `views/<id>.html`. Constrained to `views/<name>.i18n.json` so the
29
- * field can only point at a translation file co-located with the view it
30
- * translates — the same `views/` containment the HTML reader uses. The
31
- * `.i18n.json` suffix (vs plain `.json`) makes the file's purpose grep-able
32
- * for both authors and tooling.
33
- */
34
- export declare function isSafeCustomViewI18nPath(value: string): boolean;
1
+ export * from '../core/templatePath';
@@ -1,19 +1,23 @@
1
+ import { RecordCheckTier } from '../core/recordZ';
1
2
  import { LoadedCollection } from './discoveredCollection';
2
3
  import { CollectionItem, CollectionSchema } from '../core/schema';
4
+ export { COMPUTED_TYPES, compileRecordZ, recordFieldProblem, type RecordCheckTier } from '../core/recordZ';
3
5
  export interface RecordIssue {
4
6
  /** Record filename, e.g. `lesson-003.json`. */
5
7
  file: string;
6
8
  /** Human-readable problem, written to be actionable by the LLM. */
7
9
  problem: string;
8
10
  }
9
- export declare const COMPUTED_TYPES: ReadonlySet<string>;
10
11
  export declare function validateCollectionRecords(collection: LoadedCollection, opts?: {
11
12
  workspaceRoot?: string;
12
13
  }): Promise<RecordIssue[]>;
13
14
  /** 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;
15
+ * then the compiled per-field checks see `../core/recordZ` for the two
16
+ * tiers), or null when it's fine. One issue per record keeps the report
17
+ * short and the fix obvious. Pure + exported so write paths
18
+ * (manageCollection putItems) can gate on the SAME enforced rules the
19
+ * post-hoc file scan reports — `itemId` is the id the record is (or
20
+ * would be) stored under. The default `"enforced"` tier keeps every
21
+ * write gate on the historical three checks; only pass `"strict"` from
22
+ * report-only surfaces. */
23
+ export declare function validateRecordObject(record: CollectionItem, itemId: string, schema: CollectionSchema, tier?: RecordCheckTier): string | null;
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_collection_index = require("../collection/index.cjs");
3
- const require_server = require("../server-G6GtOdaW.cjs");
3
+ const require_server = require("../server-Cd5WdM8a.cjs");
4
4
  const require_notifier = require("../notifier-bS8IEeLA.cjs");
5
5
  let node_fs = require("node:fs");
6
6
  let node_fs_promises = require("node:fs/promises");
@@ -1,5 +1,5 @@
1
1
  import { whenMatches } from "../collection/index.js";
2
- import { A as listItems, P as readItem, b as loadCollection, c as isTriggerDue, l as maybeSpawnSuccessor, y as discoverCollections } from "../server-DKXXFTbw.js";
2
+ import { I as readItem, M as listItems, c as isTriggerDue, l as maybeSpawnSuccessor, v as discoverCollections, y as loadCollection } from "../server-Cc6XcyOA.js";
3
3
  import { d as publish, m as updateForPlugin, n as clear, s as listAll } from "../notifier-ChpY0XrY.js";
4
4
  import { watch } from "node:fs";
5
5
  import { mkdir } from "node:fs/promises";
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_deriveAll = require("../deriveAll-BQ_p5HSB.cjs");
3
- const require_ingestTypes = require("../ingestTypes-C7EheYZX.cjs");
2
+ const require_calendarGrid = require("../calendarGrid-C1rfCXJ3.cjs");
3
+ const require_ingestTypes = require("../ingestTypes-BIFXlw7M.cjs");
4
4
  exports.AGENT_INGEST_KIND = require_ingestTypes.AGENT_INGEST_KIND;
5
5
  exports.DEFAULT_FEED_MAX_ITEMS = require_ingestTypes.DEFAULT_FEED_MAX_ITEMS;
6
- exports.FEED_SCHEDULES = require_deriveAll.FEED_SCHEDULES;
7
- exports.INGEST_KINDS = require_deriveAll.INGEST_KINDS;
6
+ exports.FEED_SCHEDULES = require_calendarGrid.FEED_SCHEDULES;
7
+ exports.INGEST_KINDS = require_calendarGrid.INGEST_KINDS;
8
8
  exports.isFeedSchedule = require_ingestTypes.isFeedSchedule;
@@ -1,3 +1,3 @@
1
- import { l as FEED_SCHEDULES, u as INGEST_KINDS } from "../deriveAll-CMFXDQ_G.js";
2
- import { n as DEFAULT_FEED_MAX_ITEMS, r as isFeedSchedule, t as AGENT_INGEST_KIND } from "../ingestTypes-CmJeOUJc.js";
1
+ import { D as FEED_SCHEDULES, O as INGEST_KINDS } from "../calendarGrid-kO6rGfm0.js";
2
+ import { n as DEFAULT_FEED_MAX_ITEMS, r as isFeedSchedule, t as AGENT_INGEST_KIND } from "../ingestTypes-KuYPX9Ea.js";
3
3
  export { AGENT_INGEST_KIND, DEFAULT_FEED_MAX_ITEMS, FEED_SCHEDULES, INGEST_KINDS, isFeedSchedule };
@@ -1,4 +1,6 @@
1
- import { CollectionIngest, INGEST_KINDS, FEED_SCHEDULES, IngestKind, FeedSchedule } from '../collection/index.js';
1
+ import { INGEST_KINDS, FEED_SCHEDULES, IngestKind, FeedSchedule } from '../collection/index.js';
2
+ import { z } from 'zod';
3
+ import { AgentIngestZ, DeclarativeIngestZ } from '../collection/core/schemaZ';
2
4
  export declare const AGENT_INGEST_KIND: "agent";
3
5
  export type AgentIngestKind = typeof AGENT_INGEST_KIND;
4
6
  export { INGEST_KINDS, FEED_SCHEDULES, type IngestKind, type FeedSchedule };
@@ -11,47 +13,20 @@ export declare const DEFAULT_FEED_MAX_ITEMS = 100;
11
13
  * `"data.name"`). */
12
14
  export type IngestFieldMap = Record<string, string>;
13
15
  /** Declarative retrieval (`rss`/`atom`/`http-json`): the host fetches `url`
14
- * and projects each item through `map`. The canonical schema (in
15
- * `../collection`) only promises the minimal `CollectionIngest`; this
16
- * feeds-only subtype narrows those + adds the retrieval fields the engine
17
- * needs. */
18
- export interface DeclarativeIngestSpec extends CollectionIngest {
19
- /** Which declarative retriever handles this feed. */
20
- kind: IngestKind;
21
- /** Endpoint to fetch (http/https). */
22
- url: string;
23
- /** Refresh cadence. */
24
- schedule: FeedSchedule;
25
- /** `http-json` only: dot/bracket path to the array of items in the
26
- * response (e.g. `"hourly[]"` or `"data.results[]"`). Ignored for
27
- * `rss`/`atom`, which yield items natively. */
28
- itemsAt?: string;
29
- /** target field → source path. Projects each raw item into a record
30
- * whose keys match the schema's `fields`. */
31
- map: IngestFieldMap;
32
- /** Optional source path used to derive the primaryKey value when the
33
- * mapped record's primaryKey is empty (e.g. `"feedId"`). Falls back
34
- * to a content hash of the record. */
35
- idFrom?: string;
36
- /** Cap on stored records. After each fetch the feed keeps only the
37
- * newest `maxItems` (ordered by the schema's first `date` field) and
38
- * deletes the rest. Defaults to {@link DEFAULT_FEED_MAX_ITEMS} when
39
- * omitted; `0` disables the cap (keep everything). Pruning is skipped
40
- * when the schema has no `date` field to order by. */
41
- maxItems?: number;
42
- }
16
+ * and projects each item through `map` (target field source path; a
17
+ * `http-json` feed may add `itemsAt`, a dot/bracket path to the items
18
+ * array; `idFrom` derives the primaryKey; `maxItems` caps stored records,
19
+ * default {@link DEFAULT_FEED_MAX_ITEMS}, `0` = keep everything). The
20
+ * canonical loose contract stays the minimal `CollectionIngest`; this
21
+ * feeds subtype is derived from the zod source of truth
22
+ * (`collection/core/schemaZ` `DeclarativeIngestZ`), so the engine and the
23
+ * schema validator can never drift. */
24
+ export type DeclarativeIngestSpec = z.infer<typeof DeclarativeIngestZ>;
43
25
  /** Agent-performed retrieval (`kind: "agent"`). No `url`/`map`: the host seeds
44
26
  * a hidden background worker (origin `system`) in `role` with `template` + a
45
27
  * summary of every record, and the worker edits the records itself via the
46
- * collections io layer. Valid on any collection (primarily skill-backed). */
47
- export interface AgentIngestSpec extends CollectionIngest {
48
- kind: AgentIngestKind;
49
- /** Refresh cadence (same vocabulary as declarative feeds). */
50
- schedule: FeedSchedule;
51
- /** Role id the scheduled hidden worker runs in. */
52
- role: string;
53
- /** Skill-relative template path (under `templates/`) seeding the worker. */
54
- template: string;
55
- }
28
+ * collections io layer. Valid on any collection (primarily skill-backed).
29
+ * Derived from `AgentIngestZ` in `collection/core/schemaZ`. */
30
+ export type AgentIngestSpec = z.infer<typeof AgentIngestZ>;
56
31
  /** The `ingest` block carried on a `CollectionSchema`, discriminated on `kind`. */
57
32
  export type IngestSpec = DeclarativeIngestSpec | AgentIngestSpec;
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("../../rolldown-runtime-D6vf50IK.cjs");
3
- const require_deriveAll = require("../../deriveAll-BQ_p5HSB.cjs");
4
- const require_server = require("../../server-G6GtOdaW.cjs");
5
- const require_ingestTypes = require("../../ingestTypes-C7EheYZX.cjs");
3
+ const require_calendarGrid = require("../../calendarGrid-C1rfCXJ3.cjs");
4
+ const require_server = require("../../server-Cd5WdM8a.cjs");
5
+ const require_ingestTypes = require("../../ingestTypes-BIFXlw7M.cjs");
6
6
  const require_feeds_paths = require("../paths.cjs");
7
7
  const require_notifier = require("../../notifier-bS8IEeLA.cjs");
8
8
  let node_path = require("node:path");
@@ -817,8 +817,8 @@ exports.DEFAULT_FEED_MAX_ITEMS = require_ingestTypes.DEFAULT_FEED_MAX_ITEMS;
817
817
  exports.DEFAULT_FEED_REFRESH_INTERVAL_MS = DEFAULT_FEED_REFRESH_INTERVAL_MS;
818
818
  exports.FEEDS_DIR = require_feeds_paths.FEEDS_DIR;
819
819
  exports.FEED_REFRESH_TASK_ID = FEED_REFRESH_TASK_ID;
820
- exports.FEED_SCHEDULES = require_deriveAll.FEED_SCHEDULES;
821
- exports.INGEST_KINDS = require_deriveAll.INGEST_KINDS;
820
+ exports.FEED_SCHEDULES = require_calendarGrid.FEED_SCHEDULES;
821
+ exports.INGEST_KINDS = require_calendarGrid.INGEST_KINDS;
822
822
  exports.configureFeedsHost = configureFeedsHost;
823
823
  exports.feedDir = require_feeds_paths.feedDir;
824
824
  exports.feedRefreshTaskDef = feedRefreshTaskDef;
@@ -1,6 +1,6 @@
1
- import { l as FEED_SCHEDULES, u as INGEST_KINDS } from "../../deriveAll-CMFXDQ_G.js";
2
- import { A as listItems, D as buildCollectionActionSeedPrompt, F as readSkillTemplate, K as safeSlugName, L as writeItem, O as deleteItem, U as resolveDataDir, j as promptPathsFor, y as discoverCollections } from "../../server-DKXXFTbw.js";
3
- import { n as DEFAULT_FEED_MAX_ITEMS, r as isFeedSchedule, t as AGENT_INGEST_KIND } from "../../ingestTypes-CmJeOUJc.js";
1
+ import { D as FEED_SCHEDULES, O as INGEST_KINDS } from "../../calendarGrid-kO6rGfm0.js";
2
+ import { A as deleteItem, G as resolveDataDir, J as safeSlugName, L as readSkillTemplate, M as listItems, N as promptPathsFor, k as buildCollectionActionSeedPrompt, v as discoverCollections, z as writeItem } from "../../server-Cc6XcyOA.js";
3
+ import { n as DEFAULT_FEED_MAX_ITEMS, r as isFeedSchedule, t as AGENT_INGEST_KIND } from "../../ingestTypes-KuYPX9Ea.js";
4
4
  import { FEEDS_DIR, feedDir, feedStatePath, feedsRoot, ingestStateDir, ingestStatePath } from "../paths.js";
5
5
  import { d as publish, n as clear } from "../../notifier-ChpY0XrY.js";
6
6
  import path from "node:path";
@@ -1,8 +1,8 @@
1
- const require_deriveAll = require("./deriveAll-BQ_p5HSB.cjs");
1
+ const require_calendarGrid = require("./calendarGrid-C1rfCXJ3.cjs");
2
2
  require("./collection/index.cjs");
3
3
  //#region src/feeds/ingestTypes.ts
4
4
  var AGENT_INGEST_KIND = "agent";
5
- var FEED_SCHEDULE_SET = new Set(require_deriveAll.FEED_SCHEDULES);
5
+ var FEED_SCHEDULE_SET = new Set(require_calendarGrid.FEED_SCHEDULES);
6
6
  function isFeedSchedule(value) {
7
7
  return typeof value === "string" && FEED_SCHEDULE_SET.has(value);
8
8
  }
@@ -29,4 +29,4 @@ Object.defineProperty(exports, "isFeedSchedule", {
29
29
  }
30
30
  });
31
31
 
32
- //# sourceMappingURL=ingestTypes-C7EheYZX.cjs.map
32
+ //# sourceMappingURL=ingestTypes-BIFXlw7M.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ingestTypes-BIFXlw7M.cjs","names":[],"sources":["../src/feeds/ingestTypes.ts"],"sourcesContent":["// Declarative retrieval config for the \"Feeds\" mechanism. A Feed is a\n// CollectionSchema plus this `ingest` block, registered as data (NOT as\n// a skill) under `<workspace>/feeds/<slug>/schema.json`. The host's\n// retrieval engine reads it to periodically refill the collection's\n// records via the shared collections io layer.\n//\n// The ingest vocab (INGEST_KINDS / FEED_SCHEDULES + their literal-union types)\n// lives in the sibling `../collection` subpath alongside the schema contract, so\n// the package's schema validator can enforce it. Re-exported here so the feeds\n// engine's existing importers resolve them unchanged.\nimport { INGEST_KINDS, FEED_SCHEDULES, type IngestKind, type FeedSchedule } from \"../collection/index.js\";\n// Type-only: keeps zod out of this module's runtime graph (the feeds engine\n// imports it browser-free through `../collection`'s type surface).\nimport type { z } from \"zod\";\nimport type { AgentIngestZ, DeclarativeIngestZ } from \"../collection/core/schemaZ\";\n//\n// Two flavours: the declarative kinds (`rss`/`atom`/`http-json`) fetch-and-map,\n// and `agent` dispatches a hidden worker. The `code` kind (LLM-generated\n// deterministic transform) is still reserved for a future retriever.\n\n// The agent ingest kind. Defined HERE (not imported from `../collection`) on\n// purpose: the engine only needs the literal to branch, and re-importing it as a\n// VALUE keeps this module free of a value dependency on the collection vocab.\n// Core owns its own copy for the schema validator; this matches the same literal.\nexport const AGENT_INGEST_KIND = \"agent\" as const;\nexport type AgentIngestKind = typeof AGENT_INGEST_KIND;\n\nexport { INGEST_KINDS, FEED_SCHEDULES, type IngestKind, type FeedSchedule };\n\nconst FEED_SCHEDULE_SET: ReadonlySet<string> = new Set(FEED_SCHEDULES);\n\nexport function isFeedSchedule(value: unknown): value is FeedSchedule {\n return typeof value === \"string\" && FEED_SCHEDULE_SET.has(value);\n}\n\n/** Default cap on stored records per feed when `ingest.maxItems` is\n * omitted. Keeps high-volume feeds (news / podcasts) bounded. */\nexport const DEFAULT_FEED_MAX_ITEMS = 100;\n\n/** Declarative field map: target collection field name → source path\n * into the raw item (dot/bracket path, e.g. `\"title\"` or\n * `\"data.name\"`). */\nexport type IngestFieldMap = Record<string, string>;\n\n/** Declarative retrieval (`rss`/`atom`/`http-json`): the host fetches `url`\n * and projects each item through `map` (target field → source path; a\n * `http-json` feed may add `itemsAt`, a dot/bracket path to the items\n * array; `idFrom` derives the primaryKey; `maxItems` caps stored records,\n * default {@link DEFAULT_FEED_MAX_ITEMS}, `0` = keep everything). The\n * canonical loose contract stays the minimal `CollectionIngest`; this\n * feeds subtype is derived from the zod source of truth\n * (`collection/core/schemaZ` `DeclarativeIngestZ`), so the engine and the\n * schema validator can never drift. */\nexport type DeclarativeIngestSpec = z.infer<typeof DeclarativeIngestZ>;\n\n/** Agent-performed retrieval (`kind: \"agent\"`). No `url`/`map`: the host seeds\n * a hidden background worker (origin `system`) in `role` with `template` + a\n * summary of every record, and the worker edits the records itself via the\n * collections io layer. Valid on any collection (primarily skill-backed).\n * Derived from `AgentIngestZ` in `collection/core/schemaZ`. */\nexport type AgentIngestSpec = z.infer<typeof AgentIngestZ>;\n\n/** The `ingest` block carried on a `CollectionSchema`, discriminated on `kind`. */\nexport type IngestSpec = DeclarativeIngestSpec | AgentIngestSpec;\n"],"mappings":";;;AAwBA,IAAa,oBAAoB;AAKjC,IAAM,oBAAyC,IAAI,IAAI,qBAAA,cAAc;AAErE,SAAgB,eAAe,OAAuC;CACpE,OAAO,OAAO,UAAU,YAAY,kBAAkB,IAAI,KAAK;AACjE;;;AAIA,IAAa,yBAAyB"}
@@ -1,4 +1,4 @@
1
- import { l as FEED_SCHEDULES } from "./deriveAll-CMFXDQ_G.js";
1
+ import { D as FEED_SCHEDULES } from "./calendarGrid-kO6rGfm0.js";
2
2
  import "./collection/index.js";
3
3
  //#region src/feeds/ingestTypes.ts
4
4
  var AGENT_INGEST_KIND = "agent";
@@ -12,4 +12,4 @@ var DEFAULT_FEED_MAX_ITEMS = 100;
12
12
  //#endregion
13
13
  export { DEFAULT_FEED_MAX_ITEMS as n, isFeedSchedule as r, AGENT_INGEST_KIND as t };
14
14
 
15
- //# sourceMappingURL=ingestTypes-CmJeOUJc.js.map
15
+ //# sourceMappingURL=ingestTypes-KuYPX9Ea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ingestTypes-KuYPX9Ea.js","names":[],"sources":["../src/feeds/ingestTypes.ts"],"sourcesContent":["// Declarative retrieval config for the \"Feeds\" mechanism. A Feed is a\n// CollectionSchema plus this `ingest` block, registered as data (NOT as\n// a skill) under `<workspace>/feeds/<slug>/schema.json`. The host's\n// retrieval engine reads it to periodically refill the collection's\n// records via the shared collections io layer.\n//\n// The ingest vocab (INGEST_KINDS / FEED_SCHEDULES + their literal-union types)\n// lives in the sibling `../collection` subpath alongside the schema contract, so\n// the package's schema validator can enforce it. Re-exported here so the feeds\n// engine's existing importers resolve them unchanged.\nimport { INGEST_KINDS, FEED_SCHEDULES, type IngestKind, type FeedSchedule } from \"../collection/index.js\";\n// Type-only: keeps zod out of this module's runtime graph (the feeds engine\n// imports it browser-free through `../collection`'s type surface).\nimport type { z } from \"zod\";\nimport type { AgentIngestZ, DeclarativeIngestZ } from \"../collection/core/schemaZ\";\n//\n// Two flavours: the declarative kinds (`rss`/`atom`/`http-json`) fetch-and-map,\n// and `agent` dispatches a hidden worker. The `code` kind (LLM-generated\n// deterministic transform) is still reserved for a future retriever.\n\n// The agent ingest kind. Defined HERE (not imported from `../collection`) on\n// purpose: the engine only needs the literal to branch, and re-importing it as a\n// VALUE keeps this module free of a value dependency on the collection vocab.\n// Core owns its own copy for the schema validator; this matches the same literal.\nexport const AGENT_INGEST_KIND = \"agent\" as const;\nexport type AgentIngestKind = typeof AGENT_INGEST_KIND;\n\nexport { INGEST_KINDS, FEED_SCHEDULES, type IngestKind, type FeedSchedule };\n\nconst FEED_SCHEDULE_SET: ReadonlySet<string> = new Set(FEED_SCHEDULES);\n\nexport function isFeedSchedule(value: unknown): value is FeedSchedule {\n return typeof value === \"string\" && FEED_SCHEDULE_SET.has(value);\n}\n\n/** Default cap on stored records per feed when `ingest.maxItems` is\n * omitted. Keeps high-volume feeds (news / podcasts) bounded. */\nexport const DEFAULT_FEED_MAX_ITEMS = 100;\n\n/** Declarative field map: target collection field name → source path\n * into the raw item (dot/bracket path, e.g. `\"title\"` or\n * `\"data.name\"`). */\nexport type IngestFieldMap = Record<string, string>;\n\n/** Declarative retrieval (`rss`/`atom`/`http-json`): the host fetches `url`\n * and projects each item through `map` (target field → source path; a\n * `http-json` feed may add `itemsAt`, a dot/bracket path to the items\n * array; `idFrom` derives the primaryKey; `maxItems` caps stored records,\n * default {@link DEFAULT_FEED_MAX_ITEMS}, `0` = keep everything). The\n * canonical loose contract stays the minimal `CollectionIngest`; this\n * feeds subtype is derived from the zod source of truth\n * (`collection/core/schemaZ` `DeclarativeIngestZ`), so the engine and the\n * schema validator can never drift. */\nexport type DeclarativeIngestSpec = z.infer<typeof DeclarativeIngestZ>;\n\n/** Agent-performed retrieval (`kind: \"agent\"`). No `url`/`map`: the host seeds\n * a hidden background worker (origin `system`) in `role` with `template` + a\n * summary of every record, and the worker edits the records itself via the\n * collections io layer. Valid on any collection (primarily skill-backed).\n * Derived from `AgentIngestZ` in `collection/core/schemaZ`. */\nexport type AgentIngestSpec = z.infer<typeof AgentIngestZ>;\n\n/** The `ingest` block carried on a `CollectionSchema`, discriminated on `kind`. */\nexport type IngestSpec = DeclarativeIngestSpec | AgentIngestSpec;\n"],"mappings":";;;AAwBA,IAAa,oBAAoB;AAKjC,IAAM,oBAAyC,IAAI,IAAI,cAAc;AAErE,SAAgB,eAAe,OAAuC;CACpE,OAAO,OAAO,UAAU,YAAY,kBAAkB,IAAI,KAAK;AACjE;;;AAIA,IAAa,yBAAyB"}