@wrongstack/core 0.305.1 → 0.306.2

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 (60) hide show
  1. package/dist/chronicle/index.js +6 -1
  2. package/dist/chronicle/project-server.js +13 -3
  3. package/dist/coordination/agents/index.js +3 -2
  4. package/dist/coordination/agents/types.d.ts +1 -1
  5. package/dist/coordination/index.d.ts +1 -0
  6. package/dist/coordination/index.js +165 -59
  7. package/dist/coordination/mailbox-codecs.d.ts +29 -10
  8. package/dist/coordination/mailbox-constants.d.ts +30 -16
  9. package/dist/coordination/mailbox-health.d.ts +16 -0
  10. package/dist/coordination/mailbox-http-validation.d.ts +2 -1
  11. package/dist/coordination/mailbox-parse-state.d.ts +28 -10
  12. package/dist/coordination/mailbox-project-server.js +98 -4
  13. package/dist/coordination/mailbox-types.d.ts +44 -6
  14. package/dist/coordination/package-outdated-watcher.d.ts +15 -1
  15. package/dist/coordination/sqlite-mailbox-credentials.d.ts +26 -0
  16. package/dist/coordination/sqlite-mailbox.d.ts +25 -0
  17. package/dist/coordination/techstack-mailbox-consumer.d.ts +17 -0
  18. package/dist/core/index.d.ts +2 -1
  19. package/dist/core/index.js +2793 -2634
  20. package/dist/core/system-prompt-blocks.d.ts +1 -1
  21. package/dist/core/system-prompt-builder.d.ts +7 -1
  22. package/dist/core/system-prompt-glossary.d.ts +0 -23
  23. package/dist/defaults/index.js +9 -41
  24. package/dist/execution/index.js +9 -3
  25. package/dist/hq/index.js +6 -39
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.js +1053 -626
  28. package/dist/infrastructure/index.js +6 -39
  29. package/dist/observability/index.js +7 -3
  30. package/dist/plugin/index.d.ts +4 -3
  31. package/dist/plugin/index.js +595 -145
  32. package/dist/plugins/auto-review-plugin.d.ts +14 -7
  33. package/dist/plugins/chimera-plugin.d.ts +15 -1
  34. package/dist/plugins/review-finding-integration.d.ts +15 -3
  35. package/dist/plugins/review-finding-parser.d.ts +36 -0
  36. package/dist/plugins/review-finding-types.d.ts +46 -0
  37. package/dist/plugins/review-finding-verification.d.ts +53 -0
  38. package/dist/plugins/review-report-integration.d.ts +1 -0
  39. package/dist/plugins/review-report-store.d.ts +7 -0
  40. package/dist/plugins/review-report-types.d.ts +14 -0
  41. package/dist/plugins/review-types.d.ts +74 -0
  42. package/dist/replay/replay-provider-runner.d.ts +5 -4
  43. package/dist/security/file-permissions.d.ts +12 -35
  44. package/dist/security/index.js +6 -50
  45. package/dist/session-catalog/project-server.js +6 -39
  46. package/dist/storage/index.js +6 -1
  47. package/dist/tools/fallback-manage-tool-options.d.ts +9 -0
  48. package/dist/tools/index.js +91 -38
  49. package/dist/tools/one-shot-llm-tool.d.ts +6 -0
  50. package/dist/types/blocks.d.ts +10 -0
  51. package/dist/utils/index.d.ts +1 -0
  52. package/dist/utils/index.js +30 -9
  53. package/dist/utils/memory-evidence-fence.d.ts +47 -0
  54. package/instructions/agents/browser.md +1 -0
  55. package/instructions/agents/e2e.md +2 -0
  56. package/instructions/llm/chimera-review.md +52 -1
  57. package/instructions/system-lite.md +17 -6
  58. package/instructions/system-pro.md +25 -20
  59. package/instructions/system.md +25 -12
  60. package/package.json +3 -3
@@ -2387,45 +2387,12 @@ function isSecretField(name) {
2387
2387
  }
2388
2388
 
2389
2389
  // src/security/file-permissions.ts
2390
- import { chmod } from "node:fs/promises";
2391
- var SECRET_FILE_MODE = 384;
2392
- async function restrictFilePermissions(filePath, opts) {
2393
- const label = opts?.label ?? "file-permissions";
2394
- const warn = opts?.warn ?? ((msg) => console.warn(msg));
2395
- if (process.platform === "win32") {
2396
- try {
2397
- const { execFile } = await import("node:child_process");
2398
- const { promisify } = await import("node:util");
2399
- const execFileAsync = promisify(execFile);
2400
- const user = windowsAccountName();
2401
- if (!user) {
2402
- warn(
2403
- `[${label}] Could not determine the current Windows user for ${filePath}; skipping icacls hardening.`
2404
- );
2405
- return;
2406
- }
2407
- await execFileAsync("icacls", [filePath, "/inheritance:r", "/grant:r", `${user}:(F)`], {
2408
- windowsHide: true
2409
- });
2410
- } catch {
2411
- warn(
2412
- `[${label}] Could not restrict permissions on ${filePath} \u2014 it may be readable by other users on this system.`
2413
- );
2414
- }
2415
- } else {
2416
- try {
2417
- await chmod(filePath, SECRET_FILE_MODE);
2418
- } catch {
2419
- }
2420
- }
2421
- }
2422
- function windowsAccountName() {
2423
- const username = process.env.USERNAME || process.env.USER;
2424
- if (!username || username.includes("\0")) return void 0;
2425
- const domain = process.env.USERDOMAIN;
2426
- if (domain && !domain.includes("\0")) return `${domain}\\${username}`;
2427
- return username;
2428
- }
2390
+ import {
2391
+ restrictDirPermissions,
2392
+ restrictFilePermissions,
2393
+ SECRET_DIR_MODE,
2394
+ SECRET_FILE_MODE
2395
+ } from "@wrongstack/persistence";
2429
2396
 
