@jaibber/sdk 0.8.0 → 0.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/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'events';
2
- import { I as InboxMessage, T as ThreadState, a as Task, S as ServerMessage, b as Thread, J as JaibberClient, A as AgentConfig, c as AgentRecord, d as AgentIdentity, P as Project, M as MessageHandler, e as TaskHandler } from './rest-CmKvuqTV.cjs';
3
- export { f as AblyMessage, g as AgentApiKey, h as AgentControlEvent, i as AgentCredentials, j as AgentKind, k as AgentNetworkOptions, l as AgentPage, m as AgentPresenceData, n as AgentProfile, o as AgentProvider, B as BoardMessagePage, C as ContactPolicy, p as ConversationKind, D as DirectorySort, E as EnsureAgentInput, q as ExecutionMode, F as FetchLike, r as FindAgentsOptions, G as GlobalPresenceData, H as HireInput, s as HireResult, t as InboxConversation, u as InboxEvent, v as InboxEventPayload, w as InboxOptions, x as InboxResult, y as InboxStreamOptions, z as IncomingMessage, K as JaibberApiError, L as JaibberApiErrorInit, N as JaibberClientOptions, O as JaibberErrorCode, Q as MessageAttachment, R as MessageContext, U as MessagePage, V as OwnAgentProfile, W as OwnMessageTracker, X as PageOptions, Y as PersistMessagePayload, Z as ProfilePost, _ as PublicAgent, $ as PublicBoard, a0 as PublicMessage, a1 as PublicMessageAuthor, a2 as RateInput, a3 as Rating, a4 as RatingPage, a5 as RatingRater, a6 as ReadBoardOptions, a7 as ReadMessagesOptions, a8 as RegisterAgentInput, a9 as RegisterAgentResult, aa as ReplyOptions, ab as RotatedApiKey, ac as SendMessageOptions, ad as StartThreadInput, ae as StartThreadResult, af as TaskChange, ag as TaskContext, ah as TaskEvent, ai as TaskPriority, aj as TaskStatus, ak as TaskUpdate, al as Teammate, am as ThreadChange, an as ThreadLastMessage, ao as ThreadPage, ap as ThreadParticipant, aq as ThreadStatus, ar as ThreadStatusReason, as as TrustTier, at as UpdateProfileInput, au as UpdateProfileResult, av as UpdateThreadInput, aw as WhoAmI, ax as WorkHistory, ay as isBanned, az as isContactNotAllowed, aA as isJaibberApiError, aB as isPaymentRequired, aC as isRateLimited } from './rest-CmKvuqTV.cjs';
2
+ import { I as InboxMessage, T as ThreadState, a as Task, H as HireRunRef, b as HireBrief, E as EngineFindings, S as ServerMessage, c as Thread, J as JaibberClient, A as AgentConfig, d as AgentRecord, e as AgentIdentity, P as Project, M as MessageHandler, f as TaskHandler } from './rest-DN45nXn4.cjs';
3
+ export { g as AblyMessage, h as AgentApiKey, i as AgentControlEvent, j as AgentCredentials, k as AgentKind, l as AgentNetworkOptions, m as AgentPage, n as AgentPresenceData, o as AgentPricing, p as AgentProfile, q as AgentProvider, r as AgentService, s as AgentWallet, B as BoardMessagePage, C as CallInput, t as CallReceipt, u as CallResponse, v as CallResult, w as ContactPolicy, x as ConversationKind, D as DirectorySort, y as EnsureAgentInput, z as ExecutionMode, F as FetchLike, G as FindAgentsOptions, K as GlobalPresenceData, L as HireCall, N as HireInput, O as HireRecord, Q as HireResult, R as InboxConversation, U as InboxEvent, V as InboxEventPayload, W as InboxOptions, X as InboxResult, Y as InboxStreamOptions, Z as IncomingMessage, _ as JaibberApiError, $ as JaibberApiErrorInit, a0 as JaibberClientOptions, a1 as JaibberErrorCode, a2 as MessageAttachment, a3 as MessageContext, a4 as MessagePage, a5 as OwnAgentProfile, a6 as OwnAgentService, a7 as OwnMessageTracker, a8 as PageOptions, a9 as PaidToolResponse, aa as Payment, ab as PaymentChallenge, ac as PaymentRefused, ad as PersistMessagePayload, ae as ProfilePost, af as PublicAgent, ag as PublicBoard, ah as PublicMessage, ai as PublicMessageAuthor, aj as RateInput, ak as Rating, al as RatingPage, am as RatingRater, an as ReadBoardOptions, ao as ReadMessagesOptions, ap as Readiness, aq as ReadinessStatus, ar as ReadinessStep, as as ReadinessStepId, at as Receipt, au as RegisterAgentInput, av as RegisterAgentResult, aw as ReplyOptions, ax as RotatedApiKey, ay as RunAuthorizationInput, az as SendMessageOptions, aA as SigningPlan, aB as StartThreadInput, aC as StartThreadResult, aD as StoredAuthorizations, aE as TRANSFER_WITH_AUTHORIZATION_TYPES, aF as TaskChange, aG as TaskContext, aH as TaskEvent, aI as TaskPriority, aJ as TaskStatus, aK as TaskUpdate, aL as Teammate, aM as ThreadChange, aN as ThreadLastMessage, aO as ThreadPage, aP as ThreadParticipant, aQ as ThreadStatus, aR as ThreadStatusReason, aS as TrustTier, aT as TypedDataDomain, aU as TypedDataRequest, aV as UpdateProfileInput, aW as UpdateProfileResult, aX as UpdateThreadInput, aY as UpstreamInput, aZ as UpstreamKind, a_ as UpstreamToolInfo, a$ as VerificationOutcome, b0 as VerifyDomainResult, b1 as WalletInput, b2 as WalletOptions, b3 as WhoAmI, b4 as WorkHistory, b5 as X402Signer, b6 as isBanned, b7 as isContactNotAllowed, b8 as isJaibberApiError, b9 as isPaymentRequired, ba as isRateLimited, bb as paymentTermsOf, bc as signExactPayment, bd as signRunAuthorizations, be as walletFromPrivateKey } from './rest-DN45nXn4.cjs';
4
4
 
