@wrongstack/core 0.300.0 → 0.302.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.
Files changed (146) hide show
  1. package/dist/chronicle/index.d.ts +2 -0
  2. package/dist/chronicle/index.js +297 -10
  3. package/dist/chronicle/project-server.js +253 -15
  4. package/dist/chronicle/sqlite-compaction.d.ts +20 -0
  5. package/dist/chronicle/sqlite-journal.d.ts +57 -0
  6. package/dist/coordination/agents/capability-manifest.d.ts +7 -0
  7. package/dist/coordination/agents/index.d.ts +3 -2
  8. package/dist/coordination/agents/index.js +818 -570
  9. package/dist/coordination/agents/project-agent-identity.d.ts +6 -6
  10. package/dist/coordination/agents/role-skills.d.ts +1 -1
  11. package/dist/coordination/agents/types.d.ts +6 -0
  12. package/dist/coordination/director.d.ts +2 -2
  13. package/dist/coordination/index.js +6787 -6447
  14. package/dist/coordination/mail-tools.d.ts +3 -3
  15. package/dist/coordination/mailbox-project-server.js +3 -4
  16. package/dist/coordination/mailbox-types.d.ts +6 -0
  17. package/dist/core/agent-response.d.ts +5 -1
  18. package/dist/core/agent-tools.d.ts +3 -0
  19. package/dist/core/context.d.ts +20 -0
  20. package/dist/core/index.d.ts +8 -7
  21. package/dist/core/index.js +893 -284
  22. package/dist/core/instruction-template.d.ts +6 -3
  23. package/dist/core/next-steps-slot.d.ts +88 -0
  24. package/dist/core/system-prompt-builder.d.ts +5 -3
  25. package/dist/core/system-prompt-memory-skills.d.ts +1 -0
  26. package/dist/core/system-prompt-skill-bodies.d.ts +3 -3
  27. package/dist/defaults/index.js +9797 -8898
  28. package/dist/design/index.js +11 -3
  29. package/dist/execution/auto-compaction-middleware.d.ts +17 -0
  30. package/dist/execution/autonomy-brain.d.ts +8 -2
  31. package/dist/execution/brain-runtime.d.ts +3 -1
  32. package/dist/execution/compaction-core.d.ts +41 -2
  33. package/dist/execution/council-brain.d.ts +37 -2
  34. package/dist/execution/council-orchestrator.d.ts +2 -2
  35. package/dist/execution/index.d.ts +11 -10
  36. package/dist/execution/index.js +5179 -4078
  37. package/dist/execution/tool-executor.d.ts +4 -1
  38. package/dist/execution/topic-shift-advisor.d.ts +53 -0
  39. package/dist/extension/index.js +8 -2
  40. package/dist/extension/registry.d.ts +8 -1
  41. package/dist/goal/index.js +11 -3
  42. package/dist/hooks/index.js +42 -9
  43. package/dist/hooks/runner.d.ts +12 -1
  44. package/dist/hq/index.js +41 -17
  45. package/dist/hq/publisher.d.ts +21 -3
  46. package/dist/index.d.ts +21 -20
  47. package/dist/index.js +10901 -8067
  48. package/dist/infrastructure/index.js +108 -21
  49. package/dist/kernel/events/session-events.d.ts +13 -0
  50. package/dist/kernel/events/tool-events.d.ts +3 -3
  51. package/dist/models/index.d.ts +1 -0
  52. package/dist/models/index.js +17 -0
  53. package/dist/models/provider-credentials.d.ts +54 -0
  54. package/dist/plugin/index.d.ts +1 -0
  55. package/dist/plugin/index.js +2024 -502
  56. package/dist/plugins/auto-review-plugin.d.ts +3 -0
  57. package/dist/plugins/cloud-config-sync-plugin.d.ts +22 -0
  58. package/dist/plugins/review-claim-registry.d.ts +23 -8
  59. package/dist/plugins/review-types.d.ts +2 -0
  60. package/dist/registry/index.js +109 -74
  61. package/dist/registry/tool-registry.d.ts +15 -0
  62. package/dist/security/capabilities.d.ts +2 -0
  63. package/dist/security/index.d.ts +1 -1
  64. package/dist/security/index.js +9 -2
  65. package/dist/security/readonly-permission-policy.d.ts +20 -0
  66. package/dist/session-registry-atomic-file.d.ts +32 -5
  67. package/dist/session-registry-types.d.ts +17 -0
  68. package/dist/session-registry.d.ts +1 -1
  69. package/dist/skills/frontmatter.d.ts +6 -0
  70. package/dist/skills/index.js +22 -5
  71. package/dist/storage/cloud-config-sync/sanitize.d.ts +54 -0
  72. package/dist/storage/cloud-config-sync.d.ts +87 -0
  73. package/dist/storage/index.d.ts +2 -1
  74. package/dist/storage/index.js +854 -66
  75. package/dist/tools/index.d.ts +1 -1
  76. package/dist/tools/index.js +511 -234
  77. package/dist/tools/one-shot-llm-tool.d.ts +1 -0
  78. package/dist/tools/plugin-manager.d.ts +27 -0
  79. package/dist/types/config/mcp-features.d.ts +18 -11
  80. package/dist/types/config/root.d.ts +8 -1
  81. package/dist/types/config/runtime.d.ts +20 -6
  82. package/dist/types/config/skills-fleet-brain.d.ts +12 -4
  83. package/dist/types/config/tools.d.ts +16 -0
  84. package/dist/types/context-window.d.ts +1 -0
  85. package/dist/types/hooks.d.ts +14 -0
  86. package/dist/types/index.d.ts +2 -2
  87. package/dist/types/index.js +1 -0
  88. package/dist/types/multi-agent.d.ts +2 -0
  89. package/dist/types/one-shot-llm.d.ts +16 -0
  90. package/dist/types/provider.d.ts +16 -0
  91. package/dist/types/runtime-capability-manifest.d.ts +168 -0
  92. package/dist/types/skill.d.ts +5 -0
  93. package/dist/types/system-prompt.d.ts +3 -1
  94. package/dist/types/tool-executor.d.ts +8 -1
  95. package/dist/utils/context-breakdown.d.ts +8 -2
  96. package/dist/utils/index.d.ts +1 -1
  97. package/dist/utils/index.js +141 -31
  98. package/dist/utils/regex-guard.d.ts +16 -2
  99. package/dist/utils/sage-output-block.d.ts +7 -10
  100. package/dist/utils/wstack-paths.d.ts +11 -3
  101. package/instructions/agents/browser.md +1 -4
  102. package/instructions/agents/e2e.md +17 -15
  103. package/instructions/agents/ios.md +3 -3
  104. package/instructions/agents/search.md +1 -1
  105. package/instructions/autonomy/goal-preamble.md +4 -4
  106. package/instructions/coordination/director-preamble.md +2 -3
  107. package/instructions/coordination/subagent-baseline.md +3 -1
  108. package/instructions/leader-after-task.md +12 -0
  109. package/instructions/llm/chimera-review.md +1 -1
  110. package/instructions/modes/audit-lite.md +1 -1
  111. package/instructions/sections/tool/common-patterns.md +18 -2
  112. package/instructions/sections/tool/mailbox-compact.md +1 -1
  113. package/instructions/sections/tool/mailbox-full.md +1 -1
  114. package/instructions/system-lite.md +10 -0
  115. package/instructions/system-pro.md +23 -14
  116. package/instructions/system.md +22 -13
  117. package/package.json +3 -3
  118. package/skills/api-design/SKILL.md +3 -0
  119. package/skills/audit-log/SKILL.md +2 -0
  120. package/skills/auto-review/SKILL.md +6 -1
  121. package/skills/bug-hunter/SKILL.md +4 -1
  122. package/skills/chimera/SKILL.md +3 -0
  123. package/skills/data-governance/SKILL.md +3 -0
  124. package/skills/design-system/SKILL.md +5 -2
  125. package/skills/docker-deploy/SKILL.md +2 -0
  126. package/skills/git-flow/SKILL.md +2 -0
  127. package/skills/mailbox-bridge/SKILL.md +3 -0
  128. package/skills/mnemosyne/SKILL.md +2 -0
  129. package/skills/multi-agent/SKILL.md +4 -1
  130. package/skills/node-modern/SKILL.md +4 -1
  131. package/skills/observability/SKILL.md +3 -0
  132. package/skills/output-standards/SKILL.md +2 -0
  133. package/skills/plugin-author/SKILL.md +4 -1
  134. package/skills/prompt-engineering/SKILL.md +3 -1
  135. package/skills/react-modern/SKILL.md +6 -3
  136. package/skills/refactor-planner/SKILL.md +2 -0
  137. package/skills/research-web/SKILL.md +3 -0
  138. package/skills/sdd/SKILL.md +3 -1
  139. package/skills/security-scanner/SKILL.md +3 -0
  140. package/skills/skill-creator/SKILL.md +2 -0
  141. package/skills/tech-stack/SKILL.md +3 -0
  142. package/skills/testing/SKILL.md +4 -1
  143. package/skills/typescript-strict/SKILL.md +4 -1
  144. package/skills/wrongstack-kanban/SKILL.md +6 -3
  145. package/skills/wrongstack-mailbox/SKILL.md +4 -1
  146. package/skills/wrongstack-mailbox-mcp/SKILL.md +10 -8
