@wrongstack/core 0.260.0 → 0.265.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.
Files changed (99) hide show
  1. package/dist/{agent-bridge-BbskZ7HH.d.ts → agent-bridge-DrkBxszZ.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-BNIGZx18.d.ts → agent-subagent-runner-DM2pP-B6.d.ts} +116 -12
  3. package/dist/{brain-C2yDd7Lw.d.ts → brain-BXd_61kQ.d.ts} +32 -3
  4. package/dist/{compactor-t0R_AIt_.d.ts → compactor-B8pOf45Y.d.ts} +1 -1
  5. package/dist/{config-FG6As4H5.d.ts → config-BMCj_XDs.d.ts} +86 -12
  6. package/dist/{context-JFOVvu6z.d.ts → context-MRk5PhNv.d.ts} +26 -1
  7. package/dist/coordination/index.d.ts +1737 -15
  8. package/dist/coordination/index.js +3152 -494
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/{default-config-CXsDvOmP.d.ts → default-config-B0cj-Hry.d.ts} +11 -1
  11. package/dist/defaults/index.d.ts +28 -28
  12. package/dist/defaults/index.js +1804 -1363
  13. package/dist/defaults/index.js.map +1 -1
  14. package/dist/dispatcher-types.d-BBeXBQgS.d.ts +66 -0
  15. package/dist/execution/index.d.ts +16 -16
  16. package/dist/execution/index.js +933 -672
  17. package/dist/execution/index.js.map +1 -1
  18. package/dist/execution/prompt-enhancer.d.ts +1 -1
  19. package/dist/execution/prompt-enhancer.js +7 -1
  20. package/dist/execution/prompt-enhancer.js.map +1 -1
  21. package/dist/extension/index.d.ts +6 -6
  22. package/dist/extension/index.js.map +1 -1
  23. package/dist/{goal-preamble-B1IXJtLX.d.ts → goal-preamble-DvHDSKSe.d.ts} +26 -10
  24. package/dist/{goal-store-CPXz6Mml.d.ts → goal-store-DtLMySNb.d.ts} +1 -1
  25. package/dist/{index-CebbJB94.d.ts → index-B-ch8K9C.d.ts} +8 -8
  26. package/dist/{index-BPcg4N3M.d.ts → index-CEDeNodM.d.ts} +5 -5
  27. package/dist/index.d.ts +189 -104
  28. package/dist/index.js +24693 -21162
  29. package/dist/index.js.map +1 -1
  30. package/dist/infrastructure/index.d.ts +6 -6
  31. package/dist/infrastructure/index.js +12 -8
  32. package/dist/infrastructure/index.js.map +1 -1
  33. package/dist/kernel/index.d.ts +9 -9
  34. package/dist/kernel/index.js +7 -2
  35. package/dist/kernel/index.js.map +1 -1
  36. package/dist/{llm-selector-DXxI2tlu.d.ts → llm-selector-C0tfTCUe.d.ts} +14 -2
  37. package/dist/{mcp-servers-OwNHo43-.d.ts → mcp-servers-2x4w6Jn9.d.ts} +3 -3
  38. package/dist/models/index.d.ts +5 -5
  39. package/dist/models/index.js +80 -31
  40. package/dist/models/index.js.map +1 -1
  41. package/dist/{models-registry-Djlmq4uB.d.ts → models-registry-DmJlKuNp.d.ts} +1 -1
  42. package/dist/{multi-agent-coordinator-CEmrSCMJ.d.ts → multi-agent-coordinator-DyCkCZnU.d.ts} +2 -2
  43. package/dist/{null-fleet-bus-DT92xqgJ.d.ts → null-fleet-bus-CG9QY2aP.d.ts} +6 -6
  44. package/dist/observability/index.d.ts +2 -2
  45. package/dist/observability/index.js +8 -3
  46. package/dist/observability/index.js.map +1 -1
  47. package/dist/{parallel-eternal-engine-0SItuq5r.d.ts → parallel-eternal-engine-Jw9uhEoT.d.ts} +9 -9
  48. package/dist/{path-resolver-DKBh6Jlo.d.ts → path-resolver-Dy2ej-gE.d.ts} +3 -3
  49. package/dist/{permission-BJ7eO9Vl.d.ts → permission-B9SB45lp.d.ts} +1 -1
  50. package/dist/{permission-policy-DEXOfnpm.d.ts → permission-policy-CkjSXabK.d.ts} +2 -2
  51. package/dist/{pipeline-zflkI2dp.d.ts → pipeline-DPDxH_7m.d.ts} +59 -4
  52. package/dist/{plan-templates-BFXyRkEK.d.ts → plan-templates-CzD9GnAU.d.ts} +32 -8
  53. package/dist/{provider-runner-BC-uywtT.d.ts → provider-runner-DMa70ODu.d.ts} +3 -3
  54. package/dist/{retry-policy-Cavrzmtk.d.ts → retry-policy-CN0khdlj.d.ts} +1 -1
  55. package/dist/sdd/index.d.ts +8 -8
  56. package/dist/sdd/index.js +313 -122
  57. package/dist/sdd/index.js.map +1 -1
  58. package/dist/{secret-vault-CDvDYXWX.d.ts → secret-vault-B2yw84VT.d.ts} +43 -4
  59. package/dist/secret-vault-BAKpgFw_.d.ts +57 -0
  60. package/dist/security/index.d.ts +5 -5
  61. package/dist/security/index.js +411 -225
  62. package/dist/security/index.js.map +1 -1
  63. package/dist/{selector-B7AivHsu.d.ts → selector-CzHh_igB.d.ts} +1 -1
  64. package/dist/{session-event-bridge-BmIDxdJd.d.ts → session-event-bridge-BUI6Jf-4.d.ts} +8 -2
  65. package/dist/{session-reader-DtofsB-2.d.ts → session-reader-CMgdMSRP.d.ts} +1 -1
  66. package/dist/skills/index.js +67 -64
  67. package/dist/skills/index.js.map +1 -1
  68. package/dist/storage/index.d.ts +132 -16
  69. package/dist/storage/index.js +851 -432
  70. package/dist/storage/index.js.map +1 -1
  71. package/dist/tools/index.d.ts +57 -0
  72. package/dist/tools/index.js +411 -0
  73. package/dist/tools/index.js.map +1 -0
  74. package/dist/types/index.d.ts +21 -21
  75. package/dist/types/index.js +928 -711
  76. package/dist/types/index.js.map +1 -1
  77. package/dist/utils/error.d.ts +7 -0
  78. package/dist/utils/error.js +8 -0
  79. package/dist/utils/error.js.map +1 -0
  80. package/dist/utils/index.d.ts +8 -68
  81. package/dist/utils/index.js +20 -10
  82. package/dist/utils/index.js.map +1 -1
  83. package/dist/{wstack-paths-CJjEwPXn.d.ts → wstack-paths-hOpNLmvf.d.ts} +2 -0
  84. package/package.json +5 -1
  85. package/skills/api-design/SKILL.md +1 -1
  86. package/skills/audit-log/SKILL.md +6 -6
  87. package/skills/bug-hunter/SKILL.md +5 -5
  88. package/skills/chimera/SKILL.md +4 -4
  89. package/skills/docker-deploy/SKILL.md +1 -1
  90. package/skills/git-flow/SKILL.md +3 -3
  91. package/skills/multi-agent/SKILL.md +3 -3
  92. package/skills/node-modern/SKILL.md +1 -0
  93. package/skills/observability/SKILL.md +2 -2
  94. package/skills/output-standards/SKILL.md +51 -28
  95. package/skills/refactor-planner/SKILL.md +3 -3
  96. package/skills/security-scanner/SKILL.md +4 -3
  97. package/skills/tech-stack/SKILL.md +1 -2
  98. package/dist/package-outdated-watcher-C70ag2G9.d.ts +0 -581
  99. package/dist/secret-vault-BJDY28ev.d.ts +0 -25