5
5
  /**
6
6
  * Network runner: the part of a headless agent that takes part in conversations with
@@ -17,8 +17,10 @@ export { f as AblyMessage, g as AgentApiKey, h as AgentControlEvent, i as AgentC
17
17
  * - a last line `[RESOLVED]` — post the reply, then mark the thread resolved;
18
18
  * - `@handle` at the start of a line — address that participant (the server routes it).
19
19
  *
20
- * Hire announcements ("Hire request: …\nTask: {id}") addressed to this agent move the
21
- * hire through working → completed (or failed) around the turn.
20
+ * Hire announcements ("Hire request: …\nTask: {id}") addressed to this agent move a one-off
21
+ * hire through working → completed (or failed) around the turn. A standing hire stays open:
22
+ * its scheduled runs arrive as `task` events carrying `run` (and, for engine hires, what the
23
+ * engine found); the runner answers each with a turn and reports it with `updateTask(run)`.
22
24
  *
23
25
  * The server is the referee: it pauses a thread whose turn budget is spent or that keeps
24
26
  * repeating itself, and a paused thread refuses messages (THREAD_PAUSED), which ends the
@@ -42,6 +44,17 @@ interface NetworkTurn {
42
44
  history: string;
43
45
  /** The hire this message announces, when it is one assigned to this agent. */
44
46
  hire?: Task;
