@openkeyai/tool-manifest 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/LICENSE +21 -0
- package/README.md +136 -0
- package/dist/cli.cjs +294 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +288 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +231 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +110 -0
- package/dist/index.d.ts +110 -0
- package/dist/index.js +218 -0
- package/dist/index.js.map +1 -0
- package/dist/schema.cjs +59 -0
- package/dist/schema.cjs.map +1 -0
- package/dist/schema.d.cts +69 -0
- package/dist/schema.d.ts +69 -0
- package/dist/schema.js +50 -0
- package/dist/schema.js.map +1 -0
- package/package.json +62 -0
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export { ZodError } from 'zod';
|
|
3
|
+
|
|
4
|
+
/** Scopes are the FROZEN set from ARCHITECTURE.md Appendix B. */
|
|
5
|
+
declare const ToolScopeEnum: z.ZodEnum<{
|
|
6
|
+
"keys.read": "keys.read";
|
|
7
|
+
"user.read": "user.read";
|
|
8
|
+
"billing.read": "billing.read";
|
|
9
|
+
}>;
|
|
10
|
+
type ToolScope = z.infer<typeof ToolScopeEnum>;
|
|
11
|
+
/** Provider slugs aligned with the hub vault's `PROVIDERS` registry. */
|
|
12
|
+
declare const ProviderSlugEnum: z.ZodEnum<{
|
|
13
|
+
openai: "openai";
|
|
14
|
+
anthropic: "anthropic";
|
|
15
|
+
google: "google";
|
|
16
|
+
replicate: "replicate";
|
|
17
|
+
elevenlabs: "elevenlabs";
|
|
18
|
+
fal: "fal";
|
|
19
|
+
}>;
|
|
20
|
+
type ProviderSlug = z.infer<typeof ProviderSlugEnum>;
|
|
21
|
+
/** Runtime tier — pick the right template + deploy pipeline. */
|
|
22
|
+
declare const RuntimeTierEnum: z.ZodEnum<{
|
|
23
|
+
edge: "edge";
|
|
24
|
+
container: "container";
|
|
25
|
+
}>;
|
|
26
|
+
type RuntimeTier = z.infer<typeof RuntimeTierEnum>;
|
|
27
|
+
/** Owner — at least a name; email + github are nice-to-have for support. */
|
|
28
|
+
declare const ToolOwnerSchema: z.ZodObject<{
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
email: z.ZodOptional<z.ZodString>;
|
|
31
|
+
github: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
type ToolOwner = z.infer<typeof ToolOwnerSchema>;
|
|
34
|
+
/** Top-level schema. */
|
|
35
|
+
declare const ToolManifestSchema: z.ZodObject<{
|
|
36
|
+
slug: z.ZodString;
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
description: z.ZodDefault<z.ZodString>;
|
|
39
|
+
version: z.ZodString;
|
|
40
|
+
runtime: z.ZodEnum<{
|
|
41
|
+
edge: "edge";
|
|
42
|
+
container: "container";
|
|
43
|
+
}>;
|
|
44
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
45
|
+
"keys.read": "keys.read";
|
|
46
|
+
"user.read": "user.read";
|
|
47
|
+
"billing.read": "billing.read";
|
|
48
|
+
}>>;
|
|
49
|
+
providers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
50
|
+
openai: "openai";
|
|
51
|
+
anthropic: "anthropic";
|
|
52
|
+
google: "google";
|
|
53
|
+
replicate: "replicate";
|
|
54
|
+
elevenlabs: "elevenlabs";
|
|
55
|
+
fal: "fal";
|
|
56
|
+
}>>>;
|
|
57
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
58
|
+
callback_url: z.ZodString;
|
|
59
|
+
owner: z.ZodObject<{
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
email: z.ZodOptional<z.ZodString>;
|
|
62
|
+
github: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
sdk_version: z.ZodString;
|
|
65
|
+
category: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
type ToolManifest = z.infer<typeof ToolManifestSchema>;
|
|
68
|
+
|
|
69
|
+
export { type ProviderSlug, ProviderSlugEnum, type RuntimeTier, RuntimeTierEnum, type ToolManifest, ToolManifestSchema, type ToolOwner, ToolOwnerSchema, type ToolScope, ToolScopeEnum };
|
package/dist/schema.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export { ZodError } from 'zod';
|
|
3
|
+
|
|
4
|
+
// src/schema.ts
|
|
5
|
+
var slugRegex = /^[a-z][a-z0-9-]{1,38}[a-z0-9]$/;
|
|
6
|
+
var ToolScopeEnum = z.enum(["keys.read", "user.read", "billing.read"]);
|
|
7
|
+
var ProviderSlugEnum = z.enum([
|
|
8
|
+
"openai",
|
|
9
|
+
"anthropic",
|
|
10
|
+
"google",
|
|
11
|
+
"replicate",
|
|
12
|
+
"elevenlabs",
|
|
13
|
+
"fal"
|
|
14
|
+
]);
|
|
15
|
+
var RuntimeTierEnum = z.enum(["edge", "container"]);
|
|
16
|
+
var ToolOwnerSchema = z.object({
|
|
17
|
+
name: z.string().min(1).max(80),
|
|
18
|
+
email: z.string().email().optional(),
|
|
19
|
+
github: z.string().regex(/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,38}[a-zA-Z0-9])?$/, "github handle").optional()
|
|
20
|
+
});
|
|
21
|
+
var ToolManifestSchema = z.object({
|
|
22
|
+
/** Stable URL-safe identifier. Becomes the JWT's `aud` claim. */
|
|
23
|
+
slug: z.string().regex(slugRegex, "slug must be lowercase kebab-case, 3\u201340 chars"),
|
|
24
|
+
/** Human-readable name shown in the catalog and HubHeader. */
|
|
25
|
+
name: z.string().min(1).max(80),
|
|
26
|
+
/** One-sentence catalog description. */
|
|
27
|
+
description: z.string().max(280).default(""),
|
|
28
|
+
/** Tool version (semver). */
|
|
29
|
+
version: z.string().regex(/^\d+\.\d+\.\d+(?:-[\w.+-]+)?$/, "semver"),
|
|
30
|
+
/** Runtime tier — picks template + deploy pipeline. */
|
|
31
|
+
runtime: RuntimeTierEnum,
|
|
32
|
+
/** Scopes the tool may request when minting a JWT. Min 1. */
|
|
33
|
+
scopes: z.array(ToolScopeEnum).min(1),
|
|
34
|
+
/** API provider slugs the tool may fetch keys for. */
|
|
35
|
+
providers: z.array(ProviderSlugEnum).default([]),
|
|
36
|
+
/** Public homepage / docs URL. Surfaced in the hub catalog. */
|
|
37
|
+
homepage: z.string().url().optional(),
|
|
38
|
+
/** Where the hub sends users after issuing a token. https only. */
|
|
39
|
+
callback_url: z.string().url().refine((u) => u.startsWith("https://"), "callback_url must be https://"),
|
|
40
|
+
/** Tool owner. */
|
|
41
|
+
owner: ToolOwnerSchema,
|
|
42
|
+
/** Semver range the tool was built against. Hub uses this for compat warnings. */
|
|
43
|
+
sdk_version: z.string().min(1),
|
|
44
|
+
/** Optional category for catalog grouping (e.g. "media", "writing"). */
|
|
45
|
+
category: z.string().min(1).max(40).optional()
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export { ProviderSlugEnum, RuntimeTierEnum, ToolManifestSchema, ToolOwnerSchema, ToolScopeEnum };
|
|
49
|
+
//# sourceMappingURL=schema.js.map
|
|
50
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schema.ts"],"names":[],"mappings":";;;;AAsBA,IAAM,SAAA,GAAY,gCAAA;AAGX,IAAM,gBAAgB,CAAA,CAAE,IAAA,CAAK,CAAC,WAAA,EAAa,WAAA,EAAa,cAAc,CAAC;AAIvE,IAAM,gBAAA,GAAmB,EAAE,IAAA,CAAK;AAAA,EACrC,QAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAC;AAIM,IAAM,kBAAkB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;AAAA;AAAA,EAE1E,KAAA,EAAO,eAAA;AAAA;AAAA,EAEP,WAAA,EAAa,CAAA,CAAE,MAAA,EAAO,CAAE,IAAI,CAAC,CAAA;AAAA;AAAA,EAE7B,QAAA,EAAU,CAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,EAAE,CAAA,CAAE,QAAA;AACtC,CAAC","file":"schema.js","sourcesContent":["import { z } from \"zod\";\n\n/**\n * `tool.json` — the manifest every OpenKey AI tool ships at the repo root.\n *\n * This schema is the SOURCE OF TRUTH for the contract. The hub's tool\n * registry sync (Phase 9b, lands in the hub repo) imports\n * `ToolManifestSchema` from this package and rejects any insert that\n * doesn't parse cleanly. The Phase 13 auto-scaffolder uses the same\n * schema to produce a starter `tool.json` for newly-voted tools.\n *\n * Status of fields:\n * - FROZEN — changing the shape (rename, type swap, required→optional)\n * is a major version bump with 60-day notice to tool authors\n * - ADDITIONS — new optional fields are minor version bumps\n *\n * We deliberately keep the schema lean. A field exists here only if either\n * (a) the hub needs it to register the tool, (b) the SDK needs it at\n * runtime, or (c) the scanner needs it to enforce a rule.\n */\n\n/** Slug — lowercase kebab-case, 3–40 chars. Matches the hub's `tools.slug` CHECK. */\nconst slugRegex = /^[a-z][a-z0-9-]{1,38}[a-z0-9]$/;\n\n/** Scopes are the FROZEN set from ARCHITECTURE.md Appendix B. */\nexport const ToolScopeEnum = z.enum([\"keys.read\", \"user.read\", \"billing.read\"]);\nexport type ToolScope = z.infer<typeof ToolScopeEnum>;\n\n/** Provider slugs aligned with the hub vault's `PROVIDERS` registry. */\nexport const ProviderSlugEnum = z.enum([\n \"openai\",\n \"anthropic\",\n \"google\",\n \"replicate\",\n \"elevenlabs\",\n \"fal\",\n]);\nexport type ProviderSlug = z.infer<typeof ProviderSlugEnum>;\n\n/** Runtime tier — pick the right template + deploy pipeline. */\nexport const RuntimeTierEnum = z.enum([\"edge\", \"container\"]);\nexport type RuntimeTier = z.infer<typeof RuntimeTierEnum>;\n\n/** Owner — at least a name; email + github are nice-to-have for support. */\nexport const ToolOwnerSchema = z.object({\n name: z.string().min(1).max(80),\n email: z.string().email().optional(),\n github: z\n .string()\n .regex(/^[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,38}[a-zA-Z0-9])?$/, \"github handle\")\n .optional(),\n});\nexport type ToolOwner = z.infer<typeof ToolOwnerSchema>;\n\n/** Top-level schema. */\nexport const ToolManifestSchema = z.object({\n /** Stable URL-safe identifier. Becomes the JWT's `aud` claim. */\n slug: z.string().regex(slugRegex, \"slug must be lowercase kebab-case, 3–40 chars\"),\n /** Human-readable name shown in the catalog and HubHeader. */\n name: z.string().min(1).max(80),\n /** One-sentence catalog description. */\n description: z.string().max(280).default(\"\"),\n /** Tool version (semver). */\n version: z.string().regex(/^\\d+\\.\\d+\\.\\d+(?:-[\\w.+-]+)?$/, \"semver\"),\n /** Runtime tier — picks template + deploy pipeline. */\n runtime: RuntimeTierEnum,\n /** Scopes the tool may request when minting a JWT. Min 1. */\n scopes: z.array(ToolScopeEnum).min(1),\n /** API provider slugs the tool may fetch keys for. */\n providers: z.array(ProviderSlugEnum).default([]),\n /** Public homepage / docs URL. Surfaced in the hub catalog. */\n homepage: z.string().url().optional(),\n /** Where the hub sends users after issuing a token. https only. */\n callback_url: z\n .string()\n .url()\n .refine((u) => u.startsWith(\"https://\"), \"callback_url must be https://\"),\n /** Tool owner. */\n owner: ToolOwnerSchema,\n /** Semver range the tool was built against. Hub uses this for compat warnings. */\n sdk_version: z.string().min(1),\n /** Optional category for catalog grouping (e.g. \"media\", \"writing\"). */\n category: z.string().min(1).max(40).optional(),\n});\n\nexport type ToolManifest = z.infer<typeof ToolManifestSchema>;\n\n/** Re-export Zod errors verbatim — consumers can `instanceof` check them. */\nexport { ZodError } from \"zod\";\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openkeyai/tool-manifest",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Schema + AST scanner that enforces the OpenKey AI tool contract.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Scott Goodwin",
|
|
7
|
+
"homepage": "https://openkeyai.com",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/Scott-Builds-AI/tool-manifest.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/Scott-Builds-AI/tool-manifest/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.cjs",
|
|
17
|
+
"module": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"bin": {
|
|
20
|
+
"okai-scan": "./dist/cli.js"
|
|
21
|
+
},
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"require": "./dist/index.cjs",
|
|
26
|
+
"types": "./dist/index.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./schema": {
|
|
29
|
+
"import": "./dist/schema.js",
|
|
30
|
+
"require": "./dist/schema.cjs",
|
|
31
|
+
"types": "./dist/schema.d.ts"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE"
|
|
38
|
+
],
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"zod": "^4.4.3"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^20",
|
|
44
|
+
"tsup": "^8.3.0",
|
|
45
|
+
"typescript": "^5.6.0",
|
|
46
|
+
"vitest": "^2.1.0"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=20"
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsup",
|
|
56
|
+
"dev": "tsup --watch",
|
|
57
|
+
"typecheck": "tsc --noEmit",
|
|
58
|
+
"lint": "tsc --noEmit",
|
|
59
|
+
"test": "vitest run",
|
|
60
|
+
"test:watch": "vitest"
|
|
61
|
+
}
|
|
62
|
+
}
|