2430
2397
  // src/utils/deep-merge.ts
2431
2398
  var FORBIDDEN_PROTO_KEYS = /* @__PURE__ */ new Set([
@@ -379,7 +379,10 @@ var SENSITIVE_FLAG_PATTERNS = [
379
379
  // -t short flag (token): attached (-tVALUE), separated (-t VALUE), or -t=VALUE.
380
380
  // The separator group is optional so the attached form (the common one) matches.
381
381
  // (?<![-\w]) anchors to a token start so we don't match the `-t` inside `--token`.
382
- /(?<![-\w])-t(?:[=\s]+)?[^\s,-]+/,
382
+ // The value must be token-like (>= 8 chars) so ordinary combined flags such
383
+ // as `tar -tf` / `ssh -tt` are not eaten. Global flag: EVERY occurrence is
384
+ // redacted, not just the first. Synced with packages/tools _redact-command.ts.
385
+ /(?<![-\w])-t(?:[=\s]+)?[^\s,-]{8,}/g,
383
386
  // -p|-password|-a (redis auth) short flags: attached + separated + =value.
384
387
  // Same token-start anchor; over-redaction is an accepted tradeoff for a
385
388
  // redaction function (false positive = cosmetic noise; false negative = leak).
@@ -387,8 +390,9 @@ var SENSITIVE_FLAG_PATTERNS = [
387
390
  // env var–style secrets: TOKEN=x, API_KEY=y, etc.
388
391
  /(?:TOKEN|API_KEY|API_SECRET|AUTH_TOKEN|GITHUB_TOKEN|GH_TOKEN|BEARER|JWT|OAUTH|CREDENTIAL|SECRET|PRIVATE_KEY|PASSWORD|PASSWD)\s*[=:]\s*[^\s,]+/gi,
389
392
  // Generic high-entropy look: base64 strings >32 chars or hex strings >32 digits — but only
390
- // when preceded by a flag name (e.g. --github-token=EyJ...).
391
- /--\w*(?:token|key|secret|password|passwd|auth|credential)\w*[=\s,][A-Za-z0-9+/=]{32,}/
393
+ // when preceded by a flag name (e.g. --github-token=EyJ...). Global flag so
394
+ // every such flag in the command line is redacted, not just the first.
395
+ /--\w*(?:token|key|secret|password|passwd|auth|credential)\w*[=\s,][A-Za-z0-9+/=]{32,}/g
392
396
  ];
393
397
  function redactCommand(cmd) {
394
398
  let result = cmd;
@@ -3,12 +3,13 @@ export { diffPluginConfig, type PluginConfigChange, type PluginConfigSource, typ
3
3
  export { KERNEL_API_VERSION, loadPlugins, type LoadPluginsOptions, type PluginHostHandle, type PluginLoadFailure, unloadPlugins, } from './loader.js';
4
4
  export type { PluginAPI } from '../types/plugin.js';
5
5
  export { buildReviewerModelPool, createAutoReviewPlugin, parseReviewSeverity, type ReviewerModelAssignment, selectRoundRobinReviewerAssignment, } from '../plugins/auto-review-plugin.js';
6
- export { type CascadeAgentKind, CHIMERA_REVIEW_PROMPT, createChimeraPlugin, type ChimeraCascadeNeededPayload, type ChimeraReviewCompletePayload, type ChimeraReviewNeededPayload, type ReviewContextBundle, } from '../plugins/chimera-plugin.js';
6
+ export { type CascadeAgentKind, type CascadeEvidenceCheckResult, type CascadeEvidenceStatus, CHIMERA_REVIEW_PROMPT, createChimeraPlugin, type ChimeraCascadeNeededPayload, type ChimeraReviewCompletePayload, type ChimeraReviewNeededPayload, type ReviewContextBundle, } from '../plugins/chimera-plugin.js';
7
7
  export { createPromptsPlugin } from '../plugins/prompts-plugin.js';
8
8
  export { emitReviewIfChanged, recordCompletedReview, recordStartedReview, } from '../plugins/review-claim-registry.js';
9
- export { type FindingsIntegrationResult, integrateFindings, } from '../plugins/review-finding-integration.js';
9
+ export { type FindingsIntegrationResult, classifyChimeraReviewSource, integrateFindings, } from '../plugins/review-finding-integration.js';
10
10
  export { type ParsedReviewReport, parseChimeraReviewReport, } from '../plugins/review-finding-parser.js';
11
- export { persistReviewReport, type ReportIntegrationResult, } from '../plugins/review-report-integration.js';
11
+ export { verifyFindingsAgainstDisk, type VerifyFindingsOptions, } from '../plugins/review-finding-verification.js';
12
+ export { persistReviewReport, type ReportIntegrationResult, updateReviewReportEvidence, } from '../plugins/review-report-integration.js';
12
13
  export { maybeCompactReviewStores, type ReviewStoreMaintenanceResult, } from '../plugins/review-store-maintenance.js';
13
14
  export { createSkillsPlugin } from '../plugins/skills-plugin.js';
14
15
  export { createSyncPlugin } from '../plugins/sync-plugin.js';