stitchkit 0.59.0 → 0.59.2

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 (61) hide show
  1. package/README.md +44 -4
  2. package/dist/agent-runtime/runtime.d.ts.map +1 -1
  3. package/dist/agent-runtime/terminal-commit.d.ts +102 -0
  4. package/dist/agent-runtime/terminal-commit.d.ts.map +1 -0
  5. package/dist/agent-runtime.js +143 -46
  6. package/dist/application/activity.d.ts +70 -0
  7. package/dist/application/activity.d.ts.map +1 -0
  8. package/dist/application/events.d.ts +65 -0
  9. package/dist/application/events.d.ts.map +1 -0
  10. package/dist/application/grammy.d.ts +35 -0
  11. package/dist/application/grammy.d.ts.map +1 -0
  12. package/dist/application/graph.d.ts +11 -0
  13. package/dist/application/graph.d.ts.map +1 -0
  14. package/dist/application/health.d.ts +13 -0
  15. package/dist/application/health.d.ts.map +1 -0
  16. package/dist/application/kernel.d.ts +31 -0
  17. package/dist/application/kernel.d.ts.map +1 -0
  18. package/dist/application/latest-sink.d.ts +39 -0
  19. package/dist/application/latest-sink.d.ts.map +1 -0
  20. package/dist/application/resource.d.ts +30 -0
  21. package/dist/application/resource.d.ts.map +1 -0
  22. package/dist/application/schedule.d.ts +112 -0
  23. package/dist/application/schedule.d.ts.map +1 -0
  24. package/dist/application/schemas.d.ts +160 -0
  25. package/dist/application/schemas.d.ts.map +1 -0
  26. package/dist/application/server-resource.d.ts +12 -0
  27. package/dist/application/server-resource.d.ts.map +1 -0
  28. package/dist/application-grammy.d.ts +2 -0
  29. package/dist/application-grammy.d.ts.map +1 -0
  30. package/dist/application-grammy.js +165 -0
  31. package/dist/application.d.ts +10 -0
  32. package/dist/application.d.ts.map +1 -0
  33. package/dist/application.js +1370 -0
  34. package/dist/cli.d.ts +1 -0
  35. package/dist/cli.d.ts.map +1 -1
  36. package/dist/cli.js +1 -1
  37. package/dist/{index-zk5zn2nh.js → index-3nwng7hs.js} +287 -38
  38. package/dist/index-dk6e56g0.js +211 -0
  39. package/dist/{index-9zn9fb4e.js → index-he4psyve.js} +6 -213
  40. package/dist/index-yr276yz0.js +6 -0
  41. package/dist/internal/fetch-port.d.ts +2 -0
  42. package/dist/internal/fetch-port.d.ts.map +1 -0
  43. package/dist/node.js +115 -13
  44. package/dist/server/index.js +8 -6
  45. package/dist/server/node.d.ts.map +1 -1
  46. package/dist/server/process-signals.d.ts +10 -8
  47. package/dist/server/process-signals.d.ts.map +1 -1
  48. package/dist/tools/cli-args.d.ts +16 -0
  49. package/dist/tools/cli-args.d.ts.map +1 -1
  50. package/dist/tools/cli-command.d.ts +16 -0
  51. package/dist/tools/cli-command.d.ts.map +1 -1
  52. package/dist/tools/cli-policy.d.ts +22 -0
  53. package/dist/tools/cli-policy.d.ts.map +1 -0
  54. package/dist/tools/cli.d.ts +2 -1
  55. package/dist/tools/cli.d.ts.map +1 -1
  56. package/dist/tools.d.ts +1 -0
  57. package/dist/tools.d.ts.map +1 -1
  58. package/dist/tools.js +1 -1
  59. package/llms-full.txt +471 -14
  60. package/llms.txt +1 -0
  61. package/package.json +15 -2
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ import type { ApplicationHandle } from './kernel';
3
+ export declare const ApplicationHealthHandlerOptionsSchema: z.ZodObject<{
4
+ kind: z.ZodEnum<{
5
+ liveness: "liveness";
6
+ readiness: "readiness";
7
+ }>;
8
+ retryAfterSeconds: z.ZodDefault<z.ZodNumber>;
9
+ }, z.core.$strip>;
10
+ export type ApplicationHealthHandlerOptions = z.input<typeof ApplicationHealthHandlerOptionsSchema>;
11
+ /** Fetch-clean liveness/readiness response with only the sanitized application snapshot. */
12
+ export declare function createApplicationHealthHandler(application: Pick<ApplicationHandle, 'getSnapshot'>, options: ApplicationHealthHandlerOptions): () => Response;
13
+ //# sourceMappingURL=health.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/application/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,qCAAqC;;;;;;iBAGhD,CAAC;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,qCAAqC,CAC7C,CAAC;AAEF,4FAA4F;AAC5F,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,EACnD,OAAO,EAAE,+BAA+B,GACvC,MAAM,QAAQ,CAahB"}
@@ -0,0 +1,31 @@
1
+ import type { ShutdownOptions } from '../server/shutdown';
2
+ import type { ManagedResource } from './resource';
3
+ import { type ApplicationShutdownResult, type ApplicationSnapshot } from './schemas';
4
+ export interface ApplicationConfig {
5
+ readonly id: string;
6
+ readonly resources?: readonly ManagedResource[];
7
+ readonly onSnapshot?: (snapshot: ApplicationSnapshot) => void | Promise<void>;
8
+ }
9
+ export interface ApplicationOperationLease {
10
+ readonly released: boolean;
11
+ release(): void;
12
+ }
13
+ export interface ApplicationAdmission {
14
+ acquire(): ApplicationOperationLease | null;
15
+ run<T>(work: () => T | Promise<T>): Promise<T>;
16
+ }
17
+ export interface ApplicationHandle {
18
+ readonly id: string;
19
+ readonly admission: ApplicationAdmission;
20
+ start(): Promise<ApplicationSnapshot>;
21
+ getSnapshot(): ApplicationSnapshot;
22
+ subscribe(listener: (snapshot: ApplicationSnapshot) => void): () => void;
23
+ shutdown(options?: ShutdownOptions): Promise<ApplicationShutdownResult>;
24
+ }
25
+ export declare class ApplicationAdmissionError extends Error {
26
+ readonly code = "APPLICATION_NOT_ACCEPTING";
27
+ constructor();
28
+ }
29
+ /** Compose process-local resources into one deterministic application lifetime. */
30
+ export declare function createApplication(config: ApplicationConfig): ApplicationHandle;
31
+ //# sourceMappingURL=kernel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../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,cAGC;CACF;AA2BD,mFAAmF;AACnF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAwlB9E"}
@@ -0,0 +1,39 @@
1
+ import { z } from 'zod';
2
+ export declare const ApplicationSnapshotSinkStatusSchema: z.ZodReadonly<z.ZodObject<{
3
+ accepting: z.ZodBoolean;
4
+ received: z.ZodNumber;
5
+ accepted: z.ZodNumber;
6
+ rejected: z.ZodNumber;
7
+ delivered: z.ZodNumber;
8
+ coalesced: z.ZodNumber;
9
+ failed: z.ZodNumber;
10
+ inFlight: z.ZodBoolean;
11
+ pending: z.ZodBoolean;
12
+ lastAcceptedRevision: z.ZodOptional<z.ZodNumber>;
13
+ lastDeliveredRevision: z.ZodOptional<z.ZodNumber>;
14
+ }, z.core.$strict>>;
15
+ export type ApplicationSnapshotSinkStatus = z.infer<typeof ApplicationSnapshotSinkStatusSchema>;
16
+ export interface RevisionedApplicationSnapshot {
17
+ readonly revision: number;
18
+ }
19
+ export interface ApplicationSnapshotSinkError<TSnapshot> {
20
+ readonly error: unknown;
21
+ readonly snapshot: TSnapshot;
22
+ }
23
+ export interface ApplicationSnapshotSinkConfig<TSnapshot extends RevisionedApplicationSnapshot> {
24
+ write(snapshot: TSnapshot): void | Promise<void>;
25
+ onSinkError?(failure: ApplicationSnapshotSinkError<TSnapshot>): void | Promise<void>;
26
+ }
27
+ export interface ApplicationSnapshotSink<TSnapshot extends RevisionedApplicationSnapshot> {
28
+ /** Admit a newer absolute snapshot. Returns false after close or for a stale revision. */
29
+ publish(snapshot: TSnapshot): boolean;
30
+ getStatus(): ApplicationSnapshotSinkStatus;
31
+ /** Close admission and deliver the newest snapshot accepted before this boundary. */
32
+ close(): Promise<ApplicationSnapshotSinkStatus>;
33
+ }
34
+ /**
35
+ * Deliver absolute state without growing a queue: one write runs while one newer
36
+ * revision may wait, and that pending value is replaced by every still-newer one.
37
+ */
38
+ export declare function createApplicationSnapshotSink<TSnapshot extends RevisionedApplicationSnapshot>(config: ApplicationSnapshotSinkConfig<TSnapshot>): ApplicationSnapshotSink<TSnapshot>;
39
+ //# sourceMappingURL=latest-sink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latest-sink.d.ts","sourceRoot":"","sources":["../../src/application/latest-sink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,mCAAmC;;;;;;;;;;;;mBAenC,CAAC;AACd,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,4BAA4B,CAAC,SAAS;IACrD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAED,MAAM,WAAW,6BAA6B,CAC5C,SAAS,SAAS,6BAA6B;IAE/C,KAAK,CAAC,QAAQ,EAAE,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,WAAW,CAAC,CAAC,OAAO,EAAE,4BAA4B,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtF;AAED,MAAM,WAAW,uBAAuB,CAAC,SAAS,SAAS,6BAA6B;IACtF,0FAA0F;IAC1F,OAAO,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC;IACtC,SAAS,IAAI,6BAA6B,CAAC;IAC3C,qFAAqF;IACrF,KAAK,IAAI,OAAO,CAAC,6BAA6B,CAAC,CAAC;CACjD;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,SAAS,6BAA6B,EAC3F,MAAM,EAAE,6BAA6B,CAAC,SAAS,CAAC,GAC/C,uBAAuB,CAAC,SAAS,CAAC,CAiGpC"}
@@ -0,0 +1,30 @@
1
+ import type { ApplicationHealth } from './schemas';
2
+ export interface ManagedResourceContext {
3
+ readonly applicationId: string;
4
+ readonly signal: AbortSignal;
5
+ readonly deadlineAt?: number;
6
+ readonly forceDeadlineAt?: number;
7
+ now(): number;
8
+ reportHealth(health: Exclude<ApplicationHealth, 'unknown'>): void;
9
+ }
10
+ export interface ManagedResourceStartResult {
11
+ /** Resolves when the resource is ready for dependants. */
12
+ readonly ready?: Promise<void>;
13
+ /** Long-lived completion; settling before shutdown marks the resource unhealthy. */
14
+ readonly completion?: Promise<void>;
15
+ }
16
+ export interface ManagedResource {
17
+ readonly id: string;
18
+ readonly dependsOn?: readonly string[];
19
+ readonly required?: boolean;
20
+ start(context: ManagedResourceContext): void | ManagedResourceStartResult | Promise<void> | Promise<ManagedResourceStartResult | undefined>;
21
+ /** Runs only after the whole required graph reached readiness. */
22
+ activate?(context: ManagedResourceContext): void | Promise<void>;
23
+ stopAdmission?(context: ManagedResourceContext): void | Promise<void>;
24
+ drain?(context: ManagedResourceContext): void | Promise<void>;
25
+ /** Must be safe after any invoked start, including a rejected partial start. */
26
+ close?(context: ManagedResourceContext): void | Promise<void>;
27
+ force?(context: ManagedResourceContext): void | Promise<void>;
28
+ }
29
+ export declare function defineManagedResource<const TResource extends ManagedResource>(resource: TResource): TResource;
30
+ //# sourceMappingURL=resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/application/resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,GAAG,IAAI,MAAM,CAA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0 +1,112 @@
1
+ import { z } from 'zod';
2
+ import type { ManagedResource } from './resource';
3
+ export declare const ManagedScheduleOverlapSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
4
+ mode: z.ZodLiteral<"skip">;
5
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
6
+ mode: z.ZodLiteral<"queue-one">;
7
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
8
+ mode: z.ZodLiteral<"parallel">;
9
+ maxConcurrent: z.ZodNumber;
10
+ }, z.core.$strip>>], "mode">;
11
+ export type ManagedScheduleOverlap = z.infer<typeof ManagedScheduleOverlapSchema>;
12
+ export declare const ManagedScheduleErrorPolicySchema: z.ZodEnum<{
13
+ continue: "continue";
14
+ "stop-schedule": "stop-schedule";
15
+ }>;
16
+ export type ManagedScheduleErrorPolicy = z.infer<typeof ManagedScheduleErrorPolicySchema>;
17
+ export declare const ManagedScheduleDescriptorSchema: z.ZodReadonly<z.ZodObject<{
18
+ id: z.ZodString;
19
+ everyMs: z.ZodNumber;
20
+ startAfterMs: z.ZodNumber;
21
+ overlap: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
22
+ mode: z.ZodLiteral<"skip">;
23
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
24
+ mode: z.ZodLiteral<"queue-one">;
25
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
26
+ mode: z.ZodLiteral<"parallel">;
27
+ maxConcurrent: z.ZodNumber;
28
+ }, z.core.$strip>>], "mode">;
29
+ errorPolicy: z.ZodEnum<{
30
+ continue: "continue";
31
+ "stop-schedule": "stop-schedule";
32
+ }>;
33
+ }, z.core.$strip>>;
34
+ export type ManagedScheduleDescriptor = z.infer<typeof ManagedScheduleDescriptorSchema>;
35
+ export declare const ManagedScheduleStatusSchema: z.ZodReadonly<z.ZodObject<{
36
+ descriptor: z.ZodReadonly<z.ZodObject<{
37
+ id: z.ZodString;
38
+ everyMs: z.ZodNumber;
39
+ startAfterMs: z.ZodNumber;
40
+ overlap: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
41
+ mode: z.ZodLiteral<"skip">;
42
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
43
+ mode: z.ZodLiteral<"queue-one">;
44
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
45
+ mode: z.ZodLiteral<"parallel">;
46
+ maxConcurrent: z.ZodNumber;
47
+ }, z.core.$strip>>], "mode">;
48
+ errorPolicy: z.ZodEnum<{
49
+ continue: "continue";
50
+ "stop-schedule": "stop-schedule";
51
+ }>;
52
+ }, z.core.$strip>>;
53
+ state: z.ZodEnum<{
54
+ draining: "draining";
55
+ inactive: "inactive";
56
+ running: "running";
57
+ scheduled: "scheduled";
58
+ stopped: "stopped";
59
+ }>;
60
+ revision: z.ZodNumber;
61
+ capturedAt: z.ZodString;
62
+ changedAt: z.ZodString;
63
+ accepting: z.ZodBoolean;
64
+ active: z.ZodNumber;
65
+ queued: z.ZodBoolean;
66
+ runsStarted: z.ZodNumber;
67
+ runsCompleted: z.ZodNumber;
68
+ runsFailed: z.ZodNumber;
69
+ ticksSkipped: z.ZodNumber;
70
+ nextRunAt: z.ZodNullable<z.ZodString>;
71
+ lastScheduledAt: z.ZodNullable<z.ZodString>;
72
+ lastStartedAt: z.ZodNullable<z.ZodString>;
73
+ lastFinishedAt: z.ZodNullable<z.ZodString>;
74
+ }, z.core.$strip>>;
75
+ export type ManagedScheduleStatus = z.infer<typeof ManagedScheduleStatusSchema>;
76
+ export interface ManagedScheduleTimer {
77
+ cancel(): void;
78
+ }
79
+ /** Monotonic timer boundary. Tests can replace it without changing schedule semantics. */
80
+ export interface ManagedScheduleClock {
81
+ /** Monotonic clock used for cadence and deadline arithmetic. */
82
+ now(): number;
83
+ /** Wall clock used only to project portable status timestamps. */
84
+ wallNow(): Date;
85
+ schedule(callback: () => void, delayMs: number): ManagedScheduleTimer;
86
+ }
87
+ export interface ManagedScheduleRunContext {
88
+ readonly applicationId: string;
89
+ readonly signal: AbortSignal;
90
+ readonly scheduledAt: number;
91
+ readonly startedAt: number;
92
+ now(): number;
93
+ }
94
+ export interface ManagedScheduleConfig {
95
+ readonly id: string;
96
+ readonly dependsOn?: readonly string[];
97
+ readonly required?: boolean;
98
+ readonly everyMs: number;
99
+ /** Defaults to one interval. A zero value schedules the first run after activation. */
100
+ readonly startAfterMs?: number;
101
+ readonly overlap?: ManagedScheduleOverlap;
102
+ readonly errorPolicy?: ManagedScheduleErrorPolicy;
103
+ readonly run: (context: ManagedScheduleRunContext) => void | Promise<void>;
104
+ readonly onError?: (error: unknown, context: ManagedScheduleRunContext) => void | Promise<void>;
105
+ readonly clock?: ManagedScheduleClock;
106
+ }
107
+ export interface ManagedSchedule extends ManagedResource {
108
+ readonly status: ManagedScheduleStatus;
109
+ }
110
+ /** Create one fixed-rate, process-local periodic application resource. */
111
+ export declare function createManagedSchedule(config: ManagedScheduleConfig): ManagedSchedule;
112
+ //# sourceMappingURL=schedule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../src/application/schedule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAA0B,MAAM,YAAY,CAAC;AAa1E,eAAO,MAAM,4BAA4B;;;;;;;4BASvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,gCAAgC;;;EAAwC,CAAC;AACtF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;kBAQ/B,CAAC;AACd,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAA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CAAC,EAAE,CACjB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,yBAAyB,KAC/B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,oBAAoB,CAAC;CACvC;AAED,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;CACxC;AAID,0EAA0E;AAC1E,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,GAAG,eAAe,CA0QpF"}
@@ -0,0 +1,160 @@
1
+ import { z } from 'zod';
2
+ export declare const ApplicationIdSchema: z.ZodString;
3
+ export type ApplicationId = z.infer<typeof ApplicationIdSchema>;
4
+ export declare const ApplicationLifecycleSchema: z.ZodEnum<{
5
+ created: "created";
6
+ draining: "draining";
7
+ failed: "failed";
8
+ ready: "ready";
9
+ starting: "starting";
10
+ stopped: "stopped";
11
+ stopping: "stopping";
12
+ }>;
13
+ export type ApplicationLifecycle = z.infer<typeof ApplicationLifecycleSchema>;
14
+ export declare const ApplicationHealthSchema: z.ZodEnum<{
15
+ degraded: "degraded";
16
+ healthy: "healthy";
17
+ unhealthy: "unhealthy";
18
+ unknown: "unknown";
19
+ }>;
20
+ export type ApplicationHealth = z.infer<typeof ApplicationHealthSchema>;
21
+ export declare const ManagedResourceStateSchema: z.ZodEnum<{
22
+ failed: "failed";
23
+ ready: "ready";
24
+ registered: "registered";
25
+ starting: "starting";
26
+ stopped: "stopped";
27
+ stopping: "stopping";
28
+ }>;
29
+ export type ManagedResourceState = z.infer<typeof ManagedResourceStateSchema>;
30
+ export declare const ApplicationAdmissionSnapshotSchema: z.ZodReadonly<z.ZodObject<{
31
+ accepting: z.ZodBoolean;
32
+ accepted: z.ZodNumber;
33
+ completed: z.ZodNumber;
34
+ pending: z.ZodNumber;
35
+ }, z.core.$strip>>;
36
+ export type ApplicationAdmissionSnapshot = z.infer<typeof ApplicationAdmissionSnapshotSchema>;
37
+ export declare const ManagedResourceSnapshotSchema: z.ZodReadonly<z.ZodObject<{
38
+ id: z.ZodString;
39
+ required: z.ZodBoolean;
40
+ dependsOn: z.ZodReadonly<z.ZodArray<z.ZodString>>;
41
+ state: z.ZodEnum<{
42
+ failed: "failed";
43
+ ready: "ready";
44
+ registered: "registered";
45
+ starting: "starting";
46
+ stopped: "stopped";
47
+ stopping: "stopping";
48
+ }>;
49
+ health: z.ZodEnum<{
50
+ degraded: "degraded";
51
+ healthy: "healthy";
52
+ unhealthy: "unhealthy";
53
+ unknown: "unknown";
54
+ }>;
55
+ ready: z.ZodBoolean;
56
+ }, z.core.$strip>>;
57
+ export type ManagedResourceSnapshot = z.infer<typeof ManagedResourceSnapshotSchema>;
58
+ export declare const ApplicationSnapshotSchema: z.ZodReadonly<z.ZodObject<{
59
+ id: z.ZodString;
60
+ epoch: z.ZodString;
61
+ revision: z.ZodNumber;
62
+ lifecycle: z.ZodEnum<{
63
+ created: "created";
64
+ draining: "draining";
65
+ failed: "failed";
66
+ ready: "ready";
67
+ starting: "starting";
68
+ stopped: "stopped";
69
+ stopping: "stopping";
70
+ }>;
71
+ health: z.ZodEnum<{
72
+ degraded: "degraded";
73
+ healthy: "healthy";
74
+ unhealthy: "unhealthy";
75
+ unknown: "unknown";
76
+ }>;
77
+ ready: z.ZodBoolean;
78
+ capturedAt: z.ZodString;
79
+ changedAt: z.ZodString;
80
+ admission: z.ZodReadonly<z.ZodObject<{
81
+ accepting: z.ZodBoolean;
82
+ accepted: z.ZodNumber;
83
+ completed: z.ZodNumber;
84
+ pending: z.ZodNumber;
85
+ }, z.core.$strip>>;
86
+ resources: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
87
+ id: z.ZodString;
88
+ required: z.ZodBoolean;
89
+ dependsOn: z.ZodReadonly<z.ZodArray<z.ZodString>>;
90
+ state: z.ZodEnum<{
91
+ failed: "failed";
92
+ ready: "ready";
93
+ registered: "registered";
94
+ starting: "starting";
95
+ stopped: "stopped";
96
+ stopping: "stopping";
97
+ }>;
98
+ health: z.ZodEnum<{
99
+ degraded: "degraded";
100
+ healthy: "healthy";
101
+ unhealthy: "unhealthy";
102
+ unknown: "unknown";
103
+ }>;
104
+ ready: z.ZodBoolean;
105
+ }, z.core.$strip>>>>;
106
+ }, z.core.$strip>>;
107
+ export type ApplicationSnapshot = z.infer<typeof ApplicationSnapshotSchema>;
108
+ export declare const ApplicationResourceShutdownSchema: z.ZodReadonly<z.ZodObject<{
109
+ id: z.ZodString;
110
+ state: z.ZodEnum<{
111
+ closed: "closed";
112
+ "force-failed": "force-failed";
113
+ "not-started": "not-started";
114
+ }>;
115
+ failures: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
116
+ admission: "admission";
117
+ close: "close";
118
+ completion: "completion";
119
+ drain: "drain";
120
+ force: "force";
121
+ ready: "ready";
122
+ start: "start";
123
+ }>>>;
124
+ }, z.core.$strip>>;
125
+ export type ApplicationResourceShutdown = z.infer<typeof ApplicationResourceShutdownSchema>;
126
+ export declare const ApplicationShutdownResultSchema: z.ZodReadonly<z.ZodObject<{
127
+ outcome: z.ZodEnum<{
128
+ clean: "clean";
129
+ forced: "forced";
130
+ }>;
131
+ reason: z.ZodOptional<z.ZodEnum<{
132
+ deadline: "deadline";
133
+ signal: "signal";
134
+ }>>;
135
+ cleanupComplete: z.ZodBoolean;
136
+ acceptedOperations: z.ZodNumber;
137
+ completedOperations: z.ZodNumber;
138
+ pendingOperations: z.ZodNumber;
139
+ pendingOperationsAtForce: z.ZodNumber;
140
+ resources: z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
141
+ id: z.ZodString;
142
+ state: z.ZodEnum<{
143
+ closed: "closed";
144
+ "force-failed": "force-failed";
145
+ "not-started": "not-started";
146
+ }>;
147
+ failures: z.ZodReadonly<z.ZodArray<z.ZodEnum<{
148
+ admission: "admission";
149
+ close: "close";
150
+ completion: "completion";
151
+ drain: "drain";
152
+ force: "force";
153
+ ready: "ready";
154
+ start: "start";
155
+ }>>>;
156
+ }, z.core.$strip>>>>;
157
+ durationMs: z.ZodNumber;
158
+ }, z.core.$strip>>;
159
+ export type ApplicationShutdownResult = z.infer<typeof ApplicationShutdownResultSchema>;
160
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/application/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mBAAmB,aAIS,CAAC;AAC1C,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,0BAA0B;;;;;;;;EAQrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,uBAAuB;;;;;EAA0D,CAAC;AAC/F,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,0BAA0B;;;;;;;EAOrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAI9E,eAAO,MAAM,kCAAkC;;;;;kBAOlC,CAAC;AACd,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;kBAS7B,CAAC;AACd,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAazB,CAAC;AACd,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;kBAQjC,CAAC;AACd,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAY/B,CAAC;AACd,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { ManagedServerHandle } from '../server/shutdown';
2
+ import { type ManagedResource } from './resource';
3
+ export interface ManagedServerResourceConfig<TRuntime> {
4
+ readonly id: string;
5
+ readonly server: ManagedServerHandle<TRuntime> | (() => ManagedServerHandle<TRuntime>);
6
+ readonly dependsOn?: readonly string[];
7
+ readonly required?: boolean;
8
+ readonly retryAfterSeconds?: number;
9
+ }
10
+ /** Adapt an existing managed server without duplicating its shutdown state machine. */
11
+ export declare function managedServerResource<TRuntime>(config: ManagedServerResourceConfig<TRuntime>): ManagedResource;
12
+ //# sourceMappingURL=server-resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-resource.d.ts","sourceRoot":"","sources":["../../src/application/server-resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAkB,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAEzE,MAAM,WAAW,2BAA2B,CAAC,QAAQ;IACnD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvF,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAC,QAAQ,EAC5C,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,GAC5C,eAAe,CAoDjB"}
@@ -0,0 +1,2 @@
1
+ export { createGrammyWebhookResource, type GrammyPollingResourceConfig, type GrammyUpdate, type GrammyWebhookResource, type GrammyWebhookResourceConfig, GrammyWebhookUnavailableError, grammyPollingResource, } from './application/grammy';
2
+ //# sourceMappingURL=application-grammy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application-grammy.d.ts","sourceRoot":"","sources":["../src/application-grammy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,KAAK,2BAA2B,EAChC,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,6BAA6B,EAC7B,qBAAqB,GACtB,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,165 @@
1
+ import {
2
+ defineManagedResource
3
+ } from "./index-yr276yz0.js";
4
+ import"./index-1bx83sw4.js";
5
+
6
+ // src/application/grammy.ts
7
+ import { Context } from "grammy";
8
+ if (typeof Context !== "function") {
9
+ throw new TypeError("[stitchkit] stitchkit/application/grammy requires the grammY peer");
10
+ }
11
+ function reportIsolated(callback, error) {
12
+ if (!callback)
13
+ return;
14
+ Promise.resolve().then(() => callback(error)).catch(() => {});
15
+ }
16
+ function grammyPollingResource(config) {
17
+ let completion;
18
+ let stopPromise;
19
+ const stop = () => {
20
+ if (!stopPromise) {
21
+ stopPromise = Promise.resolve().then(() => config.bot.stop());
22
+ stopPromise.catch((error) => reportIsolated(config.onError, error));
23
+ }
24
+ return stopPromise;
25
+ };
26
+ return defineManagedResource({
27
+ id: config.id,
28
+ ...config.dependsOn && { dependsOn: config.dependsOn },
29
+ ...config.required !== undefined && { required: config.required },
30
+ start() {
31
+ let resolveReady = () => {
32
+ return;
33
+ };
34
+ let rejectReady = () => {
35
+ return;
36
+ };
37
+ let becameReady = false;
38
+ const ready = new Promise((resolve, reject) => {
39
+ resolveReady = resolve;
40
+ rejectReady = reject;
41
+ });
42
+ const polling = config.bot.start({
43
+ ...config.polling,
44
+ onStart: async (botInfo) => {
45
+ await config.onStart?.(botInfo);
46
+ becameReady = true;
47
+ resolveReady();
48
+ }
49
+ });
50
+ completion = polling.then(() => {
51
+ if (!becameReady) {
52
+ rejectReady(new Error("[stitchkit] grammY polling stopped before reaching readiness"));
53
+ }
54
+ }, (error) => {
55
+ if (!becameReady)
56
+ rejectReady(error);
57
+ reportIsolated(config.onError, error);
58
+ throw error;
59
+ });
60
+ completion.catch(() => {
61
+ return;
62
+ });
63
+ return { ready, completion };
64
+ },
65
+ stopAdmission() {
66
+ return stop();
67
+ },
68
+ async drain() {
69
+ await completion;
70
+ },
71
+ async close() {
72
+ await stop();
73
+ if (completion)
74
+ await completion.catch(() => {
75
+ return;
76
+ });
77
+ },
78
+ async force() {
79
+ await stop();
80
+ if (completion)
81
+ await completion.catch(() => {
82
+ return;
83
+ });
84
+ }
85
+ });
86
+ }
87
+
88
+ class GrammyWebhookUnavailableError extends Error {
89
+ code = "GRAMMY_WEBHOOK_NOT_ACCEPTING";
90
+ constructor() {
91
+ super("grammY webhook resource is not accepting updates");
92
+ this.name = "GrammyWebhookUnavailableError";
93
+ }
94
+ }
95
+ function createGrammyWebhookResource(config) {
96
+ let accepting = false;
97
+ let pending = 0;
98
+ const waiters = new Set;
99
+ const waitForIdle = (signal) => {
100
+ if (pending === 0 || signal.aborted)
101
+ return Promise.resolve();
102
+ return new Promise((resolve) => {
103
+ const finish = () => {
104
+ signal.removeEventListener("abort", finish);
105
+ waiters.delete(finish);
106
+ resolve();
107
+ };
108
+ waiters.add(finish);
109
+ signal.addEventListener("abort", finish, { once: true });
110
+ });
111
+ };
112
+ const resource = defineManagedResource({
113
+ id: config.id,
114
+ ...config.dependsOn && { dependsOn: config.dependsOn },
115
+ ...config.required !== undefined && { required: config.required },
116
+ async start(context) {
117
+ await config.bot.init(context.signal);
118
+ },
119
+ activate() {
120
+ accepting = true;
121
+ },
122
+ stopAdmission() {
123
+ accepting = false;
124
+ },
125
+ drain(context) {
126
+ return waitForIdle(context.signal);
127
+ },
128
+ close() {
129
+ accepting = false;
130
+ },
131
+ async force(context) {
132
+ accepting = false;
133
+ await waitForIdle(context.signal);
134
+ if (pending > 0) {
135
+ throw new Error("[stitchkit] grammY webhook middleware remained active at force deadline");
136
+ }
137
+ }
138
+ });
139
+ return {
140
+ resource,
141
+ async handleUpdate(update, webhookReplyEnvelope) {
142
+ if (!accepting)
143
+ throw new GrammyWebhookUnavailableError;
144
+ pending += 1;
145
+ try {
146
+ await config.bot.handleUpdate(update, webhookReplyEnvelope);
147
+ } catch (error) {
148
+ reportIsolated(config.onError, error);
149
+ throw error;
150
+ } finally {
151
+ pending -= 1;
152
+ if (pending === 0) {
153
+ for (const waiter of waiters)
154
+ waiter();
155
+ waiters.clear();
156
+ }
157
+ }
158
+ }
159
+ };
160
+ }
161
+ export {
162
+ GrammyWebhookUnavailableError,
163
+ createGrammyWebhookResource,
164
+ grammyPollingResource
165
+ };
@@ -0,0 +1,10 @@
1
+ export { type ActivityId, ActivityIdSchema, type ActivityLiveState, ActivityLiveStateSchema, type ActivityProjection, type ActivityProjectionConfig, type ActivityProjectionSubscriberError, type ActivitySnapshot, ActivitySnapshotSchema, type ActivityStageId, ActivityStageIdSchema, type ActivityStageSnapshot, ActivityStageSnapshotSchema, type ActivityToken, type ActivityTransition, createActivityProjection, } from './application/activity';
2
+ export { type ApplicationEventSink, type ApplicationEventSinkConfig, type ApplicationLifecycleEvent, ApplicationLifecycleEventSchema, applicationLifecycleEvent, createApplicationEventSink, } from './application/events';
3
+ export { type ApplicationHealthHandlerOptions, ApplicationHealthHandlerOptionsSchema, createApplicationHealthHandler, } from './application/health';
4
+ export { type ApplicationAdmission, ApplicationAdmissionError, type ApplicationConfig, type ApplicationHandle, type ApplicationOperationLease, createApplication, } from './application/kernel';
5
+ export { type ApplicationSnapshotSink, type ApplicationSnapshotSinkConfig, type ApplicationSnapshotSinkError, type ApplicationSnapshotSinkStatus, ApplicationSnapshotSinkStatusSchema, createApplicationSnapshotSink, type RevisionedApplicationSnapshot, } from './application/latest-sink';
6
+ export { defineManagedResource, type ManagedResource, type ManagedResourceContext, type ManagedResourceStartResult, } from './application/resource';
7
+ export { createManagedSchedule, type ManagedSchedule, type ManagedScheduleClock, type ManagedScheduleConfig, type ManagedScheduleDescriptor, ManagedScheduleDescriptorSchema, type ManagedScheduleErrorPolicy, ManagedScheduleErrorPolicySchema, type ManagedScheduleOverlap, ManagedScheduleOverlapSchema, type ManagedScheduleRunContext, type ManagedScheduleStatus, ManagedScheduleStatusSchema, type ManagedScheduleTimer, } from './application/schedule';
8
+ export { type ApplicationAdmissionSnapshot, ApplicationAdmissionSnapshotSchema, type ApplicationHealth, ApplicationHealthSchema, type ApplicationId, ApplicationIdSchema, type ApplicationLifecycle, ApplicationLifecycleSchema, type ApplicationResourceShutdown, ApplicationResourceShutdownSchema, type ApplicationShutdownResult, ApplicationShutdownResultSchema, type ApplicationSnapshot, ApplicationSnapshotSchema, type ManagedResourceSnapshot, ManagedResourceSnapshotSchema, type ManagedResourceState, ManagedResourceStateSchema, } from './application/schemas';
9
+ export { type ManagedServerResourceConfig, managedServerResource, } from './application/server-resource';
10
+ //# sourceMappingURL=application.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../src/application.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EACtC,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,KAAK,eAAe,EACpB,qBAAqB,EACrB,KAAK,qBAAqB,EAC1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