@fungi.computer/oyster 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.
- package/LICENSE +21 -0
- package/README.md +1082 -2
- package/dist/agents.d.ts +114 -0
- package/dist/agents.js +322 -0
- package/dist/app-builds.d.ts +151 -0
- package/dist/app-builds.js +355 -0
- package/dist/app-sandbox.d.ts +2 -0
- package/dist/app-sandbox.js +2 -0
- package/dist/app-sources.d.ts +46 -0
- package/dist/app-sources.js +335 -0
- package/dist/app-storage.d.ts +141 -0
- package/dist/app-storage.js +281 -0
- package/dist/apps/gate.d.ts +105 -0
- package/dist/apps/gate.js +273 -0
- package/dist/apps/index.d.ts +5 -0
- package/dist/apps/index.js +5 -0
- package/dist/apps/installation.d.ts +248 -0
- package/dist/apps/installation.js +307 -0
- package/dist/apps/operations.d.ts +8 -0
- package/dist/apps/operations.js +98 -0
- package/dist/apps/tools.d.ts +33 -0
- package/dist/apps/tools.js +17 -0
- package/dist/auth.d.ts +11 -0
- package/dist/auth.js +93 -0
- package/dist/backend-request.d.ts +3 -0
- package/dist/backend-request.js +53 -0
- package/dist/build/build-jobs.d.ts +128 -0
- package/dist/build/build-jobs.js +197 -0
- package/dist/build/build-step.d.ts +26 -0
- package/dist/build/build-step.js +20 -0
- package/dist/build/bundled-html.d.ts +7 -0
- package/dist/build/bundled-html.js +64 -0
- package/dist/build/definition-emission.d.ts +34 -0
- package/dist/build/definition-emission.js +201 -0
- package/dist/build/effect.d.ts +231 -0
- package/dist/build/effect.js +396 -0
- package/dist/build/git-environment.d.ts +6 -0
- package/dist/build/git-environment.js +48 -0
- package/dist/build/html-recipe.d.ts +20 -0
- package/dist/build/html-recipe.js +51 -0
- package/dist/build/local-build.d.ts +57 -0
- package/dist/build/local-build.js +1078 -0
- package/dist/build/r2-artifact-writer.d.ts +31 -0
- package/dist/build/r2-artifact-writer.js +179 -0
- package/dist/build/snapshot-package-store.d.ts +2 -0
- package/dist/build/snapshot-package-store.js +21 -0
- package/dist/build/snapshot-program-scripts.d.ts +6 -0
- package/dist/build/snapshot-program-scripts.js +2 -0
- package/dist/build/submission-contract.d.ts +384 -0
- package/dist/build/submission-contract.js +70 -0
- package/dist/build/workspace-build.d.ts +50 -0
- package/dist/build/workspace-build.js +156 -0
- package/dist/build-contract.d.ts +4 -0
- package/dist/build-contract.js +4 -0
- package/dist/build-jobs.d.ts +2 -0
- package/dist/build-jobs.js +2 -0
- package/dist/build.d.ts +11 -0
- package/dist/build.js +13 -0
- package/dist/capability-descriptor.d.ts +46 -0
- package/dist/capability-descriptor.js +51 -0
- package/dist/catalog-frame.d.ts +39 -0
- package/dist/catalog-frame.js +72 -0
- package/dist/cause-class.d.ts +19 -0
- package/dist/cause-class.js +54 -0
- package/dist/cloudflare.d.ts +123 -0
- package/dist/cloudflare.js +391 -0
- package/dist/computer-terminal.d.ts +38 -0
- package/dist/computer-terminal.js +410 -0
- package/dist/computer.d.ts +60 -0
- package/dist/computer.js +33 -0
- package/dist/event-recipients.d.ts +57 -0
- package/dist/event-recipients.js +144 -0
- package/dist/facet-invocation.d.ts +4 -0
- package/dist/facet-invocation.js +45 -0
- package/dist/files.d.ts +42 -0
- package/dist/files.js +123 -0
- package/dist/frame-binding-wire-script.d.ts +2 -0
- package/dist/frame-binding-wire-script.js +1 -0
- package/dist/frame-binding-wire.d.ts +28 -0
- package/dist/frame-binding-wire.js +54 -0
- package/dist/git-admission.d.ts +52 -0
- package/dist/git-admission.js +188 -0
- package/dist/git-auth.d.ts +11 -0
- package/dist/git-auth.js +27 -0
- package/dist/git-door.d.ts +35 -0
- package/dist/git-door.js +108 -0
- package/dist/git-journal.d.ts +31 -0
- package/dist/git-journal.js +188 -0
- package/dist/git.d.ts +31 -0
- package/dist/git.js +64 -0
- package/dist/guest-policy.d.ts +9 -0
- package/dist/guest-policy.js +13 -0
- package/dist/host.d.ts +244 -0
- package/dist/host.js +1043 -0
- package/dist/index.d.ts +166 -0
- package/dist/index.js +320 -0
- package/dist/installation-consent.d.ts +79 -0
- package/dist/installation-consent.js +82 -0
- package/dist/internal/background-origins.d.ts +3 -0
- package/dist/internal/background-origins.js +8 -0
- package/dist/internal/delivery.d.ts +12 -0
- package/dist/internal/delivery.js +167 -0
- package/dist/internal/host-gate.d.ts +14 -0
- package/dist/internal/host-gate.js +62 -0
- package/dist/internal/registry-installations.d.ts +6 -0
- package/dist/internal/registry-installations.js +12 -0
- package/dist/invocation.d.ts +251 -0
- package/dist/invocation.js +377 -0
- package/dist/keys.d.ts +48 -0
- package/dist/keys.js +52 -0
- package/dist/mcp-owner.d.ts +27 -0
- package/dist/mcp-owner.js +143 -0
- package/dist/mcp.d.ts +89 -0
- package/dist/mcp.js +429 -0
- package/dist/media.d.ts +23 -0
- package/dist/media.js +12 -0
- package/dist/pack.d.ts +76 -0
- package/dist/pack.js +134 -0
- package/dist/page/capabilities.d.ts +23 -0
- package/dist/page/capabilities.js +256 -0
- package/dist/page/computer-handles.d.ts +79 -0
- package/dist/page/computer-handles.js +44 -0
- package/dist/page/lifetime.d.ts +6 -0
- package/dist/page/lifetime.js +19 -0
- package/dist/page/mount.d.ts +163 -0
- package/dist/page/mount.js +390 -0
- package/dist/page/storage.d.ts +3 -0
- package/dist/page/storage.js +82 -0
- package/dist/page/terminal.d.ts +5 -0
- package/dist/page/terminal.js +7 -0
- package/dist/page-script.d.ts +14 -0
- package/dist/page-script.js +5 -0
- package/dist/r2-files.d.ts +3 -0
- package/dist/r2-files.js +79 -0
- package/dist/release.d.ts +72 -0
- package/dist/release.js +164 -0
- package/dist/root-data.d.ts +86 -0
- package/dist/root-data.js +69 -0
- package/dist/shell/app-directory.d.ts +537 -0
- package/dist/shell/app-directory.js +195 -0
- package/dist/shell/browser-actions.d.ts +7 -0
- package/dist/shell/browser-actions.js +56 -0
- package/dist/shell/command-host.d.ts +112 -0
- package/dist/shell/command-host.js +502 -0
- package/dist/shell/commands.d.ts +25 -0
- package/dist/shell/commands.js +78 -0
- package/dist/shell/index.d.ts +8 -0
- package/dist/shell/index.js +8 -0
- package/dist/shell/keys.d.ts +41 -0
- package/dist/shell/keys.js +134 -0
- package/dist/shell/shell-module.d.ts +31 -0
- package/dist/shell/shell-module.js +37 -0
- package/dist/shell/window-manager.d.ts +124 -0
- package/dist/shell/window-manager.js +711 -0
- package/dist/shell/workbench-contract.d.ts +68 -0
- package/dist/shell/workbench-contract.js +1 -0
- package/dist/shell/workbench-host-types.d.ts +96 -0
- package/dist/shell/workbench-host-types.js +1 -0
- package/dist/shell/workbench-host.d.ts +34 -0
- package/dist/shell/workbench-host.js +347 -0
- package/dist/shell/workbench-model.d.ts +192 -0
- package/dist/shell/workbench-model.js +53 -0
- package/dist/shell/workbench.d.ts +4 -0
- package/dist/shell/workbench.js +2 -0
- package/dist/source/fork.d.ts +27 -0
- package/dist/source/fork.js +46 -0
- package/dist/source/index.d.ts +11 -0
- package/dist/source/index.js +11 -0
- package/dist/source/seed-receipt.d.ts +53 -0
- package/dist/source/seed-receipt.js +18 -0
- package/dist/source/team-source.d.ts +32 -0
- package/dist/source/team-source.js +42 -0
- package/dist/source/template-repository.d.ts +2 -0
- package/dist/source/template-repository.js +8 -0
- package/dist/source/template-write.d.ts +69 -0
- package/dist/source/template-write.js +344 -0
- package/dist/storage-frame.d.ts +64 -0
- package/dist/storage-frame.js +28 -0
- package/dist/tenant.d.ts +81 -0
- package/dist/tenant.js +71 -0
- package/dist/testing/capabilities.d.ts +29 -0
- package/dist/testing/capabilities.js +130 -0
- package/dist/testing/catalog.d.ts +3 -0
- package/dist/testing/catalog.js +53 -0
- package/dist/testing/index.d.ts +10 -0
- package/dist/testing/index.js +10 -0
- package/dist/testing/installation.d.ts +11 -0
- package/dist/testing/installation.js +25 -0
- package/dist/testing/native-worker.d.ts +21 -0
- package/dist/testing/native-worker.js +106 -0
- package/dist/testing/worker.d.ts +18 -0
- package/dist/testing/worker.js +67 -0
- package/dist/testing/workers-runtime.d.ts +24 -0
- package/dist/testing/workers-runtime.js +33 -0
- package/dist/webhook-delivery.d.ts +14 -0
- package/dist/webhook-delivery.js +17 -0
- package/dist/workers-git.d.ts +285 -0
- package/dist/workers-git.js +1174 -0
- package/dist/workers.d.ts +352 -0
- package/dist/workers.js +866 -0
- package/docs/api/README.md +82 -0
- package/docs/api/agents.md +332 -0
- package/docs/api/app-storage.md +209 -0
- package/docs/api/apps.md +1375 -0
- package/docs/api/auth.md +63 -0
- package/docs/api/build-contract.md +507 -0
- package/docs/api/build.md +1476 -0
- package/docs/api/cloudflare.md +421 -0
- package/docs/api/computer.md +203 -0
- package/docs/api/files.md +117 -0
- package/docs/api/git.md +470 -0
- package/docs/api/host.md +1328 -0
- package/docs/api/index.md +430 -0
- package/docs/api/invocation.md +738 -0
- package/docs/api/keys.md +175 -0
- package/docs/api/mcp.md +301 -0
- package/docs/api/media.md +40 -0
- package/docs/api/modules.md +42 -0
- package/docs/api/pack.md +138 -0
- package/docs/api/page/mount.md +298 -0
- package/docs/api/root-data.md +111 -0
- package/docs/api/shell/app-directory.md +332 -0
- package/docs/api/shell/command-host.md +224 -0
- package/docs/api/shell/commands.md +197 -0
- package/docs/api/shell/keys.md +183 -0
- package/docs/api/shell/shell-module.md +143 -0
- package/docs/api/shell/window-manager.md +267 -0
- package/docs/api/shell/workbench.md +186 -0
- package/docs/api/shell.md +1788 -0
- package/docs/api/tenant.md +194 -0
- package/docs/api/workers-git.md +1527 -0
- package/docs/api/workers.md +1678 -0
- package/docs/media/architecture.mmd +32 -0
- package/docs/media/architecture.png +0 -0
- package/docs/media/bonsai-network.png +0 -0
- package/docs/media/bonsai-repository.png +0 -0
- package/docs/site/agent-quickstart.mdx +349 -0
- package/examples/git/worker.ts +39 -0
- package/examples/git/wrangler.jsonc +32 -0
- package/examples/standalone/worker.ts +14 -0
- package/examples/standalone/wrangler.jsonc +21 -0
- package/package.json +249 -3
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
|
|
2
|
+
|
|
3
|
+
[**@fungi.computer/oyster**](README.md)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
[@fungi.computer/oyster](modules.md) / files
|
|
8
|
+
|
|
9
|
+
# files
|
|
10
|
+
|
|
11
|
+
## Type Aliases
|
|
12
|
+
|
|
13
|
+
### FileEntry
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type FileEntry = Readonly<{
|
|
17
|
+
name: string;
|
|
18
|
+
type: "file" | "directory" | "symlink";
|
|
19
|
+
size: number;
|
|
20
|
+
modifiedAt: number;
|
|
21
|
+
}>;
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
One entry of a directory listing, in Agar's `computer.list` contract.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
### FileListing
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
type FileListing = Readonly<{
|
|
32
|
+
path: string;
|
|
33
|
+
entries: readonly FileEntry[];
|
|
34
|
+
nextOffset: number | null;
|
|
35
|
+
}>;
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
A page of a directory, in Agar's `computer.list` contract.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### FileReplaceOutcome
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
type FileReplaceOutcome =
|
|
46
|
+
| Readonly<{
|
|
47
|
+
kind: "replaced";
|
|
48
|
+
path: string;
|
|
49
|
+
bytes: number;
|
|
50
|
+
}>
|
|
51
|
+
| Readonly<{
|
|
52
|
+
kind: "conflict";
|
|
53
|
+
}>;
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
What a conditional replace did, in Agar's `computer.writeFile` contract.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
### FileSource
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
type FileSource = Readonly<{
|
|
64
|
+
list: Promise<Readonly<{
|
|
65
|
+
path: string;
|
|
66
|
+
entries: readonly FileEntry[];
|
|
67
|
+
nextOffset: number | null;
|
|
68
|
+
}> | null>;
|
|
69
|
+
read: Promise<Uint8Array<ArrayBufferLike> | null>;
|
|
70
|
+
write: Promise<void>;
|
|
71
|
+
mkdir: Promise<void>;
|
|
72
|
+
replace: Promise<FileReplaceOutcome>;
|
|
73
|
+
}>;
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Where an Oyster's files live. Paths are absolute (`/notes/a.md`) and already
|
|
77
|
+
normalized by the routes; a source never sees `..`.
|
|
78
|
+
|
|
79
|
+
## Functions
|
|
80
|
+
|
|
81
|
+
### normalizeFilePath()
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
function normalizeFilePath(raw): string | null;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Normalize an absolute path; `null` when it is not one or escapes the root.
|
|
88
|
+
|
|
89
|
+
#### Parameters
|
|
90
|
+
|
|
91
|
+
| Parameter | Type |
|
|
92
|
+
| --------- | -------- |
|
|
93
|
+
| `raw` | `string` |
|
|
94
|
+
|
|
95
|
+
#### Returns
|
|
96
|
+
|
|
97
|
+
`string` \| `null`
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### fileCapabilities()
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
function fileCapabilities(source): readonly Readonly<object & object>[];
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
File capabilities sharing the existing `/files/` wire and one file source.
|
|
108
|
+
|
|
109
|
+
#### Parameters
|
|
110
|
+
|
|
111
|
+
| Parameter | Type |
|
|
112
|
+
| --------- | --------------------------- |
|
|
113
|
+
| `source` | [`FileSource`](#filesource) |
|
|
114
|
+
|
|
115
|
+
#### Returns
|
|
116
|
+
|
|
117
|
+
readonly `Readonly`\<`object` & `object`\>[]
|
package/docs/api/git.md
ADDED
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
<!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
|
|
2
|
+
|
|
3
|
+
[**@fungi.computer/oyster**](README.md)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
[@fungi.computer/oyster](modules.md) / git
|
|
8
|
+
|
|
9
|
+
# git
|
|
10
|
+
|
|
11
|
+
## Type Aliases
|
|
12
|
+
|
|
13
|
+
### GitStore
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type GitStore = GitBinding;
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Installation-scoped storage; transport and credentials stay with its provider
|
|
20
|
+
adapter.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
### GitGrants
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
type GitGrants = Readonly<{
|
|
28
|
+
admits: Promise<boolean>;
|
|
29
|
+
}>;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Live host authority, reopened before every provider call. Null is an anonymous
|
|
33
|
+
reader.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
### GitPolicy
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
type GitPolicy = Readonly<{
|
|
41
|
+
authorize: Promise<
|
|
42
|
+
| {
|
|
43
|
+
allowed: z.ZodLiteral<true>;
|
|
44
|
+
}
|
|
45
|
+
| {
|
|
46
|
+
allowed: z.ZodLiteral<false>;
|
|
47
|
+
refused: z.ZodArray<
|
|
48
|
+
z.ZodObject<
|
|
49
|
+
{
|
|
50
|
+
ref: z.ZodString;
|
|
51
|
+
message: z.ZodString;
|
|
52
|
+
},
|
|
53
|
+
z.core.$strict
|
|
54
|
+
>
|
|
55
|
+
>;
|
|
56
|
+
}
|
|
57
|
+
>;
|
|
58
|
+
}>;
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Repository rules owned by the selected App; a missing or malformed answer
|
|
62
|
+
refuses.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### GitJournal
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
type GitJournal = Readonly<{
|
|
70
|
+
tip: Promise<string | null>;
|
|
71
|
+
record: Promise<void>;
|
|
72
|
+
}>;
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Durable accepted-ref journal; record commits before the provider result is
|
|
76
|
+
acknowledged.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
### AdmittedGit
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
type AdmittedGit = Readonly<{
|
|
84
|
+
push: Promise<
|
|
85
|
+
Readonly<{
|
|
86
|
+
status: number;
|
|
87
|
+
headers: Readonly<Record<string, string>>;
|
|
88
|
+
body: Uint8Array;
|
|
89
|
+
}>
|
|
90
|
+
>;
|
|
91
|
+
read: Promise<
|
|
92
|
+
Readonly<{
|
|
93
|
+
status: number;
|
|
94
|
+
headers: Readonly<Record<string, string>>;
|
|
95
|
+
body: Uint8Array;
|
|
96
|
+
}>
|
|
97
|
+
>;
|
|
98
|
+
binding: GitBinding;
|
|
99
|
+
}>;
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Host-held read/write path; Apps receive only its installation-authored binding.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
### GitDoorTarget
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
type GitDoorTarget = Readonly<{
|
|
110
|
+
installationId: string;
|
|
111
|
+
repository: string;
|
|
112
|
+
scope: "read" | "write";
|
|
113
|
+
}>;
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The repository and access one smart-HTTP request names.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
### GitDoorHost
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
type GitDoorHost = Readonly<{
|
|
124
|
+
authenticate: Promise<
|
|
125
|
+
| Readonly<{
|
|
126
|
+
kind: "actor";
|
|
127
|
+
actor: HostActor;
|
|
128
|
+
role?: "owner" | "member";
|
|
129
|
+
workflow?: WorkflowAttestation & object;
|
|
130
|
+
}>
|
|
131
|
+
| null>;
|
|
132
|
+
isPublic: Promise<boolean>;
|
|
133
|
+
git: Promise<
|
|
134
|
+
| Readonly<{
|
|
135
|
+
push: Promise<Readonly<{
|
|
136
|
+
status: number;
|
|
137
|
+
headers: Readonly<Record<..., ...>>;
|
|
138
|
+
body: Uint8Array;
|
|
139
|
+
}>>;
|
|
140
|
+
read: Promise<Readonly<{
|
|
141
|
+
status: number;
|
|
142
|
+
headers: Readonly<Record<..., ...>>;
|
|
143
|
+
body: Uint8Array;
|
|
144
|
+
}>>;
|
|
145
|
+
binding: GitBinding;
|
|
146
|
+
}>
|
|
147
|
+
| null>;
|
|
148
|
+
}>;
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Identity and selected installation come only from host-held ports.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### GitPushJournalPorts
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
type GitPushJournalPorts = Readonly<{
|
|
159
|
+
owner: WatchdogSqliteOwner;
|
|
160
|
+
deliver: Promise<void>;
|
|
161
|
+
deliverSync: Promise<PostDeliveryResult>;
|
|
162
|
+
scheduleWake: Promise<void>;
|
|
163
|
+
now?: () => number;
|
|
164
|
+
}>;
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
The standalone composition supplies selected-Instance admission and its alarm.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### EventSink
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
type EventSink = Readonly<{
|
|
175
|
+
emit: Promise<void>;
|
|
176
|
+
}>;
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The EVENTS binding: an App emits typed events the host routes.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### StandardWebhookPayload
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
type StandardWebhookPayload = Readonly<{
|
|
187
|
+
type: string;
|
|
188
|
+
timestamp: string;
|
|
189
|
+
data: Schema.Json;
|
|
190
|
+
}>;
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
The Standard Webhooks payload shape.
|
|
194
|
+
|
|
195
|
+
## Variables
|
|
196
|
+
|
|
197
|
+
### workflowGitPassPrefix
|
|
198
|
+
|
|
199
|
+
```ts
|
|
200
|
+
const workflowGitPassPrefix: "wgp." = "wgp.";
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
A Workflow Git pass presented as `Authorization: Bearer` starts with this.
|
|
204
|
+
|
|
205
|
+
## Functions
|
|
206
|
+
|
|
207
|
+
### createInstallationGitAdmission()
|
|
208
|
+
|
|
209
|
+
```ts
|
|
210
|
+
function createInstallationGitAdmission(
|
|
211
|
+
ports,
|
|
212
|
+
): (writer, repository, scope) => Promise<boolean>;
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Reuse the live installation/verified Release rule without opening provider
|
|
216
|
+
storage.
|
|
217
|
+
|
|
218
|
+
#### Parameters
|
|
219
|
+
|
|
220
|
+
| Parameter | Type |
|
|
221
|
+
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
222
|
+
| `ports` | `Readonly`\<\{ `currentInstallation`: `Promise`\< \| `Readonly`\<\{ `installationId`: `string`; `instanceId`: [`InstanceId`](index.md#instanceid) \| `null`; `appId`: `AppId`; `release`: \{ `releaseId`: `Schema.refine`\<`ReleaseId`, `Schema.String`\>; `appId`: `Schema.refine`\<`AppId`, `Schema.String`\>; `artifact`: `Schema.Struct`\<\{ `artifactRef`: `Schema.refine`\<`ArtifactRef`, `Schema.String`\>; `artifactDigest`: `Schema.refine`\<`Sha256Digest`, `Schema.String`\>; `provenance`: `Schema.Struct`\<\{ `sourceRevision`: ...; `sourceTreeDigest`: ...; `buildRecipeDigest`: ...; \}\>; \}\>; \}; `releasePin`: `"pinned"` \| `"floating"`; `authorityVersion`: `number`; `status`: `"enabled"` \| `"disabled"` \| `"deleted"`; `visibility`: `"private"` \| `"public"`; `declaredOperationsDigest`: `Sha256Digest`; `approvedGrants`: readonly `Readonly`\<\{ `capability`: \| `"agent.list"` \| `"agent.manage"` \| `"agent.rename"` \| `"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"`; `capabilityApproved`: `true`; `operations`: readonly `string`[]; `resources`: `"tenant-scope"` \| readonly ...[]; \}\>[]; `approval`: \| `Readonly`\<\{ `by`: \| \{ `kind`: ...; `memberId`: ...; \} \| \{ `kind`: ...; `agentId`: ...; \} \| \{ `kind`: ...; `keyId`: ...; \}; `at`: `number`; `authorityVersion`: `number`; \}\> \| `null`; `approvedAnonymousMethods`: readonly `Readonly`\<\{ `name`: `string`; `digest`: `Sha256Digest`; \}\>[]; `anonymousApproval`: \| `Readonly`\<\{ `by`: \| \{ `kind`: ...; `memberId`: ...; \} \| \{ `kind`: ...; `agentId`: ...; \} \| \{ `kind`: ...; `keyId`: ...; \}; `at`: `number`; `authorityVersion`: `number`; \}\> \| `null`; \}\> \| `null`\>; `declaration`: `Promise`\< \| `Readonly`\<\{ `api?`: `AppApi`; `displayName?`: `string`; `capabilities`: readonly `AppCapabilityId`[]; `calls?`: readonly `Readonly`\<\{ `appId`: ...; `methods`: ...; \}\>[]; `guidance?`: `string`; `handlers`: readonly `AppHandler`[]; `receives?`: readonly `"git.push"`[]; `icon?`: `string`; `roles`: readonly `AppRole`[]; `storage?`: readonly `AppStorageKey`[]; `commands?`: readonly `AppDeclaredCommand`[]; `gills?`: readonly `AppDeclaredGill`[]; `backend?`: `Readonly`\<\{ `bindings`: readonly ...[]; `sync?`: `Readonly`\<\{ `method`: ...; \}\>; \}\>; \}\> \| `null`\>; \}\> |
|
|
223
|
+
|
|
224
|
+
#### Returns
|
|
225
|
+
|
|
226
|
+
```ts
|
|
227
|
+
(
|
|
228
|
+
writer,
|
|
229
|
+
repository,
|
|
230
|
+
scope
|
|
231
|
+
): Promise<boolean>;
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Reopen the host authority for this repository and requested scope.
|
|
235
|
+
|
|
236
|
+
##### Parameters
|
|
237
|
+
|
|
238
|
+
| Parameter | Type |
|
|
239
|
+
| ------------ | --------------------- |
|
|
240
|
+
| `writer` | `GitWriter` \| `null` |
|
|
241
|
+
| `repository` | `string` |
|
|
242
|
+
| `scope` | `"read"` \| `"write"` |
|
|
243
|
+
|
|
244
|
+
##### Returns
|
|
245
|
+
|
|
246
|
+
`Promise`\<`boolean`\>
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
### createAdmittedGit()
|
|
251
|
+
|
|
252
|
+
```ts
|
|
253
|
+
function createAdmittedGit(ports): AdmittedGit;
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Fixed order: host grant, Workflow ceiling, App policy, provider exchange,
|
|
257
|
+
durable journal.
|
|
258
|
+
|
|
259
|
+
#### Parameters
|
|
260
|
+
|
|
261
|
+
| Parameter | Type |
|
|
262
|
+
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
263
|
+
| `ports` | `Readonly`\<\{ `installationId`: `string`; `store`: [`GitStore`](#gitstore); `grants`: [`GitGrants`](#gitgrants); `policy`: [`GitPolicy`](#gitpolicy); `journal`: [`GitJournal`](#gitjournal); `beforeProvider?`: () => `void`; \}\> |
|
|
264
|
+
|
|
265
|
+
#### Returns
|
|
266
|
+
|
|
267
|
+
[`AdmittedGit`](#admittedgit)
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
### smartHttpExchange()
|
|
272
|
+
|
|
273
|
+
```ts
|
|
274
|
+
function smartHttpExchange(
|
|
275
|
+
method,
|
|
276
|
+
url,
|
|
277
|
+
suffix,
|
|
278
|
+
): Readonly<{
|
|
279
|
+
scope: "read" | "write";
|
|
280
|
+
advertise: boolean;
|
|
281
|
+
}> | null;
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
One smart-HTTP exchange: the method, `service` query and path suffix a Git
|
|
285
|
+
client sends, whatever path names the repository. Null otherwise.
|
|
286
|
+
|
|
287
|
+
#### Parameters
|
|
288
|
+
|
|
289
|
+
| Parameter | Type |
|
|
290
|
+
| --------- | -------- |
|
|
291
|
+
| `method` | `string` |
|
|
292
|
+
| `url` | `URL` |
|
|
293
|
+
| `suffix` | `string` |
|
|
294
|
+
|
|
295
|
+
#### Returns
|
|
296
|
+
|
|
297
|
+
\| `Readonly`\<\{ `scope`: `"read"` \| `"write"`; `advertise`: `boolean`; \}\>
|
|
298
|
+
\| `null`
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
### gitDoorRoute()
|
|
303
|
+
|
|
304
|
+
```ts
|
|
305
|
+
function gitDoorRoute(
|
|
306
|
+
method,
|
|
307
|
+
url,
|
|
308
|
+
):
|
|
309
|
+
| (Readonly<{
|
|
310
|
+
installationId: string;
|
|
311
|
+
repository: string;
|
|
312
|
+
scope: "read" | "write";
|
|
313
|
+
}> &
|
|
314
|
+
Readonly<{
|
|
315
|
+
advertise: boolean;
|
|
316
|
+
}>)
|
|
317
|
+
| null;
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Oyster's own Git address: the repository, scope and phase one request names, or
|
|
321
|
+
null when it is not an exact Oyster Git exchange.
|
|
322
|
+
|
|
323
|
+
#### Parameters
|
|
324
|
+
|
|
325
|
+
| Parameter | Type |
|
|
326
|
+
| --------- | -------- |
|
|
327
|
+
| `method` | `string` |
|
|
328
|
+
| `url` | `URL` |
|
|
329
|
+
|
|
330
|
+
#### Returns
|
|
331
|
+
|
|
332
|
+
\| `Readonly`\<\{ `installationId`: `string`; `repository`: `string`; `scope`:
|
|
333
|
+
`"read"` \| `"write"`; \}\> & `Readonly`\<\{ `advertise`: `boolean`; \}\> \|
|
|
334
|
+
`null`
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
### createGitDoor()
|
|
339
|
+
|
|
340
|
+
```ts
|
|
341
|
+
function createGitDoor(host): Hono;
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Mount one smart-HTTP door with no provider credentials or alternate write
|
|
345
|
+
branch.
|
|
346
|
+
|
|
347
|
+
#### Parameters
|
|
348
|
+
|
|
349
|
+
| Parameter | Type |
|
|
350
|
+
| --------- | ----------------------------- |
|
|
351
|
+
| `host` | [`GitDoorHost`](#gitdoorhost) |
|
|
352
|
+
|
|
353
|
+
#### Returns
|
|
354
|
+
|
|
355
|
+
`Hono`
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
### createGitPushJournal()
|
|
360
|
+
|
|
361
|
+
```ts
|
|
362
|
+
function createGitPushJournal(ports): Promise<{
|
|
363
|
+
armSync: Promise<number>;
|
|
364
|
+
tip: string | null;
|
|
365
|
+
accept: Promise<"duplicate" | "recorded">;
|
|
366
|
+
alarm: Promise<void>;
|
|
367
|
+
nextWake: () => number | null;
|
|
368
|
+
}>;
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
Carrier owns delivery state; this journal owns accepted fact identity.
|
|
372
|
+
|
|
373
|
+
#### Parameters
|
|
374
|
+
|
|
375
|
+
| Parameter | Type |
|
|
376
|
+
| --------- | --------------------------------------------- |
|
|
377
|
+
| `ports` | [`GitPushJournalPorts`](#gitpushjournalports) |
|
|
378
|
+
|
|
379
|
+
#### Returns
|
|
380
|
+
|
|
381
|
+
`Promise`\<\{ `armSync`: `Promise`\<`number`\>; `tip`: `string` \| `null`;
|
|
382
|
+
`accept`: `Promise`\<`"duplicate"` \| `"recorded"`\>; `alarm`:
|
|
383
|
+
`Promise`\<`void`\>; `nextWake`: () => `number` \| `null`; \}\>
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
### lsRefsRequest()
|
|
388
|
+
|
|
389
|
+
```ts
|
|
390
|
+
function lsRefsRequest(): Uint8Array;
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
The protocol-v2 ls-refs request body.
|
|
394
|
+
|
|
395
|
+
#### Returns
|
|
396
|
+
|
|
397
|
+
`Uint8Array`
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
### parseLsRefs()
|
|
402
|
+
|
|
403
|
+
```ts
|
|
404
|
+
function parseLsRefs(response): object[];
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Parse an ls-refs response into refs.
|
|
408
|
+
|
|
409
|
+
#### Parameters
|
|
410
|
+
|
|
411
|
+
| Parameter | Type |
|
|
412
|
+
| ---------- | ------------ |
|
|
413
|
+
| `response` | `Uint8Array` |
|
|
414
|
+
|
|
415
|
+
#### Returns
|
|
416
|
+
|
|
417
|
+
`object`[]
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
### signStandardWebhook()
|
|
422
|
+
|
|
423
|
+
```ts
|
|
424
|
+
function signStandardWebhook(secret, id, timestamp, body): Promise<string>;
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
The Standard Webhooks `webhook-signature` value for one delivery.
|
|
428
|
+
|
|
429
|
+
#### Parameters
|
|
430
|
+
|
|
431
|
+
| Parameter | Type |
|
|
432
|
+
| ----------- | -------- |
|
|
433
|
+
| `secret` | `string` |
|
|
434
|
+
| `id` | `string` |
|
|
435
|
+
| `timestamp` | `number` |
|
|
436
|
+
| `body` | `string` |
|
|
437
|
+
|
|
438
|
+
#### Returns
|
|
439
|
+
|
|
440
|
+
`Promise`\<`string`\>
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
### webhookHeaders()
|
|
445
|
+
|
|
446
|
+
```ts
|
|
447
|
+
function webhookHeaders(
|
|
448
|
+
secret,
|
|
449
|
+
id,
|
|
450
|
+
type,
|
|
451
|
+
timestamp,
|
|
452
|
+
body,
|
|
453
|
+
): Promise<Record<string, string>>;
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
Headers for one signed delivery: Standard Webhooks plus `X-Hub-Signature-256`.
|
|
457
|
+
|
|
458
|
+
#### Parameters
|
|
459
|
+
|
|
460
|
+
| Parameter | Type |
|
|
461
|
+
| ----------- | -------- |
|
|
462
|
+
| `secret` | `string` |
|
|
463
|
+
| `id` | `string` |
|
|
464
|
+
| `type` | `string` |
|
|
465
|
+
| `timestamp` | `number` |
|
|
466
|
+
| `body` | `string` |
|
|
467
|
+
|
|
468
|
+
#### Returns
|
|
469
|
+
|
|
470
|
+
`Promise`\<`Record`\<`string`, `string`\>\>
|