@agentium/harness 4.0.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.
Files changed (54) hide show
  1. package/README.md +488 -0
  2. package/dist/definition.d.ts +39 -0
  3. package/dist/definition.d.ts.map +1 -0
  4. package/dist/driver-BvzvqvpB.js +2049 -0
  5. package/dist/driver-Cr2BGG4h.cjs +2138 -0
  6. package/dist/drivers.d.ts +14 -0
  7. package/dist/drivers.d.ts.map +1 -0
  8. package/dist/index.cjs +1531 -0
  9. package/dist/index.d.ts +16 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +1500 -0
  12. package/dist/mcp-resources.d.ts +42 -0
  13. package/dist/mcp-resources.d.ts.map +1 -0
  14. package/dist/policies.d.ts +29 -0
  15. package/dist/policies.d.ts.map +1 -0
  16. package/dist/presets.d.ts +41 -0
  17. package/dist/presets.d.ts.map +1 -0
  18. package/dist/runtime/context-policy.d.ts +20 -0
  19. package/dist/runtime/context-policy.d.ts.map +1 -0
  20. package/dist/runtime/context.d.ts +15 -0
  21. package/dist/runtime/context.d.ts.map +1 -0
  22. package/dist/runtime/controller.d.ts +51 -0
  23. package/dist/runtime/controller.d.ts.map +1 -0
  24. package/dist/runtime/driver.d.ts +146 -0
  25. package/dist/runtime/driver.d.ts.map +1 -0
  26. package/dist/runtime/events.d.ts +83 -0
  27. package/dist/runtime/events.d.ts.map +1 -0
  28. package/dist/runtime/index.d.ts +9 -0
  29. package/dist/runtime/index.d.ts.map +1 -0
  30. package/dist/runtime/middleware.d.ts +10 -0
  31. package/dist/runtime/middleware.d.ts.map +1 -0
  32. package/dist/runtime/resolve.d.ts +20 -0
  33. package/dist/runtime/resolve.d.ts.map +1 -0
  34. package/dist/runtime/runtime-registry.d.ts +35 -0
  35. package/dist/runtime/runtime-registry.d.ts.map +1 -0
  36. package/dist/runtime/session-bindings.d.ts +60 -0
  37. package/dist/runtime/session-bindings.d.ts.map +1 -0
  38. package/dist/runtime/types.d.ts +176 -0
  39. package/dist/runtime/types.d.ts.map +1 -0
  40. package/dist/testing.cjs +67 -0
  41. package/dist/testing.d.ts +7 -0
  42. package/dist/testing.d.ts.map +1 -0
  43. package/dist/testing.js +66 -0
  44. package/dist/watch/definition.d.ts +11 -0
  45. package/dist/watch/definition.d.ts.map +1 -0
  46. package/dist/watch/gmail.d.ts +104 -0
  47. package/dist/watch/gmail.d.ts.map +1 -0
  48. package/dist/watch/quiet-hours.d.ts +10 -0
  49. package/dist/watch/quiet-hours.d.ts.map +1 -0
  50. package/dist/watch/runtime.d.ts +42 -0
  51. package/dist/watch/runtime.d.ts.map +1 -0
  52. package/dist/watch/types.d.ts +147 -0
  53. package/dist/watch/types.d.ts.map +1 -0
  54. package/package.json +68 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-bindings.d.ts","sourceRoot":"","sources":["../../src/runtime/session-bindings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,sBAAsB;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;IAC9C,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;CACrB;AACD,MAAM,WAAW,mBAAmB;IAClC,IAAI,IAAI,sBAAsB,CAAC;IAC/B,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,sBAAsB,EAAE,UAAU,CAAC,GAAG,IAAI,CAAC;IACjE,OAAO,IAAI,IAAI,CAAC;CACjB;AACD,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,IAAI,sBAA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E,MAAM,EACjB,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,EACjC,UAAU,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAC3C,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IA2D7B,YAAY,CAAC,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC;CAoB7F"}
