opencode-matrixx 2.6.11 → 2.6.13
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/agents/architect/default.d.ts +1 -1
- package/dist/agents/architect/gpt.d.ts +1 -1
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +4 -4
- package/dist/agents/model-directives.d.ts +7 -0
- package/dist/agents/oracle/plan-template.d.ts +1 -7
- package/dist/agents/oracle/system-prompt.d.ts +1 -1
- package/dist/cli.js +7 -12
- package/dist/config/schema/dcp.d.ts +15 -11
- package/dist/config/schema/hooks.d.ts +2 -2
- package/dist/config/schema/matrixx-config.d.ts +4 -7
- package/dist/config/schema.d.ts +0 -1
- package/dist/create-hooks.d.ts +2 -2
- package/dist/features/builtin-commands/templates/evolution.d.ts +1 -1
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/evolution/compressor/index.d.ts +2 -2
- package/dist/features/evolution/compressor/interface.d.ts +9 -4
- package/dist/features/evolution/compressor/llm.d.ts +14 -4
- package/dist/features/evolution/evaluator.d.ts +10 -0
- package/dist/features/evolution/pipeline.d.ts +3 -1
- package/dist/features/evolution/schema.d.ts +46 -0
- package/dist/features/evolution/store/budget-ledger.d.ts +46 -0
- package/dist/features/evolution/store/index.d.ts +5 -0
- package/dist/features/evolution/store/lifecycle.d.ts +52 -0
- package/dist/features/evolution/store/project-identity.d.ts +27 -0
- package/dist/features/evolution/store/query.d.ts +23 -0
- package/dist/features/evolution/{store.d.ts → store/trace-store.d.ts} +1 -1
- package/dist/features/evolution/types.d.ts +34 -1
- package/dist/features/evolution/writer-emit.d.ts +17 -0
- package/dist/features/evolution/writer-frontmatter.d.ts +23 -0
- package/dist/features/evolution/writer-supersede.d.ts +20 -0
- package/dist/features/evolution/writer.d.ts +4 -0
- package/dist/features/plan-contract/appendix.d.ts +14 -0
- package/dist/features/plan-contract/constants.d.ts +16 -0
- package/dist/features/plan-contract/front-matter.d.ts +34 -0
- package/dist/features/plan-contract/index.d.ts +14 -0
- package/dist/features/plan-contract/migration.d.ts +36 -0
- package/dist/features/plan-contract/schema.d.ts +32 -0
- package/dist/features/plan-contract/skeleton.d.ts +5 -0
- package/dist/features/plan-contract/types.d.ts +56 -0
- package/dist/features/plan-contract/validate.d.ts +9 -0
- package/dist/features/session-state/state.d.ts +3 -11
- package/dist/hooks/dcp-nudge-sanitizer/constants.d.ts +2 -0
- package/dist/hooks/dcp-nudge-sanitizer/hook.d.ts +25 -0
- package/dist/hooks/dcp-nudge-sanitizer/index.d.ts +1 -0
- package/dist/hooks/evolution-compressor/host-llm-call.d.ts +17 -0
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/nudge-loop-breaker/constants.d.ts +9 -0
- package/dist/hooks/nudge-loop-breaker/hook.d.ts +18 -0
- package/dist/hooks/nudge-loop-breaker/index.d.ts +1 -0
- package/dist/hooks/nudge-loop-breaker/session-state.d.ts +11 -0
- package/dist/hooks/task-continuation-enforcer/constants.d.ts +0 -5
- package/dist/index.js +3155 -1624
- package/dist/matrixx.schema.json +39 -28
- package/dist/plugin/hooks/create-continuation-hooks.d.ts +2 -1
- package/dist/plugin/hooks/create-core-hooks.d.ts +1 -2
- package/dist/plugin/hooks/create-session-hooks.d.ts +1 -2
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +1 -2
- package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -0
- package/dist/plugin/tool-gating.d.ts +2 -0
- package/dist/shared/dcp-switch-profile.d.ts +12 -0
- package/dist/tools/evolution/constants.d.ts +24 -0
- package/dist/tools/evolution/index.d.ts +3 -0
- package/dist/tools/evolution/query-actions.d.ts +3 -0
- package/dist/tools/evolution/tools.d.ts +16 -0
- package/dist/tools/evolution/types.d.ts +20 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/plan/constants.d.ts +1 -0
- package/dist/tools/plan/index.d.ts +1 -0
- package/dist/tools/plan/plan-tasks.d.ts +3 -0
- package/dist/tools/plan/types.d.ts +10 -0
- package/package.json +1 -1
- package/dist/cli/setup/config-writer.test.d.ts +0 -1
- package/dist/cli/setup/deps.test.d.ts +0 -1
- package/dist/cli/setup/index.test.d.ts +0 -1
- package/dist/cli/setup/opencode-sync.test.d.ts +0 -1
- package/dist/cli/setup/prompts.test.d.ts +0 -1
- package/dist/config/schema/failure-counter.d.ts +0 -7
- package/dist/features/background-agent/handle-index.test.d.ts +0 -1
- package/dist/features/background-agent/manager-handles.test.d.ts +0 -1
- package/dist/features/knowledge-hub/loader.test.d.ts +0 -1
- package/dist/features/knowledge-hub/resolver.test.d.ts +0 -1
- package/dist/features/mission-state/plan-storage.test.d.ts +0 -1
- package/dist/features/mission-state/reconcile.test.d.ts +0 -1
- package/dist/features/session-state/state.test.d.ts +0 -1
- package/dist/hooks/failure-counter/counter.d.ts +0 -7
- package/dist/hooks/failure-counter/counter.test.d.ts +0 -1
- package/dist/hooks/failure-counter/hook.d.ts +0 -18
- package/dist/hooks/failure-counter/index.d.ts +0 -3
- package/dist/hooks/failure-counter/patterns.d.ts +0 -6
- package/dist/hooks/failure-counter/patterns.test.d.ts +0 -1
- package/dist/hooks/hashline-edit-diff-enhancer/hook.d.ts +0 -28
- package/dist/hooks/hashline-edit-diff-enhancer/index.d.ts +0 -1
- package/dist/hooks/input-secret-guard/detector.test.d.ts +0 -1
- package/dist/hooks/input-secret-guard/hook.test.d.ts +0 -1
- package/dist/hooks/input-secret-guard/redactor.test.d.ts +0 -1
- package/dist/hooks/input-secret-guard/session-allow-cache.test.d.ts +0 -1
- package/dist/hooks/interactive-bash-session/hook.test.d.ts +0 -1
- package/dist/hooks/knowledge-hub-guard/hook.test.d.ts +0 -1
- package/dist/hooks/knowledge-hub-injector/hook.test.d.ts +0 -1
- package/dist/hooks/knowledge-hub-search-nudge/hook.test.d.ts +0 -1
- package/dist/hooks/plan-persister/task-sync.test.d.ts +0 -1
- package/dist/hooks/rtk-bash-rewriter/hook.test.d.ts +0 -1
- package/dist/hooks/stop-continuation-guard/repro.test.d.ts +0 -1
- package/dist/hooks/task-continuation-enforcer/awaiting-user.test.d.ts +0 -1
- package/dist/hooks/task-continuation-enforcer/continuation-injection.test.d.ts +0 -1
- package/dist/hooks/task-continuation-enforcer/countdown.test.d.ts +0 -1
- package/dist/hooks/task-continuation-enforcer/idle-event.test.d.ts +0 -1
- package/dist/hooks/task-continuation-enforcer/staleness.test.d.ts +0 -1
- package/dist/hooks/task-continuation-enforcer/todo.test.d.ts +0 -1
- package/dist/hooks/task-continuation-enforcer/ulw-bootstrap.test.d.ts +0 -1
- package/dist/hooks/todo-continuation-enforcer/awaiting-user.test.d.ts +0 -1
- package/dist/hooks/todo-continuation-enforcer/countdown.test.d.ts +0 -1
- package/dist/hooks/todo-continuation-enforcer/idle-event.test.d.ts +0 -1
- package/dist/shared/format-bytes.test.d.ts +0 -1
- package/dist/shared/is-abort-error.test.d.ts +0 -1
- package/dist/shared/task-system-gating.test.d.ts +0 -1
- package/dist/shared/with-timeout.test.d.ts +0 -1
- package/dist/tools/delegate-task/poll-timeout-outcome.test.d.ts +0 -1
- package/dist/tools/delegate-task/prompt-builder.tdd.test.d.ts +0 -1
- package/dist/tools/delegate-task/sync-task.test.d.ts +0 -1
- package/dist/tools/delegate-task/tdd-enforcement.test.d.ts +0 -1
- package/dist/tools/delegate-task/timing.test.d.ts +0 -1
- package/dist/tools/github-search/result-formatter.test.d.ts +0 -1
- package/dist/tools/knowledge-hub-confirm/tools.test.d.ts +0 -1
- package/dist/tools/task/task-cleanup.test.d.ts +0 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan Contract Types
|
|
3
|
+
*
|
|
4
|
+
* Structured view of an Oracle work plan: parsed sections, numbered tasks,
|
|
5
|
+
* definition-of-done lines, and optional YAML front-matter.
|
|
6
|
+
*/
|
|
7
|
+
import type { PlanSection } from "./constants";
|
|
8
|
+
export type { PlanSection };
|
|
9
|
+
/** A single numbered TODO task parsed from a plan. */
|
|
10
|
+
export interface PlanTask {
|
|
11
|
+
/** Task number as written in the plan (e.g. `1` in `- [ ] 1. ...`). */
|
|
12
|
+
n: number;
|
|
13
|
+
/** Task title text following the number. */
|
|
14
|
+
title: string;
|
|
15
|
+
/** Whether the task checkbox is checked. */
|
|
16
|
+
checked: boolean;
|
|
17
|
+
/** 1-based line number of the task within the plan file. */
|
|
18
|
+
line: number;
|
|
19
|
+
/** Stable LINE#ID anchor for hashline-scoped edits. */
|
|
20
|
+
anchor: string;
|
|
21
|
+
}
|
|
22
|
+
/** Severity-neutral diagnostic emitted while validating a plan contract. */
|
|
23
|
+
export interface PlanContractWarning {
|
|
24
|
+
/** Machine-readable warning code. */
|
|
25
|
+
code: string;
|
|
26
|
+
/** Human-readable explanation. */
|
|
27
|
+
message: string;
|
|
28
|
+
/** 1-based line the warning refers to, when known. */
|
|
29
|
+
line?: number;
|
|
30
|
+
}
|
|
31
|
+
/** Outcome of validating a plan against the contract. */
|
|
32
|
+
export interface PlanContractResult {
|
|
33
|
+
/** True when no errors were produced (warnings may still be present). */
|
|
34
|
+
ok: boolean;
|
|
35
|
+
/** Non-fatal contract deviations. */
|
|
36
|
+
warnings: PlanContractWarning[];
|
|
37
|
+
/** Fatal contract violations. */
|
|
38
|
+
errors: string[];
|
|
39
|
+
}
|
|
40
|
+
/** Lifecycle status carried by a plan's YAML front-matter. */
|
|
41
|
+
export type PlanStatus = "pending" | "in_progress" | "completed";
|
|
42
|
+
/** Structured YAML front-matter block parsed from a plan file. */
|
|
43
|
+
export interface PlanFrontMatter {
|
|
44
|
+
/** Current plan lifecycle status. */
|
|
45
|
+
status: PlanStatus;
|
|
46
|
+
/** Monotonic revision counter. */
|
|
47
|
+
revision: number;
|
|
48
|
+
/** Execution phase label, when present. */
|
|
49
|
+
phase?: string;
|
|
50
|
+
/** Execution wave label, when present. */
|
|
51
|
+
wave?: string;
|
|
52
|
+
/** Task ids this plan depends on. */
|
|
53
|
+
deps?: string[];
|
|
54
|
+
/** Task ids blocked by this plan. */
|
|
55
|
+
blockedBy?: string[];
|
|
56
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PlanContract } from "./schema";
|
|
2
|
+
import type { PlanContractResult, PlanTask } from "./types";
|
|
3
|
+
/** Optional caller-supplied LINE#ID anchors keyed by 1-based line number. */
|
|
4
|
+
export type HashlineAnchors = ReadonlyMap<number, string> | Readonly<Record<number, string>>;
|
|
5
|
+
export declare function parsePlanTasks(content: string, hashlineAnchors?: HashlineAnchors): PlanTask[];
|
|
6
|
+
export declare function parsePlanContract(content: string): PlanContract;
|
|
7
|
+
export declare function validatePlanContract(content: string, options?: {
|
|
8
|
+
mode?: "warn" | "fail";
|
|
9
|
+
}): PlanContractResult;
|
|
@@ -28,14 +28,6 @@ export declare function setSessionAgent(sessionID: string, agent: string): void;
|
|
|
28
28
|
export declare function updateSessionAgent(sessionID: string, agent: string): void;
|
|
29
29
|
export declare function getSessionAgent(sessionID: string): string | undefined;
|
|
30
30
|
export declare function clearSessionAgent(sessionID: string): void;
|
|
31
|
-
export declare function
|
|
32
|
-
export declare function
|
|
33
|
-
export declare function
|
|
34
|
-
export declare function getFailureState(sessionID: string): {
|
|
35
|
-
count: number;
|
|
36
|
-
lastFailedAt: number;
|
|
37
|
-
} | undefined;
|
|
38
|
-
export declare function clearFailureCounter(sessionID: string): void;
|
|
39
|
-
/** @internal For testing only */
|
|
40
|
-
export declare function _resetFailureCountersForTesting(): void;
|
|
41
|
-
export declare function isThresholdReached(sessionID: string, threshold: number): boolean;
|
|
31
|
+
export declare function setSessionModel(sessionID: string, model: string): void;
|
|
32
|
+
export declare function getSessionModel(sessionID: string): string | undefined;
|
|
33
|
+
export declare function clearSessionModel(sessionID: string): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DCP Sticky-Nudge Sanitizer Hook
|
|
3
|
+
*
|
|
4
|
+
* Ordering constraint (do not "fix" by assuming otherwise):
|
|
5
|
+
* Matrixx registers `experimental.chat.messages.transform` BEFORE DCP (plugin
|
|
6
|
+
* index 0 vs 1), so this sanitizer runs before DCP injects this cycle's nudge.
|
|
7
|
+
* It therefore cleans PRIOR-cycle sticky nudge parts and caps accumulation at
|
|
8
|
+
* ~1 per cycle. It CANNOT suppress the nudge DCP injects later in the SAME
|
|
9
|
+
* cycle. Full same-cycle suppression requires the optional deploy step that
|
|
10
|
+
* reorders the `plugin` array so Matrixx runs after DCP.
|
|
11
|
+
*/
|
|
12
|
+
import type { Part } from "@opencode-ai/sdk";
|
|
13
|
+
import type { PluginContext } from "../../plugin/types";
|
|
14
|
+
interface MessageWithParts {
|
|
15
|
+
info: unknown;
|
|
16
|
+
parts: Part[];
|
|
17
|
+
}
|
|
18
|
+
type MessagesTransformHook = {
|
|
19
|
+
"experimental.chat.messages.transform"?: (input: Record<string, never>, output: {
|
|
20
|
+
messages: MessageWithParts[];
|
|
21
|
+
}) => Promise<void>;
|
|
22
|
+
};
|
|
23
|
+
export declare function sanitizeNudgeParts(messages: MessageWithParts[]): void;
|
|
24
|
+
export declare function createDcpNudgeSanitizerHook(_ctx: PluginContext): MessagesTransformHook;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createDcpNudgeSanitizerHook } from "./hook";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { createOpencodeClient } from "@opencode-ai/sdk";
|
|
2
|
+
import type { LlmUsage } from "../../features/evolution/compressor/interface";
|
|
3
|
+
type Client = ReturnType<typeof createOpencodeClient>;
|
|
4
|
+
export declare function parseModelOverride(model: string | undefined): {
|
|
5
|
+
providerID: string;
|
|
6
|
+
modelID: string;
|
|
7
|
+
} | undefined;
|
|
8
|
+
export declare function createHostLlmCall(options: {
|
|
9
|
+
client: Client;
|
|
10
|
+
directory: string;
|
|
11
|
+
agent?: string;
|
|
12
|
+
model?: string;
|
|
13
|
+
}): (prompt: string, model?: string) => Promise<{
|
|
14
|
+
text: string;
|
|
15
|
+
usage?: LlmUsage;
|
|
16
|
+
}>;
|
|
17
|
+
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { createCompactionTodoPreserverHook } from "./compaction-todo-preserver";
|
|
|
12
12
|
export { createContextModeEnforcerHook } from "./context-mode-enforcer";
|
|
13
13
|
export { type ContextWindowLimitRecoveryOptions, type ContextWindowLimitRecoveryOptions as AnthropicContextWindowLimitRecoveryOptions, createContextWindowLimitRecoveryHook, createContextWindowLimitRecoveryHook as createAnthropicContextWindowLimitRecoveryHook } from "./context-window-limit-recovery";
|
|
14
14
|
export { createContextWindowMonitorHook } from "./context-window-monitor";
|
|
15
|
+
export { createDcpNudgeSanitizerHook } from "./dcp-nudge-sanitizer";
|
|
15
16
|
export { createDelegateTaskRetryHook } from "./delegate-task-retry";
|
|
16
17
|
export { createDesignIntentPreserverHook } from "./design-intent-preserver";
|
|
17
18
|
export { createDirectoryAgentsInjectorHook } from "./directory-agents-injector";
|
|
@@ -24,8 +25,6 @@ export { createEvolutionCompressorHook } from "./evolution-compressor";
|
|
|
24
25
|
export { createEvolutionHitlHook } from "./evolution-hitl";
|
|
25
26
|
export { passesQualityGate } from "./evolution-quality-gate";
|
|
26
27
|
export { createEvolutionWatcherHook } from "./evolution-watcher";
|
|
27
|
-
export { createFailureCounterHook } from "./failure-counter";
|
|
28
|
-
export { createHashlineEditDiffEnhancerHook } from "./hashline-edit-diff-enhancer";
|
|
29
28
|
export { createHashlineReadEnhancerHook } from "./hashline-read-enhancer";
|
|
30
29
|
export { createInputSecretGuardHook } from "./input-secret-guard";
|
|
31
30
|
export { createInteractiveBashSessionHook } from "./interactive-bash-session";
|
|
@@ -37,6 +36,7 @@ export { createKnowledgeHubSearchNudgeHook } from "./knowledge-hub-search-nudge"
|
|
|
37
36
|
export { createMatrixLoopHook, type MatrixLoopHook } from "./matrix-loop";
|
|
38
37
|
export { createMouseNotepadHook } from "./mouse-notepad";
|
|
39
38
|
export { createNonInteractiveEnvHook } from "./non-interactive-env";
|
|
39
|
+
export { createNudgeLoopBreakerHook } from "./nudge-loop-breaker";
|
|
40
40
|
export { createOracleMdOnlyHook } from "./oracle-md-only";
|
|
41
41
|
export { createPlanPersister } from "./plan-persister";
|
|
42
42
|
export { createPostReadInjectorHook } from "./post-read-injector";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const DEFAULT_LOOP_THRESHOLD = 3;
|
|
2
|
+
export declare const DEFAULT_COOLDOWN_MS = 1000;
|
|
3
|
+
export declare const MAX_BACKOFF_EXPONENT = 5;
|
|
4
|
+
export declare const DSML_PATTERNS: RegExp[];
|
|
5
|
+
export declare const SESSION_ID_KEYS: readonly ["sessionID", "sessionId", "session"];
|
|
6
|
+
export declare const TEXT_KEYS: readonly ["text", "content", "message", "assistantText", "snapshot", "assistantMessageID"];
|
|
7
|
+
export declare const TOOL_KEYS: readonly ["tool", "toolName", "name"];
|
|
8
|
+
export declare const RESET_TOOL_NAMES: Set<string>;
|
|
9
|
+
export declare const DETECT_EVENT_TYPES: Set<string>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PluginContext } from "../../plugin/types";
|
|
2
|
+
export interface NudgeLoopBreakerOptions {
|
|
3
|
+
threshold?: number;
|
|
4
|
+
cooldownMs?: number;
|
|
5
|
+
now?: () => number;
|
|
6
|
+
onCorrective?: (sessionID: string, backoff: number) => void;
|
|
7
|
+
}
|
|
8
|
+
type EventInput = {
|
|
9
|
+
event: {
|
|
10
|
+
type: string;
|
|
11
|
+
properties?: unknown;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type NudgeLoopBreakerHook = {
|
|
15
|
+
event: (input: EventInput) => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
export declare function createNudgeLoopBreakerHook(ctx: PluginContext, options?: NudgeLoopBreakerOptions): NudgeLoopBreakerHook;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createNudgeLoopBreakerHook } from "./hook";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface NudgeLoopState {
|
|
2
|
+
count: number;
|
|
3
|
+
lastHash: string | null;
|
|
4
|
+
lastAt: number;
|
|
5
|
+
lastEmitAt: number;
|
|
6
|
+
correctiveSent: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function createNudgeLoopState(): NudgeLoopState;
|
|
9
|
+
export declare function computeBackoffDelay(count: number, threshold?: number): number;
|
|
10
|
+
export declare function hashText(text: string): string;
|
|
11
|
+
export declare function normalizeNudgeText(text: string): string;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
export declare const HOOK_NAME = "task-continuation-enforcer";
|
|
2
2
|
export declare const DEFAULT_SKIP_AGENTS: string[];
|
|
3
|
-
export declare const EXPLORER_AGENTS: string[];
|
|
4
|
-
export declare function hasNonExplorerBgTasks(tasks: Array<{
|
|
5
|
-
agent?: string;
|
|
6
|
-
}>): boolean;
|
|
7
3
|
export declare const CONTINUATION_PROMPT: string;
|
|
8
|
-
export declare const BOOTSTRAP_PROMPT: string;
|
|
9
4
|
export declare const COUNTDOWN_SECONDS = 2;
|
|
10
5
|
export declare const TOAST_DURATION_MS = 900;
|
|
11
6
|
export declare const COUNTDOWN_GRACE_PERIOD_MS = 500;
|