palbase 0.65.0 → 0.68.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 +3 -2
- package/dist/ai/index.js +2 -2
- package/dist/ai-sdk/index.js +4 -0
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +8 -8
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/{YP3QTS4L.js → 22GRHCVI.js} +1 -1
- package/dist/chunks/{CZGZTOK7.js → 2ZHSNWVZ.js} +2 -2
- package/dist/chunks/3OP3YJ63.js +22 -0
- package/dist/chunks/{5HMDOBEH.js → 4YV35XDP.js} +2 -2
- package/dist/chunks/5ZXXBM6L.js +18 -0
- package/dist/chunks/{KZZ3Y3DC.js → 622BI7EV.js} +1 -1
- package/dist/chunks/65QZXK2S.js +2 -0
- package/dist/chunks/{ZF3WKPVM.js → 7SGTDHXJ.js} +2 -2
- package/dist/chunks/D6EUPFUR.js +2 -0
- package/dist/chunks/EGWQ3EJE.js +21 -0
- package/dist/chunks/{ARRJICH3.js → EJAGO6ZV.js} +2 -2
- package/dist/chunks/{6GRY63N6.js → F4B6ELAN.js} +2 -2
- package/dist/chunks/IZWB7FGX.js +6 -0
- package/dist/chunks/{G2JBUBZO.js → J7WJF7F4.js} +2 -2
- package/dist/chunks/{DFX37NU3.js → LUUXXMXH.js} +1 -1
- package/dist/chunks/MVY4K43S.js +13 -0
- package/dist/chunks/{JHM7GTPD.js → OWLXCD3D.js} +1 -1
- package/dist/chunks/PP7MW4OT.js +2 -0
- package/dist/chunks/{DLMWZYLL.js → QFZ4GCJH.js} +2 -2
- package/dist/chunks/QQUIM4VK.js +2 -0
- package/dist/chunks/UJLFALKX.js +2 -0
- package/dist/chunks/{TEF7WS37.js → XJLAH42O.js} +1 -1
- package/dist/chunks/{XSOQNHZ5.js → XU4G5W72.js} +1 -1
- package/dist/chunks/YCDAV3WO.js +2 -0
- package/dist/cli.js +351 -364
- package/dist/cloud/index.js +2 -2
- package/dist/refuse/ai-sdk.js +2 -0
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.js +1 -1
- package/dist/refuse/cloud.js +1 -1
- package/dist/refuse/server.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/testing.js +2 -2
- package/dist/web/index.js +2 -2
- package/dist/web/message.js +2 -2
- package/dist/web/palbe.js +2 -2
- package/dist/web/payments-ui.js +264 -0
- package/dist/web/paywall.js +2 -2
- package/dist/web/push-sw.js +1 -1
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +4 -3
- package/package.json +19 -2
- package/types/ai/src/ai.d.ts +55 -29
- package/types/ai/src/chats.d.ts +163 -171
- package/types/ai/src/index.d.ts +5 -5
- package/types/ai/src/pools.d.ts +17 -7
- package/types/ai/src/tools.d.ts +6 -64
- package/types/ai-sdk/src/index.d.ts +166 -0
- package/types/backend/src/decorators.d.ts +3 -9
- package/types/backend/src/idempotency.d.ts +18 -0
- package/types/backend/src/index.d.ts +1 -1
- package/types/backend/src/services.d.ts +2 -2
- package/types/backend/src/stack.d.ts +2 -4
- package/types/backend/src/strings-files.d.ts +5 -6
- package/types/backend/src/upload.d.ts +2 -1
- package/types/cloud/src/generated/project.d.ts +3 -2
- package/types/cloud/src/generated/studio.d.ts +3 -3
- package/types/internal/src/chat.d.ts +56 -2
- package/types/internal/src/event.d.ts +1 -1
- package/types/internal/src/modules/ai.d.ts +939 -1133
- package/types/internal/src/modules/analytics.d.ts +1 -1
- package/types/internal/src/modules/events.d.ts +5 -4
- package/types/internal/src/modules/{purchases.d.ts → iap.d.ts} +2183 -2438
- package/types/internal/src/modules/index.d.ts +2 -1
- package/types/internal/src/modules/journeys.d.ts +1 -1
- package/types/internal/src/modules/notify.d.ts +3 -3
- package/types/internal/src/modules/payments.d.ts +3286 -0
- package/types/internal/src/modules/stores.d.ts +7 -7
- package/types/internal/src/modules/workspaces.d.ts +22 -0
- package/types/server/src/{purchases.d.ts → iap.d.ts} +7 -7
- package/types/server/src/index.d.ts +2 -1
- package/types/server/src/payments.d.ts +65 -0
- package/types/server/src/server.d.ts +4 -1
- package/types/web/src/chat.d.ts +30 -4
- package/types/web/src/client.d.ts +13 -10
- package/types/web/src/{purchases.d.ts → iap.d.ts} +46 -56
- package/types/web/src/inapp.d.ts +5 -5
- package/types/web/src/index.d.ts +4 -2
- package/types/web/src/messaging.d.ts +1 -0
- package/types/web/src/notify.d.ts +2 -2
- package/types/web/src/payments-ui/index.d.ts +7 -0
- package/types/web/src/payments-ui/payment-sheet.d.ts +13 -0
- package/types/web/src/payments-ui/qr.d.ts +9 -0
- package/types/web/src/payments-ui/saved-cards-view.d.ts +7 -0
- package/types/web/src/payments-ui/spend-qr-view.d.ts +8 -0
- package/types/web/src/payments-ui/theme.d.ts +16 -0
- package/types/web/src/payments-ui/types.d.ts +149 -0
- package/types/web/src/payments-ui/wallet-topup-sheet.d.ts +7 -0
- package/types/web/src/payments.d.ts +281 -0
- package/types/web/src/paywall/placement.d.ts +6 -8
- package/types/web/src/screen/assets.d.ts +1 -1
- package/types/web/src/screen/resolve.d.ts +3 -3
- package/types/web/src/vite.d.ts +8 -0
- package/dist/chunks/2HJQSGOO.js +0 -13
- package/dist/chunks/3TXOVBZP.js +0 -22
- package/dist/chunks/4NHRUBEF.js +0 -2
- package/dist/chunks/63TUW6P7.js +0 -18
- package/dist/chunks/BYXX373R.js +0 -21
- package/dist/chunks/CTWUVLVE.js +0 -2
- package/dist/chunks/GFG7WVN2.js +0 -2
- package/dist/chunks/KU6B2OXP.js +0 -2
- package/dist/chunks/X6JMSZBD.js +0 -6
- package/dist/chunks/ZZRRJOEP.js +0 -2
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
export interface PalbaseProviderOptions {
|
|
2
|
+
/** Base project URL (e.g. https://<ref>.palbase.studio); defaults to process.env.PALBASE_URL. */
|
|
3
|
+
url?: string;
|
|
4
|
+
/** Project secret key (pb_<ref>_s...); defaults to process.env.PALBASE_SECRET_KEY. */
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
/** Custom fetch implementation (useful for tests or edge runtimes). */
|
|
7
|
+
fetch?: typeof globalThis.fetch;
|
|
8
|
+
/** Extra headers appended to every gateway request. */
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
export interface PalbaseModelSettings {
|
|
12
|
+
/** Routes into Palbase's single engine with persistent memory, compaction, and live Studio visibility. */
|
|
13
|
+
sessionId?: string;
|
|
14
|
+
/** Runs a defined Palbase agent on the single engine. */
|
|
15
|
+
agent?: string;
|
|
16
|
+
/** End-user identifier for attribution and per-user budgets. */
|
|
17
|
+
userId?: string;
|
|
18
|
+
/** Binds an encrypted workspace to the stateful run. */
|
|
19
|
+
workspaceId?: string;
|
|
20
|
+
/** Ordered explicit fallback models used only before first byte on 429/5xx. */
|
|
21
|
+
fallbacks?: string[];
|
|
22
|
+
}
|
|
23
|
+
export interface PalbasePromptMessage {
|
|
24
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
25
|
+
content: string | Array<{
|
|
26
|
+
type: string;
|
|
27
|
+
text?: string;
|
|
28
|
+
toolCallId?: string;
|
|
29
|
+
toolName?: string;
|
|
30
|
+
input?: unknown;
|
|
31
|
+
output?: unknown;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
export interface PalbaseLanguageCallOptions {
|
|
35
|
+
prompt: PalbasePromptMessage[];
|
|
36
|
+
maxOutputTokens?: number;
|
|
37
|
+
temperature?: number;
|
|
38
|
+
topP?: number;
|
|
39
|
+
tools?: Array<{
|
|
40
|
+
type: 'function';
|
|
41
|
+
name: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
inputSchema?: Record<string, unknown>;
|
|
44
|
+
}>;
|
|
45
|
+
abortSignal?: AbortSignal;
|
|
46
|
+
headers?: Record<string, string>;
|
|
47
|
+
}
|
|
48
|
+
export interface PalbaseGenerateResult {
|
|
49
|
+
content: Array<{
|
|
50
|
+
type: 'text';
|
|
51
|
+
text: string;
|
|
52
|
+
} | {
|
|
53
|
+
type: 'tool-call';
|
|
54
|
+
toolCallId: string;
|
|
55
|
+
toolName: string;
|
|
56
|
+
input: string;
|
|
57
|
+
}>;
|
|
58
|
+
finishReason: 'stop' | 'length' | 'tool-calls' | 'error' | 'unknown';
|
|
59
|
+
usage: {
|
|
60
|
+
inputTokens: number;
|
|
61
|
+
outputTokens: number;
|
|
62
|
+
totalTokens: number;
|
|
63
|
+
};
|
|
64
|
+
warnings: unknown[];
|
|
65
|
+
}
|
|
66
|
+
export type PalbaseStreamPart = {
|
|
67
|
+
type: 'text-delta';
|
|
68
|
+
id: string;
|
|
69
|
+
delta: string;
|
|
70
|
+
} | {
|
|
71
|
+
type: 'tool-call';
|
|
72
|
+
toolCallId: string;
|
|
73
|
+
toolName: string;
|
|
74
|
+
input: string;
|
|
75
|
+
} | {
|
|
76
|
+
type: 'finish';
|
|
77
|
+
finishReason: PalbaseGenerateResult['finishReason'];
|
|
78
|
+
usage: PalbaseGenerateResult['usage'];
|
|
79
|
+
} | {
|
|
80
|
+
type: 'error';
|
|
81
|
+
error: unknown;
|
|
82
|
+
};
|
|
83
|
+
export interface PalbaseLanguageModel {
|
|
84
|
+
readonly specificationVersion: 'v2';
|
|
85
|
+
readonly provider: 'palbase';
|
|
86
|
+
readonly modelId: string;
|
|
87
|
+
doGenerate(options: PalbaseLanguageCallOptions): Promise<PalbaseGenerateResult>;
|
|
88
|
+
doStream(options: PalbaseLanguageCallOptions): Promise<{
|
|
89
|
+
stream: ReadableStream<PalbaseStreamPart>;
|
|
90
|
+
}>;
|
|
91
|
+
}
|
|
92
|
+
export interface PalbaseEmbeddingModel {
|
|
93
|
+
readonly specificationVersion: 'v2';
|
|
94
|
+
readonly provider: 'palbase';
|
|
95
|
+
readonly modelId: string;
|
|
96
|
+
readonly maxEmbeddingsPerCall: number;
|
|
97
|
+
doEmbed(options: {
|
|
98
|
+
values: string[];
|
|
99
|
+
abortSignal?: AbortSignal;
|
|
100
|
+
}): Promise<{
|
|
101
|
+
embeddings: number[][];
|
|
102
|
+
usage: {
|
|
103
|
+
tokens: number;
|
|
104
|
+
};
|
|
105
|
+
}>;
|
|
106
|
+
}
|
|
107
|
+
export interface PalbaseImageModel {
|
|
108
|
+
readonly specificationVersion: 'v2';
|
|
109
|
+
readonly provider: 'palbase';
|
|
110
|
+
readonly modelId: string;
|
|
111
|
+
doGenerate(options: {
|
|
112
|
+
prompt: string;
|
|
113
|
+
n?: number;
|
|
114
|
+
size?: string;
|
|
115
|
+
abortSignal?: AbortSignal;
|
|
116
|
+
}): Promise<{
|
|
117
|
+
images: string[];
|
|
118
|
+
warnings: unknown[];
|
|
119
|
+
}>;
|
|
120
|
+
}
|
|
121
|
+
export interface PalbaseTranscriptionModel {
|
|
122
|
+
readonly specificationVersion: 'v1';
|
|
123
|
+
readonly provider: 'palbase';
|
|
124
|
+
readonly modelId: string;
|
|
125
|
+
doGenerate(options: {
|
|
126
|
+
audio: Uint8Array;
|
|
127
|
+
mediaType: string;
|
|
128
|
+
language?: string;
|
|
129
|
+
diarization?: boolean;
|
|
130
|
+
abortSignal?: AbortSignal;
|
|
131
|
+
}): Promise<{
|
|
132
|
+
text: string;
|
|
133
|
+
language?: string;
|
|
134
|
+
durationInSeconds?: number;
|
|
135
|
+
segments: Array<{
|
|
136
|
+
speaker?: string;
|
|
137
|
+
startSecond: number;
|
|
138
|
+
endSecond: number;
|
|
139
|
+
text: string;
|
|
140
|
+
}>;
|
|
141
|
+
}>;
|
|
142
|
+
}
|
|
143
|
+
export interface PalbaseSpeechModel {
|
|
144
|
+
readonly specificationVersion: 'v1';
|
|
145
|
+
readonly provider: 'palbase';
|
|
146
|
+
readonly modelId: string;
|
|
147
|
+
doGenerate(options: {
|
|
148
|
+
text: string;
|
|
149
|
+
voice?: string;
|
|
150
|
+
outputFormat?: string;
|
|
151
|
+
speed?: number;
|
|
152
|
+
abortSignal?: AbortSignal;
|
|
153
|
+
}): Promise<{
|
|
154
|
+
audio: Uint8Array;
|
|
155
|
+
mediaType: string;
|
|
156
|
+
}>;
|
|
157
|
+
}
|
|
158
|
+
export interface PalbaseProvider {
|
|
159
|
+
(modelId: string, settings?: PalbaseModelSettings): PalbaseLanguageModel;
|
|
160
|
+
languageModel(modelId: string, settings?: PalbaseModelSettings): PalbaseLanguageModel;
|
|
161
|
+
textEmbeddingModel(modelId: string): PalbaseEmbeddingModel;
|
|
162
|
+
image(modelId: string): PalbaseImageModel;
|
|
163
|
+
transcription(modelId: string): PalbaseTranscriptionModel;
|
|
164
|
+
speech(modelId: string): PalbaseSpeechModel;
|
|
165
|
+
}
|
|
166
|
+
export declare function createPalbase(options?: PalbaseProviderOptions): PalbaseProvider;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AttestedDevice as AttestedDeviceOf } from './attest.js';
|
|
2
2
|
import 'reflect-metadata';
|
|
3
3
|
import type { EventType, PalbaseEvent } from '../../server/src/index.js';
|
|
4
|
+
import type { PalbaseBucketOption } from './stack.js';
|
|
4
5
|
import type { UserT } from './engine.js';
|
|
5
6
|
import type { UploadConfig } from './upload.js';
|
|
6
7
|
/** A validator the framework runs: any Standard Schema (zod, valibot, arktype, …). */
|
|
@@ -47,12 +48,6 @@ export interface AuthConfig {
|
|
|
47
48
|
* the app steps the user up and calls again. Implies a signed-in user.
|
|
48
49
|
*/
|
|
49
50
|
maxAge?: number;
|
|
50
|
-
/**
|
|
51
|
-
* Palbase checks no role or permission: a route naming one is refused at
|
|
52
|
-
* boot, so none runs believing it was checked — check the role in the service.
|
|
53
|
-
*/
|
|
54
|
-
role?: string;
|
|
55
|
-
permission?: string;
|
|
56
51
|
}
|
|
57
52
|
export type AuthSpec = boolean | Partial<AuthConfig>;
|
|
58
53
|
export interface RateLimitConfig {
|
|
@@ -143,7 +138,6 @@ export declare const User: () => ParameterDecorator;
|
|
|
143
138
|
export declare const OptionalUser: () => ParameterDecorator;
|
|
144
139
|
export declare const Req: () => ParameterDecorator;
|
|
145
140
|
export declare const RequestId: () => ParameterDecorator;
|
|
146
|
-
export declare const TraceId: () => ParameterDecorator;
|
|
147
141
|
export declare const Client: () => ParameterDecorator;
|
|
148
142
|
/**
|
|
149
143
|
* The device whose proof auth verified for this call ({ id, platform }), on a
|
|
@@ -187,7 +181,7 @@ export declare function Module(def: ModuleDef): ClassDecorator;
|
|
|
187
181
|
export declare const PLATFORM_EVENT: RegExp;
|
|
188
182
|
/**
|
|
189
183
|
* What a method under @On(event) may be. For a type the modules' contracts
|
|
190
|
-
* declare (x-palbase-events:
|
|
184
|
+
* declare (x-palbase-events: iap.entitlement.changed, payments.payment.succeeded, …) it takes
|
|
191
185
|
* PalbaseEvent's member of that type — its data as the contract says — and
|
|
192
186
|
* the delivery's meta: a handler that reads another payload is a compile
|
|
193
187
|
* error. For any other type (user.deleted, a third party's in a @Webhook
|
|
@@ -205,7 +199,7 @@ export interface OnOptions {
|
|
|
205
199
|
* the machine when no handler of their type takes every bucket. Left out,
|
|
206
200
|
* every bucket's.
|
|
207
201
|
*/
|
|
208
|
-
bucket?:
|
|
202
|
+
bucket?: PalbaseBucketOption;
|
|
209
203
|
}
|
|
210
204
|
/** One @On: the event it takes, its method, and the bucket a storage event's is kept to. */
|
|
211
205
|
export interface EventDeclaration {
|
|
@@ -56,6 +56,11 @@ export interface KeyedRequest {
|
|
|
56
56
|
uri: string;
|
|
57
57
|
body: Uint8Array;
|
|
58
58
|
}
|
|
59
|
+
interface Kept {
|
|
60
|
+
status: number;
|
|
61
|
+
headers: [string, string][];
|
|
62
|
+
body: string | null;
|
|
63
|
+
}
|
|
59
64
|
/** How the engine answers: its refusals' envelope, a failure's answer, and whether the handler had begun. */
|
|
60
65
|
export interface Answers {
|
|
61
66
|
requestId: string;
|
|
@@ -133,4 +138,17 @@ export declare class IdempotencyKeys {
|
|
|
133
138
|
private releaseOnce;
|
|
134
139
|
private asService;
|
|
135
140
|
}
|
|
141
|
+
/** Records the already-materialized bytes of a framework-built Response so capture() skips stream reading. */
|
|
142
|
+
export declare function knownBody(res: Response, bytes: Uint8Array | null): Response;
|
|
143
|
+
/**
|
|
144
|
+
* An answer as it is kept, and the Response that sends it. Its body is read
|
|
145
|
+
* here while it is there, up to the most kept: one that ended is kept whole.
|
|
146
|
+
* One still being produced (a stream, which may never end — the request's
|
|
147
|
+
* transaction does not wait for it) or past the most kept is sent as it
|
|
148
|
+
* comes, and its status and headers alone are kept.
|
|
149
|
+
*/
|
|
150
|
+
export declare function capture(res: Response): Promise<{
|
|
151
|
+
response: Response;
|
|
152
|
+
kept: Kept;
|
|
153
|
+
}>;
|
|
136
154
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
|
-
export { AttestedDevice, Body, Client, Controller, Delete, Get, getRegisteredControllers, getRoutes, Headers, Cron, Injectable, Module, On, OptionalUser, Param, Patch, Post, Put, Query, QueryParams, Req, RequestId, Resolve,
|
|
2
|
+
export { AttestedDevice, Body, Client, Controller, Delete, Get, getRegisteredControllers, getRoutes, Headers, Cron, Injectable, Module, On, OptionalUser, Param, Patch, Post, Put, Query, QueryParams, Req, RequestId, Resolve, User, Webhook, type AuthConfig, type AuthSpec, type ControllerOptions, type EventHandler, type CronMeta, type CronOptions, type ModuleDef, type OnOptions, type ParamResolver, type RateLimit, type RateLimitConfig, type ResolveContext, type RouteInfo, type RouteOptions, type SignatureSpec, type StandardSchemaV1, type Token, type WebhookOptions, type WebhookProvider, } from './decorators.js';
|
|
3
3
|
export { Task, TaskFailure, Tasks, type EnqueueOptions, type PayloadOf, type QueuedTask, type TaskClass, type TaskMeta, type TaskOptions, type TasksService } from './tasks.js';
|
|
4
4
|
export { TestUserTemplate, type TemplateMeta, type TemplateUser, type TestUserTemplateClass, type TestUserTemplateOptions } from './test-user-templates.js';
|
|
5
5
|
export { Upload, UploadedObject, type UploadConfig } from './upload.js';
|
|
@@ -206,7 +206,7 @@ export interface PalbaseClearAllOverridesResult {
|
|
|
206
206
|
}
|
|
207
207
|
export interface PalbaseBatchOverrideOperation {
|
|
208
208
|
userId: string;
|
|
209
|
-
values: Record<
|
|
209
|
+
values: Partial<Record<PalbaseFlagKey, PalbaseFlagValue>>;
|
|
210
210
|
}
|
|
211
211
|
export interface PalbaseBatchSetOverridesResult {
|
|
212
212
|
applied: number;
|
|
@@ -214,7 +214,7 @@ export interface PalbaseBatchSetOverridesResult {
|
|
|
214
214
|
/** Any user's values, by id — the writes of a service, not of the user it serves. */
|
|
215
215
|
export interface PalbaseFlagsServiceClient {
|
|
216
216
|
setOverrideForUser(userId: string, key: PalbaseFlagKey, value: PalbaseFlagValue): Answer<PalbaseSetOverrideResult>;
|
|
217
|
-
setOverridesForUser(userId: string, values: Record<
|
|
217
|
+
setOverridesForUser(userId: string, values: Partial<Record<PalbaseFlagKey, PalbaseFlagValue>>): Answer<PalbaseSetOverridesResult>;
|
|
218
218
|
clearOverrideForUser(userId: string, key: PalbaseFlagKey): Answer<PalbaseClearOverrideResult>;
|
|
219
219
|
clearAllOverridesForUser(userId: string): Answer<PalbaseClearAllOverridesResult>;
|
|
220
220
|
/** 1000 operations at most. */
|
|
@@ -11,10 +11,8 @@ export interface BucketTypes {
|
|
|
11
11
|
/** The project's buckets, by name, each with its renditions. */
|
|
12
12
|
export interface Buckets {
|
|
13
13
|
}
|
|
14
|
-
/** The project's roles, by name. */
|
|
15
|
-
export interface Roles {
|
|
16
|
-
}
|
|
17
14
|
export type PalbaseSecretName = keyof Secrets & string;
|
|
18
15
|
export type PalbaseFlagKey = keyof Flags & string;
|
|
19
16
|
export type PalbaseBucketName = keyof Buckets & string;
|
|
20
|
-
|
|
17
|
+
/** Strict bucket union when `palbase types:pull` has populated `Buckets`, else `string`. */
|
|
18
|
+
export type PalbaseBucketOption = [PalbaseBucketName] extends [never] ? string : PalbaseBucketName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { StringsTable } from './i18n.js';
|
|
2
2
|
export declare const STRINGS_DIR = "palbase/strings";
|
|
3
|
-
/** The format this writes and
|
|
3
|
+
/** The format this writes and reads. */
|
|
4
4
|
export declare const STRINGS_FORMAT = 3;
|
|
5
5
|
/** A language tag as Intl writes it (en, en-US, zh-Hans): the form a request's languages are matched in. */
|
|
6
6
|
export declare function canonicalLanguage(tag: string): string | undefined;
|
|
@@ -11,10 +11,10 @@ export interface StringsFiles {
|
|
|
11
11
|
languages: Map<string, Map<string, string>>;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* palbase/strings/ under `root` read
|
|
15
|
-
*
|
|
14
|
+
* palbase/strings/ under `root` read and checked: every file checked, and a
|
|
15
|
+
* file that breaks a rule is named, with the rule. Undefined when there is none.
|
|
16
16
|
*/
|
|
17
|
-
export declare function readStringsFiles(root: string
|
|
17
|
+
export declare function readStringsFiles(root: string): Promise<StringsFiles | undefined>;
|
|
18
18
|
/** The table under `root` (the app's directory) the running app answers t() from, or undefined when it has none. */
|
|
19
19
|
export declare function loadStringsTable(root: string): Promise<StringsTable | undefined>;
|
|
20
20
|
/** One language file's text: its sentences in order, each with its translation, as JSON written for people to edit. */
|
|
@@ -23,8 +23,7 @@ export declare function stringsFileText(translations: ReadonlyMap<string, string
|
|
|
23
23
|
* palbase/strings/ under `root` written as `source` and `languages` (each with every key of `order`, in that
|
|
24
24
|
* order), each file written beside itself and renamed into place, a language file no longer in `languages`
|
|
25
25
|
* removed. A run cut short leaves a table the next one reads: a new table's _meta.json is written first (its
|
|
26
|
-
* language files come with it), an existing one's last
|
|
27
|
-
* already wrote — readStringsFiles takes a plain translation there too). The files whose text changed, by name;
|
|
26
|
+
* language files come with it), an existing one's last. The files whose text changed, by name;
|
|
28
27
|
* a file that differs only in its line endings (a checkout's CRLF) is not one.
|
|
29
28
|
*/
|
|
30
29
|
export declare function writeStringsFiles(root: string, source: string, languages: ReadonlyMap<string, ReadonlyMap<string, string>>, order: readonly string[]): Promise<string[]>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type RouteOptions } from './decorators.js';
|
|
2
2
|
import type { Route } from './router.js';
|
|
3
3
|
import { type SignedUser } from './platform-calls.js';
|
|
4
|
+
import type { PalbaseBucketOption } from './stack.js';
|
|
4
5
|
/** Where an @Upload route's files go. */
|
|
5
6
|
export interface UploadConfig {
|
|
6
7
|
/**
|
|
@@ -9,7 +10,7 @@ export interface UploadConfig {
|
|
|
9
10
|
* its renditions — are the bucket's, and storage holds every upload to them
|
|
10
11
|
* as it writes: the one check a client cannot step around.
|
|
11
12
|
*/
|
|
12
|
-
bucket:
|
|
13
|
+
bucket: PalbaseBucketOption;
|
|
13
14
|
/**
|
|
14
15
|
* The object's path, made here for each upload — the client never chooses
|
|
15
16
|
* it. `{userId}` is the signed-in user's id ("anonymous" for nobody),
|
|
@@ -2,16 +2,17 @@ import * as modules from '../../../internal/src/modules/index.js';
|
|
|
2
2
|
import type { Transport } from '../../../internal/src/transport.js';
|
|
3
3
|
/** A project's environment as an access token reaches it: each module's operations under the paths the edge opens to one, a server's calls. */
|
|
4
4
|
export interface Project {
|
|
5
|
-
ai: Pick<modules.ai.Client, "draftAgent" | "listAgents" | "getAgent" | "putAgent" | "deleteAgent" | "publishAgent" | "rollbackAgent" | "listAgentVersions" | "listChats" | "createChat" | "getChat" | "deleteChat" | "decideChatApproval" | "forkChat" | "getChatGoal" | "setChatGoal" | "clearChatGoal" | "updateChatGoal" | "putChatMember" | "deleteChatMember" | "listChatMessages" | "sendChatMessage" | "getChatMessageAttachment" | "listChatParts" | "putChatPipe" | "deleteChatPipe" | "sendSubagentMessage" | "stopSubagent" | "stopChat" | "listTurnToolCalls" | "getChatToolCall" | "answerChatToolCall" | "listChatTurnArtifacts" | "getChatTurnArtifact" | "getChatTurnCost" | "startChatVoice" | "getChatVoice" | "closeChatVoice" | "commandChatVoice" | "
|
|
5
|
+
ai: Pick<modules.ai.Client, "draftAgent" | "listAgents" | "getAgent" | "putAgent" | "deleteAgent" | "publishAgent" | "rollbackAgent" | "listAgentVersions" | "createAudioSpeech" | "createAudioTranscription" | "listChats" | "createChat" | "getChat" | "deleteChat" | "decideChatApproval" | "getChatExecution" | "patchChatExecution" | "forkChat" | "getChatGoal" | "setChatGoal" | "clearChatGoal" | "updateChatGoal" | "handoffChat" | "putChatMember" | "deleteChatMember" | "listChatMessages" | "sendChatMessage" | "getChatMessageAttachment" | "listChatParts" | "putChatPipe" | "deleteChatPipe" | "sendSubagentMessage" | "stopSubagent" | "stopChat" | "listTurnToolCalls" | "getChatToolCall" | "answerChatToolCall" | "listChatTurnArtifacts" | "getChatTurnArtifact" | "getChatTurnCost" | "startChatVoice" | "getChatVoice" | "closeChatVoice" | "commandChatVoice" | "createEmbeddings" | "listEndpoints" | "putEndpoint" | "deleteEndpoint" | "listEnv" | "listEnvAllowances" | "deleteEnvAllowance" | "listEnvHostRequests" | "allowEnvHostRequest" | "dismissEnvHostRequest" | "putEnv" | "deleteEnv" | "allowEnvHost" | "listEnvironments" | "createEnvironment" | "getEnvironment" | "putEnvironment" | "deleteEnvironment" | "createEnvironmentBuild" | "getEnvironmentBuild" | "createImage" | "getImage" | "getImageFile" | "deleteMachine" | "cordonMachine" | "resumeMachine" | "listModels" | "revokePoolKey" | "listPools" | "createPool" | "deletePool" | "listPoolKeys" | "createPoolKey" | "getPoolState" | "listProviders" | "connectProvider" | "disconnectProvider" | "createResponse" | "getResponse" | "cancelResponse" | "followResponse" | "getSettings" | "putSettings" | "getSpend" | "askSupport" | "listTools" | "listUsage" | "gatewayAudioSpeech" | "gatewayAudioTranscriptions" | "gatewayChatCompletions" | "gatewayEmbeddings" | "gatewayImagesGenerations" | "gatewayAnthropicMessages" | "gatewayListModels" | "gatewayResponses" | "createVideo" | "getVideo" | "cancelVideo">;
|
|
6
6
|
analytics: Pick<modules.analytics.Client, "listAudiences" | "createAudience" | "previewAudience" | "getAudience" | "deleteAudience" | "updateAudience" | "listAudienceMembers" | "alias" | "batch" | "getEventBreakdown" | "capture" | "sendConsoleHistory" | "getConsoleConfig" | "listConsoleRecords" | "listEventNames" | "listEvents" | "getEventTimeline" | "runFunnel" | "identify" | "page" | "sendPerf" | "listPerfGroups" | "getPerfConfig" | "getPerfTimeline" | "listRequestLines" | "getMachineTraffic" | "runRetention" | "screen" | "getSettings" | "putSettings" | "getSummary" | "listTraces" | "sendTrace" | "sendTraceBatch" | "getTraceHops" | "listSessionTraces" | "getTraceSummary" | "getTraceTimeline" | "searchPeople" | "setPersonProperties" | "getPerson" | "listPersonEvents" | "getEventCatalog" | "defineEvent">;
|
|
7
7
|
auth: Pick<modules.auth.Client, "adminVerifyDeviceAssertion" | "adminGetAttestPolicy" | "adminGetAttestObservations" | "adminRecordAttestObservations" | "adminListAuditEvents" | "adminExportAuditEvents" | "adminVerifyAuditTrail" | "adminGetAuthSettings" | "adminUpdateAuthSettings" | "adminGetBreachWatch" | "adminListHooks" | "adminCreateHook" | "adminUpdateHook" | "adminDeleteHook" | "adminListHookExecutions" | "adminListIntegrations" | "adminPutIntegration" | "adminDeleteIntegration" | "adminListOAuthClients" | "adminCreateOAuthClient" | "adminGetOAuthClient" | "adminDeleteOAuthClient" | "adminUpdateOAuthClient" | "adminListProviders" | "adminGetPhoneSettings" | "adminUpdatePhoneSettings" | "adminToggleProvider" | "adminListRoles" | "adminUpsertRole" | "adminDeleteRole" | "adminListServiceAccounts" | "adminCreateServiceAccount" | "adminGetServiceAccount" | "adminRevokeServiceAccount" | "adminRotateServiceAccount" | "adminListSessions" | "adminRevokeSession" | "adminListSigningKeys" | "adminRotateSigningKey" | "socialAdminConfig" | "socialCredentialPut" | "socialCredentialDelete" | "socialProviderPatch" | "adminGetStats" | "adminSendTestTemplate" | "adminListTestUsers" | "adminCreateTestUsers" | "adminSetTestUserPhone" | "adminCreateTestSignupAddress" | "adminDeleteTestUser" | "adminCreateCustomToken" | "adminListUsers" | "adminCreateUser" | "adminImportUsers" | "adminGetUser" | "adminDeleteUser" | "adminUpdateUser" | "adminBanUser" | "adminGetUserConsents" | "adminRevokeUserCredentials" | "adminExportUser" | "adminListUserMfaFactors" | "adminResetUserMfa" | "adminResetUserPassword" | "adminListUserRoles" | "adminAssignUserRole" | "adminRevokeUserRole" | "adminRevokeUserSessions" | "adminUnbanUser" | "adminGetInstallationConsents" | "adminRefuseConsents" | "adminInviteUser">;
|
|
8
8
|
calls: Pick<modules.calls.Client, "adminListCalls" | "adminGetCall" | "adminEndCall" | "createCallTicket" | "getCallSettings" | "putCallSettings" | "rotateCallHookSecret">;
|
|
9
9
|
flags: Pick<modules.flags.Client, "getValues" | "batchUserValues" | "getDelta" | "getEvaluations" | "listExperiments" | "startExperiment" | "getExperiment" | "getExperimentResults" | "stopExperiment" | "declareExperimentWinner" | "getCurrentInstallations" | "getInstallationsDaily" | "getSnapshot" | "listDefinitions" | "getDefinition" | "putDefinition" | "deleteDefinition" | "activateTemplates" | "getActiveTemplate" | "getTemplateCapabilities" | "getTemplateDraft" | "createTemplateDraft" | "discardTemplateDraft" | "putTemplateParameter" | "removeTemplateParameter" | "reviewTemplateDraft" | "publishTemplate" | "getPublishReceipt" | "restoreTemplateVersion" | "listTemplateVersions" | "getTemplateVersion" | "getUserValues" | "putUserValues" | "deleteUserValues" | "putUserValue" | "deleteUserValue">;
|
|
10
|
+
iap: Pick<modules.iap.Client, "getAppleAccount" | "disconnectApple" | "createAppleGrant" | "getAppleReadiness" | "setXcodeCertificate" | "clearXcodeCertificate" | "setXcodeOfferKey" | "getCatalog" | "saveCatalog" | "planCatalog" | "getCatalogPlan" | "confirmCatalogPlan" | "declineCatalogPlan" | "listCatalogRevisions" | "getCatalogRevision" | "restoreCatalogRevision" | "validateCatalog" | "listCharts" | "getChartsOverview" | "getChart" | "createCheckout" | "createCheckoutRedemption" | "listCoupons" | "createCoupon" | "getCoupon" | "revokeCoupon" | "listCouponCodes" | "searchCustomers" | "getCustomer" | "grantCredits" | "listCreditEntries" | "forgiveCredits" | "listCustomerGrants" | "grantEntitlement" | "revokeGrant" | "getCustomerHistory" | "holdSpend" | "setCustomerLimit" | "clearCustomerLimit" | "grantLimit" | "spend" | "commitSpend" | "extendHold" | "releaseSpend" | "reverseSpend" | "cancelSubscription" | "extendSubscription" | "refundSubscription" | "listExperiments" | "startExperiment" | "getExperiment" | "getExperimentResults" | "stopExperiment" | "declareExperimentWinner" | "getGoogleAccount" | "connectGoogle" | "disconnectGoogle" | "getOfferings" | "getOfferStats" | "listPaywalls" | "createPaywall" | "listPaywallAssets" | "registerPaywallAsset" | "deletePaywallAsset" | "listPaywallTemplates" | "getPaywallTemplateAsset" | "validatePaywall" | "getPaywall" | "deletePaywall" | "savePaywallDraft" | "publishPaywall" | "listPaywallVersions" | "getPaywallVersion" | "listPlacements" | "listAttributeKeys" | "setPlacement" | "deletePlacement" | "recordPaywallExposure" | "getPlacementPaywall" | "previewPlacement" | "getPlacementResults" | "getPlacementRules" | "setPlacementRules" | "getSettings" | "updateSettings">;
|
|
10
11
|
journeys: Pick<modules.journeys.Client, "listJourneys" | "createJourney" | "listPersonRuns" | "simulateJourney" | "validateJourney" | "getJourney" | "updateJourney" | "deleteJourney" | "copyJourney" | "publishJourney" | "listJourneyRuns" | "getJourneyStats" | "stopJourney" | "testJourney">;
|
|
11
12
|
machines: Pick<modules.machines.Client, "listMachines" | "createMachine" | "listMachineSizes" | "getMachineNetwork" | "connectGitHub" | "listInstallations" | "linkInstallation" | "shareInstallation" | "unlinkInstallation" | "listRepositories" | "getMachine" | "deleteMachine" | "updateMachine" | "listBuilds" | "deployMachine" | "listMachinePreviews" | "putMachinePreview" | "deleteMachinePreview" | "listMachineDomains" | "addMachineDomain" | "deleteMachineDomain" | "updateMachineDomain" | "getBuild" | "getBuildLog" | "rollbackMachine" | "listDatabases" | "createDatabase" | "listDatabaseSizes" | "getDatabase" | "deleteDatabase" | "updateDatabase" | "undeleteDatabase" | "purgeDatabase" | "getDatabaseCredentials" | "changeDatabasePassword" | "readMachineLogs" | "execInMachine" | "listMachineExecs" | "getMachineMetrics" | "getMachineContract" | "restoreDatabase" | "getDatabaseSchema" | "getDatabaseMetrics" | "queryDatabase" | "listCrons" | "listCronRuns" | "runCron" | "pauseCron" | "resumeCron" | "listTasks" | "enqueueTask" | "getTask" | "cancelTask" | "retryTask" | "listTaskTypes" | "makeTemplatedTestUsers" | "templateTestUser" | "deleteTemplatedTestUser" | "listSites" | "createSite" | "getSite" | "deleteSite" | "updateSite" | "listSiteReleases" | "createSiteRelease" | "uploadSiteFile" | "finishSiteRelease" | "rollbackSite" | "listSiteBuilds" | "deploySite" | "listSitePreviews" | "listSiteDomains" | "addSiteDomain" | "deleteSiteDomain" | "updateSiteDomain" | "getSiteBuild" | "authorizeSitePreview" | "authorizeMachinePreview" | "openMachinePreview" | "moveMachine" | "moveSite" | "moveDatabase" | "cancelSiteBuild" | "cancelBuild" | "listSiteHooks" | "createSiteHook" | "deleteSiteHook" | "listMachineHooks" | "createMachineHook" | "deleteMachineHook" | "detectProject" | "createPreviewPass" | "listPreviewLinks" | "createPreviewLink" | "deletePreviewLink" | "listEnvironmentDomains" | "addEnvironmentDomain" | "deleteEnvironmentDomain" | "setEnvironmentSignInDomain">;
|
|
12
13
|
messaging: Pick<modules.messaging.Client, "adminAccessLog" | "adminListConversations" | "adminCreateConversation" | "adminGetConversation" | "adminDeleteConversation" | "adminUpdateConversation" | "adminAddMembers" | "adminRemoveMember" | "adminListMessages" | "adminSendMessage" | "adminDeleteMessage" | "adminFileUrl" | "adminPutProfile" | "adminListReports" | "adminGetReport" | "adminReportFileUrl" | "adminResolveReport" | "getSettings" | "putSettings" | "rotateHookSecret">;
|
|
13
14
|
notify: Pick<modules.notify.Client, "getDeliverability" | "listDevices" | "getDeviceStats" | "deleteMyDevice" | "sendEmail" | "listInAppCampaigns" | "createInAppCampaign" | "getInAppCampaign" | "putInAppCampaign" | "deleteInAppCampaign" | "getInAppCampaignStats" | "listInAppTemplates" | "sendInbox" | "listInboxMessages" | "listNotifyMessages" | "getNotifyMessage" | "cancelMessage" | "getMetricsSummary" | "listNotifyProviders" | "putNotifyProvider" | "deleteNotifyProvider" | "sendPush" | "getNotifySettings" | "putNotifySettings" | "sendSms" | "listEmailTemplates" | "getEmailTemplate" | "putEmailTemplate" | "deleteEmailTemplate" | "listPushTemplates" | "getPushTemplate" | "putPushTemplate" | "deletePushTemplate" | "listSmsTemplates" | "getSmsTemplate" | "putSmsTemplate" | "deleteSmsTemplate" | "listWhatsAppTemplates" | "getWhatsAppTemplate" | "putWhatsAppTemplate" | "deleteWhatsAppTemplate" | "listTestUserMessages" | "listTopics" | "createTopic" | "deleteTopic" | "changeTopic" | "addTopicSubscribers" | "removeTopicSubscriber" | "listUserDevices" | "getUserPreferences" | "setUserPreferences" | "startVerification" | "checkVerification" | "getWebPushStatus" | "sendWhatsApp" | "listWhatsAppInbound">;
|
|
14
|
-
|
|
15
|
+
payments: Pick<modules.payments.Client, "auditCashFlow" | "auditDrift" | "auditLedger" | "exportAuditLedgerCsv" | "getCapabilities" | "listChannels" | "connectChannel" | "createChannelGrant" | "getChannel" | "deleteChannel" | "checkChannel" | "setDefaultChannel" | "listDisputes" | "lookupInstallments" | "listIntents" | "createIntent" | "getIntent" | "listIntentAttempts" | "cancelIntent" | "captureIntent" | "confirmIntent" | "submitIntentOtp" | "listRefunds" | "createRefund" | "listRoutingRules" | "replaceRoutingRules" | "getSettings" | "updateSettings" | "createStripeAppGrant" | "listSubscriptions" | "createSubscription" | "cancelSubscription" | "extendSubscription" | "listWallets" | "upsertWallet" | "chargeWallet" | "creditWallet" | "getCustomerWallets" | "freezeWallet" | "createWalletHold" | "commitWalletHold" | "releaseWalletHold" | "transferWallet">;
|
|
15
16
|
realtime: Pick<modules.realtime.Client, "broadcast" | "getChannels" | "putChannels" | "getLimits" | "putLimits" | "revalidate" | "writeState" | "getStats">;
|
|
16
17
|
secrets: Pick<modules.secrets.Client, "listSecretAudit" | "listFieldKeys" | "getFieldKeys" | "openFields" | "sealPlaceholder" | "rotateFieldKeys" | "listTransitKeys" | "getTransitKeys" | "getTransitPublicKeys" | "rotateTransitKeys" | "retireTransitKey" | "listSecrets" | "getEnvironmentValues" | "getSecret" | "putSecret" | "deleteSecret" | "rollbackSecret" | "listSecretVersions">;
|
|
17
18
|
storage: Pick<modules.storage.Client, "listBuckets" | "getBucket" | "putBucket" | "deleteBucket" | "copyObject" | "moveObject" | "listObjects" | "getObject" | "putObject" | "deleteObject" | "headObject" | "createSignedUrl" | "createUploadUrl" | "getStorageStats">;
|
|
@@ -1338,7 +1338,7 @@ export declare function client(t: Transport): {
|
|
|
1338
1338
|
id: string;
|
|
1339
1339
|
environment_ref: string;
|
|
1340
1340
|
name: string;
|
|
1341
|
-
scopes: ((("machines:read") | ("machines:logs") | ("machines:previews") | ("apps:sync") | ("auth:test-users") | "support")[]) | null;
|
|
1341
|
+
scopes: ((("machines:read") | ("machines:logs") | ("machines:previews") | ("machines:deploy") | ("sites:deploy") | ("secrets:read-names") | ("apps:sync") | ("auth:test-users") | "support")[]) | null;
|
|
1342
1342
|
role: ("admin" | "member") | null;
|
|
1343
1343
|
on_behalf_of: string | null;
|
|
1344
1344
|
hint: string;
|
|
@@ -1357,7 +1357,7 @@ export declare function client(t: Transport): {
|
|
|
1357
1357
|
};
|
|
1358
1358
|
body?: {
|
|
1359
1359
|
name?: string;
|
|
1360
|
-
scopes?: ("machines:read" | "machines:logs" | "machines:previews" | "apps:sync" | "auth:test-users" | "support")[];
|
|
1360
|
+
scopes?: ("machines:read" | "machines:logs" | "machines:previews" | "machines:deploy" | "sites:deploy" | "secrets:read-names" | "apps:sync" | "auth:test-users" | "support")[];
|
|
1361
1361
|
expires_in_minutes?: number;
|
|
1362
1362
|
role?: "member" | "admin";
|
|
1363
1363
|
on_behalf_of?: string;
|
|
@@ -1367,7 +1367,7 @@ export declare function client(t: Transport): {
|
|
|
1367
1367
|
id: string;
|
|
1368
1368
|
environment_ref: string;
|
|
1369
1369
|
name: string;
|
|
1370
|
-
scopes: ((("machines:read") | ("machines:logs") | ("machines:previews") | ("apps:sync") | ("auth:test-users") | "support")[]) | null;
|
|
1370
|
+
scopes: ((("machines:read") | ("machines:logs") | ("machines:previews") | ("machines:deploy") | ("sites:deploy") | ("secrets:read-names") | ("apps:sync") | ("auth:test-users") | "support")[]) | null;
|
|
1371
1371
|
role: ("admin" | "member") | null;
|
|
1372
1372
|
on_behalf_of: string | null;
|
|
1373
1373
|
hint: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatMessage, MessageAttachment } from './modules/ai.js';
|
|
1
|
+
import type { ChatMessage, ExecutionTarget, MessageAttachment, TargetSummary } from './modules/ai.js';
|
|
2
2
|
export type TurnStatus = 'running' | 'waiting' | 'completed' | 'failed' | 'canceled' | 'timed_out' | 'budget_exceeded';
|
|
3
3
|
export type WaitingReason = 'approval' | 'tool_output' | 'subagents' | 'message';
|
|
4
4
|
export type ToolStatus = 'running' | 'awaiting_output' | 'awaiting_approval' | 'approved' | 'denied' | 'expired' | 'completed' | 'failed' | 'canceled';
|
|
@@ -253,7 +253,59 @@ export interface TranscriptEvent {
|
|
|
253
253
|
final: boolean;
|
|
254
254
|
created_at: string;
|
|
255
255
|
}
|
|
256
|
-
|
|
256
|
+
/** A session teleported to a new compute or executor target: generation advanced atomically. */
|
|
257
|
+
export interface SessionHandedOffEvent {
|
|
258
|
+
type: 'session.handed_off';
|
|
259
|
+
seq: number;
|
|
260
|
+
chat_id: string;
|
|
261
|
+
generation: number;
|
|
262
|
+
from_target?: ExecutionTarget;
|
|
263
|
+
to_target: ExecutionTarget;
|
|
264
|
+
reason: string;
|
|
265
|
+
workspace_seq: number;
|
|
266
|
+
}
|
|
267
|
+
/** A target machine went online, offline, or waking — with failover_at when auto-failover is counting down. */
|
|
268
|
+
export interface SessionMachineStatusEvent {
|
|
269
|
+
type: 'session.machine_status';
|
|
270
|
+
seq: number;
|
|
271
|
+
chat_id: string;
|
|
272
|
+
machine_id: string;
|
|
273
|
+
status: 'online' | 'offline' | 'waking' | (string & {});
|
|
274
|
+
failover_at?: string | null;
|
|
275
|
+
}
|
|
276
|
+
/** Tier 1 compaction offloaded a bulky tool output to workspace/artifact storage and replaced it with a compact stub. */
|
|
277
|
+
export interface ContextOffloadedEvent {
|
|
278
|
+
type: 'context.offloaded';
|
|
279
|
+
seq: number;
|
|
280
|
+
call_id: string;
|
|
281
|
+
storage?: string;
|
|
282
|
+
ref?: string;
|
|
283
|
+
original_bytes?: number;
|
|
284
|
+
stub_bytes?: number;
|
|
285
|
+
}
|
|
286
|
+
/** Tier 3 compaction anchored earlier history into a structured summary while preserving project directives and attachments. */
|
|
287
|
+
export interface ContextCompactedEvent {
|
|
288
|
+
type: 'context.compacted';
|
|
289
|
+
seq: number;
|
|
290
|
+
format?: string;
|
|
291
|
+
messages_compacted?: number;
|
|
292
|
+
tokens_before?: number;
|
|
293
|
+
tokens_after?: number;
|
|
294
|
+
preserved_attachments_count?: number;
|
|
295
|
+
project_directives_count?: number;
|
|
296
|
+
cache_friendly?: boolean;
|
|
297
|
+
}
|
|
298
|
+
/** Live sidebar update broadcast on ai:sessions and ai:sessions:<user_id> (event: session.summary.v1). */
|
|
299
|
+
export interface SessionSummaryEvent {
|
|
300
|
+
chat_id: string;
|
|
301
|
+
run_status: 'idle' | 'running' | 'awaiting_approval' | 'awaiting_tool' | 'offline_parked' | (string & {});
|
|
302
|
+
active_run_id?: string;
|
|
303
|
+
workspace_id?: string;
|
|
304
|
+
target_generation: number;
|
|
305
|
+
target_summary: TargetSummary;
|
|
306
|
+
updated_at: string;
|
|
307
|
+
}
|
|
308
|
+
export type ChatEvent = MessageEvent | TurnEvent | TextEvent | ResetEvent | ThinkingEvent | ToolEvent | AgentEvent | GoalEvent | HistoryEvent | VoiceEvent | TranscriptEvent | SessionHandedOffEvent | SessionMachineStatusEvent | ContextOffloadedEvent | ContextCompactedEvent;
|
|
257
309
|
/** A chat refusal of the module's, said in words its caller can act on; anything else (or one said already) as it was. */
|
|
258
310
|
export declare function chatRefusal(e: unknown): unknown;
|
|
259
311
|
/** The same promise, its chat refusals said as chatRefusal says them. */
|
|
@@ -264,3 +316,5 @@ export declare function told<T>(p: Promise<T>): Promise<T>;
|
|
|
264
316
|
* part, or one that is not a part at all.
|
|
265
317
|
*/
|
|
266
318
|
export declare function chatPart(payload: unknown): ChatEvent | undefined;
|
|
319
|
+
/** Decodes one `session.summary.v1` payload broadcast on `ai:sessions` or `ai:sessions:<user_id>`. */
|
|
320
|
+
export declare function sessionSummary(payload: unknown): SessionSummaryEvent | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface WebhookEvent<T = unknown, K extends string = string> {
|
|
2
2
|
/** Unique per event: the same id twice is the same event delivered again. */
|
|
3
3
|
id: string;
|
|
4
|
-
/** Dotted lowercase words, like
|
|
4
|
+
/** Dotted lowercase words, like iap.entitlement.changed or payments.payment.succeeded. */
|
|
5
5
|
type: K;
|
|
6
6
|
project_id: string;
|
|
7
7
|
created_at: string;
|