@@ -0,0 +1,176 @@
1
+ import type { ChatMessage, ModelResponse, RunContext, ToolCallResult, ToolDef } from "@agentium/core";
2
+ import type { HarnessRuntimeBindings, HarnessRuntimeReferences, HarnessRuntimeRegistry } from "./runtime-registry.js";
3
+ export type JsonValue = null | boolean | number | string | JsonValue[] | {
4
+ [key: string]: JsonValue;
5
+ };
6
+ export type JsonObject = {
7
+ [key: string]: JsonValue;
8
+ };
9
+ export interface AbilitySelection {
10
+ instanceId: string;
11
+ type: string;
12
+ version: number;
13
+ options: JsonObject;
14
+ }
15
+ export interface HarnessDefaults {
16
+ workspace?: false | {
17
+ path: string;
18
+ mode: "read" | "write";
19
+ };
20
+ skillDirs?: readonly string[] | false;
21
+ contextFiles?: boolean;
22
+ filesystem?: boolean;
23
+ subagents?: boolean;
24
+ fileMemory?: boolean;
25
+ searchPastSessions?: boolean;
26
+ }
27
+ export interface HarnessManifest {
28
+ contractVersion: 1;
29
+ runtime?: HarnessRuntimeReferences;
30
+ id: string;
31
+ abilities: readonly AbilitySelection[];
32
+ defaults?: HarnessDefaults;
33
+ limits?: {
34
+ toolRoundtrips?: number;
35
+ maxChildDepth?: number;
36
+ };
37
+ }
38
+ export interface PromptFragment {
39
+ id: string;
40
+ text: string;
41
+ }
42
+ export interface HarnessContextBudget {
43
+ maxEntries: number;
44
+ maxBytes: number;
45
+ maxTokens?: number;
46
+ deadlineMs: number;
47
+ }
48
+ export interface HarnessContextEntry {
49
+ id: string;
50
+ text: string;
51
+ trust: "host" | "source";
52
+ source?: {
53
+ uri: string;
54
+ version?: string;
55
+ locator?: string;
56
+ };
57
+ expiresAt?: number;
58
+ estimatedTokens?: number;
59
+ byteLength: number;
60
+ }
61
+ export interface HarnessContextSource {
62
+ id: string;
63
+ fetch: (query: string, ctx: RunContext, budget: HarnessContextBudget) => Promise<readonly HarnessContextEntry[]>;
64
+ }
65
+ export interface HarnessMiddleware {
66
+ id: string;
67
+ before?: readonly string[];
68
+ after?: readonly string[];
69
+ beforeModel?: (messages: readonly ChatMessage[], ctx: RunContext) => Promise<ChatMessage[]>;
70
+ afterModel?: (response: ModelResponse, ctx: RunContext) => Promise<void>;
71
+ afterTool?: (result: ToolCallResult, ctx: RunContext) => Promise<void>;
72
+ }
73
+ export interface AbilityBinding {
74
+ tools: readonly ToolDef[];
75
+ promptFragments?: readonly PromptFragment[];
76
+ contextSources?: readonly HarnessContextSource[];
77
+ middleware?: readonly HarnessMiddleware[];
78
+ dispose?: () => Promise<void>;
79
+ }
80
+ export interface AbilityDescription {
81
+ toolNames: readonly string[];
82
+ requirements: readonly string[];
83
+ runtimeDependent?: boolean;
84
+ }
85
+ export interface AbilityFactory {
86
+ type: string;
87
+ version: number;
88
+ validateOptions: (input: JsonObject) => JsonObject;
89
+ describe: (options: JsonObject) => AbilityDescription;
90
+ bind: (options: JsonObject, ctx: RunContext) => Promise<AbilityBinding>;
91
+ }
92
+ export interface LocalAbilityUse {
93
+ instanceId: string;
94
+ validate: () => void;
95
+ describe: () => AbilityDescription;
96
+ bind: (ctx: RunContext) => Promise<AbilityBinding>;
97
+ portable?: AbilitySelection;
98
+ /** Trusted factory approved by the creator/host, never recovered from JSON. */
99
+ factory?: AbilityFactory;
100
+ }
101
+ export type HarnessDefinition = {
102
+ readonly kind: "portable";
103
+ readonly manifest: HarnessManifest;
104
+ readonly factories: readonly AbilityFactory[];
105
+ readonly runtimeRegistry?: HarnessRuntimeRegistry;
106
+ } | {
107
+ readonly kind: "local";
108
+ readonly id?: string;
109
+ readonly abilities: readonly LocalAbilityUse[];
110
+ readonly defaults?: HarnessDefaults;
111
+ readonly limits?: HarnessManifest["limits"];
112
+ readonly runtime?: HarnessRuntimeBindings;
113
+ readonly runtimeReferences?: HarnessRuntimeReferences;
114
+ readonly runtimeRegistry?: HarnessRuntimeRegistry;
115
+ };
116
+ export type HarnessDefinitionInput = HarnessDefinition | {
117
+ id?: string;
118
+ abilities?: readonly LocalAbilityUse[];
119
+ defaults?: HarnessDefaults;
120
+ limits?: HarnessManifest["limits"];
121
+ runtime?: HarnessRuntimeBindings;
122
+ runtimeReferences?: HarnessRuntimeReferences;
123
+ runtimeRegistry?: HarnessRuntimeRegistry;
124
+ };
125
+ export interface HarnessExtension {
126
+ runtime?: HarnessRuntimeBindings;
127
+ runtimeReferences?: HarnessRuntimeReferences;
128
+ runtimeRegistry?: HarnessRuntimeRegistry;
129
+ id?: string;
130
+ abilities?: readonly LocalAbilityUse[];
131
+ disable?: readonly string[];
132
+ replaceAbilities?: readonly LocalAbilityUse[];
133
+ defaults?: HarnessDefaults;
134
+ limits?: HarnessManifest["limits"];
135
+ }
136
+ export interface HarnessDiagnostic {
137
+ code: string;
138
+ path: string;
139
+ message: string;
140
+ severity: "info" | "warning" | "error";
141
+ }
142
+ export interface HarnessDescription {
143
+ id: string;
144
+ kind: "portable" | "local";
145
+ contractVersion: 1;
146
+ abilities: readonly (AbilityDescription & {
147
+ instanceId: string;
148
+ type?: string;
149
+ version?: number;
150
+ })[];
151
+ toolNames: readonly string[];
152
+ requirements: readonly string[];
153
+ runtimeDependent: boolean;
154
+ defaults: HarnessDefaults;
155
+ limits: NonNullable<HarnessManifest["limits"]>;
156
+ diagnostics: readonly HarnessDiagnostic[];
157
+ }
158
+ export interface HarnessProvenance {
159
+ path: string;
160
+ origin: string;
161
+ }
162
+ export interface ResolvedHarness {
163
+ readonly definition: HarnessDefinition;
164
+ readonly defaults: HarnessDefaults;
165
+ readonly limits: NonNullable<HarnessManifest["limits"]>;
166
+ readonly description: HarnessDescription;
167
+ readonly provenance: readonly HarnessProvenance[];
168
+ }
169
+ export interface BoundHarness {
170
+ readonly tools: ToolDef[];
171
+ readonly promptFragments: PromptFragment[];
172
+ readonly contextSources: HarnessContextSource[];
173
+ readonly middleware: HarnessMiddleware[];
174
+ dispose: () => Promise<readonly HarnessDiagnostic[]>;
175
+ }
176
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACtG,OAAO,KAAK,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEtH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AACtG,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AACtD,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,UAAU,CAAC;CACrB;AACD,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,KAAK,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAC7D,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,KAAK,CAAC;IACtC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OA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AAe,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC/C,WAAW,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC3C;AACD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxD,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAC;IACzC,QAAQ,CAAC,UAAU,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACnD;AACD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;IAC1B,QAAQ,CAAC,eAAe,EAAE,cAAc,EAAE,CAAC;IAC3C,QAAQ,CAAC,cAAc,EAAE,oBAAoB,EAAE,CAAC;IAChD,QAAQ,CAAC,UAAU,EAAE,iBAAiB,EAAE,CAAC;IACzC,OAAO,EAAE,MAAM,OAAO,CAAC,SAAS,iBAAiB,EAAE,CAAC,CAAC;CACtD"}
@@ -0,0 +1,67 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_driver = require("./driver-Cr2BGG4h.cjs");
3
+ let node_crypto = require("node:crypto");
4
+ //#region src/testing.ts
5
+ /** No test-framework dependency. Calls the driver once and throws on violated public lifecycle invariants. */
6
+ async function testDriverContract(driver, config = { grants: {
7
+ toolIds: [],
8
+ modelRoles: ["main"]
9
+ } }) {
10
+ const runtime = new require_driver.HarnessRuntime({
11
+ ...config,
12
+ driver
13
+ });
14
+ const identity = {
15
+ tenantId: "fixture",
16
+ userId: "fixture"
17
+ };
18
+ const sessionId = `conformance:${(0, node_crypto.randomUUID)()}`;
19
+ const handle = runtime.start("Conformance fixture", {
20
+ identity,
21
+ sessionId
22
+ });
23
+ let failed = false;
24
+ let failure;
25
+ let report;
26
+ try {
27
+ const events = [];
28
+ for await (const event of handle.events()) events.push(event);
29
+ const result = await handle.result();
30
+ const terminal = events.filter((event) => event.payload.type === "run.terminal");
31
+ if (terminal.length !== 1 || terminal[0].payload.type !== "run.terminal") throw new Error("Expected exactly one terminal event");
32
+ if (JSON.stringify(terminal[0].payload.result) !== JSON.stringify(result)) throw new Error("Terminal result differs from settled result");
33
+ if (events.some((event, index) => event.sequence !== index + 1 || event.runId !== handle.runId || event.schemaVersion !== 1)) throw new Error("Invalid event identity/ordering");
34
+ if (result.finalCursor !== events.at(-1)?.sequence) throw new Error("Invalid final event cursor");
35
+ if (result.status === "failed") throw new Error(`Driver fixture failed: ${result.reason?.message}`);
36
+ if (!(await handle.events({ after: result.finalCursor }).next()).done) throw new Error("Terminal event stream remained open");
37
+ handle.cancel("Late cancellation must not replace success");
38
+ if (JSON.stringify(await handle.result()) !== JSON.stringify(result)) throw new Error("Settled result changed");
39
+ report = {
40
+ result,
41
+ eventCount: events.length
42
+ };
43
+ } catch (error) {
44
+ failed = true;
45
+ handle.cancel("Driver conformance failed");
46
+ failure = error;
47
+ } finally {
48
+ await handle.result().catch(() => {});
49
+ try {
50
+ const failures = await runtime.resources.closeSession(identity, sessionId);
51
+ if (failures.length && !failed) {
52
+ failed = true;
53
+ failure = /* @__PURE__ */ new Error(`Driver fixture resource cleanup failed: ${failures.join(", ")}`);
54
+ }
55
+ } catch (error) {
56
+ if (!failed) {
57
+ failed = true;
58
+ failure = error;
59
+ }
60
+ }
61
+ }
62
+ if (failed) throw failure;
63
+ if (!report) throw new Error("Driver fixture did not produce a result");
64
+ return report;
65
+ }
66
+ //#endregion
67
+ exports.testDriverContract = testDriverContract;
@@ -0,0 +1,7 @@
1
+ import { type ExecutionDriver, type HarnessResult, type HarnessRuntimeConfig } from "./runtime/index.js";
2
+ /** No test-framework dependency. Calls the driver once and throws on violated public lifecycle invariants. */
3
+ export declare function testDriverContract(driver: ExecutionDriver, config?: Omit<HarnessRuntimeConfig, "driver">): Promise<{
4
+ result: HarnessResult;
5
+ eventCount: number;
6
+ }>;
7
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,aAAa,EAElB,KAAK,oBAAoB,EAC1B,MAAM,oBAAoB,CAAC;AAE5B,8GAA8G;AAC9G,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,eAAe,EACvB,MAAM,GAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAqD,GAC/F,OAAO,CAAC;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAoDxD"}
@@ -0,0 +1,66 @@
1
+ import { n as HarnessRuntime } from "./driver-BvzvqvpB.js";
2
+ import { randomUUID } from "node:crypto";
3
+ //#region src/testing.ts
4
+ /** No test-framework dependency. Calls the driver once and throws on violated public lifecycle invariants. */
5
+ async function testDriverContract(driver, config = { grants: {
6
+ toolIds: [],
7
+ modelRoles: ["main"]
8
+ } }) {
9
+ const runtime = new HarnessRuntime({
10
+ ...config,
11
+ driver
12
+ });
13
+ const identity = {
14
+ tenantId: "fixture",
15
+ userId: "fixture"
16
+ };
17
+ const sessionId = `conformance:${randomUUID()}`;
18
+ const handle = runtime.start("Conformance fixture", {
19
+ identity,
20
+ sessionId
21
+ });
22
+ let failed = false;
23
+ let failure;
24
+ let report;
25
+ try {
26
+ const events = [];
27
+ for await (const event of handle.events()) events.push(event);
28
+ const result = await handle.result();
29
+ const terminal = events.filter((event) => event.payload.type === "run.terminal");
30
+ if (terminal.length !== 1 || terminal[0].payload.type !== "run.terminal") throw new Error("Expected exactly one terminal event");
31
+ if (JSON.stringify(terminal[0].payload.result) !== JSON.stringify(result)) throw new Error("Terminal result differs from settled result");
32
+ if (events.some((event, index) => event.sequence !== index + 1 || event.runId !== handle.runId || event.schemaVersion !== 1)) throw new Error("Invalid event identity/ordering");
33
+ if (result.finalCursor !== events.at(-1)?.sequence) throw new Error("Invalid final event cursor");
34
+ if (result.status === "failed") throw new Error(`Driver fixture failed: ${result.reason?.message}`);
35
+ if (!(await handle.events({ after: result.finalCursor }).next()).done) throw new Error("Terminal event stream remained open");
36
+ handle.cancel("Late cancellation must not replace success");
37
+ if (JSON.stringify(await handle.result()) !== JSON.stringify(result)) throw new Error("Settled result changed");
38
+ report = {
39
+ result,
40
+ eventCount: events.length
41
+ };
42
+ } catch (error) {
43
+ failed = true;
44
+ handle.cancel("Driver conformance failed");
45
+ failure = error;
46
+ } finally {
47
+ await handle.result().catch(() => {});
48
+ try {
49
+ const failures = await runtime.resources.closeSession(identity, sessionId);
50
+ if (failures.length && !failed) {
51
+ failed = true;
52
+ failure = /* @__PURE__ */ new Error(`Driver fixture resource cleanup failed: ${failures.join(", ")}`);
53
+ }
54
+ } catch (error) {
55
+ if (!failed) {
56
+ failed = true;
57
+ failure = error;
58
+ }
59
+ }
60
+ }
61
+ if (failed) throw failure;
62
+ if (!report) throw new Error("Driver fixture did not produce a result");
63
+ return report;
64
+ }
65
+ //#endregion
66
+ export { testDriverContract };
@@ -0,0 +1,11 @@
1
+ import type { WatchDefinition, WatchDefinitionInput } from "./types.js";
2
+ export declare function watchId(value: unknown): asserts value is string;
3
+ /** Pure definition: validates/copies JSON, without binding services or activating anything. */
4
+ export declare function defineWatch(input: WatchDefinitionInput): WatchDefinition;
5
+ export declare function describeWatch(definition: WatchDefinitionInput): {
6
+ definition: WatchDefinition;
7
+ hash: string;
8
+ activation: "explicit";
9
+ modelCalls: false;
10
+ };
11
+ //# sourceMappingURL=definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/watch/definition.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAe,MAAM,YAAY,CAAC;AAerF,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,IAAI,MAAM,CAQ/D;AAYD,+FAA+F;AAC/F,wBAAgB,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe,CAyExE;AACD,wBAAgB,aAAa,CAAC,UAAU,EAAE,oBAAoB;;;;;EAQ7D"}
@@ -0,0 +1,104 @@
1
+ import type { WatchIdentity, WatchSource } from "./types.js";
2
+ type Result<T> = Promise<{
3
+ data: T;
4
+ }>;
5
+ type RequestOptions = {
6
+ signal: AbortSignal;
7
+ };
8
+ interface GmailMessage {
9
+ id?: string | null;
10
+ internalDate?: string | null;
11
+ snippet?: string | null;
12
+ payload?: {
13
+ headers?: Array<{
14
+ name?: string | null;
15
+ value?: string | null;
16
+ }>;
17
+ } | null;
18
+ }
19
+ /** Structural subset of an already-authenticated Gmail client; no SDK or credentials are loaded. */
20
+ export interface GmailWatchClient {
21
+ users: {
22
+ getProfile(params: {
23
+ userId: string;
24
+ }, options: RequestOptions): Result<{
25
+ historyId?: string | null;
26
+ emailAddress?: string | null;
27
+ }>;
28
+ watch(params: {
29
+ userId: string;
30
+ requestBody: {
31
+ topicName: string;
32
+ labelIds?: string[];
33
+ labelFilterBehavior?: "INCLUDE";
34
+ };
35
+ }, options: RequestOptions): Result<{
36
+ historyId?: string | null;
37
+ expiration?: string | null;
38
+ }>;
39
+ stop(params: {
40
+ userId: string;
41
+ }, options: RequestOptions): Promise<unknown>;
42
+ history: {
43
+ list(params: {
44
+ userId: string;
45
+ startHistoryId: string;
46
+ historyTypes: string[];
47
+ maxResults: number;
48
+ pageToken?: string;
49
+ }, options: RequestOptions): Result<{
50
+ historyId?: string | null;
51
+ nextPageToken?: string | null;
52
+ history?: Array<{
53
+ id?: string | null;
54
+ messagesAdded?: Array<{
55
+ message?: {
56
+ id?: string | null;
57
+ labelIds?: string[] | null;
58
+ } | null;
59
+ }>;
60
+ }>;
61
+ }>;
62
+ };
63
+ messages: {
64
+ list(params: {
65
+ userId: string;
66
+ maxResults: number;
67
+ pageToken?: string;
68
+ labelIds?: string[];
69
+ }, options: RequestOptions): Result<{
70
+ messages?: Array<{
71
+ id?: string | null;
72
+ }>;
73
+ nextPageToken?: string | null;
74
+ }>;
75
+ get(params: {
76
+ userId: string;
77
+ id: string;
78
+ format: "metadata";
79
+ metadataHeaders: string[];
80
+ }, options: RequestOptions): Result<GmailMessage>;
81
+ };
82
+ };
83
+ }
84
+ export interface GmailWatchOptions {
85
+ id: string;
86
+ mailbox: string;
87
+ identity: WatchIdentity;
88
+ topicName: string;
89
+ labelIds?: string[];
90
+ client: GmailWatchClient;
91
+ /** Host verifies Pub/Sub signature, audience and subscription ownership before decoding. */
92
+ verifyPush?: (raw: unknown) => Promise<{
93
+ identity: WatchIdentity;
94
+ messageId: string;
95
+ data: {
96
+ emailAddress: string;
97
+ historyId: string;
98
+ };
99
+ }>;
100
+ }
101
+ /** Optional Gmail source: daily renewal/polling are scheduled by DurableWatch, not in this constructor. */
102
+ export declare function gmailWatchSource(options: GmailWatchOptions): WatchSource;
103
+ export {};
104
+ //# sourceMappingURL=gmail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gmail.d.ts","sourceRoot":"","sources":["../../src/watch/gmail.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAc,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzE,KAAK,MAAM,CAAC,CAAC,IAAI,OAAO,CAAC;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AACtC,KAAK,cAAc,GAAG;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,CAAC;AAC9C,UAAU,YAAY;IACpB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,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,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,gBAAgB,CAAC;IACzB,4FAA4F;IAC5F,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC;QACrC,QAAQ,EAAE,aAAa,CAAC;QACxB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE;YAAE,YAAY,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC;KACnD,CAAC,CAAC;CACJ;AAUD,2GAA2G;AAC3G,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW,CAuLxE"}
@@ -0,0 +1,10 @@
1
+ import type { WatchQuietHours } from "./types.js";
2
+ export declare function watchClock(now: number, timeZone: string): {
3
+ day: string;
4
+ minute: number;
5
+ };
6
+ export declare function quietMinute(value: string): number;
7
+ export declare function isWatchQuiet(now: number, timeZone: string, quiet?: WatchQuietHours): boolean;
8
+ /** Scan actual instants: repeated local hours are both quiet; skipped boundaries advance naturally. */
9
+ export declare function nextWatchDelivery(now: number, timeZone: string, quiet?: WatchQuietHours, nextDay?: boolean): number;
10
+ //# sourceMappingURL=quiet-hours.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quiet-hours.d.ts","sourceRoot":"","sources":["../../src/watch/quiet-hours.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAezF;AACD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIjD;AACD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,eAAe,GAAG,OAAO,CAM5F;AACD,uGAAuG;AACvG,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,eAAe,EAAE,OAAO,UAAQ,GAAG,MAAM,CAOjH"}
@@ -0,0 +1,42 @@
1
+ import type { WatchDefinition, WatchDefinitionInput, WatchServices, WatchState } from "./types.js";
2
+ /** A bounded, versioned watch. Construction is inert; all I/O requires an explicit method call. */
3
+ export declare class DurableWatch {
4
+ private readonly services;
5
+ readonly definition: WatchDefinition;
6
+ readonly key: {
7
+ tenantId: string;
8
+ taskId: string;
9
+ };
10
+ private readonly hash;
11
+ private readonly supervisor;
12
+ private readonly connectorVersion;
13
+ constructor(definition: WatchDefinitionInput, services: WatchServices);
14
+ private checkBindings;
15
+ private authorize;
16
+ private state;
17
+ private read;
18
+ private mutate;
19
+ private ensureRecord;
20
+ private owned;
21
+ private scheduleKey;
22
+ private syncSchedules;
23
+ private start;
24
+ private renewAt;
25
+ private deliveryAt;
26
+ activate(): Promise<void>;
27
+ resume(): Promise<void>;
28
+ inspect(): Promise<WatchState>;
29
+ pause(): Promise<void>;
30
+ delete(): Promise<void>;
31
+ /** Explicit fail-closed rollout. Old pending/unknown sends stay bound to the old definition. */
32
+ update(definition: WatchDefinitionInput, services?: WatchServices): Promise<DurableWatch>;
33
+ private validateCursor;
34
+ trigger(raw: unknown): Promise<void>;
35
+ poll(): Promise<void>;
36
+ renew(): Promise<void>;
37
+ /** Delivers at most one digest. It never retries an unresolved external effect. */
38
+ flush(): Promise<void>;
39
+ /** Reconciliation remains available after pause/delete/update; it never dispatches a send. */
40
+ reconcile(outboxId: string): Promise<void>;
41
+ }
42
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/watch/runtime.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAC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