@on-par/contracts 0.0.0-stage → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +14 -2
- package/dist/adr.d.ts +28 -0
- package/dist/adr.d.ts.map +1 -0
- package/dist/adr.js +24 -0
- package/dist/adr.js.map +1 -0
- package/dist/design.d.ts +224 -0
- package/dist/design.d.ts.map +1 -0
- package/dist/design.js +154 -0
- package/dist/design.js.map +1 -0
- package/dist/gherkin.d.ts +10 -0
- package/dist/gherkin.d.ts.map +1 -0
- package/dist/gherkin.js +13 -0
- package/dist/gherkin.js.map +1 -0
- package/dist/hosted.d.ts +167 -0
- package/dist/hosted.d.ts.map +1 -0
- package/dist/hosted.js +140 -0
- package/dist/hosted.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/issue.d.ts +82 -0
- package/dist/issue.d.ts.map +1 -0
- package/dist/issue.js +49 -0
- package/dist/issue.js.map +1 -0
- package/dist/lifecycle.d.ts +61 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +22 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/serde.d.ts +15 -0
- package/dist/serde.d.ts.map +1 -0
- package/dist/serde.js +24 -0
- package/dist/serde.js.map +1 -0
- package/dist/trace.d.ts +19 -0
- package/dist/trace.d.ts.map +1 -0
- package/dist/trace.js +20 -0
- package/dist/trace.js.map +1 -0
- package/package.json +46 -4
package/dist/hosted.d.ts
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const HOSTED_EXEC_FLAG = "FACTORY_HOSTED_EXEC";
|
|
3
|
+
export declare const HostedJobStatusSchema: z.ZodEnum<{
|
|
4
|
+
canceled: "canceled";
|
|
5
|
+
done: "done";
|
|
6
|
+
failed: "failed";
|
|
7
|
+
leased: "leased";
|
|
8
|
+
requested: "requested";
|
|
9
|
+
running: "running";
|
|
10
|
+
}>;
|
|
11
|
+
export declare const HostedJobRequestSchema: z.ZodObject<{
|
|
12
|
+
jobId: z.ZodString;
|
|
13
|
+
repoSlug: z.ZodString;
|
|
14
|
+
taskPayload: z.ZodString;
|
|
15
|
+
requiredCapabilities: z.ZodArray<z.ZodString>;
|
|
16
|
+
requiredAuthority: z.ZodString;
|
|
17
|
+
status: z.ZodEnum<{
|
|
18
|
+
canceled: "canceled";
|
|
19
|
+
done: "done";
|
|
20
|
+
failed: "failed";
|
|
21
|
+
leased: "leased";
|
|
22
|
+
requested: "requested";
|
|
23
|
+
running: "running";
|
|
24
|
+
}>;
|
|
25
|
+
createdAt: z.ZodString;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const HostedJobEventTypeSchema: z.ZodEnum<{
|
|
28
|
+
canceled: "canceled";
|
|
29
|
+
cleaned: "cleaned";
|
|
30
|
+
completed: "completed";
|
|
31
|
+
expired: "expired";
|
|
32
|
+
failed: "failed";
|
|
33
|
+
heartbeat: "heartbeat";
|
|
34
|
+
leased: "leased";
|
|
35
|
+
requested: "requested";
|
|
36
|
+
watchdog: "watchdog";
|
|
37
|
+
}>;
|
|
38
|
+
export declare const HostedJobEventSeveritySchema: z.ZodEnum<{
|
|
39
|
+
error: "error";
|
|
40
|
+
info: "info";
|
|
41
|
+
warn: "warn";
|
|
42
|
+
}>;
|
|
43
|
+
export declare const HostedJobEventSchema: z.ZodObject<{
|
|
44
|
+
jobId: z.ZodString;
|
|
45
|
+
type: z.ZodEnum<{
|
|
46
|
+
canceled: "canceled";
|
|
47
|
+
cleaned: "cleaned";
|
|
48
|
+
completed: "completed";
|
|
49
|
+
expired: "expired";
|
|
50
|
+
failed: "failed";
|
|
51
|
+
heartbeat: "heartbeat";
|
|
52
|
+
leased: "leased";
|
|
53
|
+
requested: "requested";
|
|
54
|
+
watchdog: "watchdog";
|
|
55
|
+
}>;
|
|
56
|
+
ts: z.ZodString;
|
|
57
|
+
severity: z.ZodEnum<{
|
|
58
|
+
error: "error";
|
|
59
|
+
info: "info";
|
|
60
|
+
warn: "warn";
|
|
61
|
+
}>;
|
|
62
|
+
message: z.ZodString;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export declare const RunnerLeaseSchema: z.ZodObject<{
|
|
65
|
+
runnerId: z.ZodString;
|
|
66
|
+
leaseId: z.ZodString;
|
|
67
|
+
jobId: z.ZodString;
|
|
68
|
+
expiresAt: z.ZodString;
|
|
69
|
+
heartbeatIntervalMs: z.ZodNumber;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export declare const HostedJobPhaseSchema: z.ZodEnum<{
|
|
72
|
+
cleanup: "cleanup";
|
|
73
|
+
clone: "clone";
|
|
74
|
+
run: "run";
|
|
75
|
+
}>;
|
|
76
|
+
export type HostedJobPhase = z.infer<typeof HostedJobPhaseSchema>;
|
|
77
|
+
/** Metadata-only reference to a produced artifact — never inline content or a
|
|
78
|
+
* secret value. `ref` is an opaque retained handle (a path or store handle). */
|
|
79
|
+
export declare const HostedArtifactRefSchema: z.ZodObject<{
|
|
80
|
+
name: z.ZodString;
|
|
81
|
+
ref: z.ZodString;
|
|
82
|
+
kind: z.ZodString;
|
|
83
|
+
sizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
sha256: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
export type HostedArtifactRef = z.infer<typeof HostedArtifactRefSchema>;
|
|
87
|
+
export declare const HostedJobOutcomeSchema: z.ZodEnum<{
|
|
88
|
+
canceled: "canceled";
|
|
89
|
+
completed: "completed";
|
|
90
|
+
failed: "failed";
|
|
91
|
+
}>;
|
|
92
|
+
export declare const HostedJobResultSchema: z.ZodObject<{
|
|
93
|
+
jobId: z.ZodString;
|
|
94
|
+
outcome: z.ZodEnum<{
|
|
95
|
+
canceled: "canceled";
|
|
96
|
+
completed: "completed";
|
|
97
|
+
failed: "failed";
|
|
98
|
+
}>;
|
|
99
|
+
summary: z.ZodString;
|
|
100
|
+
finishedAt: z.ZodString;
|
|
101
|
+
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
failurePhase: z.ZodOptional<z.ZodEnum<{
|
|
103
|
+
cleanup: "cleanup";
|
|
104
|
+
clone: "clone";
|
|
105
|
+
run: "run";
|
|
106
|
+
}>>;
|
|
107
|
+
logsTail: z.ZodOptional<z.ZodString>;
|
|
108
|
+
artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
109
|
+
name: z.ZodString;
|
|
110
|
+
ref: z.ZodString;
|
|
111
|
+
kind: z.ZodString;
|
|
112
|
+
sizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
sha256: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, z.core.$strip>>>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
export declare const ProviderKindSchema: z.ZodEnum<{
|
|
117
|
+
"claude-code-oauth": "claude-code-oauth";
|
|
118
|
+
"codex-oauth": "codex-oauth";
|
|
119
|
+
"opencode-go-oauth": "opencode-go-oauth";
|
|
120
|
+
"pi-dev": "pi-dev";
|
|
121
|
+
}>;
|
|
122
|
+
export type ProviderKind = z.infer<typeof ProviderKindSchema>;
|
|
123
|
+
/** A single piece of provider session material referenced by an opaque handle —
|
|
124
|
+
* never the raw secret. The broker resolves `handle` to real material at mount
|
|
125
|
+
* time; the handle is safe to persist in a job record. */
|
|
126
|
+
export declare const ProviderSecretRefSchema: z.ZodObject<{
|
|
127
|
+
name: z.ZodString;
|
|
128
|
+
handle: z.ZodString;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
export type ProviderSecretRef = z.infer<typeof ProviderSecretRefSchema>;
|
|
131
|
+
/** A job-scoped bundle of provider session material. Scoped to exactly one job
|
|
132
|
+
* (`jobId`) so it is never ambient/shared runner state, and holds only opaque
|
|
133
|
+
* secret refs so raw OAuth material is never persisted. */
|
|
134
|
+
export declare const ProviderSessionBundleSchema: z.ZodObject<{
|
|
135
|
+
provider: z.ZodEnum<{
|
|
136
|
+
"claude-code-oauth": "claude-code-oauth";
|
|
137
|
+
"codex-oauth": "codex-oauth";
|
|
138
|
+
"opencode-go-oauth": "opencode-go-oauth";
|
|
139
|
+
"pi-dev": "pi-dev";
|
|
140
|
+
}>;
|
|
141
|
+
jobId: z.ZodString;
|
|
142
|
+
mountPath: z.ZodString;
|
|
143
|
+
secrets: z.ZodArray<z.ZodObject<{
|
|
144
|
+
name: z.ZodString;
|
|
145
|
+
handle: z.ZodString;
|
|
146
|
+
}, z.core.$strip>>;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
export type ProviderSessionBundle = z.infer<typeof ProviderSessionBundleSchema>;
|
|
149
|
+
export type HostedJobStatus = z.infer<typeof HostedJobStatusSchema>;
|
|
150
|
+
export type HostedJobRequest = z.infer<typeof HostedJobRequestSchema>;
|
|
151
|
+
export type HostedJobEvent = z.infer<typeof HostedJobEventSchema>;
|
|
152
|
+
export type RunnerLease = z.infer<typeof RunnerLeaseSchema>;
|
|
153
|
+
export type HostedJobOutcome = z.infer<typeof HostedJobOutcomeSchema>;
|
|
154
|
+
export type HostedJobResult = z.infer<typeof HostedJobResultSchema>;
|
|
155
|
+
/** True only when the flag is exactly '1' — every other/absent value is off (default off). */
|
|
156
|
+
export declare function hostedExecEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
157
|
+
export interface HostedContractDemoResult {
|
|
158
|
+
enabled: boolean;
|
|
159
|
+
trace: string;
|
|
160
|
+
request?: HostedJobRequest;
|
|
161
|
+
event?: HostedJobEvent;
|
|
162
|
+
lease?: RunnerLease;
|
|
163
|
+
}
|
|
164
|
+
/** Pure demo: job requested -> event emitted -> runner leaseable. Constructs
|
|
165
|
+
* nothing when the flag is off — no fs, no network, no child_process, no Docker. */
|
|
166
|
+
export declare function runHostedContractDemo(env?: NodeJS.ProcessEnv): HostedContractDemoResult;
|
|
167
|
+
//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AMtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,8FAA8F;AAC9F,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAE/E;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AAMD;oFACoF;AACpF,wBAAgB,qBAAqB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,wBAAwB,CAkCpG"}
|
package/dist/hosted.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// src/hosted.ts — Hosted (remote-runner) execution contract: shared vocabulary and
|
|
2
|
+
// off-by-default safety switch for the hosted-exec architecture (#896, parent #895).
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export const HOSTED_EXEC_FLAG = 'FACTORY_HOSTED_EXEC';
|
|
5
|
+
export const HostedJobStatusSchema = z.enum(['requested', 'leased', 'running', 'done', 'failed', 'canceled']);
|
|
6
|
+
export const HostedJobRequestSchema = z.object({
|
|
7
|
+
jobId: z.string().min(1),
|
|
8
|
+
/** "owner/repo" */
|
|
9
|
+
repoSlug: z.string().min(1),
|
|
10
|
+
/** Opaque task description. */
|
|
11
|
+
taskPayload: z.string().min(1),
|
|
12
|
+
requiredCapabilities: z.array(z.string().min(1)),
|
|
13
|
+
requiredAuthority: z.string().min(1),
|
|
14
|
+
status: HostedJobStatusSchema,
|
|
15
|
+
/** ISO-8601. */
|
|
16
|
+
createdAt: z.string(),
|
|
17
|
+
});
|
|
18
|
+
export const HostedJobEventTypeSchema = z.enum([
|
|
19
|
+
'requested',
|
|
20
|
+
'leased',
|
|
21
|
+
'heartbeat',
|
|
22
|
+
'completed',
|
|
23
|
+
'failed',
|
|
24
|
+
'expired',
|
|
25
|
+
'cleaned',
|
|
26
|
+
'canceled',
|
|
27
|
+
'watchdog',
|
|
28
|
+
]);
|
|
29
|
+
export const HostedJobEventSeveritySchema = z.enum(['info', 'warn', 'error']);
|
|
30
|
+
export const HostedJobEventSchema = z.object({
|
|
31
|
+
jobId: z.string().min(1),
|
|
32
|
+
type: HostedJobEventTypeSchema,
|
|
33
|
+
/** ISO-8601. */
|
|
34
|
+
ts: z.string(),
|
|
35
|
+
severity: HostedJobEventSeveritySchema,
|
|
36
|
+
message: z.string().min(1),
|
|
37
|
+
});
|
|
38
|
+
export const RunnerLeaseSchema = z.object({
|
|
39
|
+
runnerId: z.string().min(1),
|
|
40
|
+
leaseId: z.string().min(1),
|
|
41
|
+
jobId: z.string().min(1),
|
|
42
|
+
/** ISO-8601 expiry. */
|
|
43
|
+
expiresAt: z.string(),
|
|
44
|
+
/** Heartbeat expectation. */
|
|
45
|
+
heartbeatIntervalMs: z.number().int().positive(),
|
|
46
|
+
});
|
|
47
|
+
export const HostedJobPhaseSchema = z.enum(['clone', 'run', 'cleanup']);
|
|
48
|
+
/** Metadata-only reference to a produced artifact — never inline content or a
|
|
49
|
+
* secret value. `ref` is an opaque retained handle (a path or store handle). */
|
|
50
|
+
export const HostedArtifactRefSchema = z.object({
|
|
51
|
+
/** Display/logical name, e.g. 'build.log', 'coverage'. */
|
|
52
|
+
name: z.string().min(1),
|
|
53
|
+
/** Opaque retained reference — a path or store handle. NEVER inline content. */
|
|
54
|
+
ref: z.string().min(1),
|
|
55
|
+
/** e.g. 'log', 'report', 'patch'. */
|
|
56
|
+
kind: z.string().min(1),
|
|
57
|
+
sizeBytes: z.number().int().nonnegative().optional(),
|
|
58
|
+
sha256: z.string().optional(),
|
|
59
|
+
});
|
|
60
|
+
export const HostedJobOutcomeSchema = z.enum(['completed', 'failed', 'canceled']);
|
|
61
|
+
export const HostedJobResultSchema = z.object({
|
|
62
|
+
jobId: z.string().min(1),
|
|
63
|
+
outcome: HostedJobOutcomeSchema,
|
|
64
|
+
summary: z.string().min(1),
|
|
65
|
+
/** ISO-8601. */
|
|
66
|
+
finishedAt: z.string(),
|
|
67
|
+
/** Container/process exit code when a process ran. */
|
|
68
|
+
exitCode: z.number().int().optional(),
|
|
69
|
+
/** Phase reached when the job failed — diagnosis aid. */
|
|
70
|
+
failurePhase: HostedJobPhaseSchema.optional(),
|
|
71
|
+
/** Bounded tail of recent logs; MUST already be secret-redacted by the caller. */
|
|
72
|
+
logsTail: z.string().optional(),
|
|
73
|
+
/** Metadata for produced artifacts; never inline content or secret values. */
|
|
74
|
+
artifacts: z.array(HostedArtifactRefSchema).optional(),
|
|
75
|
+
});
|
|
76
|
+
export const ProviderKindSchema = z.enum(['codex-oauth', 'claude-code-oauth', 'opencode-go-oauth', 'pi-dev']);
|
|
77
|
+
/** A single piece of provider session material referenced by an opaque handle —
|
|
78
|
+
* never the raw secret. The broker resolves `handle` to real material at mount
|
|
79
|
+
* time; the handle is safe to persist in a job record. */
|
|
80
|
+
export const ProviderSecretRefSchema = z.object({
|
|
81
|
+
/** Logical name inside the provider's session, e.g. 'oauth_token', 'refresh_token'. */
|
|
82
|
+
name: z.string().min(1),
|
|
83
|
+
/** Opaque broker handle; NEVER the secret value. */
|
|
84
|
+
handle: z.string().min(1),
|
|
85
|
+
});
|
|
86
|
+
/** A job-scoped bundle of provider session material. Scoped to exactly one job
|
|
87
|
+
* (`jobId`) so it is never ambient/shared runner state, and holds only opaque
|
|
88
|
+
* secret refs so raw OAuth material is never persisted. */
|
|
89
|
+
export const ProviderSessionBundleSchema = z.object({
|
|
90
|
+
provider: ProviderKindSchema,
|
|
91
|
+
jobId: z.string().min(1),
|
|
92
|
+
/** Where the provider CLI expects its session dir inside the container, e.g. '/root/.codex'. */
|
|
93
|
+
mountPath: z.string().min(1),
|
|
94
|
+
secrets: z.array(ProviderSecretRefSchema).min(1),
|
|
95
|
+
});
|
|
96
|
+
/** True only when the flag is exactly '1' — every other/absent value is off (default off). */
|
|
97
|
+
export function hostedExecEnabled(env = process.env) {
|
|
98
|
+
return env[HOSTED_EXEC_FLAG] === '1';
|
|
99
|
+
}
|
|
100
|
+
/** Fixed literal timestamp — this is a contract proof, not a live run, so the
|
|
101
|
+
* output is deterministic and no clock is read. */
|
|
102
|
+
const DEMO_TS = '2026-01-01T00:00:00.000Z';
|
|
103
|
+
/** Pure demo: job requested -> event emitted -> runner leaseable. Constructs
|
|
104
|
+
* nothing when the flag is off — no fs, no network, no child_process, no Docker. */
|
|
105
|
+
export function runHostedContractDemo(env = process.env) {
|
|
106
|
+
if (!hostedExecEnabled(env)) {
|
|
107
|
+
return { enabled: false, trace: 'hosted execution disabled — local path unchanged' };
|
|
108
|
+
}
|
|
109
|
+
const request = HostedJobRequestSchema.parse({
|
|
110
|
+
jobId: 'demo-job-1',
|
|
111
|
+
repoSlug: 'on-par/software-factory',
|
|
112
|
+
taskPayload: 'demo: prove the hosted contract path',
|
|
113
|
+
requiredCapabilities: ['git', 'node'],
|
|
114
|
+
requiredAuthority: 'repo:write',
|
|
115
|
+
status: 'requested',
|
|
116
|
+
createdAt: DEMO_TS,
|
|
117
|
+
});
|
|
118
|
+
const event = HostedJobEventSchema.parse({
|
|
119
|
+
jobId: request.jobId,
|
|
120
|
+
type: 'requested',
|
|
121
|
+
ts: DEMO_TS,
|
|
122
|
+
severity: 'info',
|
|
123
|
+
message: 'hosted job requested',
|
|
124
|
+
});
|
|
125
|
+
const lease = RunnerLeaseSchema.parse({
|
|
126
|
+
runnerId: 'demo-runner-1',
|
|
127
|
+
leaseId: 'demo-lease-1',
|
|
128
|
+
jobId: request.jobId,
|
|
129
|
+
expiresAt: DEMO_TS,
|
|
130
|
+
heartbeatIntervalMs: 30_000,
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
enabled: true,
|
|
134
|
+
request,
|
|
135
|
+
event,
|
|
136
|
+
lease,
|
|
137
|
+
trace: 'job requested -> event emitted -> runner leaseable',
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=hosted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosted.js","sourceRoot":"","sources":["../src/hosted.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,qFAAqF;AACrF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAEtD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;AAE9G,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,mBAAmB;IACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,+BAA+B;IAC/B,WAAW,EAAE,CAAC,CAAC,MAAM,E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
|
+
export * from './hosted.js';
|
|
5
|
+
export * from './issue.js';
|
|
6
|
+
export * from './lifecycle.js';
|
|
7
|
+
export * from './serde.js';
|
|
8
|
+
export * from './trace.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/index.ts — @on-par/contracts public surface (#466).
|
|
2
|
+
export * from './adr.js';
|
|
3
|
+
export * from './design.js';
|
|
4
|
+
export * from './gherkin.js';
|
|
5
|
+
export * from './hosted.js';
|
|
6
|
+
export * from './issue.js';
|
|
7
|
+
export * from './lifecycle.js';
|
|
8
|
+
export * from './serde.js';
|
|
9
|
+
export * from './trace.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
package/dist/issue.d.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Bumped when a field is removed or its meaning changes; additive fields do not bump it. */
|
|
3
|
+
export declare const CONTRACTS_SCHEMA_VERSION = 1;
|
|
4
|
+
export declare const IssueKindSchema: z.ZodEnum<{
|
|
5
|
+
bug: "bug";
|
|
6
|
+
epic: "epic";
|
|
7
|
+
story: "story";
|
|
8
|
+
task: "task";
|
|
9
|
+
}>;
|
|
10
|
+
export declare const EngineeringReadyIssueSchema: z.ZodObject<{
|
|
11
|
+
schemaVersion: z.ZodDefault<z.ZodLiteral<1>>;
|
|
12
|
+
number: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
kind: z.ZodEnum<{
|
|
14
|
+
bug: "bug";
|
|
15
|
+
epic: "epic";
|
|
16
|
+
story: "story";
|
|
17
|
+
task: "task";
|
|
18
|
+
}>;
|
|
19
|
+
title: z.ZodString;
|
|
20
|
+
problemStatement: z.ZodString;
|
|
21
|
+
inScope: z.ZodArray<z.ZodString>;
|
|
22
|
+
outOfScope: z.ZodArray<z.ZodString>;
|
|
23
|
+
acceptanceCriteria: z.ZodArray<z.ZodObject<{
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
given: z.ZodArray<z.ZodString>;
|
|
26
|
+
when: z.ZodArray<z.ZodString>;
|
|
27
|
+
then: z.ZodArray<z.ZodString>;
|
|
28
|
+
tracesTo: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
verification: z.ZodArray<z.ZodObject<{
|
|
31
|
+
command: z.ZodString;
|
|
32
|
+
passWhen: z.ZodString;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
filesLikelyTouched: z.ZodArray<z.ZodString>;
|
|
35
|
+
labels: z.ZodArray<z.ZodString>;
|
|
36
|
+
tracesTo: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export declare const StorySchema: z.ZodObject<{
|
|
39
|
+
schemaVersion: z.ZodDefault<z.ZodLiteral<1>>;
|
|
40
|
+
number: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
title: z.ZodString;
|
|
42
|
+
problemStatement: z.ZodString;
|
|
43
|
+
inScope: z.ZodArray<z.ZodString>;
|
|
44
|
+
outOfScope: z.ZodArray<z.ZodString>;
|
|
45
|
+
acceptanceCriteria: z.ZodArray<z.ZodObject<{
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
given: z.ZodArray<z.ZodString>;
|
|
48
|
+
when: z.ZodArray<z.ZodString>;
|
|
49
|
+
then: z.ZodArray<z.ZodString>;
|
|
50
|
+
tracesTo: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
verification: z.ZodArray<z.ZodObject<{
|
|
53
|
+
command: z.ZodString;
|
|
54
|
+
passWhen: z.ZodString;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
filesLikelyTouched: z.ZodArray<z.ZodString>;
|
|
57
|
+
labels: z.ZodArray<z.ZodString>;
|
|
58
|
+
tracesTo: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
59
|
+
kind: z.ZodLiteral<"story">;
|
|
60
|
+
role: z.ZodString;
|
|
61
|
+
want: z.ZodString;
|
|
62
|
+
soThat: z.ZodString;
|
|
63
|
+
investNote: z.ZodOptional<z.ZodString>;
|
|
64
|
+
epic: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export declare const EpicSchema: z.ZodObject<{
|
|
67
|
+
schemaVersion: z.ZodDefault<z.ZodLiteral<1>>;
|
|
68
|
+
number: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
kind: z.ZodLiteral<"epic">;
|
|
70
|
+
title: z.ZodString;
|
|
71
|
+
why: z.ZodString;
|
|
72
|
+
doneWhen: z.ZodArray<z.ZodString>;
|
|
73
|
+
children: z.ZodArray<z.ZodString>;
|
|
74
|
+
whatAlreadyExists: z.ZodOptional<z.ZodString>;
|
|
75
|
+
labels: z.ZodArray<z.ZodString>;
|
|
76
|
+
tracesTo: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
export type IssueKind = z.infer<typeof IssueKindSchema>;
|
|
79
|
+
export type EngineeringReadyIssue = z.infer<typeof EngineeringReadyIssueSchema>;
|
|
80
|
+
export type Story = z.infer<typeof StorySchema>;
|
|
81
|
+
export type Epic = z.infer<typeof EpicSchema>;
|
|
82
|
+
//# sourceMappingURL=issue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue.d.ts","sourceRoot":"","sources":["../src/issue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,6FAA6F;AAC7F,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,eAAO,MAAM,eAAe;;;;;EAA2C,CAAC;AAExE,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAetC,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQtB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;iBAarB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAChD,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
package/dist/issue.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// src/issue.ts — The engineering-ready work-item seam: what the proposer exports and the
|
|
2
|
+
// writer ingests (#466). Field names mirror .github/ISSUE_TEMPLATE/*.yml.
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { VerificationStepSchema } from './design.js';
|
|
5
|
+
import { AcceptanceCriterionSchema } from './gherkin.js';
|
|
6
|
+
import { TracesToSchema } from './trace.js';
|
|
7
|
+
/** Bumped when a field is removed or its meaning changes; additive fields do not bump it. */
|
|
8
|
+
export const CONTRACTS_SCHEMA_VERSION = 1;
|
|
9
|
+
export const IssueKindSchema = z.enum(['epic', 'story', 'task', 'bug']);
|
|
10
|
+
export const EngineeringReadyIssueSchema = z.object({
|
|
11
|
+
schemaVersion: z.literal(CONTRACTS_SCHEMA_VERSION).default(CONTRACTS_SCHEMA_VERSION),
|
|
12
|
+
/** GitHub issue number, once filed. Absent while the proposer still holds it. */
|
|
13
|
+
number: z.number().int().positive().optional(),
|
|
14
|
+
kind: IssueKindSchema,
|
|
15
|
+
title: z.string().min(1),
|
|
16
|
+
problemStatement: z.string().min(1),
|
|
17
|
+
inScope: z.array(z.string().min(1)).min(1),
|
|
18
|
+
outOfScope: z.array(z.string().min(1)),
|
|
19
|
+
acceptanceCriteria: z.array(AcceptanceCriterionSchema).min(1),
|
|
20
|
+
verification: z.array(VerificationStepSchema).min(1),
|
|
21
|
+
filesLikelyTouched: z.array(z.string().min(1)),
|
|
22
|
+
labels: z.array(z.string().min(1)),
|
|
23
|
+
/** Intent statement IDs this artifact realizes (#471). Additive — does not bump the schema version. */
|
|
24
|
+
tracesTo: TracesToSchema.default([]),
|
|
25
|
+
});
|
|
26
|
+
export const StorySchema = EngineeringReadyIssueSchema.extend({
|
|
27
|
+
kind: z.literal('story'),
|
|
28
|
+
role: z.string().min(1),
|
|
29
|
+
want: z.string().min(1),
|
|
30
|
+
soThat: z.string().min(1),
|
|
31
|
+
investNote: z.string().min(1).optional(),
|
|
32
|
+
/** Parent epic's GitHub issue number. */
|
|
33
|
+
epic: z.number().int().positive().optional(),
|
|
34
|
+
});
|
|
35
|
+
export const EpicSchema = z.object({
|
|
36
|
+
schemaVersion: z.literal(CONTRACTS_SCHEMA_VERSION).default(CONTRACTS_SCHEMA_VERSION),
|
|
37
|
+
number: z.number().int().positive().optional(),
|
|
38
|
+
kind: z.literal('epic'),
|
|
39
|
+
title: z.string().min(1),
|
|
40
|
+
why: z.string().min(1),
|
|
41
|
+
doneWhen: z.array(z.string().min(1)).min(1),
|
|
42
|
+
/** Child stories: titles or "#123" references, in build order. */
|
|
43
|
+
children: z.array(z.string().min(1)),
|
|
44
|
+
whatAlreadyExists: z.string().min(1).optional(),
|
|
45
|
+
labels: z.array(z.string().min(1)),
|
|
46
|
+
/** Intent statement IDs this artifact realizes (#471). Additive — does not bump the schema version. */
|
|
47
|
+
tracesTo: TracesToSchema.default([]),
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=issue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue.js","sourceRoot":"","sources":["../src/issue.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,0EAA0E;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,6FAA6F;AAC7F,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAE1C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,OAAO,CAAC,wBAAwB,CAAC;IACpF,iFAAiF;IACjF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC9C,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,CAAC,C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to match FactoryEvent.phase. */
|
|
3
|
+
export declare const LANE_LIFECYCLE_PHASES: readonly ['plan', 'build', 'check', 'ship'];
|
|
4
|
+
export declare const LaneLifecyclePhaseSchema: z.ZodEnum<{
|
|
5
|
+
build: "build";
|
|
6
|
+
check: "check";
|
|
7
|
+
plan: "plan";
|
|
8
|
+
ship: "ship";
|
|
9
|
+
}>;
|
|
10
|
+
export declare const LaneLifecycleStatusSchema: z.ZodEnum<{
|
|
11
|
+
done: "done";
|
|
12
|
+
failed: "failed";
|
|
13
|
+
progress: "progress";
|
|
14
|
+
started: "started";
|
|
15
|
+
}>;
|
|
16
|
+
export declare const LaneLifecycleEventSchema: z.ZodObject<{
|
|
17
|
+
ts: z.ZodString;
|
|
18
|
+
laneId: z.ZodString;
|
|
19
|
+
issueId: z.ZodString;
|
|
20
|
+
phase: z.ZodEnum<{
|
|
21
|
+
build: "build";
|
|
22
|
+
check: "check";
|
|
23
|
+
plan: "plan";
|
|
24
|
+
ship: "ship";
|
|
25
|
+
}>;
|
|
26
|
+
status: z.ZodEnum<{
|
|
27
|
+
done: "done";
|
|
28
|
+
failed: "failed";
|
|
29
|
+
progress: "progress";
|
|
30
|
+
started: "started";
|
|
31
|
+
}>;
|
|
32
|
+
detail: z.ZodString;
|
|
33
|
+
worktreePath: z.ZodString;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type LaneLifecyclePhase = z.infer<typeof LaneLifecyclePhaseSchema>;
|
|
36
|
+
export type LaneLifecycleStatus = z.infer<typeof LaneLifecycleStatusSchema>;
|
|
37
|
+
export type LaneLifecycleEvent = z.infer<typeof LaneLifecycleEventSchema>;
|
|
38
|
+
/** A lifecycle event annotated with the attached repository that produced it —
|
|
39
|
+
* the shape the server puts on the wire (`owner/name`). */
|
|
40
|
+
export declare const RepositoryLaneLifecycleEventSchema: z.ZodObject<{
|
|
41
|
+
ts: z.ZodString;
|
|
42
|
+
laneId: z.ZodString;
|
|
43
|
+
issueId: z.ZodString;
|
|
44
|
+
phase: z.ZodEnum<{
|
|
45
|
+
build: "build";
|
|
46
|
+
check: "check";
|
|
47
|
+
plan: "plan";
|
|
48
|
+
ship: "ship";
|
|
49
|
+
}>;
|
|
50
|
+
status: z.ZodEnum<{
|
|
51
|
+
done: "done";
|
|
52
|
+
failed: "failed";
|
|
53
|
+
progress: "progress";
|
|
54
|
+
started: "started";
|
|
55
|
+
}>;
|
|
56
|
+
detail: z.ZodString;
|
|
57
|
+
worktreePath: z.ZodString;
|
|
58
|
+
repo: z.ZodString;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
export type RepositoryLaneLifecycleEvent = z.infer<typeof RepositoryLaneLifecycleEventSchema>;
|
|
61
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oFAAoF;AACpF,eAAO,MAAM,qBAAqB,YAAI,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAEjF,eAAO,MAAM,wBAAwB;;;;;EAAgC,CAAC;AACtE,eAAO,MAAM,yBAAyB;;;;;EAAoD,CAAC;AAE3F,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;iBASnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;2DAC2D;AAC3D,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;iBAE7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/lifecycle.ts — Lane lifecycle event: the engine's in-process progress seam (#591).
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/** The four boss-worker-checker phases, lower-cased to match FactoryEvent.phase. */
|
|
4
|
+
export const LANE_LIFECYCLE_PHASES = ['plan', 'build', 'check', 'ship'];
|
|
5
|
+
export const LaneLifecyclePhaseSchema = z.enum(LANE_LIFECYCLE_PHASES);
|
|
6
|
+
export const LaneLifecycleStatusSchema = z.enum(['started', 'progress', 'done', 'failed']);
|
|
7
|
+
export const LaneLifecycleEventSchema = z.object({
|
|
8
|
+
/** ISO-8601, same clock format as FactoryEvent.ts. */
|
|
9
|
+
ts: z.string(),
|
|
10
|
+
laneId: z.string(),
|
|
11
|
+
issueId: z.string(),
|
|
12
|
+
phase: LaneLifecyclePhaseSchema,
|
|
13
|
+
status: LaneLifecycleStatusSchema,
|
|
14
|
+
detail: z.string(),
|
|
15
|
+
worktreePath: z.string(),
|
|
16
|
+
});
|
|
17
|
+
/** A lifecycle event annotated with the attached repository that produced it —
|
|
18
|
+
* the shape the server puts on the wire (`owner/name`). */
|
|
19
|
+
export const RepositoryLaneLifecycleEventSchema = LaneLifecycleEventSchema.extend({
|
|
20
|
+
repo: z.string().min(1),
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oFAAoF;AACpF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAEjF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE3F,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,sDAAsD;IACtD,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,wBAAwB;IAC/B,MAAM,EAAE,yBAAyB;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC;AAMH;2DAC2D;AAC3D,MAAM,CAAC,MAAM,kCAAkC,GAAG,wBAAwB,CAAC,MAAM,CAAC;IAChF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACxB,CAAC,CAAC"}
|
package/dist/serde.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
/** Validate then JSON-encode. Throws ZodError when `value` does not satisfy `schema`. */
|
|
3
|
+
export declare function serialize<T>(schema: z.ZodType<T>, value: T): string;
|
|
4
|
+
/** JSON-decode then validate. Throws SyntaxError or ZodError. */
|
|
5
|
+
export declare function deserialize<T>(schema: z.ZodType<T>, raw: string): T;
|
|
6
|
+
export type DeserializeResult<T> = {
|
|
7
|
+
ok: true;
|
|
8
|
+
value: T;
|
|
9
|
+
} | {
|
|
10
|
+
ok: false;
|
|
11
|
+
errors: string[];
|
|
12
|
+
};
|
|
13
|
+
/** Non-throwing `deserialize`. Malformed JSON reports `['json: <message>']`. */
|
|
14
|
+
export declare function tryDeserialize<T>(schema: z.ZodType<T>, raw: string): DeserializeResult<T>;
|
|
15
|
+
//# sourceMappingURL=serde.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serde.d.ts","sourceRoot":"","sources":["../src/serde.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAM7B,yFAAyF;AACzF,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAEnE;AAED,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,CAEnE;AAED,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAE5F,gFAAgF;AAChF,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAC,CAAC,CAAC,CASzF"}
|
package/dist/serde.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function formatIssues(error) {
|
|
2
|
+
return error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`);
|
|
3
|
+
}
|
|
4
|
+
/** Validate then JSON-encode. Throws ZodError when `value` does not satisfy `schema`. */
|
|
5
|
+
export function serialize(schema, value) {
|
|
6
|
+
return JSON.stringify(schema.parse(value));
|
|
7
|
+
}
|
|
8
|
+
/** JSON-decode then validate. Throws SyntaxError or ZodError. */
|
|
9
|
+
export function deserialize(schema, raw) {
|
|
10
|
+
return schema.parse(JSON.parse(raw));
|
|
11
|
+
}
|
|
12
|
+
/** Non-throwing `deserialize`. Malformed JSON reports `['json: <message>']`. */
|
|
13
|
+
export function tryDeserialize(schema, raw) {
|
|
14
|
+
let parsed;
|
|
15
|
+
try {
|
|
16
|
+
parsed = JSON.parse(raw);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
return { ok: false, errors: [`json: ${error instanceof Error ? error.message : String(error)}`] };
|
|
20
|
+
}
|
|
21
|
+
const result = schema.safeParse(parsed);
|
|
22
|
+
return result.success ? { ok: true, value: result.data } : { ok: false, errors: formatIssues(result.error) };
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=serde.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serde.js","sourceRoot":"","sources":["../src/serde.ts"],"names":[],"mappings":"AAIA,SAAS,YAAY,CAAC,KAAiB;IACrC,OAAO,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AAClF,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,SAAS,CAAI,MAAoB,EAAE,KAAQ;IACzD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7C,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,WAAW,CAAI,MAAoB,EAAE,GAAW;IAC9D,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AACvC,CAAC;AAID,gFAAgF;AAChF,MAAM,UAAU,cAAc,CAAI,MAAoB,EAAE,GAAW;IACjE,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,K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