@useago/sdk 1.5.3 → 1.5.5
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/CHANGELOG.md +33 -0
- package/README.md +10 -0
- package/dist/AgoClient-BI5esqbd.js +1694 -0
- package/dist/AgoClient-CQh8YovA.cjs +8 -0
- package/dist/angular.cjs +1 -1
- package/dist/angular.d.cts +70 -3
- package/dist/angular.d.ts +70 -3
- package/dist/angular.js +3 -3
- package/dist/{createConversationSession-BCb0D6bt.cjs → createConversationSession-0zVkMdYj.cjs} +1 -1
- package/dist/{createConversationSession-C7cnnWKW.js → createConversationSession-BlYTpxwz.js} +1 -1
- package/dist/{createFormCollector-iCDwAwYJ.js → createFormCollector-Bgs94NyR.js} +1 -1
- package/dist/{createFormCollector-t_fGyuTD.cjs → createFormCollector-DiCe_8ik.cjs} +1 -1
- package/dist/devtools.d.cts +69 -2
- package/dist/devtools.d.ts +69 -2
- package/dist/functions-CPs7omgM.cjs +1 -0
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +90 -2
- package/dist/index.d.ts +90 -2
- package/dist/index.js +64 -62
- package/dist/react.cjs +3 -3
- package/dist/react.d.cts +83 -2
- package/dist/react.d.ts +83 -2
- package/dist/react.js +240 -219
- package/dist/testing.cjs +1 -1
- package/dist/testing.d.cts +69 -2
- package/dist/testing.d.ts +69 -2
- package/dist/testing.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.d.cts +69 -2
- package/dist/vue.d.ts +69 -2
- package/dist/vue.js +2 -2
- package/dist/widget.cjs +2 -2
- package/dist/widget.d.cts +69 -2
- package/dist/widget.d.ts +69 -2
- package/dist/widget.js +4 -4
- package/llms-full.txt +29 -0
- package/package.json +1 -1
- package/dist/AgoClient-BGkFSNZF.cjs +0 -8
- package/dist/AgoClient-CW-BLT1_.js +0 -1542
- package/dist/functions-IGSjjvF4.cjs +0 -1
- package/dist/rolldown-runtime-16Nf8qvH.cjs +0 -1
- /package/dist/{autoContinue-D3Mmaaca.js → autoContinue-CC8K9mBU.js} +0 -0
- /package/dist/{autoContinue-CcCTva-D.cjs → autoContinue-CP9pJR-V.cjs} +0 -0
- /package/dist/{createMockClient-Br0TWgLO.js → createMockClient-DcuNlufr.js} +0 -0
- /package/dist/{createMockClient-BwNLPjeT.cjs → createMockClient-Dw-cyISN.cjs} +0 -0
- /package/dist/{functions-CApuQZ2b.js → functions-tzyOZNp6.js} +0 -0
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { default as default_2 } from 'react';
|
|
2
2
|
|
|
3
|
+
export declare interface ActivityEntry {
|
|
4
|
+
ts: number;
|
|
5
|
+
actor: "user" | "agent";
|
|
6
|
+
name: string;
|
|
7
|
+
summary: string;
|
|
8
|
+
data?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare interface ActivityInput {
|
|
12
|
+
actor?: "user" | "agent";
|
|
13
|
+
name: string;
|
|
14
|
+
summary: string;
|
|
15
|
+
data?: Record<string, unknown>;
|
|
16
|
+
ts?: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
3
19
|
/**
|
|
4
20
|
* One normalized entry in the agent's activity feed. Merges a tool call
|
|
5
21
|
* (`toolCall:received`) or a client-function invocation (`function:invoke` /
|
|
@@ -91,6 +107,8 @@ declare class AgoClient {
|
|
|
91
107
|
private functionRegistry;
|
|
92
108
|
private contextRegistry;
|
|
93
109
|
private eventEmitter;
|
|
110
|
+
private activityLedger;
|
|
111
|
+
private lastSentPageState;
|
|
94
112
|
private config;
|
|
95
113
|
/** Conversations already warned about an empty reply (one warning each). */
|
|
96
114
|
private warnedEmptyConversations;
|
|
@@ -177,9 +195,14 @@ declare class AgoClient {
|
|
|
177
195
|
*/
|
|
178
196
|
rejectFunction(invocationId: string): Promise<void>;
|
|
179
197
|
/**
|
|
180
|
-
* Get
|
|
198
|
+
* Get a page of conversations, newest-first. `pageSize` is capped at 100 by
|
|
199
|
+
* the backend (default 50). Returns the `{ data, has_more, total }` envelope
|
|
200
|
+
* so callers can page; `total` counts across all pages.
|
|
181
201
|
*/
|
|
182
|
-
getConversations(
|
|
202
|
+
getConversations(options?: {
|
|
203
|
+
page?: number;
|
|
204
|
+
pageSize?: number;
|
|
205
|
+
}): Promise<PaginatedResult<Conversation>>;
|
|
183
206
|
/**
|
|
184
207
|
* Get a specific conversation with messages
|
|
185
208
|
*/
|
|
@@ -401,6 +424,19 @@ declare class AgoClient {
|
|
|
401
424
|
* Get the current context snapshot.
|
|
402
425
|
*/
|
|
403
426
|
getContextSnapshot(): ContextSnapshot | null;
|
|
427
|
+
private buildSendContext;
|
|
428
|
+
/**
|
|
429
|
+
* Record something the user just did so the agent is aware of it on the next
|
|
430
|
+
* message. `actor` defaults to `"user"`. Keep `summary` short and high-signal
|
|
431
|
+
* (no raw payloads, secrets, or PII).
|
|
432
|
+
*/
|
|
433
|
+
recordActivity(entry: ActivityInput): void;
|
|
434
|
+
/** Recent user + agent actions, oldest first (a copy). */
|
|
435
|
+
getRecentActivity(): ActivityEntry[];
|
|
436
|
+
clearActivity(): void;
|
|
437
|
+
private addActivity;
|
|
438
|
+
private recordAgentAction;
|
|
439
|
+
private registerActivityContext;
|
|
404
440
|
/**
|
|
405
441
|
* Subscribe to an event
|
|
406
442
|
*/
|
|
@@ -512,6 +548,15 @@ declare interface AgoClientEvents {
|
|
|
512
548
|
* notably `createFormCollector` — can replay them to restore their state.
|
|
513
549
|
*/
|
|
514
550
|
"conversation:loaded": Conversation;
|
|
551
|
+
/**
|
|
552
|
+
* The conversation's title was generated and streamed during a live turn
|
|
553
|
+
* (the backend emits it once, at the end of the first turn). Lets the UI
|
|
554
|
+
* update a header without a refetch.
|
|
555
|
+
*/
|
|
556
|
+
"conversation:title": {
|
|
557
|
+
conversationId: string;
|
|
558
|
+
title: string;
|
|
559
|
+
};
|
|
515
560
|
"toolCall:received": ToolCallData;
|
|
516
561
|
"toolCall:form": ToolCallData;
|
|
517
562
|
"function:invoke": ClientFunctionInvocation;
|
|
@@ -572,6 +617,8 @@ declare interface AgoClientEvents {
|
|
|
572
617
|
"nudge:accepted": {
|
|
573
618
|
nudge: ProactiveNudgeInstance;
|
|
574
619
|
};
|
|
620
|
+
/** A user- or agent-action was recorded into the activity ledger. */
|
|
621
|
+
"activity:recorded": ActivityEntry;
|
|
575
622
|
}
|
|
576
623
|
|
|
577
624
|
/**
|
|
@@ -633,6 +680,14 @@ export declare interface AgoConfig {
|
|
|
633
680
|
* with `maxResultBytes` on its definition; `Infinity` disables the guard.
|
|
634
681
|
*/
|
|
635
682
|
maxFunctionResultBytes?: number;
|
|
683
|
+
/**
|
|
684
|
+
* Max number of recent actions kept in the in-memory activity ledger that
|
|
685
|
+
* rides along as the `activity:recent` context entry. Older entries drop
|
|
686
|
+
* first. Default `10`. Larger values give the agent more history at the cost
|
|
687
|
+
* of tokens on every message. Each entry's `data` is also size-clamped (long
|
|
688
|
+
* strings truncated, large arrays capped) so one event can't bloat the context.
|
|
689
|
+
*/
|
|
690
|
+
maxActivityEntries?: number;
|
|
636
691
|
/**
|
|
637
692
|
* Enable the proactive mode: declarative triggers evaluated client-side
|
|
638
693
|
* against friction signals (dwell/idle time, rage clicks, route bounces…)
|
|
@@ -1393,6 +1448,16 @@ export declare type NudgeAction = {
|
|
|
1393
1448
|
setPageState: Record<string, unknown>;
|
|
1394
1449
|
};
|
|
1395
1450
|
|
|
1451
|
+
/**
|
|
1452
|
+
* A page of list results, mirroring the API's `{ data, has_more, total }`
|
|
1453
|
+
* envelope. `total` is the count across all pages, not just this page.
|
|
1454
|
+
*/
|
|
1455
|
+
export declare interface PaginatedResult<T> {
|
|
1456
|
+
data: T[];
|
|
1457
|
+
hasMore: boolean;
|
|
1458
|
+
total: number;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1396
1461
|
/**
|
|
1397
1462
|
* Controller returned by {@link createAgoProactive} (also available as
|
|
1398
1463
|
* `client.proactive`).
|
|
@@ -1645,6 +1710,8 @@ declare interface SSEChunkData {
|
|
|
1645
1710
|
thread?: {
|
|
1646
1711
|
id: string;
|
|
1647
1712
|
};
|
|
1713
|
+
/** Generated conversation title, streamed once at the end of the first turn. */
|
|
1714
|
+
title?: string;
|
|
1648
1715
|
agent?: {
|
|
1649
1716
|
id: string;
|
|
1650
1717
|
name: string;
|
|
@@ -1789,6 +1856,20 @@ export declare function useAgo(config: UseAgoOptions | null): {
|
|
|
1789
1856
|
*/
|
|
1790
1857
|
export declare function useAgoActivity(options?: UseAgoActivityOptions): UseAgoActivityResult;
|
|
1791
1858
|
|
|
1859
|
+
/** Recent user + agent activity, kept in sync with the client's ledger. */
|
|
1860
|
+
export declare function useAgoActivityLog(options?: UseAgoActivityLogOptions): UseAgoActivityLogResult;
|
|
1861
|
+
|
|
1862
|
+
export declare interface UseAgoActivityLogOptions {
|
|
1863
|
+
client?: AgoClient;
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
export declare interface UseAgoActivityLogResult {
|
|
1867
|
+
entries: ActivityEntry[];
|
|
1868
|
+
latest?: ActivityEntry;
|
|
1869
|
+
record: (entry: ActivityInput) => void;
|
|
1870
|
+
clear: () => void;
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1792
1873
|
export declare interface UseAgoActivityOptions {
|
|
1793
1874
|
/** The AGO client. If omitted, reads from AgoProvider context. */
|
|
1794
1875
|
client?: AgoClient;
|