@noppu-labs/opencode-permission-reviewer 3.2.0 → 3.2.1
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/CHANGELOG.md +8 -0
- package/NOTICE +2 -2
- package/dist/explain.js +2723 -2723
- package/dist/index.d.ts +638 -538
- package/dist/index.js +9745 -9730
- package/dist/rpc.d.ts +1 -1
- package/dist/rpc.js +1 -1
- package/dist/tui/{opencode → adapters/opencode}/event-normalizer.ts +2 -2
- package/dist/tui/{config-fields.ts → modules/config/models/config-fields.ts} +2 -2
- package/dist/tui/{config-knobs.ts → modules/config/models/config-knobs.ts} +1 -1
- package/dist/tui/{config-policy-rules.ts → modules/config/models/config-policy-rules.ts} +2 -2
- package/dist/tui/{config-risk-policy.ts → modules/config/models/config-risk-policy.ts} +2 -1
- package/dist/tui/{config.ts → modules/config/services/config.ts} +5 -5
- package/dist/tui/{config → modules/config/services}/layer-read.ts +4 -3
- package/dist/tui/{config → modules/config/services}/loader.ts +3 -3
- package/dist/tui/{reviewer-model.ts → modules/config/services/reviewer-model.ts} +6 -3
- package/dist/tui/{config → modules/config/services}/risk-policy-clamp.ts +2 -2
- package/dist/tui/{system-one-routing.ts → modules/config/services/system-one-routing.ts} +1 -1
- package/dist/tui/{config → modules/config/services}/trust-boundary.ts +4 -4
- package/dist/tui/{config → modules/config/services}/trusted-degradation.ts +2 -2
- package/dist/tui/{config-rule-condition.ts → modules/policy/config-rule-condition.ts} +1 -1
- package/dist/tui/{ui-protocol.ts → modules/status/models/ui-protocol.ts} +9 -9
- package/dist/tui/{ui-state.ts → modules/status/services/ui-state.ts} +2 -2
- package/dist/tui/{ui-status-extras.ts → modules/status/services/ui-status-extras.ts} +4 -2
- package/dist/tui/{ui-status-parse.ts → modules/status/services/ui-status-parse.ts} +5 -5
- package/dist/tui/tui.tsx +5 -5
- package/dist/tui/ui/action-fit.ts +10 -2
- package/dist/tui/ui/attribution.ts +4 -3
- package/dist/tui/ui/components.tsx +1 -1
- package/dist/tui/ui/config-notices.ts +1 -1
- package/dist/tui/ui/fit-parts.ts +1 -1
- package/dist/tui/ui/manual-toast.ts +3 -3
- package/dist/tui/ui/review-feed.ts +3 -3
- package/dist/tui/ui/review-overlay.tsx +1 -1
- package/dist/tui/ui/review-result.tsx +1 -1
- package/dist/tui/ui/review-store.ts +3 -3
- package/dist/tui/ui/review-theme.ts +1 -1
- package/dist/tui/ui/v1-host.ts +5 -2
- package/dist/tui/ui/v2.tsx +1 -1
- package/package.json +3 -3
- package/dist/tui/types.ts +0 -357
- /package/dist/tui/{config → modules/config/services}/jsonc.ts +0 -0
- /package/dist/tui/{config → modules/config/services}/trust-boundary-keys.ts +0 -0
- /package/dist/tui/{failure-kind.ts → modules/status/models/failure-kind.ts} +0 -0
- /package/dist/tui/{ui → modules/status/models}/rpc.ts +0 -0
- /package/dist/tui/{ui-text-elide.ts → modules/status/services/ui-text-elide.ts} +0 -0
- /package/dist/tui/{descriptor-io.ts → utils/descriptor-io.ts} +0 -0
- /package/dist/tui/{is-record.ts → utils/is-record.ts} +0 -0
package/dist/rpc.d.ts
CHANGED
package/dist/rpc.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import type { PermissionRequest } from "../../kernel/permission-request.ts";
|
|
2
|
+
import { asObjectLike } from "../../utils/is-record.ts";
|
|
3
3
|
|
|
4
4
|
type UnknownRecord = Record<string, unknown>;
|
|
5
5
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ACTOR_PROFILES } from "./config-rule-condition.ts";
|
|
2
1
|
import type {
|
|
3
2
|
ActorProfile,
|
|
4
3
|
EscalationMode,
|
|
5
4
|
RepositoryTrust,
|
|
6
5
|
ReviewerConfig,
|
|
7
|
-
} from "
|
|
6
|
+
} from "../../../kernel/reviewer-config.ts";
|
|
7
|
+
import { ACTOR_PROFILES } from "../../policy/config-rule-condition.ts";
|
|
8
8
|
|
|
9
9
|
/** Parse a trusted name→profile mapping. Invalid entries are dropped. */
|
|
10
10
|
export function resolveActorProfiles(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import type { PolicyRule } from "../../../kernel/reviewer-config.ts";
|
|
2
|
+
import { validateCondition } from "../../policy/config-rule-condition.ts";
|
|
3
3
|
|
|
4
4
|
const VALID_EFFECTS: ReadonlySet<string> = new Set([
|
|
5
5
|
"review",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UserAuthorization } from "../../../kernel/review-decision.ts";
|
|
2
|
+
import type { RiskPolicy } from "../../../kernel/reviewer-config.ts";
|
|
2
3
|
|
|
3
4
|
/** Default risk×authorization matrix. `critical` stays empty: critical risk
|
|
4
5
|
* never auto-allows. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReviewerConfig } from "../../../kernel/reviewer-config.ts";
|
|
1
2
|
import {
|
|
2
3
|
isStringArray,
|
|
3
4
|
nonEmptyStringOr,
|
|
@@ -7,7 +8,7 @@ import {
|
|
|
7
8
|
resolveRepositoryTrust,
|
|
8
9
|
systemOneRoutingFields,
|
|
9
10
|
trimmedText,
|
|
10
|
-
} from "
|
|
11
|
+
} from "../models/config-fields.ts";
|
|
11
12
|
import {
|
|
12
13
|
CONFIDENCE_FLOORS,
|
|
13
14
|
CONTEXT_BUDGETS,
|
|
@@ -16,18 +17,17 @@ import {
|
|
|
16
17
|
numberKnobs,
|
|
17
18
|
REVIEW_TIMEOUT,
|
|
18
19
|
reviewBudgetKnob,
|
|
19
|
-
} from "
|
|
20
|
-
import { resolvePolicyRules } from "
|
|
20
|
+
} from "../models/config-knobs.ts";
|
|
21
|
+
import { resolvePolicyRules } from "../models/config-policy-rules.ts";
|
|
21
22
|
import {
|
|
22
23
|
DEFAULT_RISK_POLICY,
|
|
23
24
|
resolveRiskPolicy,
|
|
24
|
-
} from "
|
|
25
|
+
} from "../models/config-risk-policy.ts";
|
|
25
26
|
import {
|
|
26
27
|
isProviderModelId,
|
|
27
28
|
resolveEscalationReviewer,
|
|
28
29
|
} from "./reviewer-model.ts";
|
|
29
30
|
import { withSystemOneRoutingWarnings } from "./system-one-routing.ts";
|
|
30
|
-
import type { ReviewerConfig } from "./types.ts";
|
|
31
31
|
|
|
32
32
|
export const DEFAULT_CONFIG: ReviewerConfig = {
|
|
33
33
|
model: "openai/gpt-6-luna",
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
O_NONBLOCK,
|
|
6
6
|
O_RDONLY,
|
|
7
7
|
readFully,
|
|
8
|
-
} from "
|
|
8
|
+
} from "../../../utils/descriptor-io.ts";
|
|
9
9
|
import { parseJsoncStrict } from "./jsonc.ts";
|
|
10
10
|
|
|
11
11
|
/** Cap on a single config file read: the project layer is repository-controlled
|
|
@@ -87,8 +87,9 @@ function openLayer(path: string): number | ConfigLayer {
|
|
|
87
87
|
try {
|
|
88
88
|
// Read-only descriptor open of an existing config path; no file is
|
|
89
89
|
// created here and the descriptor must pass the regular-file check below.
|
|
90
|
-
//
|
|
91
|
-
|
|
90
|
+
// The mode only applies with O_CREAT; it marks the open as owner-only for
|
|
91
|
+
// static analysis.
|
|
92
|
+
return openSync(path, O_RDONLY | O_NONBLOCK | O_NOFOLLOW, 0o600);
|
|
92
93
|
} catch (error) {
|
|
93
94
|
if ((error as { code?: unknown }).code === "ENOENT")
|
|
94
95
|
return { raw: {}, status: "missing" };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { homedir } from "node:os";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
import { countInvalidPolicyRules } from "../config-policy-rules.ts";
|
|
5
|
-
import
|
|
3
|
+
import type { ReviewerConfig } from "../../../kernel/reviewer-config.ts";
|
|
4
|
+
import { countInvalidPolicyRules } from "../models/config-policy-rules.ts";
|
|
5
|
+
import { DEFAULT_CONFIG, resolveConfig } from "./config.ts";
|
|
6
6
|
import { type ConfigLayer, readConfigLayer } from "./layer-read.ts";
|
|
7
7
|
import type { InlineOptionsTrust } from "./sources.ts";
|
|
8
8
|
import { mergeWithTrustBoundary } from "./trust-boundary.ts";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type {
|
|
2
|
+
EscalationReviewerConfig,
|
|
3
|
+
ReviewerConfig,
|
|
4
|
+
} from "../../../kernel/reviewer-config.ts";
|
|
5
|
+
import { nonEmptyStringOr } from "../models/config-fields.ts";
|
|
6
|
+
import { boundedInteger } from "../models/config-knobs.ts";
|
|
4
7
|
|
|
5
8
|
export function splitModel(model: string): {
|
|
6
9
|
providerID: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { asObjectLike } from "../../../utils/is-record.ts";
|
|
2
|
+
import { DEFAULT_RISK_POLICY } from "../models/config-risk-policy.ts";
|
|
3
3
|
|
|
4
4
|
type FailureKnob = "onInvalidDecision" | "onReviewerFailure";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { ReviewerConfig } from "../../../kernel/reviewer-config.ts";
|
|
1
2
|
import { isSystemOneReviewerModel } from "./reviewer-model.ts";
|
|
2
|
-
import type { ReviewerConfig } from "./types.ts";
|
|
3
3
|
|
|
4
4
|
/** The least review time a hand-off needs; with less the request escalates. */
|
|
5
5
|
export const HANDOFF_BUDGET_FLOOR_MS = 15_000;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import type { PolicyRule } from "../../../kernel/reviewer-config.ts";
|
|
2
|
+
import { isRecord } from "../../../utils/is-record.ts";
|
|
3
|
+
import { DEFAULT_RISK_POLICY } from "../models/config-risk-policy.ts";
|
|
4
|
+
import { DEFAULT_CONFIG } from "./config.ts";
|
|
5
5
|
import { clampRiskPolicy } from "./risk-policy-clamp.ts";
|
|
6
6
|
import {
|
|
7
7
|
CONFIDENCE_FLOOR_KEYS,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { countInvalidPolicyRules } from "../config-policy-rules.ts";
|
|
2
|
-
import { isValidEscalationReviewer } from "../reviewer-model.ts";
|
|
1
|
+
import { countInvalidPolicyRules } from "../models/config-policy-rules.ts";
|
|
3
2
|
import type { ConfigLayer } from "./layer-read.ts";
|
|
3
|
+
import { isValidEscalationReviewer } from "./reviewer-model.ts";
|
|
4
4
|
import type { InlineOptionsTrust } from "./sources.ts";
|
|
5
5
|
|
|
6
6
|
/** Trusted mode fields and the values resolveConfig honors. A mistyped mode
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PermissionRequest } from "../../../kernel/permission-request.ts";
|
|
2
|
+
import type { ReviewDecision } from "../../../kernel/review-decision.ts";
|
|
3
|
+
import type { HandoffInfo } from "../../../kernel/review-handoff.ts";
|
|
2
4
|
import type {
|
|
3
|
-
ActorProfile,
|
|
4
5
|
EscalationDisposition,
|
|
5
6
|
ManualResolution,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "./types.ts";
|
|
7
|
+
} from "../../../kernel/review-result.ts";
|
|
8
|
+
import type { ActorProfile } from "../../../kernel/reviewer-config.ts";
|
|
9
9
|
import {
|
|
10
10
|
boundedText,
|
|
11
11
|
fitStatus,
|
|
12
12
|
type StatusExtrasOptions,
|
|
13
13
|
statusExtras,
|
|
14
|
-
} from "
|
|
15
|
-
import { parseUiStatus } from "
|
|
16
|
-
import { boundedHeadTail } from "
|
|
14
|
+
} from "../services/ui-status-extras.ts";
|
|
15
|
+
import { parseUiStatus } from "../services/ui-status-parse.ts";
|
|
16
|
+
import { boundedHeadTail } from "../services/ui-text-elide.ts";
|
|
17
17
|
|
|
18
18
|
export const UI_COMMAND_PREFIX = "opencode-permission-reviewer.status.";
|
|
19
19
|
// Time to wait for the server's first "reviewing" ack after permission.asked.
|
|
@@ -30,7 +30,7 @@ export type ReviewUiPhase =
|
|
|
30
30
|
| "unknown";
|
|
31
31
|
|
|
32
32
|
/** One command of a shell action as the server split it, for the TUI to fit
|
|
33
|
-
* to its width. Built by `src/ui-action-segments.ts`. */
|
|
33
|
+
* to its width. Built by `src/modules/status/services/ui-action-segments.ts`. */
|
|
34
34
|
export interface ActionSegment {
|
|
35
35
|
/** The segment as typed in the command, heredoc bodies left out,
|
|
36
36
|
* whitespace collapsed, at most 200 code points. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { PermissionRequest } from "
|
|
1
|
+
import type { PermissionRequest } from "../../../kernel/permission-request.ts";
|
|
2
2
|
import {
|
|
3
3
|
createUiStatus,
|
|
4
4
|
type ReviewUiStatus,
|
|
5
5
|
UI_START_GRACE_MS,
|
|
6
6
|
UI_WATCHDOG_GRACE_MS,
|
|
7
|
-
} from "
|
|
7
|
+
} from "../models/ui-protocol.ts";
|
|
8
8
|
|
|
9
9
|
export interface UiStateOptions {
|
|
10
10
|
model: string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Bounds the routing and config fields, then fits the whole status to the TUI
|
|
2
2
|
// command cap. Oversized identifiers are not cut, so they can still overflow it.
|
|
3
|
-
|
|
4
|
-
import type {
|
|
3
|
+
|
|
4
|
+
import type { ReviewDecision } from "../../../kernel/review-decision.ts";
|
|
5
|
+
import type { HandoffInfo } from "../../../kernel/review-handoff.ts";
|
|
6
|
+
import type { ManualResolution } from "../../../kernel/review-result.ts";
|
|
5
7
|
|
|
6
8
|
const MAX_LIST_ENTRIES = 5;
|
|
7
9
|
const MAX_ENTRY_CHARS = 200;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { HandoffInfo } from "
|
|
1
|
+
import type { ReviewDecision } from "../../../kernel/review-decision.ts";
|
|
2
|
+
import type { HandoffInfo } from "../../../kernel/review-handoff.ts";
|
|
3
3
|
import type {
|
|
4
4
|
HandoffTrigger,
|
|
5
5
|
ManualResolution,
|
|
6
|
-
|
|
7
|
-
} from "
|
|
8
|
-
import type { ActionSegment, ReviewUiStatus } from "
|
|
6
|
+
} from "../../../kernel/review-result.ts";
|
|
7
|
+
import { isRecord } from "../../../utils/is-record.ts";
|
|
8
|
+
import type { ActionSegment, ReviewUiStatus } from "../models/ui-protocol.ts";
|
|
9
9
|
|
|
10
10
|
// Structural checks for a decoded UI status payload. A payload passes only
|
|
11
11
|
// when every field holds a value the protocol defines; it is then returned
|
package/dist/tui/tui.tsx
CHANGED
|
@@ -3,19 +3,19 @@ import type { PluginOptions } from "@opencode-ai/plugin";
|
|
|
3
3
|
import type { TuiPlugin, TuiPluginApi } from "@opencode-ai/plugin/tui";
|
|
4
4
|
import type { JSX } from "solid-js";
|
|
5
5
|
import { createSignal, Show } from "solid-js";
|
|
6
|
-
import { loadResolvedConfig } from "./config/loader.ts";
|
|
7
|
-
import { reviewBudgetMs } from "./config.ts";
|
|
8
6
|
// Import the normalizer directly: `./index.ts` re-exports it, but importing that
|
|
9
7
|
// would evaluate the whole server engine (git/ssh evidence, `node:child_process`)
|
|
10
8
|
// inside the TUI process.
|
|
11
|
-
import { extractPermissionRequest } from "./opencode/event-normalizer.ts";
|
|
9
|
+
import { extractPermissionRequest } from "./adapters/opencode/event-normalizer.ts";
|
|
10
|
+
import { reviewBudgetMs } from "./modules/config/services/config.ts";
|
|
11
|
+
import { loadResolvedConfig } from "./modules/config/services/loader.ts";
|
|
12
|
+
import type { ReviewUiStatus } from "./modules/status/models/ui-protocol.ts";
|
|
13
|
+
import { ReviewUiState } from "./modules/status/services/ui-state.ts";
|
|
12
14
|
import { ConfigNoticeSlot, SPINNER } from "./ui/components.tsx";
|
|
13
15
|
import { ReviewOverlay } from "./ui/review-overlay.tsx";
|
|
14
16
|
import { ReviewResult } from "./ui/review-result.tsx";
|
|
15
17
|
import { activeStatus, createV1Host } from "./ui/v1-host.ts";
|
|
16
18
|
import { setupTuiV2 } from "./ui/v2.tsx";
|
|
17
|
-
import type { ReviewUiStatus } from "./ui-protocol.ts";
|
|
18
|
-
import { ReviewUiState } from "./ui-state.ts";
|
|
19
19
|
|
|
20
20
|
const REVIEW_MODE = "permission-reviewer";
|
|
21
21
|
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
// Ships to the TUI, so it imports no shell module.
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
|
|
3
|
+
import type {
|
|
4
|
+
ActionSegment,
|
|
5
|
+
ReviewUiStatus,
|
|
6
|
+
} from "../modules/status/models/ui-protocol.ts";
|
|
7
|
+
import {
|
|
8
|
+
ELISION,
|
|
9
|
+
elideMiddle,
|
|
10
|
+
keepHead,
|
|
11
|
+
keepTail,
|
|
12
|
+
} from "../modules/status/services/ui-text-elide.ts";
|
|
5
13
|
import {
|
|
6
14
|
type FitPart,
|
|
7
15
|
merged,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Who decided, and why the reasoning reviewer ran, as the TUI shows it.
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
2
|
+
|
|
3
|
+
import type { HandoffInfo } from "../kernel/review-handoff.ts";
|
|
4
|
+
import type { HandoffTrigger } from "../kernel/review-result.ts";
|
|
5
|
+
import type { ReviewUiStatus } from "../modules/status/models/ui-protocol.ts";
|
|
5
6
|
|
|
6
7
|
type PhraseSource = Pick<
|
|
7
8
|
ReviewUiStatus,
|
|
@@ -4,7 +4,7 @@ import type { ColorInput } from "@opentui/core";
|
|
|
4
4
|
import { useTerminalDimensions } from "@opentui/solid";
|
|
5
5
|
import type { JSX } from "solid-js";
|
|
6
6
|
import { Show } from "solid-js";
|
|
7
|
-
import type { ReviewUiStatus } from "../ui-protocol.ts";
|
|
7
|
+
import type { ReviewUiStatus } from "../modules/status/models/ui-protocol.ts";
|
|
8
8
|
import { type ActionFitPart, fitAction, singleLine } from "./action-fit.ts";
|
|
9
9
|
import { ActionSpans, stripActionColumns } from "./action-spans.tsx";
|
|
10
10
|
import { reviewerLabel } from "./attribution.ts";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The server's config warnings in the TUI: one toast per distinct entry per
|
|
2
2
|
// TUI session, and a one-line sidebar summary while any remain. The same
|
|
3
3
|
// `status` read also names the server's reasoning reviewer.
|
|
4
|
-
import { asObjectLike } from "../is-record.ts";
|
|
4
|
+
import { asObjectLike } from "../utils/is-record.ts";
|
|
5
5
|
|
|
6
6
|
interface NoticeLists {
|
|
7
7
|
configWarnings?: readonly string[] | undefined;
|
package/dist/tui/ui/fit-parts.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Measuring, slicing and merging fitted action parts.
|
|
2
2
|
|
|
3
|
-
import { LINE_BREAK } from "../ui-text-elide.ts";
|
|
3
|
+
import { LINE_BREAK } from "../modules/status/services/ui-text-elide.ts";
|
|
4
4
|
import type { ActionFitPart } from "./action-fit.ts";
|
|
5
5
|
|
|
6
6
|
/** A part as the fit builds it; `whole` marks one a cut may not split. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The toast a manual outcome raises: title, variant and lead sentence follow
|
|
2
2
|
// how the review ended, then the reason.
|
|
3
|
-
import { failureKind } from "../failure-kind.ts";
|
|
4
|
-
import type { ReviewUiStatus } from "../ui-protocol.ts";
|
|
3
|
+
import { failureKind } from "../modules/status/models/failure-kind.ts";
|
|
4
|
+
import type { ReviewUiStatus } from "../modules/status/models/ui-protocol.ts";
|
|
5
5
|
import { handoffCause, modelLabel, shortModelName } from "./attribution.ts";
|
|
6
6
|
|
|
7
7
|
export interface ManualToast {
|
|
@@ -12,7 +12,7 @@ export interface ManualToast {
|
|
|
12
12
|
|
|
13
13
|
const NO_TIME_LEAD = "No review time left for";
|
|
14
14
|
const GENERIC_REVIEWER = "the reasoning reviewer";
|
|
15
|
-
/** `budgetExhaustedResult`'s reason (`src/
|
|
15
|
+
/** `budgetExhaustedResult`'s reason (`src/modules/reviewer/services/system-one-budget.ts`):
|
|
16
16
|
* "<lead> after <cause>: <budget sentence> <Jev reason>". */
|
|
17
17
|
const BUDGET_REASON =
|
|
18
18
|
/^No review time left for the reasoning reviewer after (.+?): ([\s\S]*)$/;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Plugin } from "@opencode/plugin/tui";
|
|
2
|
-
import {
|
|
3
|
-
import type { ReviewUiState } from "../ui-state.ts";
|
|
2
|
+
import { ReviewerRpc } from "../modules/status/models/rpc.ts";
|
|
3
|
+
import type { ReviewUiState } from "../modules/status/services/ui-state.ts";
|
|
4
|
+
import { asObjectLike } from "../utils/is-record.ts";
|
|
4
5
|
import { ConfigNotices } from "./config-notices.ts";
|
|
5
6
|
import { manualToast } from "./manual-toast.ts";
|
|
6
7
|
import { type Connection, receive, release } from "./review-connection.ts";
|
|
7
8
|
import { isSnapshot, ReviewStore } from "./review-store.ts";
|
|
8
|
-
import { ReviewerRpc } from "./rpc.ts";
|
|
9
9
|
|
|
10
10
|
type Context = Parameters<Plugin.Definition["setup"]>[0];
|
|
11
11
|
|
|
@@ -4,7 +4,7 @@ import type { MouseEvent } from "@opentui/core";
|
|
|
4
4
|
import { useTerminalDimensions } from "@opentui/solid";
|
|
5
5
|
import type { JSX } from "solid-js";
|
|
6
6
|
import { Show } from "solid-js";
|
|
7
|
-
import type { ReviewUiStatus } from "../ui-protocol.ts";
|
|
7
|
+
import type { ReviewUiStatus } from "../modules/status/models/ui-protocol.ts";
|
|
8
8
|
import { type ActionFitPart, fitAction } from "./action-fit.ts";
|
|
9
9
|
import { ActionSpans, overlayActionColumns } from "./action-spans.tsx";
|
|
10
10
|
import { handoffPhrase, modelLabel } from "./attribution.ts";
|
|
@@ -4,7 +4,7 @@ import type { ColorInput } from "@opentui/core";
|
|
|
4
4
|
import { useTerminalDimensions } from "@opentui/solid";
|
|
5
5
|
import type { JSX } from "solid-js";
|
|
6
6
|
import { Show } from "solid-js";
|
|
7
|
-
import type { ReviewUiStatus } from "../ui-protocol.ts";
|
|
7
|
+
import type { ReviewUiStatus } from "../modules/status/models/ui-protocol.ts";
|
|
8
8
|
import { type ActionFitPart, fitAction, singleLine } from "./action-fit.ts";
|
|
9
9
|
import { ActionSpans, stripActionColumns } from "./action-spans.tsx";
|
|
10
10
|
import { resultDetail } from "./attribution.ts";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { asObjectLike } from "../is-record.ts";
|
|
2
1
|
import {
|
|
3
2
|
decodeUiStatus,
|
|
4
3
|
encodeUiStatus,
|
|
5
4
|
type ReviewUiStatus,
|
|
6
|
-
} from "../ui-protocol.ts";
|
|
7
|
-
import { ReviewUiState } from "../ui-state.ts";
|
|
5
|
+
} from "../modules/status/models/ui-protocol.ts";
|
|
6
|
+
import { ReviewUiState } from "../modules/status/services/ui-state.ts";
|
|
7
|
+
import { asObjectLike } from "../utils/is-record.ts";
|
|
8
8
|
|
|
9
9
|
interface ReviewSnapshot extends Record<string, unknown> {
|
|
10
10
|
generation: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ColorInput } from "@opentui/core";
|
|
2
|
-
import { asObjectLike } from "../is-record.ts";
|
|
2
|
+
import { asObjectLike } from "../utils/is-record.ts";
|
|
3
3
|
import type { ReviewTheme } from "./components.tsx";
|
|
4
4
|
|
|
5
5
|
const color = (value: unknown): ColorInput | undefined => {
|
package/dist/tui/ui/v1-host.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { TuiPluginApi } from "@opencode-ai/plugin/tui";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
decodeUiStatus,
|
|
4
|
+
type ReviewUiStatus,
|
|
5
|
+
} from "../modules/status/models/ui-protocol.ts";
|
|
6
|
+
import type { ReviewUiState } from "../modules/status/services/ui-state.ts";
|
|
4
7
|
import { ConfigNotices, type SidebarLine } from "./config-notices.ts";
|
|
5
8
|
import { manualToast } from "./manual-toast.ts";
|
|
6
9
|
|
package/dist/tui/ui/v2.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @jsxImportSource @opentui/solid */
|
|
2
2
|
import type { Plugin } from "@opencode/plugin/tui";
|
|
3
3
|
import { createSignal, Show } from "solid-js";
|
|
4
|
-
import type { ReviewUiStatus } from "../ui-protocol.ts";
|
|
4
|
+
import type { ReviewUiStatus } from "../modules/status/models/ui-protocol.ts";
|
|
5
5
|
import {
|
|
6
6
|
ConfigNoticeSlot,
|
|
7
7
|
ReviewProgress,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noppu-labs/opencode-permission-reviewer",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "Policy-aware permission reviewer for OpenCode V1 and V2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@biomejs/biome": "2.5.15",
|
|
92
|
-
"@opencode-ai/plugin": "1.19.
|
|
93
|
-
"@opencode-ai/sdk": "1.19.
|
|
92
|
+
"@opencode-ai/plugin": "1.19.4",
|
|
93
|
+
"@opencode-ai/sdk": "1.19.4",
|
|
94
94
|
"@opencode/plugin": "2.1.2",
|
|
95
95
|
"@types/bun": "^1.3.0",
|
|
96
96
|
"@types/semver": "7.8.0",
|