@@ -0,0 +1,87 @@
1
+ export { applyNamespacePayload, buildNamespacePayloads, CLOUD_SYNC_CONTRACT, CLOUD_SYNC_NAMESPACES, LOCAL_ONLY_TOP_LEVEL, NAMESPACE_SCHEMA_VERSIONS, stripSecretMaterial, } from './cloud-config-sync/sanitize.js';
2
+ /**
3
+ * CloudConfigSync — synchronizes the profile config with my.wrongstack.com over the
4
+ * namespaced sync API v1 (server repo: docs/CLIENT_SYNC_CONTRACT.md).
5
+ *
6
+ * Distinct from the legacy GitHub `CloudSync` (whole-file categories to a private repo)
7
+ * and from the local HQ command center: this speaks the portal's revisioned,
8
+ * schema-validated, secret-free namespace protocol.
9
+ *
10
+ * A sync pass is pull-then-push:
11
+ * 1. `GET /config?since=<cursor>` — apply changed namespaces at contract granularity
12
+ * (locally-kept fields the contract does not own are never clobbered).
13
+ * 2. For each namespace whose projected payload hash differs from the last synced
14
+ * hash: `PUT /config/<ns>` with `baseRevision` + a persisted `mutationId`, so a
15
+ * crash-and-retry of the same logical change is idempotent server-side.
16
+ * 3. `POST /heartbeat` with the cursor and revision map for fleet observability.
17
+ *
18
+ * Conflicts (409) resolve by three-way merge at owned-top-level-key granularity: keys the
19
+ * local machine did not change since its last sync adopt the server value; keys it did
20
+ * change keep the local value and are re-pushed on top of the server revision.
21
+ */
22
+ export interface CloudConfigSyncSettings {
23
+ enabled: boolean;
24
+ /** Portal base URL, e.g. https://my.wrongstack.com — no trailing slash needed. */
25
+ url: string;
26
+ /** Machine bearer token (wst_…), already decrypted. */
27
+ token: string;
28
+ }
29
+ export interface CloudConfigSyncDeps {
30
+ /** State file location, e.g. `<profileDir>/cloud-sync-state.json`. */
31
+ statePath: string;
32
+ /** Reads the decrypted profile config object (the file layer, not env/CLI merges). */
33
+ readLocalConfig(): Promise<Record<string, unknown>>;
34
+ /**
35
+ * Atomically mutates the profile config file. The mutator receives the decrypted
36
+ * object and returns the replacement; the writer re-encrypts secrets and persists.
37
+ */
38
+ writeLocalConfig(mutator: (config: Record<string, unknown>) => Record<string, unknown>): Promise<void>;
39
+ /** Resolved cloud-sync settings, or null when unconfigured/disabled. */
40
+ getSettings(): CloudConfigSyncSettings | null;
41
+ fetchImpl?: typeof fetch | undefined;
42
+ appVersion?: string | undefined;
43
+ logger?: {
44
+ info(msg: string): void;
45
+ warn(msg: string): void;
46
+ } | undefined;
47
+ randomUUID?: (() => string) | undefined;
48
+ /** Request timeout per HTTP call. Default 15s. */
49
+ requestTimeoutMs?: number | undefined;
50
+ }
51
+ export interface CloudSyncPassSummary {
52
+ ok: boolean;
53
+ skipped: boolean;
54
+ pulled: string[];
55
+ pushed: string[];
56
+ conflicted: string[];
57
+ rejected: string[];
58
+ message: string;
59
+ }
60
+ export declare class CloudConfigSync {
61
+ private readonly deps;
62
+ private state;
63
+ private readonly fetchImpl;
64
+ private readonly uuid;
65
+ private readonly timeoutMs;
66
+ constructor(deps: CloudConfigSyncDeps);
67
+ /** One full pull-then-push-then-heartbeat pass. Never throws; failures are summarized. */
68
+ syncOnce(): Promise<CloudSyncPassSummary>;
69
+ /** Human-readable status for the slash command. */
70
+ statusText(): Promise<string>;
71
+ private pullChanges;
72
+ private applySnapshot;
73
+ private dirtyNamespaces;
74
+ private pushDirty;
75
+ private putNamespace;
76
+ /**
77
+ * Three-way merge at owned-top-level-key granularity: keys unchanged locally since the
78
+ * last sync adopt the server value; locally-changed keys win and are re-pushed on top
79
+ * of the server revision with a fresh mutation id.
80
+ */
81
+ private resolveConflict;
82
+ private heartbeat;
83
+ private request;
84
+ private loadState;
85
+ private saveState;
86
+ }
87
+ //# sourceMappingURL=cloud-config-sync.d.ts.map
@@ -20,7 +20,7 @@ export { ReplayLogStore, type ReplayEntry, type ReplayLogStoreOptions, } from '.
20
20
  export { SessionRecovery, type StaleSession, type RecoveryPlan, } from './session-recovery.js';
