@fungi.computer/puffball 0.1.0 → 0.3.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/dist/app-api.js +9 -9
- package/dist/app-backend-binding-vocabulary.d.ts +33 -5
- package/dist/app-backend-binding-vocabulary.js +33 -5
- package/dist/app-backend-bindings.d.ts +1 -1
- package/dist/app-declaration.d.ts +1 -1
- package/dist/app-vocabulary.d.ts +27 -6
- package/dist/app-vocabulary.js +1 -0
- package/dist/cloudflare.d.ts +61 -0
- package/dist/cloudflare.js +88 -0
- package/dist/internal/app-release-schema.d.ts +6 -5
- package/dist/internal/public-website-authority.d.ts +3 -4
- package/docs/api/app-backend-binding-vocabulary.md +224 -188
- package/docs/api/app-backend-bindings.md +5 -5
- package/docs/api/app-event-facts.md +1 -1
- package/docs/api/app-method-runtime.md +8 -6
- package/docs/api/background-replay.md +51 -45
- package/docs/api/cloudflare.md +122 -0
- package/docs/api/git-representation.md +1 -1
- package/docs/api/inbox.md +1 -1
- package/docs/api/index.md +49 -4
- package/package.json +4 -4
|
@@ -102,11 +102,11 @@ ceiling.
|
|
|
102
102
|
|
|
103
103
|
#### Parameters
|
|
104
104
|
|
|
105
|
-
| Parameter | Type
|
|
106
|
-
| ----------- |
|
|
107
|
-
| `operation` | [`AppBackendBindingOperation`](app-backend-binding-vocabulary.md#appbackendbindingoperation)
|
|
108
|
-
| `method` | \| `Pick`\<`Readonly`\<\{ `description`: `string`; `input`: `
|
|
109
|
-
| `ceiling` | `"write"` \| `"read"`
|
|
105
|
+
| Parameter | Type |
|
|
106
|
+
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
107
|
+
| `operation` | [`AppBackendBindingOperation`](app-backend-binding-vocabulary.md#appbackendbindingoperation) |
|
|
108
|
+
| `method` | \| `Pick`\<`Readonly`\<\{ `description`: `string`; `input`: \{ \[`key`: `string`\]: \| `null` \| `string` \| `number` \| `false` \| `true` \| \{ \[`index`: `number`\]: AppApiJsonValue; `length`: `number`; \} \| AppApiJsonObject; \}; `output`: \{ \[`key`: `string`\]: \| `null` \| `string` \| `number` \| `false` \| `true` \| \{ \[`index`: `number`\]: AppApiJsonValue; `length`: `number`; \} \| AppApiJsonObject; \}; `effect`: `"write"` \| `"external"` \| `"read"`; `requires`: readonly ( \| `"approvals"` \| `"agent.list"` \| `"agent.manage"` \| `"agent.rename"` \| `"agent.avatar"` \| `"agent.toolPolicy"` \| `"agent.read"` \| `"agent.send"` \| `"computer.list"` \| `"computer.readFile"` \| `"computer.writeFile"` \| `"computer.execute"` \| `"llm.generation"` \| `"media.generation"` \| `"games:servers"` \| `"git.repository"` \| `"apps.open"` \| `"apps.call"` \| `"app.storage"` \| `"app.events.emit"` \| `"team.workbenchHost"` \| `"marketplace.browse"` \| `"marketplace.purchase"` \| `"workflow.run"` \| `"workflow.publish"` \| `"workflow.arm"` \| `"world"` \| `"channels.read"` \| `"channels.personal.manage"`)[]; `pending?`: `true`; `hidden?`: `true`; `present?`: `Readonly`\<\{ `verb`: `string`; \}\>; \}\>, `"requires"` \| `"effect"`\> \| `undefined` |
|
|
109
|
+
| `ceiling` | `"write"` \| `"read"` |
|
|
110
110
|
|
|
111
111
|
#### Returns
|
|
112
112
|
|
|
@@ -192,12 +192,14 @@ const appMethodCallerSchema: ZodMiniObject<
|
|
|
192
192
|
>;
|
|
193
193
|
backgroundLane: ZodMiniOptional<ZodMiniString<string>>;
|
|
194
194
|
backgroundOrigin: ZodMiniOptional<
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
195
|
+
ZodMiniLazy<
|
|
196
|
+
ZodMiniObject<
|
|
197
|
+
{
|
|
198
|
+
method: ZodMiniString<string>;
|
|
199
|
+
seal: ZodMiniString<string>;
|
|
200
|
+
},
|
|
201
|
+
$strict
|
|
202
|
+
>
|
|
201
203
|
>
|
|
202
204
|
>;
|
|
203
205
|
role: ZodMiniOptional<
|
|
@@ -150,12 +150,14 @@ A refused wake settles its lane; retry uses the existing Carrier backoff.
|
|
|
150
150
|
### backgroundOriginSchema
|
|
151
151
|
|
|
152
152
|
```ts
|
|
153
|
-
const backgroundOriginSchema:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
153
|
+
const backgroundOriginSchema: ZodMiniLazy<
|
|
154
|
+
ZodMiniObject<
|
|
155
|
+
{
|
|
156
|
+
method: ZodMiniString<string>;
|
|
157
|
+
seal: ZodMiniString<string>;
|
|
158
|
+
},
|
|
159
|
+
$strict
|
|
160
|
+
>
|
|
159
161
|
> = appMethodCallerSchema.shape.backgroundOrigin.def.innerType;
|
|
160
162
|
```
|
|
161
163
|
|
|
@@ -166,22 +168,24 @@ The caller's single lightweight grammar for a host-sealed enqueue origin.
|
|
|
166
168
|
### claimedJobAdmissionSchema
|
|
167
169
|
|
|
168
170
|
```ts
|
|
169
|
-
const claimedJobAdmissionSchema:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
171
|
+
const claimedJobAdmissionSchema: ZodLazy<
|
|
172
|
+
ZodUnion<
|
|
173
|
+
readonly [
|
|
174
|
+
ZodObject<
|
|
175
|
+
{
|
|
176
|
+
kind: ZodLiteral<"admitted">;
|
|
177
|
+
},
|
|
178
|
+
$strict
|
|
179
|
+
>,
|
|
180
|
+
ZodObject<
|
|
181
|
+
{
|
|
182
|
+
kind: ZodLiteral<"refused">;
|
|
183
|
+
code: ZodLiteral<"access_changed">;
|
|
184
|
+
},
|
|
185
|
+
$strict
|
|
186
|
+
>,
|
|
187
|
+
]
|
|
188
|
+
>
|
|
185
189
|
>;
|
|
186
190
|
```
|
|
187
191
|
|
|
@@ -192,29 +196,31 @@ The closed result of checking a claimed job's origin in a fresh replay frame.
|
|
|
192
196
|
### backgroundWakeSchema
|
|
193
197
|
|
|
194
198
|
```ts
|
|
195
|
-
const backgroundWakeSchema:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
199
|
+
const backgroundWakeSchema: ZodLazy<
|
|
200
|
+
ZodObject<
|
|
201
|
+
{
|
|
202
|
+
installationId: ZodString;
|
|
203
|
+
actor: ZodObject<
|
|
204
|
+
{
|
|
205
|
+
kind: ZodMiniLiteral<"member">;
|
|
206
|
+
memberId: ZodMiniString<string>;
|
|
207
|
+
},
|
|
208
|
+
$strict
|
|
209
|
+
>;
|
|
210
|
+
lane: ZodString;
|
|
211
|
+
originMethod: ZodString;
|
|
212
|
+
observed: ZodObject<
|
|
213
|
+
{
|
|
214
|
+
authorityVersion: ZodLazy<ZodNumber>;
|
|
215
|
+
artifactDigest: ZodCustom<Sha256Digest, Sha256Digest>;
|
|
216
|
+
membershipVersion: ZodOptional<ZodLazy<ZodNumber>>;
|
|
217
|
+
},
|
|
218
|
+
$strict
|
|
219
|
+
>;
|
|
220
|
+
epoch: ZodLazy<ZodNumber>;
|
|
221
|
+
},
|
|
222
|
+
$strict
|
|
223
|
+
>
|
|
218
224
|
>;
|
|
219
225
|
```
|
|
220
226
|
|
package/docs/api/cloudflare.md
CHANGED
|
@@ -765,6 +765,78 @@ R2 operations used by the scoped Team erasure owner.
|
|
|
765
765
|
|
|
766
766
|
---
|
|
767
767
|
|
|
768
|
+
### ReleaseBootResultKey
|
|
769
|
+
|
|
770
|
+
```ts
|
|
771
|
+
type ReleaseBootResultKey = Readonly<{
|
|
772
|
+
releaseId: string;
|
|
773
|
+
checkVersion: string;
|
|
774
|
+
}>;
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
One boot result's identity: the Release and the version of the check that judged
|
|
778
|
+
it.
|
|
779
|
+
|
|
780
|
+
---
|
|
781
|
+
|
|
782
|
+
### ReleaseBootResultRecord
|
|
783
|
+
|
|
784
|
+
```ts
|
|
785
|
+
type ReleaseBootResultRecord = Readonly<{
|
|
786
|
+
kind: "recorded";
|
|
787
|
+
result: Schema.Json;
|
|
788
|
+
checkedAt: number;
|
|
789
|
+
}>;
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
A recorded boot result, opaque JSON owned by the boot gate that wrote it.
|
|
793
|
+
|
|
794
|
+
---
|
|
795
|
+
|
|
796
|
+
### ReleaseBootResults
|
|
797
|
+
|
|
798
|
+
```ts
|
|
799
|
+
type ReleaseBootResults = Readonly<{
|
|
800
|
+
read: (key) => Promise<
|
|
801
|
+
| Readonly<{
|
|
802
|
+
kind: "absent";
|
|
803
|
+
}>
|
|
804
|
+
| ReleaseBootResultRecord
|
|
805
|
+
>;
|
|
806
|
+
recordIfAbsent: (input) => Promise<ReleaseBootResultRecord>;
|
|
807
|
+
}>;
|
|
808
|
+
```
|
|
809
|
+
|
|
810
|
+
One boot result per Release and check version, beside the Release in the global
|
|
811
|
+
catalog. Whoever checks first (the publisher at submission or a Team's first
|
|
812
|
+
install) records it; everyone reads it; nobody rechecks. The catalog owns
|
|
813
|
+
identity and write-once storage; the boot gate owns the result's meaning and
|
|
814
|
+
parses it on read.
|
|
815
|
+
|
|
816
|
+
Writers are host-run checkers only, recording only definitive outcomes (never an
|
|
817
|
+
inconclusive or "not checked" run) with sanitized diagnostics; the result covers
|
|
818
|
+
the UI page check alone, not backend construction.
|
|
819
|
+
|
|
820
|
+
---
|
|
821
|
+
|
|
822
|
+
### BootCapabilityRows
|
|
823
|
+
|
|
824
|
+
```ts
|
|
825
|
+
type BootCapabilityRows = Readonly<{
|
|
826
|
+
issue: (input) => Promise<void>;
|
|
827
|
+
resolve: (tokenDigest, now) => Promise<string | null>;
|
|
828
|
+
revoke: (leaseId) => Promise<void>;
|
|
829
|
+
}>;
|
|
830
|
+
```
|
|
831
|
+
|
|
832
|
+
The catalog storage behind a host's boot `BootCapabilityStore`: one short-lived
|
|
833
|
+
row per issued lease, keyed by the token's digest (never the token). The lease
|
|
834
|
+
itself is opaque JSON owned by the boot capability contract, which parses it on
|
|
835
|
+
resolve. Expired rows are deleted on resolve and purged on every issue; revoke
|
|
836
|
+
deletes.
|
|
837
|
+
|
|
838
|
+
---
|
|
839
|
+
|
|
768
840
|
### ArtifactSnapshotPolicy
|
|
769
841
|
|
|
770
842
|
```ts
|
|
@@ -821,6 +893,16 @@ const APP_RELEASE_D1_FRESH_SCHEMA: string;
|
|
|
821
893
|
|
|
822
894
|
The one current App Release D1 schema for an empty catalog.
|
|
823
895
|
|
|
896
|
+
---
|
|
897
|
+
|
|
898
|
+
### BOOT\_CAPABILITY\_MAX\_LIFETIME\_MS
|
|
899
|
+
|
|
900
|
+
```ts
|
|
901
|
+
const BOOT_CAPABILITY_MAX_LIFETIME_MS: 60000 = 60_000;
|
|
902
|
+
```
|
|
903
|
+
|
|
904
|
+
The longest a boot capability lease may live: one boot check plus cleanup.
|
|
905
|
+
|
|
824
906
|
## Functions
|
|
825
907
|
|
|
826
908
|
### createTeamAppReleaseErasure()
|
|
@@ -880,6 +962,46 @@ Create the native registry that joins a Team publisher to one App/source.
|
|
|
880
962
|
|
|
881
963
|
---
|
|
882
964
|
|
|
965
|
+
### createD1ReleaseBootResults()
|
|
966
|
+
|
|
967
|
+
```ts
|
|
968
|
+
function createD1ReleaseBootResults(database): ReleaseBootResults;
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
The catalog's write-once boot results, over the same App Release D1.
|
|
972
|
+
|
|
973
|
+
#### Parameters
|
|
974
|
+
|
|
975
|
+
| Parameter | Type |
|
|
976
|
+
| ---------- | ----------------------------------------------- |
|
|
977
|
+
| `database` | [`AppReleaseD1Database`](#appreleased1database) |
|
|
978
|
+
|
|
979
|
+
#### Returns
|
|
980
|
+
|
|
981
|
+
[`ReleaseBootResults`](#releasebootresults)
|
|
982
|
+
|
|
983
|
+
---
|
|
984
|
+
|
|
985
|
+
### createD1BootCapabilityRows()
|
|
986
|
+
|
|
987
|
+
```ts
|
|
988
|
+
function createD1BootCapabilityRows(database): BootCapabilityRows;
|
|
989
|
+
```
|
|
990
|
+
|
|
991
|
+
The catalog's short-lived boot capability rows, over the same App Release D1.
|
|
992
|
+
|
|
993
|
+
#### Parameters
|
|
994
|
+
|
|
995
|
+
| Parameter | Type |
|
|
996
|
+
| ---------- | ----------------------------------------------- |
|
|
997
|
+
| `database` | [`AppReleaseD1Database`](#appreleased1database) |
|
|
998
|
+
|
|
999
|
+
#### Returns
|
|
1000
|
+
|
|
1001
|
+
[`BootCapabilityRows`](#bootcapabilityrows)
|
|
1002
|
+
|
|
1003
|
+
---
|
|
1004
|
+
|
|
883
1005
|
### createD1AppReleaseStore()
|
|
884
1006
|
|
|
885
1007
|
```ts
|
|
@@ -50,7 +50,7 @@ One ref update, bounded before a host asks the App or forwards the push.
|
|
|
50
50
|
### gitPushEventIdSchema
|
|
51
51
|
|
|
52
52
|
```ts
|
|
53
|
-
const gitPushEventIdSchema: ZodString
|
|
53
|
+
const gitPushEventIdSchema: ZodLazy<ZodString>;
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
Host push event IDs include the Computer and local event identity.
|
package/docs/api/inbox.md
CHANGED
|
@@ -282,7 +282,7 @@ Stable placement across review transitions; Map iterations remain distinct.
|
|
|
282
282
|
|
|
283
283
|
| Parameter | Type |
|
|
284
284
|
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
285
|
-
| `item` | \| \{ `agentId`: `string`; `sessionId`: `string`; `title`: `string`; `triggerId?`: `string`; `createdAt`: `number`; `lastActivityAt`: `number`; `settledAt?`: `number`; `visitedAt?`: `number`; `state`: `"running"` \| `"done"` \| `"
|
|
285
|
+
| `item` | \| \{ `agentId`: `string`; `sessionId`: `string`; `title`: `string`; `triggerId?`: `string`; `createdAt`: `number`; `lastActivityAt`: `number`; `settledAt?`: `number`; `visitedAt?`: `number`; `state`: `"running"` \| `"done"` \| `"needs_you"` \| `"errored"`; \} \| \{ `agentId`: `string`; `sessionId`: `string`; `state`: `"unavailable"`; \} \| \{ `kind`: `"workflow-review"`; `key`: \{ `runId`: `string`; `nodeId`: `string`; `iteration`: `string`; \}; `installationId`: `string`; `workflowId`: `string` \| `null`; `workflowTitle`: `string`; `reviewTitle`: `string`; `reviewers`: `"owners"` \| `"runner"`; `show`: readonly `Json`[]; `choices?`: readonly `string`[]; `openedAt`: `number`; `expiresAt`: `number`; `state`: `"closed"` \| `"pending"` \| `"answered"` \| `"delivered"` \| `"timed_out"`; \} \| \{ `agentId`: `string`; `sessionId`: `string`; `deleted`: `true`; \} |
|
|
286
286
|
|
|
287
287
|
#### Returns
|
|
288
288
|
|
package/docs/api/index.md
CHANGED
|
@@ -739,13 +739,43 @@ type AppApi = Readonly<{
|
|
|
739
739
|
string,
|
|
740
740
|
Readonly<{
|
|
741
741
|
description: string;
|
|
742
|
-
input:
|
|
743
|
-
|
|
742
|
+
input: {
|
|
743
|
+
[key: string]:
|
|
744
|
+
| null
|
|
745
|
+
| string
|
|
746
|
+
| number
|
|
747
|
+
| false
|
|
748
|
+
| true
|
|
749
|
+
| {
|
|
750
|
+
[index: number]: AppApiJsonValue;
|
|
751
|
+
length: number;
|
|
752
|
+
}
|
|
753
|
+
| {
|
|
754
|
+
[key: string]: AppApiJsonValue;
|
|
755
|
+
};
|
|
756
|
+
};
|
|
757
|
+
output: {
|
|
758
|
+
[key: string]:
|
|
759
|
+
| null
|
|
760
|
+
| string
|
|
761
|
+
| number
|
|
762
|
+
| false
|
|
763
|
+
| true
|
|
764
|
+
| {
|
|
765
|
+
[index: number]: AppApiJsonValue;
|
|
766
|
+
length: number;
|
|
767
|
+
}
|
|
768
|
+
| {
|
|
769
|
+
[key: string]: AppApiJsonValue;
|
|
770
|
+
};
|
|
771
|
+
};
|
|
744
772
|
effect: "read" | "write" | "external";
|
|
745
773
|
requires: readonly AppCapabilityId[];
|
|
746
774
|
pending?: true;
|
|
747
775
|
hidden?: true;
|
|
748
|
-
|
|
776
|
+
present?: Readonly<{
|
|
777
|
+
verb: string;
|
|
778
|
+
}>;
|
|
749
779
|
}>
|
|
750
780
|
>
|
|
751
781
|
>;
|
|
@@ -759,7 +789,21 @@ type AppApi = Readonly<{
|
|
|
759
789
|
string,
|
|
760
790
|
Readonly<{
|
|
761
791
|
description: string;
|
|
762
|
-
payload:
|
|
792
|
+
payload: {
|
|
793
|
+
[key: string]:
|
|
794
|
+
| null
|
|
795
|
+
| string
|
|
796
|
+
| number
|
|
797
|
+
| false
|
|
798
|
+
| true
|
|
799
|
+
| {
|
|
800
|
+
[index: number]: AppApiJsonValue;
|
|
801
|
+
length: number;
|
|
802
|
+
}
|
|
803
|
+
| {
|
|
804
|
+
[key: string]: AppApiJsonValue;
|
|
805
|
+
};
|
|
806
|
+
};
|
|
763
807
|
}>
|
|
764
808
|
>
|
|
765
809
|
>;
|
|
@@ -2560,6 +2604,7 @@ format lives in `@fungi.computer/agar/roles`.
|
|
|
2560
2604
|
|
|
2561
2605
|
```ts
|
|
2562
2606
|
const appCapabilityIds: readonly [
|
|
2607
|
+
"approvals",
|
|
2563
2608
|
"agent.list",
|
|
2564
2609
|
"agent.manage",
|
|
2565
2610
|
"agent.rename",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/puffball",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"description": "Immutable App/Release catalog with verified public website delivery",
|
|
6
6
|
"type": "module",
|
|
@@ -107,12 +107,12 @@
|
|
|
107
107
|
"LICENSE"
|
|
108
108
|
],
|
|
109
109
|
"dependencies": {
|
|
110
|
-
"@fungi.computer/cairn": "0.0
|
|
110
|
+
"@fungi.computer/cairn": "0.1.0",
|
|
111
111
|
"effect": "4.0.2",
|
|
112
112
|
"@fungi.computer/cloudflare-worker-bundler": "0.2.3-fungi.0",
|
|
113
113
|
"zod": "4.4.3",
|
|
114
|
-
"@fungi.computer/watchdog": "0.0
|
|
115
|
-
"@fungi.computer/gills": "0.
|
|
114
|
+
"@fungi.computer/watchdog": "0.1.0",
|
|
115
|
+
"@fungi.computer/gills": "0.2.0"
|
|
116
116
|
},
|
|
117
117
|
"devDependencies": {
|
|
118
118
|
"@cloudflare/vitest-plugin": "1.1.2",
|