@offworld/types 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.
@@ -0,0 +1,27 @@
1
+ import { AgentSchema, ArchitectureSchema, ConfigSchema, EntitySchema, EntityTypeSchema, FileIndexEntrySchema, FileIndexSchema, FileRoleSchema, GitProviderSchema, GlobalMapRepoEntrySchema, GlobalMapSchema, InitOptions, LocalRepoSourceSchema, ProjectMapRepoEntrySchema, ProjectMapSchema, ProjectTypeSchema, ReferenceDataSchema, ReferenceMetaSchema, RelationshipSchema, RemoteRepoSourceSchema, RepoSourceSchema } from "./schemas.mjs";
2
+ import { z } from "zod";
3
+
4
+ //#region src/types.d.ts
5
+ type Agent = z.infer<typeof AgentSchema>;
6
+ type Config = z.infer<typeof ConfigSchema>;
7
+ type GitProvider = z.infer<typeof GitProviderSchema>;
8
+ type RemoteRepoSource = z.infer<typeof RemoteRepoSourceSchema>;
9
+ type LocalRepoSource = z.infer<typeof LocalRepoSourceSchema>;
10
+ type RepoSource = z.infer<typeof RepoSourceSchema>;
11
+ type ProjectType = z.infer<typeof ProjectTypeSchema>;
12
+ type EntityType = z.infer<typeof EntityTypeSchema>;
13
+ type Entity = z.infer<typeof EntitySchema>;
14
+ type Relationship = z.infer<typeof RelationshipSchema>;
15
+ type Architecture = z.infer<typeof ArchitectureSchema>;
16
+ type FileRole = z.infer<typeof FileRoleSchema>;
17
+ type FileIndexEntry = z.infer<typeof FileIndexEntrySchema>;
18
+ type FileIndex = z.infer<typeof FileIndexSchema>;
19
+ type ReferenceMeta = z.infer<typeof ReferenceMetaSchema>;
20
+ type ReferenceData = z.infer<typeof ReferenceDataSchema>;
21
+ type GlobalMapRepoEntry = z.infer<typeof GlobalMapRepoEntrySchema>;
22
+ type GlobalMap = z.infer<typeof GlobalMapSchema>;
23
+ type ProjectMapRepoEntry = z.infer<typeof ProjectMapRepoEntrySchema>;
24
+ type ProjectMap = z.infer<typeof ProjectMapSchema>;
25
+ //#endregion
26
+ export { Agent, AgentSchema, Architecture, ArchitectureSchema, Config, ConfigSchema, Entity, EntitySchema, EntityType, EntityTypeSchema, FileIndex, FileIndexEntry, FileIndexEntrySchema, FileIndexSchema, FileRole, FileRoleSchema, GitProvider, GitProviderSchema, GlobalMap, GlobalMapRepoEntry, GlobalMapRepoEntrySchema, GlobalMapSchema, InitOptions, LocalRepoSource, LocalRepoSourceSchema, ProjectMap, ProjectMapRepoEntry, ProjectMapRepoEntrySchema, ProjectMapSchema, ProjectType, ProjectTypeSchema, ReferenceData, ReferenceDataSchema, ReferenceMeta, ReferenceMetaSchema, Relationship, RelationshipSchema, RemoteRepoSource, RemoteRepoSourceSchema, RepoSource, RepoSourceSchema };
27
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;;;KAwBY,KAAA,GAAQ,CAAA,CAAE,KAAA,QAAa,WAAA;AAAA,KACvB,MAAA,GAAS,CAAA,CAAE,KAAA,QAAa,YAAA;AAAA,KAExB,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA;AAAA,KAC7B,gBAAA,GAAmB,CAAA,CAAE,KAAA,QAAa,sBAAA;AAAA,KAClC,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,KACjC,UAAA,GAAa,CAAA,CAAE,KAAA,QAAa,gBAAA;AAAA,KAE5B,WAAA,GAAc,CAAA,CAAE,KAAA,QAAa,iBAAA;AAAA,KAC7B,UAAA,GAAa,CAAA,CAAE,KAAA,QAAa,gBAAA;AAAA,KAC5B,MAAA,GAAS,CAAA,CAAE,KAAA,QAAa,YAAA;AAAA,KACxB,YAAA,GAAe,CAAA,CAAE,KAAA,QAAa,kBAAA;AAAA,KAC9B,YAAA,GAAe,CAAA,CAAE,KAAA,QAAa,kBAAA;AAAA,KAE9B,QAAA,GAAW,CAAA,CAAE,KAAA,QAAa,cAAA;AAAA,KAC1B,cAAA,GAAiB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,KAChC,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,eAAA;AAAA,KAC3B,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,KAE/B,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,KAC/B,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,wBAAA;AAAA,KACpC,SAAA,GAAY,CAAA,CAAE,KAAA,QAAa,eAAA;AAAA,KAC3B,mBAAA,GAAsB,CAAA,CAAE,KAAA,QAAa,yBAAA;AAAA,KACrC,UAAA,GAAa,CAAA,CAAE,KAAA,QAAa,gBAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { AgentSchema, ArchitectureSchema, ConfigSchema, EntitySchema, EntityTypeSchema, FileIndexEntrySchema, FileIndexSchema, FileRoleSchema, GitProviderSchema, GlobalMapRepoEntrySchema, GlobalMapSchema, LocalRepoSourceSchema, ProjectMapRepoEntrySchema, ProjectMapSchema, ProjectTypeSchema, ReferenceDataSchema, ReferenceMetaSchema, RelationshipSchema, RemoteRepoSourceSchema, RepoSourceSchema } from "./schemas.mjs";
2
+
3
+ export { AgentSchema, ArchitectureSchema, ConfigSchema, EntitySchema, EntityTypeSchema, FileIndexEntrySchema, FileIndexSchema, FileRoleSchema, GitProviderSchema, GlobalMapRepoEntrySchema, GlobalMapSchema, LocalRepoSourceSchema, ProjectMapRepoEntrySchema, ProjectMapSchema, ProjectTypeSchema, ReferenceDataSchema, ReferenceMetaSchema, RelationshipSchema, RemoteRepoSourceSchema, RepoSourceSchema };
@@ -0,0 +1,256 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/schemas.d.ts
4
+ /**
5
+ * Supported AI coding agents for skill symlinks.
6
+ * Each agent has a different skill directory location - see packages/sdk/src/agents.ts for registry.
7
+ */
8
+ declare const AgentSchema: z.ZodEnum<{
9
+ opencode: "opencode";
10
+ "claude-code": "claude-code";
11
+ codex: "codex";
12
+ amp: "amp";
13
+ antigravity: "antigravity";
14
+ cursor: "cursor";
15
+ }>;
16
+ declare const ConfigSchema: z.ZodObject<{
17
+ repoRoot: z.ZodDefault<z.ZodString>;
18
+ defaultShallow: z.ZodDefault<z.ZodBoolean>;
19
+ defaultModel: z.ZodDefault<z.ZodString>;
20
+ agents: z.ZodDefault<z.ZodArray<z.ZodEnum<{
21
+ opencode: "opencode";
22
+ "claude-code": "claude-code";
23
+ codex: "codex";
24
+ amp: "amp";
25
+ antigravity: "antigravity";
26
+ cursor: "cursor";
27
+ }>>>;
28
+ }, z.core.$strip>;
29
+ declare const GitProviderSchema: z.ZodEnum<{
30
+ github: "github";
31
+ gitlab: "gitlab";
32
+ bitbucket: "bitbucket";
33
+ }>;
34
+ declare const RemoteRepoSourceSchema: z.ZodObject<{
35
+ type: z.ZodLiteral<"remote">;
36
+ provider: z.ZodEnum<{
37
+ github: "github";
38
+ gitlab: "gitlab";
39
+ bitbucket: "bitbucket";
40
+ }>;
41
+ owner: z.ZodString;
42
+ repo: z.ZodString;
43
+ fullName: z.ZodString;
44
+ qualifiedName: z.ZodString;
45
+ cloneUrl: z.ZodString;
46
+ }, z.core.$strip>;
47
+ declare const LocalRepoSourceSchema: z.ZodObject<{
48
+ type: z.ZodLiteral<"local">;
49
+ path: z.ZodString;
50
+ name: z.ZodString;
51
+ qualifiedName: z.ZodString;
52
+ }, z.core.$strip>;
53
+ declare const RepoSourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
54
+ type: z.ZodLiteral<"remote">;
55
+ provider: z.ZodEnum<{
56
+ github: "github";
57
+ gitlab: "gitlab";
58
+ bitbucket: "bitbucket";
59
+ }>;
60
+ owner: z.ZodString;
61
+ repo: z.ZodString;
62
+ fullName: z.ZodString;
63
+ qualifiedName: z.ZodString;
64
+ cloneUrl: z.ZodString;
65
+ }, z.core.$strip>, z.ZodObject<{
66
+ type: z.ZodLiteral<"local">;
67
+ path: z.ZodString;
68
+ name: z.ZodString;
69
+ qualifiedName: z.ZodString;
70
+ }, z.core.$strip>], "type">;
71
+ declare const ProjectTypeSchema: z.ZodEnum<{
72
+ monorepo: "monorepo";
73
+ library: "library";
74
+ cli: "cli";
75
+ app: "app";
76
+ framework: "framework";
77
+ }>;
78
+ declare const EntityTypeSchema: z.ZodEnum<{
79
+ package: "package";
80
+ module: "module";
81
+ feature: "feature";
82
+ util: "util";
83
+ config: "config";
84
+ }>;
85
+ declare const EntitySchema: z.ZodObject<{
86
+ name: z.ZodString;
87
+ type: z.ZodEnum<{
88
+ package: "package";
89
+ module: "module";
90
+ feature: "feature";
91
+ util: "util";
92
+ config: "config";
93
+ }>;
94
+ path: z.ZodString;
95
+ description: z.ZodString;
96
+ responsibilities: z.ZodArray<z.ZodString>;
97
+ exports: z.ZodOptional<z.ZodArray<z.ZodString>>;
98
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
99
+ }, z.core.$strip>;
100
+ declare const RelationshipSchema: z.ZodObject<{
101
+ from: z.ZodString;
102
+ to: z.ZodString;
103
+ type: z.ZodString;
104
+ }, z.core.$strip>;
105
+ declare const ArchitectureSchema: z.ZodObject<{
106
+ projectType: z.ZodEnum<{
107
+ monorepo: "monorepo";
108
+ library: "library";
109
+ cli: "cli";
110
+ app: "app";
111
+ framework: "framework";
112
+ }>;
113
+ entities: z.ZodArray<z.ZodObject<{
114
+ name: z.ZodString;
115
+ type: z.ZodEnum<{
116
+ package: "package";
117
+ module: "module";
118
+ feature: "feature";
119
+ util: "util";
120
+ config: "config";
121
+ }>;
122
+ path: z.ZodString;
123
+ description: z.ZodString;
124
+ responsibilities: z.ZodArray<z.ZodString>;
125
+ exports: z.ZodOptional<z.ZodArray<z.ZodString>>;
126
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
127
+ }, z.core.$strip>>;
128
+ relationships: z.ZodArray<z.ZodObject<{
129
+ from: z.ZodString;
130
+ to: z.ZodString;
131
+ type: z.ZodString;
132
+ }, z.core.$strip>>;
133
+ keyFiles: z.ZodArray<z.ZodObject<{
134
+ path: z.ZodString;
135
+ role: z.ZodString;
136
+ }, z.core.$strip>>;
137
+ patterns: z.ZodObject<{
138
+ framework: z.ZodOptional<z.ZodString>;
139
+ buildTool: z.ZodOptional<z.ZodString>;
140
+ testFramework: z.ZodOptional<z.ZodString>;
141
+ language: z.ZodOptional<z.ZodString>;
142
+ }, z.core.$strip>;
143
+ }, z.core.$strip>;
144
+ declare const FileRoleSchema: z.ZodEnum<{
145
+ util: "util";
146
+ config: "config";
147
+ entry: "entry";
148
+ core: "core";
149
+ types: "types";
150
+ test: "test";
151
+ doc: "doc";
152
+ }>;
153
+ declare const FileIndexEntrySchema: z.ZodObject<{
154
+ path: z.ZodString;
155
+ importance: z.ZodNumber;
156
+ type: z.ZodEnum<{
157
+ util: "util";
158
+ config: "config";
159
+ entry: "entry";
160
+ core: "core";
161
+ types: "types";
162
+ test: "test";
163
+ doc: "doc";
164
+ }>;
165
+ exports: z.ZodOptional<z.ZodArray<z.ZodString>>;
166
+ imports: z.ZodOptional<z.ZodArray<z.ZodString>>;
167
+ summary: z.ZodOptional<z.ZodString>;
168
+ }, z.core.$strip>;
169
+ declare const FileIndexSchema: z.ZodArray<z.ZodObject<{
170
+ path: z.ZodString;
171
+ importance: z.ZodNumber;
172
+ type: z.ZodEnum<{
173
+ util: "util";
174
+ config: "config";
175
+ entry: "entry";
176
+ core: "core";
177
+ types: "types";
178
+ test: "test";
179
+ doc: "doc";
180
+ }>;
181
+ exports: z.ZodOptional<z.ZodArray<z.ZodString>>;
182
+ imports: z.ZodOptional<z.ZodArray<z.ZodString>>;
183
+ summary: z.ZodOptional<z.ZodString>;
184
+ }, z.core.$strip>>;
185
+ declare const ReferenceMetaSchema: z.ZodObject<{
186
+ referenceUpdatedAt: z.ZodString;
187
+ commitSha: z.ZodString;
188
+ version: z.ZodString;
189
+ tokenCost: z.ZodOptional<z.ZodNumber>;
190
+ }, z.core.$strip>;
191
+ /**
192
+ * Data payload for push/pull operations.
193
+ * Replaces legacy AnalysisData/SkillData.
194
+ */
195
+ declare const ReferenceDataSchema: z.ZodObject<{
196
+ fullName: z.ZodString;
197
+ referenceName: z.ZodString;
198
+ description: z.ZodString;
199
+ content: z.ZodString;
200
+ commitSha: z.ZodString;
201
+ generatedAt: z.ZodString;
202
+ }, z.core.$strip>;
203
+ /**
204
+ * Entry for a single repo in the global map.
205
+ */
206
+ declare const GlobalMapRepoEntrySchema: z.ZodObject<{
207
+ localPath: z.ZodString;
208
+ references: z.ZodArray<z.ZodString>;
209
+ primary: z.ZodString;
210
+ keywords: z.ZodDefault<z.ZodArray<z.ZodString>>;
211
+ updatedAt: z.ZodString;
212
+ }, z.core.$strip>;
213
+ /**
214
+ * Global map (local-only, at ~/.local/share/offworld/skill/offworld/assets/map.json).
215
+ */
216
+ declare const GlobalMapSchema: z.ZodObject<{
217
+ repos: z.ZodRecord<z.ZodString, z.ZodObject<{
218
+ localPath: z.ZodString;
219
+ references: z.ZodArray<z.ZodString>;
220
+ primary: z.ZodString;
221
+ keywords: z.ZodDefault<z.ZodArray<z.ZodString>>;
222
+ updatedAt: z.ZodString;
223
+ }, z.core.$strip>>;
224
+ }, z.core.$strip>;
225
+ /**
226
+ * Entry for a single repo in a project map.
227
+ */
228
+ declare const ProjectMapRepoEntrySchema: z.ZodObject<{
229
+ localPath: z.ZodString;
230
+ reference: z.ZodString;
231
+ keywords: z.ZodDefault<z.ZodArray<z.ZodString>>;
232
+ }, z.core.$strip>;
233
+ /**
234
+ * Project map (at ./.offworld/map.json).
235
+ */
236
+ declare const ProjectMapSchema: z.ZodObject<{
237
+ version: z.ZodDefault<z.ZodNumber>;
238
+ scope: z.ZodLiteral<"project">;
239
+ globalMapPath: z.ZodString;
240
+ repos: z.ZodRecord<z.ZodString, z.ZodObject<{
241
+ localPath: z.ZodString;
242
+ reference: z.ZodString;
243
+ keywords: z.ZodDefault<z.ZodArray<z.ZodString>>;
244
+ }, z.core.$strip>>;
245
+ }, z.core.$strip>;
246
+ /**
247
+ * Options for ow init command
248
+ */
249
+ interface InitOptions {
250
+ yes?: boolean;
251
+ /** Skip auth check (useful for testing) */
252
+ skipAuth?: boolean;
253
+ }
254
+ //#endregion
255
+ export { AgentSchema, ArchitectureSchema, ConfigSchema, EntitySchema, EntityTypeSchema, FileIndexEntrySchema, FileIndexSchema, FileRoleSchema, GitProviderSchema, GlobalMapRepoEntrySchema, GlobalMapSchema, InitOptions, LocalRepoSourceSchema, ProjectMapRepoEntrySchema, ProjectMapSchema, ProjectTypeSchema, ReferenceDataSchema, ReferenceMetaSchema, RelationshipSchema, RemoteRepoSourceSchema, RepoSourceSchema };
256
+ //# sourceMappingURL=schemas.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.mts","names":[],"sources":["../src/schemas.ts"],"mappings":";;;;;AAMA;;cAAa,WAAA,EAAW,CAAA,CAAA,OAAA;;;;;;;;cASX,YAAA,EAAY,CAAA,CAAA,SAAA;;;;;;;;;;;;;cASZ,iBAAA,EAAiB,CAAA,CAAA,OAAA;;;;;cAEjB,sBAAA,EAAsB,CAAA,CAAA,SAAA;;;;;;;;;;;;;cAUtB,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;cAOrB,gBAAA,EAAgB,CAAA,CAAA,qBAAA,EAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;cAKhB,iBAAA,EAAiB,CAAA,CAAA,OAAA;;;;;;;cAEjB,gBAAA,EAAgB,CAAA,CAAA,OAAA;;;;;;;cAEhB,YAAA,EAAY,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;cAUZ,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;cAMlB,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkBlB,cAAA,EAAc,CAAA,CAAA,OAAA;;;;;;;;;cAEd,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;cASpB,eAAA,EAAe,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;cAEf,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;cAWnB,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;cAYnB,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;;;;;;cAWxB,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;;;;;;cAOf,yBAAA,EAAyB,CAAA,CAAA,SAAA;;;;;;;;cASzB,gBAAA,EAAgB,CAAA,CAAA,SAAA;;;;;;;;;;;;;UAUZ,WAAA;EAChB,GAAA;;EAEA,QAAA;AAAA"}
@@ -0,0 +1,156 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/schemas.ts
4
+ /**
5
+ * Supported AI coding agents for skill symlinks.
6
+ * Each agent has a different skill directory location - see packages/sdk/src/agents.ts for registry.
7
+ */
8
+ const AgentSchema = z.enum([
9
+ "opencode",
10
+ "claude-code",
11
+ "codex",
12
+ "amp",
13
+ "antigravity",
14
+ "cursor"
15
+ ]);
16
+ const ConfigSchema = z.object({
17
+ repoRoot: z.string().default("~/ow"),
18
+ defaultShallow: z.boolean().default(true),
19
+ defaultModel: z.string().default("anthropic/claude-sonnet-4-20250514"),
20
+ agents: z.array(AgentSchema).default([])
21
+ });
22
+ const GitProviderSchema = z.enum([
23
+ "github",
24
+ "gitlab",
25
+ "bitbucket"
26
+ ]);
27
+ const RemoteRepoSourceSchema = z.object({
28
+ type: z.literal("remote"),
29
+ provider: GitProviderSchema,
30
+ owner: z.string(),
31
+ repo: z.string(),
32
+ fullName: z.string(),
33
+ qualifiedName: z.string(),
34
+ cloneUrl: z.string()
35
+ });
36
+ const LocalRepoSourceSchema = z.object({
37
+ type: z.literal("local"),
38
+ path: z.string(),
39
+ name: z.string(),
40
+ qualifiedName: z.string()
41
+ });
42
+ const RepoSourceSchema = z.discriminatedUnion("type", [RemoteRepoSourceSchema, LocalRepoSourceSchema]);
43
+ const ProjectTypeSchema = z.enum([
44
+ "monorepo",
45
+ "library",
46
+ "cli",
47
+ "app",
48
+ "framework"
49
+ ]);
50
+ const EntityTypeSchema = z.enum([
51
+ "package",
52
+ "module",
53
+ "feature",
54
+ "util",
55
+ "config"
56
+ ]);
57
+ const EntitySchema = z.object({
58
+ name: z.string(),
59
+ type: EntityTypeSchema,
60
+ path: z.string(),
61
+ description: z.string(),
62
+ responsibilities: z.array(z.string()),
63
+ exports: z.array(z.string()).optional(),
64
+ dependencies: z.array(z.string()).optional()
65
+ });
66
+ const RelationshipSchema = z.object({
67
+ from: z.string(),
68
+ to: z.string(),
69
+ type: z.string()
70
+ });
71
+ const ArchitectureSchema = z.object({
72
+ projectType: ProjectTypeSchema,
73
+ entities: z.array(EntitySchema),
74
+ relationships: z.array(RelationshipSchema),
75
+ keyFiles: z.array(z.object({
76
+ path: z.string(),
77
+ role: z.string()
78
+ })),
79
+ patterns: z.object({
80
+ framework: z.string().optional(),
81
+ buildTool: z.string().optional(),
82
+ testFramework: z.string().optional(),
83
+ language: z.string().optional()
84
+ })
85
+ });
86
+ const FileRoleSchema = z.enum([
87
+ "entry",
88
+ "core",
89
+ "types",
90
+ "config",
91
+ "test",
92
+ "util",
93
+ "doc"
94
+ ]);
95
+ const FileIndexEntrySchema = z.object({
96
+ path: z.string(),
97
+ importance: z.number().min(0).max(1),
98
+ type: FileRoleSchema,
99
+ exports: z.array(z.string()).optional(),
100
+ imports: z.array(z.string()).optional(),
101
+ summary: z.string().optional()
102
+ });
103
+ const FileIndexSchema = z.array(FileIndexEntrySchema);
104
+ const ReferenceMetaSchema = z.object({
105
+ referenceUpdatedAt: z.string(),
106
+ commitSha: z.string(),
107
+ version: z.string(),
108
+ tokenCost: z.number().optional()
109
+ });
110
+ /**
111
+ * Data payload for push/pull operations.
112
+ * Replaces legacy AnalysisData/SkillData.
113
+ */
114
+ const ReferenceDataSchema = z.object({
115
+ fullName: z.string(),
116
+ referenceName: z.string(),
117
+ description: z.string(),
118
+ content: z.string(),
119
+ commitSha: z.string(),
120
+ generatedAt: z.string()
121
+ });
122
+ /**
123
+ * Entry for a single repo in the global map.
124
+ */
125
+ const GlobalMapRepoEntrySchema = z.object({
126
+ localPath: z.string(),
127
+ references: z.array(z.string()),
128
+ primary: z.string(),
129
+ keywords: z.array(z.string()).default([]),
130
+ updatedAt: z.string()
131
+ });
132
+ /**
133
+ * Global map (local-only, at ~/.local/share/offworld/skill/offworld/assets/map.json).
134
+ */
135
+ const GlobalMapSchema = z.object({ repos: z.record(z.string(), GlobalMapRepoEntrySchema) });
136
+ /**
137
+ * Entry for a single repo in a project map.
138
+ */
139
+ const ProjectMapRepoEntrySchema = z.object({
140
+ localPath: z.string(),
141
+ reference: z.string(),
142
+ keywords: z.array(z.string()).default([])
143
+ });
144
+ /**
145
+ * Project map (at ./.offworld/map.json).
146
+ */
147
+ const ProjectMapSchema = z.object({
148
+ version: z.number().default(1),
149
+ scope: z.literal("project"),
150
+ globalMapPath: z.string(),
151
+ repos: z.record(z.string(), ProjectMapRepoEntrySchema)
152
+ });
153
+
154
+ //#endregion
155
+ export { AgentSchema, ArchitectureSchema, ConfigSchema, EntitySchema, EntityTypeSchema, FileIndexEntrySchema, FileIndexSchema, FileRoleSchema, GitProviderSchema, GlobalMapRepoEntrySchema, GlobalMapSchema, LocalRepoSourceSchema, ProjectMapRepoEntrySchema, ProjectMapSchema, ProjectTypeSchema, ReferenceDataSchema, ReferenceMetaSchema, RelationshipSchema, RemoteRepoSourceSchema, RepoSourceSchema };
156
+ //# sourceMappingURL=schemas.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.mjs","names":[],"sources":["../src/schemas.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/**\n * Supported AI coding agents for skill symlinks.\n * Each agent has a different skill directory location - see packages/sdk/src/agents.ts for registry.\n */\nexport const AgentSchema = z.enum([\n\t\"opencode\",\n\t\"claude-code\",\n\t\"codex\",\n\t\"amp\",\n\t\"antigravity\",\n\t\"cursor\",\n]);\n\nexport const ConfigSchema = z.object({\n\trepoRoot: z.string().default(\"~/ow\"),\n\tdefaultShallow: z.boolean().default(true),\n\t/** Default model in provider/model format (e.g., anthropic/claude-sonnet-4-20250514) */\n\tdefaultModel: z.string().default(\"anthropic/claude-sonnet-4-20250514\"),\n\t/** Agents to create skill symlinks for. Auto-detected if empty. */\n\tagents: z.array(AgentSchema).default([]),\n});\n\nexport const GitProviderSchema = z.enum([\"github\", \"gitlab\", \"bitbucket\"]);\n\nexport const RemoteRepoSourceSchema = z.object({\n\ttype: z.literal(\"remote\"),\n\tprovider: GitProviderSchema,\n\towner: z.string(),\n\trepo: z.string(),\n\tfullName: z.string(),\n\tqualifiedName: z.string(),\n\tcloneUrl: z.string(),\n});\n\nexport const LocalRepoSourceSchema = z.object({\n\ttype: z.literal(\"local\"),\n\tpath: z.string(),\n\tname: z.string(),\n\tqualifiedName: z.string(),\n});\n\nexport const RepoSourceSchema = z.discriminatedUnion(\"type\", [\n\tRemoteRepoSourceSchema,\n\tLocalRepoSourceSchema,\n]);\n\nexport const ProjectTypeSchema = z.enum([\"monorepo\", \"library\", \"cli\", \"app\", \"framework\"]);\n\nexport const EntityTypeSchema = z.enum([\"package\", \"module\", \"feature\", \"util\", \"config\"]);\n\nexport const EntitySchema = z.object({\n\tname: z.string(),\n\ttype: EntityTypeSchema,\n\tpath: z.string(),\n\tdescription: z.string(),\n\tresponsibilities: z.array(z.string()),\n\texports: z.array(z.string()).optional(),\n\tdependencies: z.array(z.string()).optional(),\n});\n\nexport const RelationshipSchema = z.object({\n\tfrom: z.string(),\n\tto: z.string(),\n\ttype: z.string(),\n});\n\nexport const ArchitectureSchema = z.object({\n\tprojectType: ProjectTypeSchema,\n\tentities: z.array(EntitySchema),\n\trelationships: z.array(RelationshipSchema),\n\tkeyFiles: z.array(\n\t\tz.object({\n\t\t\tpath: z.string(),\n\t\t\trole: z.string(),\n\t\t}),\n\t),\n\tpatterns: z.object({\n\t\tframework: z.string().optional(),\n\t\tbuildTool: z.string().optional(),\n\t\ttestFramework: z.string().optional(),\n\t\tlanguage: z.string().optional(),\n\t}),\n});\n\nexport const FileRoleSchema = z.enum([\"entry\", \"core\", \"types\", \"config\", \"test\", \"util\", \"doc\"]);\n\nexport const FileIndexEntrySchema = z.object({\n\tpath: z.string(),\n\timportance: z.number().min(0).max(1),\n\ttype: FileRoleSchema,\n\texports: z.array(z.string()).optional(),\n\timports: z.array(z.string()).optional(),\n\tsummary: z.string().optional(),\n});\n\nexport const FileIndexSchema = z.array(FileIndexEntrySchema);\n\nexport const ReferenceMetaSchema = z.object({\n\treferenceUpdatedAt: z.string(),\n\tcommitSha: z.string(),\n\tversion: z.string(),\n\ttokenCost: z.number().optional(),\n});\n\n/**\n * Data payload for push/pull operations.\n * Replaces legacy AnalysisData/SkillData.\n */\nexport const ReferenceDataSchema = z.object({\n\tfullName: z.string(),\n\treferenceName: z.string(),\n\tdescription: z.string(),\n\tcontent: z.string(),\n\tcommitSha: z.string(),\n\tgeneratedAt: z.string(),\n});\n\n/**\n * Entry for a single repo in the global map.\n */\nexport const GlobalMapRepoEntrySchema = z.object({\n\tlocalPath: z.string(),\n\treferences: z.array(z.string()),\n\tprimary: z.string(),\n\tkeywords: z.array(z.string()).default([]),\n\tupdatedAt: z.string(),\n});\n\n/**\n * Global map (local-only, at ~/.local/share/offworld/skill/offworld/assets/map.json).\n */\nexport const GlobalMapSchema = z.object({\n\trepos: z.record(z.string(), GlobalMapRepoEntrySchema),\n});\n\n/**\n * Entry for a single repo in a project map.\n */\nexport const ProjectMapRepoEntrySchema = z.object({\n\tlocalPath: z.string(),\n\treference: z.string(),\n\tkeywords: z.array(z.string()).default([]),\n});\n\n/**\n * Project map (at ./.offworld/map.json).\n */\nexport const ProjectMapSchema = z.object({\n\tversion: z.number().default(1),\n\tscope: z.literal(\"project\"),\n\tglobalMapPath: z.string(),\n\trepos: z.record(z.string(), ProjectMapRepoEntrySchema),\n});\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U;CAChC,CAAC;;;;;AAMF,MAAa,sBAAsB,EAAE,OAAO;CAC3C,UAAU,EAAE,QAAQ;CACpB,eAAe,EAAE,QAAQ;CACzB,aAAa,EAAE,QAAQ;CACvB,SAAS,EAAE,QAAQ;CACnB,WAAW,EAAE,QAAQ;CACrB,aAAa,EAAE,QAAQ;CACvB,CAAC;;;;AAKF,MAAa,2BAA2B,EAAE,OAAO;CAChD,WAAW,EAAE,QAAQ;CACrB,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC;CAC/B,SAAS,EAAE,QAAQ;CACnB,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;CACzC,WAAW,EAAE,QAAQ;CACrB,CAAC;;;;AAKF,MAAa,kBAAkB,EAAE,OAAO,EACvC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,yBAAyB,EACrD,CAAC;;;;AAKF,MAAa,4BAA4B,EAAE,OAAO;CACjD,WAAW,EAAE,QAAQ;CACrB,WAAW,EAAE,QAAQ;CACrB,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;CACzC,CAAC;;;;AAKF,MAAa,mBAAmB,EAAE,OAAO;CACxC,SAAS,EAAE,QAAQ,CAAC,QAAQ,EAAE;CAC9B,OAAO,EAAE,QAAQ,UAAU;CAC3B,eAAe,EAAE,QAAQ;CACzB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,0BAA0B;CACtD,CAAC"}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@offworld/types",
3
+ "version": "0.1.0",
4
+ "license": "MIT",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.mts",
12
+ "import": "./dist/index.mjs"
13
+ },
14
+ "./schemas": {
15
+ "types": "./dist/schemas.d.mts",
16
+ "import": "./dist/schemas.mjs"
17
+ }
18
+ },
19
+ "publishConfig": {
20
+ "access": "public"
21
+ },
22
+ "scripts": {
23
+ "build": "tsdown",
24
+ "dev": "tsdown --watch",
25
+ "typecheck": "tsc --noEmit",
26
+ "test": "vitest run",
27
+ "test:watch": "vitest",
28
+ "prepublishOnly": "bun run build"
29
+ },
30
+ "dependencies": {
31
+ "zod": "catalog:"
32
+ },
33
+ "devDependencies": {
34
+ "tsdown": "catalog:",
35
+ "typescript": "catalog:",
36
+ "vitest": "catalog:"
37
+ }
38
+ }