21
21
  export { ToolAuditLog, type AuditEntry, type ToolAuditLogOptions, type VerifyResult, } from './tool-audit-log.js';
22
22
  export { SessionAnalyzer } from './session-analyzer.js';
23
- export { SessionRegistry, getSessionRegistry, hasSessionRegistry, type SessionRegistryEntry, type AgentEntry, type AgentLiveStatus, type SessionLiveStatus, } from '../session-registry.js';
23
+ export { SessionRegistry, getSessionRegistry, hasSessionRegistry, type SessionRegistryEntry, type SessionWebUIEndpointHint, type AgentEntry, type AgentLiveStatus, type SessionLiveStatus, } from '../session-registry.js';
24
24
  export { AgentStatusTracker, type AgentStatusTrackerOptions, } from '../agent-status-tracker.js';
25
25
  export { FleetNotifier, type FleetNotifierOptions, } from '../fleet-notifier.js';
26
26
  export { DefaultSessionRewinder, type SessionRewinderOptions, } from './session-rewinder.js';
@@ -38,6 +38,7 @@ export { DefaultPromptStore, migratePromptEntry, promptChecksum, type PromptStor
38
38
  export { PromptUsageStore, type PromptUsage } from './prompt-usage-store.js';
39
39
  export { InputHistoryStore, INPUT_HISTORY_DEFAULT_MAX, } from './input-history-store.js';
40
40
  export { CloudSync, type SyncResult, ALL_SYNC_CATEGORIES, } from './cloud-sync.js';
41
+ export { applyNamespacePayload, buildNamespacePayloads, CLOUD_SYNC_CONTRACT, CLOUD_SYNC_NAMESPACES, CloudConfigSync, type CloudConfigSyncDeps, type CloudConfigSyncSettings, type CloudSyncPassSummary, LOCAL_ONLY_TOP_LEVEL, NAMESPACE_SCHEMA_VERSIONS, stripSecretMaterial, } from './cloud-config-sync.js';
41
42
  export { createSessionEventBridge, resolveAuditLevel, resolveSessionLoggingConfig, type SessionEventBridge, type AuditLevel, type SessionEventBridgeOptions, type SessionSamplingOptions, type ToolProgressSamplingOptions, CORE_RECONSTRUCT_EVENTS, STANDARD_AUDIT_EVENTS, } from './session-event-bridge.js';
42
43
  export type { SyncConfig, SyncCategory } from '../types/config.js';
43
44
  //# sourceMappingURL=index.d.ts.map