pilothub 0.0.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/.env.local.example +19 -0
- package/.github/workflows/ci.yml +40 -0
- package/.oxlintrc.json +3 -0
- package/AGENTS.md +45 -0
- package/CHANGELOG.md +138 -0
- package/DEPRECATIONS.md +7 -0
- package/LICENSE +21 -0
- package/README.md +150 -0
- package/biome.json +41 -0
- package/convex/_generated/api.d.ts +153 -0
- package/convex/_generated/api.js +23 -0
- package/convex/_generated/dataModel.d.ts +60 -0
- package/convex/_generated/server.d.ts +143 -0
- package/convex/_generated/server.js +93 -0
- package/convex/auth.config.ts +8 -0
- package/convex/auth.ts +19 -0
- package/convex/comments.ts +88 -0
- package/convex/crons.ts +34 -0
- package/convex/devSeed.ts +459 -0
- package/convex/devSeedExtra.ts +541 -0
- package/convex/downloads.ts +78 -0
- package/convex/githubBackups.ts +170 -0
- package/convex/githubBackupsNode.ts +183 -0
- package/convex/githubImport.ts +317 -0
- package/convex/githubSoulBackups.ts +170 -0
- package/convex/githubSoulBackupsNode.ts +186 -0
- package/convex/http.ts +194 -0
- package/convex/httpApi.handlers.test.ts +488 -0
- package/convex/httpApi.test.ts +70 -0
- package/convex/httpApi.ts +305 -0
- package/convex/httpApiV1.handlers.test.ts +584 -0
- package/convex/httpApiV1.ts +1172 -0
- package/convex/leaderboards.ts +39 -0
- package/convex/lib/access.ts +36 -0
- package/convex/lib/apiTokenAuth.ts +36 -0
- package/convex/lib/badges.ts +50 -0
- package/convex/lib/changelog.test.ts +34 -0
- package/convex/lib/changelog.ts +278 -0
- package/convex/lib/embeddings.ts +38 -0
- package/convex/lib/githubBackup.ts +443 -0
- package/convex/lib/githubImport.test.ts +247 -0
- package/convex/lib/githubImport.ts +425 -0
- package/convex/lib/githubSoulBackup.ts +443 -0
- package/convex/lib/leaderboards.ts +103 -0
- package/convex/lib/moderation.ts +42 -0
- package/convex/lib/public.ts +89 -0
- package/convex/lib/searchText.test.ts +46 -0
- package/convex/lib/searchText.ts +27 -0
- package/convex/lib/skillBackfill.test.ts +34 -0
- package/convex/lib/skillBackfill.ts +67 -0
- package/convex/lib/skillPublish.test.ts +28 -0
- package/convex/lib/skillPublish.ts +284 -0
- package/convex/lib/skillStats.ts +80 -0
- package/convex/lib/skills.test.ts +197 -0
- package/convex/lib/skills.ts +273 -0
- package/convex/lib/soulChangelog.ts +273 -0
- package/convex/lib/soulPublish.ts +236 -0
- package/convex/lib/tokens.test.ts +33 -0
- package/convex/lib/tokens.ts +51 -0
- package/convex/lib/webhooks.test.ts +91 -0
- package/convex/lib/webhooks.ts +112 -0
- package/convex/maintenance.test.ts +270 -0
- package/convex/maintenance.ts +840 -0
- package/convex/rateLimits.ts +50 -0
- package/convex/schema.ts +472 -0
- package/convex/search.test.ts +12 -0
- package/convex/search.ts +254 -0
- package/convex/seed.test.ts +37 -0
- package/convex/seed.ts +254 -0
- package/convex/seedSouls.ts +111 -0
- package/convex/skillStatEvents.ts +568 -0
- package/convex/skills.ts +1606 -0
- package/convex/soulComments.ts +88 -0
- package/convex/soulDownloads.ts +14 -0
- package/convex/soulStars.ts +71 -0
- package/convex/souls.ts +570 -0
- package/convex/stars.ts +108 -0
- package/convex/statsMaintenance.ts +205 -0
- package/convex/telemetry.ts +434 -0
- package/convex/tokens.ts +88 -0
- package/convex/tsconfig.json +7 -0
- package/convex/uploads.ts +20 -0
- package/convex/users.ts +122 -0
- package/convex/webhooks.ts +50 -0
- package/convex.json +3 -0
- package/docs/README.md +32 -0
- package/docs/api.md +51 -0
- package/docs/architecture.md +61 -0
- package/docs/auth.md +54 -0
- package/docs/cli.md +117 -0
- package/docs/deploy.md +78 -0
- package/docs/diffing.md +84 -0
- package/docs/github-import.md +171 -0
- package/docs/http-api.md +187 -0
- package/docs/manual-testing.md +64 -0
- package/docs/mintlify.md +43 -0
- package/docs/quickstart.md +120 -0
- package/docs/skill-format.md +58 -0
- package/docs/soul-format.md +37 -0
- package/docs/spec.md +177 -0
- package/docs/telemetry.md +91 -0
- package/docs/troubleshooting.md +49 -0
- package/docs/webhook.md +51 -0
- package/e2e/menu-smoke.pw.test.ts +49 -0
- package/e2e/pilothub.e2e.test.ts +494 -0
- package/e2e/search-exact.pw.test.ts +97 -0
- package/package.json +84 -0
- package/packages/pilothub/LICENSE +22 -0
- package/packages/pilothub/README.md +57 -0
- package/packages/pilothub/bin/pilothub.js +2 -0
- package/packages/pilothub/package.json +41 -0
- package/packages/pilothub/src/browserAuth.test.ts +96 -0
- package/packages/pilothub/src/browserAuth.ts +174 -0
- package/packages/pilothub/src/cli/buildInfo.ts +94 -0
- package/packages/pilothub/src/cli/commands/auth.ts +97 -0
- package/packages/pilothub/src/cli/commands/delete.test.ts +73 -0
- package/packages/pilothub/src/cli/commands/delete.ts +83 -0
- package/packages/pilothub/src/cli/commands/publish.test.ts +122 -0
- package/packages/pilothub/src/cli/commands/publish.ts +108 -0
- package/packages/pilothub/src/cli/commands/skills.test.ts +191 -0
- package/packages/pilothub/src/cli/commands/skills.ts +380 -0
- package/packages/pilothub/src/cli/commands/star.ts +46 -0
- package/packages/pilothub/src/cli/commands/sync.test.ts +310 -0
- package/packages/pilothub/src/cli/commands/sync.ts +200 -0
- package/packages/pilothub/src/cli/commands/syncHelpers.test.ts +26 -0
- package/packages/pilothub/src/cli/commands/syncHelpers.ts +427 -0
- package/packages/pilothub/src/cli/commands/syncTypes.ts +27 -0
- package/packages/pilothub/src/cli/commands/unstar.ts +48 -0
- package/packages/pilothub/src/cli/helpStyle.ts +45 -0
- package/packages/pilothub/src/cli/pilotbotConfig.test.ts +159 -0
- package/packages/pilothub/src/cli/pilotbotConfig.ts +147 -0
- package/packages/pilothub/src/cli/registry.test.ts +63 -0
- package/packages/pilothub/src/cli/registry.ts +43 -0
- package/packages/pilothub/src/cli/scanSkills.test.ts +64 -0
- package/packages/pilothub/src/cli/scanSkills.ts +84 -0
- package/packages/pilothub/src/cli/slug.ts +16 -0
- package/packages/pilothub/src/cli/types.ts +12 -0
- package/packages/pilothub/src/cli/ui.ts +75 -0
- package/packages/pilothub/src/cli.ts +311 -0
- package/packages/pilothub/src/config.ts +36 -0
- package/packages/pilothub/src/discovery.test.ts +75 -0
- package/packages/pilothub/src/discovery.ts +19 -0
- package/packages/pilothub/src/http.test.ts +156 -0
- package/packages/pilothub/src/http.ts +301 -0
- package/packages/pilothub/src/schema/ark.ts +29 -0
- package/packages/pilothub/src/schema/index.ts +5 -0
- package/packages/pilothub/src/schema/routes.ts +22 -0
- package/packages/pilothub/src/schema/schemas.ts +260 -0
- package/packages/pilothub/src/schema/textFiles.test.ts +23 -0
- package/packages/pilothub/src/schema/textFiles.ts +66 -0
- package/packages/pilothub/src/skills.test.ts +191 -0
- package/packages/pilothub/src/skills.ts +172 -0
- package/packages/pilothub/src/types.ts +10 -0
- package/packages/pilothub/tsconfig.json +14 -0
- package/packages/schema/README.md +3 -0
- package/packages/schema/dist/ark.d.ts +4 -0
- package/packages/schema/dist/ark.js +26 -0
- package/packages/schema/dist/ark.js.map +1 -0
- package/packages/schema/dist/index.d.ts +5 -0
- package/packages/schema/dist/index.js +5 -0
- package/packages/schema/dist/index.js.map +1 -0
- package/packages/schema/dist/routes.d.ts +21 -0
- package/packages/schema/dist/routes.js +22 -0
- package/packages/schema/dist/routes.js.map +1 -0
- package/packages/schema/dist/schemas.d.ts +297 -0
- package/packages/schema/dist/schemas.js +243 -0
- package/packages/schema/dist/schemas.js.map +1 -0
- package/packages/schema/dist/textFiles.d.ts +5 -0
- package/packages/schema/dist/textFiles.js +66 -0
- package/packages/schema/dist/textFiles.js.map +1 -0
- package/packages/schema/package.json +26 -0
- package/packages/schema/src/ark.ts +29 -0
- package/packages/schema/src/index.ts +5 -0
- package/packages/schema/src/routes.ts +22 -0
- package/packages/schema/src/schemas.test.ts +123 -0
- package/packages/schema/src/schemas.ts +287 -0
- package/packages/schema/src/textFiles.test.ts +23 -0
- package/packages/schema/src/textFiles.ts +66 -0
- package/packages/schema/tsconfig.json +15 -0
- package/pilothub +46 -0
- package/playwright.config.ts +33 -0
- package/public/.well-known/pilothub.json +6 -0
- package/public/api/v1/openapi.json +379 -0
- package/public/favicon.ico +0 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/og.png +0 -0
- package/public/og.svg +98 -0
- package/public/pilot-logo.png +0 -0
- package/public/pilot-mark.png +0 -0
- package/public/robots.txt +3 -0
- package/public/tanstack-circle-logo.png +0 -0
- package/public/tanstack-word-logo-white.svg +1 -0
- package/scripts/check-peer-deps.ts +56 -0
- package/scripts/docs-list.ts +148 -0
- package/scripts/run-playwright-local.sh +14 -0
- package/server/og/fetchSkillOgMeta.ts +27 -0
- package/server/og/fetchSoulOgMeta.ts +27 -0
- package/server/og/ogAssets.ts +80 -0
- package/server/og/skillOgSvg.test.ts +59 -0
- package/server/og/skillOgSvg.ts +258 -0
- package/server/og/soulOgSvg.ts +209 -0
- package/server/routes/og/skill.png.ts +103 -0
- package/server/routes/og/soul.png.ts +111 -0
- package/src/__tests__/skill-detail-page.test.tsx +86 -0
- package/src/__tests__/skills-index.test.tsx +145 -0
- package/src/__tests__/upload.route.test.tsx +228 -0
- package/src/components/AppProviders.tsx +19 -0
- package/src/components/ClientOnly.tsx +18 -0
- package/src/components/Footer.tsx +29 -0
- package/src/components/Header.tsx +295 -0
- package/src/components/InstallSwitcher.tsx +53 -0
- package/src/components/SkillCard.tsx +36 -0
- package/src/components/SkillDetailPage.tsx +817 -0
- package/src/components/SkillDiffCard.tsx +485 -0
- package/src/components/SoulCard.tsx +19 -0
- package/src/components/SoulDetailPage.tsx +263 -0
- package/src/components/UserBootstrap.tsx +18 -0
- package/src/components/ui/dropdown-menu.tsx +67 -0
- package/src/components/ui/toggle-group.tsx +35 -0
- package/src/convex/client.ts +3 -0
- package/src/lib/badges.ts +29 -0
- package/src/lib/diffing.test.ts +163 -0
- package/src/lib/diffing.ts +106 -0
- package/src/lib/gravatar.test.ts +9 -0
- package/src/lib/gravatar.ts +158 -0
- package/src/lib/og.test.ts +142 -0
- package/src/lib/og.ts +156 -0
- package/src/lib/publicUser.ts +39 -0
- package/src/lib/roles.ts +19 -0
- package/src/lib/site.test.ts +130 -0
- package/src/lib/site.ts +84 -0
- package/src/lib/theme-transition.test.ts +134 -0
- package/src/lib/theme-transition.ts +134 -0
- package/src/lib/theme.test.tsx +88 -0
- package/src/lib/theme.ts +43 -0
- package/src/lib/uploadFiles.jsdom.test.ts +33 -0
- package/src/lib/uploadFiles.test.ts +123 -0
- package/src/lib/uploadFiles.ts +245 -0
- package/src/lib/uploadUtils.test.ts +78 -0
- package/src/lib/uploadUtils.ts +93 -0
- package/src/lib/useAuthStatus.ts +12 -0
- package/src/lib/utils.test.ts +9 -0
- package/src/lib/utils.ts +6 -0
- package/src/logo.svg +12 -0
- package/src/routeTree.gen.ts +345 -0
- package/src/router.tsx +17 -0
- package/src/routes/$owner/$slug.tsx +55 -0
- package/src/routes/__root.tsx +136 -0
- package/src/routes/admin.tsx +11 -0
- package/src/routes/cli/auth.tsx +168 -0
- package/src/routes/dashboard.tsx +97 -0
- package/src/routes/import.tsx +415 -0
- package/src/routes/index.tsx +252 -0
- package/src/routes/management.tsx +529 -0
- package/src/routes/settings.tsx +203 -0
- package/src/routes/skills/index.tsx +422 -0
- package/src/routes/souls/$slug.tsx +55 -0
- package/src/routes/souls/index.tsx +243 -0
- package/src/routes/stars.tsx +68 -0
- package/src/routes/u/$handle.tsx +307 -0
- package/src/routes/upload/utils.ts +81 -0
- package/src/routes/upload.tsx +499 -0
- package/src/styles.css +2718 -0
- package/tsconfig.json +24 -0
- package/tsconfig.oxlint.json +16 -0
- package/vercel.json +8 -0
- package/vite.config.ts +48 -0
- package/vitest.config.ts +47 -0
- package/vitest.e2e.config.ts +11 -0
- package/vitest.setup.ts +1 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { type inferred } from 'arktype';
|
|
2
|
+
export declare const GlobalConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
registry: string;
|
|
4
|
+
token?: string | undefined;
|
|
5
|
+
}, {}>;
|
|
6
|
+
export type GlobalConfig = (typeof GlobalConfigSchema)[inferred];
|
|
7
|
+
export declare const WellKnownConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
8
|
+
apiBase: string;
|
|
9
|
+
authBase?: string | undefined;
|
|
10
|
+
minCliVersion?: string | undefined;
|
|
11
|
+
} | {
|
|
12
|
+
registry: string;
|
|
13
|
+
authBase?: string | undefined;
|
|
14
|
+
minCliVersion?: string | undefined;
|
|
15
|
+
}, {}>;
|
|
16
|
+
export type WellKnownConfig = (typeof WellKnownConfigSchema)[inferred];
|
|
17
|
+
export declare const LockfileSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
18
|
+
version: 1;
|
|
19
|
+
skills: {
|
|
20
|
+
[x: string]: {
|
|
21
|
+
version: string | null;
|
|
22
|
+
installedAt: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}, {}>;
|
|
26
|
+
export type Lockfile = (typeof LockfileSchema)[inferred];
|
|
27
|
+
export declare const ApiCliWhoamiResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
28
|
+
user: {
|
|
29
|
+
handle: string | null;
|
|
30
|
+
};
|
|
31
|
+
}, {}>;
|
|
32
|
+
export declare const ApiSearchResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
33
|
+
results: {
|
|
34
|
+
score: number;
|
|
35
|
+
slug?: string | undefined;
|
|
36
|
+
displayName?: string | undefined;
|
|
37
|
+
version?: string | null | undefined;
|
|
38
|
+
}[];
|
|
39
|
+
}, {}>;
|
|
40
|
+
export declare const ApiSkillMetaResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
41
|
+
latestVersion?: {
|
|
42
|
+
version: string;
|
|
43
|
+
} | undefined;
|
|
44
|
+
skill?: unknown;
|
|
45
|
+
}, {}>;
|
|
46
|
+
export declare const ApiCliUploadUrlResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
47
|
+
uploadUrl: string;
|
|
48
|
+
}, {}>;
|
|
49
|
+
export declare const ApiUploadFileResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
50
|
+
storageId: string;
|
|
51
|
+
}, {}>;
|
|
52
|
+
export declare const CliPublishFileSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
53
|
+
path: string;
|
|
54
|
+
size: number;
|
|
55
|
+
storageId: string;
|
|
56
|
+
sha256: string;
|
|
57
|
+
contentType?: string | undefined;
|
|
58
|
+
}, {}>;
|
|
59
|
+
export type CliPublishFile = (typeof CliPublishFileSchema)[inferred];
|
|
60
|
+
export declare const PublishSourceSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
61
|
+
kind: "github";
|
|
62
|
+
url: string;
|
|
63
|
+
repo: string;
|
|
64
|
+
ref: string;
|
|
65
|
+
commit: string;
|
|
66
|
+
path: string;
|
|
67
|
+
importedAt: number;
|
|
68
|
+
}, {}>;
|
|
69
|
+
export declare const CliPublishRequestSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
70
|
+
slug: string;
|
|
71
|
+
displayName: string;
|
|
72
|
+
version: string;
|
|
73
|
+
changelog: string;
|
|
74
|
+
files: {
|
|
75
|
+
path: string;
|
|
76
|
+
size: number;
|
|
77
|
+
storageId: string;
|
|
78
|
+
sha256: string;
|
|
79
|
+
contentType?: string | undefined;
|
|
80
|
+
}[];
|
|
81
|
+
tags?: string[] | undefined;
|
|
82
|
+
source?: {
|
|
83
|
+
kind: "github";
|
|
84
|
+
url: string;
|
|
85
|
+
repo: string;
|
|
86
|
+
ref: string;
|
|
87
|
+
commit: string;
|
|
88
|
+
path: string;
|
|
89
|
+
importedAt: number;
|
|
90
|
+
} | undefined;
|
|
91
|
+
forkOf?: {
|
|
92
|
+
slug: string;
|
|
93
|
+
version?: string | undefined;
|
|
94
|
+
} | undefined;
|
|
95
|
+
}, {}>;
|
|
96
|
+
export type CliPublishRequest = (typeof CliPublishRequestSchema)[inferred];
|
|
97
|
+
export declare const ApiCliPublishResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
98
|
+
ok: true;
|
|
99
|
+
skillId: string;
|
|
100
|
+
versionId: string;
|
|
101
|
+
}, {}>;
|
|
102
|
+
export declare const CliSkillDeleteRequestSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
103
|
+
slug: string;
|
|
104
|
+
}, {}>;
|
|
105
|
+
export type CliSkillDeleteRequest = (typeof CliSkillDeleteRequestSchema)[inferred];
|
|
106
|
+
export declare const ApiCliSkillDeleteResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
107
|
+
ok: true;
|
|
108
|
+
}, {}>;
|
|
109
|
+
export declare const ApiSkillResolveResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
110
|
+
match: {
|
|
111
|
+
version: string;
|
|
112
|
+
} | null;
|
|
113
|
+
latestVersion: {
|
|
114
|
+
version: string;
|
|
115
|
+
} | null;
|
|
116
|
+
}, {}>;
|
|
117
|
+
export declare const CliTelemetrySyncRequestSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
118
|
+
roots: {
|
|
119
|
+
rootId: string;
|
|
120
|
+
label: string;
|
|
121
|
+
skills: {
|
|
122
|
+
slug: string;
|
|
123
|
+
version?: string | null | undefined;
|
|
124
|
+
}[];
|
|
125
|
+
}[];
|
|
126
|
+
}, {}>;
|
|
127
|
+
export type CliTelemetrySyncRequest = (typeof CliTelemetrySyncRequestSchema)[inferred];
|
|
128
|
+
export declare const ApiCliTelemetrySyncResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
129
|
+
ok: true;
|
|
130
|
+
}, {}>;
|
|
131
|
+
export declare const ApiV1WhoamiResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
132
|
+
user: {
|
|
133
|
+
handle: string | null;
|
|
134
|
+
displayName?: string | null | undefined;
|
|
135
|
+
image?: string | null | undefined;
|
|
136
|
+
};
|
|
137
|
+
}, {}>;
|
|
138
|
+
export declare const ApiV1SearchResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
139
|
+
results: {
|
|
140
|
+
score: number;
|
|
141
|
+
slug?: string | undefined;
|
|
142
|
+
displayName?: string | undefined;
|
|
143
|
+
summary?: string | null | undefined;
|
|
144
|
+
version?: string | null | undefined;
|
|
145
|
+
updatedAt?: number | undefined;
|
|
146
|
+
}[];
|
|
147
|
+
}, {}>;
|
|
148
|
+
export declare const ApiV1SkillListResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
149
|
+
items: {
|
|
150
|
+
slug: string;
|
|
151
|
+
displayName: string;
|
|
152
|
+
tags: unknown;
|
|
153
|
+
stats: unknown;
|
|
154
|
+
createdAt: number;
|
|
155
|
+
updatedAt: number;
|
|
156
|
+
summary?: string | null | undefined;
|
|
157
|
+
latestVersion?: {
|
|
158
|
+
version: string;
|
|
159
|
+
createdAt: number;
|
|
160
|
+
changelog: string;
|
|
161
|
+
} | undefined;
|
|
162
|
+
}[];
|
|
163
|
+
nextCursor: string | null;
|
|
164
|
+
}, {}>;
|
|
165
|
+
export declare const ApiV1SkillResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
166
|
+
skill: {
|
|
167
|
+
slug: string;
|
|
168
|
+
displayName: string;
|
|
169
|
+
tags: unknown;
|
|
170
|
+
stats: unknown;
|
|
171
|
+
createdAt: number;
|
|
172
|
+
updatedAt: number;
|
|
173
|
+
summary?: string | null | undefined;
|
|
174
|
+
} | null;
|
|
175
|
+
latestVersion: {
|
|
176
|
+
version: string;
|
|
177
|
+
createdAt: number;
|
|
178
|
+
changelog: string;
|
|
179
|
+
} | null;
|
|
180
|
+
owner: {
|
|
181
|
+
handle: string | null;
|
|
182
|
+
displayName?: string | null | undefined;
|
|
183
|
+
image?: string | null | undefined;
|
|
184
|
+
} | null;
|
|
185
|
+
}, {}>;
|
|
186
|
+
export declare const ApiV1SkillVersionListResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
187
|
+
items: {
|
|
188
|
+
version: string;
|
|
189
|
+
createdAt: number;
|
|
190
|
+
changelog: string;
|
|
191
|
+
changelogSource?: "user" | "auto" | null | undefined;
|
|
192
|
+
}[];
|
|
193
|
+
nextCursor: string | null;
|
|
194
|
+
}, {}>;
|
|
195
|
+
export declare const ApiV1SkillVersionResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
196
|
+
version: {
|
|
197
|
+
version: string;
|
|
198
|
+
createdAt: number;
|
|
199
|
+
changelog: string;
|
|
200
|
+
changelogSource?: "user" | "auto" | null | undefined;
|
|
201
|
+
files?: unknown;
|
|
202
|
+
} | null;
|
|
203
|
+
skill: {
|
|
204
|
+
slug: string;
|
|
205
|
+
displayName: string;
|
|
206
|
+
} | null;
|
|
207
|
+
}, {}>;
|
|
208
|
+
export declare const ApiV1SkillResolveResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
209
|
+
match: {
|
|
210
|
+
version: string;
|
|
211
|
+
} | null;
|
|
212
|
+
latestVersion: {
|
|
213
|
+
version: string;
|
|
214
|
+
} | null;
|
|
215
|
+
}, {}>;
|
|
216
|
+
export declare const ApiV1PublishResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
217
|
+
ok: true;
|
|
218
|
+
skillId: string;
|
|
219
|
+
versionId: string;
|
|
220
|
+
}, {}>;
|
|
221
|
+
export declare const ApiV1DeleteResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
222
|
+
ok: true;
|
|
223
|
+
}, {}>;
|
|
224
|
+
export declare const ApiV1StarResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
225
|
+
ok: true;
|
|
226
|
+
starred: boolean;
|
|
227
|
+
alreadyStarred: boolean;
|
|
228
|
+
}, {}>;
|
|
229
|
+
export declare const ApiV1UnstarResponseSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
230
|
+
ok: true;
|
|
231
|
+
unstarred: boolean;
|
|
232
|
+
alreadyUnstarred: boolean;
|
|
233
|
+
}, {}>;
|
|
234
|
+
export declare const SkillInstallSpecSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
235
|
+
kind: "brew" | "node" | "go" | "uv";
|
|
236
|
+
id?: string | undefined;
|
|
237
|
+
label?: string | undefined;
|
|
238
|
+
bins?: string[] | undefined;
|
|
239
|
+
formula?: string | undefined;
|
|
240
|
+
tap?: string | undefined;
|
|
241
|
+
package?: string | undefined;
|
|
242
|
+
module?: string | undefined;
|
|
243
|
+
}, {}>;
|
|
244
|
+
export type SkillInstallSpec = (typeof SkillInstallSpecSchema)[inferred];
|
|
245
|
+
export declare const NixPluginSpecSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
246
|
+
plugin: string;
|
|
247
|
+
systems?: string[] | undefined;
|
|
248
|
+
}, {}>;
|
|
249
|
+
export type NixPluginSpec = (typeof NixPluginSpecSchema)[inferred];
|
|
250
|
+
export declare const PilotbotConfigSpecSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
251
|
+
requiredEnv?: string[] | undefined;
|
|
252
|
+
stateDirs?: string[] | undefined;
|
|
253
|
+
example?: string | undefined;
|
|
254
|
+
}, {}>;
|
|
255
|
+
export type PilotbotConfigSpec = (typeof PilotbotConfigSpecSchema)[inferred];
|
|
256
|
+
export declare const PilotbotRequiresSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
257
|
+
bins?: string[] | undefined;
|
|
258
|
+
anyBins?: string[] | undefined;
|
|
259
|
+
env?: string[] | undefined;
|
|
260
|
+
config?: string[] | undefined;
|
|
261
|
+
}, {}>;
|
|
262
|
+
export type PilotbotRequires = (typeof PilotbotRequiresSchema)[inferred];
|
|
263
|
+
export declare const PilotbotSkillMetadataSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
264
|
+
always?: boolean | undefined;
|
|
265
|
+
skillKey?: string | undefined;
|
|
266
|
+
primaryEnv?: string | undefined;
|
|
267
|
+
emoji?: string | undefined;
|
|
268
|
+
homepage?: string | undefined;
|
|
269
|
+
os?: string[] | undefined;
|
|
270
|
+
cliHelp?: string | undefined;
|
|
271
|
+
requires?: {
|
|
272
|
+
bins?: string[] | undefined;
|
|
273
|
+
anyBins?: string[] | undefined;
|
|
274
|
+
env?: string[] | undefined;
|
|
275
|
+
config?: string[] | undefined;
|
|
276
|
+
} | undefined;
|
|
277
|
+
install?: {
|
|
278
|
+
kind: "brew" | "node" | "go" | "uv";
|
|
279
|
+
id?: string | undefined;
|
|
280
|
+
label?: string | undefined;
|
|
281
|
+
bins?: string[] | undefined;
|
|
282
|
+
formula?: string | undefined;
|
|
283
|
+
tap?: string | undefined;
|
|
284
|
+
package?: string | undefined;
|
|
285
|
+
module?: string | undefined;
|
|
286
|
+
}[] | undefined;
|
|
287
|
+
nix?: {
|
|
288
|
+
plugin: string;
|
|
289
|
+
systems?: string[] | undefined;
|
|
290
|
+
} | undefined;
|
|
291
|
+
config?: {
|
|
292
|
+
requiredEnv?: string[] | undefined;
|
|
293
|
+
stateDirs?: string[] | undefined;
|
|
294
|
+
example?: string | undefined;
|
|
295
|
+
} | undefined;
|
|
296
|
+
}, {}>;
|
|
297
|
+
export type PilotbotSkillMetadata = (typeof PilotbotSkillMetadataSchema)[inferred];
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { type } from 'arktype';
|
|
2
|
+
export const GlobalConfigSchema = type({
|
|
3
|
+
registry: 'string',
|
|
4
|
+
token: 'string?',
|
|
5
|
+
});
|
|
6
|
+
export const WellKnownConfigSchema = type({
|
|
7
|
+
apiBase: 'string',
|
|
8
|
+
authBase: 'string?',
|
|
9
|
+
minCliVersion: 'string?',
|
|
10
|
+
}).or({
|
|
11
|
+
registry: 'string',
|
|
12
|
+
authBase: 'string?',
|
|
13
|
+
minCliVersion: 'string?',
|
|
14
|
+
});
|
|
15
|
+
export const LockfileSchema = type({
|
|
16
|
+
version: '1',
|
|
17
|
+
skills: {
|
|
18
|
+
'[string]': {
|
|
19
|
+
version: 'string|null',
|
|
20
|
+
installedAt: 'number',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
export const ApiCliWhoamiResponseSchema = type({
|
|
25
|
+
user: {
|
|
26
|
+
handle: 'string|null',
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
export const ApiSearchResponseSchema = type({
|
|
30
|
+
results: type({
|
|
31
|
+
slug: 'string?',
|
|
32
|
+
displayName: 'string?',
|
|
33
|
+
version: 'string|null?',
|
|
34
|
+
score: 'number',
|
|
35
|
+
}).array(),
|
|
36
|
+
});
|
|
37
|
+
export const ApiSkillMetaResponseSchema = type({
|
|
38
|
+
latestVersion: type({
|
|
39
|
+
version: 'string',
|
|
40
|
+
}).optional(),
|
|
41
|
+
skill: 'unknown|null?',
|
|
42
|
+
});
|
|
43
|
+
export const ApiCliUploadUrlResponseSchema = type({
|
|
44
|
+
uploadUrl: 'string',
|
|
45
|
+
});
|
|
46
|
+
export const ApiUploadFileResponseSchema = type({
|
|
47
|
+
storageId: 'string',
|
|
48
|
+
});
|
|
49
|
+
export const CliPublishFileSchema = type({
|
|
50
|
+
path: 'string',
|
|
51
|
+
size: 'number',
|
|
52
|
+
storageId: 'string',
|
|
53
|
+
sha256: 'string',
|
|
54
|
+
contentType: 'string?',
|
|
55
|
+
});
|
|
56
|
+
export const PublishSourceSchema = type({
|
|
57
|
+
kind: '"github"',
|
|
58
|
+
url: 'string',
|
|
59
|
+
repo: 'string',
|
|
60
|
+
ref: 'string',
|
|
61
|
+
commit: 'string',
|
|
62
|
+
path: 'string',
|
|
63
|
+
importedAt: 'number',
|
|
64
|
+
});
|
|
65
|
+
export const CliPublishRequestSchema = type({
|
|
66
|
+
slug: 'string',
|
|
67
|
+
displayName: 'string',
|
|
68
|
+
version: 'string',
|
|
69
|
+
changelog: 'string',
|
|
70
|
+
tags: 'string[]?',
|
|
71
|
+
source: PublishSourceSchema.optional(),
|
|
72
|
+
forkOf: type({
|
|
73
|
+
slug: 'string',
|
|
74
|
+
version: 'string?',
|
|
75
|
+
}).optional(),
|
|
76
|
+
files: CliPublishFileSchema.array(),
|
|
77
|
+
});
|
|
78
|
+
export const ApiCliPublishResponseSchema = type({
|
|
79
|
+
ok: 'true',
|
|
80
|
+
skillId: 'string',
|
|
81
|
+
versionId: 'string',
|
|
82
|
+
});
|
|
83
|
+
export const CliSkillDeleteRequestSchema = type({
|
|
84
|
+
slug: 'string',
|
|
85
|
+
});
|
|
86
|
+
export const ApiCliSkillDeleteResponseSchema = type({
|
|
87
|
+
ok: 'true',
|
|
88
|
+
});
|
|
89
|
+
export const ApiSkillResolveResponseSchema = type({
|
|
90
|
+
match: type({ version: 'string' }).or('null'),
|
|
91
|
+
latestVersion: type({ version: 'string' }).or('null'),
|
|
92
|
+
});
|
|
93
|
+
export const CliTelemetrySyncRequestSchema = type({
|
|
94
|
+
roots: type({
|
|
95
|
+
rootId: 'string',
|
|
96
|
+
label: 'string',
|
|
97
|
+
skills: type({
|
|
98
|
+
slug: 'string',
|
|
99
|
+
version: 'string|null?',
|
|
100
|
+
}).array(),
|
|
101
|
+
}).array(),
|
|
102
|
+
});
|
|
103
|
+
export const ApiCliTelemetrySyncResponseSchema = type({
|
|
104
|
+
ok: 'true',
|
|
105
|
+
});
|
|
106
|
+
export const ApiV1WhoamiResponseSchema = type({
|
|
107
|
+
user: {
|
|
108
|
+
handle: 'string|null',
|
|
109
|
+
displayName: 'string|null?',
|
|
110
|
+
image: 'string|null?',
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
export const ApiV1SearchResponseSchema = type({
|
|
114
|
+
results: type({
|
|
115
|
+
slug: 'string?',
|
|
116
|
+
displayName: 'string?',
|
|
117
|
+
summary: 'string|null?',
|
|
118
|
+
version: 'string|null?',
|
|
119
|
+
score: 'number',
|
|
120
|
+
updatedAt: 'number?',
|
|
121
|
+
}).array(),
|
|
122
|
+
});
|
|
123
|
+
export const ApiV1SkillListResponseSchema = type({
|
|
124
|
+
items: type({
|
|
125
|
+
slug: 'string',
|
|
126
|
+
displayName: 'string',
|
|
127
|
+
summary: 'string|null?',
|
|
128
|
+
tags: 'unknown',
|
|
129
|
+
stats: 'unknown',
|
|
130
|
+
createdAt: 'number',
|
|
131
|
+
updatedAt: 'number',
|
|
132
|
+
latestVersion: type({
|
|
133
|
+
version: 'string',
|
|
134
|
+
createdAt: 'number',
|
|
135
|
+
changelog: 'string',
|
|
136
|
+
}).optional(),
|
|
137
|
+
}).array(),
|
|
138
|
+
nextCursor: 'string|null',
|
|
139
|
+
});
|
|
140
|
+
export const ApiV1SkillResponseSchema = type({
|
|
141
|
+
skill: type({
|
|
142
|
+
slug: 'string',
|
|
143
|
+
displayName: 'string',
|
|
144
|
+
summary: 'string|null?',
|
|
145
|
+
tags: 'unknown',
|
|
146
|
+
stats: 'unknown',
|
|
147
|
+
createdAt: 'number',
|
|
148
|
+
updatedAt: 'number',
|
|
149
|
+
}).or('null'),
|
|
150
|
+
latestVersion: type({
|
|
151
|
+
version: 'string',
|
|
152
|
+
createdAt: 'number',
|
|
153
|
+
changelog: 'string',
|
|
154
|
+
}).or('null'),
|
|
155
|
+
owner: type({
|
|
156
|
+
handle: 'string|null',
|
|
157
|
+
displayName: 'string|null?',
|
|
158
|
+
image: 'string|null?',
|
|
159
|
+
}).or('null'),
|
|
160
|
+
});
|
|
161
|
+
export const ApiV1SkillVersionListResponseSchema = type({
|
|
162
|
+
items: type({
|
|
163
|
+
version: 'string',
|
|
164
|
+
createdAt: 'number',
|
|
165
|
+
changelog: 'string',
|
|
166
|
+
changelogSource: '"auto"|"user"|null?',
|
|
167
|
+
}).array(),
|
|
168
|
+
nextCursor: 'string|null',
|
|
169
|
+
});
|
|
170
|
+
export const ApiV1SkillVersionResponseSchema = type({
|
|
171
|
+
version: type({
|
|
172
|
+
version: 'string',
|
|
173
|
+
createdAt: 'number',
|
|
174
|
+
changelog: 'string',
|
|
175
|
+
changelogSource: '"auto"|"user"|null?',
|
|
176
|
+
files: 'unknown?',
|
|
177
|
+
}).or('null'),
|
|
178
|
+
skill: type({
|
|
179
|
+
slug: 'string',
|
|
180
|
+
displayName: 'string',
|
|
181
|
+
}).or('null'),
|
|
182
|
+
});
|
|
183
|
+
export const ApiV1SkillResolveResponseSchema = type({
|
|
184
|
+
match: type({ version: 'string' }).or('null'),
|
|
185
|
+
latestVersion: type({ version: 'string' }).or('null'),
|
|
186
|
+
});
|
|
187
|
+
export const ApiV1PublishResponseSchema = type({
|
|
188
|
+
ok: 'true',
|
|
189
|
+
skillId: 'string',
|
|
190
|
+
versionId: 'string',
|
|
191
|
+
});
|
|
192
|
+
export const ApiV1DeleteResponseSchema = type({
|
|
193
|
+
ok: 'true',
|
|
194
|
+
});
|
|
195
|
+
export const ApiV1StarResponseSchema = type({
|
|
196
|
+
ok: 'true',
|
|
197
|
+
starred: 'boolean',
|
|
198
|
+
alreadyStarred: 'boolean',
|
|
199
|
+
});
|
|
200
|
+
export const ApiV1UnstarResponseSchema = type({
|
|
201
|
+
ok: 'true',
|
|
202
|
+
unstarred: 'boolean',
|
|
203
|
+
alreadyUnstarred: 'boolean',
|
|
204
|
+
});
|
|
205
|
+
export const SkillInstallSpecSchema = type({
|
|
206
|
+
id: 'string?',
|
|
207
|
+
kind: '"brew"|"node"|"go"|"uv"',
|
|
208
|
+
label: 'string?',
|
|
209
|
+
bins: 'string[]?',
|
|
210
|
+
formula: 'string?',
|
|
211
|
+
tap: 'string?',
|
|
212
|
+
package: 'string?',
|
|
213
|
+
module: 'string?',
|
|
214
|
+
});
|
|
215
|
+
export const NixPluginSpecSchema = type({
|
|
216
|
+
plugin: 'string',
|
|
217
|
+
systems: 'string[]?',
|
|
218
|
+
});
|
|
219
|
+
export const PilotbotConfigSpecSchema = type({
|
|
220
|
+
requiredEnv: 'string[]?',
|
|
221
|
+
stateDirs: 'string[]?',
|
|
222
|
+
example: 'string?',
|
|
223
|
+
});
|
|
224
|
+
export const PilotbotRequiresSchema = type({
|
|
225
|
+
bins: 'string[]?',
|
|
226
|
+
anyBins: 'string[]?',
|
|
227
|
+
env: 'string[]?',
|
|
228
|
+
config: 'string[]?',
|
|
229
|
+
});
|
|
230
|
+
export const PilotbotSkillMetadataSchema = type({
|
|
231
|
+
always: 'boolean?',
|
|
232
|
+
skillKey: 'string?',
|
|
233
|
+
primaryEnv: 'string?',
|
|
234
|
+
emoji: 'string?',
|
|
235
|
+
homepage: 'string?',
|
|
236
|
+
os: 'string[]?',
|
|
237
|
+
cliHelp: 'string?',
|
|
238
|
+
requires: PilotbotRequiresSchema.optional(),
|
|
239
|
+
install: SkillInstallSpecSchema.array().optional(),
|
|
240
|
+
nix: NixPluginSpecSchema.optional(),
|
|
241
|
+
config: PilotbotConfigSpecSchema.optional(),
|
|
242
|
+
});
|
|
243
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,IAAI,EAAE,MAAM,SAAS,CAAA;AAE7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC;IACrC,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,SAAS;CACjB,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;IACxC,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,SAAS;IACnB,aAAa,EAAE,SAAS;CACzB,CAAC,CAAC,EAAE,CAAC;IACJ,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,SAAS;IACnB,aAAa,EAAE,SAAS;CACzB,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,GAAG;IACZ,MAAM,EAAE;QACN,UAAU,EAAE;YACV,OAAO,EAAE,aAAa;YACtB,WAAW,EAAE,QAAQ;SACtB;KACF;CACF,C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AI,CAAC;IAC7C,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,SAAS;IACnB,EAAE,EAAE,WAAW;IACf,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,qBAAqB,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,sBAAsB,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAClD,GAAG,EAAE,mBAAmB,CAAC,QAAQ,EAAE;IACnC,MAAM,EAAE,uBAAuB,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const TEXT_FILE_EXTENSIONS: readonly ["md", "mdx", "txt", "json", "json5", "yaml", "yml", "toml", "js", "cjs", "mjs", "ts", "tsx", "jsx", "py", "sh", "rb", "go", "rs", "swift", "kt", "java", "cs", "cpp", "c", "h", "hpp", "sql", "csv", "ini", "cfg", "env", "xml", "html", "css", "scss", "sass", "svg"];
|
|
2
|
+
export declare const TEXT_FILE_EXTENSION_SET: Set<string>;
|
|
3
|
+
export declare const TEXT_CONTENT_TYPES: readonly ["application/json", "application/xml", "application/yaml", "application/x-yaml", "application/toml", "application/javascript", "application/typescript", "application/markdown", "image/svg+xml"];
|
|
4
|
+
export declare const TEXT_CONTENT_TYPE_SET: Set<string>;
|
|
5
|
+
export declare function isTextContentType(contentType: string): boolean;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const RAW_TEXT_FILE_EXTENSIONS = [
|
|
2
|
+
'md',
|
|
3
|
+
'mdx',
|
|
4
|
+
'txt',
|
|
5
|
+
'json',
|
|
6
|
+
'json5',
|
|
7
|
+
'yaml',
|
|
8
|
+
'yml',
|
|
9
|
+
'toml',
|
|
10
|
+
'js',
|
|
11
|
+
'cjs',
|
|
12
|
+
'mjs',
|
|
13
|
+
'ts',
|
|
14
|
+
'tsx',
|
|
15
|
+
'jsx',
|
|
16
|
+
'py',
|
|
17
|
+
'sh',
|
|
18
|
+
'rb',
|
|
19
|
+
'go',
|
|
20
|
+
'rs',
|
|
21
|
+
'swift',
|
|
22
|
+
'kt',
|
|
23
|
+
'java',
|
|
24
|
+
'cs',
|
|
25
|
+
'cpp',
|
|
26
|
+
'c',
|
|
27
|
+
'h',
|
|
28
|
+
'hpp',
|
|
29
|
+
'sql',
|
|
30
|
+
'csv',
|
|
31
|
+
'ini',
|
|
32
|
+
'cfg',
|
|
33
|
+
'env',
|
|
34
|
+
'xml',
|
|
35
|
+
'html',
|
|
36
|
+
'css',
|
|
37
|
+
'scss',
|
|
38
|
+
'sass',
|
|
39
|
+
'svg',
|
|
40
|
+
];
|
|
41
|
+
export const TEXT_FILE_EXTENSIONS = RAW_TEXT_FILE_EXTENSIONS;
|
|
42
|
+
export const TEXT_FILE_EXTENSION_SET = new Set(TEXT_FILE_EXTENSIONS);
|
|
43
|
+
const RAW_TEXT_CONTENT_TYPES = [
|
|
44
|
+
'application/json',
|
|
45
|
+
'application/xml',
|
|
46
|
+
'application/yaml',
|
|
47
|
+
'application/x-yaml',
|
|
48
|
+
'application/toml',
|
|
49
|
+
'application/javascript',
|
|
50
|
+
'application/typescript',
|
|
51
|
+
'application/markdown',
|
|
52
|
+
'image/svg+xml',
|
|
53
|
+
];
|
|
54
|
+
export const TEXT_CONTENT_TYPES = RAW_TEXT_CONTENT_TYPES;
|
|
55
|
+
export const TEXT_CONTENT_TYPE_SET = new Set(TEXT_CONTENT_TYPES);
|
|
56
|
+
export function isTextContentType(contentType) {
|
|
57
|
+
if (!contentType)
|
|
58
|
+
return false;
|
|
59
|
+
const normalized = contentType.split(';', 1)[0]?.trim().toLowerCase() ?? '';
|
|
60
|
+
if (!normalized)
|
|
61
|
+
return false;
|
|
62
|
+
if (normalized.startsWith('text/'))
|
|
63
|
+
return true;
|
|
64
|
+
return TEXT_CONTENT_TYPE_SET.has(normalized);
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=textFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textFiles.js","sourceRoot":"","sources":["../src/textFiles.ts"],"names":[],"mappings":"AAAA,MAAM,wBAAwB,GAAG;IAC/B,IAAI;IACJ,KAAK;IACL,KAAK;IACL,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,MAAM;IACN,IAAI;IACJ,KAAK;IACL,KAAK;IACL,IAAI;IACJ,KAAK;IACL,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,MAAM;IACN,IAAI;IACJ,KAAK;IACL,GAAG;IACH,GAAG;IACH,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,KAAK;CACG,CAAA;AAEV,MAAM,CAAC,MAAM,oBAAoB,GAAG,wBAAwB,CAAA;AAC5D,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAS,oBAAoB,CAAC,CAAA;AAE5E,MAAM,sBAAsB,GAAG;IAC7B,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,oBAAoB;IACpB,kBAAkB;IAClB,wBAAwB;IACxB,wBAAwB;IACxB,sBAAsB;IACtB,eAAe;CACP,CAAA;AAEV,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAA;AACxD,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAS,kBAAkB,CAAC,CAAA;AAExE,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,IAAI,CAAC,WAAW;QAAE,OAAO,KAAK,CAAA;IAC9B,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,IAAI,EAAE,CAAA;IAC3E,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAA;IAC7B,IAAI,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAA;IAC/C,OAAO,qBAAqB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;AAC9C,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pilothub-schema",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc -p tsconfig.json",
|
|
18
|
+
"prepublishOnly": "npm run build"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"arktype": "^2.1.29"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"typescript": "^5.9.3"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ArkErrors } from 'arktype'
|
|
2
|
+
|
|
3
|
+
export type ArkValidator<T> = (data: unknown) => T | ArkErrors
|
|
4
|
+
|
|
5
|
+
export function parseArk<T>(schema: ArkValidator<T>, data: unknown, label: string) {
|
|
6
|
+
const result = schema(data)
|
|
7
|
+
if (result instanceof ArkErrors) {
|
|
8
|
+
throw new Error(`${label}: ${formatArkErrors(result)}`)
|
|
9
|
+
}
|
|
10
|
+
return result
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function formatArkErrors(errors: ArkErrors) {
|
|
14
|
+
const parts: string[] = []
|
|
15
|
+
for (const error of errors) {
|
|
16
|
+
if (parts.length >= 3) break
|
|
17
|
+
const path = Array.isArray(error.path) ? error.path.join('.') : ''
|
|
18
|
+
const location = path ? `${path}: ` : ''
|
|
19
|
+
const description =
|
|
20
|
+
typeof (error as { description?: unknown }).description === 'string'
|
|
21
|
+
? ((error as { description: string }).description as string)
|
|
22
|
+
: 'invalid value'
|
|
23
|
+
parts.push(`${location}${description}`)
|
|
24
|
+
}
|
|
25
|
+
if (errors.count > parts.length) {
|
|
26
|
+
parts.push(`+${errors.count - parts.length} more`)
|
|
27
|
+
}
|
|
28
|
+
return parts.join('; ')
|
|
29
|
+
}
|