@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.
- package/dist/chronicle/index.d.ts +2 -0
- package/dist/chronicle/index.js +297 -10
- package/dist/chronicle/project-server.js +253 -15
- package/dist/chronicle/sqlite-compaction.d.ts +20 -0
- package/dist/chronicle/sqlite-journal.d.ts +57 -0
- package/dist/coordination/agents/capability-manifest.d.ts +7 -0
- package/dist/coordination/agents/index.d.ts +3 -2
- package/dist/coordination/agents/index.js +818 -570
- package/dist/coordination/agents/project-agent-identity.d.ts +6 -6
- package/dist/coordination/agents/role-skills.d.ts +1 -1
- package/dist/coordination/agents/types.d.ts +6 -0
- package/dist/coordination/director.d.ts +2 -2
- package/dist/coordination/index.js +6787 -6447
- package/dist/coordination/mail-tools.d.ts +3 -3
- package/dist/coordination/mailbox-project-server.js +3 -4
- package/dist/coordination/mailbox-types.d.ts +6 -0
- package/dist/core/agent-response.d.ts +5 -1
- package/dist/core/agent-tools.d.ts +3 -0
- package/dist/core/context.d.ts +20 -0
- package/dist/core/index.d.ts +8 -7
- package/dist/core/index.js +893 -284
- package/dist/core/instruction-template.d.ts +6 -3
- package/dist/core/next-steps-slot.d.ts +88 -0
- package/dist/core/system-prompt-builder.d.ts +5 -3
- package/dist/core/system-prompt-memory-skills.d.ts +1 -0
- package/dist/core/system-prompt-skill-bodies.d.ts +3 -3
- package/dist/defaults/index.js +9797 -8898
- package/dist/design/index.js +11 -3
- package/dist/execution/auto-compaction-middleware.d.ts +17 -0
- package/dist/execution/autonomy-brain.d.ts +8 -2
- package/dist/execution/brain-runtime.d.ts +3 -1
- package/dist/execution/compaction-core.d.ts +41 -2
- package/dist/execution/council-brain.d.ts +37 -2
- package/dist/execution/council-orchestrator.d.ts +2 -2
- package/dist/execution/index.d.ts +11 -10
- package/dist/execution/index.js +5179 -4078
- package/dist/execution/tool-executor.d.ts +4 -1
- package/dist/execution/topic-shift-advisor.d.ts +53 -0
- package/dist/extension/index.js +8 -2
- package/dist/extension/registry.d.ts +8 -1
- package/dist/goal/index.js +11 -3
- package/dist/hooks/index.js +42 -9
- package/dist/hooks/runner.d.ts +12 -1
- package/dist/hq/index.js +41 -17
- package/dist/hq/publisher.d.ts +21 -3
- package/dist/index.d.ts +21 -20
- package/dist/index.js +10901 -8067
- package/dist/infrastructure/index.js +108 -21
- package/dist/kernel/events/session-events.d.ts +13 -0
- package/dist/kernel/events/tool-events.d.ts +3 -3
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +17 -0
- package/dist/models/provider-credentials.d.ts +54 -0
- package/dist/plugin/index.d.ts +1 -0
- package/dist/plugin/index.js +2024 -502
- package/dist/plugins/auto-review-plugin.d.ts +3 -0
- package/dist/plugins/cloud-config-sync-plugin.d.ts +22 -0
- package/dist/plugins/review-claim-registry.d.ts +23 -8
- package/dist/plugins/review-types.d.ts +2 -0
- package/dist/registry/index.js +109 -74
- package/dist/registry/tool-registry.d.ts +15 -0
- package/dist/security/capabilities.d.ts +2 -0
- package/dist/security/index.d.ts +1 -1
- package/dist/security/index.js +9 -2
- package/dist/security/readonly-permission-policy.d.ts +20 -0
- package/dist/session-registry-atomic-file.d.ts +32 -5
- package/dist/session-registry-types.d.ts +17 -0
- package/dist/session-registry.d.ts +1 -1
- package/dist/skills/frontmatter.d.ts +6 -0
- package/dist/skills/index.js +22 -5
- package/dist/storage/cloud-config-sync/sanitize.d.ts +54 -0
- package/dist/storage/cloud-config-sync.d.ts +87 -0
- package/dist/storage/index.d.ts +2 -1
- package/dist/storage/index.js +854 -66
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +511 -234
- package/dist/tools/one-shot-llm-tool.d.ts +1 -0
- package/dist/tools/plugin-manager.d.ts +27 -0
- package/dist/types/config/mcp-features.d.ts +18 -11
- package/dist/types/config/root.d.ts +8 -1
- package/dist/types/config/runtime.d.ts +20 -6
- package/dist/types/config/skills-fleet-brain.d.ts +12 -4
- package/dist/types/config/tools.d.ts +16 -0
- package/dist/types/context-window.d.ts +1 -0
- package/dist/types/hooks.d.ts +14 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +1 -0
- package/dist/types/multi-agent.d.ts +2 -0
- package/dist/types/one-shot-llm.d.ts +16 -0
- package/dist/types/provider.d.ts +16 -0
- package/dist/types/runtime-capability-manifest.d.ts +168 -0
- package/dist/types/skill.d.ts +5 -0
- package/dist/types/system-prompt.d.ts +3 -1
- package/dist/types/tool-executor.d.ts +8 -1
- package/dist/utils/context-breakdown.d.ts +8 -2
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +141 -31
- package/dist/utils/regex-guard.d.ts +16 -2
- package/dist/utils/sage-output-block.d.ts +7 -10
- package/dist/utils/wstack-paths.d.ts +11 -3
- package/instructions/agents/browser.md +1 -4
- package/instructions/agents/e2e.md +17 -15
- package/instructions/agents/ios.md +3 -3
- package/instructions/agents/search.md +1 -1
- package/instructions/autonomy/goal-preamble.md +4 -4
- package/instructions/coordination/director-preamble.md +2 -3
- package/instructions/coordination/subagent-baseline.md +3 -1
- package/instructions/leader-after-task.md +12 -0
- package/instructions/llm/chimera-review.md +1 -1
- package/instructions/modes/audit-lite.md +1 -1
- package/instructions/sections/tool/common-patterns.md +18 -2
- package/instructions/sections/tool/mailbox-compact.md +1 -1
- package/instructions/sections/tool/mailbox-full.md +1 -1
- package/instructions/system-lite.md +10 -0
- package/instructions/system-pro.md +23 -14
- package/instructions/system.md +22 -13
- package/package.json +3 -3
- package/skills/api-design/SKILL.md +3 -0
- package/skills/audit-log/SKILL.md +2 -0
- package/skills/auto-review/SKILL.md +6 -1
- package/skills/bug-hunter/SKILL.md +4 -1
- package/skills/chimera/SKILL.md +3 -0
- package/skills/data-governance/SKILL.md +3 -0
- package/skills/design-system/SKILL.md +5 -2
- package/skills/docker-deploy/SKILL.md +2 -0
- package/skills/git-flow/SKILL.md +2 -0
- package/skills/mailbox-bridge/SKILL.md +3 -0
- package/skills/mnemosyne/SKILL.md +2 -0
- package/skills/multi-agent/SKILL.md +4 -1
- package/skills/node-modern/SKILL.md +4 -1
- package/skills/observability/SKILL.md +3 -0
- package/skills/output-standards/SKILL.md +2 -0
- package/skills/plugin-author/SKILL.md +4 -1
- package/skills/prompt-engineering/SKILL.md +3 -1
- package/skills/react-modern/SKILL.md +6 -3
- package/skills/refactor-planner/SKILL.md +2 -0
- package/skills/research-web/SKILL.md +3 -0
- package/skills/sdd/SKILL.md +3 -1
- package/skills/security-scanner/SKILL.md +3 -0
- package/skills/skill-creator/SKILL.md +2 -0
- package/skills/tech-stack/SKILL.md +3 -0
- package/skills/testing/SKILL.md +4 -1
- package/skills/typescript-strict/SKILL.md +4 -1
- package/skills/wrongstack-kanban/SKILL.md +6 -3
- package/skills/wrongstack-mailbox/SKILL.md +4 -1
- package/skills/wrongstack-mailbox-mcp/SKILL.md +10 -8
|
@@ -75,12 +75,12 @@ export declare function makeMailSendTool(opts?: MailToolsOptions): {
|
|
|
75
75
|
required: string[];
|
|
76
76
|
};
|
|
77
77
|
execute(input: unknown, ctx: Context): Promise<{
|
|
78
|
-
ok: boolean;
|
|
79
|
-
error: string;
|
|
80
78
|
messageId?: never;
|
|
81
|
-
from?: never;
|
|
82
79
|
to?: never;
|
|
83
80
|
summary?: never;
|
|
81
|
+
ok: boolean;
|
|
82
|
+
error: string;
|
|
83
|
+
from?: never;
|
|
84
84
|
} | {
|
|
85
85
|
error?: never;
|
|
86
86
|
ok: boolean;
|
|
@@ -1371,9 +1371,7 @@ function isMailboxMessageVisibleTo(message, agentId, role) {
|
|
|
1371
1371
|
}
|
|
1372
1372
|
function validateSendType(type, to) {
|
|
1373
1373
|
if (type === "control") {
|
|
1374
|
-
throw new TypeError(
|
|
1375
|
-
'Type "control" is reserved for runtime use and cannot be set by agents'
|
|
1376
|
-
);
|
|
1374
|
+
throw new TypeError('Type "control" is reserved for runtime use and cannot be set by agents');
|
|
1377
1375
|
}
|
|
1378
1376
|
const isMultiRecipient = to === "*" || to.startsWith("@session:");
|
|
1379
1377
|
if (type === "assign" && isMultiRecipient) {
|
|
@@ -1411,7 +1409,8 @@ function isMailboxReceiptRecordV2(value) {
|
|
|
1411
1409
|
if (typeof v["timestamp"] !== "string" || v["timestamp"].length === 0) return false;
|
|
1412
1410
|
if ("read" in v && typeof v["read"] !== "boolean") return false;
|
|
1413
1411
|
if ("completed" in v && typeof v["completed"] !== "boolean") return false;
|
|
1414
|
-
if ("outcome" in v && v["outcome"] !== void 0 && typeof v["outcome"] !== "string")
|
|
1412
|
+
if ("outcome" in v && v["outcome"] !== void 0 && typeof v["outcome"] !== "string")
|
|
1413
|
+
return false;
|
|
1415
1414
|
return true;
|
|
1416
1415
|
}
|
|
1417
1416
|
|
|
@@ -204,6 +204,12 @@ export interface MailboxSessionAffinityContext {
|
|
|
204
204
|
* compatibility).
|
|
205
205
|
* 6. Otherwise drop (`false`).
|
|
206
206
|
*
|
|
207
|
+
* PR #314 guard contract: presence checks intentionally use strict
|
|
208
|
+
* `!== undefined` comparisons for both the affinity token and its optional
|
|
209
|
+
* fields. Do not simplify them to nullish checks: malformed persisted `null`
|
|
210
|
+
* values must remain on the token-bearing path and fail closed in the shape
|
|
211
|
+
* guard rather than being treated as absent.
|
|
212
|
+
*
|
|
207
213
|
* Trust note: the filter accepts the sender-asserted `sessionAffinity.sessionId`
|
|
208
214
|
* without store cross-check (rule 3). The persisted-report fallback (rule 4)
|
|
209
215
|
* is the only server-side check. A sender that fabricates both an affinity
|
|
@@ -28,7 +28,11 @@ export interface AgentResponseHandler {
|
|
|
28
28
|
* todos change during tool execution. Keeping this block volatile makes the
|
|
29
29
|
* final-response contract follow the live todo state on every iteration.
|
|
30
30
|
*/
|
|
31
|
-
export declare function buildLiveNextStepsGateBlock(ctx: Pick<Context, 'agentId' | 'todos'>
|
|
31
|
+
export declare function buildLiveNextStepsGateBlock(ctx: Pick<Context, 'agentId' | 'todos'> & {
|
|
32
|
+
tools?: readonly {
|
|
33
|
+
name: string;
|
|
34
|
+
}[] | undefined;
|
|
35
|
+
}): TextBlock | undefined;
|
|
32
36
|
export declare function createAgentResponseHandler(a: AgentInternals): AgentResponseHandler;
|
|
33
37
|
export {};
|
|
34
38
|
//# sourceMappingURL=agent-response.d.ts.map
|
package/dist/core/context.d.ts
CHANGED
|
@@ -50,6 +50,8 @@ export interface ContextInit {
|
|
|
50
50
|
allowOutsideProjectRoot?: boolean | undefined;
|
|
51
51
|
model: string;
|
|
52
52
|
tools?: Tool[] | undefined;
|
|
53
|
+
/** Complete executable catalog for lazy discovery/meta-tools. */
|
|
54
|
+
catalogTools?: Tool[] | undefined;
|
|
53
55
|
/** Agent id performing this run (e.g. 'leader', 'executor', 'tech-stack'). */
|
|
54
56
|
agentId?: string | undefined;
|
|
55
57
|
/** Human-readable agent name. */
|
|
@@ -63,6 +65,12 @@ export interface ContextInit {
|
|
|
63
65
|
*/
|
|
64
66
|
traceId?: string | undefined;
|
|
65
67
|
}
|
|
68
|
+
export interface ProviderMemoryEvidence {
|
|
69
|
+
/** Stable owner key, for example `sage.tool-memory`. */
|
|
70
|
+
source: string;
|
|
71
|
+
/** Provider-bound evidence text; never appended to chat/tool history. */
|
|
72
|
+
text: string;
|
|
73
|
+
}
|
|
66
74
|
/**
|
|
67
75
|
* L1-A: `Context` is the live agent-run object. Its read-only environment
|
|
68
76
|
* shape is exposed by the `RunEnv` interface (every field below the
|
|
@@ -197,6 +205,8 @@ export declare class Context implements RunEnv {
|
|
|
197
205
|
allowOutsideProjectRoot: boolean;
|
|
198
206
|
model: string;
|
|
199
207
|
tools: Tool[];
|
|
208
|
+
/** Complete enabled catalog; provider token accounting continues to use `tools`. */
|
|
209
|
+
catalogTools: Tool[];
|
|
200
210
|
meta: Record<string, unknown>;
|
|
201
211
|
/** Agent id performing this run (e.g. 'leader', 'executor'). */
|
|
202
212
|
agentId: string;
|
|
@@ -266,6 +276,16 @@ export declare class Context implements RunEnv {
|
|
|
266
276
|
* Cleared after being consumed by agent-tools.
|
|
267
277
|
*/
|
|
268
278
|
pendingPostToolContext: string | undefined;
|
|
279
|
+
/**
|
|
280
|
+
* Bounded, provider-bound memory evidence kept outside conversation and
|
|
281
|
+
* tool-result history. Owners replace their own slot instead of appending a
|
|
282
|
+
* fresh message on every retrieval, so long sessions do not accumulate the
|
|
283
|
+
* same SAGE hints. Request construction emits these as ephemeral system
|
|
284
|
+
* suffixes, preserving the stable prompt-cache prefix.
|
|
285
|
+
*/
|
|
286
|
+
memoryEvidence: ProviderMemoryEvidence[];
|
|
287
|
+
setMemoryEvidence(source: string, text: string | undefined, maxChars?: number): void;
|
|
288
|
+
clearMemoryEvidence(source?: string): void;
|
|
269
289
|
/**
|
|
270
290
|
* H1: pre-computed total-request token estimate from the most recent
|
|
271
291
|
* `estimateRequestTokens()` call in the agent loop's pre-flight step.
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
export { Agent, type RunResult, type UserInputPayload, } from './agent.js';
|
|
2
|
-
export {
|
|
3
|
-
export { Context, type ContextInit, type RunOptions, type TodoItem } from './context.js';
|
|
4
|
-
export { ConversationState, type ReadonlyConversationState, type StateChange, type StateChangeHandler, wrapAsState, } from './conversation-state.js';
|
|
5
|
-
export { InputBuilder, type InputBuilderEvent, type InputBuilderOptions, } from './input-builder.js';
|
|
2
|
+
export { type AgentInit, type AgentInput, type AgentPipelines, createDefaultPipelines, type ToolCallPipelinePayload, } from './agent-types.js';
|
|
6
3
|
export { buildBtwBlock, consumeBtwNotes, pendingBtwCount, setBtwNote, } from './btw.js';
|
|
4
|
+
export { Context, type ContextInit, type ProviderMemoryEvidence, type RunOptions, type TodoItem, } from './context.js';
|
|
7
5
|
export { type ContinuationInput, type ContinuationSource, detectContinueIntent, type ResolvedContinuation, resolveContinuation, } from './continue-intent.js';
|
|
6
|
+
export { ConversationState, type ReadonlyConversationState, type StateChange, type StateChangeHandler, wrapAsState, } from './conversation-state.js';
|
|
8
7
|
export { createFallbackModelExtension, effectiveFallbackChain, type FallbackGateFn, type FallbackModelDeps, fallbackProfileChain, smartDefaultFallbackChain, } from './fallback-model.js';
|
|
9
8
|
export { FallbackProfileManager } from './fallback-profile-manager.js';
|
|
10
|
-
export {
|
|
11
|
-
export { DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, type SystemBlockSource, } from './system-prompt-builder.js';
|
|
9
|
+
export { InputBuilder, type InputBuilderEvent, type InputBuilderOptions, } from './input-builder.js';
|
|
12
10
|
export { type InstructionBundle, type InstructionBundlePaths, loadInstructionBundle, type SystemInstructionVariant, } from './instruction-bundle.js';
|
|
13
11
|
export { type InstructionTemplateContext, renderInstructionLayer, } from './instruction-template.js';
|
|
14
|
-
export {
|
|
12
|
+
export { formatModelRef, type ModelRef, normalizeModelRef, parseModelRef, } from './model-ref.js';
|
|
13
|
+
export { clearPendingNextSteps, hasNextStepsTag, MAX_PENDING_NEXT_STEPS, maybeAppendPendingNextSteps, type PendingNextStep, readPendingNextSteps, renderNextStepsBlock, writePendingNextSteps, } from './next-steps-slot.js';
|
|
15
14
|
export { runProviderWithRetry } from './provider-runner.js';
|
|
15
|
+
export { setQueuedMessagesSnapshot } from './queued-messages.js';
|
|
16
|
+
export { DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, type SystemBlockSource, } from './system-prompt-builder.js';
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|