claude-slack-channel-bots 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -443,6 +443,7 @@ These top-level fields apply to the whole server. A confirmed change to one take
443
443
  | `mcp_config_path` | string | `~/.claude/slack-mcp.json` | Path to the MCP config file passed to Claude Code when launching managed sessions. |
444
444
  | `append_system_prompt_file` | string | — | Path to a file appended to every managed session's system prompt via `--append-system-prompt-file`. Missing file silently skipped. See `skills/EXAMPLE_CLAUDE.md` for a template. |
445
445
  | `system_prompt_mode` | string | `"append"` | Controls how `append_system_prompt_file` is applied. `"append"`: the custom prompt file is appended on top of `CLAUDE.md` (default, current behavior). `"none"`: only `CLAUDE.md` is used; `append_system_prompt_file` is ignored even if set. Use `"none"` when the project's `CLAUDE.md` already contains everything the bot needs. |
446
+ | `fresh_system_prompt` | boolean | `true` | When `true` (default), every bot launches with `--system-prompt-snapshot off`, so a restarted or resumed bot loads the current system prompt file and `CLAUDE.md` and keeps its conversation, whatever `system_prompt_mode` is. When `false`, the flag is omitted. A change takes effect at the next server start. Needs a Claude Code that has `--system-prompt-snapshot` (confirmed on 2.1.280); on an older one set it to `false`. A bot keeps the launch arguments it was started with on every resume, so a change reaches a bot only when it next starts a new conversation; a `clean_restart` that resumes conversations does not apply it to those bots. |
446
447
  | `cozempic_prescription` | string | `"standard"` | Cozempic cleaning intensity before resume. Valid values: `gentle`, `standard`, `aggressive`. Has no effect if cozempic is not installed. |
447
448
  | `message_archive_db` | string | — | Path to a SQLite DB where every inbound Slack message is archived in real time. Parent directories are created if missing; schema is initialized on first open. Compatible with the `archive-messages.py` backfill script — both can write concurrently. Each channel's name is looked up through the receiving persona's Slack app, which needs the `channels:read` and `groups:read` bot scopes that the shipped `slack-app-manifest.yml` grants. An app created from an earlier manifest stores the channel ID instead, until both scopes are added and the app is re-installed; the `debug-slack-channel-bots` skill has the steps under "The message archive shows channel IDs". A DM's rows keep the DM's `D…` ID whatever the scopes, as a DM has no name; a group DM's rows keep its ID too. Feature is disabled when absent. |
448
449
  | `claude_config_dir` | string | — | Default Claude on-disk config directory for every persona. When a persona has one (its own or this default), its session launches with `CLAUDE_CONFIG_DIR='<resolved-path>'` so the bot authenticates against a specific account. `~` is expanded and the path is resolved to absolute. A persona's own `claude_config_dir` overrides this value. When neither is set, Claude's own default applies. Must be non-empty when set. |
@@ -2512,10 +2513,10 @@ Before any side-effecting step runs, `/publish` enforces eight fail-fast gates.
2512
2513
 
2513
2514
  After all gates pass, the skill, in this order:
2514
2515
 
2515
- 1. Bumps `package.json` and `bun.lock` to `<next-version>` (no commit, no tag yet).
2516
+ 1. Bumps `package.json` and `bun.lock` to `<next-version>` (no commit, no tag yet), and turns `CHANGELOG.md`'s `## Unreleased` heading into `## <next-version> (<UTC date>)` under a fresh empty `## Unreleased` entry. With no `## Unreleased` heading, the release stops here and the working tree is rolled back.
2516
2517
  2. Packs the release tarball with `bun pm pack` and verifies its internal version matches.
2517
2518
  3. Scratch-installs the tarball into a temp `BUN_INSTALL` and runs the bin smoke check (non-zero exit + `Usage:` in stderr). Any failure here rolls back the working tree and aborts — no commit, no push, no publish.
2518
- 4. Creates the `Release v<version>` commit and the annotated `v<version>` tag locally.
2519
+ 4. Creates the `Release v<version>` commit (`package.json`, `bun.lock` and `CHANGELOG.md`) and the annotated `v<version>` tag locally.
2519
2520
  5. Pushes the release commit to `origin/main`.
2520
2521
  6. Publishes the smoke-tested tarball with `npm publish <tarball-path>` (the smoke-tested artifact bytes — not a repack from CWD).
2521
2522
  7. Pushes the `v<version>` tag to `origin`, bringing GitHub and npm into agreement.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-slack-channel-bots",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Run several Claude Code personas, each its own Slack app, from one server via Socket Mode",
5
5
  "type": "module",
