@fungi.computer/burrow 0.0.0-stage → 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.
@@ -0,0 +1,207 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/burrow**](README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/burrow](README.md) / index
8
+
9
+ # index
10
+
11
+ ## Classes
12
+
13
+ ### ArtifactsRestError
14
+
15
+ A failed Artifacts REST call, with the binding's error `code`.
16
+
17
+ #### Extends
18
+
19
+ - `Error`
20
+
21
+ #### Constructors
22
+
23
+ ##### Constructor
24
+
25
+ ```ts
26
+ new ArtifactsRestError(code, message): ArtifactsRestError;
27
+ ```
28
+
29
+ ###### Parameters
30
+
31
+ | Parameter | Type |
32
+ | --------- | -------- |
33
+ | `code` | `string` |
34
+ | `message` | `string` |
35
+
36
+ ###### Returns
37
+
38
+ [`ArtifactsRestError`](#artifactsresterror)
39
+
40
+ ###### Overrides
41
+
42
+ ```ts
43
+ Error.constructor;
44
+ ```
45
+
46
+ #### Properties
47
+
48
+ ##### code
49
+
50
+ ```ts
51
+ readonly code: string;
52
+ ```
53
+
54
+ ## Type Aliases
55
+
56
+ ### ArtifactsRepository
57
+
58
+ ```ts
59
+ type ArtifactsRepository = Readonly<{
60
+ id: string;
61
+ name: string;
62
+ defaultBranch: string;
63
+ }>;
64
+ ```
65
+
66
+ Stable repository identity exposed to callers; no credentials or remote URL.
67
+
68
+ ---
69
+
70
+ ### GitExchange
71
+
72
+ ```ts
73
+ type GitExchange = Readonly<{
74
+ protocol?: string;
75
+ signal?: AbortSignal;
76
+ }> &
77
+ | Readonly<{
78
+ repository: string;
79
+ operation: "upload-pack-advertisement" | "receive-pack-advertisement";
80
+ }>
81
+ | Readonly<{
82
+ repository: string;
83
+ operation: "upload-pack" | "receive-pack";
84
+ body: ReadableStream<Uint8Array>;
85
+ }>;
86
+ ```
87
+
88
+ One admitted Git smart-HTTP advertisement or byte-stream exchange.
89
+
90
+ ---
91
+
92
+ ### Artifacts
93
+
94
+ ```ts
95
+ type Artifacts = Readonly<{
96
+ ensureRepository: Promise<
97
+ Readonly<{
98
+ id: string;
99
+ name: string;
100
+ defaultBranch: string;
101
+ }>
102
+ >;
103
+ forkRepository: Promise<
104
+ Readonly<{
105
+ repository: ArtifactsRepository;
106
+ mainHead: string;
107
+ disposition: "created" | "existing";
108
+ }>
109
+ >;
110
+ recoverForkRepository: Promise<Readonly<{
111
+ repository: ArtifactsRepository;
112
+ mainHead: string;
113
+ disposition: "created" | "existing";
114
+ }> | null>;
115
+ resolveRepository: Promise<
116
+ Readonly<{
117
+ id: string;
118
+ name: string;
119
+ defaultBranch: string;
120
+ }>
121
+ >;
122
+ readDefaultBranchHead: Promise<string | null>;
123
+ readBranchHeads: Promise<readonly string[]>;
124
+ readRefs: Promise<
125
+ readonly Readonly<{
126
+ name: string;
127
+ hash: string;
128
+ }>[]
129
+ >;
130
+ exchangeGit: Promise<Response>;
131
+ }>;
132
+ ```
133
+
134
+ Configured repository owner; authorization belongs to its calling host.
135
+
136
+ ---
137
+
138
+ ### ArtifactsRestOptions
139
+
140
+ ```ts
141
+ type ArtifactsRestOptions = Readonly<{
142
+ accountId: string;
143
+ namespace: string;
144
+ apiToken: string;
145
+ fetch?: typeof fetch;
146
+ }>;
147
+ ```
148
+
149
+ Where the REST API is and how to reach it.
150
+
151
+ ## Functions
152
+
153
+ ### createArtifactsRestNamespace()
154
+
155
+ ```ts
156
+ function createArtifactsRestNamespace(options): ArtifactsNamespace;
157
+ ```
158
+
159
+ An Artifacts namespace reached over REST, with the binding's shape.
160
+
161
+ #### Parameters
162
+
163
+ | Parameter | Type |
164
+ | --------- | ----------------------------------------------- |
165
+ | `options` | [`ArtifactsRestOptions`](#artifactsrestoptions) |
166
+
167
+ #### Returns
168
+
169
+ [`ArtifactsNamespace`](namespace.md#artifactsnamespace)
170
+
171
+ ## References
172
+
173
+ ### createCloudflareArtifacts
174
+
175
+ Re-exports [createCloudflareArtifacts](cloudflare.md#createcloudflareartifacts)
176
+
177
+ ---
178
+
179
+ ### CloudflareArtifactsNamespace
180
+
181
+ Re-exports
182
+ [CloudflareArtifactsNamespace](cloudflare.md#cloudflareartifactsnamespace)
183
+
184
+ ---
185
+
186
+ ### CloudflareArtifactsOptions
187
+
188
+ Re-exports
189
+ [CloudflareArtifactsOptions](cloudflare.md#cloudflareartifactsoptions)
190
+
191
+ ---
192
+
193
+ ### ArtifactsNamespace
194
+
195
+ Re-exports [ArtifactsNamespace](namespace.md#artifactsnamespace)
196
+
197
+ ---
198
+
199
+ ### ArtifactsCommit
200
+
201
+ Re-exports [ArtifactsCommit](namespace.md#artifactscommit)
202
+
203
+ ---
204
+
205
+ ### ArtifactsRepositoryInfo
206
+
207
+ Re-exports [ArtifactsRepositoryInfo](namespace.md#artifactsrepositoryinfo)
@@ -0,0 +1,234 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/burrow**](README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/burrow](README.md) / namespace
8
+
9
+ # namespace
10
+
11
+ ## Type Aliases
12
+
13
+ ### ArtifactsRepositoryInfo
14
+
15
+ ```ts
16
+ type ArtifactsRepositoryInfo = Readonly<{
17
+ id: string;
18
+ name: string;
19
+ defaultBranch: string;
20
+ remote: string;
21
+ lastPushAt?: string | null;
22
+ source?: string | null;
23
+ }>;
24
+ ```
25
+
26
+ Host-only Artifacts namespace. Repository credentials never enter App results.
27
+
28
+ ---
29
+
30
+ ### ArtifactsCreatedRepository
31
+
32
+ ```ts
33
+ type ArtifactsCreatedRepository = ArtifactsRepositoryInfo &
34
+ Readonly<{
35
+ token: string;
36
+ }>;
37
+ ```
38
+
39
+ Initial revocation reference: a Workers token or an already-revoked REST ID.
40
+
41
+ ---
42
+
43
+ ### ArtifactsCommit
44
+
45
+ ```ts
46
+ type ArtifactsCommit = Readonly<{
47
+ hash: string;
48
+ treeHash: string;
49
+ message: string;
50
+ author: Readonly<{
51
+ name: string;
52
+ email: string;
53
+ }>;
54
+ committer: Readonly<{
55
+ name: string;
56
+ email: string;
57
+ }>;
58
+ parents: readonly string[];
59
+ authoredAt: number;
60
+ committedAt: number;
61
+ }>;
62
+ ```
63
+
64
+ Provider commit metadata and parent object IDs.
65
+
66
+ ---
67
+
68
+ ### ArtifactsTreeEntry
69
+
70
+ ```ts
71
+ type ArtifactsTreeEntry = Readonly<{
72
+ name: string;
73
+ mode: string;
74
+ hash: string;
75
+ type: "blob" | "tree" | "commit";
76
+ }>;
77
+ ```
78
+
79
+ One provider tree entry, including its mode and object kind.
80
+
81
+ ---
82
+
83
+ ### ArtifactsRepositoryHandle
84
+
85
+ ```ts
86
+ type ArtifactsRepositoryHandle = Readonly<{
87
+ info: Promise<
88
+ Readonly<{
89
+ id: string;
90
+ name: string;
91
+ defaultBranch: string;
92
+ remote: string;
93
+ lastPushAt?: string | null;
94
+ source?: string | null;
95
+ }>
96
+ >;
97
+ createToken: Promise<
98
+ Readonly<{
99
+ id: string;
100
+ plaintext: string;
101
+ expiresAt: string;
102
+ }>
103
+ >;
104
+ revokeToken: Promise<boolean>;
105
+ fork: Promise<ArtifactsCreatedRepository>;
106
+ log: Promise<
107
+ readonly Readonly<{
108
+ hash: string;
109
+ treeHash: string;
110
+ message: string;
111
+ author: Readonly<{
112
+ name: string;
113
+ email: string;
114
+ }>;
115
+ committer: Readonly<{
116
+ name: string;
117
+ email: string;
118
+ }>;
119
+ parents: readonly string[];
120
+ authoredAt: number;
121
+ committedAt: number;
122
+ }>[]
123
+ >;
124
+ readCommit: Promise<Readonly<{
125
+ hash: string;
126
+ treeHash: string;
127
+ message: string;
128
+ author: Readonly<{
129
+ name: string;
130
+ email: string;
131
+ }>;
132
+ committer: Readonly<{
133
+ name: string;
134
+ email: string;
135
+ }>;
136
+ parents: readonly string[];
137
+ authoredAt: number;
138
+ committedAt: number;
139
+ }> | null>;
140
+ readTree: Promise<
141
+ | readonly Readonly<{
142
+ name: string;
143
+ mode: string;
144
+ hash: string;
145
+ type: "blob" | "tree" | "commit";
146
+ }>[]
147
+ | null
148
+ >;
149
+ readBlob: Promise<Blob | null>;
150
+ }>;
151
+ ```
152
+
153
+ Host-only repository operations; secrets never belong in App results.
154
+
155
+ ---
156
+
157
+ ### ArtifactsNamespace
158
+
159
+ ```ts
160
+ type ArtifactsNamespace = Readonly<{
161
+ create: Promise<ArtifactsCreatedRepository>;
162
+ get: Promise<Readonly<{
163
+ info: Promise<Readonly<{
164
+ id: string;
165
+ name: string;
166
+ defaultBranch: string;
167
+ remote: string;
168
+ lastPushAt?: string | null;
169
+ source?: string | null;
170
+ }>>;
171
+ createToken: Promise<Readonly<{
172
+ id: string;
173
+ plaintext: string;
174
+ expiresAt: string;
175
+ }>>;
176
+ revokeToken: Promise<boolean>;
177
+ fork: Promise<ArtifactsCreatedRepository>;
178
+ log: Promise<readonly Readonly<{
179
+ hash: string;
180
+ treeHash: string;
181
+ message: string;
182
+ author: Readonly<{
183
+ name: ...;
184
+ email: ...;
185
+ }>;
186
+ committer: Readonly<{
187
+ name: ...;
188
+ email: ...;
189
+ }>;
190
+ parents: readonly ...[];
191
+ authoredAt: number;
192
+ committedAt: number;
193
+ }>[]>;
194
+ readCommit: Promise<
195
+ | Readonly<{
196
+ hash: string;
197
+ treeHash: string;
198
+ message: string;
199
+ author: Readonly<{
200
+ name: ...;
201
+ email: ...;
202
+ }>;
203
+ committer: Readonly<{
204
+ name: ...;
205
+ email: ...;
206
+ }>;
207
+ parents: readonly ...[];
208
+ authoredAt: number;
209
+ committedAt: number;
210
+ }>
211
+ | null>;
212
+ readTree: Promise<
213
+ | readonly Readonly<{
214
+ name: string;
215
+ mode: string;
216
+ hash: string;
217
+ type: ... | ... | ...;
218
+ }>[]
219
+ | null>;
220
+ readBlob: Promise<Blob | null>;
221
+ }>>;
222
+ list: Promise<Readonly<{
223
+ repos: readonly Readonly<{
224
+ name: string;
225
+ status: string;
226
+ }>[];
227
+ total: number;
228
+ cursor?: string;
229
+ }>>;
230
+ delete: Promise<boolean>;
231
+ }>;
232
+ ```
233
+
234
+ Configured provider namespace with repository-name-addressed handles.
package/docs/home.ts ADDED
@@ -0,0 +1,27 @@
1
+ import { createArtifactsRestNamespace } from "@fungi.computer/burrow";
2
+
3
+ // Local provider fixture: this example never contacts Cloudflare.
4
+ const namespace = createArtifactsRestNamespace({
5
+ accountId: "example-account",
6
+ namespace: "default",
7
+ apiToken: "example-only",
8
+ fetch: async () =>
9
+ Response.json({
10
+ success: true,
11
+ errors: [],
12
+ result: [
13
+ {
14
+ id: "repository-notes",
15
+ name: "notes",
16
+ default_branch: "main",
17
+ remote:
18
+ "https://example.artifacts.cloudflare.net/git/default/notes.git",
19
+ status: "ready",
20
+ },
21
+ ],
22
+ result_info: { total_pages: 1, total_count: 1 },
23
+ }),
24
+ });
25
+
26
+ const { repos } = await namespace.list();
27
+ console.log(repos.map((repository) => repository.name)); // ["notes"]
package/package.json CHANGED
@@ -1,6 +1,71 @@
1
1
  {
2
2
  "name": "@fungi.computer/burrow",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.1",
4
+ "author": "Levi <levi@technomancy.dev>",
5
+ "description": "Configured Artifacts repository and Git protocol owner",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "main": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js"
14
+ },
15
+ "./cloudflare": {
16
+ "types": "./dist/cloudflare.d.ts",
17
+ "import": "./dist/cloudflare.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "README.md",
23
+ "LICENSE",
24
+ "docs/api",
25
+ "docs/home.ts"
26
+ ],
27
+ "dependencies": {
28
+ "effect": "4.0.2",
29
+ "isomorphic-git": "1.42.2"
30
+ },
31
+ "devDependencies": {
32
+ "@cloudflare/workers-types": "5.20260828.1",
33
+ "@types/node": "24.13.3",
34
+ "typescript": "5.9.3",
35
+ "vitest": "4.1.11"
36
+ },
37
+ "botanical": {
38
+ "role": "package",
39
+ "operations": {
40
+ "lint": "required",
41
+ "typecheck": "required",
42
+ "build": "required",
43
+ "test": "required",
44
+ "docs": "required",
45
+ "pack": "required",
46
+ "smoke": "required",
47
+ "stranger": "required"
48
+ }
49
+ },
50
+ "license": "MIT",
51
+ "publishConfig": {
52
+ "access": "public"
53
+ },
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "git+https://github.com/fungi-computer/burrow.git"
57
+ },
58
+ "scripts": {
59
+ "build": "tsc -p tsconfig.build.json",
60
+ "typecheck": "tsc -p tsconfig.json --noEmit",
61
+ "lint": "eslint src test --max-warnings=0 && ../../node_modules/.bin/oxlint --config ../../oxlint.config.ts --deny-warnings src test",
62
+ "test": "../../node_modules/.bin/vitest run",
63
+ "pack": "mkdir -p ../../.botanical/burrow-pack && pnpm pack --pack-destination ../../.botanical/burrow-pack",
64
+ "smoke": "node --input-type=module -e \"Promise.all([import('./dist/index.js'), import('./dist/cloudflare.js')]).then(() => {})\"",
65
+ "format:check": "node ../../tooling/repository/scripts/format-package-check.mjs",
66
+ "lint:anti-slop": "node ../../tooling/repository/scripts/lint-package-anti-slop.mjs",
67
+ "stranger": "tsx ../../tooling/repository/src/artifacts/cli.ts --repo-root ../.. .",
68
+ "docs": "tsx ../../tooling/repository/src/docs/cli.ts check --root ../..",
69
+ "docs:write": "tsx ../../tooling/repository/src/docs/cli.ts write --root ../.."
70
+ }
6
71
  }