@useago/sdk 1.5.3 → 1.5.4

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +10 -0
  3. package/dist/AgoClient-BW0YZsis.js +1681 -0
  4. package/dist/AgoClient-Ba3ICq4K.cjs +8 -0
  5. package/dist/angular.cjs +1 -1
  6. package/dist/angular.d.cts +41 -0
  7. package/dist/angular.d.ts +41 -0
  8. package/dist/angular.js +2 -2
  9. package/dist/{createConversationSession-C7cnnWKW.js → createConversationSession-BjsgjL-v.js} +1 -1
  10. package/dist/{createConversationSession-BCb0D6bt.cjs → createConversationSession-okoz3teC.cjs} +1 -1
  11. package/dist/{createFormCollector-t_fGyuTD.cjs → createFormCollector-BWIh1pMl.cjs} +1 -1
  12. package/dist/{createFormCollector-iCDwAwYJ.js → createFormCollector-Bay2UpRv.js} +1 -1
  13. package/dist/devtools.d.cts +41 -0
  14. package/dist/devtools.d.ts +41 -0
  15. package/dist/functions-CPs7omgM.cjs +1 -0
  16. package/dist/helpers.cjs +1 -1
  17. package/dist/helpers.js +1 -1
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.d.cts +54 -0
  20. package/dist/index.d.ts +54 -0
  21. package/dist/index.js +64 -62
  22. package/dist/react.cjs +3 -3
  23. package/dist/react.d.cts +55 -0
  24. package/dist/react.d.ts +55 -0
  25. package/dist/react.js +142 -122
  26. package/dist/testing.cjs +1 -1
  27. package/dist/testing.d.cts +41 -0
  28. package/dist/testing.d.ts +41 -0
  29. package/dist/testing.js +1 -1
  30. package/dist/vue.cjs +1 -1
  31. package/dist/vue.d.cts +41 -0
  32. package/dist/vue.d.ts +41 -0
  33. package/dist/vue.js +1 -1
  34. package/dist/widget.cjs +1 -1
  35. package/dist/widget.d.cts +41 -0
  36. package/dist/widget.d.ts +41 -0
  37. package/dist/widget.js +3 -3
  38. package/llms-full.txt +29 -0
  39. package/package.json +1 -1
  40. package/dist/AgoClient-BGkFSNZF.cjs +0 -8
  41. package/dist/AgoClient-CW-BLT1_.js +0 -1542
  42. package/dist/functions-IGSjjvF4.cjs +0 -1
  43. package/dist/rolldown-runtime-16Nf8qvH.cjs +0 -1
  44. /package/dist/{autoContinue-D3Mmaaca.js → autoContinue-CC8K9mBU.js} +0 -0
  45. /package/dist/{autoContinue-CcCTva-D.cjs → autoContinue-CP9pJR-V.cjs} +0 -0
  46. /package/dist/{createMockClient-Br0TWgLO.js → createMockClient-DcuNlufr.js} +0 -0
  47. /package/dist/{createMockClient-BwNLPjeT.cjs → createMockClient-Dw-cyISN.cjs} +0 -0
  48. /package/dist/{functions-CApuQZ2b.js → functions-tzyOZNp6.js} +0 -0
