@alva-ai/toolkit 0.28.0 → 0.28.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,8 @@ interface AlvaClientConfig {
13
13
  originSessionId?: string;
14
14
  /** Session profile kind used to gate attached-context CLI commands. */
15
15
  originSessionKind?: string;
16
+ /** Host-attached canonical Session Inbox path; embedded scheduling is self-only. */
17
+ originInboxPath?: string;
16
18
  }
17
19
  interface UserProfile {
18
20
  id: string;
@@ -2157,8 +2159,14 @@ interface AgentSchedule {
2157
2159
  createdAt: string;
2158
2160
  updatedAt: string;
2159
2161
  }
2160
- interface PutAgentScheduleParams {
2162
+ type AgentScheduleTarget = {
2161
2163
  channelId: string | number;
2164
+ inboxPath?: never;
2165
+ } | {
2166
+ inboxPath: string;
2167
+ channelId?: never;
2168
+ };
2169
+ type PutAgentScheduleParams = AgentScheduleTarget & {
2162
2170
  name: string;
2163
2171
  rule: AgentScheduleRule | {
2164
2172
  kind: 'after';
@@ -2166,17 +2174,14 @@ interface PutAgentScheduleParams {
2166
2174
  };
2167
2175
  bounds?: AgentScheduleBounds;
2168
2176
  text: string;
2169
- }
2170
- interface ManageAgentScheduleParams {
2171
- channelId: string | number;
2177
+ };
2178
+ type ManageAgentScheduleParams = AgentScheduleTarget & {
2172
2179
  name: string;
2173
- }
2180
+ };
2174
2181
  declare class SchedulesResource {
2175
2182
  private client;
2176
2183
  constructor(client: AlvaClient);
2177
- list(params: {
2178
- channelId: string | number;
2179
- }): Promise<AgentSchedule[]>;
2184
+ list(params: AgentScheduleTarget): Promise<AgentSchedule[]>;
2180
2185
  put(params: PutAgentScheduleParams): Promise<AgentSchedule>;
2181
2186
  pause(params: ManageAgentScheduleParams): Promise<AgentSchedule>;
2182
2187
  resume(params: ManageAgentScheduleParams): Promise<AgentSchedule>;
@@ -2184,6 +2189,89 @@ declare class SchedulesResource {
2184
2189
  /** Resolve the authenticated viewer's unique Agent Channel for CLI defaults. */
2185
2190
  agentChannelId(): Promise<string>;
2186
2191
  private manage;
2192
+ private update;
2193
+ private graphql;
2194
+ }
2195
+
2196
+ /**
2197
+ * Push steward tool commands (mono-meta #935). Every call names the steward by
2198
+ * its own Session Inbox path, which the host supplies to the embedded `alva`
2199
+ * tool; the Backend resolves it to the caller's ready steward binding and
2200
+ * scopes every delivery to that binding's Channel.
2201
+ */
2202
+ type StewardDecision = 'immediate' | 'digest' | 'suppress';
2203
+ interface StewardTarget {
2204
+ inboxPath: string;
2205
+ }
2206
+ interface StewardDecideParams extends StewardTarget {
2207
+ deliveryId: string;
2208
+ decision: StewardDecision;
2209
+ reason: string;
2210
+ }
2211
+ interface StewardForwardParams extends StewardTarget {
2212
+ deliveryId: string;
2213
+ /** Idempotency key; the CLI generates a UUID when omitted. */
2214
+ requestId?: string;
2215
+ }
2216
+ interface StewardSendParams extends StewardTarget {
2217
+ body: string;
2218
+ deliveryIds: string[];
2219
+ requestId?: string;
2220
+ }
2221
+ type StewardSourceKind = 'FEED' | 'MARKET_ENTITY' | 'THESIS_FEED';
2222
+ interface StewardPendingParams extends StewardTarget {
2223
+ /** Opaque cursor from the previous page's `nextCursor`; carries the window. */
2224
+ after?: string;
2225
+ /** First page only: lower bound on decision time. */
2226
+ sinceMs?: number;
2227
+ /** First page only: fixed upper bound of the Brief window (the digest_request's untilMs). */
2228
+ untilMs?: number;
2229
+ first?: number;
2230
+ }
2231
+ interface StewardBriefedParams extends StewardTarget {
2232
+ deliveryIds: string[];
2233
+ digestRunId: string;
2234
+ }
2235
+ interface StewardDecideResult {
2236
+ state: string;
2237
+ }
2238
+ interface StewardForwardResult {
2239
+ channelMessageId: string;
2240
+ state: string;
2241
+ }
2242
+ interface StewardSendResult {
2243
+ channelMessageId: string;
2244
+ /** The idempotency key used; pass it as digestRunId to `briefed`. */
2245
+ requestId: string;
2246
+ }
2247
+ interface StewardPendingItem {
2248
+ deliveryId: string;
2249
+ feedEntryId: string;
2250
+ source: {
2251
+ kind: StewardSourceKind;
2252
+ id: string;
2253
+ };
2254
+ decisionReason: string;
2255
+ consumedAtMs: number;
2256
+ }
2257
+ interface StewardPendingPage {
2258
+ items: StewardPendingItem[];
2259
+ /** Cursor for the next page; `null` when this page was the last. */
2260
+ nextCursor: string | null;
2261
+ /** The window every page of this Brief was read with. */
2262
+ windowSinceMs: number;
2263
+ windowUntilMs: number;
2264
+ }
2265
+ declare class StewardResource {
2266
+ private client;
2267
+ constructor(client: AlvaClient);
2268
+ decide(params: StewardDecideParams): Promise<StewardDecideResult>;
2269
+ forward(params: StewardForwardParams): Promise<StewardForwardResult>;
2270
+ send(params: StewardSendParams): Promise<StewardSendResult>;
2271
+ pending(params: StewardPendingParams): Promise<StewardPendingPage>;
2272
+ briefed(params: StewardBriefedParams): Promise<{
2273
+ ok: true;
2274
+ }>;
2187
2275
  private graphql;
2188
2276
  }
2189
2277
 
@@ -2224,6 +2312,98 @@ declare class TradingPairsResource {
2224
2312
  } & TradingPairResolveFilters) | Omit<TradingPairSearchParams, 'limit'>): Promise<TradingPairCandidate>;
2225
2313
  }
