@wrongstack/core 0.280.0 → 0.281.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/dist/{agent-subagent-runner-PoqNKiR4.d.ts → agent-subagent-runner-DyOSK2Wy.d.ts} +39 -8
- package/dist/{compactor-U3agvUIG.d.ts → compactor-BxddyCFu.d.ts} +1 -1
- package/dist/{config-Cr3312zc.d.ts → config-CN-vdDEI.d.ts} +82 -2
- package/dist/coordination/index.d.ts +203 -20
- package/dist/coordination/index.js +981 -52
- package/dist/coordination/index.js.map +1 -1
- package/dist/defaults/index.d.ts +26 -30
- package/dist/defaults/index.js +382 -30
- package/dist/defaults/index.js.map +1 -1
- package/dist/{events-Bs2fmldo.d.ts → events-C5hLU0AT.d.ts} +38 -2
- package/dist/execution/index.d.ts +16 -16
- package/dist/execution/index.js +161 -18
- package/dist/execution/index.js.map +1 -1
- package/dist/execution/prompt-enhancer.d.ts +1 -1
- package/dist/execution/prompt-enhancer.js +12 -3
- package/dist/execution/prompt-enhancer.js.map +1 -1
- package/dist/extension/index.d.ts +6 -6
- package/dist/{global-mailbox-Ct7IorLJ.d.ts → global-mailbox-CHM1QkCi.d.ts} +5 -2
- package/dist/{goal-store-C4F6DjC0.d.ts → goal-store-BLGZq16t.d.ts} +1 -1
- package/dist/hq/index.d.ts +6 -6
- package/dist/hq/index.js +35 -13
- package/dist/hq/index.js.map +1 -1
- package/dist/{index-nP09-oP2.d.ts → index-BEFWNZYs.d.ts} +1 -2
- package/dist/{index-kidebiDh.d.ts → index-C1E-_71T.d.ts} +6 -6
- package/dist/index.d.ts +44 -48
- package/dist/index.js +14855 -13944
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/index.d.ts +60 -8
- package/dist/infrastructure/index.js.map +1 -1
- package/dist/kernel/index.d.ts +11 -11
- package/dist/kernel/index.js.map +1 -1
- package/dist/{mcp-servers-D910X5_r.d.ts → mcp-servers-EKRAcJDi.d.ts} +97 -4
- package/dist/models/index.d.ts +4 -5
- package/dist/models/index.js +22 -5
- package/dist/models/index.js.map +1 -1
- package/dist/{multi-agent-coordinator-CieyUoEL.d.ts → multi-agent-coordinator-IpHCuHUa.d.ts} +29 -1
- package/dist/{null-fleet-bus-DkdmZJ_W.d.ts → null-fleet-bus-ZBkKGR9j.d.ts} +105 -7
- package/dist/observability/index.d.ts +3 -3
- package/dist/{tool-executor-SiE1wlZo.d.ts → parallel-eternal-engine-Cc2CNgmv.d.ts} +6 -202
- package/dist/path-resolver-CMS5307d.d.ts +13 -0
- package/dist/{permission-Dx6dIqS2.d.ts → permission-B6YAtNFz.d.ts} +1 -1
- package/dist/{pipeline-BwAP21_4.d.ts → pipeline-E7_jqGyV.d.ts} +2 -2
- package/dist/{provider-model-resolve-CwQNZWt_.d.ts → provider-model-resolve-KgIdiEQ6.d.ts} +118 -5
- package/dist/{provider-runner-CYHFImzV.d.ts → provider-runner-DxWXNHL1.d.ts} +3 -3
- package/dist/{retry-policy-D4feSLk3.d.ts → retry-policy-V67lBOJz.d.ts} +2 -2
- package/dist/sdd/index.d.ts +9 -9
- package/dist/sdd/index.js +94 -10
- package/dist/sdd/index.js.map +1 -1
- package/dist/{permission-policy-C8vJcnX5.d.ts → secret-vault-D7jeyXUQ.d.ts} +119 -3
- package/dist/security/index.d.ts +5 -6
- package/dist/security/index.js +4 -1
- package/dist/security/index.js.map +1 -1
- package/dist/{selector-Dy-MzKp1.d.ts → selector-Bx2HgUkU.d.ts} +1 -1
- package/dist/{session-event-bridge-CqdiGnfU.d.ts → session-event-bridge-vA2fLV58.d.ts} +1 -1
- package/dist/{session-reader-Hk0WbNm9.d.ts → session-reader-B-Fi9L6I.d.ts} +1 -1
- package/dist/session-registry-Dvg7i_IA.d.ts +129 -0
- package/dist/storage/index.d.ts +71 -142
- package/dist/storage/index.js +161 -13
- package/dist/storage/index.js.map +1 -1
- package/dist/{todos-checkpoint-Bk2uP7Ex.d.ts → todos-checkpoint-B1QVkoa8.d.ts} +23 -5
- package/dist/{tool-BkOgs_KL.d.ts → tool-LVSLiE1s.d.ts} +18 -4
- package/dist/{strategy-compactor-CQwhbErd.d.ts → tool-executor-BWtYwuPI.d.ts} +210 -12
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/types/index.d.ts +17 -41
- package/dist/types/index.js +182 -5085
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +6 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/{worktree-manager-BjOFF6bt.d.ts → worktree-manager-C6CIilTT.d.ts} +1 -1
- package/dist/{wstack-paths-CMl_cYgq.d.ts → wstack-paths-C3K40Qst.d.ts} +2 -0
- package/instructions/agents/shadow-agent.md +23 -84
- package/instructions/coordination/director-preamble.md +12 -3
- package/instructions/coordination/subagent-baseline.md +39 -46
- package/instructions/leader-after-task.md +10 -28
- package/instructions/llm/llm-selector.md +1 -2
- package/instructions/modes/brief-system.md +7 -33
- package/instructions/modes/brief.md +5 -20
- package/instructions/modes/teach-system.md +12 -72
- package/instructions/modes/teach.md +12 -49
- package/instructions/sections/tool/commit-hygiene.md +5 -5
- package/instructions/sections/tool/context-management-full.md +6 -6
- package/instructions/sections/tool/delegation-compact.md +1 -1
- package/instructions/sections/tool/delegation-full.md +19 -23
- package/instructions/sections/tool/mailbox-full.md +11 -31
- package/instructions/sections/tool/mcp-full-control.md +5 -7
- package/instructions/sections/tool/mcp-full-use.md +7 -7
- package/instructions/system.md +22 -38
- package/package.json +1 -29
- package/dist/agent-bridge-DXC6QDJ4.d.ts +0 -35
- package/dist/logger-D3lV0cUZ.d.ts +0 -101
- package/dist/models-registry-CLkoOcHk.d.ts +0 -108
- package/dist/path-resolver-XfZ9eLxG.d.ts +0 -67
- package/dist/secret-vault-CImt2XrR.d.ts +0 -118
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { E as EventBus } from './events-Bs2fmldo.js';
|
|
2
|
-
import { M as ModelsRegistry, b as ResolvedModel } from './config-Cr3312zc.js';
|
|
3
|
-
import { f as TokenCounter, U as Usage, g as CacheStats } from './tool-BkOgs_KL.js';
|
|
4
|
-
import { P as PathResolver } from './path-resolver-CPRj4bFY.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Token counter that derives pricing from the ModelsRegistry instead of a
|
|
8
|
-
* hardcoded table. If a model is unknown to the registry (or the registry is
|
|
9
|
-
* unavailable) the counter still tracks token totals but reports zero cost.
|
|
10
|
-
*/
|
|
11
|
-
declare class DefaultTokenCounter implements TokenCounter {
|
|
12
|
-
private input;
|
|
13
|
-
private output;
|
|
14
|
-
private cacheRead;
|
|
15
|
-
private cacheWrite;
|
|
16
|
-
private costInput;
|
|
17
|
-
private costOutput;
|
|
18
|
-
private readonly registry?;
|
|
19
|
-
private readonly providerId?;
|
|
20
|
-
private readonly events?;
|
|
21
|
-
private sessionId?;
|
|
22
|
-
private priceCache;
|
|
23
|
-
/** Most recently accounted request's tokens. Used for per-request context pressure. */
|
|
24
|
-
private lastInput;
|
|
25
|
-
private lastCacheRead;
|
|
26
|
-
constructor(opts?: {
|
|
27
|
-
registry?: ModelsRegistry | undefined;
|
|
28
|
-
providerId?: string | undefined;
|
|
29
|
-
events?: EventBus | undefined;
|
|
30
|
-
sessionId?: string | (() => string | undefined) | undefined;
|
|
31
|
-
});
|
|
32
|
-
setSessionId(sessionId: string | (() => string | undefined) | undefined): void;
|
|
33
|
-
account(usage: Usage, model?: string): void;
|
|
34
|
-
/** Synchronous variant for code paths that have already resolved the model. */
|
|
35
|
-
accountWithModel(usage: Usage, resolved: ResolvedModel): void;
|
|
36
|
-
total(): Usage;
|
|
37
|
-
currentRequestTokens(): {
|
|
38
|
-
input: number;
|
|
39
|
-
cacheRead: number;
|
|
40
|
-
};
|
|
41
|
-
setCurrentRequestTokens(input: number, cacheRead?: number): void;
|
|
42
|
-
estimateCost(): {
|
|
43
|
-
input: number;
|
|
44
|
-
output: number;
|
|
45
|
-
total: number;
|
|
46
|
-
currency: 'USD';
|
|
47
|
-
};
|
|
48
|
-
cacheStats(): CacheStats;
|
|
49
|
-
/** Invalidate cached prices so the next account() call fetches fresh data. */
|
|
50
|
-
invalidateCache(): void;
|
|
51
|
-
private emitAccounted;
|
|
52
|
-
private currentSessionId;
|
|
53
|
-
reset(): void;
|
|
54
|
-
private applyPrice;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
declare class DefaultPathResolver implements PathResolver {
|
|
58
|
-
readonly projectRoot: string;
|
|
59
|
-
readonly cwd: string;
|
|
60
|
-
constructor(cwd?: string);
|
|
61
|
-
detectProjectRoot(start: string): string;
|
|
62
|
-
resolve(input: string): string;
|
|
63
|
-
isInsideRoot(absPath: string): boolean;
|
|
64
|
-
ensureInsideRoot(absPath: string): string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export { DefaultPathResolver as D, DefaultTokenCounter as a };
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { S as SecretScrubber } from './secret-scrubber-3MHDDAtm.js';
|
|
2
|
-
import { L as Logger } from './logger-B63L5bTg.js';
|
|
3
|
-
import { R as RotatableSecretVault, S as SecretVault } from './secret-vault-BAKpgFw_.js';
|
|
4
|
-
|
|
5
|
-
declare class DefaultSecretScrubber implements SecretScrubber {
|
|
6
|
-
scrub(text: string): string;
|
|
7
|
-
private scrubOne;
|
|
8
|
-
/**
|
|
9
|
-
* Recursively scrub every string value in an object/array graph. Secrets can
|
|
10
|
-
* appear under any key — a URL query param, an `authorization` header, an
|
|
11
|
-
* arbitrarily-named nested field — so we don't gate recursion on key names.
|
|
12
|
-
* The per-string `scrub()` fast-path (anchor pre-scan) keeps this cheap: any
|
|
13
|
-
* value without a credential anchor returns immediately without regex work.
|
|
14
|
-
*/
|
|
15
|
-
scrubObject<T>(obj: T): T;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface SecretVaultOptions {
|
|
19
|
-
/** Absolute path to the key file. Created with mode 0o600 if missing. */
|
|
20
|
-
keyFile: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Default vault: AES-256-GCM with a key stored at `keyFile` (mode 0o600).
|
|
24
|
-
* The key is loaded lazily on first encrypt/decrypt; if it does not exist,
|
|
25
|
-
* a fresh one is generated. Decryption of plaintext values is a no-op so
|
|
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.
|
|
34
|
-
*/
|
|
35
|
-
declare class DefaultSecretVault implements RotatableSecretVault {
|
|
36
|
-
private readonly keyFile;
|
|
37
|
-
private key?;
|
|
38
|
-
private _keyVersion;
|
|
39
|
-
constructor(opts: SecretVaultOptions);
|
|
40
|
-
/** Current key version. Starts at 1; incremented by rotateKey(). */
|
|
41
|
-
get keyVersion(): number;
|
|
42
|
-
isEncrypted(value: string): boolean;
|
|
43
|
-
encrypt(plaintext: string): string;
|
|
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
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* If WRONGSTACK_VAULT_PASSPHRASE is set but the key on disk is still stored
|
|
56
|
-
* unwrapped (legacy v1 / versioned v2), re-write it in passphrase-wrapped (v3)
|
|
57
|
-
* form. The data key is preserved, so all existing ciphertext keeps
|
|
58
|
-
* decrypting. Best-effort: a write failure leaves the working unwrapped file
|
|
59
|
-
* in place and is not fatal to load.
|
|
60
|
-
*/
|
|
61
|
-
private migrateToWrappedIfPassphrase;
|
|
62
|
-
private loadOrCreateKey;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Walk a Config-shaped object and decrypt any apiKey-like fields in place,
|
|
66
|
-
* returning a new object. Used by the config loader so the rest of the
|
|
67
|
-
* system never has to know about the wire format.
|
|
68
|
-
*
|
|
69
|
-
* @param warn — callback for decryption warnings. Defaults to `console.warn`
|
|
70
|
-
* for backward compatibility; pass `logger.warn` when a structured logger
|
|
71
|
-
* is available (preferred in long-running/server contexts).
|
|
72
|
-
*/
|
|
73
|
-
declare function decryptConfigSecrets<T>(cfg: T, vault: SecretVault, opts?: {
|
|
74
|
-
warn?: (msg: string) => void;
|
|
75
|
-
}): T;
|
|
76
|
-
declare function encryptConfigSecrets<T>(cfg: T, vault: SecretVault, _opts?: {
|
|
77
|
-
warn?: (msg: string) => void;
|
|
78
|
-
}): T;
|
|
79
|
-
declare function isSecretField(name: string): boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Re-write `~/.wrongstack/config.json` (or any path) with all secret-bearing
|
|
82
|
-
* fields encrypted. Used by the `wstack auth` subcommand.
|
|
83
|
-
*/
|
|
84
|
-
declare function rewriteConfigEncrypted(configPath: string, vault: SecretVault, patch?: Record<string, unknown>): Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* Scan a config file on disk for plaintext secret-bearing fields and
|
|
87
|
-
* rewrite the file with them encrypted in place. Returns a count of how
|
|
88
|
-
* many fields were migrated. Idempotent — calling on a fully-encrypted
|
|
89
|
-
* file is a no-op and writes nothing. Used by the CLI on every boot so
|
|
90
|
-
* users who had plaintext keys before the vault landed are upgraded
|
|
91
|
-
* transparently.
|
|
92
|
-
*/
|
|
93
|
-
declare function migratePlaintextSecrets(configPath: string, vault: SecretVault, logger?: Pick<Logger, 'warn'>): Promise<{
|
|
94
|
-
migrated: number;
|
|
95
|
-
file: string;
|
|
96
|
-
}>;
|
|
97
|
-
/**
|
|
98
|
-
* Rotate the vault's encryption key and re-encrypt all secret-bearing
|
|
99
|
-
* fields in a config file. This is the atomic key rotation operation:
|
|
100
|
-
*
|
|
101
|
-
* 1. Read the config file
|
|
102
|
-
* 2. Decrypt all encrypted values with the old key
|
|
103
|
-
* 3. Generate a new key (vault.rotateKey())
|
|
104
|
-
* 4. Re-encrypt all values with the new key (new version prefix)
|
|
105
|
-
* 5. Write the config file atomically
|
|
106
|
-
*
|
|
107
|
-
* Returns the number of fields re-encrypted and the version transition.
|
|
108
|
-
* If the config file doesn't exist or has no encrypted fields, returns
|
|
109
|
-
* { rotated: 0 } without modifying the key.
|
|
110
|
-
*/
|
|
111
|
-
declare function rotateConfigKeys(configPath: string, vault: RotatableSecretVault, logger?: Pick<Logger, 'warn' | 'info'>): Promise<{
|
|
112
|
-
rotated: number;
|
|
113
|
-
oldVersion: number;
|
|
114
|
-
newVersion: number;
|
|
115
|
-
file: string;
|
|
116
|
-
}>;
|
|
117
|
-
|
|
118
|
-
export { DefaultSecretVault as D, type SecretVaultOptions as S, DefaultSecretScrubber as a, rotateConfigKeys as b, decryptConfigSecrets as d, encryptConfigSecrets as e, isSecretField as i, migratePlaintextSecrets as m, rewriteConfigEncrypted as r };
|