@mulmoclaude/core 5.10.1 → 5.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/helps/index.md +2 -0
- package/assets/helps/memory-atomic.md +35 -0
- package/assets/helps/memory-topic.md +62 -0
- package/dist/collection/registry/server/index.cjs +1 -1
- package/dist/collection/registry/server/index.js +1 -1
- package/dist/collection/server/index.cjs +1 -1
- package/dist/collection/server/index.js +1 -1
- package/dist/collection/server/manageTool.d.ts +4 -0
- package/dist/collection-watchers/index.cjs +1 -1
- package/dist/collection-watchers/index.js +1 -1
- package/dist/feeds/server/index.cjs +1 -1
- package/dist/feeds/server/index.js +1 -1
- package/dist/{server-CVCc6JAO.js → server-BtbbQqBY.js} +17 -1
- package/dist/{server-CVCc6JAO.js.map → server-BtbbQqBY.js.map} +1 -1
- package/dist/{server-C-1R-aQ-.cjs → server-CJek9Y3Q.cjs} +17 -1
- package/dist/{server-C-1R-aQ-.cjs.map → server-CJek9Y3Q.cjs.map} +1 -1
- package/package.json +1 -1
package/assets/helps/index.md
CHANGED
|
@@ -71,6 +71,8 @@ See [Wiki](config/helps/wiki.md) for details on how it works.
|
|
|
71
71
|
- [Attached files](config/helps/attachments.md) — the `[Attached file: …]` markers on a user message: where each path lives, PPTX arriving as PDF, multi-image `editImages`, and the original-filename rules
|
|
72
72
|
- [Image references](config/helps/image-references.md) — how a `.md` / `.html` file embeds an image so it renders both in the app and from disk: relative paths only, and the forms that break
|
|
73
73
|
- [Task scheduling](config/helps/scheduling.md) — `schedule:` frontmatter syntax (`daily HH:MM` is UTC), recommended intervals, and changing a system task's frequency via the overrides API
|
|
74
|
+
- [Memory (topic files)](config/helps/memory-topic.md) — how the agent saves memory as `conversations/memory/<type>/<topic>.md` topic files: the file format, picking the type, adding a bullet, creating a topic and its `MEMORY.md` line
|
|
75
|
+
- [Memory (typed entries)](config/helps/memory-atomic.md) — the older one-file-per-entry memory layout: frontmatter, picking the type, and the `MEMORY.md` index line
|
|
74
76
|
- [Error recovery](config/helps/error-recovery.md) — the lookup the agent reads on tool failures (sandbox gh/git/SSH, Marp PDF, registry import, build/workspace, plugin runtime, a bridge gone quiet), plus the triage for a “broken” report
|
|
75
77
|
- [Bug-report FAQ](config/helps/bug-report-faq.md) — symptoms that turn out to be configuration or by design (voice input, push, chat titles, journal, connector tools, preset skills, custom views); says where to read the live value, never what it is
|
|
76
78
|
- [Telegram Bridge](config/helps/telegram.md) — how to talk to MulmoClaude from the Telegram app: creating a bot, starting the bridge, allowlisting chat IDs, commands, and troubleshooting
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Memory — typed-entry layout
|
|
2
|
+
|
|
3
|
+
The full write procedure for the typed-entry memory layout (one file per entry). The system prompt keeps only the rules that apply on every turn and points here before a write.
|
|
4
|
+
|
|
5
|
+
When you learn something from the conversation that would be useful to remember in future sessions, silently save it as a typed entry under `conversations/memory/`. Do not ask permission — just write it.
|
|
6
|
+
|
|
7
|
+
Each entry is one markdown file with YAML frontmatter:
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
---
|
|
11
|
+
name: <one-line label>
|
|
12
|
+
description: <short blurb shown in the index>
|
|
13
|
+
type: <preference|interest|fact|reference>
|
|
14
|
+
---
|
|
15
|
+
<optional longer body>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Pick the type:
|
|
19
|
+
|
|
20
|
+
- `preference` — durable habit, preference, or convention. Examples: "uses yarn (npm not allowed)", "prefers Emacs", "writes commits in English".
|
|
21
|
+
- `interest` — a topic, hobby, or domain followed long-term. Examples: "AI research papers", "robotics", "Impressionist painting".
|
|
22
|
+
- `fact` — a concrete personal fact that could become stale over time. Examples: "planning a trip to Egypt", "owns a toaster oven", "currently working on BootCamp project".
|
|
23
|
+
- `reference` — pointer to an internal/external resource. Examples: "main repo at ~/ss/llm/mulmoclaude4", "weekly art-exhibitions-watch task".
|
|
24
|
+
|
|
25
|
+
Filename convention: `<type>_<short-slug>.md` (lowercase ASCII, hyphenated). The frontmatter `type` is the source of truth — the filename is just for ergonomics. After writing the entry, also add a 1-line entry to `conversations/memory/MEMORY.md` of the form:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
- [<name>](<filename>) — <description>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Write when: the fact is durable, not derivable from code or git history, and not already covered by an existing entry. Update an existing entry (and its index line) instead of creating a near-duplicate.
|
|
32
|
+
|
|
33
|
+
Skip when: it is ephemeral task state, sensitive (credentials, `~/.ssh`, tokens), a duplicate, or something the user asked you to forget.
|
|
34
|
+
|
|
35
|
+
Keep entries short — name + description + a few lines of body at most. Bias toward fewer high-signal entries rather than exhaustive logging.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Memory — topic-file layout
|
|
2
|
+
|
|
3
|
+
The full write procedure for the topic-file memory layout. The system prompt keeps only the rules that apply on every turn (save silently, when to write or skip, recall before answering) and points here before a write.
|
|
4
|
+
|
|
5
|
+
When you learn something from the conversation that would be useful to remember in future sessions, silently save it under `conversations/memory/`. Do not ask permission — just write it.
|
|
6
|
+
|
|
7
|
+
Memory is organised by **topic file**. Each file lives at `conversations/memory/<type>/<topic>.md` and groups related bullets under H2 sections. The system prompt's Memory section shows the existing topics — pick from that list when adding a new bullet, and only create a new topic when nothing fits.
|
|
8
|
+
|
|
9
|
+
## Using memory proactively
|
|
10
|
+
|
|
11
|
+
Before answering, scan the system prompt's Memory section for topics related to the user's current message. The H2 tags after each `<type>/<topic>.md` line are searchable hints — match against the user's words (e.g. art / music / travel / tooling). When a topic looks relevant, `Read` the file first and weave the relevant bullets naturally into your answer. Examples:
|
|
12
|
+
|
|
13
|
+
- The user mentions a trip → check `fact/travel.md` (and any related interest topic) before suggesting destinations.
|
|
14
|
+
- The user asks about a tool / language → check `preference/dev.md` so you don't suggest something they've already vetoed.
|
|
15
|
+
- The user picks up a long-running project → check the matching `fact` or `reference` topic for prior context.
|
|
16
|
+
|
|
17
|
+
Do NOT announce that you are using memory ("according to your memory…"). The recall is for grounding your answer, not for narration. If nothing in memory is relevant, just answer normally.
|
|
18
|
+
|
|
19
|
+
Each topic file is one markdown document:
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
---
|
|
23
|
+
type: <preference|interest|fact|reference>
|
|
24
|
+
topic: <slug>
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# <Topic Name>
|
|
28
|
+
|
|
29
|
+
## <H2 Section>
|
|
30
|
+
- bullet
|
|
31
|
+
- another bullet
|
|
32
|
+
|
|
33
|
+
## <Another H2>
|
|
34
|
+
- bullet
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Pick the type:
|
|
38
|
+
|
|
39
|
+
- `preference` — durable habit, preference, or convention. Examples: yarn over npm, prefers Emacs, writes commits in English.
|
|
40
|
+
- `interest` — a topic, hobby, or domain followed long-term. Examples: AI research papers, robotics, Impressionist painting.
|
|
41
|
+
- `fact` — a concrete personal fact that could become stale over time. Examples: planning a trip to Egypt, owns a toaster oven, currently working on BootCamp project.
|
|
42
|
+
- `reference` — pointer to an internal/external resource. Examples: main repo path, weekly art-exhibitions-watch task.
|
|
43
|
+
|
|
44
|
+
Adding a new bullet:
|
|
45
|
+
|
|
46
|
+
1. Read the system prompt's Memory section. Find the topic file whose subject covers the new bullet.
|
|
47
|
+
2. `Read` that topic file. Pick the H2 section the bullet fits under (or add a new H2 if none fits — H2 sections are optional, you may also append directly under H1 for a small / new topic).
|
|
48
|
+
3. Append your bullet. Keep it short, one line ideally.
|
|
49
|
+
4. `Write` the file back.
|
|
50
|
+
5. `MEMORY.md` is rebuilt during clustering and on explicit `regenerateTopicIndex` calls; individual topic-file writes do NOT update the index immediately. If your bullet adds a new H2 that should appear in the index right away, also `Write` an updated `MEMORY.md` line for that topic.
|
|
51
|
+
|
|
52
|
+
Creating a new topic file:
|
|
53
|
+
|
|
54
|
+
- Filename: `<type>/<topic>.md` where `<topic>` is a short lowercase ASCII slug (a-z, 0-9, hyphenated). Examples: `interest/music.md`, `fact/travel.md`, `reference/tasks.md`.
|
|
55
|
+
- Body: H1 with a humanised topic name + bullet(s) under it. H2 sections are optional and best added once the topic has enough material to warrant grouping.
|
|
56
|
+
- After the topic file is written, also `Write` a matching line into `conversations/memory/MEMORY.md` so the new topic is discoverable in the next turn's Memory context. Same caveat as adding an H2: individual topic-file writes do NOT update `MEMORY.md` automatically — the index is only rebuilt during clustering or on explicit `regenerateTopicIndex` calls.
|
|
57
|
+
|
|
58
|
+
Write when: the fact is durable, not derivable from code or git history, and not already covered by an existing bullet. Update an existing bullet instead of adding a near-duplicate.
|
|
59
|
+
|
|
60
|
+
Skip when: it is ephemeral task state, sensitive (credentials, `~/.ssh`, tokens), a duplicate, or something the user asked you to forget.
|
|
61
|
+
|
|
62
|
+
Keep entries short — bias toward fewer high-signal bullets rather than exhaustive logging.
|
|
@@ -6,7 +6,7 @@ const require_relPath = require("../../../relPath-CTAjGdCL.cjs");
|
|
|
6
6
|
const require_utils_fetch = require("../../../utils/fetch.cjs");
|
|
7
7
|
const require_discovery = require("../../../discovery-DgZRmO7F.cjs");
|
|
8
8
|
const require_templatePath = require("../../../templatePath-27vUZowm.cjs");
|
|
9
|
-
const require_server = require("../../../server-
|
|
9
|
+
const require_server = require("../../../server-CJek9Y3Q.cjs");
|
|
10
10
|
const require_skill_bridge_index = require("../../../skill-bridge/index.cjs");
|
|
11
11
|
const require_types = require("../../../types-CNqkLT4M.cjs");
|
|
12
12
|
let node_fs = require("node:fs");
|
|
@@ -4,7 +4,7 @@ import { n as toPosixRelPath } from "../../../relPath-DW8MC8VO.js";
|
|
|
4
4
|
import { fetchWithTimeout } from "../../../utils/fetch.js";
|
|
5
5
|
import { K as safeRecordId, et as collectionsRegistriesConfigPath, ht as skillsStagingDir, lt as projectSkillsDir, r as loadCollection, rt as getWorkspaceRoot, s as CollectionSchemaZ, st as log, t as acceptParsedSchema } from "../../../discovery-CbwHtcwk.js";
|
|
6
6
|
import { t as isSafeActionTemplatePath } from "../../../templatePath-k_WNbL_Q.js";
|
|
7
|
-
import { y as ONE_SECOND_MS } from "../../../server-
|
|
7
|
+
import { y as ONE_SECOND_MS } from "../../../server-BtbbQqBY.js";
|
|
8
8
|
import { claudeSkillDir, dataSkillDir, mirrorSkillWrite } from "../../../skill-bridge/index.js";
|
|
9
9
|
import { n as parseRegistryIndex, r as isRecord, t as OFFICIAL_REGISTRY_NAME } from "../../../types-BKVZrtyc.js";
|
|
10
10
|
import { readFileSync } from "node:fs";
|
|
@@ -3,7 +3,7 @@ const require_root = require("../../root-BvwBUcol.cjs");
|
|
|
3
3
|
const require_itemId = require("../../itemId-CVrNibwT.cjs");
|
|
4
4
|
const require_discovery = require("../../discovery-DgZRmO7F.cjs");
|
|
5
5
|
const require_templatePath = require("../../templatePath-27vUZowm.cjs");
|
|
6
|
-
const require_server = require("../../server-
|
|
6
|
+
const require_server = require("../../server-CJek9Y3Q.cjs");
|
|
7
7
|
exports.APP_MANIFEST_FILE = require_discovery.APP_MANIFEST_FILE;
|
|
8
8
|
exports.BackendUnavailableError = require_discovery.BackendUnavailableError;
|
|
9
9
|
exports.COLLECTION_ROOT_REQUIRED = require_discovery.COLLECTION_ROOT_REQUIRED;
|
|
@@ -2,5 +2,5 @@ import { t as canonicalRoot } from "../../root-BcS4-Kge.js";
|
|
|
2
2
|
import { K as COMPUTED_TYPES } from "../../itemId-C9s-Jd5s.js";
|
|
3
3
|
import { $ as collectionChangePayload, A as readItem, B as SCHEMA_FILE, C as CollectionQueryZ, D as generateItemId, E as deleteItem, F as loadAppManifest, G as resolveTemplatePath, H as isUnderRealRoot, I as parseAppManifest, J as BackendUnavailableError, K as safeRecordId, L as sharedItemsPath, M as writeItem, N as APP_MANIFEST_FILE, O as isRegularFile, P as appManifestReason, Q as collectionChangeKey, R as pageFromFullRead, S as compileJsonlQuery, T as MAX_QUERY_ROWS, U as itemFilePath, V as isContainedInRoot, W as resolveDataDir, X as COLLECTION_ROOT_REQUIRED, Y as isBackendUnavailable, _ as dedupeByRecordId, a as toDetail, ct as peekWorkspaceRoot, d as storeFor, dt as setCollectionChangePublisher, ft as setFirestoreAccessor, g as decodeCsvRecordId, h as csvRowToItem, i as resolvePrimaryField, it as hostSupportsSharedCollections, j as resolveCreateItemId, k as listItems, l as collectionWritable, mt as sharedCollectionChangePayload, n as discoverCollections, nt as firestoreHandle, o as toSummary, ot as localCollectionKey, p as MAX_CSV_ROWS, pt as setSharedCollectionsSupport, q as safeSlugName, r as loadCollection, rt as getWorkspaceRoot, s as CollectionSchemaZ, st as log, t as acceptParsedSchema, tt as configureCollectionHost, u as readOnlyRefusal, ut as publishCollectionChange, v as encodeCsvRecordId, w as DEFAULT_QUERY_ROWS, x as compileCsvQuery, y as normalizeCsvValue, z as projectItemFields } from "../../discovery-CbwHtcwk.js";
|
|
4
4
|
import { i as isSafeTemplatePath, n as isSafeCustomViewI18nPath, r as isSafeCustomViewPath, t as isSafeActionTemplatePath } from "../../templatePath-k_WNbL_Q.js";
|
|
5
|
-
import { A as recordFieldProblem, B as stagedSkillDir, C as applyMutateAction, D as validateCollectionRecords, E as STORE_UNREADABLE, F as buildCollectionActionSeedPrompt, I as promptPathsFor, L as readCustomViewHtml, M as enrichItems, N as runQueryOverRows, O as validateRecordObject, P as buildActionSeedPrompt, R as readCustomViewI18n, S as schemaRelations, T as MAX_RECORD_ISSUES, _ as resolveEvery, a as MAX_UNSELECTIVE_ITEMS, b as computeCollectionIcon, c as deleteCollection, d as computeSuccessor, f as daysInMonth, g as parseCivil, h as maybeSpawnSuccessor, i as MAX_SCHEMA_ISSUES, j as runCollectionQuery, k as compileRecordZ, l as deleteCollectionRefusalMessage, m as isTriggerDue, n as MAX_PUT_ITEMS, o as makeManageCollectionTool, p as formatCivil, r as MAX_PUT_LINT, s as deleteCustomView, t as MAX_ITEMS_FILE_BYTES, u as advanceTriggerDate, v as successorId, w as firstMutateParamProblem, x as buildWorkspaceOntology, z as readSkillTemplate } from "../../server-
|
|
5
|
+
import { A as recordFieldProblem, B as stagedSkillDir, C as applyMutateAction, D as validateCollectionRecords, E as STORE_UNREADABLE, F as buildCollectionActionSeedPrompt, I as promptPathsFor, L as readCustomViewHtml, M as enrichItems, N as runQueryOverRows, O as validateRecordObject, P as buildActionSeedPrompt, R as readCustomViewI18n, S as schemaRelations, T as MAX_RECORD_ISSUES, _ as resolveEvery, a as MAX_UNSELECTIVE_ITEMS, b as computeCollectionIcon, c as deleteCollection, d as computeSuccessor, f as daysInMonth, g as parseCivil, h as maybeSpawnSuccessor, i as MAX_SCHEMA_ISSUES, j as runCollectionQuery, k as compileRecordZ, l as deleteCollectionRefusalMessage, m as isTriggerDue, n as MAX_PUT_ITEMS, o as makeManageCollectionTool, p as formatCivil, r as MAX_PUT_LINT, s as deleteCustomView, t as MAX_ITEMS_FILE_BYTES, u as advanceTriggerDate, v as successorId, w as firstMutateParamProblem, x as buildWorkspaceOntology, z as readSkillTemplate } from "../../server-BtbbQqBY.js";
|
|
6
6
|
export { APP_MANIFEST_FILE, BackendUnavailableError, COLLECTION_ROOT_REQUIRED, COMPUTED_TYPES, CollectionQueryZ, CollectionSchemaZ, DEFAULT_QUERY_ROWS, MAX_CSV_ROWS, MAX_ITEMS_FILE_BYTES, MAX_PUT_ITEMS, MAX_PUT_LINT, MAX_QUERY_ROWS, MAX_RECORD_ISSUES, MAX_SCHEMA_ISSUES, MAX_UNSELECTIVE_ITEMS, SCHEMA_FILE, STORE_UNREADABLE, acceptParsedSchema, advanceTriggerDate, appManifestReason, applyMutateAction, buildActionSeedPrompt, buildCollectionActionSeedPrompt, buildWorkspaceOntology, canonicalRoot, collectionChangeKey, collectionChangePayload, collectionWritable, compileCsvQuery, compileJsonlQuery, compileRecordZ, computeCollectionIcon, computeSuccessor, configureCollectionHost, csvRowToItem, daysInMonth, decodeCsvRecordId, dedupeByRecordId, deleteCollection, deleteCollectionRefusalMessage, deleteCustomView, deleteItem, discoverCollections, encodeCsvRecordId, enrichItems, firestoreHandle, firstMutateParamProblem, formatCivil, generateItemId, getWorkspaceRoot, hostSupportsSharedCollections, isBackendUnavailable, isContainedInRoot, isRegularFile, isSafeActionTemplatePath, isSafeCustomViewI18nPath, isSafeCustomViewPath, isSafeTemplatePath, isTriggerDue, isUnderRealRoot, itemFilePath, listItems, loadAppManifest, loadCollection, localCollectionKey, log, makeManageCollectionTool, maybeSpawnSuccessor, normalizeCsvValue, pageFromFullRead, parseAppManifest, parseCivil, peekWorkspaceRoot, projectItemFields, promptPathsFor, publishCollectionChange, readCustomViewHtml, readCustomViewI18n, readItem, readOnlyRefusal, readSkillTemplate, recordFieldProblem, resolveCreateItemId, resolveDataDir, resolveEvery, resolvePrimaryField, resolveTemplatePath, runCollectionQuery, runQueryOverRows, safeRecordId, safeSlugName, schemaRelations, setCollectionChangePublisher, setFirestoreAccessor, setSharedCollectionsSupport, sharedCollectionChangePayload, sharedItemsPath, stagedSkillDir, storeFor, successorId, toDetail, toSummary, validateCollectionRecords, validateRecordObject, writeItem };
|
|
@@ -158,5 +158,9 @@ export declare function makeManageCollectionTool(deps?: ManageCollectionDeps): {
|
|
|
158
158
|
};
|
|
159
159
|
alwaysActive: boolean;
|
|
160
160
|
prompt: string;
|
|
161
|
+
promptCompact: string;
|
|
162
|
+
promptFiles: {
|
|
163
|
+
"manageCollection.md": string;
|
|
164
|
+
};
|
|
161
165
|
handler: (args: Record<string, unknown>) => Promise<string>;
|
|
162
166
|
};
|
|
@@ -4,7 +4,7 @@ const require_itemId = require("../itemId-CVrNibwT.cjs");
|
|
|
4
4
|
const require_promptSafety = require("../promptSafety-yET9jLep.cjs");
|
|
5
5
|
require("../collection/index.cjs");
|
|
6
6
|
const require_discovery = require("../discovery-DgZRmO7F.cjs");
|
|
7
|
-
const require_server = require("../server-
|
|
7
|
+
const require_server = require("../server-CJek9Y3Q.cjs");
|
|
8
8
|
const require_notifier = require("../notifier-CiemUClt.cjs");
|
|
9
9
|
let node_fs_promises = require("node:fs/promises");
|
|
10
10
|
//#region src/collection-watchers/config.ts
|
|
@@ -3,7 +3,7 @@ import { $ as fieldText, P as isValidCollectionName } from "../itemId-C9s-Jd5s.j
|
|
|
3
3
|
import { D as whenMatches, f as itemIsDone } from "../promptSafety-DFaOnOWN.js";
|
|
4
4
|
import "../collection/index.js";
|
|
5
5
|
import { $ as collectionChangePayload, U as itemFilePath, ct as peekWorkspaceRoot, d as storeFor, mt as sharedCollectionChangePayload, n as discoverCollections, nt as firestoreHandle, r as loadCollection, ut as publishCollectionChange } from "../discovery-CbwHtcwk.js";
|
|
6
|
-
import { h as maybeSpawnSuccessor, m as isTriggerDue } from "../server-
|
|
6
|
+
import { h as maybeSpawnSuccessor, m as isTriggerDue } from "../server-BtbbQqBY.js";
|
|
7
7
|
import { d as publish, m as updateForPlugin, n as clear, s as listAll } from "../notifier-dgkC-h80.js";
|
|
8
8
|
import { access } from "node:fs/promises";
|
|
9
9
|
//#region src/collection-watchers/config.ts
|
|
@@ -5,7 +5,7 @@ const require_root = require("../../root-BvwBUcol.cjs");
|
|
|
5
5
|
const require_itemId = require("../../itemId-CVrNibwT.cjs");
|
|
6
6
|
const require_project = require("../../project-C1ep9pvo.cjs");
|
|
7
7
|
const require_discovery = require("../../discovery-DgZRmO7F.cjs");
|
|
8
|
-
const require_server = require("../../server-
|
|
8
|
+
const require_server = require("../../server-CJek9Y3Q.cjs");
|
|
9
9
|
const require_feeds_paths = require("../paths.cjs");
|
|
10
10
|
const require_ingestTypes = require("../../ingestTypes-DS9HiR2I.cjs");
|
|
11
11
|
const require_notifier = require("../../notifier-CiemUClt.cjs");
|
|
@@ -3,7 +3,7 @@ import { t as canonicalRoot } from "../../root-BcS4-Kge.js";
|
|
|
3
3
|
import { J as INGEST_KINDS, q as FEED_SCHEDULES } from "../../itemId-C9s-Jd5s.js";
|
|
4
4
|
import { t as mergeIntoExisting } from "../../project-B0j_Vf_Q.js";
|
|
5
5
|
import { W as resolveDataDir, _t as createForwardingLogger, d as storeFor, k as listItems, n as discoverCollections, q as safeSlugName, vt as createHostSlot } from "../../discovery-CbwHtcwk.js";
|
|
6
|
-
import { F as buildCollectionActionSeedPrompt, I as promptPathsFor, z as readSkillTemplate } from "../../server-
|
|
6
|
+
import { F as buildCollectionActionSeedPrompt, I as promptPathsFor, z as readSkillTemplate } from "../../server-BtbbQqBY.js";
|
|
7
7
|
import { FEEDS_DIR, feedDir, feedStatePath, feedsRoot, ingestStateDir, ingestStatePath } from "../paths.js";
|
|
8
8
|
import { n as DEFAULT_FEED_MAX_ITEMS, r as isFeedSchedule, t as AGENT_INGEST_KIND } from "../../ingestTypes-Bs31Xt5c.js";
|
|
9
9
|
import { d as publish, n as clear } from "../../notifier-dgkC-h80.js";
|
|
@@ -2342,6 +2342,20 @@ async function handlePutSchema(slug, schemaArg, deps) {
|
|
|
2342
2342
|
});
|
|
2343
2343
|
}
|
|
2344
2344
|
var MANAGE_COLLECTION_PROMPT = "Use `manageCollection` instead of raw Read/Write/Edit when working with a collection's records OR its schema (raw file I/O stays available as the escape hatch). Before authoring or changing a collection's `schema.json`, call `schemaDocs` to load the field/DSL reference — the default reply is the core authoring guide plus a table of contents; fetch advanced sections (actions, bells, calendar/kanban views, dataSource, storage) by passing their heading as `topic` rather than dumping `topic: \"all\"`. Then read with `getSchema` and write with `putSchema` — `putSchema` validates the whole schema before writing and returns actionable errors instead of silently failing discovery's validation. `getItems` is the only way to see computed values — `derived` fields (e.g. a portfolio's value), `toggle` projections, and `embed` records are host-computed and never present in the stored JSON files. On large collections pass `ids` and/or `fields` to keep the result small. For a question that spans collections (\"which clients have unpaid invoices?\"), start with `getOntology`: it lists every collection with its primaryKey, record count, and outbound `ref`/`embed` relations, so you know which collections to join before reading any records. `putItems` GATES every row on what would make the record unopenable — required fields, enum values, primaryKey = record id — and returns `{ written, rejected }`; fix each rejected row using its `problem` text and retry just those rows. Never include computed fields in a row you write. That gate does NOT check the SHAPE of a value: a `datetime` written as an instant (`2026-08-17T15:00:00.000Z`, what `toISOString()` produces) rather than as a wall clock, a `number` holding something that is not a number at all, a `date` that is not a real day are all WRITTEN, and come back in a `lint` block beside `written`. Read it — a full `getItems` listing warns about the same rows and publishing a shared app REFUSES them, so a silent `lint` is the only proof the values are right. Before generating a large set, read the exact stored form of each type in the `Field types` section of `schemaDocs` (`topic: \"Field types\"` fetches just that one), then write ONE batch and check that `lint` is absent. `datetime` in particular is a local wall clock (`YYYY-MM-DDTHH:MM`, no timezone suffix; a bare `YYYY-MM-DD` means ALL DAY and is not the same as `…T00:00`, a real midnight start), so `new Date(...).toISOString()` is wrong twice over — the suffix, and the hours the conversion moved. The one `Z`-suffixed datetime the strict tier accepts is a shared app's server-stamped instant, written by the SERVER with nine fractional digits; you never produce that value. When the rows come from a script rather than from you (a generated schedule, an imported set, anything past a few dozen records), write them to a JSON file UNDER THE WORKSPACE and pass its absolute path as `itemsFile` instead of `items` — the host reads the file, so the rows never pass through your context. Do NOT hand-transcribe a generated file into `items`, and never drive the collection by spawning the MCP bridge yourself. To update a few fields of an existing record, use `mode: \"merge\"` with a partial row ({ id, <changed fields> }) — the default upsert replaces the WHOLE record, so a partial upsert would silently erase every optional field it omits. `deleteItems` removes records by id and returns `{ deleted, rejected }`; an id that doesn't exist comes back rejected rather than counted as deleted, so check `rejected` before reporting a deletion as done. Answer aggregation questions (counts, sums, averages, group-bys) with `queryItems` on ANY collection — on a dataSource (CSV) collection it scans the whole file (getItems is row-capped, so aggregates computed from its output can be silently wrong on large files); on a file-backed collection it aggregates the enriched records, so computed fields (derived/rollup/toggle) are queryable columns.";
|
|
2345
|
+
var MANAGE_COLLECTION_REFERENCE_FILE = "manageCollection.md";
|
|
2346
|
+
/** Injected instead of the full prompt by a host that supports `promptCompact` /
|
|
2347
|
+
* `promptFiles` (`../../prompt-files`). Keeps every rule that decides whether to
|
|
2348
|
+
* call the tool, and the one write rule whose omission loses data (a partial
|
|
2349
|
+
* upsert erases fields); the write-gate / lint / field-format detail is behind
|
|
2350
|
+
* the Read. */
|
|
2351
|
+
var MANAGE_COLLECTION_PROMPT_COMPACT = [
|
|
2352
|
+
"Use `manageCollection` instead of raw Read/Write/Edit for a collection's records or schema.",
|
|
2353
|
+
"`getItems` is the only way to see computed values (`derived`, `toggle`, `embed`); pass `ids` / `fields` on large collections.",
|
|
2354
|
+
"Start a cross-collection question with `getOntology`, and answer counts / sums / averages / group-bys with `queryItems`.",
|
|
2355
|
+
"Before changing a `schema.json`, call `schemaDocs`, then `getSchema` / `putSchema`.",
|
|
2356
|
+
"To update a few fields use `mode: \"merge\"` — the default upsert replaces the WHOLE record and erases every optional field the row omits.",
|
|
2357
|
+
`Before writing or deleting records (\`putItems\`, \`itemsFile\`, \`deleteItems\`), Read {{promptFilesDir}}/${MANAGE_COLLECTION_REFERENCE_FILE} for the write gate, the \`lint\` block and the stored form of each field type.`
|
|
2358
|
+
].join(" ");
|
|
2345
2359
|
/** Validate getItems' optional `ids`/`fields` args, then delegate. */
|
|
2346
2360
|
async function dispatchGetItems(collection, args, deps) {
|
|
2347
2361
|
const ids = optionalStringArray(args.ids, "ids");
|
|
@@ -2468,10 +2482,12 @@ function makeManageCollectionTool(deps = {}) {
|
|
|
2468
2482
|
definition: MANAGE_COLLECTION_DEFINITION,
|
|
2469
2483
|
alwaysActive: true,
|
|
2470
2484
|
prompt: MANAGE_COLLECTION_PROMPT,
|
|
2485
|
+
promptCompact: MANAGE_COLLECTION_PROMPT_COMPACT,
|
|
2486
|
+
promptFiles: { [MANAGE_COLLECTION_REFERENCE_FILE]: MANAGE_COLLECTION_PROMPT },
|
|
2471
2487
|
handler: (args) => manageCollectionHandler(deps, args)
|
|
2472
2488
|
};
|
|
2473
2489
|
}
|
|
2474
2490
|
//#endregion
|
|
2475
2491
|
export { recordFieldProblem as A, stagedSkillDir as B, applyMutateAction as C, validateCollectionRecords as D, STORE_UNREADABLE as E, buildCollectionActionSeedPrompt as F, promptPathsFor as I, readCustomViewHtml as L, enrichItems as M, runQueryOverRows as N, validateRecordObject as O, buildActionSeedPrompt as P, readCustomViewI18n as R, schemaRelations as S, MAX_RECORD_ISSUES as T, resolveEvery as _, MAX_UNSELECTIVE_ITEMS as a, computeCollectionIcon as b, deleteCollection as c, computeSuccessor as d, daysInMonth as f, parseCivil as g, maybeSpawnSuccessor as h, MAX_SCHEMA_ISSUES as i, runCollectionQuery as j, compileRecordZ as k, deleteCollectionRefusalMessage as l, isTriggerDue as m, MAX_PUT_ITEMS as n, makeManageCollectionTool as o, formatCivil as p, MAX_PUT_LINT as r, deleteCustomView as s, MAX_ITEMS_FILE_BYTES as t, advanceTriggerDate as u, successorId as v, firstMutateParamProblem as w, buildWorkspaceOntology as x, ONE_SECOND_MS as y, readSkillTemplate as z };
|
|
2476
2492
|
|
|
2477
|
-
//# sourceMappingURL=server-
|
|
2493
|
+
//# sourceMappingURL=server-BtbbQqBY.js.map
|