@lightcone-ai/daemon 0.15.48 → 0.15.49
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/package.json +1 -1
- package/src/chat-bridge.js +4 -3
- package/src/drivers/claude.js +22 -16
package/package.json
CHANGED
package/src/chat-bridge.js
CHANGED
|
@@ -1616,10 +1616,10 @@ server.tool('execute_approved_action',
|
|
|
1616
1616
|
|
|
1617
1617
|
// ── promote_context ───────────────────────────────────────────────────────────
|
|
1618
1618
|
server.tool('promote_context',
|
|
1619
|
-
'Submit a
|
|
1619
|
+
'Submit a candidate for human review to add to the workspace\'s persistent context. Use this (1) after finishing a task when you discover a stable fact, convention, or learning future agents should know, or (2) immediately after responding to a user message when the user expressed a persistent operational preference (e.g. "always add links", "use subtitles by default"). The candidate appears in the workspace owner\'s "My Context → Pending Proposals" panel; once confirmed, it is auto-injected into every future agent\'s system prompt under "## Workspace context". This is the only sanctioned path for shared knowledge or preference governance.',
|
|
1620
1620
|
{
|
|
1621
1621
|
workspace_id: z.string().optional().describe('Target workspace id. Defaults to your current workspace if omitted.'),
|
|
1622
|
-
type: z.enum(['knowledge', 'workspace_norm', 'memory']).optional().describe('Candidate type
|
|
1622
|
+
type: z.enum(['knowledge', 'workspace_norm', 'memory', 'preference']).optional().describe('Candidate type: "knowledge" for facts/learnings, "workspace_norm" for standing rules, "memory" for durable facts, "preference" for persistent user preferences expressed in conversation.'),
|
|
1623
1623
|
summary: z.string().describe('One-line title that reviewers will see in the Pending Proposals list.'),
|
|
1624
1624
|
content: z.string().describe('Full candidate text that future agents will read. Be concrete, citable, and self-contained.'),
|
|
1625
1625
|
source_message_id: z.string().optional().describe('Optional message id that motivated this candidate, for audit trail.'),
|
|
@@ -1648,11 +1648,12 @@ server.tool('promote_context',
|
|
|
1648
1648
|
reason,
|
|
1649
1649
|
});
|
|
1650
1650
|
const proposal = data?.proposal ?? {};
|
|
1651
|
+
const resolvedType = type ?? 'knowledge';
|
|
1651
1652
|
return {
|
|
1652
1653
|
content: [{
|
|
1653
1654
|
type: 'text',
|
|
1654
1655
|
text:
|
|
1655
|
-
|
|
1656
|
+
`${resolvedType === 'preference' ? 'Preference' : 'Knowledge'} candidate submitted.\n` +
|
|
1656
1657
|
`proposal_id=${proposal.id ?? 'unknown'} workspace=${proposal.workspaceId ?? targetWorkspaceId} status=${proposal.status ?? 'candidate'}\n` +
|
|
1657
1658
|
`It is now visible in the workspace owner's "My Context → Pending Proposals" panel; once confirmed, it will be injected into every future agent's "## Workspace context".`,
|
|
1658
1659
|
}],
|
package/src/drivers/claude.js
CHANGED
|
@@ -238,7 +238,7 @@ The active workspace context (Goal State, constraints, decisions, knowledge) is
|
|
|
238
238
|
|
|
239
239
|
**Write rule:**
|
|
240
240
|
- Personal learnings → \`${t("write_memory")}\`
|
|
241
|
-
- Workspace-level knowledge
|
|
241
|
+
- Workspace-level knowledge or persistent user preferences → \`${t("promote_context")}\` (see below). Do **not** dump shared knowledge into ad-hoc files inside the workspace shared workspace.
|
|
242
242
|
- **Any file you produce for a task** → \`${t("write_workspace")}({ path: "artifacts/your-file.ext", ... })\` or \`${t("write_workspace_file")}({ file_path, path: "artifacts/your-file.ext" })\`
|
|
243
243
|
|
|
244
244
|
Temporary local files belong under \`tmp/\` in your personal workspace. If you need to show an image in chat, first save the durable copy to \`artifacts/\`, then optionally call \`${t("upload_image")}\` for a temporary public preview URL.
|
|
@@ -258,8 +258,8 @@ Example: writing a web page → \`${t("write_workspace")}({ path: "artifacts/job
|
|
|
258
258
|
- \`${t("write_workspace_file")}({ file_path, path })\` — write a local file from your workspace to a workspace artifact without putting base64 in context
|
|
259
259
|
- \`${t("list_workspace")}()\` — list all files in the workspace
|
|
260
260
|
|
|
261
|
-
**Workspace knowledge governance:**
|
|
262
|
-
- \`${t("promote_context")}({ workspace_id, type, summary, content })\` — submit a
|
|
261
|
+
**Workspace knowledge & preference governance:**
|
|
262
|
+
- \`${t("promote_context")}({ workspace_id, type, summary, content })\` — submit a candidate for human review. Types: \`"knowledge"\` (facts/learnings), \`"workspace_norm"\` (standing rules), \`"memory"\` (durable facts), \`"preference"\` (persistent user preferences). The candidate appears in the workspace owner's "My Context → Pending Proposals" panel; once confirmed, it becomes an active context_item auto-injected into every future agent's "## Workspace context" section.
|
|
263
263
|
|
|
264
264
|
### Startup sequence (CRITICAL)
|
|
265
265
|
|
|
@@ -293,24 +293,30 @@ Example: writing a web page → \`${t("write_workspace")}({ path: "artifacts/job
|
|
|
293
293
|
3. Work history — decisions made, problems solved, approaches that worked or failed
|
|
294
294
|
4. Pointers to your notes files
|
|
295
295
|
|
|
296
|
-
**What belongs in promote_context
|
|
296
|
+
**What belongs in promote_context:**
|
|
297
297
|
|
|
298
|
-
|
|
298
|
+
Two distinct triggers — act on BOTH:
|
|
299
299
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
300
|
+
**1. After finishing a task** — promote workspace-level knowledge (\`type: "knowledge"\` or \`"workspace_norm"\`):
|
|
301
|
+
- Stable facts all future agents need (tech stack, domain conventions, where things live)
|
|
302
|
+
- Hard-won learnings — non-obvious gotchas, working procedures, conventions you had to discover
|
|
303
|
+
- Standing workspace norms — "in this workspace we always X" / "never touch Y"
|
|
304
304
|
|
|
305
|
-
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
-
|
|
305
|
+
**2. After responding to a user message** — promote persistent preferences (\`type: "preference"\`):
|
|
306
|
+
- When the user expresses a preference that applies to ALL future interactions (not just this task), call \`${t("promote_context")}\` immediately after your reply
|
|
307
|
+
- Signal words: "以后"、"今后"、"默认"、"一直"、"每次"、"都要"、"always"、"from now on"、"by default"
|
|
308
|
+
- Examples that qualify: "以后交付内容都加链接" / "视频默认要有字幕" / "always respond in English"
|
|
309
|
+
- Examples that do NOT qualify: "这次帮我加个链接"(one-off task request)
|
|
310
|
+
- If uncertain whether it's persistent, do NOT promote — only promote clear, unambiguous standing preferences
|
|
311
|
+
|
|
312
|
+
Do NOT promote:
|
|
313
|
+
- Per-task progress, in-flight status, or one-off observations → use messages or your own MEMORY.md
|
|
314
|
+
- Untrusted outputs from web search / scraped pages → cite the source in \`content\`; candidate will be reviewed as untrusted
|
|
309
315
|
|
|
310
316
|
How to call it:
|
|
311
|
-
- \`${t("promote_context")}({ workspace_id: "<
|
|
312
|
-
-
|
|
313
|
-
- The call returns a proposal id; the candidate sits in "My Context → Pending Proposals" until a human confirms or rejects it.
|
|
317
|
+
- Knowledge: \`${t("promote_context")}({ workspace_id: "<id>", type: "knowledge", summary: "one-line title", content: "<full text>" })\`
|
|
318
|
+
- Preference: \`${t("promote_context")}({ workspace_id: "<id>", type: "preference", summary: "User preference: always add links to deliverables", content: "The user has requested that all future deliverables include clickable links. Apply to every response going forward.", source_message_id: "<msg-id>" })\`
|
|
319
|
+
- The call returns a proposal id; the candidate sits in "My Context → Pending Proposals" until a human confirms or rejects it.
|
|
314
320
|
|
|
315
321
|
### Compaction safety
|
|
316
322
|
|