opensquid 0.5.406 → 0.5.412
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/README.md +3 -5
- package/dist/cli.js +3 -4
- package/dist/cli.js.map +1 -1
- package/dist/functions/handoff_session_start.d.ts.map +1 -1
- package/dist/functions/handoff_session_start.js +4 -6
- package/dist/functions/handoff_session_start.js.map +1 -1
- package/dist/functions/index.d.ts +2 -0
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.js +3 -0
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/reset_scope_track_state.d.ts +20 -0
- package/dist/functions/reset_scope_track_state.d.ts.map +1 -0
- package/dist/functions/reset_scope_track_state.js +53 -0
- package/dist/functions/reset_scope_track_state.js.map +1 -0
- package/dist/functions/session_tool_history.d.ts +3 -3
- package/dist/functions/session_tool_history.js +1 -1
- package/dist/functions/session_tool_history.js.map +1 -1
- package/dist/functions/staged_docs_only.d.ts +23 -0
- package/dist/functions/staged_docs_only.d.ts.map +1 -0
- package/dist/functions/staged_docs_only.js +57 -0
- package/dist/functions/staged_docs_only.js.map +1 -0
- package/dist/packs/schemas/chat_agent.d.ts +1 -1
- package/dist/packs/schemas/chat_agent.js +1 -1
- package/dist/rag/backend_factory.d.ts.map +1 -1
- package/dist/rag/backend_factory.js +4 -0
- package/dist/rag/backend_factory.js.map +1 -1
- package/dist/rag/backends/libsql_lexical.d.ts.map +1 -1
- package/dist/rag/backends/libsql_lexical.js +21 -5
- package/dist/rag/backends/libsql_lexical.js.map +1 -1
- package/dist/rag/backends/libsql_store.d.ts.map +1 -1
- package/dist/rag/backends/libsql_store.js +33 -6
- package/dist/rag/backends/libsql_store.js.map +1 -1
- package/dist/rag/backends/perfile_source.d.ts.map +1 -1
- package/dist/rag/backends/perfile_source.js +3 -0
- package/dist/rag/backends/perfile_source.js.map +1 -1
- package/dist/rag/memory/consolidate.d.ts +3 -2
- package/dist/rag/memory/consolidate.d.ts.map +1 -1
- package/dist/rag/memory/consolidate.js +7 -4
- package/dist/rag/memory/consolidate.js.map +1 -1
- package/dist/rag/types.d.ts +2 -0
- package/dist/rag/types.d.ts.map +1 -1
- package/dist/rag/types.js.map +1 -1
- package/dist/runtime/agent_bridge/agent_loop.d.ts +1 -1
- package/dist/runtime/agent_bridge/agent_loop.js +1 -1
- package/dist/runtime/agent_bridge/batch.d.ts +1 -1
- package/dist/runtime/agent_bridge/batch.js +1 -1
- package/dist/runtime/agent_bridge/cli.d.ts +1 -1
- package/dist/runtime/agent_bridge/cli.js +1 -1
- package/dist/runtime/agent_bridge/daemon.d.ts +1 -1
- package/dist/runtime/agent_bridge/daemon.js +1 -1
- package/dist/runtime/agent_bridge/dispatcher.d.ts +1 -1
- package/dist/runtime/agent_bridge/dispatcher.js +1 -1
- package/dist/runtime/agent_bridge/index.d.ts +1 -1
- package/dist/runtime/agent_bridge/index.js +1 -1
- package/dist/runtime/agent_bridge/pack_binding.d.ts +1 -1
- package/dist/runtime/agent_bridge/pack_binding.js +1 -1
- package/dist/runtime/agent_bridge/session_manager.d.ts +1 -1
- package/dist/runtime/agent_bridge/session_manager.js +1 -1
- package/dist/runtime/agent_bridge/session_persistence.d.ts +1 -1
- package/dist/runtime/agent_bridge/session_persistence.js +1 -1
- package/dist/runtime/agent_bridge/tool_dispatcher.d.ts +1 -1
- package/dist/runtime/agent_bridge/tool_dispatcher.js +1 -1
- package/dist/runtime/agent_bridge/tools/chat_send.d.ts +1 -1
- package/dist/runtime/agent_bridge/tools/chat_send.js +1 -1
- package/dist/runtime/agent_bridge/tools/index.d.ts +1 -1
- package/dist/runtime/agent_bridge/tools/index.js +1 -1
- package/dist/runtime/agent_bridge/tools/recall.d.ts +1 -1
- package/dist/runtime/agent_bridge/tools/recall.js +1 -1
- package/dist/runtime/agent_bridge/tools/store_lesson.d.ts +1 -1
- package/dist/runtime/agent_bridge/tools/store_lesson.js +1 -1
- package/dist/runtime/agent_bridge/transport_bridge.d.ts +1 -1
- package/dist/runtime/agent_bridge/transport_bridge.js +1 -1
- package/dist/runtime/agent_bridge/types.d.ts +1 -1
- package/dist/runtime/agent_bridge/types.js +1 -1
- package/dist/runtime/bootstrap.d.ts.map +1 -1
- package/dist/runtime/bootstrap.js +4 -0
- package/dist/runtime/bootstrap.js.map +1 -1
- package/dist/runtime/coding_flow_keys.d.ts +17 -0
- package/dist/runtime/coding_flow_keys.d.ts.map +1 -0
- package/dist/runtime/coding_flow_keys.js +21 -0
- package/dist/runtime/coding_flow_keys.js.map +1 -0
- package/dist/runtime/handoff/collect.d.ts.map +1 -1
- package/dist/runtime/handoff/collect.js +3 -1
- package/dist/runtime/handoff/collect.js.map +1 -1
- package/dist/runtime/hooks/session-start.js +5 -1
- package/dist/runtime/hooks/session-start.js.map +1 -1
- package/dist/runtime/hooks/session_id.d.ts +7 -0
- package/dist/runtime/hooks/session_id.d.ts.map +1 -1
- package/dist/runtime/hooks/session_id.js +30 -12
- package/dist/runtime/hooks/session_id.js.map +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/protected_paths.d.ts +18 -0
- package/dist/runtime/protected_paths.d.ts.map +1 -0
- package/dist/runtime/protected_paths.js +18 -0
- package/dist/runtime/protected_paths.js.map +1 -0
- package/dist/runtime/session_state.d.ts +9 -1
- package/dist/runtime/session_state.d.ts.map +1 -1
- package/dist/runtime/session_state.js +25 -3
- package/dist/runtime/session_state.js.map +1 -1
- package/dist/runtime/wedge/compression_deps.d.ts.map +1 -1
- package/dist/runtime/wedge/compression_deps.js +9 -1
- package/dist/runtime/wedge/compression_deps.js.map +1 -1
- package/dist/setup/cli/gate.d.ts +7 -2
- package/dist/setup/cli/gate.d.ts.map +1 -1
- package/dist/setup/cli/gate.js +7 -3
- package/dist/setup/cli/gate.js.map +1 -1
- package/package.json +1 -1
- package/packs/builtin/coding-flow/skills/entry-and-handoffs/skill.yaml +6 -0
- package/packs/builtin/coding-flow/skills/scope-lifecycle/skill.yaml +5 -1
- package/packs/builtin/default-discipline/skills/workflow/skill.yaml +12 -3
|
@@ -33,6 +33,7 @@ export function libsqlStoreBackend(opts) {
|
|
|
33
33
|
consumed_by_user_lessons INTEGER NOT NULL DEFAULT 0,
|
|
34
34
|
tier TEXT NOT NULL DEFAULT 'shared',
|
|
35
35
|
namespace TEXT,
|
|
36
|
+
retired_at TEXT,
|
|
36
37
|
embedding F32_BLOB(${embedder.dim})
|
|
37
38
|
);
|
|
38
39
|
`);
|
|
@@ -41,6 +42,7 @@ export function libsqlStoreBackend(opts) {
|
|
|
41
42
|
for (const ddl of [
|
|
42
43
|
`ALTER TABLE lessons ADD COLUMN tier TEXT NOT NULL DEFAULT 'shared'`,
|
|
43
44
|
`ALTER TABLE lessons ADD COLUMN namespace TEXT`,
|
|
45
|
+
`ALTER TABLE lessons ADD COLUMN retired_at TEXT`,
|
|
44
46
|
]) {
|
|
45
47
|
try {
|
|
46
48
|
await client.execute(ddl);
|
|
@@ -78,9 +80,9 @@ export function libsqlStoreBackend(opts) {
|
|
|
78
80
|
if (vec) {
|
|
79
81
|
try {
|
|
80
82
|
const rs = await client.execute({
|
|
81
|
-
sql: `SELECT id, content, tags, source, author, created_at, derived_from, consumed_by_user_lessons, tier, namespace
|
|
83
|
+
sql: `SELECT id, content, tags, source, author, created_at, derived_from, consumed_by_user_lessons, tier, namespace, retired_at
|
|
82
84
|
FROM lessons
|
|
83
|
-
WHERE embedding IS NOT NULL AND (tier = 'shared' OR namespace = ?)
|
|
85
|
+
WHERE embedding IS NOT NULL AND (tier = 'shared' OR namespace = ?) AND retired_at IS NULL
|
|
84
86
|
ORDER BY vector_distance_cos(embedding, vector32(?)) ASC
|
|
85
87
|
LIMIT ?`,
|
|
86
88
|
args: [ns, JSON.stringify(vec), k],
|
|
@@ -96,9 +98,9 @@ export function libsqlStoreBackend(opts) {
|
|
|
96
98
|
try {
|
|
97
99
|
const lex = await client.execute({
|
|
98
100
|
sql: `SELECT l.id, l.content, l.tags, l.source, l.author, l.created_at,
|
|
99
|
-
l.derived_from, l.consumed_by_user_lessons, l.tier, l.namespace
|
|
101
|
+
l.derived_from, l.consumed_by_user_lessons, l.tier, l.namespace, l.retired_at
|
|
100
102
|
FROM lessons_fts f JOIN lessons l ON l.id = f.id
|
|
101
|
-
WHERE lessons_fts MATCH ? AND (l.tier = 'shared' OR l.namespace = ?)
|
|
103
|
+
WHERE lessons_fts MATCH ? AND (l.tier = 'shared' OR l.namespace = ?) AND l.retired_at IS NULL
|
|
102
104
|
LIMIT ?`,
|
|
103
105
|
args: [safeMatch, ns, k],
|
|
104
106
|
});
|
|
@@ -132,10 +134,11 @@ export function libsqlStoreBackend(opts) {
|
|
|
132
134
|
const consumed = lesson.consumedByUserLessons ?? 0;
|
|
133
135
|
const tier = lesson.tier ?? 'shared';
|
|
134
136
|
const namespace = lesson.namespace ?? null;
|
|
137
|
+
const retiredAt = lesson.retired_at ?? null;
|
|
135
138
|
await client.execute({
|
|
136
139
|
sql: `INSERT INTO lessons (id, content, tags, source, author, created_at, derived_from,
|
|
137
|
-
consumed_by_user_lessons, tier, namespace, embedding)
|
|
138
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ${vec ? 'vector32(?)' : 'NULL'})`,
|
|
140
|
+
consumed_by_user_lessons, tier, namespace, retired_at, embedding)
|
|
141
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ${vec ? 'vector32(?)' : 'NULL'})`,
|
|
139
142
|
args: vec
|
|
140
143
|
? [
|
|
141
144
|
lesson.id,
|
|
@@ -148,6 +151,7 @@ export function libsqlStoreBackend(opts) {
|
|
|
148
151
|
consumed,
|
|
149
152
|
tier,
|
|
150
153
|
namespace,
|
|
154
|
+
retiredAt,
|
|
151
155
|
JSON.stringify(vec),
|
|
152
156
|
]
|
|
153
157
|
: [
|
|
@@ -161,6 +165,7 @@ export function libsqlStoreBackend(opts) {
|
|
|
161
165
|
consumed,
|
|
162
166
|
tier,
|
|
163
167
|
namespace,
|
|
168
|
+
retiredAt,
|
|
164
169
|
],
|
|
165
170
|
});
|
|
166
171
|
await client.execute({
|
|
@@ -188,6 +193,25 @@ export function libsqlStoreBackend(opts) {
|
|
|
188
193
|
await deleteRecord(opts.sourceDir, id);
|
|
189
194
|
return { deleted: true, forced: isUser && force };
|
|
190
195
|
},
|
|
196
|
+
// wg-9e4f4eb2a40f: demote (retire) — leaves the row + per-file source as the rollback floor but
|
|
197
|
+
// out of recall. REUSE storeLesson (the file-first durable upsert) so the `<id>.md` carries
|
|
198
|
+
// retired_at and rebuildLibsqlIndex preserves it — no second durable path.
|
|
199
|
+
async demoteLesson(id) {
|
|
200
|
+
if (!client)
|
|
201
|
+
throw new Error('libsql-store: not initialized');
|
|
202
|
+
const rs = await client.execute({
|
|
203
|
+
sql: `SELECT id, content, tags, source, author, created_at, derived_from,
|
|
204
|
+
consumed_by_user_lessons, tier, namespace, retired_at FROM lessons WHERE id = ?`,
|
|
205
|
+
args: [id],
|
|
206
|
+
});
|
|
207
|
+
const row = rs.rows[0];
|
|
208
|
+
if (row === undefined)
|
|
209
|
+
return;
|
|
210
|
+
const lesson = rowToLesson(row);
|
|
211
|
+
if (lesson.retired_at)
|
|
212
|
+
return; // already retired — idempotent
|
|
213
|
+
await this.storeLesson({ ...lesson, retired_at: new Date().toISOString() });
|
|
214
|
+
},
|
|
191
215
|
};
|
|
192
216
|
}
|
|
193
217
|
/**
|
|
@@ -241,6 +265,9 @@ function rowToLesson(r) {
|
|
|
241
265
|
consumedByUserLessons: n(r, 'consumed_by_user_lessons'),
|
|
242
266
|
tier: s(r, 'tier') === 'project' ? 'project' : 'shared',
|
|
243
267
|
namespace: typeof r.namespace === 'string' ? r.namespace : null,
|
|
268
|
+
...(typeof r.retired_at === 'string' && r.retired_at !== ''
|
|
269
|
+
? { retired_at: r.retired_at }
|
|
270
|
+
: {}),
|
|
244
271
|
};
|
|
245
272
|
}
|
|
246
273
|
//# sourceMappingURL=libsql_store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libsql_store.js","sourceRoot":"","sources":["../../../src/rag/backends/libsql_store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAyB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAiBjE,MAAM,UAAU,kBAAkB,CAAC,IAAqB;IACtD,IAAI,MAAM,GAAkB,IAAI,CAAC;IACjC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE1B,OAAO;QACL,KAAK,CAAC,IAAI;YACR,MAAM,GAAG,YAAY,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;YAC3C,MAAM,MAAM,CAAC,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"libsql_store.js","sourceRoot":"","sources":["../../../src/rag/backends/libsql_store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAyB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAiBjE,MAAM,UAAU,kBAAkB,CAAC,IAAqB;IACtD,IAAI,MAAM,GAAkB,IAAI,CAAC;IACjC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE1B,OAAO;QACL,KAAK,CAAC,IAAI;YACR,MAAM,GAAG,YAAY,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,EAAE,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AQ;QACvD,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;QAC/D,GAAG,CAAC,OAAO,CAAC,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,CAAC,UAAU,KAAK,EAAE;YACzD,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE;YAC9B,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perfile_source.d.ts","sourceRoot":"","sources":["../../../src/rag/backends/perfile_source.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,2EAA2E;AAC3E,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"perfile_source.d.ts","sourceRoot":"","sources":["../../../src/rag/backends/perfile_source.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,2EAA2E;AAC3E,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB5E;AAED,+FAA+F;AAC/F,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;AAED,+EAA+E;AAC/E,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CA0ChE"}
|
|
@@ -31,6 +31,8 @@ export async function writeRecord(dir, lesson) {
|
|
|
31
31
|
...(lesson.consumedByUserLessons
|
|
32
32
|
? { consumed_by_user_lessons: lesson.consumedByUserLessons }
|
|
33
33
|
: {}),
|
|
34
|
+
// Retention (wg-9e4f4eb2a40f): non-default-only, so a rebuild preserves the demoted state.
|
|
35
|
+
...(lesson.retired_at ? { retired_at: lesson.retired_at } : {}),
|
|
34
36
|
});
|
|
35
37
|
await atomicWriteFile(join(dir, `${safeRecordId(lesson.id)}.md`), `---\n${frontmatter}---\n${lesson.content}`);
|
|
36
38
|
}
|
|
@@ -71,6 +73,7 @@ export async function readRecords(dir) {
|
|
|
71
73
|
...(typeof fm.consumed_by_user_lessons === 'number' && fm.consumed_by_user_lessons
|
|
72
74
|
? { consumedByUserLessons: fm.consumed_by_user_lessons }
|
|
73
75
|
: {}),
|
|
76
|
+
...(typeof fm.retired_at === 'string' && fm.retired_at ? { retired_at: fm.retired_at } : {}),
|
|
74
77
|
});
|
|
75
78
|
}
|
|
76
79
|
return out;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perfile_source.js","sourceRoot":"","sources":["../../../src/rag/backends/perfile_source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAI7E,2EAA2E;AAC3E,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAW,EAAE,MAAc;IAC3D,MAAM,WAAW,GAAG,aAAa,CAAC;QAChC,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,UAAU,EAAE,MAAM,CAAC,SAAS;Q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KAAK,QAAQ,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7F,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -19,8 +19,9 @@ export declare const DEFAULT_CONSOLIDATE_RECALL_K = 5;
|
|
|
19
19
|
export interface ConsolidateDeps extends CompressDeps {
|
|
20
20
|
/** Backend recall → the hit ids (e.g. `recall(q,k).then(hs => hs.map(h => h.lesson.id))`). */
|
|
21
21
|
recallIds: (query: string, k: number) => Promise<string[]>;
|
|
22
|
-
/** Backend `
|
|
23
|
-
|
|
22
|
+
/** Backend `demoteLesson(id)` (wg-9e4f4eb2a40f) — sets `retired_at` (out of recall) and retains the
|
|
23
|
+
* row + per-file source as the rollback floor. NOT a hard delete; slice 3's sweeper deletes later. */
|
|
24
|
+
demoteMemory: (id: string) => Promise<void>;
|
|
24
25
|
}
|
|
25
26
|
export interface ConsolidateOutcome {
|
|
26
27
|
mcId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consolidate.d.ts","sourceRoot":"","sources":["../../../src/rag/memory/consolidate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAY,KAAK,YAAY,EAAkB,MAAM,eAAe,CAAC;AAE5E,iGAAiG;AACjG,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,8FAA8F;IAC9F,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3D
|
|
1
|
+
{"version":3,"file":"consolidate.d.ts","sourceRoot":"","sources":["../../../src/rag/memory/consolidate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAY,KAAK,YAAY,EAAkB,MAAM,eAAe,CAAC;AAE5E,iGAAiG;AACjG,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAE9C,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,8FAA8F;IAC9F,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3D;2GACuG;IACvG,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAUD,wBAAsB,WAAW,CAC/B,IAAI,EAAE,eAAe,EACrB,GAAG,EAAE,MAAM,EAAE,EACb,OAAO,GAAE,MAAqC,GAC7C,OAAO,CAAC,kBAAkB,CAAC,CAqD7B"}
|
|
@@ -53,23 +53,26 @@ export async function consolidate(deps, ids, recallK = DEFAULT_CONSOLIDATE_RECAL
|
|
|
53
53
|
// 3. fail-closed: a verify miss deletes NOTHING. Mc lives alongside the predecessors.
|
|
54
54
|
if (!verified)
|
|
55
55
|
return { mcId: mc.id, deleted: [], keptImmune: [], verified: false };
|
|
56
|
-
// 4. gated
|
|
56
|
+
// 4. gated DEMOTE (wg-9e4f4eb2a40f) — RE-LOAD the authoritative citation counter right before the
|
|
57
|
+
// (reversible) demotion. `deleted` holds the ids removed from the live recall surface — now via
|
|
58
|
+
// demotion (retired_at), NOT a hard delete; the rows + per-file sources are retained as the
|
|
59
|
+
// rollback floor, and slice 3's sweeper hard-deletes them after 30 untouched days.
|
|
57
60
|
const deleted = [];
|
|
58
61
|
const keptImmune = [];
|
|
59
62
|
for (const pid of unique) {
|
|
60
63
|
const reloaded = await deps.getMemoryById(pid);
|
|
61
|
-
// Absent/unreadable → treat as immune-safe (never
|
|
64
|
+
// Absent/unreadable → treat as immune-safe (never touch the unconfirmable). Citation-only immunity.
|
|
62
65
|
const immune = reloaded === null ? true : reloaded.consumedByUserLessons > 0;
|
|
63
66
|
if (immune) {
|
|
64
67
|
keptImmune.push(pid);
|
|
65
68
|
continue;
|
|
66
69
|
}
|
|
67
70
|
try {
|
|
68
|
-
await deps.
|
|
71
|
+
await deps.demoteMemory(pid);
|
|
69
72
|
deleted.push(pid);
|
|
70
73
|
}
|
|
71
74
|
catch {
|
|
72
|
-
keptImmune.push(pid); // a
|
|
75
|
+
keptImmune.push(pid); // a demote error is non-fatal — keep it live; Mc preserves the trace
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
return { mcId: mc.id, deleted, keptImmune, verified: true };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consolidate.js","sourceRoot":"","sources":["../../../src/rag/memory/consolidate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAqC,MAAM,eAAe,CAAC;AAE5E,iGAAiG;AACjG,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"consolidate.js","sourceRoot":"","sources":["../../../src/rag/memory/consolidate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAqC,MAAM,eAAe,CAAC;AAE5E,iGAAiG;AACjG,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAiB9C;;uEAEuE;AACvE,SAAS,cAAc,CAAC,CAAY;IAClC,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC3D,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,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E,CAAC;IAEpF,kGAAkG;IAClG,gGAAgG;IAChG,4FAA4F;IAC5F,mFAAmF;IACnF,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAC/C,oGAAoG;QACpG,MAAM,MAAM,GAAG,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,qBAAqB,GAAG,CAAC,CAAC;QAC7E,IAAI,MAAM,EAAE,CAAC;YACX,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACrB,SAAS;QACX,CAAC;QACD,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;YAC7B,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;QAAC,MAAM,CAAC;YACP,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,qEAAqE;QAC7F,CAAC;IACH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC9D,CAAC"}
|
package/dist/rag/types.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export interface Lesson {
|
|
|
25
25
|
consumedByUserLessons?: number;
|
|
26
26
|
tier?: MemoryTier;
|
|
27
27
|
namespace?: string | null;
|
|
28
|
+
retired_at?: string;
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
31
|
* A memory's scope tier. `shared` crosses every project (user/global knowledge); `project` is isolated
|
|
@@ -72,5 +73,6 @@ export interface RagBackend {
|
|
|
72
73
|
deleteLesson(id: string, opts?: {
|
|
73
74
|
force?: boolean;
|
|
74
75
|
}): Promise<DeleteResult>;
|
|
76
|
+
demoteLesson?(id: string): Promise<void>;
|
|
75
77
|
}
|
|
76
78
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/rag/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/rag/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAG/B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/rag/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAG/B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAI1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,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@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/rag/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/rag/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAmCH;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CACrB,IAA4B,EAC5B,SAAoC,EACpC,KAAkB;IAElB,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACjD,OAAO,SAAS,IAAI,IAAI,IAAI,SAAS,KAAK,KAAK,CAAC,SAAS,CAAC;AAC5D,CAAC;AAcD;;;;;;GAMG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IACtB;IAA5B,YAA4B,EAAU;QACpC,KAAK,CAAC,UAAU,EAAE,oEAAoE,CAAC,CAAC;QAD9D,OAAE,GAAF,EAAE,CAAQ;QAEpC,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — agent loop core (WAB.4, 0.5.97).
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.4.
|
|
5
5
|
* Architecture: `docs/tasks/WAB.1-architecture.md` decisions (c) + (g).
|
|
6
6
|
*
|
|
7
7
|
* Responsibility:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — agent loop core (WAB.4, 0.5.97).
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.4.
|
|
5
5
|
* Architecture: `docs/tasks/WAB.1-architecture.md` decisions (c) + (g).
|
|
6
6
|
*
|
|
7
7
|
* Responsibility:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — adaptive batch coordinator (WAB.5, 0.5.99).
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.5.
|
|
5
5
|
* Architecture: `docs/tasks/WAB.1-architecture.md` decision (d).
|
|
6
6
|
*
|
|
7
7
|
* Responsibility:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — adaptive batch coordinator (WAB.5, 0.5.99).
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.5.
|
|
5
5
|
* Architecture: `docs/tasks/WAB.1-architecture.md` decision (d).
|
|
6
6
|
*
|
|
7
7
|
* Responsibility:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — `opensquid agent-bridge {start|stop|status|restart|run-foreground}` CLI (WAB.7).
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.7 §"CLI".
|
|
5
5
|
*
|
|
6
6
|
* Shape: start spawns detached `run-foreground`; stop/status read pid file +
|
|
7
7
|
* `kill -0` liveness; restart = stop + wait for pid removal + start;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — `opensquid agent-bridge {start|stop|status|restart|run-foreground}` CLI (WAB.7).
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.7 §"CLI".
|
|
5
5
|
*
|
|
6
6
|
* Shape: start spawns detached `run-foreground`; stop/status read pid file +
|
|
7
7
|
* `kill -0` liveness; restart = stop + wait for pid removal + start;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — long-running daemon (WAB.7 + WAB-SUB.2 lazy api client, 0.5.106).
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.7 +
|
|
5
5
|
* WAB-SUB.2 §"daemon mode-aware lazy client". Architecture:
|
|
6
6
|
* `docs/tasks/WAB.1-architecture.md` decisions (a)-(g).
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — long-running daemon (WAB.7 + WAB-SUB.2 lazy api client, 0.5.106).
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.7 +
|
|
5
5
|
* WAB-SUB.2 §"daemon mode-aware lazy client". Architecture:
|
|
6
6
|
* `docs/tasks/WAB.1-architecture.md` decisions (a)-(g).
|
|
7
7
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* agent_bridge — event-bus → batch → session → agent-loop glue
|
|
3
3
|
* (WAB.5 + WAB-SUB.2 mode dispatch, 0.5.106).
|
|
4
4
|
*
|
|
5
|
-
* Spec: the warm-agent planning notes
|
|
5
|
+
* Spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.5 + WAB-SUB.2
|
|
6
6
|
* §"dispatcher integration". Architecture:
|
|
7
7
|
* `docs/tasks/WAB.1-architecture.md` decision (d).
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* agent_bridge — event-bus → batch → session → agent-loop glue
|
|
3
3
|
* (WAB.5 + WAB-SUB.2 mode dispatch, 0.5.106).
|
|
4
4
|
*
|
|
5
|
-
* Spec: the warm-agent planning notes
|
|
5
|
+
* Spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.5 + WAB-SUB.2
|
|
6
6
|
* §"dispatcher integration". Architecture:
|
|
7
7
|
* `docs/tasks/WAB.1-architecture.md` decision (d).
|
|
8
8
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — warm-pool chat-agent shell.
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) +
|
|
5
5
|
* `docs/tasks/WAB.1-architecture.md`. Currently shipped slices:
|
|
6
6
|
* - WAB.2 (0.5.94): types, typed event bus, transport bridge.
|
|
7
7
|
* - WAB.3 (0.5.95): SessionManager + SessionPersistence + history types.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — warm-pool chat-agent shell.
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) +
|
|
5
5
|
* `docs/tasks/WAB.1-architecture.md`. Currently shipped slices:
|
|
6
6
|
* - WAB.2 (0.5.94): types, typed event bus, transport bridge.
|
|
7
7
|
* - WAB.3 (0.5.95): SessionManager + SessionPersistence + history types.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — pack binding (WAB.6 + WAB-SUB.2 mode dispatcher, 0.5.106).
|
|
3
3
|
*
|
|
4
|
-
* Specs: the warm-agent planning notes
|
|
4
|
+
* Specs: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.6 §"pack_binding.ts"
|
|
5
5
|
* + WAB-SUB.2 §"mode dispatcher". Architecture: `WAB.1-architecture.md`
|
|
6
6
|
* decisions (e) + (g).
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — pack binding (WAB.6 + WAB-SUB.2 mode dispatcher, 0.5.106).
|
|
3
3
|
*
|
|
4
|
-
* Specs: the warm-agent planning notes
|
|
4
|
+
* Specs: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.6 §"pack_binding.ts"
|
|
5
5
|
* + WAB-SUB.2 §"mode dispatcher". Architecture: `WAB.1-architecture.md`
|
|
6
6
|
* decisions (e) + (g).
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — warm-pool session manager (WAB.3, 0.5.95).
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.3.
|
|
5
5
|
* Architecture: `docs/tasks/WAB.1-architecture.md` decisions (b) + (c) +
|
|
6
6
|
* Section 2 module layout (≤350 LOC budget for this file).
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — warm-pool session manager (WAB.3, 0.5.95).
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.3.
|
|
5
5
|
* Architecture: `docs/tasks/WAB.1-architecture.md` decisions (b) + (c) +
|
|
6
6
|
* Section 2 module layout (≤350 LOC budget for this file).
|
|
7
7
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* agent_bridge — append-only JSONL persistence for warm-pool session
|
|
3
3
|
* history (WAB.3, 0.5.95).
|
|
4
4
|
*
|
|
5
|
-
* Authoritative spec: the warm-agent planning notes
|
|
5
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.3.
|
|
6
6
|
* Architecture: `docs/tasks/WAB.1-architecture.md` decision (c) + Section 2
|
|
7
7
|
* module layout (≤200 LOC budget for this file).
|
|
8
8
|
*
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* agent_bridge — append-only JSONL persistence for warm-pool session
|
|
3
3
|
* history (WAB.3, 0.5.95).
|
|
4
4
|
*
|
|
5
|
-
* Authoritative spec: the warm-agent planning notes
|
|
5
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.3.
|
|
6
6
|
* Architecture: `docs/tasks/WAB.1-architecture.md` decision (c) + Section 2
|
|
7
7
|
* module layout (≤200 LOC budget for this file).
|
|
8
8
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — tool dispatcher (WAB.4, 0.5.97).
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.4.
|
|
5
5
|
* Architecture: `docs/tasks/WAB.1-architecture.md` decisions (e) + (f).
|
|
6
6
|
*
|
|
7
7
|
* Responsibility:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge — tool dispatcher (WAB.4, 0.5.97).
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.4.
|
|
5
5
|
* Architecture: `docs/tasks/WAB.1-architecture.md` decisions (e) + (f).
|
|
6
6
|
*
|
|
7
7
|
* Responsibility:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge built-in tool — `chat_send`.
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.6 §"Tool
|
|
5
5
|
* surface". Wraps the chat-daemon's `send` JSON-RPC method so the warm
|
|
6
6
|
* agent can reply on the same channel that delivered the inbound message.
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge built-in tool — `chat_send`.
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.6 §"Tool
|
|
5
5
|
* surface". Wraps the chat-daemon's `send` JSON-RPC method so the warm
|
|
6
6
|
* agent can reply on the same channel that delivered the inbound message.
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge built-in tools — barrel + BUILT_INS registry.
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.6 §"Tool
|
|
5
5
|
* surface". The three built-ins (`chat_send`, `recall`, `store_lesson`) are
|
|
6
6
|
* shipped as factories — `pack_binding.ts` constructs them with the
|
|
7
7
|
* runtime-wide dependencies (RagBackend, optional daemon-send seam) and
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge built-in tools — barrel + BUILT_INS registry.
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.6 §"Tool
|
|
5
5
|
* surface". The three built-ins (`chat_send`, `recall`, `store_lesson`) are
|
|
6
6
|
* shipped as factories — `pack_binding.ts` constructs them with the
|
|
7
7
|
* runtime-wide dependencies (RagBackend, optional daemon-send seam) and
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge built-in tool — `recall`.
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.6 §"Tool
|
|
5
5
|
* surface". Wraps the project-scoped RAG backend's `recall(query, k)` method.
|
|
6
6
|
*
|
|
7
7
|
* Responsibility:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge built-in tool — `recall`.
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.6 §"Tool
|
|
5
5
|
* surface". Wraps the project-scoped RAG backend's `recall(query, k)` method.
|
|
6
6
|
*
|
|
7
7
|
* Responsibility:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge built-in tool — `store_lesson`.
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.6 §"Tool
|
|
5
5
|
* surface" + memory `project_opensquid_wedge_gate_two_stages` Stage 1 +
|
|
6
6
|
* `project_opensquid_automation_buffer_pattern`.
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* agent_bridge built-in tool — `store_lesson`.
|
|
3
3
|
*
|
|
4
|
-
* Authoritative spec: the warm-agent planning notes
|
|
4
|
+
* Authoritative spec: the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.6 §"Tool
|
|
5
5
|
* surface" + memory `project_opensquid_wedge_gate_two_stages` Stage 1 +
|
|
6
6
|
* `project_opensquid_automation_buffer_pattern`.
|
|
7
7
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* (WAB.2, 0.5.94).
|
|
4
4
|
*
|
|
5
5
|
* Authoritative source: `docs/tasks/WAB.1-architecture.md` decisions (a) +
|
|
6
|
-
* (b); the warm-agent planning notes
|
|
6
|
+
* (b); the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.2 Part B spec.
|
|
7
7
|
*
|
|
8
8
|
* Reads the CANONICAL per-project inbox path:
|
|
9
9
|
* `~/.opensquid/projects/<projectUuid>/inbox/<platform>.jsonl`
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* (WAB.2, 0.5.94).
|
|
4
4
|
*
|
|
5
5
|
* Authoritative source: `docs/tasks/WAB.1-architecture.md` decisions (a) +
|
|
6
|
-
* (b); the warm-agent planning notes
|
|
6
|
+
* (b); the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.2 Part B spec.
|
|
7
7
|
*
|
|
8
8
|
* Reads the CANONICAL per-project inbox path:
|
|
9
9
|
* `~/.opensquid/projects/<projectUuid>/inbox/<platform>.jsonl`
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* agent_bridge — shared types (WAB.2, 0.5.94).
|
|
3
3
|
*
|
|
4
4
|
* Authoritative source: `docs/tasks/WAB.1-architecture.md` decisions (b) +
|
|
5
|
-
* (c), and the warm-agent planning notes
|
|
5
|
+
* (c), and the warm-agent planning notes (not retained — docs/tasks/WAB.1-architecture.md is the surviving authority) WAB.2 spec.
|
|
6
6
|
*
|
|
7
7
|
* Why one types module: all six WAB sub-modules (event_bus, transport_bridge,
|
|
8
8
|
* session_manager, agent_loop, batch, dispatcher) share the SessionKey +
|