palbase 0.76.0 → 0.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/index.js +2 -2
- package/dist/ai-sdk/index.js +2 -2
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +3 -3
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/3I5XH3A3.js +13 -0
- package/dist/chunks/{MKVIRNSJ.js → 3X3ZT72M.js} +2 -2
- package/dist/chunks/{TGQGGUE6.js → 5H3UYFOC.js} +2 -2
- package/dist/chunks/5OBOVEK6.js +2 -0
- package/dist/chunks/{KEGVHELA.js → AKJC5WTU.js} +1 -1
- package/dist/chunks/{TUK6NH2Q.js → AMKY4SZU.js} +2 -2
- package/dist/chunks/B64J3E3T.js +2 -0
- package/dist/chunks/{5RNXCTOO.js → EFELMJMQ.js} +2 -2
- package/dist/chunks/{ZCMCYI2D.js → FOZVJW7G.js} +2 -2
- package/dist/chunks/{BRDO3ZPT.js → HHKRAOVG.js} +1 -1
- package/dist/chunks/{ISMWEEGW.js → HVRVTNMI.js} +1 -1
- package/dist/chunks/{SVWF7ABJ.js → JSRN4NOZ.js} +2 -2
- package/dist/chunks/{33XOVYAU.js → MA74JJUB.js} +4 -4
- package/dist/chunks/{UHN63FGH.js → MFWAOKLM.js} +2 -2
- package/dist/chunks/{PGQNRJ2C.js → NG4OMSEK.js} +2 -2
- package/dist/chunks/{5YJZAPY2.js → NQUAVRMC.js} +2 -2
- package/dist/chunks/{EXLA3A7O.js → Q3GH7I66.js} +2 -2
- package/dist/chunks/{3CN6HGTW.js → QL2UAO36.js} +1 -1
- package/dist/chunks/{DKYFIOWM.js → QOETZ4FB.js} +1 -1
- package/dist/chunks/RP2TPMXT.js +2 -0
- package/dist/chunks/S7C7NHZI.js +18 -0
- package/dist/chunks/{D6NOE76D.js → SHYJVOD2.js} +1 -1
- package/dist/chunks/{A3I7H7QN.js → VP3HFVV4.js} +1 -1
- package/dist/chunks/{UOW74IHY.js → XVJ3CMFN.js} +2 -2
- package/dist/chunks/{Q4UWBIJ6.js → YQQKZUVS.js} +2 -2
- package/dist/cli.js +243 -187
- package/dist/cloud/index.js +2 -2
- package/dist/refuse/ai-sdk.js +1 -1
- 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 +2 -2
- 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 +2 -2
- package/package.json +2 -2
- package/types/ai/src/ai.d.ts +6 -2
- package/types/ai/src/chats.d.ts +29 -10
- package/types/ai/src/index.d.ts +2 -2
- package/types/ai/src/pools.d.ts +15 -24
- package/types/cloud/src/generated/project.d.ts +3 -3
- package/types/cloud/src/generated/studio.d.ts +4 -6
- package/types/internal/src/ai-machines.d.ts +120 -0
- package/types/internal/src/chat.d.ts +29 -1
- package/types/internal/src/modules/ai.d.ts +192 -79
- package/types/internal/src/modules/analytics.d.ts +5 -1
- package/types/internal/src/modules/auth.d.ts +3 -28
- package/types/internal/src/modules/commerce.d.ts +92 -13
- package/types/internal/src/modules/events.d.ts +2 -2
- package/types/internal/src/modules/iap.d.ts +2 -2
- package/types/internal/src/modules/journeys.d.ts +2 -2
- package/types/internal/src/modules/machines.d.ts +33 -33
- package/types/internal/src/modules/notify.d.ts +2 -2
- package/types/internal/src/modules/payments.d.ts +83 -14
- package/types/internal/src/modules/stores.d.ts +3 -3
- package/types/internal/src/modules/workspaces.d.ts +5 -5
- package/types/web/src/ai-machines.d.ts +76 -0
- package/types/web/src/chat.d.ts +21 -1
- package/types/web/src/index.d.ts +3 -1
- package/types/web/src/templates.d.ts +8 -0
- package/dist/chunks/2NEPN2ZZ.js +0 -2
- package/dist/chunks/3VGWTVKI.js +0 -2
- package/dist/chunks/ALT62XIG.js +0 -13
- package/dist/chunks/YRYPXVAJ.js +0 -18
|
@@ -577,7 +577,7 @@ export declare function client(t: Transport): {
|
|
|
577
577
|
/**
|
|
578
578
|
* Request direct presigned blob upload URLs
|
|
579
579
|
*
|
|
580
|
-
* Returns presigned PUT URLs directly to managed
|
|
580
|
+
* Returns presigned PUT URLs directly to managed object storage or BYOS S3 for missing content-addressed blobs or chunks.
|
|
581
581
|
*/
|
|
582
582
|
requestSyncUploadGrants(input: {
|
|
583
583
|
body: UploadGrantRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
@@ -586,7 +586,7 @@ export declare function client(t: Transport): {
|
|
|
586
586
|
/**
|
|
587
587
|
* Request direct presigned blob download URLs
|
|
588
588
|
*
|
|
589
|
-
* Returns presigned GET URLs directly to managed
|
|
589
|
+
* Returns presigned GET URLs directly to managed object storage or BYOS S3 for project blobs or chunks.
|
|
590
590
|
*/
|
|
591
591
|
requestSyncDownloadGrants(input: {
|
|
592
592
|
body: DownloadGrantRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
@@ -595,7 +595,7 @@ export declare function client(t: Transport): {
|
|
|
595
595
|
/**
|
|
596
596
|
* Download a decrypted blob via a short-lived signed grant URL
|
|
597
597
|
*
|
|
598
|
-
* Reads
|
|
598
|
+
* Reads encrypted blob ciphertext from managed object storage or BYOS S3, authenticates and decrypts it with the workspace's dedicated key, and streams verified plaintext.
|
|
599
599
|
*/
|
|
600
600
|
downloadSignedSyncBlob(input: {
|
|
601
601
|
path: {
|
|
@@ -604,9 +604,9 @@ export declare function client(t: Transport): {
|
|
|
604
604
|
signal?: AbortSignal;
|
|
605
605
|
}): Promise<Reply<200, undefined>>;
|
|
606
606
|
/**
|
|
607
|
-
* Upload a blob via a short-lived signed grant URL
|
|
607
|
+
* Upload a blob via a short-lived signed grant URL with transparent workspace encryption
|
|
608
608
|
*
|
|
609
|
-
* Accepts plaintext bytes matching the HMAC-signed grant URL, encrypts them with the workspace's
|
|
609
|
+
* Accepts plaintext bytes matching the HMAC-signed grant URL, encrypts them with the workspace's dedicated encryption key, and writes ciphertext to managed object storage or BYOS S3.
|
|
610
610
|
*/
|
|
611
611
|
uploadSignedSyncBlob(input: {
|
|
612
612
|
path: {
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type Machine, type Machines } from '../../internal/src/ai-machines.js';
|
|
2
|
+
import { type Transport } from '../../internal/src/transport.js';
|
|
3
|
+
import { type SessionManager } from './session.js';
|
|
4
|
+
import type { RealtimeSocket } from './socket.js';
|
|
5
|
+
/** The broadcast the platform sends on a person's machines channel when their list changed: it carries no data. */
|
|
6
|
+
export declare const MACHINES_CHANGED = "machines.changed.v1";
|
|
7
|
+
/** The floor: a watch reads the list again this often whatever its channel does, in ms. */
|
|
8
|
+
export declare const MACHINES_FLOOR_MS = 60000;
|
|
9
|
+
/** The signed-in person's own machines: their session's calls, and the list kept current (watch). */
|
|
10
|
+
export interface WebMachines extends Machines {
|
|
11
|
+
/**
|
|
12
|
+
* The person's machines now, then again each time the list changes — `for await (const machines of
|
|
13
|
+
* pb.ai.machines.watch())`; break out of the loop (or abort signal) to stop: the channel is left, nothing more is
|
|
14
|
+
* read or told. The first list is read before anything else; when that read fails the iteration throws its error.
|
|
15
|
+
* Later reads that fail are let be — the next change, join or minute reads again — except a refusal of the person
|
|
16
|
+
* (401, 403), which end the iteration with it. The channel never ends it: a join refused is asked again as the
|
|
17
|
+
* socket asks, and without the channel the list is read every minute. It is one person's: once they sign out it
|
|
18
|
+
* ends with 401 not_signed_in, and once someone else signs in with SessionChangedError — at once, and a list read
|
|
19
|
+
* for them that comes back after is never told. Needs a signed-in person (401 not_signed_in otherwise).
|
|
20
|
+
*/
|
|
21
|
+
watch(options?: {
|
|
22
|
+
signal?: AbortSignal;
|
|
23
|
+
}): AsyncIterableIterator<Machine[]>;
|
|
24
|
+
}
|
|
25
|
+
/** What a watch reads with and hears from: the list, and the channel's "read again". */
|
|
26
|
+
export interface MachineWatchSource {
|
|
27
|
+
/** The person's list: GET /ai/machines, no owner. */
|
|
28
|
+
read(signal: AbortSignal): Promise<Machine[]>;
|
|
29
|
+
/** Hears each "read again" — a broadcast, a join — until the returned function is called. */
|
|
30
|
+
follow(readAgain: () => void): () => void;
|
|
31
|
+
/** How often the list is read whatever the channel does, in ms. */
|
|
32
|
+
floorMs: number;
|
|
33
|
+
/** Why the watch is no longer its person's — nobody signed in, or someone else — or undefined while it is. */
|
|
34
|
+
gone(): unknown;
|
|
35
|
+
/** Hears the session change away from the watch's person (told why) until the returned function is called. */
|
|
36
|
+
onGone(end: (why: unknown) => void): () => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* One watch. Reads are never concurrent: a "read again" heard while one is on its way is one more read after it,
|
|
40
|
+
* however many were heard. A list equal to the last one told (every field, in order) is not told again; a list not yet
|
|
41
|
+
* taken is replaced by a newer one — or dropped, when the newer one is the list the app already holds.
|
|
42
|
+
*/
|
|
43
|
+
export declare class MachineWatch implements AsyncIterableIterator<Machine[]> {
|
|
44
|
+
private started;
|
|
45
|
+
private done;
|
|
46
|
+
private reading;
|
|
47
|
+
private again;
|
|
48
|
+
private taken;
|
|
49
|
+
private told;
|
|
50
|
+
private pending;
|
|
51
|
+
private failure;
|
|
52
|
+
private waiter;
|
|
53
|
+
private unfollow;
|
|
54
|
+
private offSession;
|
|
55
|
+
private floor;
|
|
56
|
+
private readonly abort;
|
|
57
|
+
private readonly source;
|
|
58
|
+
constructor(source: () => Promise<MachineWatchSource>, signal?: AbortSignal);
|
|
59
|
+
[Symbol.asyncIterator](): this;
|
|
60
|
+
next(): Promise<IteratorResult<Machine[]>>;
|
|
61
|
+
/** Stops it: the channel left, the floor stopped, nothing told from now — a next() waiting is told it is done. */
|
|
62
|
+
return(): Promise<IteratorResult<Machine[]>>;
|
|
63
|
+
private stop;
|
|
64
|
+
private start;
|
|
65
|
+
private readAgain;
|
|
66
|
+
private pump;
|
|
67
|
+
/** Whether the session is no longer the watch's person's: the watch is ended then, with why. */
|
|
68
|
+
private leftBy;
|
|
69
|
+
private tell;
|
|
70
|
+
private fail;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* pb.ai.machines: the calls with the person's session, and watches of their list — each watch's reads pinned to the
|
|
74
|
+
* person who started it, and every watch of one person hearing one channel (joined once, left with the last watch).
|
|
75
|
+
*/
|
|
76
|
+
export declare function webMachines(transport: Transport, userTransport: (user: string) => Transport, session: SessionManager, socket: RealtimeSocket, ref: string, floorMs?: number): WebMachines;
|
package/types/web/src/chat.d.ts
CHANGED
|
@@ -55,12 +55,23 @@ export interface ChatMessageView {
|
|
|
55
55
|
/** Its pictures and files, its images first ([] for none). */
|
|
56
56
|
attachments: ChatAttachment[];
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* When a step of the chat came to each state it was in, as the platform's journal took it (RFC 3339, UTC, to the
|
|
60
|
+
* microsecond, at a fixed width: the text sorts as the time) — the first time for each, whatever order the channel and
|
|
61
|
+
* the pages of the past told them in. A tool call's completed minus its running is how long it ran, its approval's wait
|
|
62
|
+
* apart; a turn's completed minus its running how long the turn took. A state told by a module before it said times,
|
|
63
|
+
* or on a page of the past not read yet, is absent.
|
|
64
|
+
*/
|
|
65
|
+
export type StepTimes = Readonly<Record<string, string>>;
|
|
58
66
|
/** One model step's reasoning, as the agent showed it (thinking: visible): its windows as they came, together. */
|
|
59
67
|
export interface ChatThinking {
|
|
60
68
|
/** The model step it is of; null when the part named none. */
|
|
61
69
|
stepId: string | null;
|
|
62
70
|
runId: string;
|
|
63
71
|
text: string;
|
|
72
|
+
/** When its first window and its last came, as the journal took them (null: told with no time). */
|
|
73
|
+
startedAt: string | null;
|
|
74
|
+
endedAt: string | null;
|
|
64
75
|
/**
|
|
65
76
|
* The agent shows its reasoning and the turn's provider would not give it: why there is none (text ''), said
|
|
66
77
|
* once, where it would have been — the model, and the provider's word (null otherwise).
|
|
@@ -76,9 +87,11 @@ export type ChatPart = {
|
|
|
76
87
|
} | {
|
|
77
88
|
type: 'tool';
|
|
78
89
|
tool: ToolEvent;
|
|
90
|
+
times: StepTimes;
|
|
79
91
|
} | {
|
|
80
92
|
type: 'agent';
|
|
81
93
|
agent: AgentEvent;
|
|
94
|
+
times: StepTimes;
|
|
82
95
|
} | {
|
|
83
96
|
type: 'thinking';
|
|
84
97
|
thinking: ChatThinking;
|
|
@@ -115,6 +128,11 @@ export interface ChatResponse {
|
|
|
115
128
|
history: boolean;
|
|
116
129
|
/** Its text is the first of a longer one (a fork's history part carries no more). */
|
|
117
130
|
truncated: boolean;
|
|
131
|
+
/** When it came to each status: its turn's parts' (running, waiting, completed…), a subagent's its agent parts'. */
|
|
132
|
+
times: StepTimes;
|
|
133
|
+
/** The earliest time the chat holds of it — its start, once the page that holds its start is read — and when it ended (null: not yet, or not known). */
|
|
134
|
+
startedAt: string | null;
|
|
135
|
+
endedAt: string | null;
|
|
118
136
|
}
|
|
119
137
|
/** One tool call of the chat, its whole answer — the stream shows its end (its last 16 KiB) — its secret shapes masked. */
|
|
120
138
|
export interface ChatToolCall {
|
|
@@ -135,6 +153,8 @@ export interface ChatToolCall {
|
|
|
135
153
|
export interface ChatStreamPart {
|
|
136
154
|
type: string;
|
|
137
155
|
id?: number;
|
|
156
|
+
/** When it happened, as the journal took it (the module's at): what the state's times are made of. */
|
|
157
|
+
at?: string;
|
|
138
158
|
data: Record<string, unknown>;
|
|
139
159
|
}
|
|
140
160
|
/**
|
|
@@ -198,7 +218,7 @@ export interface ChatExecutionState {
|
|
|
198
218
|
generation: number;
|
|
199
219
|
workspaceSeq: number;
|
|
200
220
|
machineId: string | null;
|
|
201
|
-
machineStatus: 'online' | 'offline' | 'waking' | (string & {}) | null;
|
|
221
|
+
machineStatus: 'online' | 'offline' | 'cordoned' | 'waking' | 'removed' | (string & {}) | null;
|
|
202
222
|
failoverAt: string | null;
|
|
203
223
|
lastHandoff: SessionHandedOffEvent | null;
|
|
204
224
|
compactions: ContextCompactedEvent[];
|
package/types/web/src/index.d.ts
CHANGED
|
@@ -6,9 +6,11 @@ export { Analytics, type AnalyticsOptions, type People } from './analytics.js';
|
|
|
6
6
|
export { Consent, type ConsentKeyInfo, type ConsentListener, type ConsentOptions, type ConsentRegion, type ConsentState } from './consent.js';
|
|
7
7
|
export { Installation } from './installation.js';
|
|
8
8
|
export { sessionSummary } from './chat.js';
|
|
9
|
-
export type { AgentEvent, ChatAttachment, ChatEvent, ChatExecutionState, ChatGoal, ChatItem, ChatMessageView, ChatPart, ChatPartsPage, ChatPartsQuery, ChatResponse, ChatState, ChatStreamPart, ChatThinking, ChatToolCall, ChatVoice, ContextCompactedEvent, ContextOffloadedEvent, GatewayChat, GoalEvent, HistoryEvent, HistoryItem, Publication, SessionHandedOffEvent, SessionMachineStatusEvent, SessionSummaryEvent, ThinkingEvent, ToolEvent, TranscriptEvent, TurnEnd, TurnEvent, VoiceEvent, } from './chat.js';
|
|
9
|
+
export type { AgentEvent, ChatAttachment, ChatEvent, ChatExecutionState, ChatGoal, ChatItem, ChatMessageView, ChatPart, ChatPartsPage, ChatPartsQuery, ChatResponse, ChatState, ChatStreamPart, ChatThinking, StepTimes, ChatToolCall, ChatVoice, ContextCompactedEvent, ContextOffloadedEvent, GatewayChat, GoalEvent, HistoryEvent, HistoryItem, Publication, SessionHandedOffEvent, SessionMachineStatusEvent, SessionSummaryEvent, ThinkingEvent, ToolEvent, TranscriptEvent, TurnEnd, TurnEvent, VoiceEvent, } from './chat.js';
|
|
10
10
|
export { connectVoice, type StartedVoice, type VoiceConnection, type VoiceOptions } from './voice.js';
|
|
11
11
|
export { ClientTemplates, type TemplateAttachment, type TemplateRunOptions, type TemplateRunResult, type TemplateRunUsage, type TemplateStreamChunk, type TemplateVoiceOptions, type TemplateVoiceResult, type WebAI, } from './templates.js';
|
|
12
|
+
export { MACHINES_CHANGED, type WebMachines } from './ai-machines.js';
|
|
13
|
+
export type { Machine, MachineHarness, MachineKey, MachineKeyEnroll, Machines } from '../../internal/src/ai-machines.js';
|
|
12
14
|
export { Iap, redemptionToken, type CheckoutSource, type CustomerInfo, type CustomerInfoListener, type GrantInfo, type MergeGrant, type OfferView, type Offerings, type Redeemed, type RedemptionLink, type RefundDataConsent, } from './iap.js';
|
|
13
15
|
export { Payments, TERMINAL_INTENT_STATUSES, declineMessage, isTerminalIntentStatus, mountEmbedFrame, parseCallbackMessage, type Address, type Buyer, type CancelSubscriptionResponse, type Capabilities, type CapabilitiesResponse, type ConfirmIntentOptions, type InstallmentConfig, type InstallmentOption, type InstallmentTable, type IntentView, type MasterpassAction, type NextAction, type OtpPromptContext, type PaymentCallbackMessage, type PaymentRealtimeEvent, type PaymentRealtimeListener, type PresentIntentOptions, type PresentableIntent, type ProviderOptions, type SavedMethodView, type SpendToken, type SubmitOtpOptions, type SubscriptionListResponse, type SubscriptionSummary, type TopUpWalletOptions, type WaitForIntentOptions, type WalletBalance, type WalletBalancesListener, } from './payments.js';
|
|
14
16
|
export { COMMERCE_DISCOVERY_EVENTS, Commerce, SellerPortal, type AppliedRuleSummary, type AttributeFacetBucketList, type AttributeFacetMap, type BrandFacetBucket, type BrandSummary, type BuyBoxSummary, type Cart, type CartAuthOptions, type CartComplementaryOptions, type CategoryFacetBucket, type CategorySummary, type CheckoutResponse, type CommerceDiscoveryEvent, type CommerceTracker, type ContextRecommendationOptions, type CreateProductReviewInput, type CreateStoreReviewInput, type DiscoveryStrategyKey, type ExperimentAssignment, type MintReviewUploadUrlInput, type OfferCondition, type Order, type OrderDetail, type OrderDownloads, type OrderList, type PriceRangeFacet, type PrimaryMedia, type Product, type ProductDetail, type ProductFacetGroup, type ProductKind, type ProductList, type ProductListQuery, type ProductRecommendationHelperOptions, type ProductRecommendationsQuery, type ProductReview, type ProductReviewListQuery, type ProductReviewListResponse, type ProductReviewSummary, type ProductSearchHit, type ProductSearchRequest, type ProductSearchResponse, type ProductSort, type RatingFacetBucket, type RecommendOptions, type RecommendRequest, type RecommendResponse, type ReturnList, type ReturnRecord, type ReviewDeleteResponse, type ReviewKind, type ReviewMedia, type ReviewMediaInput, type ReviewModerationResponse, type ReviewReplyResponse, type ReviewSort, type ReviewUploadURLResponse, type ReviewVoteResponse, type ReviewsBundle, type SearchFacets, type SellerProductListQuery, type SellerReplyReviewInput, type Store, type StoreList, type StoreMetrics, type StoreOrder, type StoreOrderDetail, type StoreOrderList, type StoreReview, type StoreReviewListQuery, type StoreReviewListResponse, type StoreReviewSummary, type SuggestProductHit, type SuggestQuery, type SuggestResponse, type TermFacetBucket, type TrackCartItemAddedInput, type TrackProductClickedInput, type TrackProductViewedInput, type TrackRecommendationClickedInput, type TrackSearchPerformedInput, type VoteReviewInput, } from './commerce.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WebMachines } from './ai-machines.js';
|
|
1
2
|
import { type Fetch } from '../../internal/src/transport.js';
|
|
2
3
|
import type { SessionManager } from './session.js';
|
|
3
4
|
import type { Installation } from './installation.js';
|
|
@@ -55,6 +56,13 @@ export interface TemplateVoiceResult {
|
|
|
55
56
|
export interface WebAI {
|
|
56
57
|
/** Guardrailed direct server-locked AI templates (`pb.ai.templates`). */
|
|
57
58
|
readonly templates: ClientTemplates;
|
|
59
|
+
/**
|
|
60
|
+
* The signed-in person's own machines (`pb.ai.machines`): an enrolment key for a Mac or a Linux box of theirs,
|
|
61
|
+
* minted with their session when the project lets its users enrol machines (settings userMachines) — said once, into
|
|
62
|
+
* a file on the machine, never on a command line — their machines read, cordoned, resumed and deleted, and the list
|
|
63
|
+
* kept current (watch). Someone else's machine, or one of the project's own, is not there for them (404).
|
|
64
|
+
*/
|
|
65
|
+
readonly machines: WebMachines;
|
|
58
66
|
}
|
|
59
67
|
export declare class ClientTemplates {
|
|
60
68
|
private readonly origin;
|
package/dist/chunks/2NEPN2ZZ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! palbase 0.76.0 — Palbase SDK License (see LICENSE) */
|
|
2
|
-
import{a as d,b as u}from"./UOW74IHY.js";var g={too_many_chats:()=>"this user is in as many chats as they may be (100): delete or leave one before starting another",too_many_endpoints:()=>"the project holds as many tool endpoints as it may (32): delete one (ai.endpoints.delete) before putting another",too_many_messages:t=>`this user has sent as many messages this minute as the project allows${t.retryAfter!==void 0?`: write again in ${t.retryAfter} s`:""}`,history_full:()=>"the project keeps as much chat history as it may: delete chats to write again",not_your_turn:()=>"this turn is another member's: only the member who started it (or the project's server) answers its tools and decides its approvals",not_a_member:()=>"the member the server acts as (as) is not in this chat: put them in it first (chats.members.put), or act as the server",goal_lapsed:()=>"the goal was set as a member who no longer stands where they stood then (out of the chat, or the chat no longer theirs alone): it is not resumed \u2014 clear it, or set another for the chat as it is now",goal_achieved:()=>"the goal is achieved: set a new one (chats.goal.set) to work on",turn_running:()=>"the chat's agent is at work on a turn: fork it once the turn has ended, or stop it first (chats.stop)",fork_too_large:()=>"what came before that message is more than a fork begins with (512 KiB): fork it before an earlier message",too_many_voices:t=>`this user has started as many voices this hour as the project allows (5)${t.retryAfter!==void 0?`: start again in ${t.retryAfter} s`:""}`,voice_active:()=>"another member's voice is live in this chat \u2014 one voice talks in a chat at a time: wait for it to end",not_your_voice:()=>"this voice is another member's: only its member \u2014 or the server as itself \u2014 reads, tells and closes it",voice_closed:()=>"the voice has ended: start a new one (chats.voice.start)",no_workspace:()=>"this chat works in no workspace, and files go into one: start the chat with a workspace, or send pictures as images",attachment_not_found:()=>"a picture or a file given is not one its writer may attach: a file of the project's storage \u2014 for a member, their own or a public bucket's",attachment_too_large:()=>"an attachment is past its bound: 5 MiB a picture, 15 MiB a file",attachment_changed:()=>"a file changed while it was being attached: send the message again",unsupported_image:()=>"a picture is not png, jpeg, webp or gif by its bytes: send it as a file",image_not_found:()=>"a picture given is not a file of the project's storage: upload it first (storage.from(bucket).upload(path, file)) and give that bucket and path",storage_unavailable:t=>`the project's storage did not answer when the model was to read a picture${t.retryAfter!==void 0?`: try again in ${t.retryAfter} s`:"; try again shortly"}`,draft_changed:()=>"the agent's draft was saved again since its revision was read: read it again (ai.agents.get) and make the change on that one",agent_defined_in_code:()=>"this agent is the backend's code's (its build's contract names it): it is changed in the code, and has no draft, versions or delete",nothing_to_publish:()=>"the agent's draft is the version published already: save a change to it first (ai.agents.saveDraft)",agent_not_published:()=>"the agent has no version published yet: publish its draft (ai.agents.publish) before a chat or an answer names it",ai_budget_reached:()=>"the project's monthly AI budget is spent: Palbase's models serve it again when the month turns (UTC) or an owner or admin raises the budget (Studio \u203A AI \u203A Settings, or palbase ai:settings:set --monthly-budget) \u2014 or connect the project's own key for the model's provider (ai.connectProvider), which its provider bills",ai_payment_required:()=>"the month's free AI dollar is spent and the project has no paid rights now to pay for Palbase's models (it is on Free, at its month's limit, or its payment account has an unpaid charge): move it to Pay as you go (Studio \u203A Billing) \u2014 or connect the project's own key for the model's provider (ai.connectProvider), which its provider bills",billing_unavailable:t=>`Palbase's billing did not say whether its models serve the project${t.retryAfter!==void 0?`: try again in ${t.retryAfter} s`:"; try again shortly"}`,client_handoff_disabled:()=>"app users may not hand off chats in this project: enable allow_client_handoff in AI settings, or trigger the handoff from your server",superseded:()=>"this chat has already moved to a newer execution target generation",machine_not_found:()=>"the target machine is not enrolled in this project's runner pools",harness_unavailable:()=>"the requested ACP CLI harness is not ready on the target machine",handoff_requires_idle:()=>"a turn is currently running in this chat: pass when: 'after_turn' or when: 'now' to hand off"},c=new WeakSet;function f(t){if(!(t instanceof u)||c.has(t))return t;let n=g[t.code];if(!n)return t;let i=new u({op:t.op,status:t.status,code:t.code,message:`${n(t)} (${t.op}: ${t.status} ${t.code})`,requestId:t.requestId,retryAfter:t.retryAfter,body:t.body,cause:t});return c.add(i),i}function m(t){return t.catch(n=>{throw f(n)})}function h(t){if(typeof t!="object"||t===null)return;let n=t,i=n.data;if(typeof n.type!="string"||typeof i!="object"||i===null||Array.isArray(i))return;let e=d(i),s=typeof n.id=="number"&&Number.isSafeInteger(n.id)?n.id:0;switch(n.type){case"message":return typeof e.client_id=="string"?{type:"message",seq:s,message:e}:void 0;case"turn":{if(typeof e.response_id!="string"||typeof e.status!="string")return;let r={...e,type:"turn",seq:s};return r.waiting??=null,r.error??=null,r}case"text":{let r=e.offset;return typeof e.response_id!="string"||typeof r!="number"||!Number.isInteger(r)||r<0?void 0:{type:"text",response_id:e.response_id,offset:r,text:typeof e.text=="string"?e.text:""}}case"reset":{let r=e.offset;return typeof e.response_id!="string"||typeof r!="number"||!Number.isInteger(r)||r<0?void 0:{type:"reset",response_id:e.response_id,offset:r}}case"tool":{if(typeof e.call_id!="string"||typeof e.response_id!="string")return;let r=e.omitted_bytes;return{...e,type:"tool",seq:s,omittedBytes:typeof r=="number"&&Number.isSafeInteger(r)&&r>0?r:0,outputTruncated:e.output_truncated===!0}}case"agent":return typeof e.parent_response_id=="string"?{...e,type:"agent",seq:s}:void 0;case"thinking":{if(typeof e.response_id!="string")return;let r=typeof e.run_id=="string"?e.run_id:"";return e.unavailable===!0?{type:"thinking",seq:s,response_id:e.response_id,run_id:r,text:"",unavailable:!0,model:typeof e.model=="string"?e.model:"",reason:typeof e.reason=="string"?e.reason:""}:typeof e.text!="string"?void 0:{type:"thinking",seq:s,response_id:e.response_id,run_id:r,...typeof e.step_id=="string"&&e.step_id!==""?{step_id:e.step_id}:{},text:e.text}}case"goal":{if(typeof e.goal_id!="string"||typeof e.kind!="string")return;let{seq:r,...a}=e;return{...a,type:"goal",seq:s,...typeof r=="number"?{turn:r}:{}}}case"history":{if(!Array.isArray(e.items)||typeof e.part!="number"||!Number.isInteger(e.part)||e.part<0)return;let r=e.items.filter(o=>typeof o=="object"&&o!==null&&(o.role==="user"||o.role==="assistant")&&typeof o.text=="string"),a=e.forked_from;return{type:"history",forked_from:a&&typeof a.chat_id=="string"?a:null,part:e.part,parts:typeof e.parts=="number"?e.parts:e.part+1,items:r}}case"voice":return typeof e.voice_id!="string"||e.voice_id===""||typeof e.status!="string"?void 0:{...e,type:"voice",seq:s,user_id:typeof e.user_id=="string"?e.user_id:null};case"transcript":return typeof e.id!="string"||e.id===""||typeof e.text!="string"?void 0:{type:"transcript",seq:s,id:e.id,voice_id:typeof e.voice_id=="string"?e.voice_id:"",role:typeof e.role=="string"?e.role:"",user_id:typeof e.user_id=="string"?e.user_id:null,author_name:typeof e.author_name=="string"?e.author_name:"",text:e.text,final:e.final!==!1,created_at:typeof e.created_at=="string"?e.created_at:""};case"session.handed_off":return typeof e.to_target!="object"||e.to_target===null||typeof e.generation!="number"?void 0:{type:"session.handed_off",seq:s,chat_id:typeof e.chat_id=="string"?e.chat_id:"",generation:e.generation,...typeof e.from_target=="object"&&e.from_target!==null?{from_target:e.from_target}:{},to_target:e.to_target,reason:typeof e.reason=="string"?e.reason:"",workspace_seq:typeof e.workspace_seq=="number"?e.workspace_seq:0};case"session.machine_status":return typeof e.status!="string"?void 0:{type:"session.machine_status",seq:s,chat_id:typeof e.chat_id=="string"?e.chat_id:"",machine_id:typeof e.machine_id=="string"?e.machine_id:"",status:e.status,...e.failover_at===null||typeof e.failover_at=="string"?{failover_at:e.failover_at}:{}};case"context.offloaded":return{type:"context.offloaded",seq:s,call_id:typeof e.call_id=="string"?e.call_id:"",...typeof e.storage=="string"?{storage:e.storage}:{},...typeof e.ref=="string"?{ref:e.ref}:{},...typeof e.original_bytes=="number"?{original_bytes:e.original_bytes}:{},...typeof e.stub_bytes=="number"?{stub_bytes:e.stub_bytes}:{}};case"context.compacted":return{type:"context.compacted",seq:s,...typeof e.format=="string"?{format:e.format}:{},...typeof e.messages_compacted=="number"?{messages_compacted:e.messages_compacted}:{},...typeof e.tokens_before=="number"?{tokens_before:e.tokens_before}:{},...typeof e.tokens_after=="number"?{tokens_after:e.tokens_after}:{},...typeof e.preserved_attachments_count=="number"?{preserved_attachments_count:e.preserved_attachments_count}:{},...typeof e.project_directives_count=="number"?{project_directives_count:e.project_directives_count}:{},...typeof e.cache_friendly=="boolean"?{cache_friendly:e.cache_friendly}:{}};default:return}}function y(t){if(typeof t!="object"||t===null||Array.isArray(t))return;let n=d(t);if(!(typeof n.chat_id!="string"||n.chat_id===""||typeof n.run_status!="string"||typeof n.target_generation!="number")&&!(typeof n.target_summary!="object"||n.target_summary===null))return{chat_id:n.chat_id,run_status:n.run_status,...typeof n.active_run_id=="string"&&n.active_run_id!==""?{active_run_id:n.active_run_id}:{},...typeof n.workspace_id=="string"&&n.workspace_id!==""?{workspace_id:n.workspace_id}:{},target_generation:n.target_generation,target_summary:n.target_summary,updated_at:typeof n.updated_at=="string"?n.updated_at:""}}function v(t){let n=0;for(let i=0;i<t.length;i++){let e=t.charCodeAt(i);e<128?n+=1:e<2048?n+=2:e>=55296&&e<=56319&&i+1<t.length&&(t.charCodeAt(i+1)&64512)===56320?(n+=4,i++):n+=3}return n}function p(t,n){if(n<=0)return 0;let i=0;for(let e=0;e<t.length;e++){let s=t.charCodeAt(e),r=3,a=1;if(s<128?r=1:s<2048?r=2:s>=55296&&s<=56319&&e+1<t.length&&(t.charCodeAt(e+1)&64512)===56320&&(r=4,a=2),i+=r,i>=n)return e+a;e+=a-1}return t.length}function w(t,n){return t.slice(p(t,n))}export{m as a,h as b,y as c,v as d,p as e,w as f};
|