@jmanuelcorral/openteam 0.1.40 → 0.1.41
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/AGENTS.md +15 -0
- package/README.es.md +1 -1
- package/README.md +1 -1
- package/dist/cli.js +39 -2
- package/dist/commands/graph.d.ts +65 -0
- package/dist/commands/graph.d.ts.map +1 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/migrations.d.ts +27 -0
- package/dist/config/migrations.d.ts.map +1 -0
- package/dist/config/resolve.d.ts +34 -0
- package/dist/config/resolve.d.ts.map +1 -0
- package/dist/config/schema.d.ts +39 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/context/redaction.d.ts +48 -0
- package/dist/context/redaction.d.ts.map +1 -0
- package/dist/context/schema.d.ts +115 -0
- package/dist/context/schema.d.ts.map +1 -0
- package/dist/context/types.d.ts +8 -0
- package/dist/context/types.d.ts.map +1 -0
- package/dist/graph/events.d.ts +25 -0
- package/dist/graph/events.d.ts.map +1 -0
- package/dist/graph/ids.d.ts +5 -0
- package/dist/graph/ids.d.ts.map +1 -0
- package/dist/graph/planner.d.ts +15 -0
- package/dist/graph/planner.d.ts.map +1 -0
- package/dist/graph/policies.d.ts +34 -0
- package/dist/graph/policies.d.ts.map +1 -0
- package/dist/graph/privacyPolicy.d.ts +29 -0
- package/dist/graph/privacyPolicy.d.ts.map +1 -0
- package/dist/graph/reducer.d.ts +27 -0
- package/dist/graph/reducer.d.ts.map +1 -0
- package/dist/graph/replay.d.ts +20 -0
- package/dist/graph/replay.d.ts.map +1 -0
- package/dist/graph/reviewerPolicy.d.ts +27 -0
- package/dist/graph/reviewerPolicy.d.ts.map +1 -0
- package/dist/graph/schema.d.ts +220 -0
- package/dist/graph/schema.d.ts.map +1 -0
- package/dist/graph/types.d.ts +40 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/validate.d.ts +19 -0
- package/dist/graph/validate.d.ts.map +1 -0
- package/dist/index.js +39 -2
- package/dist/orchestrator/graphCancellation.d.ts +84 -0
- package/dist/orchestrator/graphCancellation.d.ts.map +1 -0
- package/dist/orchestrator/graphEffects.d.ts +63 -0
- package/dist/orchestrator/graphEffects.d.ts.map +1 -0
- package/dist/orchestrator/graphReview.d.ts +84 -0
- package/dist/orchestrator/graphReview.d.ts.map +1 -0
- package/dist/orchestrator/graphRuntime.d.ts +69 -0
- package/dist/orchestrator/graphRuntime.d.ts.map +1 -0
- package/dist/orchestrator/opencodeSessionAdapter.d.ts +117 -0
- package/dist/orchestrator/opencodeSessionAdapter.d.ts.map +1 -0
- package/dist/orchestrator/sdd.d.ts +38 -2
- package/dist/orchestrator/sdd.d.ts.map +1 -1
- package/dist/orchestrator/sddCompiler.d.ts +44 -0
- package/dist/orchestrator/sddCompiler.d.ts.map +1 -0
- package/dist/orchestrator/sessionReconciler.d.ts +74 -0
- package/dist/orchestrator/sessionReconciler.d.ts.map +1 -0
- package/dist/orchestrator/shadowComparator.d.ts +62 -0
- package/dist/orchestrator/shadowComparator.d.ts.map +1 -0
- package/dist/storage/graph/codec.d.ts +52 -0
- package/dist/storage/graph/codec.d.ts.map +1 -0
- package/dist/storage/graph/fsGraphJournal.d.ts +3 -0
- package/dist/storage/graph/fsGraphJournal.d.ts.map +1 -0
- package/dist/storage/graph/importLegacy.d.ts +62 -0
- package/dist/storage/graph/importLegacy.d.ts.map +1 -0
- package/dist/storage/graph/memoryGraphJournal.d.ts +11 -0
- package/dist/storage/graph/memoryGraphJournal.d.ts.map +1 -0
- package/dist/storage/graph/migrateLegacyBriefs.d.ts +32 -0
- package/dist/storage/graph/migrateLegacyBriefs.d.ts.map +1 -0
- package/dist/storage/graph/projections.d.ts +31 -0
- package/dist/storage/graph/projections.d.ts.map +1 -0
- package/dist/storage/graph/provider.d.ts +52 -0
- package/dist/storage/graph/provider.d.ts.map +1 -0
- package/dist/storage/graph/recovery.d.ts +38 -0
- package/dist/storage/graph/recovery.d.ts.map +1 -0
- package/dist/storage/graph/runRegistry.d.ts +17 -0
- package/dist/storage/graph/runRegistry.d.ts.map +1 -0
- package/dist/storage/graph/snapshot.d.ts +44 -0
- package/dist/storage/graph/snapshot.d.ts.map +1 -0
- package/dist/storage/graph/workspaceLease.d.ts +36 -0
- package/dist/storage/graph/workspaceLease.d.ts.map +1 -0
- package/dist/storage/graph/writer.d.ts +20 -0
- package/dist/storage/graph/writer.d.ts.map +1 -0
- package/dist/telemetry/graphProjection.d.ts +36 -0
- package/dist/telemetry/graphProjection.d.ts.map +1 -0
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -33,6 +33,21 @@ openteam is an opencode plugin built with **TypeScript + Bun** with **local-firs
|
|
|
33
33
|
- TypeScript strict, ESM only, Zod at boundaries.
|
|
34
34
|
- Biome governs lint/format; do not introduce ESLint/Prettier unless a new decision is made.
|
|
35
35
|
|
|
36
|
+
## Test-first with Gherkin
|
|
37
|
+
|
|
38
|
+
- **Default workflow for behavioral work is Test-First with Gherkin.** Before implementing a
|
|
39
|
+
story in `src/graph/**`, `src/context/**`, `src/storage/graph/**`, or `src/orchestrator/**`,
|
|
40
|
+
first write the `.feature` scenarios derived from the story's "Testable acceptance", watch
|
|
41
|
+
them fail, then implement until green.
|
|
42
|
+
- Functional tests run on the in-repo, **dependency-free** Gherkin harness at
|
|
43
|
+
`tests/functional/gherkin/` (parser + runner). Do not add Cucumber or any BDD dependency:
|
|
44
|
+
it would violate the supply-chain policy.
|
|
45
|
+
- Feature files live under `tests/functional/features/**`; step definitions are inlined in the
|
|
46
|
+
matching `tests/functional/*.test.ts` so they do not drag coverage. Steps drive the **real**
|
|
47
|
+
modules; only injected I/O ports (filesystem, clock, session client) may be deterministic fakes.
|
|
48
|
+
- Backfill is incremental: as we touch or extend an area, add the missing Gherkin coverage and
|
|
49
|
+
pay down technical debt rather than leaving gaps.
|
|
50
|
+
|
|
36
51
|
## Non-negotiables
|
|
37
52
|
|
|
38
53
|
- No merge without tests, coverage, typecheck, lint/format, and determinism green.
|
package/README.es.md
CHANGED
|
@@ -727,7 +727,7 @@ Consulta [docs/compatibility.md](docs/compatibility.md). Resumen verificado el `
|
|
|
727
727
|
|
|
728
728
|
| Superficie | Versión / contrato |
|
|
729
729
|
| --- | --- |
|
|
730
|
-
| openteam | `0.1.
|
|
730
|
+
| openteam | `0.1.41`; versión actual del paquete |
|
|
731
731
|
| `@opencode-ai/plugin` | `1.17.13` |
|
|
732
732
|
| `@opencode-ai/sdk` | `1.17.13` |
|
|
733
733
|
| Hook de routing | `chat.message`; no `chat.params` para cambiar modelo |
|
package/README.md
CHANGED
|
@@ -344,7 +344,7 @@ See [docs/compatibility.md](docs/compatibility.md). Verified summary as of `2026
|
|
|
344
344
|
|
|
345
345
|
| Surface | Version / contract |
|
|
346
346
|
| --- | --- |
|
|
347
|
-
| openteam | `0.1.
|
|
347
|
+
| openteam | `0.1.41`; current package version |
|
|
348
348
|
| `@opencode-ai/plugin` | `1.17.13` |
|
|
349
349
|
| `@opencode-ai/sdk` | `1.17.13` |
|
|
350
350
|
| Routing hook | `chat.message`; not `chat.params` for model changes |
|
package/dist/cli.js
CHANGED
|
@@ -628,6 +628,11 @@ var PrivacyModeSchema = z3.enum([
|
|
|
628
628
|
"off"
|
|
629
629
|
]);
|
|
630
630
|
var BaselineModeSchema = z3.enum(["auto", "pinned"]);
|
|
631
|
+
var GraphModeSchema = z3.enum(["off", "shadow", "active"]);
|
|
632
|
+
var GraphConfigSchema = z3.object({
|
|
633
|
+
mode: GraphModeSchema.default("off"),
|
|
634
|
+
killSwitch: z3.boolean().default(false)
|
|
635
|
+
});
|
|
631
636
|
var ConsoleHostSchema = z3.enum(["127.0.0.1", "localhost"]);
|
|
632
637
|
var ConsoleConfigSchema = z3.object({
|
|
633
638
|
host: ConsoleHostSchema.default("127.0.0.1"),
|
|
@@ -769,7 +774,8 @@ var OpenTeamConfigObjectSchema = z3.object({
|
|
|
769
774
|
privacyMode: PrivacyModeSchema.default("forceLocalOnSensitive"),
|
|
770
775
|
console: ConsoleConfigSchema,
|
|
771
776
|
storage: StorageConfigSchema,
|
|
772
|
-
memory: MemoryConfigSchema.optional()
|
|
777
|
+
memory: MemoryConfigSchema.optional(),
|
|
778
|
+
graph: GraphConfigSchema.optional()
|
|
773
779
|
});
|
|
774
780
|
var OpenTeamConfigSchema = OpenTeamConfigObjectSchema;
|
|
775
781
|
function resolveMemorySemantic(config) {
|
|
@@ -5123,9 +5129,40 @@ async function runSetup(deps) {
|
|
|
5123
5129
|
}
|
|
5124
5130
|
}
|
|
5125
5131
|
|
|
5132
|
+
// src/config/migrations.ts
|
|
5133
|
+
var CURRENT_CONFIG_VERSION = 1;
|
|
5134
|
+
|
|
5135
|
+
class ConfigMigrationError extends Error {
|
|
5136
|
+
code;
|
|
5137
|
+
detail;
|
|
5138
|
+
constructor(code, detail) {
|
|
5139
|
+
super(`${code}: ${detail}`);
|
|
5140
|
+
this.name = "ConfigMigrationError";
|
|
5141
|
+
this.code = code;
|
|
5142
|
+
this.detail = detail;
|
|
5143
|
+
}
|
|
5144
|
+
}
|
|
5145
|
+
function migrateConfig(raw) {
|
|
5146
|
+
if (typeof raw !== "object" || raw === null) {
|
|
5147
|
+
return raw;
|
|
5148
|
+
}
|
|
5149
|
+
const record = raw;
|
|
5150
|
+
const version = record.configVersion;
|
|
5151
|
+
if (version === undefined) {
|
|
5152
|
+
return { ...record, configVersion: CURRENT_CONFIG_VERSION };
|
|
5153
|
+
}
|
|
5154
|
+
if (typeof version !== "number" || !Number.isInteger(version) || version < 1) {
|
|
5155
|
+
throw new ConfigMigrationError("unknown-version", String(version));
|
|
5156
|
+
}
|
|
5157
|
+
if (version > CURRENT_CONFIG_VERSION) {
|
|
5158
|
+
throw new ConfigMigrationError("unsupported-version", String(version));
|
|
5159
|
+
}
|
|
5160
|
+
return record;
|
|
5161
|
+
}
|
|
5162
|
+
|
|
5126
5163
|
// src/config/load.ts
|
|
5127
5164
|
function loadOpenTeamConfig(raw) {
|
|
5128
|
-
return OpenTeamConfigSchema.parse(raw ?? {});
|
|
5165
|
+
return OpenTeamConfigSchema.parse(migrateConfig(raw ?? {}));
|
|
5129
5166
|
}
|
|
5130
5167
|
|
|
5131
5168
|
// src/memory/types.ts
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ConfigSource } from "../config/resolve";
|
|
2
|
+
import type { GraphMode } from "../config/schema";
|
|
3
|
+
import type { LeaseRecord } from "../storage/graph/workspaceLease";
|
|
4
|
+
/**
|
|
5
|
+
* GE-045 — operator commands for the graph runtime as pure dry-run plans.
|
|
6
|
+
*
|
|
7
|
+
* These functions never touch I/O: the caller reads the journal, lease, and
|
|
8
|
+
* config health, hands a settled snapshot here, and this module renders the
|
|
9
|
+
* operator view and decides which action is safe. Execution (recover/cancel)
|
|
10
|
+
* happens in the wiring layer only when a plan authorises it.
|
|
11
|
+
*
|
|
12
|
+
* Safety contract:
|
|
13
|
+
* - Commands are idempotent: a settled state plans `none`.
|
|
14
|
+
* - Recovering a corrupt journal is blocked unless the operator explicitly
|
|
15
|
+
* acknowledges the unsafe reconciliation.
|
|
16
|
+
* - Cancelling a run held by another holder (a stale takeover) is blocked
|
|
17
|
+
* unless the operator explicitly forces it.
|
|
18
|
+
*/
|
|
19
|
+
/** Health of the on-disk journal tail as classified by recovery. */
|
|
20
|
+
export type GraphJournalHealth = "clean" | "recovered" | "corrupt";
|
|
21
|
+
/** Settled, side-effect-free view of the graph runtime for the operator. */
|
|
22
|
+
export type GraphHealthSnapshot = {
|
|
23
|
+
/** Where the effective graph config was resolved from. */
|
|
24
|
+
readonly source: ConfigSource;
|
|
25
|
+
/** Effective graph mode after config resolution. */
|
|
26
|
+
readonly effectiveMode: GraphMode;
|
|
27
|
+
/** Current workspace lease, or `undefined` when no run is active. */
|
|
28
|
+
readonly lease: LeaseRecord | undefined;
|
|
29
|
+
/** Journal tail health. */
|
|
30
|
+
readonly journal: GraphJournalHealth;
|
|
31
|
+
/** Committed effects still awaiting a receipt. */
|
|
32
|
+
readonly pendingEffects: number;
|
|
33
|
+
/** Effects whose outcome is unknown and require reconciliation. */
|
|
34
|
+
readonly unknownEffects: number;
|
|
35
|
+
};
|
|
36
|
+
/** Action an operator command would take, decided without executing it. */
|
|
37
|
+
export type GraphActionKind = "none" | "recover" | "cancel" | "blocked";
|
|
38
|
+
/** Result of planning an operator command. */
|
|
39
|
+
export type GraphActionPlan = {
|
|
40
|
+
/** What the command would do. */
|
|
41
|
+
readonly kind: GraphActionKind;
|
|
42
|
+
/** Stable machine-readable reason for the decision. */
|
|
43
|
+
readonly reason: string;
|
|
44
|
+
/** `true` when the action preserves invariants without operator override. */
|
|
45
|
+
readonly safe: boolean;
|
|
46
|
+
};
|
|
47
|
+
/** Options for planning a journal recovery. */
|
|
48
|
+
export type GraphRecoverOptions = {
|
|
49
|
+
/** Operator explicitly accepts an unsafe reconciliation of a corrupt tail. */
|
|
50
|
+
readonly acknowledgeUnsafe?: boolean;
|
|
51
|
+
};
|
|
52
|
+
/** Options for planning a run cancellation. */
|
|
53
|
+
export type GraphCancelOptions = {
|
|
54
|
+
/** Identity of the operator requesting the cancel. */
|
|
55
|
+
readonly holder: string;
|
|
56
|
+
/** Operator explicitly accepts taking over a run held by someone else. */
|
|
57
|
+
readonly force?: boolean;
|
|
58
|
+
};
|
|
59
|
+
/** Render the operator-facing status view of a graph health snapshot. */
|
|
60
|
+
export declare function renderGraphStatus(snapshot: GraphHealthSnapshot): string;
|
|
61
|
+
/** Decide whether recovering the journal tail is a safe, idempotent action. */
|
|
62
|
+
export declare function planGraphRecover(snapshot: GraphHealthSnapshot, options?: GraphRecoverOptions): GraphActionPlan;
|
|
63
|
+
/** Decide whether cancelling the active run is a safe, idempotent action. */
|
|
64
|
+
export declare function planGraphCancel(snapshot: GraphHealthSnapshot, options: GraphCancelOptions): GraphActionPlan;
|
|
65
|
+
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../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B,GAAG;IAC/B,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAUF,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,CAkBvE;AAED,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,GAAE,mBAAwB,GAChC,eAAe,CAejB;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE,kBAAkB,GAC1B,eAAe,CAejB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,UAAU,CAAC;AAErE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,CAE/D;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,SAA4B,EAChC,OAAO,GAAE,eAAwD,GAChE,OAAO,CAAC,cAAc,CAAC,CAMzB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migración **versionada** de la config de openteam (GE-040).
|
|
3
|
+
*
|
|
4
|
+
* La config declara opcionalmente `configVersion`. Cuando falta se asume la
|
|
5
|
+
* versión actual (config legacy). Una versión no entera/positiva es
|
|
6
|
+
* `unknown-version`; una versión futura mayor que la soportada es
|
|
7
|
+
* `unsupported-version`. La migración es pura: normaliza la entrada para el
|
|
8
|
+
* parseo de esquema y **falla cerrado** ante versiones no soportadas, de modo
|
|
9
|
+
* que CLI y plugin comparten exactamente la misma resolución.
|
|
10
|
+
*/
|
|
11
|
+
/** Versión de config soportada por esta build. */
|
|
12
|
+
export declare const CURRENT_CONFIG_VERSION: 1;
|
|
13
|
+
/** Código de fallo de migración de config. */
|
|
14
|
+
export type ConfigMigrationErrorCode = "unknown-version" | "unsupported-version";
|
|
15
|
+
/** Error tipado de una migración de config rechazada. */
|
|
16
|
+
export declare class ConfigMigrationError extends Error {
|
|
17
|
+
readonly code: ConfigMigrationErrorCode;
|
|
18
|
+
readonly detail: string;
|
|
19
|
+
constructor(code: ConfigMigrationErrorCode, detail: string);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Normaliza la config cruda a la versión actual. Devuelve la entrada intacta si
|
|
23
|
+
* no es un objeto (el parseo de esquema la rechazará); en caso contrario valida
|
|
24
|
+
* `configVersion` y falla cerrado ante versiones desconocidas o futuras.
|
|
25
|
+
*/
|
|
26
|
+
export declare function migrateConfig(raw: unknown): unknown;
|
|
27
|
+
//# sourceMappingURL=migrations.d.ts.map
|
|
@@ -0,0 +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;gBAEZ,IAAI,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM;CAM3D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAoBnD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { GraphMode, OpenTeamConfig } from "./schema";
|
|
2
|
+
/**
|
|
3
|
+
* Resolver **efectivo** y compartido de la config de Graph (GE-040).
|
|
4
|
+
*
|
|
5
|
+
* CLI y plugin resuelven a través de esta única función, así que una misma
|
|
6
|
+
* config produce exactamente el mismo resultado en ambos. Reglas:
|
|
7
|
+
*
|
|
8
|
+
* - **Default off**: sin sección `graph`, el modo efectivo es `off`.
|
|
9
|
+
* - **Kill switch en vivo**: si `killSwitch` está activo, el modo efectivo es
|
|
10
|
+
* `off` sea cual sea el modo configurado.
|
|
11
|
+
* - **Shadow sin executor**: solo `active` habilita el executor; `shadow` y
|
|
12
|
+
* `off` no reciben executor.
|
|
13
|
+
* - **Fuente visible**: el origen de la config se propaga al resultado.
|
|
14
|
+
*
|
|
15
|
+
* Puro: sin I/O, reloj ni estado global.
|
|
16
|
+
*/
|
|
17
|
+
/** Origen de la config resuelta (para trazabilidad/observabilidad). */
|
|
18
|
+
export type ConfigSource = "file" | "inline" | "default";
|
|
19
|
+
/** Resolución efectiva de la config de Graph. */
|
|
20
|
+
export type ResolvedGraphConfig = {
|
|
21
|
+
/** Modo declarado en la config (default `off`). */
|
|
22
|
+
readonly configuredMode: GraphMode;
|
|
23
|
+
/** Modo efectivo tras aplicar el kill switch. */
|
|
24
|
+
readonly effectiveMode: GraphMode;
|
|
25
|
+
/** Solo `active` habilita el executor. */
|
|
26
|
+
readonly executorEnabled: boolean;
|
|
27
|
+
/** Kill switch en vivo. */
|
|
28
|
+
readonly killSwitch: boolean;
|
|
29
|
+
/** Origen de la config. */
|
|
30
|
+
readonly source: ConfigSource;
|
|
31
|
+
};
|
|
32
|
+
/** Resuelve la config de Graph efectiva a partir de la config y su origen. */
|
|
33
|
+
export declare function resolveGraphConfig(config: OpenTeamConfig, source: ConfigSource): ResolvedGraphConfig;
|
|
34
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +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;;;;;;;;;;;;;;GAcG;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,iDAAiD;IACjD,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;CAC/B,CAAC;AAEF,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,YAAY,GACnB,mBAAmB,CAWrB"}
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -17,6 +17,27 @@ export declare const BaselineModeSchema: z.ZodEnum<{
|
|
|
17
17
|
auto: "auto";
|
|
18
18
|
pinned: "pinned";
|
|
19
19
|
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Modo del subsistema Graph (GE-040). `off` mantiene el camino legacy; `shadow`
|
|
22
|
+
* observa sin ejecutar efectos; `active` habilita el executor. Default `off`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const GraphModeSchema: z.ZodEnum<{
|
|
25
|
+
off: "off";
|
|
26
|
+
shadow: "shadow";
|
|
27
|
+
active: "active";
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Sección `graph` de la config. Opcional: cuando falta, el resolver aplica
|
|
31
|
+
* `off`. Un `killSwitch` en vivo fuerza `off` sea cual sea el modo configurado.
|
|
32
|
+
*/
|
|
33
|
+
export declare const GraphConfigSchema: z.ZodObject<{
|
|
34
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
35
|
+
off: "off";
|
|
36
|
+
shadow: "shadow";
|
|
37
|
+
active: "active";
|
|
38
|
+
}>>;
|
|
39
|
+
killSwitch: z.ZodDefault<z.ZodBoolean>;
|
|
40
|
+
}, z.core.$strip>;
|
|
20
41
|
export declare const ConsoleHostSchema: z.ZodEnum<{
|
|
21
42
|
"127.0.0.1": "127.0.0.1";
|
|
22
43
|
localhost: "localhost";
|
|
@@ -298,6 +319,14 @@ export declare const OpenTeamConfigObjectSchema: z.ZodObject<{
|
|
|
298
319
|
}, z.core.$strip>>;
|
|
299
320
|
}, z.core.$strip>>;
|
|
300
321
|
}, z.core.$strip>>;
|
|
322
|
+
graph: z.ZodOptional<z.ZodObject<{
|
|
323
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
324
|
+
off: "off";
|
|
325
|
+
shadow: "shadow";
|
|
326
|
+
active: "active";
|
|
327
|
+
}>>;
|
|
328
|
+
killSwitch: z.ZodDefault<z.ZodBoolean>;
|
|
329
|
+
}, z.core.$strip>>;
|
|
301
330
|
}, z.core.$strip>;
|
|
302
331
|
/** Esquema público de la config de openteam. */
|
|
303
332
|
export declare const OpenTeamConfigSchema: z.ZodObject<{
|
|
@@ -424,10 +453,20 @@ export declare const OpenTeamConfigSchema: z.ZodObject<{
|
|
|
424
453
|
}, z.core.$strip>>;
|
|
425
454
|
}, z.core.$strip>>;
|
|
426
455
|
}, z.core.$strip>>;
|
|
456
|
+
graph: z.ZodOptional<z.ZodObject<{
|
|
457
|
+
mode: z.ZodDefault<z.ZodEnum<{
|
|
458
|
+
off: "off";
|
|
459
|
+
shadow: "shadow";
|
|
460
|
+
active: "active";
|
|
461
|
+
}>>;
|
|
462
|
+
killSwitch: z.ZodDefault<z.ZodBoolean>;
|
|
463
|
+
}, z.core.$strip>>;
|
|
427
464
|
}, z.core.$strip>;
|
|
428
465
|
export type ModelRef = z.infer<typeof ModelRefSchema>;
|
|
429
466
|
export type RouterMode = z.infer<typeof RouterModeSchema>;
|
|
430
467
|
export type PrivacyMode = z.infer<typeof PrivacyModeSchema>;
|
|
468
|
+
export type GraphMode = z.infer<typeof GraphModeSchema>;
|
|
469
|
+
export type GraphConfig = z.infer<typeof GraphConfigSchema>;
|
|
431
470
|
export type OpenTeamConfig = z.infer<typeof OpenTeamConfigSchema>;
|
|
432
471
|
export type LocalRuntime = z.infer<typeof LocalRuntimeSchema>;
|
|
433
472
|
export type ConsoleConfig = z.infer<typeof ConsoleConfigSchema>;
|
|
@@ -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,eAAO,MAAM,iBAAiB;;;EAAqC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;kBAmC5B,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,0BAA0B;;;EAGrC,CAAC;AACH,eAAO,MAAM,8BAA8B;;;EAA4B,CAAC;AAExE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkD7B,CAAC;AAEL;;;;GAIG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ACrB,oBAAoB,CAEtB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ContextRef, ManifestEntry } from "./schema";
|
|
2
|
+
/**
|
|
3
|
+
* Utilidades de **redacción** del seam de contexto.
|
|
4
|
+
*
|
|
5
|
+
* Calcula digests SHA-256 estables y construye entradas de manifiesto a partir
|
|
6
|
+
* de contenido en memoria **sin persistirlo**. También ofrece un guard que
|
|
7
|
+
* rechaza estructuras con campos de contenido crudo, para mantener journal,
|
|
8
|
+
* snapshots y telemetría solo con referencias.
|
|
9
|
+
*
|
|
10
|
+
* Cómputo determinista: `node:crypto` y `Buffer` no son I/O, reloj ni random.
|
|
11
|
+
*/
|
|
12
|
+
/** Error tipado de una violación de la política reference-only. */
|
|
13
|
+
export declare class RedactionError extends Error {
|
|
14
|
+
readonly code: "raw-content";
|
|
15
|
+
readonly key: string;
|
|
16
|
+
constructor(key: string);
|
|
17
|
+
}
|
|
18
|
+
/** Digest SHA-256 en hex minúscula de una cadena UTF-8. */
|
|
19
|
+
export declare function sha256Hex(input: string): string;
|
|
20
|
+
/** Par digest + tamaño en bytes UTF-8 de un contenido en memoria. */
|
|
21
|
+
export type Digest = {
|
|
22
|
+
sha256: string;
|
|
23
|
+
bytes: number;
|
|
24
|
+
};
|
|
25
|
+
/** Deriva el digest y el tamaño UTF-8 de un contenido, sin almacenarlo. */
|
|
26
|
+
export declare function digestUtf8(text: string): Digest;
|
|
27
|
+
/**
|
|
28
|
+
* Construye una entrada de manifiesto redactada a partir de contenido en
|
|
29
|
+
* memoria. Incluye la `ContextRef` solo si se aporta una referencia estable.
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildManifestEntry(label: string, text: string, ref?: ContextRef): ManifestEntry;
|
|
32
|
+
/**
|
|
33
|
+
* Proyección **reference-only** de una `ContextRef`: solo localización lógica,
|
|
34
|
+
* digest y tamaño. Descarta `mediaType` para mantener la telemetría acotada;
|
|
35
|
+
* nunca transporta contenido.
|
|
36
|
+
*/
|
|
37
|
+
export declare function redactedRef(ref: ContextRef): {
|
|
38
|
+
uri: string;
|
|
39
|
+
sha256: string;
|
|
40
|
+
bytes: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Recorre una estructura y lanza `RedactionError` si encuentra alguna clave de
|
|
44
|
+
* contenido crudo. Guard barato para journal/snapshots/telemetría; no valida
|
|
45
|
+
* esquema, solo ausencia de campos crudos.
|
|
46
|
+
*/
|
|
47
|
+
export declare function assertReferenceOnly(value: unknown): void;
|
|
48
|
+
//# sourceMappingURL=redaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redaction.d.ts","sourceRoot":"","sources":["../../src/context/redaction.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE1D;;;;;;;;;GASG;AAEH,mEAAmE;AACnE,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;gBAET,GAAG,EAAE,MAAM;CAMxB;AAED,2DAA2D;AAC3D,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,qEAAqE;AACrE,MAAM,MAAM,MAAM,GAAG;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK/C;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,UAAU,GACf,aAAa,CAKf;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAEA;AAgBD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAkBxD"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Esquemas Zod del **seam de contexto** de Graph V1.
|
|
4
|
+
*
|
|
5
|
+
* Este módulo es la capa base pura: define referencias, digests y clases de
|
|
6
|
+
* privacidad que el resto de Graph consume. Solo transporta **referencias y
|
|
7
|
+
* digests**; nunca contenido crudo (brief, prompt, findings o salida del
|
|
8
|
+
* modelo). Todos los objetos usan `.strict()`, de modo que cualquier campo
|
|
9
|
+
* desconocido —incluidos campos de contenido crudo— falla con un error tipado.
|
|
10
|
+
*
|
|
11
|
+
* Prohibido en `src/context/**`: Prefill, llamadas al modelo, cache warming,
|
|
12
|
+
* filesystem y telemetría. `sha256Hex`/`digestUtf8` viven en `redaction.ts` y
|
|
13
|
+
* solo hacen cómputo determinista.
|
|
14
|
+
*/
|
|
15
|
+
/** Clase de privacidad de un artefacto o contrato de contexto. */
|
|
16
|
+
export declare const PrivacyClassSchema: z.ZodEnum<{
|
|
17
|
+
public: "public";
|
|
18
|
+
internal: "internal";
|
|
19
|
+
sensitive: "sensitive";
|
|
20
|
+
}>;
|
|
21
|
+
export type PrivacyClass = z.infer<typeof PrivacyClassSchema>;
|
|
22
|
+
/** Digest SHA-256 en hex minúscula (exactamente 64 caracteres). */
|
|
23
|
+
export declare const Sha256Schema: z.ZodString;
|
|
24
|
+
export type Sha256 = z.infer<typeof Sha256Schema>;
|
|
25
|
+
/**
|
|
26
|
+
* Identificador estable (taskID, etiquetas de manifiesto). No es contenido:
|
|
27
|
+
* charset acotado y longitud limitada para mantener el seam determinista.
|
|
28
|
+
*/
|
|
29
|
+
export declare const IdentifierSchema: z.ZodString;
|
|
30
|
+
export type Identifier = z.infer<typeof IdentifierSchema>;
|
|
31
|
+
/**
|
|
32
|
+
* `TaskAnchor` — referencia estable a la tarea/spec que ancla un nodo. Solo
|
|
33
|
+
* identificador y digest; nunca contenido.
|
|
34
|
+
*/
|
|
35
|
+
export declare const TaskAnchorSchema: z.ZodObject<{
|
|
36
|
+
taskID: z.ZodString;
|
|
37
|
+
specDigest: z.ZodString;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
export type TaskAnchor = z.infer<typeof TaskAnchorSchema>;
|
|
40
|
+
/**
|
|
41
|
+
* `ContextRef` — referencia acotada a contenido por digest. No transporta el
|
|
42
|
+
* contenido: solo su localización lógica, digest SHA-256 y tamaño en bytes.
|
|
43
|
+
*/
|
|
44
|
+
export declare const ContextRefSchema: z.ZodObject<{
|
|
45
|
+
uri: z.ZodString;
|
|
46
|
+
sha256: z.ZodString;
|
|
47
|
+
bytes: z.ZodNumber;
|
|
48
|
+
mediaType: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
export type ContextRef = z.infer<typeof ContextRefSchema>;
|
|
51
|
+
/**
|
|
52
|
+
* Entrada de un manifiesto de artefactos: etiqueta estable, digest y tamaño;
|
|
53
|
+
* opcionalmente una `ContextRef` estable cuando el input persiste como
|
|
54
|
+
* referencia revalidable. Nunca lleva título, extracto ni contenido.
|
|
55
|
+
*/
|
|
56
|
+
export declare const ManifestEntrySchema: z.ZodObject<{
|
|
57
|
+
label: z.ZodString;
|
|
58
|
+
sha256: z.ZodString;
|
|
59
|
+
bytes: z.ZodNumber;
|
|
60
|
+
ref: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
uri: z.ZodString;
|
|
62
|
+
sha256: z.ZodString;
|
|
63
|
+
bytes: z.ZodNumber;
|
|
64
|
+
mediaType: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strict>>;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
export type ManifestEntry = z.infer<typeof ManifestEntrySchema>;
|
|
68
|
+
/**
|
|
69
|
+
* Manifiesto redactado de inputs seleccionados: versión, taskID, clase de
|
|
70
|
+
* privacidad y entradas ordenadas. El orden más los digests bastan para probar
|
|
71
|
+
* exactamente qué inputs se seleccionaron, sin exponer su contenido.
|
|
72
|
+
*/
|
|
73
|
+
export declare const ArtifactManifestSchema: z.ZodObject<{
|
|
74
|
+
version: z.ZodLiteral<1>;
|
|
75
|
+
taskID: z.ZodString;
|
|
76
|
+
privacyClass: z.ZodEnum<{
|
|
77
|
+
public: "public";
|
|
78
|
+
internal: "internal";
|
|
79
|
+
sensitive: "sensitive";
|
|
80
|
+
}>;
|
|
81
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
82
|
+
label: z.ZodString;
|
|
83
|
+
sha256: z.ZodString;
|
|
84
|
+
bytes: z.ZodNumber;
|
|
85
|
+
ref: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
uri: z.ZodString;
|
|
87
|
+
sha256: z.ZodString;
|
|
88
|
+
bytes: z.ZodNumber;
|
|
89
|
+
mediaType: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strict>>;
|
|
91
|
+
}, z.core.$strict>>;
|
|
92
|
+
}, z.core.$strict>;
|
|
93
|
+
export type ArtifactManifest = z.infer<typeof ArtifactManifestSchema>;
|
|
94
|
+
/**
|
|
95
|
+
* `NodeContextContract` — único seam de contexto de V1. Identifica referencias
|
|
96
|
+
* acotadas y digests; no hace fetch, prefill, warm, cache, summarize ni reserva
|
|
97
|
+
* de tokens.
|
|
98
|
+
*/
|
|
99
|
+
export declare const NodeContextContractSchema: z.ZodObject<{
|
|
100
|
+
version: z.ZodLiteral<1>;
|
|
101
|
+
refs: z.ZodArray<z.ZodObject<{
|
|
102
|
+
uri: z.ZodString;
|
|
103
|
+
sha256: z.ZodString;
|
|
104
|
+
bytes: z.ZodNumber;
|
|
105
|
+
mediaType: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, z.core.$strict>>;
|
|
107
|
+
privacyClass: z.ZodEnum<{
|
|
108
|
+
public: "public";
|
|
109
|
+
internal: "internal";
|
|
110
|
+
sensitive: "sensitive";
|
|
111
|
+
}>;
|
|
112
|
+
maxInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
export type NodeContextContract = z.infer<typeof NodeContextContractSchema>;
|
|
115
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/context/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;GAYG;AAEH,kEAAkE;AAClE,eAAO,MAAM,kBAAkB;;;;EAA8C,CAAC;AAC9E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,mEAAmE;AACnE,eAAO,MAAM,YAAY,aAEmC,CAAC;AAC7D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,aAIkC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;kBAKlB,CAAC;AACZ,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;kBAOlB,CAAC;AACZ,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;kBAOrB,CAAC;AACZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;kBAOxB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;kBAO3B,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Superficie de tipos del seam de contexto. Reexporta los tipos inferidos de
|
|
3
|
+
* los esquemas Zod para que el resto de Graph importe tipos sin acoplarse al
|
|
4
|
+
* detalle de validación, y expone el tipo `Digest` de `redaction.ts`.
|
|
5
|
+
*/
|
|
6
|
+
export type { Digest } from "./redaction";
|
|
7
|
+
export type { ArtifactManifest, ContextRef, Identifier, ManifestEntry, NodeContextContract, PrivacyClass, Sha256, TaskAnchor, } from "./schema";
|
|
8
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/context/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,MAAM,EACN,UAAU,GACX,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ContextRef } from "../context/schema";
|
|
2
|
+
import type { ErrorClass, GraphEventType, GraphEventV1 } from "./schema";
|
|
3
|
+
/**
|
|
4
|
+
* Constructores y type guards para el sobre de eventos de Graph V1.
|
|
5
|
+
*
|
|
6
|
+
* Los constructores producen literales ya conformes al esquema (no validan;
|
|
7
|
+
* validar es `parseGraphEvent`). Puro: sin I/O ni estado global.
|
|
8
|
+
*/
|
|
9
|
+
/** Lista exhaustiva de tipos de evento, en orden estable. */
|
|
10
|
+
export declare const EVENT_TYPES: readonly GraphEventType[];
|
|
11
|
+
export declare function runStarted(runID: string, seq: number, specDigest: string): GraphEventV1;
|
|
12
|
+
export declare function nodeDispatched(runID: string, seq: number, nodeID: string, operationID: string, attemptID: string): GraphEventV1;
|
|
13
|
+
export declare function nodeSucceeded(runID: string, seq: number, nodeID: string, operationID: string, attemptID: string, artifact: ContextRef): GraphEventV1;
|
|
14
|
+
export declare function nodeFailed(runID: string, seq: number, nodeID: string, operationID: string, attemptID: string, errorClass: ErrorClass): GraphEventV1;
|
|
15
|
+
export declare function nodeCancelled(runID: string, seq: number, nodeID: string): GraphEventV1;
|
|
16
|
+
export declare function runCompleted(runID: string, seq: number): GraphEventV1;
|
|
17
|
+
export declare function runFailed(runID: string, seq: number): GraphEventV1;
|
|
18
|
+
export declare function runCancelled(runID: string, seq: number): GraphEventV1;
|
|
19
|
+
/** Evento que afecta a un nodo concreto (lleva `nodeID`). */
|
|
20
|
+
export type NodeEvent = Extract<GraphEventV1, {
|
|
21
|
+
nodeID: string;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function isNodeEvent(event: GraphEventV1): event is NodeEvent;
|
|
24
|
+
export declare function isRunEvent(event: GraphEventV1): boolean;
|
|
25
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/graph/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGzE;;;;;GAKG;AAEH,6DAA6D;AAC7D,eAAO,MAAM,WAAW,EAAE,SAAS,cAAc,EAShD,CAAC;AAEF,wBAAgB,UAAU,CACxB,K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,5 @@
|
|
|
1
|
+
/** ID estable del efecto de un nodo, opcionalmente por revisión. */
|
|
2
|
+
export declare function operationID(runID: string, nodeID: string, revision?: number): string;
|
|
3
|
+
/** ID del intento `attempt` (>= 0) de una operación dada. */
|
|
4
|
+
export declare function attemptID(operation: string, attempt: number): string;
|
|
5
|
+
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../src/graph/ids.ts"],"names":[],"mappings":"AAYA,oEAAoE;AACpE,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,QAAQ,SAAI,GACX,MAAM,CAKR;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GraphSpecV1 } from "./schema";
|
|
2
|
+
import type { GraphState, ReadyNode } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Planificador determinista del conjunto listo (ready-set).
|
|
5
|
+
*
|
|
6
|
+
* Un nodo está listo si el run sigue `running`, el nodo está `pending` y todas
|
|
7
|
+
* sus dependencias están `succeeded`. El orden es estable (por id). La
|
|
8
|
+
* cancelación del run —o de una dependencia— bloquea el despacho. IDs
|
|
9
|
+
* reproducibles vía `ids.ts`. Puro: sin I/O, reloj ni random.
|
|
10
|
+
*/
|
|
11
|
+
/** IDs de nodo listos, en orden estable. */
|
|
12
|
+
export declare function readyNodeIDs(spec: GraphSpecV1, state: GraphState): string[];
|
|
13
|
+
/** Plan de despacho: nodos listos con sus IDs deterministas de operación. */
|
|
14
|
+
export declare function plan(spec: GraphSpecV1, state: GraphState): ReadyNode[];
|
|
15
|
+
//# sourceMappingURL=planner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner.d.ts","sourceRoot":"","sources":["../../src/graph/planner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;;;GAOG;AAEH,4CAA4C;AAC5C,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,CAiB3E;AAED,6EAA6E;AAC7E,wBAAgB,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,GAAG,SAAS,EAAE,CAUtE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ErrorClass } from "./schema";
|
|
2
|
+
/**
|
|
3
|
+
* Políticas puras de transición y reintento. Deterministas: sin reloj, jitter
|
|
4
|
+
* oculto ni random. Incluye la taxonomía reutilizable, el límite por defecto y
|
|
5
|
+
* el backoff determinista (GE-033); el runtime aplica límites y expone el
|
|
6
|
+
* retardo sin dormir por su cuenta.
|
|
7
|
+
*/
|
|
8
|
+
/** Límite de intentos por defecto para un error reintentable. */
|
|
9
|
+
export declare const DEFAULT_RETRY_LIMIT = 3;
|
|
10
|
+
/** Número de revisiones por defecto que puede encadenar un rechazo (GE-036). */
|
|
11
|
+
export declare const DEFAULT_REVISION_LIMIT = 2;
|
|
12
|
+
/**
|
|
13
|
+
* `true` si se permite otra revisión: `currentRevision` (revisiones ya hechas,
|
|
14
|
+
* 0 la implementación inicial) aún no alcanza el límite. Determinista.
|
|
15
|
+
*/
|
|
16
|
+
export declare function revisionAllowed(currentRevision: number, limit?: number): boolean;
|
|
17
|
+
/** Base en milisegundos del backoff exponencial determinista. */
|
|
18
|
+
export declare const DEFAULT_BACKOFF_BASE_MS = 100;
|
|
19
|
+
/**
|
|
20
|
+
* Retardo determinista (ms) antes del intento `attempt` (índice basado en 0).
|
|
21
|
+
* El primer intento (`attempt <= 0`) no espera; a partir de ahí crece de forma
|
|
22
|
+
* exponencial (`base * 2^(attempt-1)`). Función pura: sin reloj, jitter ni
|
|
23
|
+
* random, de modo que la misma secuencia se reproduce tras un reinicio. El
|
|
24
|
+
* runtime la expone en el resultado del paso; no duerme por su cuenta.
|
|
25
|
+
*/
|
|
26
|
+
export declare function backoffDelayMs(attempt: number, baseMs?: number): number;
|
|
27
|
+
/** `true` si la clase de error justifica un reintento con nuevo intento. */
|
|
28
|
+
export declare function isRetryableError(errorClass: ErrorClass): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* `true` si se permite otro intento: el error es reintentable y aún no se han
|
|
31
|
+
* agotado los intentos. `attempts` es el número de intentos ya consumidos.
|
|
32
|
+
*/
|
|
33
|
+
export declare function retryAllowed(errorClass: ErrorClass, attempts: number, limit?: number): boolean;
|
|
34
|
+
//# sourceMappingURL=policies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../../src/graph/policies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;GAKG;AAEH,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,gFAAgF;AAChF,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,eAAe,EAAE,MAAM,EACvB,KAAK,GAAE,MAA+B,GACrC,OAAO,CAET;AAED,iEAAiE;AACjE,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAAgC,GACvC,MAAM,CAKR;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAEhE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,MAA4B,GAClC,OAAO,CAET"}
|