@@ -1,6 +1,6 @@
1
- import { S as SecretScrubber } from './permission-BJ7eO9Vl.js';
1
+ import { S as SecretScrubber } from './permission-B9SB45lp.js';
2
2
  import { L as Logger } from './logger-B63L5bTg.js';
3
- import { S as SecretVault } from './secret-vault-BJDY28ev.js';
3
+ import { R as RotatableSecretVault, S as SecretVault } from './secret-vault-BAKpgFw_.js';
4
4
 
5
5
  declare class DefaultSecretScrubber implements SecretScrubber {
6
6
  scrub(text: string): string;
@@ -24,14 +24,33 @@ interface SecretVaultOptions {
24
24
  * The key is loaded lazily on first encrypt/decrypt; if it does not exist,
25
25
  * a fresh one is generated. Decryption of plaintext values is a no-op so
26
26
  * legacy configs continue to work.
27
+ *
28
+ * Key file format:
29
+ * - Legacy (v1): exactly 32 raw bytes
30
+ * - Versioned (v2+): 4-byte magic `WSKV` + 1-byte version + 32-byte key (37 bytes)
31
+ *
32
+ * Encrypted value format: `enc:v<N>:<iv>:<tag>:<ciphertext>` where N is the
33
+ * key version. After rotation, encrypt() emits the new version prefix.
27
34
  */
28
- declare class DefaultSecretVault implements SecretVault {
35
+ declare class DefaultSecretVault implements RotatableSecretVault {
29
36
  private readonly keyFile;
30
37
  private key?;
38
+ private _keyVersion;
31
39
  constructor(opts: SecretVaultOptions);
40
+ /** Current key version. Starts at 1; incremented by rotateKey(). */
41
+ get keyVersion(): number;
32
42
  isEncrypted(value: string): boolean;
33
43
  encrypt(plaintext: string): string;
34
44
  decrypt(value: string): string;
45
+ /**
46
+ * Generate a new encryption key, write it to disk, and increment the key version.
47
+ * After rotation, encrypt() emits the new version prefix (e.g. enc:v2:).
48
+ * The caller must re-encrypt existing config values (see rotateConfigKeys()).
49
+ */
50
+ rotateKey(): {
51
+ oldVersion: number;
52
+ newVersion: number;
53
+ };
35
54
  private loadOrCreateKey;
36
55
  }
37
56
  /**
@@ -67,5 +86,25 @@ declare function migratePlaintextSecrets(configPath: string, vault: SecretVault,
67
86
  migrated: number;
68
87
  file: string;
69
88
  }>;
89
+ /**
90
+ * Rotate the vault's encryption key and re-encrypt all secret-bearing
91
+ * fields in a config file. This is the atomic key rotation operation:
92
+ *
93
+ * 1. Read the config file
94
+ * 2. Decrypt all encrypted values with the old key
95
+ * 3. Generate a new key (vault.rotateKey())
96
+ * 4. Re-encrypt all values with the new key (new version prefix)
97
+ * 5. Write the config file atomically
98
+ *
99
+ * Returns the number of fields re-encrypted and the version transition.
100
+ * If the config file doesn't exist or has no encrypted fields, returns
101
+ * { rotated: 0 } without modifying the key.
102
+ */
103
+ declare function rotateConfigKeys(configPath: string, vault: RotatableSecretVault, logger?: Pick<Logger, 'warn' | 'info'>): Promise<{
104
+ rotated: number;
105
+ oldVersion: number;
106
+ newVersion: number;
107
+ file: string;
108
+ }>;
70
109
 
71
- export { DefaultSecretScrubber as D, type SecretVaultOptions as S, DefaultSecretVault as a, decryptConfigSecrets as d, encryptConfigSecrets as e, isSecretField as i, migratePlaintextSecrets as m, rewriteConfigEncrypted as r };
110
+ export { DefaultSecretScrubber as D, type SecretVaultOptions as S, DefaultSecretVault as a, rotateConfigKeys as b, decryptConfigSecrets as d, encryptConfigSecrets as e, isSecretField as i, migratePlaintextSecrets as m, rewriteConfigEncrypted as r };
@@ -0,0 +1,57 @@
1
+ /**
2
+ * SecretVault encrypts secrets-at-rest in config files. The wire format is
3
+ * `enc:v<N>:<base64-iv>:<base64-tag>:<base64-ciphertext>` where `<N>` is the
4
+ * key version used for encryption. Plaintext strings (those that do not match
5
+ * this prefix) are passed through unchanged so that existing configs and
6
+ * env-var-derived values keep working.
7
+ *
8
+ * Key rotation produces a new key and re-encrypts all secrets under it.
9
+ * After rotation, `encrypt()` emits the new version prefix (e.g. `enc:v2:`)
10
+ * and `decrypt()` accepts any version prefix — it uses the current key
11
+ * regardless, since rotation re-encrypts every value atomically.
12
+ *
13
+ * The vault is intentionally NOT designed to defeat a determined local
14
+ * attacker who can read both the config file and the key file — that level
15
+ * of secrecy needs the OS keychain. The goal is to keep keys from being
16
+ * visible in screen shares, accidental log captures, and `cat config.json`
17
+ * over someone's shoulder.
18
+ */
19
+ interface SecretVault {
20
+ encrypt(plaintext: string): string;
21
+ decrypt(value: string): string;
22
+ isEncrypted(value: string): boolean;
23
+ /** Current key version. Starts at 1; incremented by `rotateKey()`. */
24
+ readonly keyVersion: number;
25
+ }
26
+ /**
27
+ * RotatableSecretVault extends SecretVault with key rotation support.
28
+ * `rotateKey()` generates a fresh key, writes it to disk, and increments
29
+ * the key version. All subsequent `encrypt()` calls use the new version
30
+ * prefix. The caller is responsible for re-encrypting existing config
31
+ * values (see `rotateConfigKeys()`).
32
+ */
33
+ interface RotatableSecretVault extends SecretVault {
34
+ rotateKey(): {
35
+ oldVersion: number;
36
+ newVersion: number;
37
+ };
38
+ }
39
+ /**
40
+ * Return the encrypted prefix for a given key version.
41
+ * @example encryptedPrefixForVersion(1) // 'enc:v1:'
42
+ * @example encryptedPrefixForVersion(2) // 'enc:v2:'
43
+ */
44
+ declare function encryptedPrefixForVersion(version: number): string;
45
+ /**
46
+ * Parse the key version from an encrypted value string.
47
+ * Returns undefined if the string is not an encrypted value.
48
+ */
49
+ declare function parseEncryptedVersion(value: string): number | undefined;
50
+ /**
51
+ * No-op SecretVault that passes values through unchanged.
52
+ * Used in contexts where encryption is not needed — e.g. reading/writing
53
+ * config sections that contain no secret fields (models, settings, etc.).
54
+ */
55
+ declare const noOpVault: SecretVault;
56
+
57
+ export { type RotatableSecretVault as R, type SecretVault as S, encryptedPrefixForVersion as e, noOpVault as n, parseEncryptedVersion as p };
@@ -1,9 +1,9 @@
1
- export { D as DefaultSecretScrubber, a as DefaultSecretVault, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, i as isSecretField, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from '../secret-vault-CDvDYXWX.js';
2
- export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from '../permission-policy-DEXOfnpm.js';
3
- import '../permission-BJ7eO9Vl.js';
4
- import '../context-JFOVvu6z.js';
1
+ export { D as DefaultSecretScrubber, a as DefaultSecretVault, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, i as isSecretField, m as migratePlaintextSecrets, r as rewriteConfigEncrypted, b as rotateConfigKeys } from '../secret-vault-B2yw84VT.js';
2
+ export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from '../permission-policy-CkjSXabK.js';
3
+ import '../permission-B9SB45lp.js';
4
+ import '../context-MRk5PhNv.js';
5
5
  import '../logger-B63L5bTg.js';
6
- import '../secret-vault-BJDY28ev.js';
6
+ import '../secret-vault-BAKpgFw_.js';
7
7
  import '../input-reader-E-ffP2ee.js';
8
8
 
9
9
  /**