package/dist/react.d.cts 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;
@@ -401,6 +419,19 @@ declare class AgoClient {
401
419
  * Get the current context snapshot.
402
420
  */
403
421
  getContextSnapshot(): ContextSnapshot | null;
422
+ private buildSendContext;
423
+ /**
424
+ * Record something the user just did so the agent is aware of it on the next
425
+ * message. `actor` defaults to `"user"`. Keep `summary` short and high-signal
426
+ * (no raw payloads, secrets, or PII).
427
+ */
428
+ recordActivity(entry: ActivityInput): void;
429
+ /** Recent user + agent actions, oldest first (a copy). */
430
+ getRecentActivity(): ActivityEntry[];
431
+ clearActivity(): void;
432
+ private addActivity;
433
+ private recordAgentAction;
434
+ private registerActivityContext;
404
435
  /**
405
436
  * Subscribe to an event
406
437
  */
@@ -572,6 +603,8 @@ declare interface AgoClientEvents {
572
603
  "nudge:accepted": {
573
604
  nudge: ProactiveNudgeInstance;
574
605
  };
606
+ /** A user- or agent-action was recorded into the activity ledger. */
607
+ "activity:recorded": ActivityEntry;
575
608
  }
576
609
 
577
610
  /**
@@ -633,6 +666,14 @@ export declare interface AgoConfig {
633
666
  * with `maxResultBytes` on its definition; `Infinity` disables the guard.
634
667
  */
635
668
  maxFunctionResultBytes?: number;
669
+ /**
670
+ * Max number of recent actions kept in the in-memory activity ledger that
671
+ * rides along as the `activity:recent` context entry. Older entries drop
672
+ * first. Default `10`. Larger values give the agent more history at the cost
673
+ * of tokens on every message. Each entry's `data` is also size-clamped (long
674
+ * strings truncated, large arrays capped) so one event can't bloat the context.
675
+ */
676
+ maxActivityEntries?: number;
636
677
  /**
637
678
  * Enable the proactive mode: declarative triggers evaluated client-side
638
679
  * against friction signals (dwell/idle time, rage clicks, route bounces…)
@@ -1789,6 +1830,20 @@ export declare function useAgo(config: UseAgoOptions | null): {
1789
1830
  */
1790
1831
  export declare function useAgoActivity(options?: UseAgoActivityOptions): UseAgoActivityResult;
1791
1832
 
1833
+ /** Recent user + agent activity, kept in sync with the client's ledger. */
1834
+ export declare function useAgoActivityLog(options?: UseAgoActivityLogOptions): UseAgoActivityLogResult;
1835
+
1836
+ export declare interface UseAgoActivityLogOptions {
1837
+ client?: AgoClient;
1838
+ }
1839
+
1840
+ export declare interface UseAgoActivityLogResult {
1841
+ entries: ActivityEntry[];
1842
+ latest?: ActivityEntry;
1843
+ record: (entry: ActivityInput) => void;
1844
+ clear: () => void;
1845
+ }
1846
+
1792
1847
  export declare interface UseAgoActivityOptions {
1793
1848
  /** The AGO client. If omitted, reads from AgoProvider context. */
1794
1849
  client?: AgoClient;
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;
@@ -401,6 +419,19 @@ declare class AgoClient {
401
419
  * Get the current context snapshot.
402
420
  */
403
421
  getContextSnapshot(): ContextSnapshot | null;
422
+ private buildSendContext;
423
+ /**
424
+ * Record something the user just did so the agent is aware of it on the next
425
+ * message. `actor` defaults to `"user"`. Keep `summary` short and high-signal
426
+ * (no raw payloads, secrets, or PII).
427
+ */
428
+ recordActivity(entry: ActivityInput): void;
429
+ /** Recent user + agent actions, oldest first (a copy). */
430
+ getRecentActivity(): ActivityEntry[];
431
+ clearActivity(): void;
432
+ private addActivity;
433
+ private recordAgentAction;
434
+ private registerActivityContext;
404
435
  /**
405
436
  * Subscribe to an event
406
437
  */
@@ -572,6 +603,8 @@ declare interface AgoClientEvents {
572
603
  "nudge:accepted": {
573
604
  nudge: ProactiveNudgeInstance;
574
605
  };
606
+ /** A user- or agent-action was recorded into the activity ledger. */
607
+ "activity:recorded": ActivityEntry;
575
608
  }
576
609
 
577
610
  /**
@@ -633,6 +666,14 @@ export declare interface AgoConfig {
633
666
  * with `maxResultBytes` on its definition; `Infinity` disables the guard.
634
667
  */
635
668
  maxFunctionResultBytes?: number;
669
+ /**
670
+ * Max number of recent actions kept in the in-memory activity ledger that
671
+ * rides along as the `activity:recent` context entry. Older entries drop
672
+ * first. Default `10`. Larger values give the agent more history at the cost
673
+ * of tokens on every message. Each entry's `data` is also size-clamped (long
674
+ * strings truncated, large arrays capped) so one event can't bloat the context.
675
+ */
676
+ maxActivityEntries?: number;
636
677
  /**
637
678
  * Enable the proactive mode: declarative triggers evaluated client-side
638
679
  * against friction signals (dwell/idle time, rage clicks, route bounces…)
@@ -1789,6 +1830,20 @@ export declare function useAgo(config: UseAgoOptions | null): {
1789
1830
  */
1790
1831
  export declare function useAgoActivity(options?: UseAgoActivityOptions): UseAgoActivityResult;
1791
1832
 
1833
+ /** Recent user + agent activity, kept in sync with the client's ledger. */
1834
+ export declare function useAgoActivityLog(options?: UseAgoActivityLogOptions): UseAgoActivityLogResult;
1835
+
1836
+ export declare interface UseAgoActivityLogOptions {
1837
+ client?: AgoClient;
1838
+ }
1839
+
1840
+ export declare interface UseAgoActivityLogResult {
1841
+ entries: ActivityEntry[];
1842
+ latest?: ActivityEntry;
1843
+ record: (entry: ActivityInput) => void;
1844
+ clear: () => void;
1845
+ }
1846
+
1792
1847
  export declare interface UseAgoActivityOptions {
1793
1848
  /** The AGO client. If omitted, reads from AgoProvider context. */
1794
1849
  client?: AgoClient;