@stratusagent/core 0.13.7 → 0.14.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.
- package/dist/channels.d.ts +172 -1
- package/dist/channels.d.ts.map +1 -1
- package/dist/channels.js.map +1 -1
- package/dist/index.d.ts +170 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/channels.d.ts
CHANGED
|
@@ -381,6 +381,21 @@ export interface ConversationReadRequest {
|
|
|
381
381
|
* decides with its own `sessionConversation`; absent, no DM is.
|
|
382
382
|
*/
|
|
383
383
|
sessionId?: string;
|
|
384
|
+
/**
|
|
385
|
+
* Fetch the image files on the messages read, so the model can be shown
|
|
386
|
+
* them: at most `count` images and `bytes` decoded bytes for the whole
|
|
387
|
+
* read, taken in the order the messages are returned and the files
|
|
388
|
+
* within each, and stopping at the first that does not fit. Each image
|
|
389
|
+
* is held to the same limits as one a person sends with a message
|
|
390
|
+
* (`IMAGE_ATTACHMENT_MAX_BYTES`, `IMAGE_ATTACHMENT_MAX_DIMENSION`).
|
|
391
|
+
* Absent, files come back by name only. An adapter that cannot fetch
|
|
392
|
+
* files ignores it and returns names, which is what every adapter
|
|
393
|
+
* written before it does.
|
|
394
|
+
*/
|
|
395
|
+
images?: {
|
|
396
|
+
count: number;
|
|
397
|
+
bytes: number;
|
|
398
|
+
};
|
|
384
399
|
}
|
|
385
400
|
/** One message as a read returns it: text and who wrote it, not markup. */
|
|
386
401
|
export interface ConversationMessage {
|
|
@@ -397,8 +412,21 @@ export interface ConversationMessage {
|
|
|
397
412
|
thread?: string;
|
|
398
413
|
/** How many replies a thread root has. */
|
|
399
414
|
replies?: number;
|
|
400
|
-
/** Names of attached files;
|
|
415
|
+
/** Names of attached files, images included; other contents are not read. */
|
|
401
416
|
files?: string[];
|
|
417
|
+
/**
|
|
418
|
+
* The message's images, fetched for a read that asked for them
|
|
419
|
+
* (`ConversationReadRequest.images`), in the order its files are listed.
|
|
420
|
+
* In flight only: `message.read` hands them to the model with its result
|
|
421
|
+
* and never puts them in the result's text.
|
|
422
|
+
*/
|
|
423
|
+
images?: ImageAttachment[];
|
|
424
|
+
/**
|
|
425
|
+
* A sentence for each image file on the message that is not shown as
|
|
426
|
+
* itself — sent as the platform's smaller preview, or left out and why —
|
|
427
|
+
* so the agent never answers as if it had looked at one it was not shown.
|
|
428
|
+
*/
|
|
429
|
+
imageNotes?: string[];
|
|
402
430
|
}
|
|
403
431
|
/** One of a conversation's bookmarks: plain text, no markup and no ids. */
|
|
404
432
|
export interface ConversationBookmark {
|
|
@@ -463,6 +491,63 @@ export interface ConversationCreateResult {
|
|
|
463
491
|
reason: string;
|
|
464
492
|
}>;
|
|
465
493
|
}
|
|
494
|
+
/**
|
|
495
|
+
* A request for the agent's own app to join an existing conversation —
|
|
496
|
+
* what `channel.join` resolves. Channel-native ids, like
|
|
497
|
+
* `ConversationReadRequest`'s.
|
|
498
|
+
*/
|
|
499
|
+
export interface ConversationJoinRequest {
|
|
500
|
+
/** Whose app joins. */
|
|
501
|
+
agentId: string;
|
|
502
|
+
/** The conversation to join (Slack: `C…`). */
|
|
503
|
+
conversation: string;
|
|
504
|
+
}
|
|
505
|
+
export interface ConversationJoinResult {
|
|
506
|
+
/** Channel-native id of the conversation the app is now in. */
|
|
507
|
+
conversation: string;
|
|
508
|
+
/** The app was already a member, so nothing changed. */
|
|
509
|
+
alreadyMember: boolean;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* A request to invite people to a conversation that already exists,
|
|
513
|
+
* through the agent's own app — what `channel.invite` resolves.
|
|
514
|
+
*/
|
|
515
|
+
export interface ConversationInviteRequest {
|
|
516
|
+
/** Whose app sends the invitation; it has to be a member already. */
|
|
517
|
+
agentId: string;
|
|
518
|
+
/** The conversation to invite them to (Slack: `C…`). */
|
|
519
|
+
conversation: string;
|
|
520
|
+
/**
|
|
521
|
+
* Who to invite: channel-native user ids, or ids of agents on this host,
|
|
522
|
+
* which the adapter resolves to the user its app for that agent posts as.
|
|
523
|
+
*/
|
|
524
|
+
invite: string[];
|
|
525
|
+
}
|
|
526
|
+
export interface ConversationInviteResult {
|
|
527
|
+
/** Each `invite` entry that is now a member, as the caller named it. */
|
|
528
|
+
invited: string[];
|
|
529
|
+
/** Each `invite` entry that was not invited, with a sentence for the agent. */
|
|
530
|
+
notInvited: Array<{
|
|
531
|
+
who: string;
|
|
532
|
+
reason: string;
|
|
533
|
+
}>;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* A request for the agent's own app to archive a conversation it created —
|
|
537
|
+
* what `channel.archive` resolves.
|
|
538
|
+
*/
|
|
539
|
+
export interface ConversationArchiveRequest {
|
|
540
|
+
/** Whose app archives it; only a conversation that app created qualifies. */
|
|
541
|
+
agentId: string;
|
|
542
|
+
/** The conversation to archive (Slack: `C…`). */
|
|
543
|
+
conversation: string;
|
|
544
|
+
}
|
|
545
|
+
export interface ConversationArchiveResult {
|
|
546
|
+
/** Channel-native id of the archived conversation. */
|
|
547
|
+
conversation: string;
|
|
548
|
+
/** It was archived already, so nothing changed. */
|
|
549
|
+
alreadyArchived: boolean;
|
|
550
|
+
}
|
|
466
551
|
/**
|
|
467
552
|
* A credential an agent asked for, handed to the channel its conversation
|
|
468
553
|
* is in so a person there can be shown a form. Everything the answer needs
|
|
@@ -483,6 +568,13 @@ export interface ChannelCredentialRequest {
|
|
|
483
568
|
* is being replaced.
|
|
484
569
|
*/
|
|
485
570
|
replace?: boolean;
|
|
571
|
+
/**
|
|
572
|
+
* The environment variable the agent's shell commands will read the key
|
|
573
|
+
* from once it is stored. The form must say so before anything is typed
|
|
574
|
+
* ("Atlas's shell commands will be able to read this as `GH_TOKEN`"),
|
|
575
|
+
* because answering it is the approval for that too.
|
|
576
|
+
*/
|
|
577
|
+
env?: string;
|
|
486
578
|
/** The session's routing metadata: where the conversation is. */
|
|
487
579
|
metadata: JsonObject;
|
|
488
580
|
}
|
|
@@ -527,6 +619,14 @@ export interface ChannelAdapter {
|
|
|
527
619
|
* since its ordinary add form would rotate a key without saying so.
|
|
528
620
|
*/
|
|
529
621
|
credentialReplaceForms?: boolean;
|
|
622
|
+
/**
|
|
623
|
+
* True when this adapter's `requestCredential` form shows `env`: it tells
|
|
624
|
+
* the approver which variable the agent's shell will read the key from.
|
|
625
|
+
* Absent on an adapter written before bindings, which the gateway never
|
|
626
|
+
* hands a request with `env`, since its form would make a key readable by
|
|
627
|
+
* the agent without saying so.
|
|
628
|
+
*/
|
|
629
|
+
credentialEnvForms?: boolean;
|
|
530
630
|
/**
|
|
531
631
|
* The read side of an addressable conversation — what `message.read`
|
|
532
632
|
* resolves. Optional, like `resolveOutbound`: a transport with no
|
|
@@ -571,6 +671,54 @@ export interface ChannelAdapter {
|
|
|
571
671
|
* agent would retry into a second one.
|
|
572
672
|
*/
|
|
573
673
|
createConversation?(request: ConversationCreateRequest): Promise<ConversationCreateResult>;
|
|
674
|
+
/**
|
|
675
|
+
* Joins an existing conversation with the agent's own app — what
|
|
676
|
+
* `channel.join` resolves. Optional, like `createConversation`.
|
|
677
|
+
*
|
|
678
|
+
* MUST reject, with a sentence for the agent, anything it did not join:
|
|
679
|
+
* no app here, a missing permission, a conversation the platform will
|
|
680
|
+
* not let an app join on its own (a private one), an archived or unknown
|
|
681
|
+
* one. When the platform's answer leaves it unknown whether the app
|
|
682
|
+
* joined, it MUST reject saying so, and that a retry is safe. Joining a
|
|
683
|
+
* conversation the app is already in resolves with `alreadyMember`.
|
|
684
|
+
*/
|
|
685
|
+
joinConversation?(request: ConversationJoinRequest): Promise<ConversationJoinResult>;
|
|
686
|
+
/**
|
|
687
|
+
* Invites people to an existing conversation through the agent's own
|
|
688
|
+
* app — what `channel.invite` resolves. Optional, like
|
|
689
|
+
* `createConversation`.
|
|
690
|
+
*
|
|
691
|
+
* MUST reject only when it knows nobody was invited: a request it
|
|
692
|
+
* refuses before asking the platform (no app here, nobody to invite, too
|
|
693
|
+
* many), or a whole call the platform refused without acting (the app
|
|
694
|
+
* not in the conversation, a missing permission, an archived or unknown
|
|
695
|
+
* conversation). A rejection means the members did not change. Every
|
|
696
|
+
* other outcome resolves, each entry it did not invite in `notInvited`
|
|
697
|
+
* with a reason, including a call that may have partly worked; an entry
|
|
698
|
+
* whose outcome cannot be checked is never claimed as invited.
|
|
699
|
+
*/
|
|
700
|
+
inviteToConversation?(request: ConversationInviteRequest): Promise<ConversationInviteResult>;
|
|
701
|
+
/**
|
|
702
|
+
* Archives a conversation the agent's own app created — what
|
|
703
|
+
* `channel.archive` resolves. Optional, like `createConversation`.
|
|
704
|
+
*
|
|
705
|
+
* Resolves only when the conversation is archived, by this call or
|
|
706
|
+
* already (`alreadyArchived`). MUST reject, with a sentence for the
|
|
707
|
+
* agent, anything it did not archive: no app here, an unknown id, a
|
|
708
|
+
* direct message, a conversation shared outside this workspace, a
|
|
709
|
+
* missing permission, an app that is no longer a member, a workspace
|
|
710
|
+
* rule against it. MUST NOT archive a conversation unless the platform
|
|
711
|
+
* says this agent's own app created it and no other agent here uses that
|
|
712
|
+
* app, and refuses when the creator can't be told. When the platform's
|
|
713
|
+
* answer leaves the outcome unknown, it MUST reject saying the
|
|
714
|
+
* conversation may have been archived and that a retry is safe.
|
|
715
|
+
*
|
|
716
|
+
* The gateway refuses the conversation the asking work came from before
|
|
717
|
+
* an adapter is asked, so an adapter need not check that. It asks the
|
|
718
|
+
* adapter's `sessionConversation` which one that is, so an adapter with
|
|
719
|
+
* this method implements that too: without it, every archive is refused.
|
|
720
|
+
*/
|
|
721
|
+
archiveConversation?(request: ConversationArchiveRequest): Promise<ConversationArchiveResult>;
|
|
574
722
|
/**
|
|
575
723
|
* The workspace this agent's app is connected to, for a transport whose
|
|
576
724
|
* conversation ids are unique only within one: a Slack team id.
|
|
@@ -590,6 +738,29 @@ export interface ChannelAdapter {
|
|
|
590
738
|
* without it, that authorization never applies on this transport.
|
|
591
739
|
*/
|
|
592
740
|
conversationKindFor?(agentId: string, conversation: string): Promise<'channel' | 'direct' | undefined>;
|
|
741
|
+
/**
|
|
742
|
+
* Picks up a change in which agents this channel carries, without a
|
|
743
|
+
* restart: an agent whose secrets were stored or removed since `start`,
|
|
744
|
+
* a soul that appeared, one that is gone. The gateway calls it after
|
|
745
|
+
* every roster reload, on each channel that started, one channel at a
|
|
746
|
+
* time, once the new roster is what `GatewayLike.agents()` answers.
|
|
747
|
+
*
|
|
748
|
+
* Connects, reconnects or drops only what changed and leaves every other
|
|
749
|
+
* connection alone, so a conversation on an unchanged app never notices.
|
|
750
|
+
* Settings other than the secrets come from wherever `start` read them,
|
|
751
|
+
* which for the daemon is the config it started with: a reload changes
|
|
752
|
+
* which apps are connected, never how an agent is configured.
|
|
753
|
+
*
|
|
754
|
+
* Resolves once done. Rejects, with a reason for the log, only when the
|
|
755
|
+
* reload could not run at all; one app that would not connect is the
|
|
756
|
+
* adapter's to log, the way `start` does, and not a reason to reject.
|
|
757
|
+
* The gateway stops waiting after a bound and goes on, so a second
|
|
758
|
+
* reload can arrive before the first settled, and `stop()` can arrive
|
|
759
|
+
* during one: an implementation serializes its own reloads, and leaves
|
|
760
|
+
* nothing connected that a stop has already taken down. Optional: a
|
|
761
|
+
* channel without it changes only at a restart.
|
|
762
|
+
*/
|
|
763
|
+
reload?(): Promise<void>;
|
|
593
764
|
}
|
|
594
765
|
export interface ChannelSessionKeyParts {
|
|
595
766
|
/** Channel kind, e.g. 'slack'. */
|
package/dist/channels.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../src/channels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,eAAe,EACf,QAAQ,EACR,eAAe,EACf,UAAU,EACV,OAAO,EACP,UAAU,EACX,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,kCAAkC;IAClC,OAAO,EAAE,MAAM,CA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C,EAAE,WAAW,CAAC;CACrB;AAED,6DAA6D;AAC7D,eAAO,MAAM,WAAW,GAAI,QAAQ,YAAY,GAAG,SAAS,EAAE,UAAU,MAAM,KAAG,OAClC,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,YAAY,GAAG,SAAS,EAAE,UAAU,MAAM,KAAG,OACM,CAAC;AAEzF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,YAAY,GAAG,SAAS,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CACtE,CAAC"}
|
package/dist/channels.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../src/channels.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../src/channels.ts"],"names":[],"mappings":"AA8wBA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAU,EAAE;IACzE,MAAM,QAAQ,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAChF,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC,CAAC;AAiCF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAgC,EAAE,QAAgB,EAAW,EAAE,CACzF,CAAC,MAAM,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAEhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAgC,EAAE,QAAgB,EAAW,EAAE,CAC1F,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,KAAK,YAAY,IAAI,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEzF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAgC,EAAE,QAAgB,EAA2C,EAAE,CAC5H,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -347,7 +347,33 @@ export interface Session {
|
|
|
347
347
|
* (`totalTokenUsage`), never written here.
|
|
348
348
|
*/
|
|
349
349
|
usage?: UsageRecord[];
|
|
350
|
+
/**
|
|
351
|
+
* Set when the latest message ended early: it used its step budget (and
|
|
352
|
+
* any auto-continue grants) or kept repeating one failure, and the turn
|
|
353
|
+
* that answered was the wrap-up (`TURN_LIMIT_NOTE`). The session still
|
|
354
|
+
* ends `completed`, because the wrap-up did answer; this is what tells
|
|
355
|
+
* that run apart from one that finished its work.
|
|
356
|
+
*
|
|
357
|
+
* Cleared when the next message in the session starts. A reason and
|
|
358
|
+
* counts only, never content: the summary is the turn's reply.
|
|
359
|
+
*/
|
|
360
|
+
stoppedEarly?: SessionStoppedEarly;
|
|
350
361
|
}
|
|
362
|
+
/** Why a message ended in a wrap-up instead of finishing. */
|
|
363
|
+
export type StoppedEarlyReason = 'turn-limit' | 'repeated-failure';
|
|
364
|
+
/** See `Session.stoppedEarly`. */
|
|
365
|
+
export interface SessionStoppedEarly {
|
|
366
|
+
reason: StoppedEarlyReason;
|
|
367
|
+
/** Auto-continue grants the message had used when it stopped. */
|
|
368
|
+
continuations: number;
|
|
369
|
+
/** When the wrap-up answered. */
|
|
370
|
+
at: string;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Whether a value is a reason core knows. A provider is a plugin, and its
|
|
374
|
+
* `ProviderResponse.stoppedEarly` reaches the runner untyped at runtime.
|
|
375
|
+
*/
|
|
376
|
+
export declare const isStoppedEarlyReason: (value: unknown) => value is StoppedEarlyReason;
|
|
351
377
|
export interface ToolCall {
|
|
352
378
|
id: string;
|
|
353
379
|
toolName: string;
|
|
@@ -1503,6 +1529,21 @@ export type CredentialScope = 'agent' | 'shared';
|
|
|
1503
1529
|
export type CredentialDelivery = 'form' | 'link';
|
|
1504
1530
|
export interface CredentialResolver {
|
|
1505
1531
|
resolve(agent: AgentDefinition, name: string): Promise<string | undefined>;
|
|
1532
|
+
/**
|
|
1533
|
+
* The environment variables this agent's stored keys were bound to, with
|
|
1534
|
+
* their values, read now: an approver answered a form that said the key
|
|
1535
|
+
* would be readable by this agent's shell as that variable, or an
|
|
1536
|
+
* operator bound it with `stratus credential env`. Only names the agent's
|
|
1537
|
+
* `credentials:` list grants, by `assertCredentialAllowed`'s rule
|
|
1538
|
+
* (skipped rather than thrown), and a bound name with nothing stored is
|
|
1539
|
+
* left out.
|
|
1540
|
+
*
|
|
1541
|
+
* Optional: a host that omits it has no bindings, and its shell commands
|
|
1542
|
+
* see only what the operator's config maps. A plugin is handed it only
|
|
1543
|
+
* when its manifest says `"envBindings": true`, since the values it
|
|
1544
|
+
* returns are names the manifest never listed.
|
|
1545
|
+
*/
|
|
1546
|
+
envBindings?(agent: AgentDefinition): Promise<Record<string, string>>;
|
|
1506
1547
|
}
|
|
1507
1548
|
export interface ScopedCredentials {
|
|
1508
1549
|
get(name: string): Promise<string>;
|
|
@@ -1875,6 +1916,14 @@ export interface ProviderResponse {
|
|
|
1875
1916
|
* other, and an adapter that reported through the sink leaves this alone.
|
|
1876
1917
|
*/
|
|
1877
1918
|
usage?: ProviderCallUsage;
|
|
1919
|
+
/**
|
|
1920
|
+
* For a provider that runs its own tool loop (the harness runtimes): set
|
|
1921
|
+
* when this answer is that loop's wrap-up, given because its inner budget
|
|
1922
|
+
* ran out, so the runner marks the session `stoppedEarly` as it does for
|
|
1923
|
+
* its own wrap-up. A value the runner does not know is ignored. Absent
|
|
1924
|
+
* for every ordinary answer.
|
|
1925
|
+
*/
|
|
1926
|
+
stoppedEarly?: 'turn-limit';
|
|
1878
1927
|
}
|
|
1879
1928
|
export interface ModelProvider {
|
|
1880
1929
|
name: string;
|
|
@@ -2650,6 +2699,8 @@ export type StratusEvent = {
|
|
|
2650
2699
|
via?: CredentialDelivery;
|
|
2651
2700
|
/** A new value for a key the agent already holds, swapped in place. Always a form, never a link. */
|
|
2652
2701
|
replace?: boolean;
|
|
2702
|
+
/** The variable the agent's shell commands will read the key from once it is added. */
|
|
2703
|
+
env?: string;
|
|
2653
2704
|
metadata?: JsonObject;
|
|
2654
2705
|
}
|
|
2655
2706
|
/**
|
|
@@ -2673,6 +2724,8 @@ export type StratusEvent = {
|
|
|
2673
2724
|
actor?: string;
|
|
2674
2725
|
/** The value replaced one already stored, rather than being added. */
|
|
2675
2726
|
replace?: boolean;
|
|
2727
|
+
/** The variable the agent's shell commands now read the key from. */
|
|
2728
|
+
env?: string;
|
|
2676
2729
|
/** Set when the key was stored but could not be added to the soul. */
|
|
2677
2730
|
grantError?: string;
|
|
2678
2731
|
} | {
|
|
@@ -2765,6 +2818,18 @@ export type StratusEvent = {
|
|
|
2765
2818
|
sessionId: string;
|
|
2766
2819
|
continuation: number;
|
|
2767
2820
|
turns: number;
|
|
2821
|
+
}
|
|
2822
|
+
/**
|
|
2823
|
+
* The message ended in a wrap-up instead of finishing (`Session.stoppedEarly`):
|
|
2824
|
+
* emitted just before its `session.completed`. Counts only, like
|
|
2825
|
+
* `session.continued`, because the daemon log records it; the summary is
|
|
2826
|
+
* the turn's reply.
|
|
2827
|
+
*/
|
|
2828
|
+
| {
|
|
2829
|
+
type: 'session.stopped-early';
|
|
2830
|
+
sessionId: string;
|
|
2831
|
+
reason: StoppedEarlyReason;
|
|
2832
|
+
continuations: number;
|
|
2768
2833
|
};
|
|
2769
2834
|
export type EventHandler = (event: StratusEvent) => void | Promise<void>;
|
|
2770
2835
|
export interface EventBusOptions {
|
|
@@ -2892,6 +2957,10 @@ export interface ChannelAdapterLike {
|
|
|
2892
2957
|
before?: string;
|
|
2893
2958
|
limit: number;
|
|
2894
2959
|
sessionId?: string;
|
|
2960
|
+
images?: {
|
|
2961
|
+
count: number;
|
|
2962
|
+
bytes: number;
|
|
2963
|
+
};
|
|
2895
2964
|
}): Promise<{
|
|
2896
2965
|
messages: Array<{
|
|
2897
2966
|
id: string;
|
|
@@ -2902,6 +2971,8 @@ export interface ChannelAdapterLike {
|
|
|
2902
2971
|
thread?: string;
|
|
2903
2972
|
replies?: number;
|
|
2904
2973
|
files?: string[];
|
|
2974
|
+
images?: ImageAttachment[];
|
|
2975
|
+
imageNotes?: string[];
|
|
2905
2976
|
}>;
|
|
2906
2977
|
more: boolean;
|
|
2907
2978
|
bookmarks?: Array<{
|
|
@@ -2932,12 +3003,42 @@ export interface ChannelAdapterLike {
|
|
|
2932
3003
|
reason: string;
|
|
2933
3004
|
}>;
|
|
2934
3005
|
}>;
|
|
3006
|
+
/** See `ChannelAdapter.joinConversation`. */
|
|
3007
|
+
joinConversation?(request: {
|
|
3008
|
+
agentId: string;
|
|
3009
|
+
conversation: string;
|
|
3010
|
+
}): Promise<{
|
|
3011
|
+
conversation: string;
|
|
3012
|
+
alreadyMember: boolean;
|
|
3013
|
+
}>;
|
|
3014
|
+
/** See `ChannelAdapter.inviteToConversation`. */
|
|
3015
|
+
inviteToConversation?(request: {
|
|
3016
|
+
agentId: string;
|
|
3017
|
+
conversation: string;
|
|
3018
|
+
invite: string[];
|
|
3019
|
+
}): Promise<{
|
|
3020
|
+
invited: string[];
|
|
3021
|
+
notInvited: Array<{
|
|
3022
|
+
who: string;
|
|
3023
|
+
reason: string;
|
|
3024
|
+
}>;
|
|
3025
|
+
}>;
|
|
3026
|
+
/** See `ChannelAdapter.archiveConversation`. */
|
|
3027
|
+
archiveConversation?(request: {
|
|
3028
|
+
agentId: string;
|
|
3029
|
+
conversation: string;
|
|
3030
|
+
}): Promise<{
|
|
3031
|
+
conversation: string;
|
|
3032
|
+
alreadyArchived: boolean;
|
|
3033
|
+
}>;
|
|
2935
3034
|
/** See `ChannelAdapter.accountFor`. */
|
|
2936
3035
|
accountFor?(agentId: string): string | undefined;
|
|
2937
3036
|
/** See `ChannelAdapter.conversationKindFor`. */
|
|
2938
3037
|
conversationKindFor?(agentId: string, conversation: string): Promise<'channel' | 'direct' | undefined>;
|
|
2939
3038
|
/** See `ChannelAdapter.sessionConversation`. */
|
|
2940
3039
|
sessionConversation?(agentId: string, sessionId: string): string | undefined;
|
|
3040
|
+
/** See `ChannelAdapter.reload`. */
|
|
3041
|
+
reload?(): Promise<void>;
|
|
2941
3042
|
}
|
|
2942
3043
|
/**
|
|
2943
3044
|
* A channel contributed by a plugin: the adapter plus the agents it
|
|
@@ -3405,10 +3506,56 @@ export interface PluginContext {
|
|
|
3405
3506
|
* itself loaded.
|
|
3406
3507
|
*/
|
|
3407
3508
|
providerCalls?: ProviderCallGuardHandle;
|
|
3509
|
+
/**
|
|
3510
|
+
* Feeds this plugin's events to the host's event triggers. See
|
|
3511
|
+
* {@link EventIngestHandle}. A host that omits it takes no events from
|
|
3512
|
+
* plugins (`stratus run` is one), and a plugin whose whole job is feeding
|
|
3513
|
+
* them must fail its `setup` naming it, rather than load and poll for
|
|
3514
|
+
* events nothing will ever act on.
|
|
3515
|
+
*/
|
|
3516
|
+
events?: EventIngestHandle;
|
|
3408
3517
|
}
|
|
3409
3518
|
export interface ProviderCallGuardHandle {
|
|
3410
3519
|
register(guard: ProviderCallGuard): void;
|
|
3411
3520
|
}
|
|
3521
|
+
/**
|
|
3522
|
+
* What the host did with one event a plugin fed it. `matched`: stored, with
|
|
3523
|
+
* a firing waiting for each event trigger it matched. `unmatched`: stored,
|
|
3524
|
+
* and no trigger wanted it. `duplicate`: the source took the same id within
|
|
3525
|
+
* the dedup window, so nothing new was stored and nothing fires.
|
|
3526
|
+
*/
|
|
3527
|
+
export interface EventIngestResult {
|
|
3528
|
+
status: 'matched' | 'unmatched' | 'duplicate';
|
|
3529
|
+
}
|
|
3530
|
+
/**
|
|
3531
|
+
* How a plugin that is not a webhook (a poller, an MCP subscriptions bridge)
|
|
3532
|
+
* wakes agents' event triggers. Its events take the same path a signed
|
|
3533
|
+
* delivery to the events port takes: the size limit, the per-source rate,
|
|
3534
|
+
* dedup on the source and the event's id, the rule filter, then a firing
|
|
3535
|
+
* per matched trigger. What a plugin skips is the signature, because the
|
|
3536
|
+
* plugin is code the operator installed. Its event text is still labeled
|
|
3537
|
+
* `external` in the turn, the way a webhook's is: who fed an event says
|
|
3538
|
+
* nothing about who wrote the comment inside it.
|
|
3539
|
+
*
|
|
3540
|
+
* Bound to the source ids the plugin's manifest declares
|
|
3541
|
+
* (`contributes.eventSources`), the way its tools are bound to the names it
|
|
3542
|
+
* declares. A source a plugin feeds is never a path on the events port.
|
|
3543
|
+
*/
|
|
3544
|
+
export interface EventIngestHandle {
|
|
3545
|
+
/**
|
|
3546
|
+
* Store one event for a declared source. The event is a structured
|
|
3547
|
+
* CloudEvents 1.0 object: `specversion` "1.0" and non-empty string `id`,
|
|
3548
|
+
* `source` and `type`, with `subject`, `time`, scalar extension
|
|
3549
|
+
* attributes and JSON `data` as wanted. Resolves once it is stored, so a
|
|
3550
|
+
* poller can move its cursor past it. Rejects, naming the reason, for a
|
|
3551
|
+
* source the manifest does not declare, an event that is not a
|
|
3552
|
+
* CloudEvent, one over the size limit, a source over its rate, a plugin
|
|
3553
|
+
* that has not finished loading or did not load, and a host that has
|
|
3554
|
+
* stopped. A rejected event fires nothing; feeding it again later is
|
|
3555
|
+
* safe, because the id is what dedup keys on.
|
|
3556
|
+
*/
|
|
3557
|
+
ingest(sourceId: string, event: JsonObject): Promise<EventIngestResult>;
|
|
3558
|
+
}
|
|
3412
3559
|
export interface Plugin {
|
|
3413
3560
|
name: string;
|
|
3414
3561
|
setup(context: PluginContext): Promise<void> | void;
|
|
@@ -4157,12 +4304,33 @@ export declare const raiseContextFloor: (session: Session) => boolean;
|
|
|
4157
4304
|
* Thrown when a run is stopped by its abort signal. The session ends up
|
|
4158
4305
|
* `failed` with this error's message as `lastError`, so an aborted turn is
|
|
4159
4306
|
* distinguishable from a genuine failure.
|
|
4307
|
+
*
|
|
4308
|
+
* Except a keyed turn aborted with `resumable`: see `RunAbortedError.resumable`.
|
|
4160
4309
|
*/
|
|
4161
4310
|
export declare class RunAbortedError extends Error {
|
|
4162
4311
|
/** Recognized across copies of core: a channel package aborts with its own. */
|
|
4163
4312
|
static [Symbol.hasInstance](value: unknown): boolean;
|
|
4164
|
-
|
|
4313
|
+
/**
|
|
4314
|
+
* The aborter is going away and the turn can be picked up after it: a
|
|
4315
|
+
* host's planned stop or restart. A turn whose message carries an
|
|
4316
|
+
* idempotency key is then not failed but left `running`, as a crash
|
|
4317
|
+
* leaves it, for the next start to continue once (`continueTurn`); the
|
|
4318
|
+
* abort still ends everything it was running. Not for a turn already
|
|
4319
|
+
* continued once (`Message.continuedAfterCrash`) or one that could have
|
|
4320
|
+
* reached a harness (`Message.hostedLoop`), which are failed, and never
|
|
4321
|
+
* for an unkeyed turn, whose caller was promised nothing and is told now.
|
|
4322
|
+
*/
|
|
4323
|
+
readonly resumable: boolean;
|
|
4324
|
+
constructor(message?: string, options?: {
|
|
4325
|
+
resumable?: boolean;
|
|
4326
|
+
});
|
|
4165
4327
|
}
|
|
4328
|
+
/**
|
|
4329
|
+
* Whether an abort leaves this session's turn for the next start rather
|
|
4330
|
+
* than failing it; see `RunAbortedError.resumable`. Exported for the host,
|
|
4331
|
+
* which tells the turn's caller the same thing the runner decided.
|
|
4332
|
+
*/
|
|
4333
|
+
export declare const leftForNextStart: (session: Pick<Session, "messages">, error: unknown) => boolean;
|
|
4166
4334
|
/**
|
|
4167
4335
|
* The abort that stopped a run, as the runner records it.
|
|
4168
4336
|
*
|
|
@@ -4460,5 +4628,5 @@ export declare class AgentRunner {
|
|
|
4460
4628
|
private executeToolCall;
|
|
4461
4629
|
}
|
|
4462
4630
|
export { createDirectExecutor, defineExecutor, DirectExecutor, failureResult, normalizeExecutorError, successResult, type DirectExecutorErrorContext, type DirectExecutorOptions, type ExecutorDefinition, type ExecutorResultCallRef, } from './executors.ts';
|
|
4463
|
-
export { admitsSender, channelSessionKey, isPrincipal, senderTrustFor, type AdmitPolicy, type ChannelAdapter, type ChannelCredentialRequest, type ChannelSessionKeyParts, type ConversationBookmark, type ConversationCreateRequest, type ConversationCreateResult, type ConversationMessage, type ConversationReadRequest, type ConversationReadResult, type GatewayLike, type InboundMessage, type OutboundAddress, type OutboundConnection, type OutboundMessageRef, type SenderPolicy, type SessionRouting, } from './channels.ts';
|
|
4631
|
+
export { admitsSender, channelSessionKey, isPrincipal, senderTrustFor, type AdmitPolicy, type ChannelAdapter, type ChannelCredentialRequest, type ChannelSessionKeyParts, type ConversationArchiveRequest, type ConversationArchiveResult, type ConversationBookmark, type ConversationCreateRequest, type ConversationCreateResult, type ConversationInviteRequest, type ConversationInviteResult, type ConversationJoinRequest, type ConversationJoinResult, type ConversationMessage, type ConversationReadRequest, type ConversationReadResult, type GatewayLike, type InboundMessage, type OutboundAddress, type OutboundConnection, type OutboundMessageRef, type SenderPolicy, type SessionRouting, } from './channels.ts';
|
|
4464
4632
|
//# sourceMappingURL=index.d.ts.map
|