6
6
  "bin": {
@@ -136,6 +136,11 @@ export function deriveMemoryReadAllowRules(personaConfig: PersonaConfig, home: s
136
136
  * Conditionally appends `--append-system-prompt-file <path>` when
137
137
  * `system_prompt_mode === 'append'` and the path is R_OK-readable. An
138
138
  * unreadable path produces a single stderr warning and the flag is omitted.
139
+ *
140
+ * Then appends `--system-prompt-snapshot off` (b.b1j SR-2) unless
141
+ * `fresh_system_prompt` is exactly `false`; a configuration without the field
142
+ * gets the pair. It does not depend on `system_prompt_mode`, on the append
143
+ * file probe or on dry run, and is always the last two elements.
139
144
  */
140
145
  export function buildTemplateParams(
141
146
  personaConfig: PersonaConfig,
@@ -165,6 +170,13 @@ export function buildTemplateParams(
165
170
  }
166
171
  }
167
172
 
173
+ // b.b1j SR-2: last, whatever the append-file decision above was, so a
174
+ // resumed or restarted bot reloads the current system prompt file and
175
+ // CLAUDE.md. Only a `fresh_system_prompt` of exactly `false` leaves it out.
176
+ if (personaConfig.fresh_system_prompt !== false) {
177
+ claude_args.push('--system-prompt-snapshot', 'off')
178
+ }
179
+
168
180
  return {
169
181
  name: DEFAULT_TEMPLATE_NAME,
170
182
  relay_mode: 'on',
package/src/config.ts CHANGED
@@ -122,6 +122,7 @@ const SHARED_TOP_LEVEL_KEYS = [
122
122
  'append_system_prompt_file',
123
123
  'cozempic_prescription',
124
124
  'system_prompt_mode',
125
+ 'fresh_system_prompt',
125
126
  'message_archive_db',
126
127
  'claude_config_dir',
127
128
  'resume_enabled',
@@ -271,6 +272,13 @@ export interface ServerSettingsInput {
271
272
  append_system_prompt_file?: string
272
273
  cozempic_prescription?: string
273
274
  system_prompt_mode?: string
275
+ /**
276
+ * Whether bots launch with `--system-prompt-snapshot off`, so a resumed or
277
+ * restarted bot reloads the current system prompt file and `CLAUDE.md`
278
+ * (b.b1j SR-1). Absent means `true`; must be a boolean. Server-wide only: a
279
+ * persona entry cannot set it. A change takes effect at the next start.
280
+ */
281
+ fresh_system_prompt?: boolean
274
282
  /** Optional path to a SQLite DB where every inbound Slack message will be archived. */
275
283
  message_archive_db?: string
276
284
  /**
@@ -351,6 +359,11 @@ export interface ServerSettings {
351
359
  append_system_prompt_file?: string
352
360
  cozempic_prescription: string
353
361
  system_prompt_mode: string
362
+ /**
363
+ * Whether bots launch with `--system-prompt-snapshot off` (b.b1j SR-1).
364
+ * Defaults to true when absent; read by the template builder.
365
+ */
366
+ fresh_system_prompt: boolean
354
367
  /** Absolute path to SQLite archive DB. Undefined disables the feature. */
355
368
  message_archive_db?: string
356
369
  claude_config_dir?: string
@@ -603,6 +616,9 @@ function applyServerDefaults(input: ServerSettingsInput, configDir: string, cron
603
616
  append_system_prompt_file: input.append_system_prompt_file,
604
617
  cozempic_prescription: input.cozempic_prescription ?? 'standard',
605
618
  system_prompt_mode: input.system_prompt_mode ?? 'append',
619
+ // b.b1j SR-1: only an absent key takes the default: any other value,
620
+ // `null` included, is kept so the key's boolean rule rejects it.
621
+ fresh_system_prompt: input.fresh_system_prompt === undefined ? true : input.fresh_system_prompt,
606
622
  message_archive_db: input.message_archive_db,
607
623
  claude_config_dir: input.claude_config_dir,
608
624
  resume_enabled: input.resume_enabled ?? true,
@@ -1129,6 +1145,7 @@ function validatePersonaServerSettings(settings: PersonaServerSettings): void {
1129
1145
  validateServerTimingsAndModes(settings, style)
1130
1146
  checkOptionalNonEmptyString(settings.claude_config_dir, 'claude_config_dir', style)
1131
1147
  checkBoolean(settings.stop_hook_bootstrap, 'stop_hook_bootstrap', style)
1148
+ checkBoolean(settings.fresh_system_prompt, 'fresh_system_prompt', style) // b.b1j SR-1
1132
1149
  validateServerPollAndCron(settings, style)
1133
1150
  checkOptionalNonEmptyString(settings.ack_reaction, 'ack_reaction', style)
1134
1151
  checkOptionalPositiveInteger(settings.reply_chunk_limit, 'reply_chunk_limit', style)