@wizardingcode/shibaox-schemas 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/gate.js ADDED
@@ -0,0 +1,51 @@
1
+ import { z } from 'zod';
2
+ import { Id } from './common.js';
3
+ const base = { name: Id };
4
+ export const CheckSchema = z.discriminatedUnion('type', [
5
+ z.object({
6
+ ...base,
7
+ type: z.literal('code'),
8
+ command: z.string().min(1),
9
+ timeout_ms: z.number().int().positive().default(300_000),
10
+ }),
11
+ /** Runs the project's own test runner, detected in the workspace (npm/pnpm/yarn/bun test, pytest, go test, cargo test, make test, phpunit, rspec). */
12
+ z.object({
13
+ ...base,
14
+ type: z.literal('tests'),
15
+ timeout_ms: z.number().int().positive().default(300_000),
16
+ }),
17
+ /** Runs the project's linter, detected in the workspace (lint script, biome, eslint, ruff, phpstan, golangci-lint/go vet, clippy, make lint), or `command`. */
18
+ z.object({
19
+ ...base,
20
+ type: z.literal('lint'),
21
+ command: z.string().min(1).optional(),
22
+ timeout_ms: z.number().int().positive().default(300_000),
23
+ }),
24
+ /** A code review by the judge model, criterion by criterion (the built-in rubric when none is given). */
25
+ z.object({
26
+ ...base,
27
+ type: z.literal('review'),
28
+ criteria: z.array(z.string().min(1)).min(1).optional(),
29
+ }),
30
+ z.object({
31
+ ...base,
32
+ type: z.literal('jev'),
33
+ question: z.string().min(1),
34
+ kind: z.enum(['noul', 'score']).default('noul'),
35
+ threshold: z.number().min(0).max(1).default(0.8),
36
+ }),
37
+ z.object({ ...base, type: z.literal('judge'), role: Id, rubric: z.string().min(1) }),
38
+ z.object({ ...base, type: z.literal('human'), prompt: z.string().min(1) }),
39
+ z.object({
40
+ ...base,
41
+ type: z.literal('mock'),
42
+ passes: z.boolean(),
43
+ evidence: z.string().default('mock check'),
44
+ }),
45
+ ]);
46
+ export const GateSchema = z.object({
47
+ gate: Id,
48
+ description: z.string().optional(),
49
+ checks: z.array(CheckSchema).min(1),
50
+ });
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CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;KAC3C,CAAC;CACH,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,IAAI,EAAE,EAAE;IACR,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CACpC,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare const SCHEMAS_VERSION = "0.0.1";
2
+ export * from './catalog.js';
3
+ export * from './common.js';
4
+ export * from './events.js';
5
+ export * from './gate.js';
6
+ export * from './load.js';
7
+ export * from './models.js';
8
+ export * from './org.js';
9
+ export * from './role.js';
10
+ export * from './team.js';
11
+ export * from './workflow.js';
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ export const SCHEMAS_VERSION = '0.0.1';
2
+ export * from './catalog.js';
3
+ export * from './common.js';
4
+ export * from './events.js';
5
+ export * from './gate.js';
6
+ export * from './load.js';
7
+ export * from './models.js';
8
+ export * from './org.js';
9
+ export * from './role.js';
10
+ export * from './team.js';
11
+ export * from './workflow.js';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,OAAO,CAAC;AAEvC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC"}
package/dist/load.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import { type CatalogEntry } from './catalog.js';
2
+ import { type Gate } from './gate.js';
3
+ import { type Models } from './models.js';
4
+ import { type OrgFile } from './org.js';
5
+ import { type Role } from './role.js';
6
+ import { type Team } from './team.js';
7
+ import { type Workflow } from './workflow.js';
8
+ export interface Org {
9
+ root: string;
10
+ org: OrgFile;
11
+ models: Models;
12
+ teams: Record<string, Team>;
13
+ roles: Record<string, Role>;
14
+ workflows: Record<string, Workflow>;
15
+ gates: Record<string, Gate>;
16
+ catalog: Record<string, CatalogEntry>;
17
+ }
18
+ export declare class OrgLoadError extends Error {
19
+ readonly file: string;
20
+ constructor(file: string, message: string);
21
+ }
22
+ export declare function loadOrg(root: string): Org;
package/dist/load.js ADDED
@@ -0,0 +1,103 @@
1
+ import { existsSync, readdirSync, readFileSync } from 'node:fs';
2
+ import { join, relative } from 'node:path';
3
+ import { parse as parseYaml } from 'yaml';
4
+ import { CatalogEntrySchema } from './catalog.js';
5
+ import { GateSchema } from './gate.js';
6
+ import { ModelsSchema } from './models.js';
7
+ import { OrgFileSchema } from './org.js';
8
+ import { RoleSchema } from './role.js';
9
+ import { TeamSchema } from './team.js';
10
+ import { WorkflowSchema } from './workflow.js';
11
+ export class OrgLoadError extends Error {
12
+ file;
13
+ constructor(file, message) {
14
+ super(`${file}: ${message}`);
15
+ this.file = file;
16
+ this.name = 'OrgLoadError';
17
+ }
18
+ }
19
+ function readYamlFile(root, rel, schema) {
20
+ const file = join(root, rel);
21
+ let raw;
22
+ try {
23
+ raw = parseYaml(readFileSync(file, 'utf8'));
24
+ }
25
+ catch (e) {
26
+ throw new OrgLoadError(relative(root, file), e.message);
27
+ }
28
+ const result = schema.safeParse(raw);
29
+ if (!result.success) {
30
+ const msg = result.error.issues
31
+ .map((i) => `${i.path.join('.') || '(root)'}: ${i.message}`)
32
+ .join('; ');
33
+ throw new OrgLoadError(rel, msg);
34
+ }
35
+ return result.data;
36
+ }
37
+ function readDir(root, sub, schema, key, kind) {
38
+ const dir = join(root, sub);
39
+ if (!existsSync(dir))
40
+ return { items: {}, files: {} };
41
+ const items = {};
42
+ const files = {};
43
+ for (const name of readdirSync(dir)
44
+ .filter((f) => /\.ya?ml$/.test(f))
45
+ .sort()) {
46
+ const file = join(sub, name);
47
+ const item = readYamlFile(root, file, schema);
48
+ const id = String(item[key]);
49
+ const existingFile = files[id];
50
+ if (existingFile) {
51
+ throw new OrgLoadError(file, `duplicate ${kind} id "${id}" also defined in ${existingFile}`);
52
+ }
53
+ items[id] = item;
54
+ files[id] = file;
55
+ }
56
+ return { items, files };
57
+ }
58
+ export function loadOrg(root) {
59
+ if (!existsSync(join(root, 'org.yaml')))
60
+ throw new OrgLoadError('org.yaml', 'file not found');
61
+ const org = readYamlFile(root, 'org.yaml', OrgFileSchema);
62
+ const models = existsSync(join(root, 'models.yaml'))
63
+ ? readYamlFile(root, 'models.yaml', ModelsSchema)
64
+ : ModelsSchema.parse({});
65
+ const { items: teams, files: teamFiles } = readDir(root, 'teams', TeamSchema, 'team', 'team');
66
+ const { items: roles } = readDir(root, 'roles', RoleSchema, 'role', 'role');
67
+ const { items: workflows, files: workflowFiles } = readDir(root, 'workflows', WorkflowSchema, 'workflow', 'workflow');
68
+ const { items: gates } = readDir(root, 'gates', GateSchema, 'gate', 'gate');
69
+ const { items: catalog } = readDir(root, 'catalog', CatalogEntrySchema, 'id', 'catalog entry');
70
+ for (const t of org.teams) {
71
+ if (!teams[t])
72
+ throw new OrgLoadError('org.yaml', `team "${t}" has no file in teams/`);
73
+ }
74
+ for (const [name, team] of Object.entries(teams)) {
75
+ const file = teamFiles[name] ?? `teams/${name}.yaml`;
76
+ if (!roles[team.lead])
77
+ throw new OrgLoadError(file, `lead role "${team.lead}" is not defined in roles/`);
78
+ for (const r of team.roles)
79
+ if (!roles[r])
80
+ throw new OrgLoadError(file, `role "${r}" is not defined in roles/`);
81
+ for (const g of team.gates)
82
+ if (!gates[g])
83
+ throw new OrgLoadError(file, `gate "${g}" is not defined in gates/`);
84
+ for (const w of team.workflows)
85
+ if (!workflows[w])
86
+ throw new OrgLoadError(file, `workflow "${w}" is not defined in workflows/`);
87
+ }
88
+ for (const [name, wf] of Object.entries(workflows)) {
89
+ const file = workflowFiles[name] ?? `workflows/${name}.yaml`;
90
+ if (wf.team && !teams[wf.team])
91
+ throw new OrgLoadError(file, `team "${wf.team}" is not defined`);
92
+ for (const [id, node] of Object.entries(wf.nodes)) {
93
+ if (node.type === 'task' && !roles[node.role])
94
+ throw new OrgLoadError(file, `node "${id}" uses role "${node.role}" which is not defined`);
95
+ if (node.type === 'gate')
96
+ for (const g of node.gates)
97
+ if (!gates[g])
98
+ throw new OrgLoadError(file, `node "${id}" uses gate "${g}" which is not defined`);
99
+ }
100
+ }
101
+ return { root, org, models, teams, roles, workflows, gates, catalog };
102
+ }
103
+ //# sourceMappingURL=load.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load.js","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAqB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAa,UAAU,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAe,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAgB,aAAa,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAa,UAAU,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAa,UAAU,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAiB,cAAc,EAAE,MAAM,eAAe,CAAC;AAa9D,MAAM,OAAO,YAAa,SAAQ,KAAK;IAEnB;IADlB,YACkB,IAAY,EAC5B,OAAe;QAEf,KAAK,CAAC,GAAG,IAAI,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,IAAI,KAAK,MAAM;gBACtB,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK;oBACxB,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;wBACX,MAAM,IAAI,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,gBAAgB,CAAC,wBAAwB,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AACxE,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ export declare const ModelsSchema: z.ZodObject<{
3
+ providers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
4
+ api_key_env: z.ZodOptional<z.ZodString>;
5
+ base_url: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>>>;
7
+ tiers: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
8
+ strong: "strong";
9
+ cheap: "cheap";
10
+ local: "local";
11
+ decision: "decision";
12
+ }> & z.core.$partial, z.ZodString>>;
13
+ roles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
14
+ model: z.ZodString;
15
+ runtime: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>>>;
17
+ gates: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
18
+ }, z.core.$strip>;
19
+ export type Models = z.infer<typeof ModelsSchema>;
package/dist/models.js ADDED
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ import { ModelTierSchema } from './common.js';
3
+ export const ModelsSchema = z.object({
4
+ providers: z
5
+ .record(z.string(), z.object({ api_key_env: z.string().optional(), base_url: z.string().optional() }))
6
+ .default({}),
7
+ tiers: z.partialRecord(ModelTierSchema, z.string()).default({}),
8
+ roles: z
9
+ .record(z.string(), z.object({ model: z.string(), runtime: z.string().optional() }))
10
+ .default({}),
11
+ gates: z.record(z.string(), z.string()).default({}),
12
+ });
13
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,SAAS,EAAE,CAAC;SACT,MAAM,CACL,CAAC,CAAC,MAAM,EAAE,EACV,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAClF;SACA,OAAO,CAAC,EAAE,CAAC;IACd,KAAK,EAAE,CAAC,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/D,KAAK,EAAE,CAAC;SACL,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;SACnF,OAAO,CAAC,EAAE,CAAC;IACd,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACpD,CAAC,CAAC"}
package/dist/org.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ export declare const OrgFileSchema: z.ZodObject<{
3
+ organization: z.ZodString;
4
+ budgets: z.ZodDefault<z.ZodObject<{
5
+ monthly_usd: z.ZodOptional<z.ZodNumber>;
6
+ per_run_usd: z.ZodOptional<z.ZodNumber>;
7
+ }, z.core.$strip>>;
8
+ teams: z.ZodDefault<z.ZodArray<z.ZodString>>;
9
+ adapter: z.ZodOptional<z.ZodEnum<{
10
+ mock: "mock";
11
+ direct: "direct";
12
+ "claude-code": "claude-code";
13
+ }>>;
14
+ max_concurrent_runs: z.ZodOptional<z.ZodNumber>;
15
+ vault: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>;
17
+ export type OrgFile = z.infer<typeof OrgFileSchema>;
package/dist/org.js ADDED
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { Id } from './common.js';
3
+ export const OrgFileSchema = z.object({
4
+ organization: Id,
5
+ budgets: z
6
+ .object({
7
+ monthly_usd: z.number().positive().optional(),
8
+ per_run_usd: z.number().positive().optional(),
9
+ })
10
+ .default({}),
11
+ teams: z.array(Id).default([]),
12
+ /** Runtime adapter for task nodes when `--adapter` is not passed (default: mock). */
13
+ adapter: z.enum(['mock', 'direct', 'claude-code']).optional(),
14
+ /** Runs of this org that may execute at once in the daemon (default 2). */
15
+ max_concurrent_runs: z.number().int().positive().optional(),
16
+ /** Obsidian vault path (relative to the org root, or absolute) for run notes. */
17
+ vault: z.string().optional(),
18
+ });
19
+ //# sourceMappingURL=org.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"org.js","sourceRoot":"","sources":["../src/org.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,YAAY,EAAE,EAAE;IAChB,OAAO,EAAE,CAAC;SACP,MAAM,CAAC;QACN,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;QAC7C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;KAC9C,CAAC;SACD,OAAO,CAAC,EAAE,CAAC;IACd,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9B,qFAAqF;IACrF,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC7D,2EAA2E;IAC3E,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC3D,iFAAiF;IACjF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC"}
package/dist/role.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ export declare const RoleSchema: z.ZodObject<{
3
+ role: z.ZodString;
4
+ description: z.ZodOptional<z.ZodString>;
5
+ capabilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
6
+ runtime: z.ZodDefault<z.ZodString>;
7
+ model_tier: z.ZodDefault<z.ZodEnum<{
8
+ strong: "strong";
9
+ cheap: "cheap";
10
+ local: "local";
11
+ decision: "decision";
12
+ }>>;
13
+ system_prompt: z.ZodOptional<z.ZodString>;
14
+ tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
15
+ max_steps: z.ZodOptional<z.ZodNumber>;
16
+ max_turns: z.ZodOptional<z.ZodNumber>;
17
+ budget_usd: z.ZodOptional<z.ZodNumber>;
18
+ permissions: z.ZodDefault<z.ZodObject<{
19
+ fs: z.ZodDefault<z.ZodArray<z.ZodString>>;
20
+ network: z.ZodDefault<z.ZodArray<z.ZodString>>;
21
+ approval_required: z.ZodDefault<z.ZodArray<z.ZodString>>;
22
+ }, z.core.$strip>>;
23
+ }, z.core.$strip>;
24
+ export type Role = z.infer<typeof RoleSchema>;
package/dist/role.js ADDED
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { Id, ModelTierSchema } from './common.js';
3
+ export const RoleSchema = z.object({
4
+ role: Id,
5
+ description: z.string().optional(),
6
+ capabilities: z.array(z.string()).default([]),
7
+ runtime: z.string().default('claude-code'),
8
+ model_tier: ModelTierSchema.default('strong'),
9
+ system_prompt: z.string().optional(),
10
+ tools: z.array(z.string()).default([]),
11
+ /** Tool-loop steps for the direct adapter (default 12). */
12
+ max_steps: z.number().int().positive().optional(),
13
+ /** Agent turns for the Claude Code adapter (default 60). */
14
+ max_turns: z.number().int().positive().optional(),
15
+ /** Cap on what one task of this role may spend (USD), within the run budget. */
16
+ budget_usd: z.number().positive().optional(),
17
+ permissions: z
18
+ .object({
19
+ fs: z.array(z.string()).default(['workspace']),
20
+ network: z.array(z.string()).default([]),
21
+ approval_required: z.array(z.string()).default([]),
22
+ })
23
+ .default(() => ({ fs: ['workspace'], network: [], approval_required: [] })),
24
+ });
25
+ //# sourceMappingURL=role.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.js","sourceRoot":"","sources":["../src/role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,IAAI,EAAE,EAAE;IACR,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC;IAC1C,UAAU,EAAE,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC7C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACtC,2DAA2D;IAC3D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACjD,4DAA4D;IAC5D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACjD,gFAAgF;IAChF,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5C,WAAW,EAAE,CAAC;SACX,MAAM,CAAC;QACN,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;QAC9C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;KACnD,CAAC;SACD,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,CAAC,CAAC;CAC9E,CAAC,CAAC"}
package/dist/team.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ export declare const TeamSchema: z.ZodObject<{
3
+ team: z.ZodString;
4
+ description: z.ZodOptional<z.ZodString>;
5
+ lead: z.ZodString;
6
+ roles: z.ZodArray<z.ZodString>;
7
+ gates: z.ZodDefault<z.ZodArray<z.ZodString>>;
8
+ workflows: z.ZodDefault<z.ZodArray<z.ZodString>>;
9
+ }, z.core.$strip>;
10
+ export type Team = z.infer<typeof TeamSchema>;
package/dist/team.js ADDED
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { Id } from './common.js';
3
+ export const TeamSchema = z.object({
4
+ team: Id,
5
+ description: z.string().optional(),
6
+ lead: Id,
7
+ roles: z.array(Id).min(1),
8
+ gates: z.array(Id).default([]),
9
+ workflows: z.array(Id).default([]),
10
+ });
11
+ //# sourceMappingURL=team.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team.js","sourceRoot":"","sources":["../src/team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,IAAI,EAAE,EAAE;IACR,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9B,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACnC,CAAC,CAAC"}
@@ -0,0 +1,154 @@
1
+ import { z } from 'zod';
2
+ export declare const TaskNodeSchema: z.ZodObject<{
3
+ type: z.ZodLiteral<"task">;
4
+ role: z.ZodString;
5
+ instruction: z.ZodOptional<z.ZodString>;
6
+ next: z.ZodOptional<z.ZodString>;
7
+ }, z.core.$strip>;
8
+ export declare const CodeNodeSchema: z.ZodObject<{
9
+ type: z.ZodLiteral<"code">;
10
+ command: z.ZodString;
11
+ timeout_ms: z.ZodDefault<z.ZodNumber>;
12
+ next: z.ZodOptional<z.ZodString>;
13
+ }, z.core.$strip>;
14
+ export declare const HumanNodeSchema: z.ZodObject<{
15
+ type: z.ZodLiteral<"human">;
16
+ action: z.ZodString;
17
+ prompt: z.ZodOptional<z.ZodString>;
18
+ next: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strip>;
20
+ export declare const DecideNodeSchema: z.ZodObject<{
21
+ type: z.ZodLiteral<"decide">;
22
+ by: z.ZodString;
23
+ question: z.ZodOptional<z.ZodString>;
24
+ options: z.ZodArray<z.ZodString>;
25
+ next: z.ZodRecord<z.ZodString, z.ZodString>;
26
+ }, z.core.$strip>;
27
+ export declare const GateNodeSchema: z.ZodObject<{
28
+ type: z.ZodLiteral<"gate">;
29
+ gates: z.ZodArray<z.ZodString>;
30
+ on_pass: z.ZodString;
31
+ on_fail: z.ZodString;
32
+ max_retries: z.ZodDefault<z.ZodNumber>;
33
+ }, z.core.$strip>;
34
+ /**
35
+ * A git step the daemon runs itself (trusted org config, like `code`): `commit` the workspace,
36
+ * open a `pr` (push + `gh pr create`), or `merge` the run branch on the base through the
37
+ * project's merge queue (rebase, tests, fast-forward, push when there is a remote).
38
+ */
39
+ export declare const GitNodeSchema: z.ZodObject<{
40
+ type: z.ZodLiteral<"git">;
41
+ action: z.ZodEnum<{
42
+ commit: "commit";
43
+ pr: "pr";
44
+ merge: "merge";
45
+ }>;
46
+ message: z.ZodOptional<z.ZodString>;
47
+ base: z.ZodOptional<z.ZodString>;
48
+ tests: z.ZodOptional<z.ZodString>;
49
+ timeout_ms: z.ZodDefault<z.ZodNumber>;
50
+ next: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$strip>;
52
+ export declare const ParallelNodeSchema: z.ZodObject<{
53
+ type: z.ZodLiteral<"parallel">;
54
+ branches: z.ZodArray<z.ZodString>;
55
+ join: z.ZodString;
56
+ }, z.core.$strip>;
57
+ export declare const WorkflowNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
58
+ type: z.ZodLiteral<"task">;
59
+ role: z.ZodString;
60
+ instruction: z.ZodOptional<z.ZodString>;
61
+ next: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$strip>, z.ZodObject<{
63
+ type: z.ZodLiteral<"code">;
64
+ command: z.ZodString;
65
+ timeout_ms: z.ZodDefault<z.ZodNumber>;
66
+ next: z.ZodOptional<z.ZodString>;
67
+ }, z.core.$strip>, z.ZodObject<{
68
+ type: z.ZodLiteral<"human">;
69
+ action: z.ZodString;
70
+ prompt: z.ZodOptional<z.ZodString>;
71
+ next: z.ZodOptional<z.ZodString>;
72
+ }, z.core.$strip>, z.ZodObject<{
73
+ type: z.ZodLiteral<"decide">;
74
+ by: z.ZodString;
75
+ question: z.ZodOptional<z.ZodString>;
76
+ options: z.ZodArray<z.ZodString>;
77
+ next: z.ZodRecord<z.ZodString, z.ZodString>;
78
+ }, z.core.$strip>, z.ZodObject<{
79
+ type: z.ZodLiteral<"gate">;
80
+ gates: z.ZodArray<z.ZodString>;
81
+ on_pass: z.ZodString;
82
+ on_fail: z.ZodString;
83
+ max_retries: z.ZodDefault<z.ZodNumber>;
84
+ }, z.core.$strip>, z.ZodObject<{
85
+ type: z.ZodLiteral<"git">;
86
+ action: z.ZodEnum<{
87
+ commit: "commit";
88
+ pr: "pr";
89
+ merge: "merge";
90
+ }>;
91
+ message: z.ZodOptional<z.ZodString>;
92
+ base: z.ZodOptional<z.ZodString>;
93
+ tests: z.ZodOptional<z.ZodString>;
94
+ timeout_ms: z.ZodDefault<z.ZodNumber>;
95
+ next: z.ZodOptional<z.ZodString>;
96
+ }, z.core.$strip>, z.ZodObject<{
97
+ type: z.ZodLiteral<"parallel">;
98
+ branches: z.ZodArray<z.ZodString>;
99
+ join: z.ZodString;
100
+ }, z.core.$strip>], "type">;
101
+ export type WorkflowNode = z.infer<typeof WorkflowNodeSchema>;
102
+ export declare function transitionsOf(node: WorkflowNode): string[];
103
+ export declare const WorkflowSchema: z.ZodObject<{
104
+ workflow: z.ZodString;
105
+ team: z.ZodOptional<z.ZodString>;
106
+ description: z.ZodOptional<z.ZodString>;
107
+ conversation: z.ZodOptional<z.ZodBoolean>;
108
+ start: z.ZodString;
109
+ nodes: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
110
+ type: z.ZodLiteral<"task">;
111
+ role: z.ZodString;
112
+ instruction: z.ZodOptional<z.ZodString>;
113
+ next: z.ZodOptional<z.ZodString>;
114
+ }, z.core.$strip>, z.ZodObject<{
115
+ type: z.ZodLiteral<"code">;
116
+ command: z.ZodString;
117
+ timeout_ms: z.ZodDefault<z.ZodNumber>;
118
+ next: z.ZodOptional<z.ZodString>;
119
+ }, z.core.$strip>, z.ZodObject<{
120
+ type: z.ZodLiteral<"human">;
121
+ action: z.ZodString;
122
+ prompt: z.ZodOptional<z.ZodString>;
123
+ next: z.ZodOptional<z.ZodString>;
124
+ }, z.core.$strip>, z.ZodObject<{
125
+ type: z.ZodLiteral<"decide">;
126
+ by: z.ZodString;
127
+ question: z.ZodOptional<z.ZodString>;
128
+ options: z.ZodArray<z.ZodString>;
129
+ next: z.ZodRecord<z.ZodString, z.ZodString>;
130
+ }, z.core.$strip>, z.ZodObject<{
131
+ type: z.ZodLiteral<"gate">;
132
+ gates: z.ZodArray<z.ZodString>;
133
+ on_pass: z.ZodString;
134
+ on_fail: z.ZodString;
135
+ max_retries: z.ZodDefault<z.ZodNumber>;
136
+ }, z.core.$strip>, z.ZodObject<{
137
+ type: z.ZodLiteral<"git">;
138
+ action: z.ZodEnum<{
139
+ commit: "commit";
140
+ pr: "pr";
141
+ merge: "merge";
142
+ }>;
143
+ message: z.ZodOptional<z.ZodString>;
144
+ base: z.ZodOptional<z.ZodString>;
145
+ tests: z.ZodOptional<z.ZodString>;
146
+ timeout_ms: z.ZodDefault<z.ZodNumber>;
147
+ next: z.ZodOptional<z.ZodString>;
148
+ }, z.core.$strip>, z.ZodObject<{
149
+ type: z.ZodLiteral<"parallel">;
150
+ branches: z.ZodArray<z.ZodString>;
151
+ join: z.ZodString;
152
+ }, z.core.$strip>], "type">>;
153
+ }, z.core.$strip>;
154
+ export type Workflow = z.infer<typeof WorkflowSchema>;