@wrongstack/core 0.309.1 → 0.310.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/chronicle/index.js +113 -41
- package/dist/chronicle/metrics-ingest.d.ts +7 -0
- package/dist/chronicle/metrics-schema.d.ts +4 -1
- package/dist/chronicle/project-server.js +94 -38
- package/dist/chronicle/query.d.ts +1 -0
- package/dist/chronicle/sqlite-journal-schema.d.ts +2 -1
- package/dist/chronicle/types.d.ts +2 -0
- package/dist/{agent-status-helpers.d.ts → coordination/agent-status-helpers.d.ts} +1 -1
- package/dist/{agent-status-tracker.d.ts → coordination/agent-status-tracker.d.ts} +2 -2
- package/dist/{middleware → coordination}/collab-pause.d.ts +1 -1
- package/dist/coordination/director-kanban-queue-helpers.d.ts +1 -1
- package/dist/coordination/fleet-status-tool.d.ts +1 -1
- package/dist/coordination/index.d.ts +5 -1
- package/dist/coordination/index.js +2061 -346
- package/dist/coordination/kanban-dispatch-port.d.ts +30 -0
- package/dist/coordination/kanban-ops-port.d.ts +21 -0
- package/dist/coordination/mailbox-hooks.d.ts +1 -1
- package/dist/coordination/mailbox-project-server.js +14 -9
- package/dist/core/context.d.ts +35 -44
- package/dist/core/conversation-state.d.ts +16 -52
- package/dist/core/index.js +53 -16
- package/dist/core/provider-runner.d.ts +2 -2
- package/dist/core/run-env.d.ts +7 -28
- package/dist/core/streaming-response-builder.d.ts +2 -2
- package/dist/execution/index.js +111 -153
- package/dist/goal/index.js +100 -22
- package/dist/hq/auth-store.d.ts +9 -0
- package/dist/hq/cost-bridge.d.ts +1 -1
- package/dist/hq/index.js +24 -2
- package/dist/index.d.ts +12 -5
- package/dist/index.js +27806 -33937
- package/dist/infrastructure/index.js +210 -132
- package/dist/infrastructure/provider-cache-ledger.d.ts +1 -1
- package/dist/infrastructure/token-counter.d.ts +5 -1
- package/dist/kernel/events/file-events.d.ts +6 -0
- package/dist/kernel/events/provider-events.d.ts +10 -7
- package/dist/kernel/events/session-events.d.ts +4 -4
- package/dist/kernel/events/tool-events.d.ts +12 -2
- package/dist/plugin/index.js +105 -35
- package/dist/security/index.d.ts +1 -0
- package/dist/security/index.js +47 -18
- package/dist/security/kanban-boundary.d.ts +1 -1
- package/dist/security/kanban-governance-port.d.ts +28 -0
- package/dist/session-catalog/index.js +2 -3
- package/dist/session-catalog/project-server.js +2 -3
- package/dist/session-catalog/protocol.d.ts +1 -1
- package/dist/session-catalog/registry.d.ts +1 -1
- package/dist/session-catalog/store-schema.d.ts +1 -1
- package/dist/session-catalog/store.d.ts +1 -1
- package/dist/storage/annotations-store.d.ts +1 -1
- package/dist/storage/board-store-port.d.ts +45 -0
- package/dist/storage/completed-work-checkpoint.d.ts +1 -1
- package/dist/storage/config-loader/types.d.ts +1 -1
- package/dist/storage/event-bus-port.d.ts +27 -0
- package/dist/storage/file-session-writer.d.ts +47 -5
- package/dist/storage/goal-coordination.d.ts +1 -1
- package/dist/storage/goal-store.d.ts +1 -1
- package/dist/storage/index.d.ts +3 -4
- package/dist/storage/index.js +1063 -1459
- package/dist/storage/plan-store.d.ts +1 -1
- package/dist/storage/queue-store.d.ts +1 -1
- package/dist/storage/replay-log-store.d.ts +1 -1
- package/dist/storage/session-recovery.d.ts +10 -0
- package/dist/storage/session-resume-validation.d.ts +13 -1
- package/dist/storage/session-store/events.d.ts +1 -1
- package/dist/storage/session-store/load-session-data.d.ts +1 -1
- package/dist/storage/session-store/rename-session.d.ts +1 -1
- package/dist/storage/session-store/resume-session.d.ts +3 -1
- package/dist/storage/session-store/session-store-index.d.ts +2 -1
- package/dist/storage/session-store/types.d.ts +1 -1
- package/dist/storage/session-store.d.ts +70 -0
- package/dist/storage/session-summary-tracker.d.ts +8 -0
- package/dist/storage/session-write-buffer.d.ts +31 -2
- package/dist/storage/task-store.d.ts +1 -1
- package/dist/storage/todos-checkpoint.d.ts +1 -1
- package/dist/storage/tool-audit-log.d.ts +1 -1
- package/dist/tasking/index.js +100 -22
- package/dist/tasking/task-tracker.d.ts +24 -1
- package/dist/types/compactor.d.ts +2 -2
- package/dist/types/context.d.ts +212 -0
- package/dist/types/conversation-state.d.ts +109 -0
- package/dist/types/error-handler.d.ts +2 -2
- package/dist/types/file-event-record.d.ts +6 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.js +17 -1
- package/dist/types/permission.d.ts +3 -3
- package/dist/types/plugin.d.ts +3 -3
- package/dist/types/provider-runner.d.ts +2 -2
- package/dist/types/provider.d.ts +10 -0
- package/dist/types/run-env.d.ts +32 -0
- package/dist/types/session.d.ts +3 -0
- package/dist/types/slash-command.d.ts +2 -2
- package/dist/types/token-counter.d.ts +30 -1
- package/dist/types/tool-executor.d.ts +2 -2
- package/dist/types/tool.d.ts +5 -5
- package/dist/utils/context-breakdown.d.ts +2 -2
- package/dist/utils/context-evidence.d.ts +12 -12
- package/dist/utils/crash-shield.d.ts +9 -0
- package/dist/utils/heap-watchdog.js +11 -3
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +72 -156
- package/dist/utils/regex-guard.d.ts +7 -30
- package/dist/utils/todos-format.d.ts +1 -1
- package/dist/utils/tree-kill.d.ts +2 -0
- package/dist/utils/tree-kill.js +1 -0
- package/instructions/coordination/subagent-baseline.md +10 -0
- package/instructions/system-lite.md +2 -0
- package/instructions/system-pro.md +40 -0
- package/instructions/system.md +15 -0
- package/package.json +6 -9
- package/dist/defaults/index.d.ts +0 -69
- package/dist/defaults/index.js +0 -38133
- /package/dist/{fleet-notifier.d.ts → coordination/fleet-notifier.d.ts} +0 -0
- /package/dist/{session-registry-atomic-file.d.ts → session-catalog/session-registry-atomic-file.d.ts} +0 -0
- /package/dist/{session-registry-types.d.ts → session-catalog/session-registry-types.d.ts} +0 -0
- /package/dist/{session-registry.d.ts → session-catalog/session-registry.d.ts} +0 -0
package/instructions/system.md
CHANGED
|
@@ -76,6 +76,21 @@ Before you write any new code — a function, a wrapper, a flag, a fallback path
|
|
|
76
76
|
|
|
77
77
|
The ladder trims what **you** invented; it never shrinks what the user asked for. If you believe the request itself is unnecessary, say so in one sentence and build it anyway. Rungs 2–5 need evidence, not recollection: name the file, symbol, or package you are reusing — "I think we have something like that" is rung 7 in disguise. A new dependency is the user's decision, never a side effect. Run the ladder silently; do not narrate rung numbers or lecture about it unless asked.
|
|
78
78
|
|
|
79
|
+
## Architecture discipline
|
|
80
|
+
|
|
81
|
+
The five questions decide *whether* the change is right; the cost ladder decides *how much* it costs; this section decides *what shape* it takes. Maintainability, testability, and consistent structure outrank the fastest possible patch. These rules govern only the code you write or touch — they are never a license to refactor working neighbors; note violations in your summary instead.
|
|
82
|
+
|
|
83
|
+
- **Boundaries (clean/hexagonal):** domain logic stays pure (no framework, SDK, or I/O imports); orchestration sits above it; DB drivers, external APIs, and third-party SDKs live behind adapters at the edge. Dependencies point inward.
|
|
84
|
+
- **Program to interfaces** wherever a behavior has, or will plausibly have, more than one implementation; inject the concrete choice. Prefer composition over inheritance.
|
|
85
|
+
- **Single responsibility:** past ~200 lines, evaluate whether two concerns got mixed; split along a seam rather than appending.
|
|
86
|
+
- **Factory:** creation of dynamic or multi-provider services (payment gateways, AI models, storage drivers, notification channels) routes through a dedicated factory — never a bare constructor inside a handler.
|
|
87
|
+
- **Singleton:** only for expensive shared resources (connection pools, loggers, cache managers); no global mutable-state leakage.
|
|
88
|
+
- **Adapter:** third-party SDKs and external schemas never touch domain types. Map vendor shapes at the boundary so vendor churn stops there.
|
|
89
|
+
- **Strategy:** when an `if`/`switch` selects between interchangeable algorithms or behaviors across more than two cases, extract an injected strategy instead of growing the branch.
|
|
90
|
+
- **Observer/typed events:** decouple side-effects (audit logs, metrics, emails, notifications, cache invalidation) from the action that caused them.
|
|
91
|
+
- Zero speculative dependencies or framework sprawl; strict typing and explicit error handling by default.
|
|
92
|
+
- When scaffolding or adding a feature, state briefly which pattern you applied and why — one line each, not a lecture.
|
|
93
|
+
|
|
79
94
|
<!--ws:if tool=todo-->
|
|
80
95
|
## Todo status lifecycle
|
|
81
96
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.310.0",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "WrongStack core: kernel, types,
|
|
5
|
+
"description": "WrongStack core: kernel, types, and shared utilities for the WrongStack CLI agent.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/WrongStack/WrongStack.git",
|
|
@@ -44,10 +44,6 @@
|
|
|
44
44
|
"types": "./dist/core/model-ref.d.ts",
|
|
45
45
|
"import": "./dist/core/model-ref.js"
|
|
46
46
|
},
|
|
47
|
-
"./defaults": {
|
|
48
|
-
"types": "./dist/defaults/index.d.ts",
|
|
49
|
-
"import": "./dist/defaults/index.js"
|
|
50
|
-
},
|
|
51
47
|
"./utils": {
|
|
52
48
|
"types": "./dist/utils/index.d.ts",
|
|
53
49
|
"import": "./dist/utils/index.js"
|
|
@@ -182,11 +178,12 @@
|
|
|
182
178
|
"wrongstackApiVersion": "0.1.10",
|
|
183
179
|
"dependencies": {
|
|
184
180
|
"zod": "4.4.3",
|
|
185
|
-
"@wrongstack/
|
|
186
|
-
"@wrongstack/
|
|
181
|
+
"@wrongstack/primitives": "0.310.0",
|
|
182
|
+
"@wrongstack/kanban": "0.310.0",
|
|
183
|
+
"@wrongstack/persistence": "0.310.0"
|
|
187
184
|
},
|
|
188
185
|
"devDependencies": {
|
|
189
|
-
"@types/node": "^
|
|
186
|
+
"@types/node": "^22.19.0",
|
|
190
187
|
"typescript": "^7.0.2"
|
|
191
188
|
},
|
|
192
189
|
"publishConfig": {
|
package/dist/defaults/index.d.ts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
export { createMessage, InMemoryAgentBridge, InMemoryBridgeTransport, } from '../coordination/agent-bridge.js';
|
|
2
|
-
export { type AgentFactory, type AgentFactoryResult, type AgentRunnerOptions, makeAgentSubagentRunner, } from '../coordination/agent-subagent-runner.js';
|
|
3
|
-
export { AGENT_CATALOG, AGENTS_BY_PHASE, type AgentBudgetTier, type AgentCapability, type AgentDefinition, type AgentPhase, ALL_AGENT_DEFINITIONS, getAgentDefinition, } from '../coordination/agents/index.js';
|
|
4
|
-
export { type AutoExtendCeiling, type AutoExtendPolicy, attachAutoExtend, } from '../coordination/auto-extend.js';
|
|
5
|
-
export { type CreateDelegateToolOptions, createDelegateTool, type DelegateHost, } from '../coordination/delegate-tool.js';
|
|
6
|
-
export { Director, FleetSpawnBudgetError, } from '../coordination/director.js';
|
|
7
|
-
export { composeDirectorPrompt, composeSubagentPrompt, DEFAULT_DIRECTOR_PREAMBLE, DEFAULT_SUBAGENT_BASELINE, type DirectorPromptParts, rosterSummaryFromConfigs, type SubagentPromptParts, } from '../coordination/director-prompts.js';
|
|
8
|
-
export { type DirectorSessionFactory, type DirectorSessionFactoryOptions, makeDirectorSessionFactory, } from '../coordination/director-session.js';
|
|
9
|
-
export { makeAskTool, makeAssignTool, makeAwaitTasksTool, makeCollabDebugTool, makeFleetEmitTool, makeFleetTool, makeRollUpTool, makeSpawnTool, makeTerminateTool, } from '../coordination/director-tools.js';
|
|
10
|
-
export { DEFAULT_DISPATCH_ROLE, type DispatchCandidate, type DispatchClassifier, type DispatchMethod, type DispatchOptions, type DispatchResult, dispatchAgent, makeLLMClassifier, scoreAgents, } from '../coordination/dispatcher.js';
|
|
11
|
-
export { ALL_FLEET_AGENTS, AUDIT_LOG_AGENT, applyRosterBudget, BUG_HUNTER_AGENT, FLEET_ROSTER, FLEET_ROSTER_BUDGETS, type FleetRosterBudget, REFACTOR_PLANNER_AGENT, SECURITY_SCANNER_AGENT, } from '../coordination/fleet.js';
|
|
12
|
-
export { FleetBus, type FleetEvent, type FleetHandler, type FleetUsage, FleetUsageAggregator, type SubagentUsageSnapshot, } from '../coordination/fleet-bus.js';
|
|
13
|
-
export type { ICoordinator } from '../coordination/icoordinator.js';
|
|
14
|
-
export type { IFleetManager } from '../coordination/ifleet-manager.js';
|
|
15
|
-
export { DefaultMultiAgentCoordinator, type MultiAgentCoordinatorOptions, } from '../coordination/multi-agent-coordinator.js';
|
|
16
|
-
export { NULL_FLEET_BUS } from '../coordination/null-fleet-bus.js';
|
|
17
|
-
export { BudgetExceededError, type BudgetKind, type BudgetLimits, type BudgetUsage, SubagentBudget, } from '../coordination/subagent-budget.js';
|
|
18
|
-
export { AutoCompactionMiddleware } from '../execution/auto-compaction-middleware.js';
|
|
19
|
-
export { installSubagentAutoCompaction } from '../execution/subagent-compaction.js';
|
|
20
|
-
export { AutonomousRunner, type AutonomousRunnerOptions, type DoneCheckResult, DoneConditionChecker, } from '../execution/autonomous-runner.js';
|
|
21
|
-
export { type AutonomyPromptContributorOptions, makeAutonomyPromptContributor, } from '../execution/autonomy-prompt-contributor.js';
|
|
22
|
-
export { type CompactorOptions, DEFAULT_AUTONOMY_CONFIG, DEFAULT_CONTEXT_CONFIG, DEFAULT_TOOLS_CONFIG, HybridCompactor, } from '../execution/compactor.js';
|
|
23
|
-
export { activateDesign, clearActiveKit, detectFrontendFile, detectFrontendIntent, getDesignState, installDesignStudioMiddleware, makeDesignDetectToolCallMiddleware, makeDesignDetectUserInputMiddleware, makeDesignStudioRequestMiddleware, makeDesignVerifyToolCallMiddleware, setActiveKit, setDesignOverrides, } from '../execution/design-detect.js';
|
|
24
|
-
export { _resetDesignKitLoaderMemo, DefaultDesignKitLoader, type DesignKitLoaderOptions, getDesignKitLoader, resolveBundledDesignKitsDir, } from '../execution/design-kit-loader.js';
|
|
25
|
-
export { classifyTokenValue, colorToHex, isColorToken, oklchToHex, parseOklch, } from '../execution/design-color.js';
|
|
26
|
-
export { type MaterializeResult, materializeTokens, } from '../execution/design-materialize.js';
|
|
27
|
-
export { type DesignAxis, type DesignVerifyReport, type DesignViolation, runDesignVerify, verifyFiles, } from '../execution/design-verify.js';
|
|
28
|
-
export { resolveSemanticTune, SEMANTIC_TUNE_KNOBS, type SemanticTune, } from '../execution/design-tune.js';
|
|
29
|
-
export { _resetDesignRulesCache, applyTokenOverrides, clearPersistedActiveKit, designProjectDir, type DesignOverrides, loadActiveKit, loadProjectDesignRules, type PersistedActiveKit, recordKitChoice, recordOverrides, } from '../execution/design-project-store.js';
|
|
30
|
-
export { DefaultErrorHandler } from '../execution/error-handler.js';
|
|
31
|
-
export { EternalAutonomyEngine, type EternalAutonomyOptions, type EternalEngineState, type IterationStage, } from '../execution/eternal-autonomy.js';
|
|
32
|
-
export { buildGoalPreamble } from '../execution/goal-preamble.js';
|
|
33
|
-
export { IntelligentCompactor, type IntelligentCompactorOptions, } from '../execution/intelligent-compactor.js';
|
|
34
|
-
export { type ParallelEngineState, ParallelEternalEngine, type ParallelEternalOptions, type ParallelIterationStage, } from '../execution/parallel-eternal-engine.js';
|
|
35
|
-
export { DefaultProviderRunner } from '../execution/provider-runner-impl.js';
|
|
36
|
-
export { DefaultRetryPolicy } from '../execution/retry-policy.js';
|
|
37
|
-
export { SelectiveCompactor, type SelectiveCompactorOptions, } from '../execution/selective-compactor.js';
|
|
38
|
-
export { DefaultSkillLoader, type SkillLoaderOptions } from '../execution/skill-loader.js';
|
|
39
|
-
export { DefaultPromptLoader, type PromptLoaderOptions, renderPrompt, } from '../execution/prompt-loader.js';
|
|
40
|
-
export { type CompactorStrategy, createStrategyCompactor, type StrategyCompactorOptions, } from '../execution/strategy-compactor.js';
|
|
41
|
-
export { ToolExecutor } from '../execution/tool-executor.js';
|
|
42
|
-
export { type ContextManagerAction, type ContextManagerInput, type ContextManagerResult, type ContextManagerToolOptions, contextManagerTool, createContextManagerTool, } from '../infrastructure/context-manager.js';
|
|
43
|
-
export { DefaultLogger, type DefaultLoggerOptions, type LogFormat, } from '../infrastructure/logger.js';
|
|
44
|
-
export { allServers, awsServer, blockServer, braveSearchServer, context7Server, everArtServer, filesystemServer, githubServer, googleMapsServer, miniMaxVisionServer, playwrightServer, sentinelServer, slackServer, sshManagerServer, zaiVisionServer, } from '../infrastructure/mcp-servers.js';
|
|
45
|
-
export { CODEX_MODELS, type CodexModelMeta, codexModelMeta } from '../models/codex-catalog.js';
|
|
46
|
-
export { LLMSelector, type LLMSelectorOptions } from '../models/llm-selector.js';
|
|
47
|
-
export { DefaultModeStore, loadProjectModes, loadUserModes, type ModeLoaderOptions, } from '../models/mode-store.js';
|
|
48
|
-
export { classifyFamily, DefaultModelsRegistry, type DefaultModelsRegistryOptions, } from '../models/models-registry.js';
|
|
49
|
-
export { describeCatalogModel, type ProviderModelDescriptor, resolveProviderModelList, } from '../models/provider-model-resolve.js';
|
|
50
|
-
export { buildOtlpMetricsRequest, buildOtlpTracesRequest, DefaultHealthRegistry, InMemoryMetricsSink, type MetricsServerHandle, type MetricsServerOptions, NoopMetricsSink, NoopTracer, OTelTracer, type OtlpMetricsExporterHandle, type OtlpMetricsExporterOptions, type OtlpTraceExporterHandle, type OtlpTraceExporterOptions, PROMETHEUS_CONTENT_TYPE, renderPrometheus, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, wireMetricsToEvents, } from '../observability/index.js';
|
|
51
|
-
export { AutoApprovePermissionPolicy, DefaultPermissionPolicy, type PermissionPolicyOptions, } from '../security/permission-policy.js';
|
|
52
|
-
export { DefaultSecretScrubber } from '../security/secret-scrubber.js';
|
|
53
|
-
export { DefaultSecretVault, migratePlaintextSecrets, rewriteConfigEncrypted, type SecretVaultOptions, } from '../security/secret-vault.js';
|
|
54
|
-
export { decryptConfigSecrets, encryptConfigSecrets } from '../security/config-secrets.js';
|
|
55
|
-
export { type AttachmentStoreOptions, DefaultAttachmentStore, } from '../storage/attachment-store.js';
|
|
56
|
-
export { type ConfigLoaderOptions, type ConfigSource, DefaultConfigLoader, } from '../storage/config-loader.js';
|
|
57
|
-
export { type ConfigMigration, ConfigMigrationError, DEFAULT_CONFIG_MIGRATIONS, type MigrationContext, type MigrationResult, runConfigMigrations, } from '../storage/config-migration.js';
|
|
58
|
-
export { DefaultConfigStore } from '../storage/config-store.js';
|
|
59
|
-
export { DirectorStateCheckpoint, type DirectorStateSnapshot, type DirectorSubagentState, type DirectorTaskState, loadDirectorState, } from '../storage/director-state.js';
|
|
60
|
-
export { addPlanItem, attachPlanCheckpoint, clearPlan, deriveTodosFromPlanItem, emptyPlan, formatPlan, loadPlan, type PlanFile, type PlanItem, removePlanItem, savePlan, setPlanItemStatus, } from '../storage/plan-store.js';
|
|
61
|
-
export { formatPlanTemplates, getPlanTemplate, listPlanTemplates, type PlanTemplate, } from '../storage/plan-templates.js';
|
|
62
|
-
export { type PersistedQueueItem, QueueStore, } from '../storage/queue-store.js';
|
|
63
|
-
export { type AbandonedSession, RecoveryLock, type RecoveryLockOptions, } from '../storage/recovery-lock.js';
|
|
64
|
-
export { SessionAnalyzer } from '../storage/session-analyzer.js';
|
|
65
|
-
export { type AuditLevel, createSessionEventBridge, resolveAuditLevel, resolveSessionLoggingConfig, type SessionEventBridge, type SessionEventBridgeOptions, type SessionSamplingOptions, type ToolProgressSamplingOptions, } from '../storage/session-event-bridge.js';
|
|
66
|
-
export { DefaultSessionReader } from '../storage/session-reader.js';
|
|
67
|
-
export { DefaultSessionStore, type SessionStoreOptions, } from '../storage/session-store.js';
|
|
68
|
-
export { attachTodosCheckpoint, loadTodosCheckpoint, saveTodosCheckpoint, type TodosCheckpointFile, } from '../storage/todos-checkpoint.js';
|
|
69
|
-
//# sourceMappingURL=index.d.ts.map
|