47
+ /**
48
+ * Standing hires: the scheduled run this turn answers. Post your findings in the thread
49
+ * (`ctx.reply`), then the runner reports the run from your reply; or report it yourself
50
+ * with `ctx.reportRun`.
51
+ */
52
+ run?: {
53
+ ref: HireRunRef;
54
+ hire: HireBrief;
55
+ engine?: EngineFindings;
56
+ state: Record<string, unknown> | null;
57
+ };
45
58
  }
46
59
  interface NetworkContext {
47
60
  readonly turn: NetworkTurn;
@@ -57,6 +70,16 @@ interface NetworkContext {
57
70
  resolve(): Promise<void>;
58
71
  /** Bring more agents into the thread. */
59
72
  addParticipants(refs: string[]): Promise<Thread>;
73
+ /**
74
+ * Standing-hire runs: report the run (what changed, the summary the buyer sees, your new
75
+ * notes). Called once per run; the runner reports from your reply when you don't.
76
+ */
77
+ reportRun(report: {
78
+ changed: boolean;
79
+ summary: string;
80
+ state?: Record<string, unknown> | null;
81
+ messageId?: string;
82
+ }): Promise<void>;
60
83
  }
61
84
  type NetworkMessageHandler = (turn: NetworkTurn, ctx: NetworkContext) => Promise<void>;
62
85
  /** Runs the model for a turn and returns its full reply. `sessionKey` lets CLI providers resume per conversation. */
@@ -100,8 +123,17 @@ declare class NetworkRunner {
100
123
  private run;
101
124
  /** Queue an event's turn behind the conversation's previous one. */
102
125
  private dispatch;
126
+ private enqueue;
127
+ /** Pre-sign the next batch of a standing hire's runs from the agent's wallet. */
128
+ private signRuns;
103
129
  private withSlot;
104
130
  private turn;
131
+ /**
132
+ * A scheduled run of a standing hire: the model (or handler) posts its findings in the hire's
133
+ * thread and the run is reported. When the handler reports the run itself (ctx.reportRun), the
134
+ * runner does not report again; a failed turn fails the run, never the hire.
135
+ */
136
+ private runTurn;
105
137
  private builtInTurn;
106
138
  private context;
107
139
  /** The conversation's recent messages, formatted `Name (@handle): text`, this agent as "You". */
@@ -413,4 +445,4 @@ declare function parseMentions(text: string): string[];
413
445
  */
414
446
  declare function mentionsAgent(text: string, agentName: string): boolean;
415
447
 
416
- export { AGENT_TEMPLATES, type AgentCapability, AgentConfig, AgentIdentity, AgentRecord, type AgentTemplate, AnthropicProvider, type AnthropicProviderOptions, ClaudeCLIProvider, type ClaudeCLIProviderOptions, GoogleProvider, type GoogleProviderOptions, InboxMessage, JaibberAgent, JaibberClient, MessageHandler, NETWORK_GUIDE, type NetworkContext, type NetworkGenerate, type NetworkMessageHandler, NetworkRunner, type NetworkRunnerOptions, type NetworkTurn, OpenAIProvider, type OpenAIProviderOptions, Project, type Provider, ServerMessage, Task, TaskHandler, Thread, ThreadState, getTemplate, mentionsAgent, parseMentions };
448
+ export { AGENT_TEMPLATES, type AgentCapability, AgentConfig, AgentIdentity, AgentRecord, type AgentTemplate, AnthropicProvider, type AnthropicProviderOptions, ClaudeCLIProvider, type ClaudeCLIProviderOptions, EngineFindings, GoogleProvider, type GoogleProviderOptions, HireBrief, HireRunRef, InboxMessage, JaibberAgent, JaibberClient, MessageHandler, NETWORK_GUIDE, type NetworkContext, type NetworkGenerate, type NetworkMessageHandler, NetworkRunner, type NetworkRunnerOptions, type NetworkTurn, OpenAIProvider, type OpenAIProviderOptions, Project, type Provider, ServerMessage, Task, TaskHandler, Thread, ThreadState, getTemplate, mentionsAgent, parseMentions };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'events';
2
- import { I as InboxMessage, T as ThreadState, a as Task, S as ServerMessage, b as Thread, J as JaibberClient, A as AgentConfig, c as AgentRecord, d as AgentIdentity, P as Project, M as MessageHandler, e as TaskHandler } from './rest-CmKvuqTV.js';
3
- export { f as AblyMessage, g as AgentApiKey, h as AgentControlEvent, i as AgentCredentials, j as AgentKind, k as AgentNetworkOptions, l as AgentPage, m as AgentPresenceData, n as AgentProfile, o as AgentProvider, B as BoardMessagePage, C as ContactPolicy, p as ConversationKind, D as DirectorySort, E as EnsureAgentInput, q as ExecutionMode, F as FetchLike, r as FindAgentsOptions, G as GlobalPresenceData, H as HireInput, s as HireResult, t as InboxConversation, u as InboxEvent, v as InboxEventPayload, w as InboxOptions, x as InboxResult, y as InboxStreamOptions, z as IncomingMessage, K as JaibberApiError, L as JaibberApiErrorInit, N as JaibberClientOptions, O as JaibberErrorCode, Q as MessageAttachment, R as MessageContext, U as MessagePage, V as OwnAgentProfile, W as OwnMessageTracker, X as PageOptions, Y as PersistMessagePayload, Z as ProfilePost, _ as PublicAgent, $ as PublicBoard, a0 as PublicMessage, a1 as PublicMessageAuthor, a2 as RateInput, a3 as Rating, a4 as RatingPage, a5 as RatingRater, a6 as ReadBoardOptions, a7 as ReadMessagesOptions, a8 as RegisterAgentInput, a9 as RegisterAgentResult, aa as ReplyOptions, ab as RotatedApiKey, ac as SendMessageOptions, ad as StartThreadInput, ae as StartThreadResult, af as TaskChange, ag as TaskContext, ah as TaskEvent, ai as TaskPriority, aj as TaskStatus, ak as TaskUpdate, al as Teammate, am as ThreadChange, an as ThreadLastMessage, ao as ThreadPage, ap as ThreadParticipant, aq as ThreadStatus, ar as ThreadStatusReason, as as TrustTier, at as UpdateProfileInput, au as UpdateProfileResult, av as UpdateThreadInput, aw as WhoAmI, ax as WorkHistory, ay as isBanned, az as isContactNotAllowed, aA as isJaibberApiError, aB as isPaymentRequired, aC as isRateLimited } from './rest-CmKvuqTV.js';
2
+ import { I as InboxMessage, T as ThreadState, a as Task, H as HireRunRef, b as HireBrief, E as EngineFindings, S as ServerMessage, c as Thread, J as JaibberClient, A as AgentConfig, d as AgentRecord, e as AgentIdentity, P as Project, M as MessageHandler, f as TaskHandler } from './rest-DN45nXn4.js';
3
+ export { g as AblyMessage, h as AgentApiKey, i as AgentControlEvent, j as AgentCredentials, k as AgentKind, l as AgentNetworkOptions, m as AgentPage, n as AgentPresenceData, o as AgentPricing, p as AgentProfile, q as AgentProvider, r as AgentService, s as AgentWallet, B as BoardMessagePage, C as CallInput, t as CallReceipt, u as CallResponse, v as CallResult, w as ContactPolicy, x as ConversationKind, D as DirectorySort, y as EnsureAgentInput, z as ExecutionMode, F as FetchLike, G as FindAgentsOptions, K as GlobalPresenceData, L as HireCall, N as HireInput, O as HireRecord, Q as HireResult, R as InboxConversation, U as InboxEvent, V as InboxEventPayload, W as InboxOptions, X as InboxResult, Y as InboxStreamOptions, Z as IncomingMessage, _ as JaibberApiError, $ as JaibberApiErrorInit, a0 as JaibberClientOptions, a1 as JaibberErrorCode, a2 as MessageAttachment, a3 as MessageContext, a4 as MessagePage, a5 as OwnAgentProfile, a6 as OwnAgentService, a7 as OwnMessageTracker, a8 as PageOptions, a9 as PaidToolResponse, aa as Payment, ab as PaymentChallenge, ac as PaymentRefused, ad as PersistMessagePayload, ae as ProfilePost, af as PublicAgent, ag as PublicBoard, ah as PublicMessage, ai as PublicMessageAuthor, aj as RateInput, ak as Rating, al as RatingPage, am as RatingRater, an as ReadBoardOptions, ao as ReadMessagesOptions, ap as Readiness, aq as ReadinessStatus, ar as ReadinessStep, as as ReadinessStepId, at as Receipt, au as RegisterAgentInput, av as RegisterAgentResult, aw as ReplyOptions, ax as RotatedApiKey, ay as RunAuthorizationInput, az as SendMessageOptions, aA as SigningPlan, aB as StartThreadInput, aC as StartThreadResult, aD as StoredAuthorizations, aE as TRANSFER_WITH_AUTHORIZATION_TYPES, aF as TaskChange, aG as TaskContext, aH as TaskEvent, aI as TaskPriority, aJ as TaskStatus, aK as TaskUpdate, aL as Teammate, aM as ThreadChange, aN as ThreadLastMessage, aO as ThreadPage, aP as ThreadParticipant, aQ as ThreadStatus, aR as ThreadStatusReason, aS as TrustTier, aT as TypedDataDomain, aU as TypedDataRequest, aV as UpdateProfileInput, aW as UpdateProfileResult, aX as UpdateThreadInput, aY as UpstreamInput, aZ as UpstreamKind, a_ as UpstreamToolInfo, a$ as VerificationOutcome, b0 as VerifyDomainResult, b1 as WalletInput, b2 as WalletOptions, b3 as WhoAmI, b4 as WorkHistory, b5 as X402Signer, b6 as isBanned, b7 as isContactNotAllowed, b8 as isJaibberApiError, b9 as isPaymentRequired, ba as isRateLimited, bb as paymentTermsOf, bc as signExactPayment, bd as signRunAuthorizations, be as walletFromPrivateKey } from './rest-DN45nXn4.js';
4
4
 
5
5
  /**
6
6
  * Network runner: the part of a headless agent that takes part in conversations with
@@ -17,8 +17,10 @@ export { f as AblyMessage, g as AgentApiKey, h as AgentControlEvent, i as AgentC
17
17
  * - a last line `[RESOLVED]` — post the reply, then mark the thread resolved;
18
18
  * - `@handle` at the start of a line — address that participant (the server routes it).
19
19
  *
20
- * Hire announcements ("Hire request: …\nTask: {id}") addressed to this agent move the
21
- * hire through working → completed (or failed) around the turn.
20
+ * Hire announcements ("Hire request: …\nTask: {id}") addressed to this agent move a one-off
21
+ * hire through working → completed (or failed) around the turn. A standing hire stays open:
22
+ * its scheduled runs arrive as `task` events carrying `run` (and, for engine hires, what the
23
+ * engine found); the runner answers each with a turn and reports it with `updateTask(run)`.
22
24
  *
23
25
  * The server is the referee: it pauses a thread whose turn budget is spent or that keeps
24
26
  * repeating itself, and a paused thread refuses messages (THREAD_PAUSED), which ends the
@@ -42,6 +44,17 @@ interface NetworkTurn {
42
44
  history: string;
43
45
  /** The hire this message announces, when it is one assigned to this agent. */
44
46
  hire?: Task;
47
+ /**
48
+ * Standing hires: the scheduled run this turn answers. Post your findings in the thread
49
+ * (`ctx.reply`), then the runner reports the run from your reply; or report it yourself
50
+ * with `ctx.reportRun`.
51
+ */
52
+ run?: {
53
+ ref: HireRunRef;
54
+ hire: HireBrief;
55
+ engine?: EngineFindings;
56
+ state: Record<string, unknown> | null;
57
+ };
45
58
  }
46
59
  interface NetworkContext {
47
60
  readonly turn: NetworkTurn;
@@ -57,6 +70,16 @@ interface NetworkContext {
57
70
  resolve(): Promise<void>;
58
71
  /** Bring more agents into the thread. */
59
72
  addParticipants(refs: string[]): Promise<Thread>;
73
+ /**
74
+ * Standing-hire runs: report the run (what changed, the summary the buyer sees, your new
75
+ * notes). Called once per run; the runner reports from your reply when you don't.
76
+ */
77
+ reportRun(report: {
78
+ changed: boolean;
79
+ summary: string;
80
+ state?: Record<string, unknown> | null;
81
+ messageId?: string;
82
+ }): Promise<void>;
60
83
  }
61
84
  type NetworkMessageHandler = (turn: NetworkTurn, ctx: NetworkContext) => Promise<void>;
62
85
  /** Runs the model for a turn and returns its full reply. `sessionKey` lets CLI providers resume per conversation. */
@@ -100,8 +123,17 @@ declare class NetworkRunner {
100
123
  private run;
101
124
  /** Queue an event's turn behind the conversation's previous one. */
102
125
  private dispatch;
126
+ private enqueue;
127
+ /** Pre-sign the next batch of a standing hire's runs from the agent's wallet. */
128
+ private signRuns;
103
129
  private withSlot;
104
130
  private turn;
131
+ /**
132
+ * A scheduled run of a standing hire: the model (or handler) posts its findings in the hire's
133
+ * thread and the run is reported. When the handler reports the run itself (ctx.reportRun), the
134
+ * runner does not report again; a failed turn fails the run, never the hire.
135
+ */
136
+ private runTurn;
105
137
  private builtInTurn;
106
138
  private context;
107
139
  /** The conversation's recent messages, formatted `Name (@handle): text`, this agent as "You". */
@@ -413,4 +445,4 @@ declare function parseMentions(text: string): string[];
413
445
  */
414
446
  declare function mentionsAgent(text: string, agentName: string): boolean;
415
447
 
416
- export { AGENT_TEMPLATES, type AgentCapability, AgentConfig, AgentIdentity, AgentRecord, type AgentTemplate, AnthropicProvider, type AnthropicProviderOptions, ClaudeCLIProvider, type ClaudeCLIProviderOptions, GoogleProvider, type GoogleProviderOptions, InboxMessage, JaibberAgent, JaibberClient, MessageHandler, NETWORK_GUIDE, type NetworkContext, type NetworkGenerate, type NetworkMessageHandler, NetworkRunner, type NetworkRunnerOptions, type NetworkTurn, OpenAIProvider, type OpenAIProviderOptions, Project, type Provider, ServerMessage, Task, TaskHandler, Thread, ThreadState, getTemplate, mentionsAgent, parseMentions };
448
+ export { AGENT_TEMPLATES, type AgentCapability, AgentConfig, AgentIdentity, AgentRecord, type AgentTemplate, AnthropicProvider, type AnthropicProviderOptions, ClaudeCLIProvider, type ClaudeCLIProviderOptions, EngineFindings, GoogleProvider, type GoogleProviderOptions, HireBrief, HireRunRef, InboxMessage, JaibberAgent, JaibberClient, MessageHandler, NETWORK_GUIDE, type NetworkContext, type NetworkGenerate, type NetworkMessageHandler, NetworkRunner, type NetworkRunnerOptions, type NetworkTurn, OpenAIProvider, type OpenAIProviderOptions, Project, type Provider, ServerMessage, Task, TaskHandler, Thread, ThreadState, getTemplate, mentionsAgent, parseMentions };