@jmanuelcorral/openteam 0.1.41 → 0.2.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/.opencode/openteam.example.json +6 -1
- package/README.es.md +1 -1
- package/README.md +1 -1
- package/dist/capabilities/types.d.ts +4 -4
- package/dist/classifier/types.d.ts +3 -3
- package/dist/cli.js +430 -36
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/graph.d.ts +36 -2
- package/dist/commands/graph.d.ts.map +1 -1
- package/dist/config/graphFeatureGate.d.ts +96 -0
- package/dist/config/graphFeatureGate.d.ts.map +1 -0
- package/dist/config/migrations.d.ts.map +1 -1
- package/dist/config/resolve.d.ts +20 -1
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/schema.d.ts +40 -19
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/console/assets.d.ts +9 -1
- package/dist/console/assets.d.ts.map +1 -1
- package/dist/console/opencodeClient.d.ts +6 -0
- package/dist/console/opencodeClient.d.ts.map +1 -1
- package/dist/console/protocol.d.ts +8 -0
- package/dist/console/protocol.d.ts.map +1 -1
- package/dist/console/render.d.ts +25 -0
- package/dist/console/render.d.ts.map +1 -1
- package/dist/context/redaction.d.ts +23 -0
- package/dist/context/redaction.d.ts.map +1 -1
- package/dist/context/schema.d.ts +3 -3
- package/dist/contract/opencode.d.ts +2 -2
- package/dist/contract/opencode.d.ts.map +1 -1
- package/dist/graph/certificate.d.ts +505 -0
- package/dist/graph/certificate.d.ts.map +1 -0
- package/dist/graph/ids.d.ts +9 -0
- package/dist/graph/ids.d.ts.map +1 -1
- package/dist/graph/privacyPolicy.d.ts.map +1 -1
- package/dist/graph/reducer.d.ts.map +1 -1
- package/dist/graph/replay.d.ts.map +1 -1
- package/dist/graph/reviewerPolicy.d.ts.map +1 -1
- package/dist/graph/schema.d.ts +33 -33
- package/dist/graph/schema.d.ts.map +1 -1
- package/dist/graph/soakLedger.d.ts +144 -0
- package/dist/graph/soakLedger.d.ts.map +1 -0
- package/dist/graph/types.d.ts +2 -0
- package/dist/graph/types.d.ts.map +1 -1
- package/dist/graph/validate.d.ts.map +1 -1
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2351 -180
- package/dist/local/registry.d.ts.map +1 -1
- package/dist/memory/types.d.ts +2 -2
- package/dist/orchestrator/graphFacade.d.ts +39 -0
- package/dist/orchestrator/graphFacade.d.ts.map +1 -0
- package/dist/orchestrator/graphIngress.d.ts +136 -0
- package/dist/orchestrator/graphIngress.d.ts.map +1 -0
- package/dist/orchestrator/graphShadow.d.ts +121 -0
- package/dist/orchestrator/graphShadow.d.ts.map +1 -0
- package/dist/orchestrator/ledger.d.ts +14 -2
- package/dist/orchestrator/ledger.d.ts.map +1 -1
- package/dist/orchestrator/opencodeSessionAdapter.d.ts.map +1 -1
- package/dist/orchestrator/roles.d.ts +3 -3
- package/dist/orchestrator/sdd.d.ts +55 -1
- package/dist/orchestrator/sdd.d.ts.map +1 -1
- package/dist/orchestrator/sddCompiler.d.ts +6 -2
- package/dist/orchestrator/sddCompiler.d.ts.map +1 -1
- package/dist/orchestrator/worktreeAdapter.d.ts +39 -0
- package/dist/orchestrator/worktreeAdapter.d.ts.map +1 -0
- package/dist/orchestrator/worktreeDispatch.d.ts +84 -0
- package/dist/orchestrator/worktreeDispatch.d.ts.map +1 -0
- package/dist/orchestrator/worktreeReconciler.d.ts +74 -0
- package/dist/orchestrator/worktreeReconciler.d.ts.map +1 -0
- package/dist/plugin/graphShadowIngress.d.ts +165 -0
- package/dist/plugin/graphShadowIngress.d.ts.map +1 -0
- package/dist/plugin/graphTool.d.ts +63 -0
- package/dist/plugin/graphTool.d.ts.map +1 -0
- package/dist/plugin/hooks.d.ts +6 -0
- package/dist/plugin/hooks.d.ts.map +1 -1
- package/dist/plugin/legacyRunProducer.d.ts +60 -0
- package/dist/plugin/legacyRunProducer.d.ts.map +1 -0
- package/dist/plugin/reportRunSchema.d.ts +60 -0
- package/dist/plugin/reportRunSchema.d.ts.map +1 -0
- package/dist/plugin/sessionTracker.d.ts +42 -0
- package/dist/plugin/sessionTracker.d.ts.map +1 -0
- package/dist/plugin/shadowPipeline.d.ts +49 -0
- package/dist/plugin/shadowPipeline.d.ts.map +1 -0
- package/dist/plugin/soakObserver.d.ts +73 -0
- package/dist/plugin/soakObserver.d.ts.map +1 -0
- package/dist/storage/graph/codec.d.ts.map +1 -1
- package/dist/storage/graph/migrateLegacyBriefs.d.ts.map +1 -1
- package/dist/storage/graph/migration.d.ts +91 -0
- package/dist/storage/graph/migration.d.ts.map +1 -0
- package/dist/storage/graph/provider.d.ts +1 -0
- package/dist/storage/graph/provider.d.ts.map +1 -1
- package/dist/storage/graph/recovery.d.ts.map +1 -1
- package/dist/storage/graph/runRegistry.d.ts.map +1 -1
- package/dist/storage/graph/soakRecorder.d.ts +59 -0
- package/dist/storage/graph/soakRecorder.d.ts.map +1 -0
- package/dist/storage/graph/workspaceLease.d.ts.map +1 -1
- package/dist/storage/graph/worktreeRegistry.d.ts +29 -0
- package/dist/storage/graph/worktreeRegistry.d.ts.map +1 -0
- package/dist/storage/graph/writer.d.ts +15 -0
- package/dist/storage/graph/writer.d.ts.map +1 -1
- package/dist/storage/path.d.ts.map +1 -1
- package/dist/telemetry/events.d.ts +12 -12
- package/dist/telemetry/graphRuntimeHealth.d.ts +53 -0
- package/dist/telemetry/graphRuntimeHealth.d.ts.map +1 -0
- package/dist/telemetry/graphView.d.ts +76 -0
- package/dist/telemetry/graphView.d.ts.map +1 -0
- package/dist/telemetry/types.d.ts +4 -4
- package/dist/web/console.d.ts +6 -0
- package/dist/web/console.d.ts.map +1 -1
- package/dist/web/graphRoute.d.ts +36 -0
- package/dist/web/graphRoute.d.ts.map +1 -0
- package/dist/web/server.d.ts +21 -2
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/start.d.ts +11 -0
- package/dist/web/start.d.ts.map +1 -1
- package/package.json +7 -5
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { OpenTeamConfig } from "../config/schema";
|
|
2
2
|
import type { LocalRuntimeSnapshot } from "../local/types";
|
|
3
|
+
import type { GraphViewHealth } from "../telemetry/graphView";
|
|
3
4
|
export type DoctorInput = {
|
|
4
5
|
config: OpenTeamConfig;
|
|
5
6
|
snapshots: readonly LocalRuntimeSnapshot[];
|
|
6
7
|
telemetryPath: string;
|
|
7
8
|
telemetryRecords: number;
|
|
9
|
+
graphHealth?: GraphViewHealth;
|
|
8
10
|
};
|
|
9
11
|
export declare function renderDoctor(input: DoctorInput): string;
|
|
10
12
|
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B,CAAC;AAWF,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAgDvD"}
|
package/dist/commands/graph.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { ConfigSource } from "../config/resolve";
|
|
2
2
|
import type { GraphMode } from "../config/schema";
|
|
3
|
+
import type { GraphJournalHealth } from "../graph/types";
|
|
4
|
+
import type { WorktreeReconcileReport } from "../orchestrator/worktreeReconciler";
|
|
5
|
+
import type { LegacyImportRecordV1 } from "../storage/graph/importLegacy";
|
|
6
|
+
import type { MigrationBackup, MigrationPlan } from "../storage/graph/migration";
|
|
3
7
|
import type { LeaseRecord } from "../storage/graph/workspaceLease";
|
|
4
8
|
/**
|
|
5
9
|
* GE-045 — operator commands for the graph runtime as pure dry-run plans.
|
|
@@ -16,8 +20,6 @@ import type { LeaseRecord } from "../storage/graph/workspaceLease";
|
|
|
16
20
|
* - Cancelling a run held by another holder (a stale takeover) is blocked
|
|
17
21
|
* unless the operator explicitly forces it.
|
|
18
22
|
*/
|
|
19
|
-
/** Health of the on-disk journal tail as classified by recovery. */
|
|
20
|
-
export type GraphJournalHealth = "clean" | "recovered" | "corrupt";
|
|
21
23
|
/** Settled, side-effect-free view of the graph runtime for the operator. */
|
|
22
24
|
export type GraphHealthSnapshot = {
|
|
23
25
|
/** Where the effective graph config was resolved from. */
|
|
@@ -62,4 +64,36 @@ export declare function renderGraphStatus(snapshot: GraphHealthSnapshot): string
|
|
|
62
64
|
export declare function planGraphRecover(snapshot: GraphHealthSnapshot, options?: GraphRecoverOptions): GraphActionPlan;
|
|
63
65
|
/** Decide whether cancelling the active run is a safe, idempotent action. */
|
|
64
66
|
export declare function planGraphCancel(snapshot: GraphHealthSnapshot, options: GraphCancelOptions): GraphActionPlan;
|
|
67
|
+
/**
|
|
68
|
+
* Render the operator-facing view of a worktree reconciliation plan (GE-074).
|
|
69
|
+
* Pure: the caller supplies a settled report from `planWorktreeReconciliation`
|
|
70
|
+
* and this only formats it. A disabled report renders a single no-op line so
|
|
71
|
+
* the operator can see isolation is off without any worktree being touched.
|
|
72
|
+
*/
|
|
73
|
+
export declare function renderWorktreeReconciliation(report: WorktreeReconcileReport): string;
|
|
74
|
+
/** Action a migration command would take. */
|
|
75
|
+
export type MigrationActionKind = "none" | "dry-run" | "backup" | "apply" | "rollback" | "blocked";
|
|
76
|
+
/** Result of planning a migration command. */
|
|
77
|
+
export type MigrationActionPlan = {
|
|
78
|
+
readonly kind: MigrationActionKind;
|
|
79
|
+
readonly reason: string;
|
|
80
|
+
readonly safe: boolean;
|
|
81
|
+
/** Number of records the action would affect. */
|
|
82
|
+
readonly recordCount: number;
|
|
83
|
+
};
|
|
84
|
+
/** Plan a migration dry-run from a settled migration plan. */
|
|
85
|
+
export declare function planMigrationDryRun(plan: MigrationPlan): MigrationActionPlan;
|
|
86
|
+
/** Plan a backup creation from current authority. */
|
|
87
|
+
export declare function planMigrationBackup(authority: readonly LegacyImportRecordV1[]): MigrationActionPlan;
|
|
88
|
+
/** Options for planning a migration apply. */
|
|
89
|
+
export type MigrationApplyOptions = {
|
|
90
|
+
/** Operator explicitly acknowledges applying a migration. */
|
|
91
|
+
readonly acknowledge?: boolean;
|
|
92
|
+
};
|
|
93
|
+
/** Plan a migration apply from a settled migration plan. */
|
|
94
|
+
export declare function planMigrationApply(plan: MigrationPlan, options?: MigrationApplyOptions): MigrationActionPlan;
|
|
95
|
+
/** Plan a rollback from a validated backup. */
|
|
96
|
+
export declare function planMigrationRollback(backup: MigrationBackup, currentAuthority: readonly LegacyImportRecordV1[]): MigrationActionPlan;
|
|
97
|
+
/** Render a migration action plan for the operator. */
|
|
98
|
+
export declare function renderMigrationPlan(plan: MigrationActionPlan): string;
|
|
65
99
|
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/commands/graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,
|
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AmB,CACjC,SAAS,EAAE,SAAS,oBAAoB,EAAE,GACzC,mBAAmB,CAOrB;AAED,8CAA8C;AAC9C,MAAM,MAAM,qBAAqB,GAAG;IAClC,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,4DAA4D;AAC5D,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,aAAa,EACnB,OAAO,GAAE,qBAA0B,GAClC,mBAAmB,CA+BrB;AAED,+CAA+C;AAC/C,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,eAAe,EACvB,gBAAgB,EAAE,SAAS,oBAAoB,EAAE,GAChD,mBAAmB,CAsBrB;AAED,uDAAuD;AACvD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAUrE"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **Cutover gate** for Graph active mode (GE-057).
|
|
3
|
+
*
|
|
4
|
+
* Pure and deterministic — no I/O, clock, random, or env vars. The gate
|
|
5
|
+
* evaluates pre-parsed certificate statuses, migration state, and operator
|
|
6
|
+
* approval. All inputs are injected by the wiring layer (`index.ts`).
|
|
7
|
+
*
|
|
8
|
+
* Design decisions:
|
|
9
|
+
*
|
|
10
|
+
* 1. **Noisy degradation, not abort.** When the gate denies `active`, the
|
|
11
|
+
* effective mode degrades to `off` with explicit violations. This is
|
|
12
|
+
* preferable to aborting the entire plugin (disproportionate for an opt-in
|
|
13
|
+
* feature) and to silent degradation (the operator would believe they're in
|
|
14
|
+
* `active`). Every violation carries a distinct code and human-readable
|
|
15
|
+
* detail so the operator can distinguish "absent" from "invalid" from
|
|
16
|
+
* "stale" — diagnostics with different remedies.
|
|
17
|
+
*
|
|
18
|
+
* 2. **No raw certificate reads.** The gate never inspects certificate fields.
|
|
19
|
+
* It receives `CertificateStatus` values produced by the recomputing
|
|
20
|
+
* parsers (`parseShadowCertificate`, `parseReleaseCertificate`,
|
|
21
|
+
* `parseSoakCertificate`), which derive verdicts from evidence. A
|
|
22
|
+
* `status: "valid"` means the parser accepted it — verdict recomputed,
|
|
23
|
+
* digest verified, version pin matched.
|
|
24
|
+
*
|
|
25
|
+
* 3. **Operator approval is a declaration, not a proof.** The `operatorApproval`
|
|
26
|
+
* flag records that the operator has reviewed the certificates and completed
|
|
27
|
+
* migration. Nothing in the system can verify the operator actually read the
|
|
28
|
+
* certificates or performed migration locally. This is an organizational
|
|
29
|
+
* trust boundary, not a cryptographic guarantee. We say so explicitly rather
|
|
30
|
+
* than building a mechanism that *appears* to verify what it cannot.
|
|
31
|
+
*
|
|
32
|
+
* 4. **Absence is not zero — it's a distinct failure.** Missing, unreadable,
|
|
33
|
+
* expired, and invalid certificates are all distinguished so the operator
|
|
34
|
+
* gets the right remediation advice.
|
|
35
|
+
*/
|
|
36
|
+
/** Status of a certificate after the wiring layer attempted to parse it. */
|
|
37
|
+
export type CertificateStatus = {
|
|
38
|
+
readonly status: "valid";
|
|
39
|
+
readonly digest: string;
|
|
40
|
+
} | {
|
|
41
|
+
readonly status: "absent";
|
|
42
|
+
} | {
|
|
43
|
+
readonly status: "invalid";
|
|
44
|
+
readonly code: string;
|
|
45
|
+
readonly detail: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Migration readiness as determined by the wiring layer.
|
|
49
|
+
*
|
|
50
|
+
* - `complete`: no pending migration work (empty ledger, or all imported).
|
|
51
|
+
* - `pending`: ledger has entries that may not be imported yet.
|
|
52
|
+
* - `unknown`: could not determine (e.g., ledger unreadable).
|
|
53
|
+
*/
|
|
54
|
+
export type MigrationStatus = "complete" | "pending" | "unknown";
|
|
55
|
+
/** All inputs the gate needs, pre-resolved by the wiring layer. */
|
|
56
|
+
export type GraphGateInput = {
|
|
57
|
+
readonly shadow: CertificateStatus;
|
|
58
|
+
readonly release: CertificateStatus;
|
|
59
|
+
readonly soak: CertificateStatus;
|
|
60
|
+
readonly migration: MigrationStatus;
|
|
61
|
+
readonly operatorApproval: boolean;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Violation codes. Each maps to a distinct failure with a distinct remedy.
|
|
65
|
+
* Codes use kebab-case with the certificate name as prefix so log grep is
|
|
66
|
+
* unambiguous.
|
|
67
|
+
*/
|
|
68
|
+
export type GateViolationCode = "shadow-certificate-absent" | "shadow-certificate-invalid" | "release-certificate-absent" | "release-certificate-invalid" | "soak-certificate-absent" | "soak-certificate-invalid" | "migration-pending" | "migration-unknown" | "operator-approval-missing";
|
|
69
|
+
/** A single gate violation with code and human-readable detail. */
|
|
70
|
+
export type GateViolation = {
|
|
71
|
+
readonly code: GateViolationCode;
|
|
72
|
+
readonly detail: string;
|
|
73
|
+
};
|
|
74
|
+
/** Result of evaluating the cutover gate. */
|
|
75
|
+
export type GraphGateResult = {
|
|
76
|
+
/** `true` only when every condition is satisfied. */
|
|
77
|
+
readonly allowed: boolean;
|
|
78
|
+
/** All violations found, even when `allowed` is already `false`. */
|
|
79
|
+
readonly violations: readonly GateViolation[];
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Evaluates the cutover gate. Pure and deterministic: same inputs always
|
|
83
|
+
* produce the same result.
|
|
84
|
+
*
|
|
85
|
+
* All five conditions are **independently necessary**: shadow, release, soak,
|
|
86
|
+
* migration, and operator approval. A single missing condition closes the gate.
|
|
87
|
+
* All violations are collected (not short-circuited) so the operator sees
|
|
88
|
+
* everything that needs fixing.
|
|
89
|
+
*/
|
|
90
|
+
export declare function evaluateGraphGate(input: GraphGateInput): GraphGateResult;
|
|
91
|
+
/**
|
|
92
|
+
* Whether the cutover gate applies to a given mode. Only `active` mode
|
|
93
|
+
* requires the gate — `shadow` and `off` bypass it entirely.
|
|
94
|
+
*/
|
|
95
|
+
export declare function isGateApplicable(mode: "off" | "shadow" | "active"): boolean;
|
|
96
|
+
//# sourceMappingURL=graphFeatureGate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphFe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AQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,oEAAoE;IACpE,QAAQ,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,CAAC;CAC/C,CAAC;AAuBF;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,eAAe,CAyCxE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAE3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/config/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,kDAAkD;AAClD,eAAO,MAAM,sBAAsB,EAAG,CAAU,CAAC;AAEjD,8CAA8C;AAC9C,MAAM,MAAM,wBAAwB,GAChC,iBAAiB,GACjB,qBAAqB,CAAC;AAE1B,yDAAyD;AACzD,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../src/config/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,kDAAkD;AAClD,eAAO,MAAM,sBAAsB,EAAG,CAAU,CAAC;AAEjD,8CAA8C;AAC9C,MAAM,MAAM,wBAAwB,GAChC,iBAAiB,GACjB,qBAAqB,CAAC;AAE1B,yDAAyD;AACzD,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,YAAY,IAAI,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,EAKzD;CACF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAoBnD"}
|
package/dist/config/resolve.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { GateViolation, GraphGateResult } from "./graphFeatureGate";
|
|
1
2
|
import type { GraphMode, OpenTeamConfig } from "./schema";
|
|
2
3
|
/**
|
|
3
4
|
* Resolver **efectivo** y compartido de la config de Graph (GE-040).
|
|
@@ -11,6 +12,10 @@ import type { GraphMode, OpenTeamConfig } from "./schema";
|
|
|
11
12
|
* - **Shadow sin executor**: solo `active` habilita el executor; `shadow` y
|
|
12
13
|
* `off` no reciben executor.
|
|
13
14
|
* - **Fuente visible**: el origen de la config se propaga al resultado.
|
|
15
|
+
* - **Cutover gate (GE-057)**: `active` mode additionally requires the cutover
|
|
16
|
+
* gate to pass. When the gate denies, `effectiveMode` degrades to `off` and
|
|
17
|
+
* `gateDenied` is `true`. This degradation is **never silent**: the wiring
|
|
18
|
+
* layer emits warnings for each violation.
|
|
14
19
|
*
|
|
15
20
|
* Puro: sin I/O, reloj ni estado global.
|
|
16
21
|
*/
|
|
@@ -20,7 +25,7 @@ export type ConfigSource = "file" | "inline" | "default";
|
|
|
20
25
|
export type ResolvedGraphConfig = {
|
|
21
26
|
/** Modo declarado en la config (default `off`). */
|
|
22
27
|
readonly configuredMode: GraphMode;
|
|
23
|
-
/** Modo efectivo tras aplicar el kill switch. */
|
|
28
|
+
/** Modo efectivo tras aplicar el kill switch and cutover gate. */
|
|
24
29
|
readonly effectiveMode: GraphMode;
|
|
25
30
|
/** Solo `active` habilita el executor. */
|
|
26
31
|
readonly executorEnabled: boolean;
|
|
@@ -28,7 +33,21 @@ export type ResolvedGraphConfig = {
|
|
|
28
33
|
readonly killSwitch: boolean;
|
|
29
34
|
/** Origen de la config. */
|
|
30
35
|
readonly source: ConfigSource;
|
|
36
|
+
/**
|
|
37
|
+
* `true` when the cutover gate denied `active` mode and degraded to `off`.
|
|
38
|
+
* Absent or `false` when the gate was not evaluated (non-active modes) or
|
|
39
|
+
* when it passed.
|
|
40
|
+
*/
|
|
41
|
+
readonly gateDenied?: boolean;
|
|
42
|
+
/** Violations found by the cutover gate, if evaluated. */
|
|
43
|
+
readonly gateViolations?: readonly GateViolation[];
|
|
31
44
|
};
|
|
32
45
|
/** Resuelve la config de Graph efectiva a partir de la config y su origen. */
|
|
33
46
|
export declare function resolveGraphConfig(config: OpenTeamConfig, source: ConfigSource): ResolvedGraphConfig;
|
|
47
|
+
/**
|
|
48
|
+
* Applies the cutover gate result to a resolved config. When the gate denies
|
|
49
|
+
* `active` mode, degrades `effectiveMode` to `off` and marks `gateDenied`.
|
|
50
|
+
* Pure: the gate result is pre-computed by the wiring layer.
|
|
51
|
+
*/
|
|
52
|
+
export declare function applyGraphGate(resolved: ResolvedGraphConfig, gateResult: GraphGateResult): ResolvedGraphConfig;
|
|
34
53
|
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1D;;;;;;;;;;;;;;;;;;GAkBG;AAEH,uEAAuE;AACvE,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzD,iDAAiD;AACjD,MAAM,MAAM,mBAAmB,GAAG;IAChC,mDAAmD;IACnD,QAAQ,CAAC,cAAc,EAAE,SAAS,CAAC;IACnC,kEAAkE;IAClE,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC;IAClC,0CAA0C;IAC1C,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,2BAA2B;IAC3B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,2BAA2B;IAC3B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,0DAA0D;IAC1D,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CACpD,CAAC;AAEF,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY,GACnB,mBAAmB,CAWrB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,mBAAmB,EAC7B,UAAU,EAAE,eAAe,GAC1B,mBAAmB,CAWrB"}
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -4,13 +4,13 @@ export declare const ModelRefSchema: z.ZodObject<{
|
|
|
4
4
|
modelID: z.ZodString;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
export declare const RouterModeSchema: z.ZodEnum<{
|
|
7
|
-
economy: "economy";
|
|
8
7
|
balanced: "balanced";
|
|
8
|
+
economy: "economy";
|
|
9
9
|
quality: "quality";
|
|
10
10
|
}>;
|
|
11
11
|
export declare const PrivacyModeSchema: z.ZodEnum<{
|
|
12
|
-
forceLocalOnSensitive: "forceLocalOnSensitive";
|
|
13
12
|
consentBeforeFrontier: "consentBeforeFrontier";
|
|
13
|
+
forceLocalOnSensitive: "forceLocalOnSensitive";
|
|
14
14
|
off: "off";
|
|
15
15
|
}>;
|
|
16
16
|
export declare const BaselineModeSchema: z.ZodEnum<{
|
|
@@ -22,9 +22,9 @@ export declare const BaselineModeSchema: z.ZodEnum<{
|
|
|
22
22
|
* observa sin ejecutar efectos; `active` habilita el executor. Default `off`.
|
|
23
23
|
*/
|
|
24
24
|
export declare const GraphModeSchema: z.ZodEnum<{
|
|
25
|
+
active: "active";
|
|
25
26
|
off: "off";
|
|
26
27
|
shadow: "shadow";
|
|
27
|
-
active: "active";
|
|
28
28
|
}>;
|
|
29
29
|
/**
|
|
30
30
|
* Sección `graph` de la config. Opcional: cuando falta, el resolver aplica
|
|
@@ -32,11 +32,15 @@ export declare const GraphModeSchema: z.ZodEnum<{
|
|
|
32
32
|
*/
|
|
33
33
|
export declare const GraphConfigSchema: z.ZodObject<{
|
|
34
34
|
mode: z.ZodDefault<z.ZodEnum<{
|
|
35
|
+
active: "active";
|
|
35
36
|
off: "off";
|
|
36
37
|
shadow: "shadow";
|
|
37
|
-
active: "active";
|
|
38
38
|
}>>;
|
|
39
39
|
killSwitch: z.ZodDefault<z.ZodBoolean>;
|
|
40
|
+
operatorApproval: z.ZodDefault<z.ZodBoolean>;
|
|
41
|
+
worktrees: z.ZodDefault<z.ZodObject<{
|
|
42
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
+
}, z.core.$strip>>;
|
|
40
44
|
}, z.core.$strip>;
|
|
41
45
|
export declare const ConsoleHostSchema: z.ZodEnum<{
|
|
42
46
|
"127.0.0.1": "127.0.0.1";
|
|
@@ -57,6 +61,9 @@ export declare const ConsoleConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
57
61
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
58
62
|
pty: z.ZodOptional<z.ZodBoolean>;
|
|
59
63
|
}, z.core.$strip>>;
|
|
64
|
+
graphView: z.ZodOptional<z.ZodObject<{
|
|
65
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
66
|
+
}, z.core.$strip>>;
|
|
60
67
|
}, z.core.$strip>>;
|
|
61
68
|
/**
|
|
62
69
|
* Bloque de configuración de la Console web (nombre canónico `console`).
|
|
@@ -74,16 +81,16 @@ export declare const StorageConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
74
81
|
}, z.core.$strip>>;
|
|
75
82
|
export declare const LocalRuntimeSchema: z.ZodObject<{
|
|
76
83
|
id: z.ZodEnum<{
|
|
77
|
-
ollama: "ollama";
|
|
78
|
-
lmstudio: "lmstudio";
|
|
79
84
|
"foundry-local": "foundry-local";
|
|
85
|
+
lmstudio: "lmstudio";
|
|
86
|
+
ollama: "ollama";
|
|
80
87
|
}>;
|
|
81
88
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
82
89
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
83
90
|
discovery: z.ZodOptional<z.ZodEnum<{
|
|
84
91
|
cli: "cli";
|
|
85
|
-
sdk: "sdk";
|
|
86
92
|
manual: "manual";
|
|
93
|
+
sdk: "sdk";
|
|
87
94
|
}>>;
|
|
88
95
|
defaultModel: z.ZodObject<{
|
|
89
96
|
providerID: z.ZodString;
|
|
@@ -212,8 +219,8 @@ export declare const OpenTeamConfigObjectSchema: z.ZodObject<{
|
|
|
212
219
|
}, z.core.$strip>>;
|
|
213
220
|
router: z.ZodDefault<z.ZodObject<{
|
|
214
221
|
mode: z.ZodDefault<z.ZodEnum<{
|
|
215
|
-
economy: "economy";
|
|
216
222
|
balanced: "balanced";
|
|
223
|
+
economy: "economy";
|
|
217
224
|
quality: "quality";
|
|
218
225
|
}>>;
|
|
219
226
|
localDefault: z.ZodDefault<z.ZodObject<{
|
|
@@ -227,16 +234,16 @@ export declare const OpenTeamConfigObjectSchema: z.ZodObject<{
|
|
|
227
234
|
local: z.ZodDefault<z.ZodObject<{
|
|
228
235
|
runtimes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
229
236
|
id: z.ZodEnum<{
|
|
230
|
-
ollama: "ollama";
|
|
231
|
-
lmstudio: "lmstudio";
|
|
232
237
|
"foundry-local": "foundry-local";
|
|
238
|
+
lmstudio: "lmstudio";
|
|
239
|
+
ollama: "ollama";
|
|
233
240
|
}>;
|
|
234
241
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
235
242
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
236
243
|
discovery: z.ZodOptional<z.ZodEnum<{
|
|
237
244
|
cli: "cli";
|
|
238
|
-
sdk: "sdk";
|
|
239
245
|
manual: "manual";
|
|
246
|
+
sdk: "sdk";
|
|
240
247
|
}>>;
|
|
241
248
|
defaultModel: z.ZodObject<{
|
|
242
249
|
providerID: z.ZodString;
|
|
@@ -251,8 +258,8 @@ export declare const OpenTeamConfigObjectSchema: z.ZodObject<{
|
|
|
251
258
|
hardStopOnBudgetExhaustion: z.ZodDefault<z.ZodBoolean>;
|
|
252
259
|
}, z.core.$strip>>;
|
|
253
260
|
privacyMode: z.ZodDefault<z.ZodEnum<{
|
|
254
|
-
forceLocalOnSensitive: "forceLocalOnSensitive";
|
|
255
261
|
consentBeforeFrontier: "consentBeforeFrontier";
|
|
262
|
+
forceLocalOnSensitive: "forceLocalOnSensitive";
|
|
256
263
|
off: "off";
|
|
257
264
|
}>>;
|
|
258
265
|
console: z.ZodDefault<z.ZodObject<{
|
|
@@ -270,6 +277,9 @@ export declare const OpenTeamConfigObjectSchema: z.ZodObject<{
|
|
|
270
277
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
271
278
|
pty: z.ZodOptional<z.ZodBoolean>;
|
|
272
279
|
}, z.core.$strip>>;
|
|
280
|
+
graphView: z.ZodOptional<z.ZodObject<{
|
|
281
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
282
|
+
}, z.core.$strip>>;
|
|
273
283
|
}, z.core.$strip>>;
|
|
274
284
|
storage: z.ZodDefault<z.ZodObject<{
|
|
275
285
|
sqliteIndex: z.ZodDefault<z.ZodObject<{
|
|
@@ -321,11 +331,15 @@ export declare const OpenTeamConfigObjectSchema: z.ZodObject<{
|
|
|
321
331
|
}, z.core.$strip>>;
|
|
322
332
|
graph: z.ZodOptional<z.ZodObject<{
|
|
323
333
|
mode: z.ZodDefault<z.ZodEnum<{
|
|
334
|
+
active: "active";
|
|
324
335
|
off: "off";
|
|
325
336
|
shadow: "shadow";
|
|
326
|
-
active: "active";
|
|
327
337
|
}>>;
|
|
328
338
|
killSwitch: z.ZodDefault<z.ZodBoolean>;
|
|
339
|
+
operatorApproval: z.ZodDefault<z.ZodBoolean>;
|
|
340
|
+
worktrees: z.ZodDefault<z.ZodObject<{
|
|
341
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
342
|
+
}, z.core.$strip>>;
|
|
329
343
|
}, z.core.$strip>>;
|
|
330
344
|
}, z.core.$strip>;
|
|
331
345
|
/** Esquema público de la config de openteam. */
|
|
@@ -346,8 +360,8 @@ export declare const OpenTeamConfigSchema: z.ZodObject<{
|
|
|
346
360
|
}, z.core.$strip>>;
|
|
347
361
|
router: z.ZodDefault<z.ZodObject<{
|
|
348
362
|
mode: z.ZodDefault<z.ZodEnum<{
|
|
349
|
-
economy: "economy";
|
|
350
363
|
balanced: "balanced";
|
|
364
|
+
economy: "economy";
|
|
351
365
|
quality: "quality";
|
|
352
366
|
}>>;
|
|
353
367
|
localDefault: z.ZodDefault<z.ZodObject<{
|
|
@@ -361,16 +375,16 @@ export declare const OpenTeamConfigSchema: z.ZodObject<{
|
|
|
361
375
|
local: z.ZodDefault<z.ZodObject<{
|
|
362
376
|
runtimes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
363
377
|
id: z.ZodEnum<{
|
|
364
|
-
ollama: "ollama";
|
|
365
|
-
lmstudio: "lmstudio";
|
|
366
378
|
"foundry-local": "foundry-local";
|
|
379
|
+
lmstudio: "lmstudio";
|
|
380
|
+
ollama: "ollama";
|
|
367
381
|
}>;
|
|
368
382
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
369
383
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
370
384
|
discovery: z.ZodOptional<z.ZodEnum<{
|
|
371
385
|
cli: "cli";
|
|
372
|
-
sdk: "sdk";
|
|
373
386
|
manual: "manual";
|
|
387
|
+
sdk: "sdk";
|
|
374
388
|
}>>;
|
|
375
389
|
defaultModel: z.ZodObject<{
|
|
376
390
|
providerID: z.ZodString;
|
|
@@ -385,8 +399,8 @@ export declare const OpenTeamConfigSchema: z.ZodObject<{
|
|
|
385
399
|
hardStopOnBudgetExhaustion: z.ZodDefault<z.ZodBoolean>;
|
|
386
400
|
}, z.core.$strip>>;
|
|
387
401
|
privacyMode: z.ZodDefault<z.ZodEnum<{
|
|
388
|
-
forceLocalOnSensitive: "forceLocalOnSensitive";
|
|
389
402
|
consentBeforeFrontier: "consentBeforeFrontier";
|
|
403
|
+
forceLocalOnSensitive: "forceLocalOnSensitive";
|
|
390
404
|
off: "off";
|
|
391
405
|
}>>;
|
|
392
406
|
console: z.ZodDefault<z.ZodObject<{
|
|
@@ -404,6 +418,9 @@ export declare const OpenTeamConfigSchema: z.ZodObject<{
|
|
|
404
418
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
405
419
|
pty: z.ZodOptional<z.ZodBoolean>;
|
|
406
420
|
}, z.core.$strip>>;
|
|
421
|
+
graphView: z.ZodOptional<z.ZodObject<{
|
|
422
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
423
|
+
}, z.core.$strip>>;
|
|
407
424
|
}, z.core.$strip>>;
|
|
408
425
|
storage: z.ZodDefault<z.ZodObject<{
|
|
409
426
|
sqliteIndex: z.ZodDefault<z.ZodObject<{
|
|
@@ -455,11 +472,15 @@ export declare const OpenTeamConfigSchema: z.ZodObject<{
|
|
|
455
472
|
}, z.core.$strip>>;
|
|
456
473
|
graph: z.ZodOptional<z.ZodObject<{
|
|
457
474
|
mode: z.ZodDefault<z.ZodEnum<{
|
|
475
|
+
active: "active";
|
|
458
476
|
off: "off";
|
|
459
477
|
shadow: "shadow";
|
|
460
|
-
active: "active";
|
|
461
478
|
}>>;
|
|
462
479
|
killSwitch: z.ZodDefault<z.ZodBoolean>;
|
|
480
|
+
operatorApproval: z.ZodDefault<z.ZodBoolean>;
|
|
481
|
+
worktrees: z.ZodDefault<z.ZodObject<{
|
|
482
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
483
|
+
}, z.core.$strip>>;
|
|
463
484
|
}, z.core.$strip>>;
|
|
464
485
|
}, z.core.$strip>;
|
|
465
486
|
export type ModelRef = z.infer<typeof ModelRefSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;iBAGzB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;EAA6C,CAAC;AAC3E,eAAO,MAAM,iBAAiB;;;;EAI5B,CAAC;AACH,eAAO,MAAM,kBAAkB;;;EAA6B,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;EAAsC,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc;;;iBAGzB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;EAA6C,CAAC;AAC3E,eAAO,MAAM,iBAAiB;;;;EAI5B,CAAC;AACH,eAAO,MAAM,kBAAkB;;;EAA6B,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;EAAsC,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;iBAyB5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;EAAqC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;kBA8C5B,CAAC;AAEL;;GAEG;AAEH;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;kBAW5B,CAAC;AAWL,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;iBAM7B,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;EAA8B,CAAC;AAC7D,eAAO,MAAM,0BAA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,CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,GACrB,oBAAoB,CAEtB"}
|
package/dist/console/assets.d.ts
CHANGED
|
@@ -5,5 +5,13 @@
|
|
|
5
5
|
* todo el contenido dinámico antes de insertarlo.
|
|
6
6
|
*/
|
|
7
7
|
export declare const CONSOLE_STYLE = "\n:root{color-scheme:dark;--bg:#0f1115;--panel:#171a21;--fg:#e6e8eb;--muted:#8b929c;--good:#3fb950;--local:#58a6ff;--frontier:#d29922;--line:#262b34}\n*{box-sizing:border-box}\nbody{margin:0;background:var(--bg);color:var(--fg);font:14px/1.5 ui-sans-serif,system-ui,Segoe UI,Roboto,sans-serif}\nheader{padding:16px 24px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap}\nheader h1{font-size:18px;margin:0}\nheader .meta{color:var(--muted);font-size:12px}\nmain{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px;padding:24px}\n.panel{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:16px}\n.panel h2{font-size:14px;margin:0 0 12px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}\n.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}\n.stat{display:flex;flex-direction:column;gap:2px}\n.stat .k{color:var(--muted);font-size:12px}\n.stat .v{font-size:18px;font-weight:600}\n.good{color:var(--good)}\n.local{color:var(--local)}\n.frontier{color:var(--frontier)}\n.muted{color:var(--muted)}\ntable{width:100%;border-collapse:collapse;font-size:13px}\nth,td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--line)}\nth{color:var(--muted);font-weight:600}\n.hash{font-family:ui-monospace,Consolas,monospace;color:var(--muted)}\n.progress{height:10px;background:#0b0d11;border-radius:6px;overflow:hidden;border:1px solid var(--line)}\n.progress .bar{height:100%;background:var(--good)}\nul.items,ul.timeline{list-style:none;margin:8px 0 0;padding:0;max-height:320px;overflow:auto}\nul.items li,ul.timeline li{padding:4px 0;border-bottom:1px solid var(--line)}\nul.items li.done{color:var(--muted)}\nul.items .box{font-family:monospace}\n.who{color:var(--local)}\n.tag{color:var(--frontier);font-size:12px}\n.kind{display:inline-block;min-width:66px;color:var(--muted);font-size:12px}\ncode{font-family:ui-monospace,Consolas,monospace;background:#0b0d11;padding:1px 5px;border-radius:4px}\n.mono{font-family:ui-monospace,Consolas,monospace;font-size:12px}\n.tabs{display:flex;gap:6px;padding:12px 24px 0;flex-wrap:wrap;border-bottom:1px solid var(--line)}\n.tabs .tab{background:var(--panel);color:var(--fg);border:1px solid var(--line);border-bottom:none;border-radius:8px 8px 0 0;padding:8px 14px;cursor:pointer;font:inherit;display:flex;align-items:center;gap:6px}\n.tabs .tab.active{background:var(--bg);border-color:var(--local);color:var(--fg)}\n.dot{width:8px;height:8px;border-radius:50%;display:inline-block;background:var(--muted)}\n.badge{font-size:11px;padding:1px 8px;border-radius:10px;border:1px solid var(--line);color:var(--muted);vertical-align:middle}\n.status-running{background:var(--good)}\n.badge.status-running{color:var(--good);border-color:var(--good)}\n.status-idle{background:var(--muted)}\n.badge.status-idle{color:var(--muted)}\n.status-waiting-input{background:var(--frontier)}\n.badge.status-waiting-input{color:var(--frontier);border-color:var(--frontier)}\n.status-ended{background:#6e7681}\n.badge.status-ended{color:#6e7681}\n.term .termlog{background:#0b0d11;border:1px solid var(--line);border-radius:8px;padding:10px;max-height:340px;overflow:auto;font-family:ui-monospace,Consolas,monospace;font-size:12px;white-space:pre-wrap}\n.term .tl{padding:1px 0}\n.term .tl.input{color:var(--local)}\n.term .tl.tool{color:var(--frontier)}\n.term .tl.status{color:var(--muted)}\n.term .tl.error{color:#f85149}\n.term .tl.permission{color:var(--frontier);font-weight:600}\n.term form.terminput{display:flex;gap:8px;margin-top:10px}\n.term form.terminput input{flex:1;background:#0b0d11;color:var(--fg);border:1px solid var(--line);border-radius:8px;padding:8px 10px;font:inherit}\n.term form.terminput button{background:var(--local);color:#04122b;border:none;border-radius:8px;padding:8px 16px;cursor:pointer;font:inherit;font-weight:600}\n.pty .ptylog{background:#05070a;border:1px solid var(--line);border-radius:8px;padding:10px;max-height:340px;overflow:auto;font-family:ui-monospace,Consolas,monospace;font-size:12px;white-space:pre-wrap;color:#c8d1dc}\n.pty form.ptyinput{display:flex;gap:8px;margin-top:10px}\n.pty form.ptyinput input{flex:1;background:#05070a;color:var(--fg);border:1px solid var(--line);border-radius:8px;padding:8px 10px;font:inherit}\n.pty form.ptyinput button,.pty .pty-start{background:var(--frontier);color:#1a1200;border:none;border-radius:8px;padding:8px 16px;cursor:pointer;font:inherit;font-weight:600;margin-top:8px}\n.pty .pty-start:disabled{opacity:.5;cursor:default}\n";
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Estilos del render del grafo de agentes (GE-083). Se inyectan en el `<style>`
|
|
10
|
+
* **solo** cuando la vista del grafo está habilitada, de modo que con la vista
|
|
11
|
+
* apagada la Console es byte-idéntica a hoy. Colorean cada nodo por estado y dan
|
|
12
|
+
* formato a las aristas y a los badges reference-only (intento/error/timeout/
|
|
13
|
+
* cancelación/veredicto/linaje/artefacto).
|
|
14
|
+
*/
|
|
15
|
+
export declare const GRAPH_STYLE = "\n.graph-wrap{overflow:auto;background:#0b0d11;border:1px solid var(--line);border-radius:8px;padding:8px}\nsvg.graph{display:block}\n.gedge{stroke:#3a4250;stroke-width:1.5;marker-end:url(#garrow)}\n.gnode rect{fill:var(--panel);stroke:var(--line);stroke-width:1.5;rx:8}\n.gnode .gname{fill:var(--fg);font:600 12px ui-monospace,Consolas,monospace}\n.gnode .grole{fill:var(--muted);font-size:11px}\n.gnode .gstate{font-size:10px;text-transform:uppercase;letter-spacing:.05em}\n.gnode.state-pending rect{stroke:#6e7681}\n.gnode.state-pending .gstate{fill:#6e7681}\n.gnode.state-ready rect{stroke:var(--local)}\n.gnode.state-ready .gstate{fill:var(--local)}\n.gnode.state-active rect{stroke:var(--frontier)}\n.gnode.state-active .gstate{fill:var(--frontier)}\n.gnode.state-succeeded rect{stroke:var(--good)}\n.gnode.state-succeeded .gstate{fill:var(--good)}\n.gnode.state-failed rect{stroke:#f85149}\n.gnode.state-failed .gstate{fill:#f85149}\n.gnode.state-cancelled rect{stroke:#484f58}\n.gnode.state-cancelled .gstate{fill:#484f58}\n.gbadge{font-size:10px;font-family:ui-monospace,Consolas,monospace}\n.gbadge.badge-retry{fill:var(--frontier)}\n.gbadge.badge-error{fill:#f85149}\n.gbadge.badge-cancelled{fill:#484f58}\n.gbadge.badge-verdict.verdict-approved{fill:var(--good)}\n.gbadge.badge-verdict.verdict-rejected{fill:#f85149}\n.gbadge.badge-verdict.verdict-inconclusive{fill:var(--frontier)}\n.gbadge.badge-lineage{fill:var(--local)}\n.gbadge.badge-artifact{fill:var(--muted)}\n.gnode[data-session]{cursor:pointer}\n.gnode[data-session]:hover rect{stroke-width:2.5}\n.graph-health{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}\n.gchip{font-size:11px;padding:2px 10px;border-radius:10px;border:1px solid var(--line);color:var(--muted)}\n.gchip.on{font-weight:600}\n.gchip.gh-recovery.on,.gchip.gh-unknown.on{color:var(--frontier);border-color:var(--frontier)}\n.gchip.gh-conflict.on,.gchip.gh-kill.on{color:#f85149;border-color:#f85149}\n.graph-drill{margin-top:14px;border-top:1px solid var(--line);padding-top:12px}\n.graph-drill h3{font-size:13px;margin:0 0 8px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}\n.graph-drill .drilllog{background:#0b0d11;border:1px solid var(--line);border-radius:8px;padding:10px;max-height:280px;overflow:auto;font-family:ui-monospace,Consolas,monospace;font-size:12px;white-space:pre-wrap}\n.graph-drill .drilllog .tl{padding:1px 0}\n.graph-drill .drilllog .tl.tool{color:var(--frontier)}\n.graph-drill .drilllog .tl.status{color:var(--muted)}\n.graph-drill .drilllog .tl.permission{color:var(--frontier);font-weight:600}\n.graph-drill .drilllog .tl.error{color:#f85149}\n";
|
|
16
|
+
export declare const CONSOLE_CLIENT_JS = "\n(function(){\n var authTok='';\n try{\n var qp=new URLSearchParams(window.location.search).get('token');\n if(qp){authTok='?token='+encodeURIComponent(qp)}\n }catch(e){/* ignore */}\n function reloadIfChanged(prev){\n fetch('/api/state'+authTok).then(function(r){return r.json()}).then(function(s){\n if(s.generatedAt!==prev){location.reload()}\n }).catch(function(){});\n }\n var current=document.documentElement.getAttribute('data-generated')||'';\n if('EventSource' in window){\n try{\n var es=new EventSource('/events'+authTok);\n es.addEventListener('state',function(){location.reload()});\n es.onerror=function(){/* fallback below */};\n }catch(e){/* ignore */}\n }\n var ms=parseInt(document.documentElement.getAttribute('data-refresh')||'2000',10);\n setInterval(function(){reloadIfChanged(current)},isNaN(ms)?2000:Math.max(250,ms));\n\n function selectTab(name){\n var tabs=document.querySelectorAll('#tabbar .tab');\n for(var i=0;i<tabs.length;i++){tabs[i].classList.toggle('active',tabs[i].getAttribute('data-tab')===name)}\n var views=document.querySelectorAll('main .view');\n var matched=false;\n for(var j=0;j<views.length;j++){\n var show=views[j].getAttribute('data-view')===name;\n views[j].hidden=!show;\n if(show){matched=true;if(name!=='all'){connectTerminal(views[j],name)}}\n }\n if(!matched){return false}\n try{sessionStorage.setItem('openteam.tab',name)}catch(e){}\n return true;\n }\n function connectTerminal(view,id){\n if(view.__wired){return}\n var root=document.documentElement;\n var token=root.getAttribute('data-token');\n if(root.getAttribute('data-terminal')!=='1'||!token){return}\n var log=view.querySelector('.termlog');\n if(!log){return}\n view.__wired=true;\n function append(cls,text){\n var line=document.createElement('div');\n line.className='tl '+cls;line.textContent=text;\n log.appendChild(line);log.scrollTop=log.scrollHeight;\n }\n var q='/console/session/'+encodeURIComponent(id);\n var tk='token='+encodeURIComponent(token);\n if('EventSource' in window){\n try{\n var es=new EventSource(q+'/stream?'+tk);\n es.addEventListener('frame',function(e){try{var f=JSON.parse(e.data);append(f.kind,f.text)}catch(_){}}); \n es.onerror=function(){/* reconecta solo */};\n }catch(_){/* ignore */}\n }\n var form=view.querySelector('form.terminput');\n if(form){\n form.addEventListener('submit',function(e){\n e.preventDefault();\n var inp=form.querySelector('input[name=text]');\n var text=inp.value;\n if(!text){return}\n inp.value='';append('input','\u203A '+text);\n fetch(q+'/input?'+tk,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({text:text})})\n .then(function(r){if(!r.ok){append('error','\u2716 env\u00EDo rechazado ('+r.status+')')}})\n .catch(function(){append('error','\u2716 no se pudo enviar')});\n });\n }\n connectPty(view,id,q,tk);\n }\n function connectPty(view,id,q,tk){\n var root=document.documentElement;\n if(root.getAttribute('data-pty')!=='1'){return}\n var pane=view.querySelector('.pty');\n if(!pane){return}\n var log=pane.querySelector('.ptylog');\n var startBtn=pane.querySelector('.pty-start');\n var input=pane.querySelector('form.ptyinput');\n function plog(text){\n var d=document.createElement('span');d.textContent=text;\n log.appendChild(d);log.scrollTop=log.scrollHeight;\n }\n if(!startBtn){return}\n startBtn.addEventListener('click',function(){\n startBtn.disabled=true;plog('Abriendo shell\u2026\n');\n fetch(q+'/pty?'+tk,{method:'POST',headers:{'content-type':'application/json'},body:'{}'})\n .then(function(r){return r.ok?r.json():Promise.reject(r.status)})\n .then(function(info){openPtyWs(info.wsUrl)})\n .catch(function(s){plog('\u2716 no se pudo abrir PTY ('+s+')\n');startBtn.disabled=false});\n });\n function openPtyWs(url){\n try{\n var ws=new WebSocket(url);\n ws.binaryType='arraybuffer';\n ws.onmessage=function(e){\n var data=e.data;\n if(data instanceof ArrayBuffer){data=new TextDecoder().decode(new Uint8Array(data))}\n plog(data);\n };\n ws.onclose=function(){plog('\n[shell cerrada]\n');startBtn.disabled=false};\n ws.onerror=function(){plog('\n\u2716 error de WebSocket\n')};\n if(input){\n input.hidden=false;\n input.addEventListener('submit',function(e){\n e.preventDefault();\n var c=input.querySelector('input[name=cmd]');\n if(!c.value){return}\n ws.send(c.value+'\r');c.value='';\n });\n }\n }catch(_){plog('\n\u2716 WebSocket no disponible\n');startBtn.disabled=false}\n }\n }\n function wireGraphDrill(){\n var root=document.documentElement;\n if(root.getAttribute('data-drilldown')!=='1'){return}\n var token=root.getAttribute('data-token');\n if(!token){return}\n var drill=document.querySelector('.graph-drill');\n if(!drill){return}\n var gview=drill.closest('.view');\n if(!gview){return}\n var log=drill.querySelector('.drilllog');\n var title=drill.querySelector('.drill-title');\n if(!log){return}\n var es=null;\n function append(cls,text){\n var line=document.createElement('div');\n line.className='tl '+cls;line.textContent=text;\n log.appendChild(line);log.scrollTop=log.scrollHeight;\n }\n function open(id){\n if(es){try{es.close()}catch(_){}}\n log.textContent='';drill.hidden=false;\n if(title){title.textContent='Conversaci\u00F3n \u00B7 '+id}\n var tk='token='+encodeURIComponent(token);\n var base='/console/session/'+encodeURIComponent(id);\n fetch(base+'/messages?'+tk).then(function(r){return r.ok?r.json():Promise.reject(r.status)})\n .then(function(d){(d&&d.frames||[]).forEach(function(f){append(f.kind,f.text)})})\n .catch(function(s){append('error','\u2716 no se pudo cargar la conversaci\u00F3n ('+s+')')});\n if('EventSource' in window){\n try{\n es=new EventSource(base+'/stream?'+tk);\n es.addEventListener('frame',function(e){try{var f=JSON.parse(e.data);append(f.kind,f.text)}catch(_){}}); \n es.onerror=function(){/* reconecta solo */};\n }catch(_){/* ignore */}\n }\n }\n gview.addEventListener('click',function(e){\n var t=e.target;\n while(t&&t!==gview&&!(t.getAttribute&&t.getAttribute('data-session'))){t=t.parentNode}\n if(t&&t.getAttribute&&t.getAttribute('data-session')){open(t.getAttribute('data-session'))}\n });\n }\n var bar=document.getElementById('tabbar');\n if(bar){\n bar.addEventListener('click',function(e){\n var t=e.target;\n while(t&&t!==bar&&!t.getAttribute('data-tab')){t=t.parentNode}\n if(t&&t.getAttribute('data-tab')){selectTab(t.getAttribute('data-tab'))}\n });\n }\n var saved='all';\n try{saved=sessionStorage.getItem('openteam.tab')||'all'}catch(e){}\n if(!selectTab(saved)){selectTab('all')}\n wireGraphDrill();\n})();\n";
|
|
9
17
|
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/console/assets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,igJA6DzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/console/assets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,aAAa,igJA6DzB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,klFA4CvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,kmOA2K7B,CAAC"}
|
|
@@ -18,6 +18,12 @@ export type ConsoleClient = {
|
|
|
18
18
|
sendPrompt: (sessionID: string, text: string) => Promise<void>;
|
|
19
19
|
/** Responde a una solicitud de permiso. */
|
|
20
20
|
respondPermission: (sessionID: string, permissionID: string, response: "once" | "always" | "reject") => Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Lee el histórico de la conversación de una sesión vía `session.messages`
|
|
23
|
+
* (GET **de solo lectura**) para el drill-down del grafo (GE-084). Devuelve
|
|
24
|
+
* frames reference-only; nunca persiste ni registra el contenido.
|
|
25
|
+
*/
|
|
26
|
+
listMessages: (sessionID: string) => Promise<SessionFrame[]>;
|
|
21
27
|
/**
|
|
22
28
|
* Suscribe a los eventos de la sesión y llama `onFrame` por cada frame legible.
|
|
23
29
|
* Se detiene cuando `signal` aborta o el stream termina.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencodeClient.d.ts","sourceRoot":"","sources":["../../src/console/opencodeClient.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"opencodeClient.d.ts","sourceRoot":"","sources":["../../src/console/opencodeClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAEjE;;;;GAIG;AAEH,MAAM,MAAM,SAAS,GAAG,OAAO,KAAK,CAAC;AAErC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,iFAAiF;IACjF,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,2CAA2C;IAC3C,iBAAiB,EAAE,CACjB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,KACnC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB;;;;OAIG;IACH,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC7D;;;OAGG;IACH,YAAY,EAAE,CACZ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,EACtC,MAAM,EAAE,WAAW,KAChB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,CAAC;AAgBF,oFAAoF;AACpF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,MAAM,GAChB,YAAY,GAAG,SAAS,CAK1B;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,aAAa,CA+E1E"}
|
|
@@ -31,6 +31,14 @@ export type OpencodeEventLike = {
|
|
|
31
31
|
* campo directo como los anidados (`part.sessionID`, `info.sessionID`). Pure.
|
|
32
32
|
*/
|
|
33
33
|
export declare function eventSessionID(event: OpencodeEventLike): string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Traduce la respuesta de `session.messages` (histórico de la conversación) a
|
|
36
|
+
* frames legibles para el drill-down **de solo lectura** (GE-084). Acepta la
|
|
37
|
+
* forma laxa `{ info?, parts? }[]`, descarta entradas de otra sesión y traduce
|
|
38
|
+
* cada `part` con `partToFrame`. Nunca incluye argumentos de tool ni secretos.
|
|
39
|
+
* Determinista y sin I/O: el driver (`console/opencodeClient.ts`) aporta la red.
|
|
40
|
+
*/
|
|
41
|
+
export declare function messagesToFrames(raw: unknown, sessionID: string): SessionFrame[];
|
|
34
42
|
/**
|
|
35
43
|
* Traduce un evento opencode a un frame de sesión legible, **solo** si pertenece
|
|
36
44
|
* a `sessionID`. Devuelve `undefined` para eventos irrelevantes o de otra sesión.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/console/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AAEH,mFAAmF;AACnF,eAAO,MAAM,eAAe,SAAU,CAAC;AAEvC,eAAO,MAAM,kBAAkB;;iBAE7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAGxE;AAED,MAAM,MAAM,g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ACvB,CAAC;AAEF,4EAA4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAYF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAU3E;AAoBD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,MAAM,GAChB,YAAY,EAAE,CA+BhB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,MAAM,GAChB,YAAY,GAAG,SAAS,CA6B1B;AAED,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAEtD"}
|
package/dist/console/render.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import type { GraphViewProjectionV1 } from "../telemetry/graphView";
|
|
1
2
|
import type { ConsoleState } from "./types";
|
|
2
3
|
/** Escapa texto para HTML. Evita fuga de markup y roturas de `</script>`. Pure. */
|
|
3
4
|
export declare function escapeHtml(value: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Renderiza el DAG del grafo de agentes como SVG **determinista** a partir de la
|
|
7
|
+
* proyección reference-only (GE-083). Colorea cada nodo por estado y pinta los
|
|
8
|
+
* badges de intento/error/timeout/cancelación/veredicto/linaje. Escapa todo
|
|
9
|
+
* identificador; **nunca** incluye contenido crudo. Puro: mismas entradas ->
|
|
10
|
+
* misma salida.
|
|
11
|
+
*/
|
|
12
|
+
export declare function renderGraphView(projection: GraphViewProjectionV1 | null): string;
|
|
4
13
|
export type RenderOptions = {
|
|
5
14
|
/** Fallback de polling en ms (default 2000). */
|
|
6
15
|
refreshMs?: number;
|
|
@@ -10,6 +19,22 @@ export type RenderOptions = {
|
|
|
10
19
|
terminalEnabled?: boolean;
|
|
11
20
|
/** Habilita la vista "Terminal" (PTY real, Fase 5). Opt-in. */
|
|
12
21
|
ptyEnabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Habilita la vista "Grafo" (GE-083). Opt-in: cuando se pasa, se añade la
|
|
24
|
+
* pestaña/vista del DAG y sus estilos; sin ella, la salida es byte-idéntica a
|
|
25
|
+
* hoy. `projection` es la vista reference-only del grafo (o `null` si no hay
|
|
26
|
+
* run activo).
|
|
27
|
+
*/
|
|
28
|
+
graphView?: {
|
|
29
|
+
readonly projection: GraphViewProjectionV1 | null;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Habilita el drill-down nodo->conversación de solo lectura (GE-084). Solo
|
|
33
|
+
* surte efecto junto a `graphView`: añade el panel de conversación y expone el
|
|
34
|
+
* token/marca `data-drilldown` que usa el cliente. Sin él, la vista del grafo
|
|
35
|
+
* es idéntica a GE-083.
|
|
36
|
+
*/
|
|
37
|
+
drilldownEnabled?: boolean;
|
|
13
38
|
};
|
|
14
39
|
/**
|
|
15
40
|
* Renderiza el console como un único HTML autocontenido (CSS + JS inline, sin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/console/render.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/console/render.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAGV,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAGV,YAAY,EAIb,MAAM,SAAS,CAAC;AASjB,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOhD;AAyhBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,qBAAqB,GAAG,IAAI,GACvC,MAAM,CAwBR;AAwED,MAAM,MAAM,aAAa,GAAG;IAC1B,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,+DAA+D;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,SAAS,CAAC,EAAE;QACV,QAAQ,CAAC,UAAU,EAAE,qBAAqB,GAAG,IAAI,CAAC;KACnD,CAAC;IACF;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,OAAO,GAAE,aAAkB,GAC1B,MAAM,CAyDR"}
|