@coryrylan/cradle 0.0.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,19 @@
1
+ export type WhichFn = (bin: string) => string | null;
2
+ /**
3
+ * mise installs cradle's managed tools (nono, pi, …) as shims under
4
+ * `~/.local/share/mise/shims`. Under the default `mise activate` (hook-env)
5
+ * setup that directory isn't on PATH, and a freshly installed tool isn't on the
6
+ * running process's PATH until the next prompt — so right after a `mise install`
7
+ * a plain PATH lookup misses it. Resolve the shim directly so `run`/`doctor`
8
+ * see tools mise just installed. Returns the shim path or `null` when absent.
9
+ */
10
+ export declare function miseShimPath(bin: string, home?: string): string | null;
11
+ /** A `WhichFn` backed by a static table — the shared PATH-lookup double for in-process tests. */
12
+ export declare function createWhichStub(table: Record<string, string>): WhichFn;
13
+ /** Resolve an executable on PATH (or in mise's shims), returning its path or `null` when absent. */
14
+ export declare function lookupBin(bin: string, which?: WhichFn): string | null;
15
+ /**
16
+ * Resolve an executable on PATH or throw a friendly error pointing the user at
17
+ * `cradle doctor`. Returns the resolved path on success.
18
+ */
19
+ export declare function requireBin(bin: string, which?: WhichFn): string;
package/package.json ADDED
@@ -0,0 +1,233 @@
1
+ {
2
+ "name": "@coryrylan/cradle",
3
+ "version": "0.0.0",
4
+ "description": "A runtime for portable agents defined as folders — launches the pi coding agent configured from an agent folder, sandboxed with nono",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ }
14
+ },
15
+ "bin": {
16
+ "cradle": "dist/index.js"
17
+ },
18
+ "files": [
19
+ "README.md",
20
+ "CHANGELOG.md",
21
+ "LICENSE",
22
+ "package.json",
23
+ "dist/index.js",
24
+ "dist/**/*.d.ts",
25
+ "!dist/**/*.test.d.ts"
26
+ ],
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/coryrylan/cradle.git",
30
+ "directory": "projects/cli"
31
+ },
32
+ "keywords": [
33
+ "pi",
34
+ "agents",
35
+ "agent-folders",
36
+ "sandbox",
37
+ "nono",
38
+ "cli",
39
+ "bun"
40
+ ],
41
+ "author": "Cory Rylan (https://coryrylan.com)",
42
+ "license": "MIT",
43
+ "bugs": {
44
+ "url": "https://github.com/coryrylan/cradle/issues"
45
+ },
46
+ "homepage": "https://github.com/coryrylan/cradle/tree/main/projects/cli#readme",
47
+ "engines": {
48
+ "bun": ">=1.3.0"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "scripts": {
54
+ "start": "wireit",
55
+ "ci": "wireit",
56
+ "ci:nocache": "bun run clean && bun run ci",
57
+ "clean": "rm -rf dist",
58
+ "test": "wireit",
59
+ "test:coverage": "wireit",
60
+ "lint": "wireit",
61
+ "build": "wireit",
62
+ "install:local": "wireit",
63
+ "uninstall:local": "wireit",
64
+ "release": "wireit"
65
+ },
66
+ "wireit": {
67
+ "start": {
68
+ "command": "bun src/index.ts",
69
+ "cache": false
70
+ },
71
+ "ci": {
72
+ "dependencies": [
73
+ "lint",
74
+ "build",
75
+ "test:coverage"
76
+ ]
77
+ },
78
+ "test": {
79
+ "command": "bun test",
80
+ "files": [
81
+ "src/**/*.ts",
82
+ "src/**/*.json",
83
+ "src/**/*.txt",
84
+ "tsconfig.json",
85
+ "bunfig.toml"
86
+ ],
87
+ "output": []
88
+ },
89
+ "test:coverage": {
90
+ "command": "bun test --coverage",
91
+ "files": [
92
+ "src/**/*.ts",
93
+ "src/**/*.json",
94
+ "src/**/*.txt",
95
+ "tsconfig.json",
96
+ "bunfig.toml"
97
+ ],
98
+ "output": []
99
+ },
100
+ "lint": {
101
+ "command": "eslint .",
102
+ "files": [
103
+ "src/**/*.ts",
104
+ "eslint.config.js",
105
+ "package.json"
106
+ ],
107
+ "output": []
108
+ },
109
+ "build": {
110
+ "dependencies": [
111
+ "build:js",
112
+ "build:tsc",
113
+ "build:darwin-arm64",
114
+ "build:darwin-x64",
115
+ "build:linux-x64",
116
+ "build:linux-arm64",
117
+ "build:windows-x64"
118
+ ]
119
+ },
120
+ "build:js": {
121
+ "command": "bun build ./src/index.ts --outdir=./dist --target=bun --format=esm --minify",
122
+ "files": [
123
+ "src/**/*.ts",
124
+ "src/**/*.json",
125
+ "src/**/*.txt",
126
+ "tsconfig.json"
127
+ ],
128
+ "output": [
129
+ "dist/index.js"
130
+ ]
131
+ },
132
+ "build:tsc": {
133
+ "command": "tsc --emitDeclarationOnly --project tsconfig.types.json",
134
+ "files": [
135
+ "src/**/*.ts",
136
+ "src/**/*.json",
137
+ "tsconfig.json",
138
+ "tsconfig.types.json"
139
+ ],
140
+ "output": [
141
+ "dist/**/*.d.ts"
142
+ ]
143
+ },
144
+ "build:darwin-arm64": {
145
+ "command": "bun build --compile --minify src/index.ts --target=bun-darwin-arm64 --outfile dist/cradle-macos-arm64",
146
+ "files": [
147
+ "src/**/*.ts",
148
+ "src/**/*.json",
149
+ "src/**/*.txt",
150
+ "tsconfig.json"
151
+ ],
152
+ "output": [
153
+ "dist/cradle-macos-arm64"
154
+ ]
155
+ },
156
+ "build:darwin-x64": {
157
+ "command": "bun build --compile --minify src/index.ts --target=bun-darwin-x64 --outfile dist/cradle-macos-x64",
158
+ "files": [
159
+ "src/**/*.ts",
160
+ "src/**/*.json",
161
+ "src/**/*.txt",
162
+ "tsconfig.json"
163
+ ],
164
+ "output": [
165
+ "dist/cradle-macos-x64"
166
+ ]
167
+ },
168
+ "build:linux-x64": {
169
+ "command": "bun build --compile --minify src/index.ts --target=bun-linux-x64 --outfile dist/cradle-linux-x64",
170
+ "files": [
171
+ "src/**/*.ts",
172
+ "src/**/*.json",
173
+ "src/**/*.txt",
174
+ "tsconfig.json"
175
+ ],
176
+ "output": [
177
+ "dist/cradle-linux-x64"
178
+ ]
179
+ },
180
+ "build:linux-arm64": {
181
+ "command": "bun build --compile --minify src/index.ts --target=bun-linux-arm64 --outfile dist/cradle-linux-arm64",
182
+ "files": [
183
+ "src/**/*.ts",
184
+ "src/**/*.json",
185
+ "src/**/*.txt",
186
+ "tsconfig.json"
187
+ ],
188
+ "output": [
189
+ "dist/cradle-linux-arm64"
190
+ ]
191
+ },
192
+ "build:windows-x64": {
193
+ "command": "bun build --compile --minify src/index.ts --target=bun-windows-x64 --outfile dist/cradle-windows-x64.exe",
194
+ "files": [
195
+ "src/**/*.ts",
196
+ "src/**/*.json",
197
+ "src/**/*.txt",
198
+ "tsconfig.json"
199
+ ],
200
+ "output": [
201
+ "dist/cradle-windows-x64.exe"
202
+ ]
203
+ },
204
+ "install:local": {
205
+ "dependencies": [
206
+ "build"
207
+ ],
208
+ "command": "bash install.sh",
209
+ "cache": false
210
+ },
211
+ "uninstall:local": {
212
+ "command": "rm -f \"$HOME/.local/bin/cradle\"",
213
+ "cache": false
214
+ },
215
+ "release": {
216
+ "command": "HUSKY=0 bun x semantic-release",
217
+ "dependencies": [
218
+ "ci"
219
+ ]
220
+ }
221
+ },
222
+ "dependencies": {
223
+ "yargs": "18.0.0"
224
+ },
225
+ "devDependencies": {
226
+ "@eslint/js": "catalog:",
227
+ "@types/bun": "catalog:",
228
+ "@types/yargs": "17.0.35",
229
+ "eslint": "catalog:",
230
+ "typescript": "catalog:",
231
+ "typescript-eslint": "catalog:"
232
+ }
233
+ }