switchroom 0.19.32 → 0.19.33
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/dist/auth-broker/index.js +112 -6
- package/dist/cli/switchroom.js +177 -34
- package/dist/host-control/main.js +289 -27
- package/dist/vault/approvals/kernel-server.js +112 -6
- package/dist/vault/broker/server.js +112 -6
- package/package.json +1 -1
- package/telegram-plugin/dist/gateway/gateway.js +209 -61
- package/telegram-plugin/gateway/stale-pin-sweep-store.ts +14 -8
- package/telegram-plugin/gateway/stale-pin-sweep.test.ts +106 -1
- package/telegram-plugin/gateway/stale-pin-sweep.ts +156 -47
- package/telegram-plugin/gateway/status-pin-store.ts +44 -11
- package/telegram-plugin/tests/status-pin-store.test.ts +62 -6
- package/vendor/hindsight-memory/scripts/subagent_retain.py +30 -7
- package/vendor/hindsight-memory/scripts/tests/test_subagent_retain.py +100 -2
- package/vendor/hindsight-memory/settings.json +1 -1
|
@@ -18960,12 +18960,12 @@ init_paths();
|
|
|
18960
18960
|
var _warnedReads = new Set;
|
|
18961
18961
|
|
|
18962
18962
|
// src/setup/hindsight-pg-defaults.ts
|
|
18963
|
-
var HINDSIGHT_PG_MEM_LIMIT_MIB_FOR_DERIVATION =
|
|
18963
|
+
var HINDSIGHT_PG_MEM_LIMIT_MIB_FOR_DERIVATION = 16 * 1024;
|
|
18964
18964
|
var HINDSIGHT_PG_APP_ANON_MIB = 2560;
|
|
18965
18965
|
var HINDSIGHT_PG_PAGE_CACHE_FLOOR_MIB = 2048;
|
|
18966
18966
|
var HINDSIGHT_PG_SHARED_BUFFERS_BUDGET_MIB = HINDSIGHT_PG_MEM_LIMIT_MIB_FOR_DERIVATION - HINDSIGHT_PG_APP_ANON_MIB - HINDSIGHT_PG_PAGE_CACHE_FLOOR_MIB;
|
|
18967
|
-
var HINDSIGHT_PG_DEFAULT_SHARED_BUFFERS_MIB =
|
|
18968
|
-
var HINDSIGHT_PG_DEFAULT_EFFECTIVE_CACHE_SIZE_MIB =
|
|
18967
|
+
var HINDSIGHT_PG_DEFAULT_SHARED_BUFFERS_MIB = 3072;
|
|
18968
|
+
var HINDSIGHT_PG_DEFAULT_EFFECTIVE_CACHE_SIZE_MIB = 7168;
|
|
18969
18969
|
function pgMib(mib) {
|
|
18970
18970
|
return `${mib}MB`;
|
|
18971
18971
|
}
|
|
@@ -19140,7 +19140,17 @@ var HINDSIGHT_HEALTHCHECK_CMD = `python3 -c '${HINDSIGHT_HEALTHCHECK_PY}'`;
|
|
|
19140
19140
|
var DOCKER_PROBE_TIMEOUT_MS = 60 * 1000;
|
|
19141
19141
|
|
|
19142
19142
|
// src/memory/hindsight.ts
|
|
19143
|
-
var DEFAULT_RETAIN_MISSION = `Extract durable facts that will still be true and useful weeks from now
|
|
19143
|
+
var DEFAULT_RETAIN_MISSION = `Extract durable facts that will still be true and useful weeks from now, once this session is forgotten.
|
|
19144
|
+
` + `
|
|
19145
|
+
` + `DURABILITY GATE. Emit a candidate ONLY if it is one of these five classes:
|
|
19146
|
+
` + `- PREFERENCE — what the user likes, wants, or always does; a standing rule or correction.
|
|
19147
|
+
` + `- DECISION — a settled choice that changes how future work is done, including a choice NOT to do something. A decision about the mechanics of the CURRENT task (which worker to dispatch, which branch to rebase, which PR to merge now, what to do next) is process narration, not a durable decision — drop it unless it establishes a standing rule or permanently changes a system.
|
|
19148
|
+
` + `- FINDING — a root cause, a measurement, or verified behaviour of a system. Include the number.
|
|
19149
|
+
` + `- OUTCOME — a completed result that changed the world: what shipped, what a thing turned out to be. Not the act of shipping it.
|
|
19150
|
+
` + `- RELATIONSHIP — who a person is, what a project or tool is, and how they connect.
|
|
19151
|
+
` + `If a candidate fits none of the five, it is not a memory. Drop it; do not reword it into one.
|
|
19152
|
+
` + `
|
|
19153
|
+
` + `A preference revealed by a request is durable — record the preference (what the user likes, wants, or always does), not the request itself.
|
|
19144
19154
|
` + `
|
|
19145
19155
|
` + `A TOOL RESULT IS NOT A FACT. Before extracting, ask: is the subject of this
|
|
19146
19156
|
` + `candidate a file path, a command/process/agent/session id, a temp directory, or
|
|
@@ -19157,6 +19167,9 @@ var DEFAULT_RETAIN_MISSION = `Extract durable facts that will still be true and
|
|
|
19157
19167
|
` + `- Anything mentioning a path under /tmp, a scratchpad directory, or a .tmp file.
|
|
19158
19168
|
` + `- Agent tool-use traces or narration of what the assistant did (e.g. "the
|
|
19159
19169
|
` + ` assistant used X to query Y", "ran a search", "sent the message").
|
|
19170
|
+
` + `- The act of delegating, dispatching, spawning, launching, steering or merging
|
|
19171
|
+
` + ` work — including when it succeeded. "X was dispatched and completed" is the
|
|
19172
|
+
` + ` session describing itself. Record only what the work LEARNED or CHANGED.
|
|
19160
19173
|
` + `- In-flight workflow/process narration (a sub-task started, paused, or is still
|
|
19161
19174
|
` + ` running) — retain the outcome only once the task completes or a decision is made.
|
|
19162
19175
|
` + `- Operation, request, batch, agent, command or session IDs, UUIDs, hashes, or error codes.
|
|
@@ -19179,8 +19192,12 @@ var DEFAULT_RETAIN_MISSION = `Extract durable facts that will still be true and
|
|
|
19179
19192
|
` + ` the fact is explicitly dated, in which case record it as a dated observation.
|
|
19180
19193
|
` + `- Greetings, acknowledgements, and routine operational chatter.
|
|
19181
19194
|
` + `
|
|
19195
|
+
` + `Write each fact so it stands alone: name the thing, the number, and the date. A
|
|
19196
|
+
` + `sentence that only makes sense while reading this transcript is not durable.
|
|
19197
|
+
` + `
|
|
19182
19198
|
` + `If a candidate fact matches an exclusion, drop it rather than rewording it. If
|
|
19183
|
-
` +
|
|
19199
|
+
` + `nothing durable remains, return an empty facts list.
|
|
19200
|
+
`;
|
|
19184
19201
|
var SUPERSEDED_RETAIN_MISSIONS = [
|
|
19185
19202
|
"Extract technical decisions, architectural choices, user preferences, project context, and people/tool relationships. Ignore routine greetings and transient operational details.",
|
|
19186
19203
|
"Extract user preferences, ongoing projects, recurring commitments, " + "important context, and durable facts that should help across future " + "conversations. Skip one-off chatter and temporary task noise.",
|
|
@@ -19227,7 +19244,96 @@ var SUPERSEDED_RETAIN_MISSIONS = [
|
|
|
19227
19244
|
` + `- Greetings, acknowledgements, and routine operational chatter.
|
|
19228
19245
|
` + `
|
|
19229
19246
|
` + `If a candidate fact matches an exclusion, drop it rather than rewording it. If
|
|
19230
|
-
` + "nothing durable remains, return an empty facts list."
|
|
19247
|
+
` + "nothing durable remains, return an empty facts list.",
|
|
19248
|
+
`Extract durable facts that will still be true and useful weeks from now: user preferences and standing rules, ongoing projects and recurring commitments, technical and architectural decisions with their rationale, and people/tool relationships. A preference revealed by a request is durable — record the preference (what the user likes, wants, or always does), not the request itself.
|
|
19249
|
+
` + `
|
|
19250
|
+
` + `A TOOL RESULT IS NOT A FACT. Before extracting, ask: is the subject of this
|
|
19251
|
+
` + `candidate a file path, a command/process/agent/session id, a temp directory, or
|
|
19252
|
+
` + `the location where some output was written? If yes, drop it — it is transcript
|
|
19253
|
+
` + `exhaust, not memory.
|
|
19254
|
+
` + `
|
|
19255
|
+
` + `NEVER extract:
|
|
19256
|
+
` + `- Tool results verbatim or paraphrased. Concretely, never produce a fact whose
|
|
19257
|
+
` + ` text resembles any of these: "File created successfully at /path/to/file",
|
|
19258
|
+
` + ` "A background command with ID bctz4yskm is running, and its output will be
|
|
19259
|
+
` + ` written to /tmp/...", "Async agent a745598ba84e71df1 was launched successfully
|
|
19260
|
+
` + ` and is running in the background", "User executed a Bash command to sleep for
|
|
19261
|
+
` + ` 200 seconds", "The assistant used grep to locate 'truncateSync' in src/foo.ts".
|
|
19262
|
+
` + `- Anything mentioning a path under /tmp, a scratchpad directory, or a .tmp file.
|
|
19263
|
+
` + `- Agent tool-use traces or narration of what the assistant did (e.g. "the
|
|
19264
|
+
` + ` assistant used X to query Y", "ran a search", "sent the message").
|
|
19265
|
+
` + `- In-flight workflow/process narration (a sub-task started, paused, or is still
|
|
19266
|
+
` + ` running) — retain the outcome only once the task completes or a decision is made.
|
|
19267
|
+
` + `- Operation, request, batch, agent, command or session IDs, UUIDs, hashes, or error codes.
|
|
19268
|
+
` + `- Slash commands the user typed and their effects (e.g. "User issued /clear to
|
|
19269
|
+
` + ` reset assistant state").
|
|
19270
|
+
` + `- Hindsight's own errors, retries, backlogs, or internal state — the memory
|
|
19271
|
+
` + ` system's self-reports are not memories.
|
|
19272
|
+
` + `- Restatements of the user's current request or the task in progress.
|
|
19273
|
+
` + `- Volatile state written as a timeless assertion. A version, count, size,
|
|
19274
|
+
` + ` backlog, status, or any "X is running Y" / "X is at Y" / "X is currently Y"
|
|
19275
|
+
` + ` claim is true only at the instant it was said. Concretely, never produce a
|
|
19276
|
+
` + ` fact whose text resembles any of these: "Switchroom fleet is running image
|
|
19277
|
+
` + ` version v0.18.19", "The switchroom repo is at /path/to/fleet, version
|
|
19278
|
+
` + ` v0.19.5", "Bank overlord has 43155 pending consolidations", "The build is
|
|
19279
|
+
` + ` currently green". If the claim is worth keeping, put the date INSIDE the
|
|
19280
|
+
` + ` fact text ("As of 2026-07-19 the fleet was running v0.18.19"); if you
|
|
19281
|
+
` + ` cannot date it, drop it. An undated one is recalled forever as though it
|
|
19282
|
+
` + ` were still true, which is worse than not remembering it at all.
|
|
19283
|
+
` + `- Transient state (unread counts, build status, what is running right now) unless
|
|
19284
|
+
` + ` the fact is explicitly dated, in which case record it as a dated observation.
|
|
19285
|
+
` + `- Greetings, acknowledgements, and routine operational chatter.
|
|
19286
|
+
` + `
|
|
19287
|
+
` + `If a candidate fact matches an exclusion, drop it rather than rewording it. If
|
|
19288
|
+
` + "nothing durable remains, return an empty facts list.",
|
|
19289
|
+
`Extract durable facts that will still be true and useful weeks from now, once this session is forgotten.
|
|
19290
|
+
` + `
|
|
19291
|
+
` + `DURABILITY GATE. Emit a candidate ONLY if it is one of these five classes:
|
|
19292
|
+
` + `- PREFERENCE — what the user likes, wants, or always does; a standing rule or correction.
|
|
19293
|
+
` + `- DECISION — a settled choice that changes how future work is done, including a choice NOT to do something. A decision about the mechanics of the CURRENT task (which worker to dispatch, which branch to rebase, which PR to merge now, what to do next) is process narration, not a durable decision — drop it unless it establishes a standing rule or permanently changes a system.
|
|
19294
|
+
` + `- FINDING — a root cause, a measurement, or verified behaviour of a system. Include the number.
|
|
19295
|
+
` + `- OUTCOME — a completed result that changed the world: what shipped, what a thing turned out to be. Not the act of shipping it.
|
|
19296
|
+
` + `- RELATIONSHIP — who a person is, what a project or tool is, and how they connect.
|
|
19297
|
+
` + `If a candidate fits none of the five, it is not a memory. Drop it; do not reword it into one.
|
|
19298
|
+
` + `
|
|
19299
|
+
` + `A preference revealed by a request is durable — record the preference (what the user likes, wants, or always does), not the request itself.
|
|
19300
|
+
` + `
|
|
19301
|
+
` + `A TOOL RESULT IS NOT A FACT. Before extracting, ask: is the subject of this
|
|
19302
|
+
` + `candidate a file path, a command/process/agent/session id, a temp directory, or
|
|
19303
|
+
` + `the location where some output was written? If yes, drop it — it is transcript
|
|
19304
|
+
` + `exhaust, not memory.
|
|
19305
|
+
` + `
|
|
19306
|
+
` + `NEVER extract:
|
|
19307
|
+
` + `- Tool results verbatim or paraphrased. Concretely, never produce a fact whose
|
|
19308
|
+
` + ` text resembles any of these: "File created successfully at /path/to/file",
|
|
19309
|
+
` + ` "A background command with ID bctz4yskm is running, and its output will be
|
|
19310
|
+
` + ` written to /tmp/...", "Async agent a745598ba84e71df1 was launched successfully
|
|
19311
|
+
` + ` and is running in the background", "User executed a Bash command to sleep for
|
|
19312
|
+
` + ` 200 seconds", "The assistant used grep to locate 'truncateSync' in src/foo.ts".
|
|
19313
|
+
` + `- Anything mentioning a path under /tmp, a scratchpad directory, or a .tmp file.
|
|
19314
|
+
` + `- Agent tool-use traces or narration of what the assistant did (e.g. "the
|
|
19315
|
+
` + ` assistant used X to query Y", "ran a search", "sent the message").
|
|
19316
|
+
` + `- The act of delegating, dispatching, spawning, launching, steering or merging
|
|
19317
|
+
` + ` work — including when it succeeded. "X was dispatched and completed" is the
|
|
19318
|
+
` + ` session describing itself. Record only what the work LEARNED or CHANGED.
|
|
19319
|
+
` + `- In-flight workflow/process narration (a sub-task started, paused, or is still
|
|
19320
|
+
` + ` running) — retain the outcome only once the task completes or a decision is made.
|
|
19321
|
+
` + `- Operation, request, batch, agent, command or session IDs, UUIDs, hashes, or error codes.
|
|
19322
|
+
` + `- Slash commands the user typed and their effects (e.g. "User issued /clear to
|
|
19323
|
+
` + ` reset assistant state").
|
|
19324
|
+
` + `- Hindsight's own errors, retries, backlogs, or internal state — the memory
|
|
19325
|
+
` + ` system's self-reports are not memories.
|
|
19326
|
+
` + `- Restatements of the user's current request or the task in progress.
|
|
19327
|
+
` + `- Transient state (unread counts, build status, what is running right now) unless
|
|
19328
|
+
` + ` the fact is explicitly dated, in which case record it as a dated observation.
|
|
19329
|
+
` + `- Greetings, acknowledgements, and routine operational chatter.
|
|
19330
|
+
` + `
|
|
19331
|
+
` + `Write each fact so it stands alone: name the thing, the number, and the date. A
|
|
19332
|
+
` + `sentence that only makes sense while reading this transcript is not durable.
|
|
19333
|
+
` + `
|
|
19334
|
+
` + `If a candidate fact matches an exclusion, drop it rather than rewording it. If
|
|
19335
|
+
` + `nothing durable remains, return an empty facts list.
|
|
19336
|
+
`
|
|
19231
19337
|
];
|
|
19232
19338
|
var DEFAULT_OBSERVATIONS_MISSION = `Synthesise durable, standing knowledge about the people, projects, and systems this agent works with: preferences and standing rules, roles and relationships, skills and recurring patterns, technical and operational decisions with their rationale, and the state of long-running work once it lands.
|
|
19233
19339
|
` + `
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "switchroom",
|
|
3
3
|
"//version": "NOT the release version — source of truth is the git tag, resolved by scripts/build.mjs:resolveVersion() (see CLAUDE.md > Standard release process). This field is stale by design and only the Layer-4 dev/non-tag fallback for build.mjs + src/cli/resolve-version.ts; do NOT bump it expecting a release to pick it up. npm-pack tarball naming needs a real version — do that as an UNCOMMITTED pack-time bump (see release step 6), never a committed one.",
|
|
4
|
-
"version": "0.19.
|
|
4
|
+
"version": "0.19.33",
|
|
5
5
|
"description": "Run Claude Code 24/7 on your Claude Pro/Max subscription over Telegram. Open-source alternative to OpenClaw and NanoClaw — no API keys.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|