toolfactory 0.1.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/README.md +166 -0
- package/dist/bindings/index.d.ts +23 -0
- package/dist/bindings/index.js +29 -0
- package/dist/bindings/python.d.ts +33 -0
- package/dist/bindings/python.js +805 -0
- package/dist/bindings/python.test.d.ts +1 -0
- package/dist/bindings/python.test.js +316 -0
- package/dist/bindings/typescript.d.ts +39 -0
- package/dist/bindings/typescript.js +758 -0
- package/dist/bindings/typescript.test.d.ts +1 -0
- package/dist/bindings/typescript.test.js +264 -0
- package/dist/commands.d.ts +188 -0
- package/dist/commands.js +662 -0
- package/dist/commands.test.d.ts +1 -0
- package/dist/commands.test.js +215 -0
- package/dist/e2e.test.d.ts +1 -0
- package/dist/e2e.test.js +124 -0
- package/dist/hosts/browser.d.ts +10 -0
- package/dist/hosts/browser.js +94 -0
- package/dist/hosts/github.d.ts +66 -0
- package/dist/hosts/github.js +247 -0
- package/dist/hosts/openclaw.d.ts +4 -0
- package/dist/hosts/openclaw.js +94 -0
- package/dist/hosts/template.d.ts +15 -0
- package/dist/hosts/template.js +142 -0
- package/dist/hosts/web.d.ts +4 -0
- package/dist/hosts/web.js +89 -0
- package/dist/identity/name.d.ts +20 -0
- package/dist/identity/name.js +33 -0
- package/dist/identity/name.test.d.ts +1 -0
- package/dist/identity/name.test.js +37 -0
- package/dist/identity/read.d.ts +9 -0
- package/dist/identity/read.js +106 -0
- package/dist/identity/read.test.d.ts +1 -0
- package/dist/identity/read.test.js +76 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/introspect/index.d.ts +15 -0
- package/dist/introspect/index.js +63 -0
- package/dist/model.d.ts +236 -0
- package/dist/model.js +214 -0
- package/dist/ops.d.ts +255 -0
- package/dist/ops.js +297 -0
- package/dist/project/apply.d.ts +35 -0
- package/dist/project/apply.js +360 -0
- package/dist/project/apply.test.d.ts +1 -0
- package/dist/project/apply.test.js +285 -0
- package/dist/project/gate.d.ts +129 -0
- package/dist/project/gate.js +597 -0
- package/dist/project/history.d.ts +62 -0
- package/dist/project/history.js +41 -0
- package/dist/project/load.d.ts +21 -0
- package/dist/project/load.js +82 -0
- package/dist/project/lock.d.ts +28 -0
- package/dist/project/lock.js +42 -0
- package/dist/project/plan.d.ts +5 -0
- package/dist/project/plan.js +96 -0
- package/dist/report/coverage.d.ts +22 -0
- package/dist/report/coverage.js +72 -0
- package/dist/report/coverage.test.d.ts +1 -0
- package/dist/report/coverage.test.js +93 -0
- package/dist/surfaces/agent-plugins.d.ts +10 -0
- package/dist/surfaces/agent-plugins.js +36 -0
- package/dist/surfaces/agents.d.ts +35 -0
- package/dist/surfaces/agents.js +609 -0
- package/dist/surfaces/agents.template.d.ts +8 -0
- package/dist/surfaces/agents.template.js +21 -0
- package/dist/surfaces/agents.test.d.ts +1 -0
- package/dist/surfaces/agents.test.js +181 -0
- package/dist/surfaces/browser-extension.d.ts +101 -0
- package/dist/surfaces/browser-extension.js +1034 -0
- package/dist/surfaces/browser-extension.test.d.ts +1 -0
- package/dist/surfaces/browser-extension.test.js +145 -0
- package/dist/surfaces/claude.d.ts +2 -0
- package/dist/surfaces/claude.js +81 -0
- package/dist/surfaces/codex.d.ts +13 -0
- package/dist/surfaces/codex.js +101 -0
- package/dist/surfaces/codex.test.d.ts +1 -0
- package/dist/surfaces/codex.test.js +67 -0
- package/dist/surfaces/cursor.d.ts +2 -0
- package/dist/surfaces/cursor.js +50 -0
- package/dist/surfaces/distribution.test.d.ts +1 -0
- package/dist/surfaces/distribution.test.js +146 -0
- package/dist/surfaces/dsh.d.ts +25 -0
- package/dist/surfaces/dsh.js +147 -0
- package/dist/surfaces/dsh.test.d.ts +1 -0
- package/dist/surfaces/dsh.test.js +100 -0
- package/dist/surfaces/external.d.ts +9 -0
- package/dist/surfaces/external.js +4 -0
- package/dist/surfaces/gemini.d.ts +29 -0
- package/dist/surfaces/gemini.js +68 -0
- package/dist/surfaces/gemini.test.d.ts +1 -0
- package/dist/surfaces/gemini.test.js +74 -0
- package/dist/surfaces/hermes-native.d.ts +53 -0
- package/dist/surfaces/hermes-native.js +507 -0
- package/dist/surfaces/hermes-native.test.d.ts +1 -0
- package/dist/surfaces/hermes-native.test.js +156 -0
- package/dist/surfaces/kernel.d.ts +5 -0
- package/dist/surfaces/kernel.js +63 -0
- package/dist/surfaces/mcp-registry.d.ts +19 -0
- package/dist/surfaces/mcp-registry.js +160 -0
- package/dist/surfaces/mcp-registry.test.d.ts +1 -0
- package/dist/surfaces/mcp-registry.test.js +79 -0
- package/dist/surfaces/mcpb.d.ts +11 -0
- package/dist/surfaces/mcpb.js +118 -0
- package/dist/surfaces/mcpb.test.d.ts +1 -0
- package/dist/surfaces/mcpb.test.js +104 -0
- package/dist/surfaces/npm.d.ts +6 -0
- package/dist/surfaces/npm.js +72 -0
- package/dist/surfaces/openclaw-native.d.ts +93 -0
- package/dist/surfaces/openclaw-native.js +956 -0
- package/dist/surfaces/openclaw-native.test.d.ts +1 -0
- package/dist/surfaces/openclaw-native.test.js +246 -0
- package/dist/surfaces/pypi.d.ts +5 -0
- package/dist/surfaces/pypi.js +82 -0
- package/dist/surfaces/readme.d.ts +7 -0
- package/dist/surfaces/readme.js +181 -0
- package/dist/surfaces/registry.d.ts +6 -0
- package/dist/surfaces/registry.js +73 -0
- package/dist/surfaces/shared.d.ts +49 -0
- package/dist/surfaces/shared.js +112 -0
- package/dist/surfaces/skill.d.ts +7 -0
- package/dist/surfaces/skill.js +118 -0
- package/dist/surfaces/skill.test.d.ts +1 -0
- package/dist/surfaces/skill.test.js +87 -0
- package/dist/surfaces/web.d.ts +97 -0
- package/dist/surfaces/web.js +1285 -0
- package/dist/surfaces/web.test.d.ts +1 -0
- package/dist/surfaces/web.test.js +255 -0
- package/dist/surfaces/workflows.d.ts +2 -0
- package/dist/surfaces/workflows.js +809 -0
- package/dist/surfaces/workflows.test.d.ts +1 -0
- package/dist/surfaces/workflows.test.js +563 -0
- package/dist/toolfactory/cli.d.ts +2 -0
- package/dist/toolfactory/cli.js +65 -0
- package/dist/toolfactory/config.d.ts +3 -0
- package/dist/toolfactory/config.js +27 -0
- package/dist/toolfactory/mcp.d.ts +37 -0
- package/dist/toolfactory/mcp.js +269 -0
- package/dist/toolfactory/types.d.ts +31 -0
- package/dist/toolfactory/types.js +10 -0
- package/dist/toolfactory/web.d.ts +4 -0
- package/dist/toolfactory/web.js +40 -0
- package/dist/validate/agent-plugins.d.ts +5 -0
- package/dist/validate/agent-plugins.js +46 -0
- package/package.json +68 -0
- package/schemas/agent-plugins/mcp.schema.json +120 -0
- package/schemas/agent-plugins/plugin.schema.json +65 -0
- package/src/bindings/index.ts +47 -0
- package/src/bindings/python.test.ts +374 -0
- package/src/bindings/python.ts +862 -0
- package/src/bindings/typescript.test.ts +329 -0
- package/src/bindings/typescript.ts +818 -0
- package/src/commands.test.ts +253 -0
- package/src/commands.ts +886 -0
- package/src/e2e.test.ts +169 -0
- package/src/hosts/browser.ts +106 -0
- package/src/hosts/github.ts +321 -0
- package/src/hosts/openclaw.ts +110 -0
- package/src/hosts/template.ts +149 -0
- package/src/hosts/web.ts +111 -0
- package/src/identity/name.test.ts +43 -0
- package/src/identity/name.ts +39 -0
- package/src/identity/read.test.ts +92 -0
- package/src/identity/read.ts +119 -0
- package/src/index.ts +11 -0
- package/src/introspect/index.ts +72 -0
- package/src/model.ts +386 -0
- package/src/ops.ts +333 -0
- package/src/project/apply.test.ts +348 -0
- package/src/project/apply.ts +417 -0
- package/src/project/gate.ts +717 -0
- package/src/project/history.ts +46 -0
- package/src/project/load.ts +104 -0
- package/src/project/lock.ts +54 -0
- package/src/project/plan.ts +101 -0
- package/src/report/coverage.test.ts +108 -0
- package/src/report/coverage.ts +113 -0
- package/src/surfaces/agent-plugins.ts +47 -0
- package/src/surfaces/agents.template.ts +32 -0
- package/src/surfaces/agents.test.ts +206 -0
- package/src/surfaces/agents.ts +729 -0
- package/src/surfaces/browser-extension.test.ts +175 -0
- package/src/surfaces/browser-extension.ts +1095 -0
- package/src/surfaces/claude.ts +99 -0
- package/src/surfaces/codex.test.ts +71 -0
- package/src/surfaces/codex.ts +105 -0
- package/src/surfaces/cursor.ts +62 -0
- package/src/surfaces/distribution.test.ts +166 -0
- package/src/surfaces/dsh.test.ts +110 -0
- package/src/surfaces/dsh.ts +159 -0
- package/src/surfaces/external.ts +13 -0
- package/src/surfaces/gemini.test.ts +80 -0
- package/src/surfaces/gemini.ts +84 -0
- package/src/surfaces/hermes-native.test.ts +179 -0
- package/src/surfaces/hermes-native.ts +584 -0
- package/src/surfaces/kernel.ts +68 -0
- package/src/surfaces/mcp-registry.test.ts +99 -0
- package/src/surfaces/mcp-registry.ts +190 -0
- package/src/surfaces/mcpb.test.ts +112 -0
- package/src/surfaces/mcpb.ts +130 -0
- package/src/surfaces/npm.ts +78 -0
- package/src/surfaces/openclaw-native.test.ts +283 -0
- package/src/surfaces/openclaw-native.ts +1070 -0
- package/src/surfaces/pypi.ts +84 -0
- package/src/surfaces/readme.ts +218 -0
- package/src/surfaces/registry.ts +79 -0
- package/src/surfaces/shared.ts +140 -0
- package/src/surfaces/skill.test.ts +103 -0
- package/src/surfaces/skill.ts +136 -0
- package/src/surfaces/web.test.ts +303 -0
- package/src/surfaces/web.ts +1310 -0
- package/src/surfaces/workflows.test.ts +677 -0
- package/src/surfaces/workflows.ts +936 -0
- package/src/toolfactory/cli.ts +74 -0
- package/src/toolfactory/config.ts +33 -0
- package/src/toolfactory/mcp.ts +311 -0
- package/src/toolfactory/types.ts +52 -0
- package/src/toolfactory/web.ts +45 -0
- package/src/validate/agent-plugins.ts +53 -0
- package/web/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/web/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/web/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/web/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/web/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/web/dist/assets/index-CCXhQKK3.css +2 -0
- package/web/dist/assets/index-D1PwZ3qS.js +10 -0
- package/web/dist/index.html +14 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { type PackageManager, type Project, type SurfaceId } from "../model.js";
|
|
2
|
+
export interface GateStep {
|
|
3
|
+
/** Step label: the CI step name, and the banner the shell script echoes. */
|
|
4
|
+
name: string;
|
|
5
|
+
run: string;
|
|
6
|
+
/**
|
|
7
|
+
* `"ci"` — runner provisioning no checkout may perform on the author's machine (a global or
|
|
8
|
+
* system-wide install); the local runner skips it. `"node24"` — needs Node >= 24, which the
|
|
9
|
+
* `openclaw` CLI does; the matrix guard in `ci.yml`.
|
|
10
|
+
*/
|
|
11
|
+
when?: "ci" | "node24";
|
|
12
|
+
env?: Record<string, string>;
|
|
13
|
+
}
|
|
14
|
+
/** Where `toolfactory package` and the release `package` job leave every asset. */
|
|
15
|
+
export declare const RELEASE_DIR = "dist/release";
|
|
16
|
+
/** The web app's build, shared by the release tarball and the Pages job (which sets `PAGES_BASE`). */
|
|
17
|
+
export declare const WEB_BUILD = "npm -C web ci && npm -C web run build";
|
|
18
|
+
/** The commands each supported package manager spells; `package.json` `packageManager` picks the row. */
|
|
19
|
+
export declare const PACKAGE_MANAGER_COMMANDS: Record<PackageManager, {
|
|
20
|
+
install: string;
|
|
21
|
+
run: (script: string) => string;
|
|
22
|
+
test: string;
|
|
23
|
+
}>;
|
|
24
|
+
/** How the project invokes toolfactory: the devDependency in a TypeScript project, a pinned fetch otherwise. */
|
|
25
|
+
export declare function toolfactoryCli(project: Project): string;
|
|
26
|
+
/**
|
|
27
|
+
* Dependencies and, for TypeScript, the build — everything both the gate and the packaging run
|
|
28
|
+
* need before any command that imports the project's own code.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Output files (§2.2 S4) are build products, not tracked: a fresh checkout has none, and the
|
|
32
|
+
* validators and the web build read them. On a tree `check` has just proved current, `build`
|
|
33
|
+
* writes exactly those.
|
|
34
|
+
*/
|
|
35
|
+
export declare function outputsStep(project: Project): GateStep;
|
|
36
|
+
export declare function bootstrapSteps(project: Project): GateStep[];
|
|
37
|
+
/**
|
|
38
|
+
* The gate: bootstrap, the drift check, the validator CLIs the selected surfaces need on PATH,
|
|
39
|
+
* `toolfactory validate` (every surface's own upstream validator), the author's `check` and
|
|
40
|
+
* tests, and the credential-free OpenClaw turn. Nothing is transcribed from a surface — the
|
|
41
|
+
* commands a surface owns are reached through `toolfactory validate`, so this list cannot drift
|
|
42
|
+
* away from what `validate` actually runs.
|
|
43
|
+
*/
|
|
44
|
+
export declare function gateSteps(project: Project): GateStep[];
|
|
45
|
+
/**
|
|
46
|
+
* §2.2: one version, in the identity file, projected everywhere by `build`. A release therefore
|
|
47
|
+
* asserts the tag against it and never writes it — rewriting a SHA-locked file from the tag would
|
|
48
|
+
* be a change `build` did not make and `check` would fail on the next run.
|
|
49
|
+
*/
|
|
50
|
+
export declare function tagVersionAssert(project: Project): GateStep | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* The release assets, into `dist/release/`: the same list locally (`toolfactory package`) and in
|
|
53
|
+
* the release workflow's `package` job, which uploads the directory as one artifact. Publishing
|
|
54
|
+
* to a registry stays a CI concern; producing the artifacts never is.
|
|
55
|
+
*/
|
|
56
|
+
export declare function packageSteps(project: Project): GateStep[];
|
|
57
|
+
/** npm's filename for the root package, including its flattened scope. */
|
|
58
|
+
export declare function npmTarball(project: Project): string;
|
|
59
|
+
/** The ClawHub tarball `npm pack ./hosts/openclaw` writes, by name, inside the release artifact. */
|
|
60
|
+
export declare function openclawTarball(project: Project): string;
|
|
61
|
+
/**
|
|
62
|
+
* One row per (surface, registry): what publishing needs, what proves it, how to retract.
|
|
63
|
+
* DESIGN.md §1 (research3). `secrets status`/`check`, the release legs' presence gating and the
|
|
64
|
+
* unpublish step all read this table and nothing else.
|
|
65
|
+
*/
|
|
66
|
+
export interface Registry {
|
|
67
|
+
/** Stable id: the release job suffix, the `secrets status` row, the unpublish step name. */
|
|
68
|
+
id: "npm" | "pypi" | "mcp-registry" | "oci" | "clawhub-package" | "clawhub-skill" | "pages" | "chrome" | "firefox" | "edge" | "safari";
|
|
69
|
+
/** The surfaces whose selection publishes here; all must be selected. */
|
|
70
|
+
surfaces: SurfaceId[];
|
|
71
|
+
/** Environment names the publish leg consumes (repository scope); [] for OIDC/GITHUB_TOKEN legs. */
|
|
72
|
+
secrets: string[];
|
|
73
|
+
/** Environment names retraction consumes when they differ from `secrets`. */
|
|
74
|
+
retractSecrets?: string[];
|
|
75
|
+
/** Where a human mints the credential or does the one-time web step. */
|
|
76
|
+
url: string;
|
|
77
|
+
/** Where a human retracts by hand, when that differs from `url`; the notices point at it. */
|
|
78
|
+
retractUrl?: string;
|
|
79
|
+
/** Shell: exit 0 iff the credential in the environment is accepted (`secrets check`). Absent = no probe exists. */
|
|
80
|
+
probe?: string;
|
|
81
|
+
/** Shell: exit 0 iff the current version is published (anonymous; idempotency for publish and unpublish). */
|
|
82
|
+
exists?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Shell: exit 0 iff this leg can publish at this tag — the release `gate` job's
|
|
85
|
+
* `outputs.<id>`, which every leg's job-level `if` reads. Absent = the leg is never gated.
|
|
86
|
+
*/
|
|
87
|
+
gate?: string;
|
|
88
|
+
/** Shell: the retraction, one upstream CLI; absent = manual. */
|
|
89
|
+
retract?: string;
|
|
90
|
+
/** With `--hard`: the destructive form. */
|
|
91
|
+
retractHard?: string;
|
|
92
|
+
/** A one-time human step with no API, gated by a repository variable the human sets when done. */
|
|
93
|
+
confirmVariable?: string;
|
|
94
|
+
}
|
|
95
|
+
/** ClawHub's CLI, pinned: no runner carries `clawhub` on PATH and every ClawHub row shells to it. */
|
|
96
|
+
export declare const CLAWHUB_PIN = "0.23.3";
|
|
97
|
+
/** The `mcp-publisher` binary: the publish leg and the MCP Registry retraction fetch the same one. */
|
|
98
|
+
export declare const MCP_PUBLISHER_FETCH = "curl -sL \"https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_linux_amd64.tar.gz\" | tar xz mcp-publisher";
|
|
99
|
+
/**
|
|
100
|
+
* Every name any row can consume, selected or not: the release's retraction step runs against
|
|
101
|
+
* the previous tag's selection, so its environment carries them all (an unset one is empty).
|
|
102
|
+
*/
|
|
103
|
+
export declare const RELEASE_SECRET_NAMES: string[];
|
|
104
|
+
/**
|
|
105
|
+
* Every registry row whose surfaces are all selected, with the exact upstream command for each
|
|
106
|
+
* column. Four consumers read this and nothing else: `secrets status`, `secrets check`, the
|
|
107
|
+
* release legs' presence gating, and the unpublish step.
|
|
108
|
+
*/
|
|
109
|
+
export declare function registries(project: Project): Registry[];
|
|
110
|
+
/** The shell variable the release gate holds a row's presence in; the job output takes the same name. */
|
|
111
|
+
export declare function gateVariable(row: Registry): string;
|
|
112
|
+
/** Every environment name a secret can be set under: sensitive config keys, then the release registries' tokens. */
|
|
113
|
+
export declare function secretsOf(project: Project): string[];
|
|
114
|
+
/**
|
|
115
|
+
* The one-time human steps the table cannot automate — no API at all, or one no token in CI can
|
|
116
|
+
* reach. `secrets status` and `bootstrap-repo` print the same list.
|
|
117
|
+
*/
|
|
118
|
+
export declare function manualSteps(project: Project): string[];
|
|
119
|
+
/**
|
|
120
|
+
* The retraction of every registry a dropped surface used to publish to, one step per row:
|
|
121
|
+
* `exists` → the secret guard → `retract`, so re-running the same tag is a no-op and a registry
|
|
122
|
+
* with no machine retraction prints the exact page instead of failing the release.
|
|
123
|
+
*
|
|
124
|
+
* `previous` is the project as the previous tag left it — its surfaces and its version — so the
|
|
125
|
+
* existence probes ask about what that tag actually published, not about the tag being cut now.
|
|
126
|
+
*/
|
|
127
|
+
export declare function unpublishSteps(previous: Project, dropped: readonly SurfaceId[], hard?: boolean): GateStep[];
|
|
128
|
+
/** The one line CI runs, exactly as `toolfactory validate` is one gate step: the whole diff-and-retract. */
|
|
129
|
+
export declare function unpublishStep(project: Project): GateStep;
|