2226
2314
 
2315
+ /** Thesis IDs are signed int64 values represented losslessly as decimal strings. */
2316
+ type ThesisID = string;
2317
+ type ThesisVisibility = 'public' | 'private';
2318
+ /** Canonical server-supported candidate rewrite operation. */
2319
+ type ThesisRewriteMode = 'reformat' | 'shorten' | 'enrich';
2320
+ interface Thesis {
2321
+ id: ThesisID;
2322
+ author_version_id: ThesisID;
2323
+ material_version_id: ThesisID;
2324
+ title: string;
2325
+ body: string;
2326
+ entity_ids: ThesisID[];
2327
+ visibility: ThesisVisibility;
2328
+ closed: boolean;
2329
+ closing_note: string;
2330
+ author_kind: string;
2331
+ author_ref: string;
2332
+ }
2333
+ interface ThesisResponse {
2334
+ thesis: Thesis;
2335
+ }
2336
+ interface ThesisAuthor {
2337
+ id: ThesisID;
2338
+ kind: string;
2339
+ display_name: string;
2340
+ avatar_url: string;
2341
+ username: string;
2342
+ }
2343
+ interface ThesisEntity {
2344
+ id: ThesisID;
2345
+ ticker: string;
2346
+ name: string;
2347
+ icon_url: string;
2348
+ kind: string;
2349
+ }
2350
+ interface ThesisGetResponse extends ThesisResponse {
2351
+ author: ThesisAuthor;
2352
+ entities: ThesisEntity[];
2353
+ }
2354
+ interface CreateThesisParams {
2355
+ /** Caller-supplied, stable non-zero UUID. Reuse it only to resolve ambiguity. */
2356
+ request_id: string;
2357
+ body: string;
2358
+ title?: string;
2359
+ entity_ids?: ThesisID[];
2360
+ /** Exact STOCK ticker symbols resolved by Backend during creation. */
2361
+ tickers?: string[];
2362
+ /** Omitted means public, as defined by the REST contract. */
2363
+ visibility?: ThesisVisibility;
2364
+ }
2365
+ interface UpdateThesisParams {
2366
+ /** Caller-supplied, stable non-zero UUID. Reuse it only to resolve ambiguity. */
2367
+ request_id: string;
2368
+ expected_author_version_id: ThesisID;
2369
+ body: string;
2370
+ title?: string;
2371
+ entity_ids?: ThesisID[];
2372
+ /** Required so an update cannot inadvertently publish a private thesis. */
2373
+ visibility: ThesisVisibility;
2374
+ editorial?: boolean;
2375
+ }
2376
+ interface SetThesisVisibilityParams {
2377
+ visibility: ThesisVisibility;
2378
+ }
2379
+ interface CloseThesisParams {
2380
+ expected_author_version_id: ThesisID;
2381
+ note?: string;
2382
+ }
2383
+ interface RewriteThesisParams {
2384
+ body: string;
2385
+ /** Omitted selects the canonical `reformat` mode. */
2386
+ mode?: ThesisRewriteMode;
2387
+ }
2388
+ interface RewriteThesisResponse {
2389
+ body: string;
2390
+ }
2391
+ /**
2392
+ * Thesis CRUD and explicit text rewriting. This resource never retries,
2393
+ * starts Signal/Alert setup, or invokes rewrite as a side effect of CRUD.
2394
+ */
2395
+ declare class ThesesResource {
2396
+ private client;
2397
+ constructor(client: AlvaClient);
2398
+ create(params: CreateThesisParams): Promise<ThesisResponse>;
2399
+ get(id: ThesisID): Promise<ThesisGetResponse>;
2400
+ update(id: ThesisID, params: UpdateThesisParams): Promise<ThesisResponse>;
2401
+ setVisibility(id: ThesisID, params: SetThesisVisibilityParams): Promise<ThesisResponse>;
2402
+ close(id: ThesisID, params: CloseThesisParams): Promise<ThesisResponse>;
2403
+ delete(id: ThesisID): Promise<Record<string, never>>;
2404
+ rewrite(params: RewriteThesisParams): Promise<RewriteThesisResponse>;
2405
+ }
2406
+
2227
2407
  interface RequestOptions {
2228
2408
  query?: Record<string, unknown>;
2229
2409
  body?: unknown;
@@ -2261,6 +2441,8 @@ declare class AlvaClient {
2261
2441
  readonly originSessionId?: string;
2262
2442
  /** Session profile kind associated with originSessionId. */
2263
2443
  readonly originSessionKind?: string;
2444
+ /** Host-attached file Session target, distinct from the chat origin header. */
2445
+ readonly originInboxPath?: string;
2264
2446
  private _fs?;
2265
2447
  private _run?;
2266
2448
  private _deploy?;
@@ -2291,7 +2473,9 @@ declare class AlvaClient {
2291
2473
  private _credits?;
2292
2474
  private _markets?;
2293
2475
  private _schedules?;
2476
+ private _steward?;
2294
2477
  private _tradingPairs?;
2478
+ private _theses?;
2295
2479
  constructor(config: AlvaClientConfig);
2296
2480
  get fs(): FsResource;
2297
2481
  get run(): RunResource;
@@ -2323,6 +2507,8 @@ declare class AlvaClient {
2323
2507
  get markets(): MarketsResource;
2324
2508
  get tradingPairs(): TradingPairsResource;
2325
2509
  get schedules(): SchedulesResource;
2510
+ get steward(): StewardResource;
2511
+ get theses(): ThesesResource;
2326
2512
  _requireAuth(): void;
2327
2513
  get forYou(): ForYouResource;
2328
2514
  _request(method: string, path: string, options?: RequestOptions): Promise<unknown>;
@@ -2349,6 +2535,8 @@ interface DispatchRuntimeDeps {
2349
2535
  };
2350
2536
  localFiles?: DispatchLocalFiles;
2351
2537
  readStdin?: () => Promise<string>;
2538
+ /** Raw stdin bytes for commands that must reject malformed UTF-8. */
2539
+ readStdinBytes?: () => Promise<Uint8Array>;
2352
2540
  randomUUID?: () => string;
2353
2541
  configureFetchTimeout?: (timeoutMs: number) => void;
2354
2542
  writeBrokerResult?: (envelope: unknown, exitCode: number) => Promise<void>;