@betterlu/agentlu 1.9.0 → 1.10.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 +18 -0
- package/dist/generated.d.ts +34 -9
- package/dist/index.d.ts +17 -2
- package/dist/index.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -341,3 +341,21 @@ if (response.agentlu?.browser?.status === "needs_human") {
|
|
|
341
341
|
Browser response metadata contains the session and page identity plus screenshot
|
|
342
342
|
ids. Screenshot pixels stay in the authenticated viewer and are not copied into
|
|
343
343
|
API response metadata.
|
|
344
|
+
|
|
345
|
+
### Household signals (Herald)
|
|
346
|
+
|
|
347
|
+
Apps should send structured facts to Herald, not post directly to the ChatLu
|
|
348
|
+
family room through notif. Herald decides whether/when/how to share them.
|
|
349
|
+
|
|
350
|
+
```ts
|
|
351
|
+
const alu = new AgentLu({ apiKey: "alu_your_client_key" });
|
|
352
|
+
const signal = await alu.household.signal({
|
|
353
|
+
source: "mealu", kind: "milestone", title: "A household milestone",
|
|
354
|
+
facts: { count: 3 }, urgency: "today", dedupeKey: "milestone-2026-11-08",
|
|
355
|
+
});
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
`WireHouseholdSignalInput` → `Promise<WireHouseholdSignalResult>` (`id`, `status`,
|
|
359
|
+
`deduped`). Facts are data, never instructions; urgency `now` requests a batched
|
|
360
|
+
review, not guaranteed delivery. See [Household signals](../../docs/household-signals.md)
|
|
361
|
+
for limits, expiry, dedupe and editorial semantics.
|
package/dist/generated.d.ts
CHANGED
|
@@ -8,6 +8,21 @@
|
|
|
8
8
|
* contract. They describe the bytes on the wire (snake_case); the SDK's own
|
|
9
9
|
* types are the ergonomic view over them.
|
|
10
10
|
*/
|
|
11
|
+
export interface WireHouseholdSignalInput {
|
|
12
|
+
"source": string;
|
|
13
|
+
"kind": string;
|
|
14
|
+
"title": string;
|
|
15
|
+
"facts": Record<string, unknown>;
|
|
16
|
+
"urgency"?: "fyi" | "today" | "now";
|
|
17
|
+
"dedupeKey": string;
|
|
18
|
+
"occurredAt"?: string;
|
|
19
|
+
"expiresAt"?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface WireHouseholdSignalResult {
|
|
22
|
+
"id": string;
|
|
23
|
+
"status": "pending" | "held" | "posted" | "folded" | "dropped" | "expired" | "failed";
|
|
24
|
+
"deduped": boolean;
|
|
25
|
+
}
|
|
11
26
|
export interface WireCreateResponse {
|
|
12
27
|
/** Execution backend. */
|
|
13
28
|
"backend"?: "pi";
|
|
@@ -71,7 +86,7 @@ export interface WireCreateResponse {
|
|
|
71
86
|
"metadata"?: Record<string, string>;
|
|
72
87
|
"include"?: Array<"reasoning" | "rounds" | "subagents" | "artifacts">;
|
|
73
88
|
/** Which agent runs the request. The recommended general machine agent is `api`, which has no persona: `instructions` replace its system prompt. Pin `fast` for the chat-tuned version. `direct` selects the direct tier: the profile-free `api` agent with no tools and no session (see the Tiers section). `household/<slug>` runs a household agent built in the Agents studio (list them at GET /v1/agents). An `<app>/<name>` id runs an agent the caller's app declared at registration. `research` is an alias for `thorough` with Report output (a sourced report artifact). Retired ids (`mealu`, `nestlu`, `kitchen`, `waterlu`, `money`, `swarm`, `storylu`, `google-research`, `google-image`, `android`) return HTTP 400 `unknown_agent` with a pointer to their successor; the Android phone is now the `android` tool family on `assistant`. */
|
|
74
|
-
"agent"?: "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "
|
|
89
|
+
"agent"?: "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "herald" | "cradle" | "custom" | "direct" | string | "mealu" | "nestlu" | "kitchen" | "waterlu" | "money" | "swarm" | "stage" | "roleplay" | "storylu" | "google-research" | "google-image" | "android" | "research";
|
|
75
90
|
/** Thinking level. Explicit `effort: "off"` is honored; other requests are clamped to the selected model's supported capabilities. The SDK does not promise provider benchmark parity. */
|
|
76
91
|
"reasoning"?: {
|
|
77
92
|
"effort"?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
@@ -149,8 +164,9 @@ export interface WireRegisterClientRequest {
|
|
|
149
164
|
/** Run defaults applied when a request omits the field: request > registered client default > use-case tier > agent/profile default. The built-in `store` default is true. Register one client per use-case (e.g. mealu-enrich) with its system prompt and tools baked in. */
|
|
150
165
|
"defaults"?: {
|
|
151
166
|
"backend"?: "pi";
|
|
152
|
-
"agent"?: "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "
|
|
167
|
+
"agent"?: "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "herald" | "cradle" | "custom" | "direct" | string | "mealu" | "nestlu" | "kitchen" | "waterlu" | "money" | "swarm" | "stage" | "roleplay" | "storylu" | "google-research" | "google-image" | "android" | "research";
|
|
153
168
|
"model"?: string;
|
|
169
|
+
"modelRoute"?: "chat.quick" | "chat.household" | "chat.deep" | "chat.code" | "device" | "background.digest" | "utility" | "memory.extract" | "memory.judge" | "memory.consolidate";
|
|
154
170
|
"instructions"?: string;
|
|
155
171
|
"temperature"?: number;
|
|
156
172
|
"store"?: boolean;
|
|
@@ -200,9 +216,11 @@ export interface WireRegisterClientRequest {
|
|
|
200
216
|
export interface WireClientDefaults {
|
|
201
217
|
"backend"?: "pi";
|
|
202
218
|
/** Which agent runs the request. The recommended general machine agent is `api`, which has no persona: `instructions` replace its system prompt. Pin `fast` for the chat-tuned version. `direct` selects the direct tier: the profile-free `api` agent with no tools and no session (see the Tiers section). `household/<slug>` runs a household agent built in the Agents studio (list them at GET /v1/agents). An `<app>/<name>` id runs an agent the caller's app declared at registration. `research` is an alias for `thorough` with Report output (a sourced report artifact). Retired ids (`mealu`, `nestlu`, `kitchen`, `waterlu`, `money`, `swarm`, `storylu`, `google-research`, `google-image`, `android`) return HTTP 400 `unknown_agent` with a pointer to their successor; the Android phone is now the `android` tool family on `assistant`. */
|
|
203
|
-
"agent"?: "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "
|
|
219
|
+
"agent"?: "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "herald" | "cradle" | "custom" | "direct" | string | "mealu" | "nestlu" | "kitchen" | "waterlu" | "money" | "swarm" | "stage" | "roleplay" | "storylu" | "google-research" | "google-image" | "android" | "research";
|
|
204
220
|
/** ModelConfig id (GET /v1/models). Stock clients may also use an agent name here; prefer explicit `agent` for machine calls. */
|
|
205
221
|
"model"?: string;
|
|
222
|
+
/** Task route whose pool order and effort apply to automatic model selection. Mutually exclusive with model. Explicit request models, builtin chat agents, and agent model pins win; app-owned and api agents inherit the client route. */
|
|
223
|
+
"modelRoute"?: "chat.quick" | "chat.household" | "chat.deep" | "chat.code" | "device" | "background.digest" | "utility" | "memory.extract" | "memory.judge" | "memory.consolidate";
|
|
206
224
|
/** System prompt for every run of this client. */
|
|
207
225
|
"instructions"?: string;
|
|
208
226
|
"temperature"?: number;
|
|
@@ -263,7 +281,7 @@ export interface WireAppAgentDeclaration {
|
|
|
263
281
|
}
|
|
264
282
|
export interface WireCreateThreadRequest {
|
|
265
283
|
"title"?: string;
|
|
266
|
-
"agent"?: "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "
|
|
284
|
+
"agent"?: "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "herald" | "cradle" | "custom" | "research" | string;
|
|
267
285
|
"model"?: string;
|
|
268
286
|
"person"?: string | null;
|
|
269
287
|
"owner"?: "client" | "person";
|
|
@@ -299,7 +317,7 @@ export interface WireResponse {
|
|
|
299
317
|
"created_at": number;
|
|
300
318
|
"status": "queued" | "in_progress" | "completed" | "failed" | "incomplete" | "cancelled";
|
|
301
319
|
"backend": "pi";
|
|
302
|
-
"agent": "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "
|
|
320
|
+
"agent": "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "herald" | "cradle" | "custom";
|
|
303
321
|
"model": string;
|
|
304
322
|
"conversation"?: {
|
|
305
323
|
"id": string;
|
|
@@ -369,6 +387,7 @@ export interface WireResponse {
|
|
|
369
387
|
"thread_id"?: string | null;
|
|
370
388
|
"retries"?: number;
|
|
371
389
|
"effective_model"?: string | null;
|
|
390
|
+
"model_route"?: "chat.quick" | "chat.household" | "chat.deep" | "chat.code" | "device" | "background.digest" | "utility" | "memory.extract" | "memory.judge" | "memory.consolidate";
|
|
372
391
|
"service_tier"?: "standard" | "priority";
|
|
373
392
|
"execution_path"?: string | null;
|
|
374
393
|
"queue_wait_ms"?: number | null;
|
|
@@ -411,6 +430,8 @@ export interface WireResponse {
|
|
|
411
430
|
"android"?: {
|
|
412
431
|
"sessionId"?: string;
|
|
413
432
|
"username"?: string;
|
|
433
|
+
"device"?: string;
|
|
434
|
+
"deviceName"?: string;
|
|
414
435
|
"ownerId"?: string;
|
|
415
436
|
"status": "active" | "needs_human" | "human_control" | "idle" | "closed" | "interrupted" | "reserved";
|
|
416
437
|
"action"?: string;
|
|
@@ -486,7 +507,7 @@ export interface WireThread {
|
|
|
486
507
|
"created_at": number;
|
|
487
508
|
"updated_at": number;
|
|
488
509
|
"title": string;
|
|
489
|
-
"agent": "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "
|
|
510
|
+
"agent": "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "herald" | "cradle" | "custom";
|
|
490
511
|
"model": string | null;
|
|
491
512
|
/** "api" for threads created through /v1; "chat" when a human started it. */
|
|
492
513
|
"origin": string;
|
|
@@ -525,8 +546,9 @@ export interface WireClient {
|
|
|
525
546
|
"allow_person_threads"?: boolean;
|
|
526
547
|
"defaults"?: {
|
|
527
548
|
"backend"?: "pi";
|
|
528
|
-
"agent"?: "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "
|
|
549
|
+
"agent"?: "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "herald" | "cradle" | "custom" | "direct" | string | "mealu" | "nestlu" | "kitchen" | "waterlu" | "money" | "swarm" | "stage" | "roleplay" | "storylu" | "google-research" | "google-image" | "android" | "research";
|
|
529
550
|
"model"?: string;
|
|
551
|
+
"modelRoute"?: "chat.quick" | "chat.household" | "chat.deep" | "chat.code" | "device" | "background.digest" | "utility" | "memory.extract" | "memory.judge" | "memory.consolidate";
|
|
530
552
|
"instructions"?: string;
|
|
531
553
|
"temperature"?: number;
|
|
532
554
|
"store"?: boolean;
|
|
@@ -650,7 +672,7 @@ export interface WireResponseList {
|
|
|
650
672
|
"created_at": number;
|
|
651
673
|
"status": "queued" | "in_progress" | "completed" | "failed" | "incomplete" | "cancelled";
|
|
652
674
|
"backend": "pi";
|
|
653
|
-
"agent": "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "
|
|
675
|
+
"agent": "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "herald" | "cradle" | "custom";
|
|
654
676
|
"model": string;
|
|
655
677
|
"conversation"?: {
|
|
656
678
|
"id": string;
|
|
@@ -715,6 +737,7 @@ export interface WireResponseList {
|
|
|
715
737
|
"thread_id"?: string | null;
|
|
716
738
|
"retries"?: number;
|
|
717
739
|
"effective_model"?: string | null;
|
|
740
|
+
"model_route"?: "chat.quick" | "chat.household" | "chat.deep" | "chat.code" | "device" | "background.digest" | "utility" | "memory.extract" | "memory.judge" | "memory.consolidate";
|
|
718
741
|
"service_tier"?: "standard" | "priority";
|
|
719
742
|
"execution_path"?: string | null;
|
|
720
743
|
"queue_wait_ms"?: number | null;
|
|
@@ -757,6 +780,8 @@ export interface WireResponseList {
|
|
|
757
780
|
"android"?: {
|
|
758
781
|
"sessionId"?: string;
|
|
759
782
|
"username"?: string;
|
|
783
|
+
"device"?: string;
|
|
784
|
+
"deviceName"?: string;
|
|
760
785
|
"ownerId"?: string;
|
|
761
786
|
"status": "active" | "needs_human" | "human_control" | "idle" | "closed" | "interrupted" | "reserved";
|
|
762
787
|
"action"?: string;
|
|
@@ -782,7 +807,7 @@ export interface WireThreadList {
|
|
|
782
807
|
"created_at": number;
|
|
783
808
|
"updated_at": number;
|
|
784
809
|
"title": string;
|
|
785
|
-
"agent": "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "
|
|
810
|
+
"agent": "auto" | "fast" | "thorough" | "assistant" | "code" | "google" | "image" | "api" | "digest" | "herald" | "cradle" | "custom";
|
|
786
811
|
"model": string | null;
|
|
787
812
|
"origin": string;
|
|
788
813
|
"end_user"?: string | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
* Wire types generated from the server's zod contract are re-exported here as
|
|
25
25
|
* `Wire*` types (see `generated.ts`, regenerate with `npm run gen:contract`).
|
|
26
26
|
*/
|
|
27
|
-
import type { WireAppAgentDeclaration, WireClientDefaults, WireUseCaseProfile } from "./generated.js";
|
|
28
|
-
export type { WireAppAgentDeclaration, WireAgentInfo, WireChatCompletion, WireChatCompletionRequest, WireClient, WireClientDefaults, WireCreateDecision, WireCreateResponse, WireCreateThreadRequest, WireDecision, WireError, WireFile, WireModelInfo, WireRegisterClientRequest, WireResponse, WireStreamEvent, WireThread, WireThreadMessage, WireToolInfo, WireUseCaseProfile, } from "./generated.js";
|
|
27
|
+
import type { WireHouseholdSignalInput, WireHouseholdSignalResult, WireAppAgentDeclaration, WireClientDefaults, WireUseCaseProfile } from "./generated.js";
|
|
28
|
+
export type { WireHouseholdSignalInput, WireHouseholdSignalResult, WireAppAgentDeclaration, WireAgentInfo, WireChatCompletion, WireChatCompletionRequest, WireClient, WireClientDefaults, WireCreateDecision, WireCreateResponse, WireCreateThreadRequest, WireDecision, WireError, WireFile, WireModelInfo, WireRegisterClientRequest, WireResponse, WireStreamEvent, WireThread, WireThreadMessage, WireToolInfo, WireUseCaseProfile, } from "./generated.js";
|
|
29
29
|
export declare const DEFAULT_BASE_URL = "http://localhost:8912/v1";
|
|
30
30
|
/**
|
|
31
31
|
* Accept an origin (`http://host:8912`) or a `/v1` base and normalize to the
|
|
@@ -86,6 +86,8 @@ export interface AndroidOperation {
|
|
|
86
86
|
export interface AndroidActivity {
|
|
87
87
|
sessionId: string;
|
|
88
88
|
username: string;
|
|
89
|
+
device?: string;
|
|
90
|
+
deviceName?: string;
|
|
89
91
|
ownerId?: string;
|
|
90
92
|
status: AndroidStatus;
|
|
91
93
|
action?: string;
|
|
@@ -183,6 +185,16 @@ export interface DecisionOptions {
|
|
|
183
185
|
/** Caller cancellation, combined with `timeoutMs` when both are set. */
|
|
184
186
|
signal?: AbortSignal;
|
|
185
187
|
}
|
|
188
|
+
/** Per-request transport knobs threaded through `request()` / `raw()`. */
|
|
189
|
+
interface RequestOptions {
|
|
190
|
+
auth?: boolean;
|
|
191
|
+
apiKey?: string;
|
|
192
|
+
timeoutMs?: number;
|
|
193
|
+
maxAttempts?: number;
|
|
194
|
+
signal?: AbortSignal;
|
|
195
|
+
/** Extra request headers (e.g. a caller-supplied Idempotency-Key). */
|
|
196
|
+
headers?: Record<string, string>;
|
|
197
|
+
}
|
|
186
198
|
export interface DecisionObject {
|
|
187
199
|
id: string;
|
|
188
200
|
object: "decision";
|
|
@@ -656,6 +668,9 @@ export declare class AgentLu {
|
|
|
656
668
|
delete: (id: string) => Promise<unknown>;
|
|
657
669
|
messages: (id: string) => Promise<unknown>;
|
|
658
670
|
};
|
|
671
|
+
readonly household: {
|
|
672
|
+
signal: (input: WireHouseholdSignalInput, opts?: RequestOptions) => Promise<WireHouseholdSignalResult>;
|
|
673
|
+
};
|
|
659
674
|
/**
|
|
660
675
|
* Decision model (System One / Jev): typed questions in, calibrated
|
|
661
676
|
* probabilities out, ~100-500ms. Sync only - there is no stream or poll.
|
package/dist/index.js
CHANGED
|
@@ -728,6 +728,9 @@ export class AgentLu {
|
|
|
728
728
|
delete: (id) => this.request("DELETE", `/threads/${encodeURIComponent(id)}`),
|
|
729
729
|
messages: (id) => this.request("GET", `/threads/${encodeURIComponent(id)}/messages`),
|
|
730
730
|
};
|
|
731
|
+
household = {
|
|
732
|
+
signal: (input, opts) => this.request("POST", "/household/signals", input, opts),
|
|
733
|
+
};
|
|
731
734
|
/**
|
|
732
735
|
* Decision model (System One / Jev): typed questions in, calibrated
|
|
733
736
|
* probabilities out, ~100-500ms. Sync only - there is no stream or poll.
|
package/package.json
CHANGED