@fungi.computer/agar 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/README.md +34 -18
- package/dist/agent-message-meta.d.ts +21 -16
- package/dist/agent-message-meta.js +17 -6
- package/dist/agents.d.ts +86 -13
- package/dist/agents.js +48 -25
- package/dist/approvals.d.ts +5 -0
- package/dist/approvals.js +36 -0
- package/dist/apps.js +4 -4
- package/dist/backend-definition.d.ts +41 -4
- package/dist/backend-definition.js +70 -10
- package/dist/backend-refusal.d.ts +1 -0
- package/dist/backend-refusal.js +1 -0
- package/dist/backend.js +4 -4
- package/dist/channels.js +4 -4
- package/dist/computer-contracts.d.ts +11 -28
- package/dist/computer-contracts.js +10 -29
- package/dist/computer.js +16 -16
- package/dist/connect.d.ts +3 -3
- package/dist/connect.js +7 -17
- package/dist/errors.d.ts +39 -1
- package/dist/errors.js +62 -5
- package/dist/game-servers.js +2 -2
- package/dist/git-rpc.d.ts +23 -23
- package/dist/git-rpc.js +14 -16
- package/dist/git.d.ts +9 -9
- package/dist/git.js +8 -8
- package/dist/host.d.ts +3 -1
- package/dist/host.js +5 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.js +5 -2
- package/dist/inference.js +2 -1
- package/dist/internal/app-session.js +37 -1
- package/dist/internal/media-diagnostic.d.ts +11 -0
- package/dist/internal/media-diagnostic.js +21 -0
- package/dist/internal/protocol.d.ts +4 -4
- package/dist/internal/schemas.d.ts +40 -7
- package/dist/internal/schemas.js +122 -35
- package/dist/marketplace.js +7 -5
- package/dist/media-json.d.ts +14 -0
- package/dist/media-json.js +1 -0
- package/dist/media-request-id.d.ts +1 -1
- package/dist/media-request-id.js +2 -2
- package/dist/media.d.ts +11 -0
- package/dist/media.js +8 -2
- package/dist/method-presentation.d.ts +7 -0
- package/dist/method-presentation.js +14 -0
- package/dist/method-refusal.d.ts +5 -5
- package/dist/method-refusal.js +4 -4
- package/dist/query.d.ts +2 -2
- package/dist/react-mount.d.ts +7 -1
- package/dist/react-mount.js +28 -8
- package/dist/react.d.ts +14 -2
- package/dist/react.js +40 -4
- package/dist/read-copy.d.ts +1 -1
- package/dist/read-copy.js +3 -6
- package/dist/storage.js +1 -1
- package/dist/test-kit/git.js +19 -2
- package/dist/window.d.ts +68 -0
- package/dist/window.js +31 -0
- package/docs/api/README.md +15 -15
- package/docs/api/backend-definition.md +83 -9
- package/docs/api/backend.md +45 -38
- package/docs/api/errors.md +104 -0
- package/docs/api/git-rpc.md +35 -35
- package/docs/api/git.md +66 -80
- package/docs/api/index.md +851 -143
- package/docs/api/media-json.md +32 -59
- package/docs/api/media-request-id.md +1 -1
- package/docs/api/method-presentation.md +21 -0
- package/docs/api/modules.md +1 -0
- package/docs/api/query.md +1 -1
- package/docs/api/react.md +23 -10
- package/package.json +16 -6
package/dist/errors.d.ts
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
/** Declaration-safe projection of the canonical Media diagnostic grammar. */
|
|
3
|
+
export type MediaProviderDiagnostic = Readonly<{
|
|
4
|
+
/** Allowlisted Workers AI category; never a provider message. */
|
|
5
|
+
category: "InferenceUpstreamError" | "AiInternalError" | "TypeError" | "AbortError" | "TimeoutError" | "Error";
|
|
6
|
+
/** Four- or five-digit provider prefix, or null when absent. */
|
|
7
|
+
code: number | null;
|
|
8
|
+
}> | Readonly<{
|
|
9
|
+
/** A completed video result could not be downloaded. */
|
|
10
|
+
category: "result_download";
|
|
11
|
+
/** Native Response status, including zero. */
|
|
12
|
+
status: number;
|
|
13
|
+
}>;
|
|
14
|
+
/** Decode only safe provider facts, rejecting unmodeled private fields. */
|
|
15
|
+
export declare function decodeMediaProviderDiagnostic(input: unknown): MediaProviderDiagnostic;
|
|
16
|
+
/**
|
|
17
|
+
* Documentable wire projection of the canonical diagnostic grammar.
|
|
18
|
+
* Maintained converters preserve its closed objects and numeric bounds;
|
|
19
|
+
* decoding still returns the declaration-safe public diagnostic type.
|
|
20
|
+
*/
|
|
21
|
+
export declare const mediaProviderDiagnosticWireSchema: z.ZodPipe<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>, z.ZodTransform<Readonly<{
|
|
22
|
+
/** Allowlisted Workers AI category; never a provider message. */
|
|
23
|
+
category: "InferenceUpstreamError" | "AiInternalError" | "TypeError" | "AbortError" | "TimeoutError" | "Error";
|
|
24
|
+
/** Four- or five-digit provider prefix, or null when absent. */
|
|
25
|
+
code: number | null;
|
|
26
|
+
}> | Readonly<{
|
|
27
|
+
/** A completed video result could not be downloaded. */
|
|
28
|
+
category: "result_download";
|
|
29
|
+
/** Native Response status, including zero. */
|
|
30
|
+
status: number;
|
|
31
|
+
}>, unknown>>;
|
|
32
|
+
/** Decode an ordinary Error name without retaining arbitrary upstream text. */
|
|
33
|
+
export declare function decodeMediaProviderErrorCategory(input: string | undefined): Exclude<MediaProviderDiagnostic["category"], "result_download">;
|
|
1
34
|
/** The closed set of reasons an AppError can state; every SDK and
|
|
2
35
|
* host-reported failure is tagged with exactly one of these codes. */
|
|
3
|
-
export
|
|
36
|
+
export declare const appErrorCodes: readonly ["CANCELLED", "CAPABILITY_DENIED", "CAPABILITY_REVOKED", "COMMAND_NOT_DECLARED", "CONFLICT", "DELIVERY_PENDING", "DISCONNECTED", "FILE_TOO_LARGE", "HOST_FAILURE", "IDENTITY", "INSUFFICIENT_CREDIT", "INVALID_ARGUMENT", "PROTOCOL", "SAFETY_FILTER_REFUSED", "SELECTION_CHANGED", "TIMEOUT"];
|
|
37
|
+
export type AppErrorCode = (typeof appErrorCodes)[number];
|
|
38
|
+
/** One pending-delivery refusal shared by admission and the shell. */
|
|
39
|
+
export type AppDeliveryPending = Readonly<{
|
|
40
|
+
code: Extract<AppErrorCode, "DELIVERY_PENDING">;
|
|
41
|
+
}>;
|
|
4
42
|
/** Required construction options for an AppError. */
|
|
5
43
|
export type AppErrorOptions = {
|
|
6
44
|
readonly cause?: unknown;
|
package/dist/errors.js
CHANGED
|
@@ -1,3 +1,53 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
import * as Option from "effect/Option";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
import { mediaProviderDiagnosticSchema, mediaProviderErrorCategorySchema, } from "./internal/media-diagnostic.js";
|
|
5
|
+
/** Decode only safe provider facts, rejecting unmodeled private fields. */
|
|
6
|
+
export function decodeMediaProviderDiagnostic(input) {
|
|
7
|
+
// Bidirectional projection check, erased from the Promise declaration graph.
|
|
8
|
+
return Schema.decodeUnknownSync(mediaProviderDiagnosticSchema, {
|
|
9
|
+
onExcessProperty: "error",
|
|
10
|
+
})(input);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Documentable wire projection of the canonical diagnostic grammar.
|
|
14
|
+
* Maintained converters preserve its closed objects and numeric bounds;
|
|
15
|
+
* decoding still returns the declaration-safe public diagnostic type.
|
|
16
|
+
*/
|
|
17
|
+
export const mediaProviderDiagnosticWireSchema = z
|
|
18
|
+
.fromJSONSchema(Schema.toJsonSchemaDocument(mediaProviderDiagnosticSchema, {
|
|
19
|
+
onExcessProperty: "error",
|
|
20
|
+
}).schema)
|
|
21
|
+
.transform(decodeMediaProviderDiagnostic);
|
|
22
|
+
/** Decode an ordinary Error name without retaining arbitrary upstream text. */
|
|
23
|
+
export function decodeMediaProviderErrorCategory(input) {
|
|
24
|
+
return (Option.getOrUndefined(Schema.decodeUnknownOption(mediaProviderErrorCategorySchema)(input)) ?? "Error");
|
|
25
|
+
}
|
|
26
|
+
/** The closed set of reasons an AppError can state; every SDK and
|
|
27
|
+
* host-reported failure is tagged with exactly one of these codes. */
|
|
28
|
+
export const appErrorCodes = [
|
|
29
|
+
"CANCELLED",
|
|
30
|
+
"CAPABILITY_DENIED",
|
|
31
|
+
"CAPABILITY_REVOKED",
|
|
32
|
+
"COMMAND_NOT_DECLARED",
|
|
33
|
+
"CONFLICT",
|
|
34
|
+
"DELIVERY_PENDING",
|
|
35
|
+
"DISCONNECTED",
|
|
36
|
+
"FILE_TOO_LARGE",
|
|
37
|
+
"HOST_FAILURE",
|
|
38
|
+
"IDENTITY",
|
|
39
|
+
"INSUFFICIENT_CREDIT",
|
|
40
|
+
"INVALID_ARGUMENT",
|
|
41
|
+
"PROTOCOL",
|
|
42
|
+
"SAFETY_FILTER_REFUSED",
|
|
43
|
+
"SELECTION_CHANGED",
|
|
44
|
+
"TIMEOUT",
|
|
45
|
+
];
|
|
46
|
+
const describedAppErrorSchema = Schema.Struct({
|
|
47
|
+
name: Schema.Literal("AppError"),
|
|
48
|
+
code: Schema.Literals(appErrorCodes),
|
|
49
|
+
retryable: Schema.Boolean,
|
|
50
|
+
});
|
|
1
51
|
/** The SDK's one typed failure. Carries a closed `code` naming the failure
|
|
2
52
|
* kind and an explicit `retryable` verdict, instead of leaving callers to
|
|
3
53
|
* guess either from the message or exception shape. */
|
|
@@ -35,6 +85,10 @@ const errorCopy = {
|
|
|
35
85
|
title: "File changed",
|
|
36
86
|
message: "This file changed elsewhere. Review it before saving again.",
|
|
37
87
|
},
|
|
88
|
+
DELIVERY_PENDING: {
|
|
89
|
+
title: "App delivery pending",
|
|
90
|
+
message: "The App hasn't finished getting ready. Try opening it again.",
|
|
91
|
+
},
|
|
38
92
|
DISCONNECTED: {
|
|
39
93
|
title: "Connection lost",
|
|
40
94
|
message: "Reopen the App to connect again.",
|
|
@@ -90,15 +144,18 @@ const errorCopy = {
|
|
|
90
144
|
* prerequisites, so they can accompany a non-retryable operation.
|
|
91
145
|
*/
|
|
92
146
|
export function describeAppError(cause, overrides) {
|
|
93
|
-
|
|
147
|
+
// The picked shell and host can be separate bundles of this same SDK.
|
|
148
|
+
const decoded = Schema.decodeUnknownOption(describedAppErrorSchema)(cause);
|
|
149
|
+
if (Option.isNone(decoded))
|
|
94
150
|
return { ...errorCopy.UNKNOWN, retryable: false };
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
const
|
|
151
|
+
const error = decoded.value;
|
|
152
|
+
const entry = errorCopy[error.code];
|
|
153
|
+
const copy = overrides?.[error.code] ?? entry;
|
|
154
|
+
const action = entry.action ?? (error.retryable ? "retry" : undefined);
|
|
98
155
|
const description = {
|
|
99
156
|
title: copy.title,
|
|
100
157
|
message: copy.message,
|
|
101
|
-
retryable:
|
|
158
|
+
retryable: error.retryable,
|
|
102
159
|
};
|
|
103
160
|
if (action)
|
|
104
161
|
return { ...description, action };
|
package/dist/game-servers.js
CHANGED
|
@@ -221,7 +221,7 @@ export class GameServerRequestError extends Error {
|
|
|
221
221
|
this.name = "GameServerRequestError";
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
export const gamesServers = defineCapability("games:servers", 1, rpcHandleSchema({
|
|
224
|
+
export const gamesServers = defineCapability("games:servers", 1, z.lazy(() => rpcHandleSchema({
|
|
225
225
|
list: rpcMethod(rpcDataSchema(z.unknown().transform((value) => gameServerPageSchema.parse(value)))),
|
|
226
226
|
catalog: rpcMethod(rpcDataSchema(z
|
|
227
227
|
.unknown()
|
|
@@ -236,7 +236,7 @@ export const gamesServers = defineCapability("games:servers", 1, rpcHandleSchema
|
|
|
236
236
|
.transform((value) => z.array(gameServerBackupSchema).parse(value)))),
|
|
237
237
|
delete: rpcVoid,
|
|
238
238
|
backupNow: rpcVoid,
|
|
239
|
-
}));
|
|
239
|
+
})));
|
|
240
240
|
/** Decode the host's listing at the App boundary. */
|
|
241
241
|
export async function listGameServers(capabilities, input) {
|
|
242
242
|
const page = await capabilities.require(gamesServers).list(input);
|
package/dist/git-rpc.d.ts
CHANGED
|
@@ -3,27 +3,27 @@ import { type GitBinding } from "./git.js";
|
|
|
3
3
|
/** The native tuple and result grammar shared by the handle and frame entrypoint. */
|
|
4
4
|
export declare const nativeGitCodecs: {
|
|
5
5
|
create: {
|
|
6
|
-
args: z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodObject<{
|
|
6
|
+
args: z.ZodTuple<[z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodObject<{
|
|
7
7
|
description: z.ZodOptional<z.ZodString>;
|
|
8
8
|
defaultBranch: z.ZodOptional<z.ZodString>;
|
|
9
|
-
}, z.core.$strict
|
|
10
|
-
result: z.ZodObject<{
|
|
9
|
+
}, z.core.$strict>>>], null>;
|
|
10
|
+
result: z.ZodLazy<z.ZodObject<{
|
|
11
11
|
name: z.ZodString;
|
|
12
12
|
defaultBranch: z.ZodString;
|
|
13
13
|
lastPushAt: z.ZodNullable<z.ZodString>;
|
|
14
14
|
source: z.ZodNullable<z.ZodString>;
|
|
15
|
-
}, z.core.$strict
|
|
15
|
+
}, z.core.$strict>>;
|
|
16
16
|
};
|
|
17
17
|
fork: {
|
|
18
|
-
args: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodOptional<z.ZodObject<{
|
|
18
|
+
args: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodObject<{
|
|
19
19
|
description: z.ZodOptional<z.ZodString>;
|
|
20
|
-
}, z.core.$strict
|
|
21
|
-
result: z.ZodObject<{
|
|
20
|
+
}, z.core.$strict>>>], null>;
|
|
21
|
+
result: z.ZodLazy<z.ZodObject<{
|
|
22
22
|
name: z.ZodString;
|
|
23
23
|
defaultBranch: z.ZodString;
|
|
24
24
|
lastPushAt: z.ZodNullable<z.ZodString>;
|
|
25
25
|
source: z.ZodNullable<z.ZodString>;
|
|
26
|
-
}, z.core.$strict
|
|
26
|
+
}, z.core.$strict>>;
|
|
27
27
|
};
|
|
28
28
|
cloneUrl: {
|
|
29
29
|
args: z.ZodTuple<[z.ZodString], null>;
|
|
@@ -31,24 +31,24 @@ export declare const nativeGitCodecs: {
|
|
|
31
31
|
};
|
|
32
32
|
info: {
|
|
33
33
|
args: z.ZodTuple<[z.ZodString], null>;
|
|
34
|
-
result: z.ZodNullable<z.ZodObject<{
|
|
34
|
+
result: z.ZodNullable<z.ZodLazy<z.ZodObject<{
|
|
35
35
|
name: z.ZodString;
|
|
36
36
|
defaultBranch: z.ZodString;
|
|
37
37
|
lastPushAt: z.ZodNullable<z.ZodString>;
|
|
38
38
|
source: z.ZodNullable<z.ZodString>;
|
|
39
|
-
}, z.core.$strict
|
|
39
|
+
}, z.core.$strict>>>;
|
|
40
40
|
};
|
|
41
41
|
delete: {
|
|
42
42
|
args: z.ZodTuple<[z.ZodString], null>;
|
|
43
43
|
result: z.ZodBoolean;
|
|
44
44
|
};
|
|
45
45
|
log: {
|
|
46
|
-
args: z.ZodTuple<[z.ZodString, z.ZodObject<{
|
|
46
|
+
args: z.ZodTuple<[z.ZodString, z.ZodLazy<z.ZodObject<{
|
|
47
47
|
ref: z.ZodString;
|
|
48
48
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
49
49
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
50
|
-
}, z.core.$strict
|
|
51
|
-
result: z.ZodArray<z.ZodObject<{
|
|
50
|
+
}, z.core.$strict>>], null>;
|
|
51
|
+
result: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
52
52
|
hash: z.ZodString;
|
|
53
53
|
treeHash: z.ZodString;
|
|
54
54
|
message: z.ZodString;
|
|
@@ -63,11 +63,11 @@ export declare const nativeGitCodecs: {
|
|
|
63
63
|
parents: z.ZodArray<z.ZodString>;
|
|
64
64
|
authoredAt: z.ZodNumber;
|
|
65
65
|
committedAt: z.ZodNumber;
|
|
66
|
-
}, z.core.$strict
|
|
66
|
+
}, z.core.$strict>>>;
|
|
67
67
|
};
|
|
68
68
|
readCommit: {
|
|
69
69
|
args: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
70
|
-
result: z.ZodNullable<z.ZodObject<{
|
|
70
|
+
result: z.ZodNullable<z.ZodLazy<z.ZodObject<{
|
|
71
71
|
hash: z.ZodString;
|
|
72
72
|
treeHash: z.ZodString;
|
|
73
73
|
message: z.ZodString;
|
|
@@ -82,11 +82,11 @@ export declare const nativeGitCodecs: {
|
|
|
82
82
|
parents: z.ZodArray<z.ZodString>;
|
|
83
83
|
authoredAt: z.ZodNumber;
|
|
84
84
|
committedAt: z.ZodNumber;
|
|
85
|
-
}, z.core.$strict
|
|
85
|
+
}, z.core.$strict>>>;
|
|
86
86
|
};
|
|
87
87
|
readTree: {
|
|
88
88
|
args: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
89
|
-
result: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
89
|
+
result: z.ZodNullable<z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
90
90
|
name: z.ZodString;
|
|
91
91
|
mode: z.ZodString;
|
|
92
92
|
hash: z.ZodString;
|
|
@@ -95,11 +95,11 @@ export declare const nativeGitCodecs: {
|
|
|
95
95
|
tree: "tree";
|
|
96
96
|
commit: "commit";
|
|
97
97
|
}>;
|
|
98
|
-
}, z.core.$strict
|
|
98
|
+
}, z.core.$strict>>>>;
|
|
99
99
|
};
|
|
100
100
|
readBlob: {
|
|
101
101
|
args: z.ZodTuple<[z.ZodString, z.ZodString], null>;
|
|
102
|
-
result: z.ZodNullable<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer
|
|
102
|
+
result: z.ZodNullable<z.ZodLazy<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>>;
|
|
103
103
|
};
|
|
104
104
|
refs: {
|
|
105
105
|
args: z.ZodTuple<[z.ZodString], null>;
|
|
@@ -118,13 +118,13 @@ export declare const nativeGitCodecs: {
|
|
|
118
118
|
advertise: "advertise";
|
|
119
119
|
exchange: "exchange";
|
|
120
120
|
}>;
|
|
121
|
-
body: z.ZodNullable<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer
|
|
122
|
-
headers: z.ZodRecord<z.ZodString, z.ZodString
|
|
121
|
+
body: z.ZodNullable<z.ZodLazy<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>>;
|
|
122
|
+
headers: z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
123
123
|
}, z.core.$strict>], null>;
|
|
124
124
|
result: z.ZodObject<{
|
|
125
125
|
status: z.ZodNumber;
|
|
126
|
-
headers: z.ZodRecord<z.ZodString, z.ZodString
|
|
127
|
-
body: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer
|
|
126
|
+
headers: z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
127
|
+
body: z.ZodLazy<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>>;
|
|
128
128
|
}, z.core.$strict>;
|
|
129
129
|
};
|
|
130
130
|
};
|
package/dist/git-rpc.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import {} from "./git.js";
|
|
3
3
|
import { gitRepositoryNameSchema, gitSha1Schema, } from "@fungi.computer/puffball/git-representation";
|
|
4
|
-
const bytes = z
|
|
4
|
+
const bytes = z.lazy(() => z
|
|
5
5
|
.instanceof(Uint8Array)
|
|
6
|
-
.refine((value) => value.byteLength <= 32 * 1024 * 1024);
|
|
7
|
-
const headers = z.record(z.string().max(256), z.string().max(8192));
|
|
6
|
+
.refine((value) => value.byteLength <= 32 * 1024 * 1024));
|
|
7
|
+
const headers = z.lazy(() => z.record(z.string().max(256), z.string().max(8192)));
|
|
8
8
|
const identity = z.strictObject({ name: z.string(), email: z.string() });
|
|
9
|
-
const info = z.strictObject({
|
|
9
|
+
const info = z.lazy(() => z.strictObject({
|
|
10
10
|
name: gitRepositoryNameSchema,
|
|
11
11
|
defaultBranch: z.string(),
|
|
12
12
|
lastPushAt: z.string().nullable(),
|
|
13
13
|
source: gitRepositoryNameSchema.nullable(),
|
|
14
|
-
});
|
|
15
|
-
const commit = z.strictObject({
|
|
14
|
+
}));
|
|
15
|
+
const commit = z.lazy(() => z.strictObject({
|
|
16
16
|
hash: gitSha1Schema,
|
|
17
17
|
treeHash: gitSha1Schema,
|
|
18
18
|
message: z.string(),
|
|
@@ -21,13 +21,13 @@ const commit = z.strictObject({
|
|
|
21
21
|
parents: z.array(gitSha1Schema),
|
|
22
22
|
authoredAt: z.number().int(),
|
|
23
23
|
committedAt: z.number().int(),
|
|
24
|
-
});
|
|
25
|
-
const tree = z.strictObject({
|
|
24
|
+
}));
|
|
25
|
+
const tree = z.lazy(() => z.strictObject({
|
|
26
26
|
name: z.string(),
|
|
27
27
|
mode: z.string(),
|
|
28
28
|
hash: gitSha1Schema,
|
|
29
29
|
type: z.enum(["blob", "tree", "commit"]),
|
|
30
|
-
});
|
|
30
|
+
}));
|
|
31
31
|
const request = z.strictObject({
|
|
32
32
|
service: z.enum(["upload-pack", "receive-pack"]),
|
|
33
33
|
phase: z.enum(["advertise", "exchange"]),
|
|
@@ -39,20 +39,18 @@ const response = z.strictObject({
|
|
|
39
39
|
headers,
|
|
40
40
|
body: bytes,
|
|
41
41
|
});
|
|
42
|
-
const createOptions = z
|
|
42
|
+
const createOptions = z.lazy(() => z
|
|
43
43
|
.strictObject({
|
|
44
44
|
description: z.string().max(8192).optional(),
|
|
45
45
|
defaultBranch: z.string().min(1).max(1024).optional(),
|
|
46
46
|
})
|
|
47
|
-
.optional();
|
|
48
|
-
const forkOptions = z
|
|
49
|
-
|
|
50
|
-
.optional();
|
|
51
|
-
const logOptions = z.strictObject({
|
|
47
|
+
.optional());
|
|
48
|
+
const forkOptions = z.lazy(() => z.strictObject({ description: z.string().max(8192).optional() }).optional());
|
|
49
|
+
const logOptions = z.lazy(() => z.strictObject({
|
|
52
50
|
ref: z.string().min(1).max(1024),
|
|
53
51
|
limit: z.number().int().min(1).max(1000).optional(),
|
|
54
52
|
offset: z.number().int().nonnegative().optional(),
|
|
55
|
-
});
|
|
53
|
+
}));
|
|
56
54
|
/** The native tuple and result grammar shared by the handle and frame entrypoint. */
|
|
57
55
|
export const nativeGitCodecs = {
|
|
58
56
|
create: {
|
package/dist/git.d.ts
CHANGED
|
@@ -9,14 +9,14 @@ export type GitRepositoryName = z.output<typeof gitRepositoryNameSchema>;
|
|
|
9
9
|
* Host-selected repository namespace. Team identity comes from the host;
|
|
10
10
|
* decoding this reference never grants access to either namespace.
|
|
11
11
|
*/
|
|
12
|
-
export declare const repositoryRefSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
|
+
export declare const repositoryRefSchema: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
13
|
kind: z.ZodLiteral<"installation">;
|
|
14
14
|
installationId: z.ZodString;
|
|
15
15
|
repository: z.ZodString;
|
|
16
16
|
}, z.core.$strict>, z.ZodObject<{
|
|
17
17
|
kind: z.ZodLiteral<"team-source">;
|
|
18
18
|
repository: z.ZodString;
|
|
19
|
-
}, z.core.$strict>], "kind"
|
|
19
|
+
}, z.core.$strict>], "kind">>;
|
|
20
20
|
/** Installation-local repository or registered Team source, selected by its host. */
|
|
21
21
|
export type RepositoryRef = z.output<typeof repositoryRefSchema>;
|
|
22
22
|
/** Stable namespace identity, serialized through the canonical repository decoder. */
|
|
@@ -84,7 +84,7 @@ export declare const gitWriterSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
84
84
|
}, z.core.$strict>], "kind">>;
|
|
85
85
|
}, z.core.$strict>], "kind">;
|
|
86
86
|
/** The App's question covers the whole push, under host-held attribution. */
|
|
87
|
-
export declare const gitPushQuestionSchema: z.ZodObject<{
|
|
87
|
+
export declare const gitPushQuestionSchema: z.ZodLazy<z.ZodObject<{
|
|
88
88
|
repository: z.ZodString;
|
|
89
89
|
writer: z.ZodObject<{
|
|
90
90
|
kind: z.ZodLiteral<"actor">;
|
|
@@ -124,9 +124,9 @@ export declare const gitPushQuestionSchema: z.ZodObject<{
|
|
|
124
124
|
before: z.ZodString;
|
|
125
125
|
after: z.ZodString;
|
|
126
126
|
}, z.core.$strict>>;
|
|
127
|
-
}, z.core.$strict
|
|
127
|
+
}, z.core.$strict>>;
|
|
128
128
|
/** A whole push verdict; refusal messages are shown by ordinary Git clients. */
|
|
129
|
-
export declare const gitPushVerdictSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
129
|
+
export declare const gitPushVerdictSchema: z.ZodLazy<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
130
130
|
allowed: z.ZodLiteral<true>;
|
|
131
131
|
}, z.core.$strict>, z.ZodObject<{
|
|
132
132
|
allowed: z.ZodLiteral<false>;
|
|
@@ -134,13 +134,13 @@ export declare const gitPushVerdictSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
134
134
|
ref: z.ZodString;
|
|
135
135
|
message: z.ZodString;
|
|
136
136
|
}, z.core.$strict>>;
|
|
137
|
-
}, z.core.$strict>], "allowed"
|
|
137
|
+
}, z.core.$strict>], "allowed">>;
|
|
138
138
|
/** Ref question sent only after host grant and Workflow branch admission. */
|
|
139
139
|
export type GitPushQuestion = z.output<typeof gitPushQuestionSchema>;
|
|
140
140
|
/** Explicit permission or bounded per-ref refusal for the whole push. */
|
|
141
141
|
export type GitPushVerdict = z.output<typeof gitPushVerdictSchema>;
|
|
142
142
|
/** One accepted push, with host attribution and no remote or credential. */
|
|
143
|
-
export declare const appGitPushFactSchema: z.ZodObject<{
|
|
143
|
+
export declare const appGitPushFactSchema: z.ZodLazy<z.ZodObject<{
|
|
144
144
|
repository: z.ZodString;
|
|
145
145
|
writer: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
146
146
|
kind: z.ZodLiteral<"actor">;
|
|
@@ -197,8 +197,8 @@ export declare const appGitPushFactSchema: z.ZodObject<{
|
|
|
197
197
|
ref: z.ZodString;
|
|
198
198
|
journaled: z.ZodNullable<z.ZodString>;
|
|
199
199
|
}, z.core.$strict>>>;
|
|
200
|
-
eventId: z.ZodString
|
|
201
|
-
}, z.core.$strict
|
|
200
|
+
eventId: z.ZodLazy<z.ZodString>;
|
|
201
|
+
}, z.core.$strict>>;
|
|
202
202
|
/** One bounded ref update, shared by push questions and accepted facts. */
|
|
203
203
|
export type GitRefUpdate = z.output<typeof appGitPushFactSchema>["updates"][number];
|
|
204
204
|
/** Host-delivered push fact; retries retain the same event ID. */
|
package/dist/git.js
CHANGED
|
@@ -7,7 +7,7 @@ export const gitRepositoryCapability = "git.repository";
|
|
|
7
7
|
* Host-selected repository namespace. Team identity comes from the host;
|
|
8
8
|
* decoding this reference never grants access to either namespace.
|
|
9
9
|
*/
|
|
10
|
-
export const repositoryRefSchema = z.discriminatedUnion("kind", [
|
|
10
|
+
export const repositoryRefSchema = z.lazy(() => z.discriminatedUnion("kind", [
|
|
11
11
|
z.strictObject({
|
|
12
12
|
kind: z.literal("installation"),
|
|
13
13
|
installationId: z.string().min(1).max(256),
|
|
@@ -17,7 +17,7 @@ export const repositoryRefSchema = z.discriminatedUnion("kind", [
|
|
|
17
17
|
kind: z.literal("team-source"),
|
|
18
18
|
repository: gitRepositoryNameSchema,
|
|
19
19
|
}),
|
|
20
|
-
]);
|
|
20
|
+
]));
|
|
21
21
|
/** Stable namespace identity, serialized through the canonical repository decoder. */
|
|
22
22
|
export function repositoryRefKey(repository) {
|
|
23
23
|
return JSON.stringify(repositoryRefSchema.parse(repository));
|
|
@@ -55,13 +55,13 @@ export const gitWriterSchema = z.discriminatedUnion("kind", [
|
|
|
55
55
|
}),
|
|
56
56
|
]);
|
|
57
57
|
/** The App's question covers the whole push, under host-held attribution. */
|
|
58
|
-
export const gitPushQuestionSchema = z.strictObject({
|
|
58
|
+
export const gitPushQuestionSchema = z.lazy(() => z.strictObject({
|
|
59
59
|
repository: gitRepositoryNameSchema,
|
|
60
60
|
writer: gitWriterSchema.options[0],
|
|
61
61
|
updates: z.array(gitRefUpdateSchema).min(1).max(256),
|
|
62
|
-
});
|
|
62
|
+
}));
|
|
63
63
|
/** A whole push verdict; refusal messages are shown by ordinary Git clients. */
|
|
64
|
-
export const gitPushVerdictSchema = z.discriminatedUnion("allowed", [
|
|
64
|
+
export const gitPushVerdictSchema = z.lazy(() => z.discriminatedUnion("allowed", [
|
|
65
65
|
z.strictObject({ allowed: z.literal(true) }),
|
|
66
66
|
z.strictObject({
|
|
67
67
|
allowed: z.literal(false),
|
|
@@ -73,9 +73,9 @@ export const gitPushVerdictSchema = z.discriminatedUnion("allowed", [
|
|
|
73
73
|
.min(1)
|
|
74
74
|
.max(256),
|
|
75
75
|
}),
|
|
76
|
-
]);
|
|
76
|
+
]));
|
|
77
77
|
/** One accepted push, with host attribution and no remote or credential. */
|
|
78
|
-
export const appGitPushFactSchema = z.strictObject({
|
|
78
|
+
export const appGitPushFactSchema = z.lazy(() => z.strictObject({
|
|
79
79
|
repository: gitRepositoryNameSchema,
|
|
80
80
|
writer: gitWriterSchema,
|
|
81
81
|
updates: z.array(gitRefUpdateSchema).min(1).max(256),
|
|
@@ -88,7 +88,7 @@ export const appGitPushFactSchema = z.strictObject({
|
|
|
88
88
|
.optional(),
|
|
89
89
|
// Host event IDs may include a Computer ID as well as its local event ID.
|
|
90
90
|
eventId: gitPushEventIdSchema,
|
|
91
|
-
});
|
|
91
|
+
}));
|
|
92
92
|
/** Parse a host-admitted fact and invoke its lifecycle handler, preserving rejection. */
|
|
93
93
|
export async function dispatchAppGitPush(lifecycle, raw) {
|
|
94
94
|
const fact = appGitPushFactSchema.parse(raw);
|
package/dist/host.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AppCommand } from "./commands.js";
|
|
2
2
|
import type { WhistleExecutionOrigin, WhistleJsonValue } from "@fungi.computer/whistle";
|
|
3
3
|
import type { AppContext, AppIdentity, FocusState } from "./lifecycle.js";
|
|
4
|
-
import type { AppNavigationState } from "./window.js";
|
|
4
|
+
import type { AppNavigationActivation, AppNavigationState } from "./window.js";
|
|
5
5
|
import type { AppBrowserAction, AppBrowserActionOutcome, AgentSessionSelection, AppPermissionOutcome, AppPermissionRequest, AppStatusAction, AppStatusItem, FileNavigationInput, ToastInput } from "./ui.js";
|
|
6
6
|
import { AppError } from "./errors.js";
|
|
7
7
|
import { type AppConnectMessage } from "./internal/protocol.js";
|
|
@@ -11,6 +11,8 @@ export type AppHost = {
|
|
|
11
11
|
requestClose(): Promise<boolean>;
|
|
12
12
|
/** Ask the App to go back one step in its own history; `true` when it did. */
|
|
13
13
|
requestBack(): Promise<boolean>;
|
|
14
|
+
/** Deliver the person's use of a crumb or header command; `true` when the App acted. */
|
|
15
|
+
activateNavigation(activation: AppNavigationActivation): Promise<boolean>;
|
|
14
16
|
/** Deliver the person's use of a status item; `true` when the App acted. */
|
|
15
17
|
activateStatus(action: AppStatusAction): Promise<boolean>;
|
|
16
18
|
updateContext(fact: AppHostFact<AppContext>): Promise<void>;
|
package/dist/host.js
CHANGED
|
@@ -12,7 +12,7 @@ import { disposeRpcValue } from "./internal/capabilities.js";
|
|
|
12
12
|
import { disconnectHost } from "./internal/disconnect-host.js";
|
|
13
13
|
import { APP_CONNECT_TYPE, APP_PROTOCOL_VERSION, APP_READY_TYPE, } from "./internal/protocol.js";
|
|
14
14
|
import { callRpc, rpcFailure, rpcSuccess, } from "./internal/result.js";
|
|
15
|
-
import { parseBrowserAction, parseChordInvocation, parseCommandResultRpc, parseBackDecisionResult, parseCloseDecisionResult, parseCommand, parseCommandId, parseConnectRequest, parseContextFact, parseFocus, parseAgentSessionSelection, parseLocalHostBootstrap, parseHostLifecycleFact, parseNavigation, parseNavigationState, parseStatusAction, parseStatusItems, parsePermissionRequest, parseReady, parseReservedChordsFact, parseThemeFact, parseToast, parseVoidResult, } from "./internal/schemas.js";
|
|
15
|
+
import { parseBrowserAction, parseChordInvocation, parseCommandResultRpc, parseBackDecisionResult, parseCloseDecisionResult, parseCommand, parseCommandId, parseConnectRequest, parseContextFact, parseFocus, parseAgentSessionSelection, parseLocalHostBootstrap, parseHostLifecycleFact, parseNavigation, parseNavigationActivation, parseNavigationState, parseStatusAction, parseStatusItems, parsePermissionRequest, parseReady, parseReservedChordsFact, parseThemeFact, parseToast, parseVoidResult, } from "./internal/schemas.js";
|
|
16
16
|
import { createTerminalGate, } from "./internal/terminal-gate.js";
|
|
17
17
|
/** One pending or live mount belongs to each iframe WindowProxy. */
|
|
18
18
|
const liveMounts = new WeakMap();
|
|
@@ -639,6 +639,10 @@ function createHost(options) {
|
|
|
639
639
|
assertLive();
|
|
640
640
|
return await callRpc(options.client.requestBack(), parseBackDecisionResult);
|
|
641
641
|
},
|
|
642
|
+
activateNavigation: async (activation) => {
|
|
643
|
+
assertLive();
|
|
644
|
+
return await callRpc(options.client.activateNavigation(parseNavigationActivation(activation)), parseBackDecisionResult);
|
|
645
|
+
},
|
|
642
646
|
activateStatus: async (action) => {
|
|
643
647
|
assertLive();
|
|
644
648
|
return await callRpc(options.client.activateStatus(parseStatusAction(action)), parseBackDecisionResult);
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export { createCapabilityRegistry, defineCapability } from "./capabilities.js";
|
|
|
4
4
|
export { pending, pendingSchema } from "./pending.js";
|
|
5
5
|
export type { Pending } from "./pending.js";
|
|
6
6
|
export type { CapabilityContract, CapabilityDirectory, CapabilityRegistry, } from "./capabilities.js";
|
|
7
|
-
export { agentList, agentManage, agentRename, agentSessionRead, agentSessionWrite, agentToolPolicy, createAppAgent, renameAppAgent, appAgentCreateInputSchema, appAgentRenameInputSchema, appAgentSchema, appAgentToolPolicyResultSchema, appAgentToolPolicyStatusSchema, listAppAgents, openAppAgent, } from "./agents.js";
|
|
8
|
-
export type { AppAgent, AppAgentCreateHandle, AppAgentCreateInput, AppAgentDirectoryHandle, AppAgentListHandle, AppAgentRenameHandle, AppAgentRenameInput, AppAgentToolPolicyHandle, AppAgentToolPolicyResult, AppAgentToolPolicyStatus, AppAgentTransport, AppAgentTransportHandle, } from "./agents.js";
|
|
7
|
+
export { agentAvatar, agentList, agentManage, agentRename, agentSessionRead, agentSessionWrite, agentToolPolicy, createAppAgent, renameAppAgent, setAppAgentAvatar, appAgentAvatarInputSchema, appAgentAvatarSchema, appAgentCreateInputSchema, appAgentRenameInputSchema, appAgentSchema, appAgentToolPolicyResultSchema, appAgentToolPolicyStatusSchema, listAppAgents, openAppAgent, } from "./agents.js";
|
|
8
|
+
export type { AppAgent, AppAgentAvatarHandle, AppAgentAvatarInput, AppAgentCreateHandle, AppAgentCreateInput, AppAgentDirectoryHandle, AppAgentListHandle, AppAgentRenameHandle, AppAgentRenameInput, AppAgentToolPolicyHandle, AppAgentToolPolicyResult, AppAgentToolPolicyStatus, AppAgentTransport, AppAgentTransportHandle, } from "./agents.js";
|
|
9
9
|
export { mediaGeneration, mediaGenerationFailureSchema, mediaGenerationReferenceSchema, mediaGenerationSelectionSchema, mediaModelSchema, openMediaGeneration, } from "./media.js";
|
|
10
10
|
export type { MediaGenerationHandle, MediaGenerationAttempt, MediaGenerationAttemptHandle, MediaGenerationFailure, MediaGenerationInput, MediaGenerationOutcome, MediaGenerationReference, MediaGenerationResult, MediaGenerationSelection, MediaModel, MediaOutputFormat, MediaGenerationSession, } from "./media.js";
|
|
11
11
|
export type { AppCommand, AppCommandHandler, AppCommandInvocation, AppCommands, } from "./commands.js";
|
|
@@ -16,6 +16,8 @@ export type { ConnectAppOptions } from "./connect.js";
|
|
|
16
16
|
export { APP_CONNECT_TYPE, APP_PROTOCOL_VERSION, APP_READY_TYPE, } from "./internal/protocol.js";
|
|
17
17
|
export type { AppConnectMessage, AppReadyMessage, } from "./internal/protocol.js";
|
|
18
18
|
export { AppError } from "./errors.js";
|
|
19
|
+
export { appDeliveryPendingSchema } from "./internal/schemas.js";
|
|
20
|
+
export type { AppDeliveryPending } from "./errors.js";
|
|
19
21
|
export { statusActionAllowed, statusText } from "./status.js";
|
|
20
22
|
export { APP_BROWSER_SAVE_MAX_BYTES, APP_BROWSER_COPY_MAX_BYTES, APP_STATUS_ITEMS_MAX, APP_STATUS_OPTIONS_MAX, APP_STATUS_TEXT_MAX, } from "./ui.js";
|
|
21
23
|
export { parseStatusAction as parseAppStatusAction, parseStatusItems as parseAppStatusItems, } from "./internal/schemas.js";
|
|
@@ -25,7 +27,9 @@ export type { AppRoot } from "./root.js";
|
|
|
25
27
|
export type { AgentSessionSelection } from "./ui.js";
|
|
26
28
|
export type { Disposer, ReadonlyStore } from "./store.js";
|
|
27
29
|
export type { AppBrowserAction, AppBrowserActionOutcome, AppBrowserActionRefusal, AgentAccessOperation, AppPermissionOutcome, AppPermissionRequest, AppStatusAction, AppStatusActionHandler, AppStatusIcon, AppStatusItem, AppStatusOption, AppStatusTone, ComputerAccessOperation, FileNavigationInput, HostUi, ToastInput, } from "./ui.js";
|
|
28
|
-
export {
|
|
29
|
-
export
|
|
30
|
+
export { resultRowSchemaV1, type ResultRow } from "@fungi.computer/gills";
|
|
31
|
+
export { APP_NAVIGATION_CONTRACT_VERSION, APP_NAVIGATION_CRUMBS_MAX, APP_NAVIGATION_LABEL_MAX, APP_NAVIGATION_MENU_MAX, APP_NAVIGATION_PRIMARY_MAX, APP_NAVIGATION_SIBLINGS_MAX, APP_NAVIGATION_STATUS_MAX, APP_NAVIGATION_TITLE_MAX, inertHostNavigation, navigationActivationAllowed, } from "./window.js";
|
|
32
|
+
export type { AppBackHandler, AppCrumb, AppHeaderCommand, AppHeaderStatus, AppNavigationActivation, AppNavigationActivationHandler, AppNavigationState, AppWindow, BeforeAppClose, HostNavigation, } from "./window.js";
|
|
30
33
|
export { appStorage, AppStorageError } from "./storage.js";
|
|
31
34
|
export type { AppStorage, AppStorageWatch, AppStorageWrite, AppStorageReset, ResolvedAppStorage, } from "./storage.js";
|
|
35
|
+
export { approvals } from "./approvals.js";
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
export { FungiAuthorSchema, FungiDelegationReplySchema, FungiMessageMetaSchema, messageAuthor, messageDelegationReply, authorMeta, } from "./agent-message-meta.js";
|
|
2
2
|
export { createCapabilityRegistry, defineCapability } from "./capabilities.js";
|
|
3
3
|
export { pending, pendingSchema } from "./pending.js";
|
|
4
|
-
export { agentList, agentManage, agentRename, agentSessionRead, agentSessionWrite, agentToolPolicy, createAppAgent, renameAppAgent, appAgentCreateInputSchema, appAgentRenameInputSchema, appAgentSchema, appAgentToolPolicyResultSchema, appAgentToolPolicyStatusSchema, listAppAgents, openAppAgent, } from "./agents.js";
|
|
4
|
+
export { agentAvatar, agentList, agentManage, agentRename, agentSessionRead, agentSessionWrite, agentToolPolicy, createAppAgent, renameAppAgent, setAppAgentAvatar, appAgentAvatarInputSchema, appAgentAvatarSchema, appAgentCreateInputSchema, appAgentRenameInputSchema, appAgentSchema, appAgentToolPolicyResultSchema, appAgentToolPolicyStatusSchema, listAppAgents, openAppAgent, } from "./agents.js";
|
|
5
5
|
export { mediaGeneration, mediaGenerationFailureSchema, mediaGenerationReferenceSchema, mediaGenerationSelectionSchema, mediaModelSchema, openMediaGeneration, } from "./media.js";
|
|
6
6
|
export { registerCatalog } from "./commands.js";
|
|
7
7
|
export { connectApp } from "./connect.js";
|
|
8
8
|
/** Data exchanged by iframe and host before the RPC MessagePort takes over. */
|
|
9
9
|
export { APP_CONNECT_TYPE, APP_PROTOCOL_VERSION, APP_READY_TYPE, } from "./internal/protocol.js";
|
|
10
10
|
export { AppError } from "./errors.js";
|
|
11
|
+
export { appDeliveryPendingSchema } from "./internal/schemas.js";
|
|
11
12
|
export { statusActionAllowed, statusText } from "./status.js";
|
|
12
13
|
export { APP_BROWSER_SAVE_MAX_BYTES, APP_BROWSER_COPY_MAX_BYTES, APP_STATUS_ITEMS_MAX, APP_STATUS_OPTIONS_MAX, APP_STATUS_TEXT_MAX, } from "./ui.js";
|
|
13
14
|
export { parseStatusAction as parseAppStatusAction, parseStatusItems as parseAppStatusItems, } from "./internal/schemas.js";
|
|
14
|
-
export {
|
|
15
|
+
export { resultRowSchemaV1 } from "@fungi.computer/gills";
|
|
16
|
+
export { APP_NAVIGATION_CONTRACT_VERSION, APP_NAVIGATION_CRUMBS_MAX, APP_NAVIGATION_LABEL_MAX, APP_NAVIGATION_MENU_MAX, APP_NAVIGATION_PRIMARY_MAX, APP_NAVIGATION_SIBLINGS_MAX, APP_NAVIGATION_STATUS_MAX, APP_NAVIGATION_TITLE_MAX, inertHostNavigation, navigationActivationAllowed, } from "./window.js";
|
|
15
17
|
export { appStorage, AppStorageError } from "./storage.js";
|
|
18
|
+
export { approvals } from "./approvals.js";
|
package/dist/inference.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { defineCapability } from "./capabilities.js";
|
|
2
2
|
import { rpcFetchHandleSchema, rpcHandleSchema, rpcMethod, } from "./internal/rpc-contract.js";
|
|
3
|
+
import * as z from "zod";
|
|
3
4
|
import * as Schema from "effect/Schema";
|
|
4
5
|
import { AppError } from "./errors.js";
|
|
5
6
|
import { reportCatchFailure } from "./failure.js";
|
|
6
|
-
export const llmGeneration = defineCapability("llm.generation", 1, rpcHandleSchema({ open: rpcMethod(rpcFetchHandleSchema) }));
|
|
7
|
+
export const llmGeneration = defineCapability("llm.generation", 1, z.lazy(() => rpcHandleSchema({ open: rpcMethod(rpcFetchHandleSchema) })));
|
|
7
8
|
const baseURL = "https://inference.fungi.invalid/v1";
|
|
8
9
|
const decodeResponse = Schema.decodeUnknownSync(Schema.instanceOf(Response));
|
|
9
10
|
/** OpenAI-compatible transport; no Agent, Session, host URL or credentials are exposed. */
|