@slopus/happy-providers 0.0.9 → 0.0.11
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/EXAMPLES.md +4 -1
- package/README.md +36 -18
- package/VENDOR_ANTHROPIC_BEDROCK.md +14 -7
- package/dist/core/SessionContext.d.ts +16 -10
- package/dist/core/SessionContext.d.ts.map +1 -1
- package/dist/core/toSessionAgentNotificationMessage.d.ts +14 -0
- package/dist/core/toSessionAgentNotificationMessage.d.ts.map +1 -0
- package/dist/core/toSessionAgentNotificationMessage.js +28 -0
- package/dist/core/toSessionAgentNotificationMessage.js.map +1 -0
- package/dist/core/toSessionReminderMessage.d.ts.map +1 -1
- package/dist/core/toSessionReminderMessage.js +7 -4
- package/dist/core/toSessionReminderMessage.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/protocol/anthropic/toAnthropicMessages.d.ts.map +1 -1
- package/dist/protocol/anthropic/toAnthropicMessages.js +6 -5
- package/dist/protocol/anthropic/toAnthropicMessages.js.map +1 -1
- package/dist/protocol/responses/toOpenAIInputContent.d.ts +2 -0
- package/dist/protocol/responses/toOpenAIInputContent.d.ts.map +1 -1
- package/dist/protocol/responses/toOpenAIInputContent.js +4 -0
- package/dist/protocol/responses/toOpenAIInputContent.js.map +1 -1
- package/dist/protocol/responses/toOpenAIResponseInput.d.ts.map +1 -1
- package/dist/protocol/responses/toOpenAIResponseInput.js +7 -15
- package/dist/protocol/responses/toOpenAIResponseInput.js.map +1 -1
- package/dist/vendors/VendorCredential.d.ts +3 -1
- package/dist/vendors/VendorCredential.d.ts.map +1 -1
- package/dist/vendors/VendorCredential.js +6 -1
- package/dist/vendors/VendorCredential.js.map +1 -1
- package/dist/vendors/anthropic/AnthropicProvider.d.ts +2 -2
- package/dist/vendors/anthropic/AnthropicProvider.d.ts.map +1 -1
- package/dist/vendors/anthropic/AnthropicProvider.js +2 -1
- package/dist/vendors/anthropic/AnthropicProvider.js.map +1 -1
- package/dist/vendors/bedrock/AnthropicBedrockSession.js +1 -1
- package/dist/vendors/bedrock/AnthropicBedrockSession.js.map +1 -1
- package/dist/vendors/bedrock/BedrockAwsCredential.d.ts +18 -0
- package/dist/vendors/bedrock/BedrockAwsCredential.d.ts.map +1 -0
- package/dist/vendors/bedrock/BedrockAwsCredential.js +44 -0
- package/dist/vendors/bedrock/BedrockAwsCredential.js.map +1 -0
- package/dist/vendors/bedrock/impl/AnthropicBedrockConnection.d.ts +6 -5
- package/dist/vendors/bedrock/impl/AnthropicBedrockConnection.d.ts.map +1 -1
- package/dist/vendors/bedrock/impl/AnthropicBedrockConnection.js +5 -5
- package/dist/vendors/bedrock/impl/AnthropicBedrockConnection.js.map +1 -1
- package/dist/vendors/bedrock/impl/assertBedrockCredential.d.ts +1 -1
- package/dist/vendors/bedrock/impl/assertBedrockCredential.d.ts.map +1 -1
- package/dist/vendors/bedrock/impl/assertBedrockCredential.js +3 -5
- package/dist/vendors/bedrock/impl/assertBedrockCredential.js.map +1 -1
- package/dist/vendors/bedrock/impl/createAnthropicBedrockClient.d.ts +2 -1
- package/dist/vendors/bedrock/impl/createAnthropicBedrockClient.d.ts.map +1 -1
- package/dist/vendors/bedrock/impl/createAnthropicBedrockClient.js +27 -4
- package/dist/vendors/bedrock/impl/createAnthropicBedrockClient.js.map +1 -1
- package/dist/vendors/claude/impl/claudeMessageIdentity.js +3 -1
- package/dist/vendors/claude/impl/claudeMessageIdentity.js.map +1 -1
- package/dist/vendors/claude/impl/createClaudeSessionReplay.d.ts.map +1 -1
- package/dist/vendors/claude/impl/createClaudeSessionReplay.js +9 -5
- package/dist/vendors/claude/impl/createClaudeSessionReplay.js.map +1 -1
- package/dist/vendors/codex/CodexProvider.d.ts +2 -1
- package/dist/vendors/codex/CodexProvider.d.ts.map +1 -1
- package/dist/vendors/codex/CodexProvider.js +6 -2
- package/dist/vendors/codex/CodexProvider.js.map +1 -1
- package/dist/vendors/codex/CodexSession.d.ts +3 -1
- package/dist/vendors/codex/CodexSession.d.ts.map +1 -1
- package/dist/vendors/codex/CodexSession.js +36 -8
- package/dist/vendors/codex/CodexSession.js.map +1 -1
- package/dist/vendors/codex/errors/codexErrors.d.ts +2 -0
- package/dist/vendors/codex/errors/codexErrors.d.ts.map +1 -1
- package/dist/vendors/codex/errors/codexErrors.js +24 -0
- package/dist/vendors/codex/errors/codexErrors.js.map +1 -1
- package/dist/vendors/codex/impl/assertCodexCredential.d.ts +1 -1
- package/dist/vendors/codex/impl/assertCodexCredential.d.ts.map +1 -1
- package/dist/vendors/codex/impl/assertCodexCredential.js +3 -2
- package/dist/vendors/codex/impl/assertCodexCredential.js.map +1 -1
- package/dist/vendors/codex/impl/createCodexClient.d.ts +2 -1
- package/dist/vendors/codex/impl/createCodexClient.d.ts.map +1 -1
- package/dist/vendors/codex/impl/createCodexClient.js +13 -6
- package/dist/vendors/codex/impl/createCodexClient.js.map +1 -1
- package/dist/vendors/codex/impl/getCodexTurnKey.d.ts.map +1 -1
- package/dist/vendors/codex/impl/getCodexTurnKey.js +1 -2
- package/dist/vendors/codex/impl/getCodexTurnKey.js.map +1 -1
- package/dist/vendors/codex/impl/withCodexSkills.d.ts.map +1 -1
- package/dist/vendors/codex/impl/withCodexSkills.js +1 -1
- package/dist/vendors/codex/impl/withCodexSkills.js.map +1 -1
- package/dist/vendors/grok/impl/toGrokResponseInput.d.ts.map +1 -1
- package/dist/vendors/grok/impl/toGrokResponseInput.js +5 -4
- package/dist/vendors/grok/impl/toGrokResponseInput.js.map +1 -1
- package/dist/vendors/tryLoadCredentials.d.ts +3 -0
- package/dist/vendors/tryLoadCredentials.d.ts.map +1 -1
- package/dist/vendors/tryLoadCredentials.js +17 -0
- package/dist/vendors/tryLoadCredentials.js.map +1 -1
- package/package.json +4 -1
package/EXAMPLES.md
CHANGED
|
@@ -162,6 +162,7 @@ The session lifecycle is the same for every provider; only construction and vend
|
|
|
162
162
|
```ts
|
|
163
163
|
import {
|
|
164
164
|
AnthropicProvider,
|
|
165
|
+
BedrockAwsCredential,
|
|
165
166
|
BedrockBearerTokenCredential,
|
|
166
167
|
ClaudeCodeCredential,
|
|
167
168
|
GrokProvider,
|
|
@@ -190,7 +191,9 @@ if (grokCredential !== null) {
|
|
|
190
191
|
await session.destroy();
|
|
191
192
|
}
|
|
192
193
|
|
|
193
|
-
const bedrockCredential =
|
|
194
|
+
const bedrockCredential =
|
|
195
|
+
(await BedrockBearerTokenCredential.tryLoad()) ??
|
|
196
|
+
(await BedrockAwsCredential.tryLoad({ profile: process.env.AWS_PROFILE }));
|
|
194
197
|
if (bedrockCredential !== null) {
|
|
195
198
|
const bedrock = new AnthropicProvider({
|
|
196
199
|
credential: bedrockCredential,
|
package/README.md
CHANGED
|
@@ -14,9 +14,9 @@ never think about keep-alive, reconnects, or which wire protocol a vendor speaks
|
|
|
14
14
|
messages wherever we can classify them; only genuinely unknown failures fall back to an
|
|
15
15
|
unclassified error, and even those arrive readable.
|
|
16
16
|
|
|
17
|
-
🔑 **Coding-assistant credentials and tokens** — reuse the credentials your local Codex
|
|
18
|
-
Code installation already manages, pass an API key or bearer token directly, or discover
|
|
19
|
-
account on the machine and let the user pick.
|
|
17
|
+
🔑 **Coding-assistant credentials and tokens** — reuse the credentials your local Codex, Claude
|
|
18
|
+
Code, or AWS installation already manages, pass an API key or bearer token directly, or discover
|
|
19
|
+
every account on the machine and let the user pick.
|
|
20
20
|
|
|
21
21
|
🧪 **Tested against the real thing** — golden traces are captured from the actual Codex, Claude
|
|
22
22
|
Code, and Grok clients talking to their real backends, and the test suite verifies our requests
|
|
@@ -141,12 +141,12 @@ needed for the next turn.
|
|
|
141
141
|
|
|
142
142
|
## Providers and credentials
|
|
143
143
|
|
|
144
|
-
| Provider | Talks to | Credential options
|
|
145
|
-
| ------------------- | ------------------------------------------------------ |
|
|
146
|
-
| `AnthropicProvider` | Claude Code SDK or Anthropic Messages on Bedrock | Claude Code, OAuth, auth token, API key,
|
|
147
|
-
| `CodexProvider` | OpenAI Responses, Responses Lite, or OpenAI on Bedrock | Codex session, OpenAI API key, Bedrock bearer token
|
|
148
|
-
| `GrokProvider` | Grok Responses-compatible protocol | Grok session or xAI API key
|
|
149
|
-
| `ResponsesProvider` | Any generic Responses-compatible endpoint | Explicit endpoint and API key
|
|
144
|
+
| Provider | Talks to | Credential options |
|
|
145
|
+
| ------------------- | ------------------------------------------------------ | --------------------------------------------------------------------------------- |
|
|
146
|
+
| `AnthropicProvider` | Claude Code SDK or Anthropic Messages on Bedrock | Claude Code, OAuth, auth token, API key, Bedrock bearer token, or AWS credentials |
|
|
147
|
+
| `CodexProvider` | OpenAI Responses, Responses Lite, or OpenAI on Bedrock | Codex session, OpenAI API key, Bedrock bearer token, or AWS credentials |
|
|
148
|
+
| `GrokProvider` | Grok Responses-compatible protocol | Grok session or xAI API key |
|
|
149
|
+
| `ResponsesProvider` | Any generic Responses-compatible endpoint | Explicit endpoint and API key |
|
|
150
150
|
|
|
151
151
|
You always choose the credential; the library never picks an account for you. Each vendor
|
|
152
152
|
credential class has a `tryLoad()` that accepts explicit values or reads the native client's
|
|
@@ -156,8 +156,10 @@ discovers everything available on the machine.
|
|
|
156
156
|
For Anthropic there is deliberately no second provider choice. Construct `AnthropicProvider`
|
|
157
157
|
with whichever credential the user selected. `ClaudeCodeCredential`, `ClaudeOAuthCredential`,
|
|
158
158
|
`ClaudeAuthTokenCredential`, and `ClaudeApiKeyCredential` select the persistent Claude Agent SDK
|
|
159
|
-
implementation. `BedrockBearerTokenCredential`
|
|
160
|
-
|
|
159
|
+
implementation. `BedrockBearerTokenCredential` and `BedrockAwsCredential` select Anthropic
|
|
160
|
+
Messages on Bedrock. The AWS credential uses the standard Node credential chain, including shared
|
|
161
|
+
profiles with `credential_process`, and SigV4-signs requests. The provider's canonical `name`
|
|
162
|
+
remains `"claude"` on either transport.
|
|
161
163
|
|
|
162
164
|
Credentials are reusable: load one once and share it across every session you open — sessions
|
|
163
165
|
don't take ownership of it, and there is no need to reload it per conversation. Token refreshing
|
|
@@ -535,10 +537,11 @@ Every option each provider constructor accepts, and how the defaults are chosen.
|
|
|
535
537
|
|
|
536
538
|
### `CodexProvider` (OpenAI Codex)
|
|
537
539
|
|
|
538
|
-
- `credential` _(required)_ — a Codex session, an OpenAI API key,
|
|
539
|
-
credential also picks the default endpoint: a Codex session talks to
|
|
540
|
-
`https://chatgpt.com/backend-api`, an API key to `https://api.openai.com/v1`, and
|
|
541
|
-
|
|
540
|
+
- `credential` _(required)_ — a Codex session, an OpenAI API key, a Bedrock bearer token, or AWS
|
|
541
|
+
credentials. The credential also picks the default endpoint: a Codex session talks to
|
|
542
|
+
`https://chatgpt.com/backend-api`, an API key to `https://api.openai.com/v1`, and either Bedrock
|
|
543
|
+
credential to the Bedrock Mantle endpoint for the resolved region. AWS credentials use SigV4
|
|
544
|
+
and remain refreshable through the credential provider chain.
|
|
542
545
|
- `endpoint` — overrides that default endpoint.
|
|
543
546
|
- `model` — the session's default model, resolved against the curated catalog. On Bedrock the
|
|
544
547
|
catalog maps it to the corresponding Bedrock model ID.
|
|
@@ -571,15 +574,30 @@ separate Bedrock provider class in the public API:
|
|
|
571
574
|
- A `ClaudeCodeCredential`, `ClaudeOAuthCredential`, `ClaudeAuthTokenCredential`, or
|
|
572
575
|
`ClaudeApiKeyCredential` uses the Anthropic Agent SDK. This branch accepts `env`, `model`,
|
|
573
576
|
`onAccountUsage`, `pathToClaudeCodeExecutable`, `query`, and `userAgent`.
|
|
574
|
-
- A `BedrockBearerTokenCredential` uses Anthropic Messages on Amazon
|
|
575
|
-
`client`, `endpoint`, `model`, `region` (default `us-east-1`),
|
|
576
|
-
default, or `"runtime"`), and `userAgent`.
|
|
577
|
+
- A `BedrockBearerTokenCredential` or `BedrockAwsCredential` uses Anthropic Messages on Amazon
|
|
578
|
+
Bedrock. This branch accepts `client`, `endpoint`, `model`, `region` (default `us-east-1`),
|
|
579
|
+
`transport` (`"mantle"` by default, or `"runtime"`), and `userAgent`.
|
|
577
580
|
|
|
578
581
|
The exported `AnthropicProviderOptions` union describes both credential-specific option shapes. A
|
|
579
582
|
credential selected dynamically may remain typed as the complete `AnthropicCredential` union;
|
|
580
583
|
the common `{ credential, model, userAgent }` constructor shape accepts it directly. `query` and
|
|
581
584
|
`client` are advanced injection seams for tests; production callers normally leave them unset.
|
|
582
585
|
|
|
586
|
+
`BedrockAwsCredential.tryLoad()` uses the standard AWS Node credential chain. Pass `profile` to
|
|
587
|
+
select a shared-config profile explicitly; otherwise `AWS_PROFILE`, environment credentials,
|
|
588
|
+
shared files, web identity, and instance/container credentials follow normal AWS precedence. A
|
|
589
|
+
profile containing `credential_process` is executed by the AWS SDK, and expiring credentials are
|
|
590
|
+
refreshed by the same provider:
|
|
591
|
+
|
|
592
|
+
```ini
|
|
593
|
+
[profile work-bedrock]
|
|
594
|
+
credential_process = /usr/local/bin/aws-credential-helper work
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
```ts
|
|
598
|
+
const credential = await BedrockAwsCredential.tryLoad({ profile: "work-bedrock" });
|
|
599
|
+
```
|
|
600
|
+
|
|
583
601
|
### `GrokProvider` (Grok Build)
|
|
584
602
|
|
|
585
603
|
- `credential` _(required)_ — a Grok session or an xAI API key.
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# Anthropic Bedrock transport
|
|
2
2
|
|
|
3
3
|
The public `AnthropicProvider` selects its internal Bedrock implementation whenever it receives a
|
|
4
|
-
`BedrockBearerTokenCredential`. That implementation sends Anthropic
|
|
5
|
-
to Amazon Bedrock through `@anthropic-ai/bedrock-sdk`. It supports
|
|
6
|
-
endpoint and Bedrock Runtime, preferring Mantle when the selected
|
|
7
|
-
caller supplies the complete system instructions and tool
|
|
8
|
-
launch Claude Code or adopt its tool execution and permission
|
|
4
|
+
`BedrockBearerTokenCredential` or `BedrockAwsCredential`. That implementation sends Anthropic
|
|
5
|
+
Messages API requests directly to Amazon Bedrock through `@anthropic-ai/bedrock-sdk`. It supports
|
|
6
|
+
the Anthropic-compatible Mantle endpoint and Bedrock Runtime, preferring Mantle when the selected
|
|
7
|
+
model is available in-region. Its caller supplies the complete system instructions and tool
|
|
8
|
+
definitions; the provider does not launch Claude Code or adopt its tool execution and permission
|
|
9
|
+
runtime.
|
|
9
10
|
|
|
10
11
|
## Request contract
|
|
11
12
|
|
|
@@ -76,12 +77,18 @@ Rig never sends a separate summarization request.
|
|
|
76
77
|
|
|
77
78
|
## Credentials
|
|
78
79
|
|
|
79
|
-
Load `BedrockBearerTokenCredential`, normally from `AWS_BEARER_TOKEN_BEDROCK
|
|
80
|
-
|
|
80
|
+
Load `BedrockBearerTokenCredential`, normally from `AWS_BEARER_TOKEN_BEDROCK`, or load
|
|
81
|
+
`BedrockAwsCredential` from the standard AWS Node credential chain. Named and default shared
|
|
82
|
+
profiles support `credential_process`; the AWS SDK validates the process result, memoizes it, and
|
|
83
|
+
refreshes expiring credentials. AWS credentials SigV4-sign both Mantle and Runtime requests and
|
|
84
|
+
cannot be displaced by an ambient Bedrock bearer token. The provider accepts an explicit region
|
|
85
|
+
and otherwise defaults to `us-east-1`; environment resolution belongs to the
|
|
81
86
|
executor/configuration layer.
|
|
82
87
|
|
|
83
88
|
## Verification
|
|
84
89
|
|
|
90
|
+
`tests/bedrockAwsCredential.test.ts` executes a real fixture `credential_process` and verifies the
|
|
91
|
+
resulting OpenAI Mantle, Anthropic Mantle, and Anthropic Runtime SigV4 request headers.
|
|
85
92
|
`tests/anthropicBedrockProvider.test.ts` exercises regional routing, signed-thinking replay,
|
|
86
93
|
provider-owned retry, native compaction, Mantle and Runtime wire shapes, exact current Rig prompt
|
|
87
94
|
and tools, and the captured Claude golden response stream.
|
|
@@ -13,24 +13,30 @@ export interface SessionUserMessage {
|
|
|
13
13
|
readonly role: "user";
|
|
14
14
|
readonly content: readonly SessionInputBlock[];
|
|
15
15
|
}
|
|
16
|
+
/** Who wrote an agent message, as the receiving model should understand them. */
|
|
17
|
+
export interface SessionAgentAuthor {
|
|
18
|
+
/** Stable identity of the sending agent. */
|
|
19
|
+
readonly id: string;
|
|
20
|
+
/** Short human-readable description of the sender, shown to the receiving model. */
|
|
21
|
+
readonly description: string;
|
|
22
|
+
}
|
|
23
|
+
/** What one agent may say to another: ordinary content, never provider-native payloads. */
|
|
24
|
+
export type SessionAgentBlock = SessionTextBlock | SessionImageBlock | SessionReasoningBlock;
|
|
16
25
|
/**
|
|
17
|
-
*
|
|
26
|
+
* A message one agent addressed to another.
|
|
18
27
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
28
|
+
* This is a portable application message, not a provider-native one. No vendor is given an agent
|
|
29
|
+
* role, because none of them agree on what that is; every provider receives the message as a
|
|
30
|
+
* system notification naming its author, built by `toSessionAgentNotificationMessage`.
|
|
21
31
|
*/
|
|
22
32
|
export interface SessionAgentMessage {
|
|
23
33
|
readonly role: "agent";
|
|
24
|
-
readonly author:
|
|
25
|
-
readonly
|
|
26
|
-
readonly header: string;
|
|
27
|
-
readonly encryptedContent: string;
|
|
28
|
-
/** Whether this message establishes the boundary for a new inference turn. */
|
|
29
|
-
readonly agentMessageTriggerTurn?: boolean;
|
|
34
|
+
readonly author: SessionAgentAuthor;
|
|
35
|
+
readonly content: readonly SessionAgentBlock[];
|
|
30
36
|
}
|
|
31
37
|
export interface SessionSystemMessage {
|
|
32
38
|
readonly role: "system";
|
|
33
|
-
readonly content: readonly
|
|
39
|
+
readonly content: readonly SessionInputBlock[];
|
|
34
40
|
}
|
|
35
41
|
/**
|
|
36
42
|
* One reasoning block retained exactly as the caller supplied it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionContext.d.ts","sourceRoot":"","sources":["../../sources/core/SessionContext.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBA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c,EAAE,CAAC;CAChD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SessionAgentMessage, SessionSystemMessage } from "../core/SessionContext.js";
|
|
2
|
+
/**
|
|
3
|
+
* Projects a message from one agent onto the system role.
|
|
4
|
+
*
|
|
5
|
+
* No provider has an agent role that means what we mean by it, so the message reaches every model
|
|
6
|
+
* the same way: a notification that names who sent it, followed by what they said. Saying who is
|
|
7
|
+
* the point — without it the receiving model has no way to tell another agent's words from the
|
|
8
|
+
* user's, and would read them as instructions the person gave.
|
|
9
|
+
*
|
|
10
|
+
* Reasoning the sender exposed is folded in as text. Reasoning that is only an opaque signed
|
|
11
|
+
* payload is dropped: it belongs to the model that produced it and means nothing here.
|
|
12
|
+
*/
|
|
13
|
+
export declare function toSessionAgentNotificationMessage(message: SessionAgentMessage): SessionSystemMessage;
|
|
14
|
+
//# sourceMappingURL=toSessionAgentNotificationMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toSessionAgentNotificationMessage.d.ts","sourceRoot":"","sources":["../../sources/core/toSessionAgentNotificationMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,mBAAmB,EAEnB,oBAAoB,EACvB,MAAM,0BAA0B,CAAC;AAElC;;;;;;;;;;GAUG;AACH,wBAAgB,iCAAiC,CAC7C,OAAO,EAAE,mBAAmB,GAC7B,oBAAoB,CActB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projects a message from one agent onto the system role.
|
|
3
|
+
*
|
|
4
|
+
* No provider has an agent role that means what we mean by it, so the message reaches every model
|
|
5
|
+
* the same way: a notification that names who sent it, followed by what they said. Saying who is
|
|
6
|
+
* the point — without it the receiving model has no way to tell another agent's words from the
|
|
7
|
+
* user's, and would read them as instructions the person gave.
|
|
8
|
+
*
|
|
9
|
+
* Reasoning the sender exposed is folded in as text. Reasoning that is only an opaque signed
|
|
10
|
+
* payload is dropped: it belongs to the model that produced it and means nothing here.
|
|
11
|
+
*/
|
|
12
|
+
export function toSessionAgentNotificationMessage(message) {
|
|
13
|
+
const { description, id } = message.author;
|
|
14
|
+
const heading = description.length === 0 ? id : `${description} (${id})`;
|
|
15
|
+
const content = [{ type: "text", text: `Message from agent ${heading}:` }];
|
|
16
|
+
for (const block of message.content) {
|
|
17
|
+
if (block.type === "image") {
|
|
18
|
+
content.push(block);
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const { text } = block;
|
|
22
|
+
if (text === undefined || text.length === 0)
|
|
23
|
+
continue;
|
|
24
|
+
content.push({ type: "text", text });
|
|
25
|
+
}
|
|
26
|
+
return { role: "system", content };
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=toSessionAgentNotificationMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toSessionAgentNotificationMessage.js","sourceRoot":"","sources":["../../sources/core/toSessionAgentNotificationMessage.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iCAAiC,CAC7C,OAA4B;IAE5B,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAC3C,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,WAAW,KAAK,EAAE,GAAG,CAAC;IACzE,MAAM,OAAO,GAAwB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,OAAO,GAAG,EAAE,CAAC,CAAC;IAChG,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QAClC,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpB,SAAS;QACb,CAAC;QACD,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;QACvB,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACtD,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toSessionReminderMessage.d.ts","sourceRoot":"","sources":["../../sources/core/toSessionReminderMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEzF;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,oBAAoB,GAAG,kBAAkB,
|
|
1
|
+
{"version":3,"file":"toSessionReminderMessage.d.ts","sourceRoot":"","sources":["../../sources/core/toSessionReminderMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEzF;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,oBAAoB,GAAG,kBAAkB,CAa1F"}
|
|
@@ -7,13 +7,16 @@
|
|
|
7
7
|
* cached prefix on every notice.
|
|
8
8
|
*/
|
|
9
9
|
export function toSessionReminderMessage(message) {
|
|
10
|
+
const text = message.content
|
|
11
|
+
.flatMap((block) => (block.type === "text" ? [block.text] : []))
|
|
12
|
+
.join("\n\n");
|
|
10
13
|
return {
|
|
11
14
|
role: "user",
|
|
12
15
|
content: [
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
{ type: "text", text: `<system-reminder>\n${text}\n</system-reminder>` },
|
|
17
|
+
// An image cannot be wrapped in the reminder text, so it follows it intact rather
|
|
18
|
+
// than being dropped along with whatever the notice was showing.
|
|
19
|
+
...message.content.filter((block) => block.type === "image"),
|
|
17
20
|
],
|
|
18
21
|
};
|
|
19
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toSessionReminderMessage.js","sourceRoot":"","sources":["../../sources/core/toSessionReminderMessage.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAA6B;IAClE,OAAO;QACH,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE;YACL
|
|
1
|
+
{"version":3,"file":"toSessionReminderMessage.js","sourceRoot":"","sources":["../../sources/core/toSessionReminderMessage.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAA6B;IAClE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO;SACvB,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC/D,IAAI,CAAC,MAAM,CAAC,CAAC;IAClB,OAAO;QACH,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE;YACL,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,IAAI,sBAAsB,EAAE;YACxE,kFAAkF;YAClF,iEAAiE;YACjE,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC;SAC/D;KACJ,CAAC;AACN,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { DEFAULT_PROVIDER_QUOTA_STALE_AFTER_MS, isProviderQuotaStale, } from "./
|
|
|
9
9
|
export { unavailableProviderQuota } from "./core/unavailableProviderQuota.js";
|
|
10
10
|
export { EMPTY_SESSION_USAGE, type SessionUsage } from "./core/SessionUsage.js";
|
|
11
11
|
export type { CancelledSessionCompaction, CompletedSessionCompaction, FailedSessionCompaction, SessionCompaction, SessionCompactionOptions, } from "./core/SessionCompaction.js";
|
|
12
|
-
export type { SessionAssistantMessage, SessionAgentMessage, SessionCompactionMessage, SessionContext, SessionAssistantBlock, SessionImageBlock, SessionInputBlock, SessionMessage, SessionOutputBlock, SessionReasoningBlock, SessionSystemMessage, SessionTextBlock, SessionToolCallBlock, SessionToolResultBlock, SessionToolResultMessage, SessionUserMessage, } from "./core/SessionContext.js";
|
|
12
|
+
export type { SessionAssistantMessage, SessionAgentAuthor, SessionAgentBlock, SessionAgentMessage, SessionCompactionMessage, SessionContext, SessionAssistantBlock, SessionImageBlock, SessionInputBlock, SessionMessage, SessionOutputBlock, SessionReasoningBlock, SessionSystemMessage, SessionTextBlock, SessionToolCallBlock, SessionToolResultBlock, SessionToolResultMessage, SessionUserMessage, } from "./core/SessionContext.js";
|
|
13
13
|
export type { SessionModelConfiguration } from "./core/SessionModelConfiguration.js";
|
|
14
14
|
export type { SessionDoneState, SessionErrorKind, SessionEvent, SessionProviderError, SessionProviderErrorDiagnostics, SessionStream, SessionTokens, } from "./core/SessionEvent.js";
|
|
15
15
|
export { isSessionDoneEvent, isSessionErrorDone } from "./core/SessionEvent.js";
|
|
@@ -51,6 +51,7 @@ export { anthropicBedrockMantleEndpoint, BEDROCK_DEFAULT_REGION, bedrockMantleEn
|
|
|
51
51
|
export { ResponsesProvider, type ResponsesProviderOptions, } from "./protocol/responses/ResponsesProvider.js";
|
|
52
52
|
export { MINIMAL_RESPONSES_CAPABILITIES, OPENAI_RESPONSES_CAPABILITIES, type ResponsesCapabilities, } from "./protocol/responses/ResponsesCapabilities.js";
|
|
53
53
|
export { ResponsesSession, type ResponsesSessionOptions, } from "./protocol/responses/ResponsesSession.js";
|
|
54
|
+
export { BedrockAwsCredential, type BedrockAwsCredentialLoadOptions, type BedrockAwsCredentialValue, } from "./vendors/bedrock/BedrockAwsCredential.js";
|
|
54
55
|
export { BedrockBearerTokenCredential, type BedrockBearerTokenCredentialLoadOptions, type BedrockBearerTokenCredentialValue, } from "./vendors/bedrock/BedrockBearerTokenCredential.js";
|
|
55
56
|
export { ClaudeApiKeyCredential, type ClaudeApiKeyCredentialLoadOptions, type ClaudeApiKeyCredentialValue, } from "./vendors/claude/ClaudeApiKeyCredential.js";
|
|
56
57
|
export { ClaudeAuthTokenCredential, type ClaudeAuthTokenCredentialLoadOptions, type ClaudeAuthTokenCredentialValue, } from "./vendors/claude/ClaudeAuthTokenCredential.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../sources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,YAAY,EACR,aAAa,EACb,mBAAmB,EACnB,mBAAmB,GACtB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACR,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,yBAAyB,EACzB,KAAK,gCAAgC,GACxC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACH,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,GACjC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACH,qCAAqC,EACrC,oBAAoB,GACvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAChF,YAAY,EACR,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,wBAAwB,GAC3B,MAAM,6BAA6B,CAAC;AACr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,EACH,qBAAqB,EACrB,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,GAClC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACH,qBAAqB,EACrB,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,GAClC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACH,sBAAsB,EACtB,KAAK,iCAAiC,EACtC,KAAK,2BAA2B,GACnC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACH,mBAAmB,EACnB,KAAK,0BAA0B,GAClC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACH,sBAAsB,EACtB,KAAK,iCAAiC,EACtC,KAAK,2BAA2B,GACnC,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACH,oBAAoB,EACpB,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,GACjC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACH,qBAAqB,EACrB,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,GAClC,MAAM,yCAAyC,CAAC;AACjD,YAAY,EACR,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,kBAAkB,EAClB,KAAK,yBAAyB,GACjC,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../sources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,YAAY,EACR,aAAa,EACb,mBAAmB,EACnB,mBAAmB,GACtB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACR,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,GACtB,MAAM,yBAAyB,CAAC;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BAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,kBAAkB,EAClB,KAAK,yBAAyB,GACjC,MAAM,iCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,7 @@ export { anthropicBedrockMantleEndpoint, BEDROCK_DEFAULT_REGION, bedrockMantleEn
|
|
|
37
37
|
export { ResponsesProvider, } from "./protocol/responses/ResponsesProvider.js";
|
|
38
38
|
export { MINIMAL_RESPONSES_CAPABILITIES, OPENAI_RESPONSES_CAPABILITIES, } from "./protocol/responses/ResponsesCapabilities.js";
|
|
39
39
|
export { ResponsesSession, } from "./protocol/responses/ResponsesSession.js";
|
|
40
|
+
export { BedrockAwsCredential, } from "./vendors/bedrock/BedrockAwsCredential.js";
|
|
40
41
|
export { BedrockBearerTokenCredential, } from "./vendors/bedrock/BedrockBearerTokenCredential.js";
|
|
41
42
|
export { ClaudeApiKeyCredential, } from "./vendors/claude/ClaudeApiKeyCredential.js";
|
|
42
43
|
export { ClaudeAuthTokenCredential, } from "./vendors/claude/ClaudeAuthTokenCredential.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../sources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAYpD,OAAO,EACH,yBAAyB,GAE5B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACH,wBAAwB,GAG3B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACH,qCAAqC,EACrC,oBAAoB,GACvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,wBAAwB,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vD,OAAO,EACH,gBAAgB,GAEnB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACH,oBAAoB,GAGvB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACH,4BAA4B,GAG/B,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EACH,sBAAsB,GAGzB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACH,yBAAyB,GAG5B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACH,oBAAoB,GAEvB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACH,qBAAqB,GAGxB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACH,qBAAqB,GAGxB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACH,sBAAsB,GAGzB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACH,mBAAmB,GAEtB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACH,sBAAsB,GAGzB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACH,oBAAoB,GAGvB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACH,qBAAqB,GAGxB,MAAM,yCAAyC,CAAC;AAWjD,OAAO,EACH,kBAAkB,GAErB,MAAM,iCAAiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toAnthropicMessages.d.ts","sourceRoot":"","sources":["../../../sources/protocol/anthropic/toAnthropicMessages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGR,gBAAgB,EAEnB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,KAAK,EAKR,cAAc,EAIjB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"toAnthropicMessages.d.ts","sourceRoot":"","sources":["../../../sources/protocol/anthropic/toAnthropicMessages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGR,gBAAgB,EAEnB,MAAM,oDAAoD,CAAC;AAE5D,OAAO,KAAK,EAKR,cAAc,EAIjB,MAAM,0BAA0B,CAAC;AAMlC,MAAM,MAAM,uBAAuB,GAC7B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,GAAG,gBAAgB,EAAE,CAyB3F;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,uBAAuB,GAAG,MAAM,CAE/E;AAED,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,SAAS,uBAAuB,EAAE,GAAG,MAAM,CAEjG"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { toSessionAgentNotificationMessage } from "../../core/toSessionAgentNotificationMessage.js";
|
|
1
2
|
import { toSessionReminderMessage } from "../../core/toSessionReminderMessage.js";
|
|
2
3
|
import { toAnthropicCompactionBlock } from "../../protocol/anthropic/toAnthropicCompactionBlock.js";
|
|
3
4
|
import { toAnthropicToolName } from "../../protocol/anthropic/toAnthropicToolName.js";
|
|
4
5
|
export function toAnthropicMessages(messages) {
|
|
5
6
|
const converted = messages.flatMap((message) => {
|
|
6
|
-
if (message.role === "system") {
|
|
7
|
+
if (message.role === "system" || message.role === "agent") {
|
|
7
8
|
// Anthropic has no system role inside a conversation, so a notice keeps the position
|
|
8
|
-
// the caller chose as a `<system-reminder>` user turn.
|
|
9
|
-
|
|
9
|
+
// the caller chose as a `<system-reminder>` user turn. A message from another agent
|
|
10
|
+
// arrives the same way, as the notification that names who sent it.
|
|
11
|
+
const notice = message.role === "agent" ? toSessionAgentNotificationMessage(message) : message;
|
|
12
|
+
const reminder = toSessionReminderMessage(notice);
|
|
10
13
|
return [{ role: "user", content: toInputContent(reminder.content) }];
|
|
11
14
|
}
|
|
12
15
|
if (message.role === "compaction") {
|
|
@@ -18,8 +21,6 @@ export function toAnthropicMessages(messages) {
|
|
|
18
21
|
if (message.role === "tool") {
|
|
19
22
|
return [{ role: "user", content: [toToolResult(message)] }];
|
|
20
23
|
}
|
|
21
|
-
if (message.role === "agent")
|
|
22
|
-
return [];
|
|
23
24
|
return [{ role: "assistant", content: toAssistantContent(message) }];
|
|
24
25
|
});
|
|
25
26
|
const last = converted.at(-1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toAnthropicMessages.js","sourceRoot":"","sources":["../../../sources/protocol/anthropic/toAnthropicMessages.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAMlF,MAAM,UAAU,mBAAmB,CAAC,QAAmC;IACnE,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAsB,EAAE;QAC/D,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"toAnthropicMessages.js","sourceRoot":"","sources":["../../../sources/protocol/anthropic/toAnthropicMessages.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,iCAAiC,EAAE,MAAM,6CAA6C,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,oDAAoD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAMlF,MAAM,UAAU,mBAAmB,CAAC,QAAmC;IACnE,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAsB,EAAE;QAC/D,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YACxD,qFAAqF;YACrF,oFAAoF;YACpF,oEAAoE;YACpE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CAAC;IACrE,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,CAAC;IAClE,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { ResponseInputImage, ResponseInputText } from "openai/resources/responses/responses.js";
|
|
2
2
|
import type { SessionInputBlock, SessionOutputBlock } from "../../core/SessionContext.js";
|
|
3
3
|
export declare function toOpenAIInputContent(content: readonly (SessionInputBlock | SessionOutputBlock)[]): string | Array<ResponseInputText | ResponseInputImage>;
|
|
4
|
+
/** The same projection without the single-text shorthand, for items that always take blocks. */
|
|
5
|
+
export declare function toOpenAIInputContentBlocks(content: readonly (SessionInputBlock | SessionOutputBlock)[]): Array<ResponseInputText | ResponseInputImage>;
|
|
4
6
|
//# sourceMappingURL=toOpenAIInputContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOpenAIInputContent.d.ts","sourceRoot":"","sources":["../../../sources/protocol/responses/toOpenAIInputContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kBAAkB,EAClB,iBAAiB,EACpB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,wBAAgB,oBAAoB,CAChC,OAAO,EAAE,SAAS,CAAC,iBAAiB,GAAG,kBAAkB,CAAC,EAAE,GAC7D,MAAM,GAAG,KAAK,CAAC,iBAAiB,GAAG,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"toOpenAIInputContent.d.ts","sourceRoot":"","sources":["../../../sources/protocol/responses/toOpenAIInputContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,kBAAkB,EAClB,iBAAiB,EACpB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,wBAAgB,oBAAoB,CAChC,OAAO,EAAE,SAAS,CAAC,iBAAiB,GAAG,kBAAkB,CAAC,EAAE,GAC7D,MAAM,GAAG,KAAK,CAAC,iBAAiB,GAAG,kBAAkB,CAAC,CAGxD;AAED,gGAAgG;AAChG,wBAAgB,0BAA0B,CACtC,OAAO,EAAE,SAAS,CAAC,iBAAiB,GAAG,kBAAkB,CAAC,EAAE,GAC7D,KAAK,CAAC,iBAAiB,GAAG,kBAAkB,CAAC,CAU/C"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export function toOpenAIInputContent(content) {
|
|
2
2
|
if (content.length === 1 && content[0]?.type === "text")
|
|
3
3
|
return content[0].text;
|
|
4
|
+
return toOpenAIInputContentBlocks(content);
|
|
5
|
+
}
|
|
6
|
+
/** The same projection without the single-text shorthand, for items that always take blocks. */
|
|
7
|
+
export function toOpenAIInputContentBlocks(content) {
|
|
4
8
|
return content.map((block) => block.type === "text"
|
|
5
9
|
? { type: "input_text", text: block.text }
|
|
6
10
|
: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOpenAIInputContent.js","sourceRoot":"","sources":["../../../sources/protocol/responses/toOpenAIInputContent.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,oBAAoB,CAChC,OAA4D;IAE5D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,MAAM;QAAE,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAChF,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACzB,KAAK,CAAC,IAAI,KAAK,MAAM;QACjB,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE;QAC1C,CAAC,CAAC;YACI,IAAI,EAAE,aAAa;YACnB,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,QAAQ,KAAK,CAAC,QAAQ,WAAW,KAAK,CAAC,IAAI,EAAE;SAC3D,CACV,CAAC;AACN,CAAC"}
|
|
1
|
+
{"version":3,"file":"toOpenAIInputContent.js","sourceRoot":"","sources":["../../../sources/protocol/responses/toOpenAIInputContent.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,oBAAoB,CAChC,OAA4D;IAE5D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,MAAM;QAAE,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAChF,OAAO,0BAA0B,CAAC,OAAO,CAAC,CAAC;AAC/C,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,0BAA0B,CACtC,OAA4D;IAE5D,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACzB,KAAK,CAAC,IAAI,KAAK,MAAM;QACjB,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE;QAC1C,CAAC,CAAC;YACI,IAAI,EAAE,aAAa;YACnB,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,QAAQ,KAAK,CAAC,QAAQ,WAAW,KAAK,CAAC,IAAI,EAAE;SAC3D,CACV,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOpenAIResponseInput.d.ts","sourceRoot":"","sources":["../../../sources/protocol/responses/toOpenAIResponseInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAqB,MAAM,yCAAyC,CAAC;AAEhG,OAAO,KAAK,EAER,cAAc,EAEjB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"toOpenAIResponseInput.d.ts","sourceRoot":"","sources":["../../../sources/protocol/responses/toOpenAIResponseInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAqB,MAAM,yCAAyC,CAAC;AAEhG,OAAO,KAAK,EAER,cAAc,EAEjB,MAAM,0BAA0B,CAAC;AASlC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,GAAG,aAAa,CAqI5E"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
import { toSessionAgentNotificationMessage } from "../../core/toSessionAgentNotificationMessage.js";
|
|
1
2
|
import { createCodexCallIdMapper } from "../../protocol/responses/createCodexCallIdMapper.js";
|
|
2
|
-
import { toOpenAIInputContent } from "../../protocol/responses/toOpenAIInputContent.js";
|
|
3
|
+
import { toOpenAIInputContent, toOpenAIInputContentBlocks, } from "../../protocol/responses/toOpenAIInputContent.js";
|
|
3
4
|
export function toOpenAIResponseInput(context) {
|
|
4
5
|
const input = [];
|
|
5
6
|
const customToolCallIds = new Set();
|
|
6
7
|
const toolSearchCallIds = new Set();
|
|
7
8
|
const mapCallId = createCodexCallIdMapper();
|
|
8
9
|
let messageId = 0;
|
|
9
|
-
for (const
|
|
10
|
+
for (const original of context.messages) {
|
|
11
|
+
// A message from another agent is a developer notification naming its author, the same
|
|
12
|
+
// one every other provider receives; Responses is given no native agent item.
|
|
13
|
+
const message = original.role === "agent" ? toSessionAgentNotificationMessage(original) : original;
|
|
10
14
|
if (message.role === "system") {
|
|
11
15
|
input.push({
|
|
12
16
|
type: "message",
|
|
13
17
|
role: "developer",
|
|
14
|
-
content: message.content
|
|
18
|
+
content: toOpenAIInputContentBlocks(message.content),
|
|
15
19
|
});
|
|
16
20
|
continue;
|
|
17
21
|
}
|
|
@@ -23,18 +27,6 @@ export function toOpenAIResponseInput(context) {
|
|
|
23
27
|
});
|
|
24
28
|
continue;
|
|
25
29
|
}
|
|
26
|
-
if (message.role === "agent") {
|
|
27
|
-
input.push({
|
|
28
|
-
type: "agent_message",
|
|
29
|
-
author: message.author,
|
|
30
|
-
recipient: message.recipient,
|
|
31
|
-
content: [
|
|
32
|
-
{ type: "input_text", text: message.header },
|
|
33
|
-
{ type: "encrypted_content", encrypted_content: message.encryptedContent },
|
|
34
|
-
],
|
|
35
|
-
});
|
|
36
|
-
continue;
|
|
37
|
-
}
|
|
38
30
|
if (message.role === "compaction") {
|
|
39
31
|
if (message.encryptedContent === null) {
|
|
40
32
|
throw new Error("Responses compaction is missing encrypted content.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toOpenAIResponseInput.js","sourceRoot":"","sources":["../../../sources/protocol/responses/toOpenAIResponseInput.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,
|
|
1
|
+
{"version":3,"file":"toOpenAIResponseInput.js","sourceRoot":"","sources":["../../../sources/protocol/responses/toOpenAIResponseInput.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iCAAiC,EAAE,MAAM,6CAA6C,CAAC;AAChG,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EACH,oBAAoB,EACpB,0BAA0B,GAC7B,MAAM,8CAA8C,CAAC;AAGtD,MAAM,UAAU,qBAAqB,CAAC,OAAuB;IACzD,MAAM,KAAK,GAAkB,EAAE,CAAC;IAChC,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC5C,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;IAC5C,MAAM,SAAS,GAAG,uBAAuB,EAAE,CAAC;IAC5C,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,KAAK,MAAM,QAAQ,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;QACtC,uFAAuF;QACvF,8EAA8E;QAC9E,MAAM,OAAO,GACT,QAAQ,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,iCAAiC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QACvF,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC5B,KAAK,CAAC,IAAI,CAA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QACD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAsB,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,SAAS,CAAC;IACrB,CAAC;AACL,CAAC;AAED,SAAS,eAAe,CACpB,IAAuB,EACvB,SAAqC;IAErC,OAAO,SAAS,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;QACxD,CAAC,CAAE,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAwB;QACtE,CAAC,CAAC,IAAI,CAAC;AACf,CAAC;AAED,SAAS,cAAc,CAAC,MAAW;IAC/B,IAAI,MAAM,EAAE,QAAQ,KAAK,OAAO,IAAI,MAAM,EAAE,QAAQ,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC;IACvF,OAAO,MAAM,EAAE,IAAI,KAAK,eAAe;QACnC,MAAM,EAAE,IAAI,KAAK,kBAAkB;QACnC,MAAM,EAAE,IAAI,KAAK,kBAAkB;QACnC,CAAC,CAAC,MAAM,CAAC,IAAI;QACb,CAAC,CAAC,SAAS,CAAC;AACpB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BedrockAwsCredential } from "../vendors/bedrock/BedrockAwsCredential.js";
|
|
1
2
|
import type { BedrockBearerTokenCredential } from "../vendors/bedrock/BedrockBearerTokenCredential.js";
|
|
2
3
|
import type { ClaudeApiKeyCredential } from "../vendors/claude/ClaudeApiKeyCredential.js";
|
|
3
4
|
import type { ClaudeAuthTokenCredential } from "../vendors/claude/ClaudeAuthTokenCredential.js";
|
|
@@ -8,7 +9,7 @@ import type { CodexSessionCredential } from "../vendors/codex/CodexSessionCreden
|
|
|
8
9
|
import type { GeminiApiKeyCredential } from "../vendors/gemini/GeminiApiKeyCredential.js";
|
|
9
10
|
import type { GrokApiKeyCredential } from "../vendors/grok/GrokApiKeyCredential.js";
|
|
10
11
|
import type { GrokSessionCredential } from "../vendors/grok/GrokSessionCredential.js";
|
|
11
|
-
export type BedrockCredential = BedrockBearerTokenCredential;
|
|
12
|
+
export type BedrockCredential = BedrockAwsCredential | BedrockBearerTokenCredential;
|
|
12
13
|
export type ClaudeCredential = ClaudeApiKeyCredential | ClaudeAuthTokenCredential | ClaudeCodeCredential | ClaudeOAuthCredential;
|
|
13
14
|
export type AnthropicCredential = BedrockCredential | ClaudeCredential;
|
|
14
15
|
export type CodexCredential = CodexApiKeyCredential | CodexSessionCredential;
|
|
@@ -16,4 +17,5 @@ export type CodexProviderCredential = BedrockCredential | CodexCredential;
|
|
|
16
17
|
export type GeminiCredential = GeminiApiKeyCredential;
|
|
17
18
|
export type GrokCredential = GrokApiKeyCredential | GrokSessionCredential;
|
|
18
19
|
export type VendorCredential = AnthropicCredential | CodexCredential | GeminiCredential | GrokCredential;
|
|
20
|
+
export declare function isBedrockCredential(value: unknown): value is BedrockCredential;
|
|
19
21
|
//# sourceMappingURL=VendorCredential.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VendorCredential.d.ts","sourceRoot":"","sources":["../../sources/vendors/VendorCredential.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;AACtG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,KAAK,EAAE,oBAAoB,EAAE,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GAAG,sBAAsB,CAAC;AAEtD,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG,qBAAqB,CAAC;AAE1E,MAAM,MAAM,gBAAgB,GACtB,mBAAmB,GACnB,eAAe,GACf,gBAAgB,GAChB,cAAc,CAAC;AAErB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,iBAAiB,CAI9E"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export function isBedrockCredential(value) {
|
|
2
|
+
if (typeof value !== "object" || value === null || !("name" in value))
|
|
3
|
+
return false;
|
|
4
|
+
const name = value.name;
|
|
5
|
+
return name === "bedrock-aws" || name === "bedrock-bearer-token";
|
|
6
|
+
}
|
|
2
7
|
//# sourceMappingURL=VendorCredential.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VendorCredential.js","sourceRoot":"","sources":["../../sources/vendors/VendorCredential.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"VendorCredential.js","sourceRoot":"","sources":["../../sources/vendors/VendorCredential.ts"],"names":[],"mappings":"AAoCA,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACpF,MAAM,IAAI,GAAI,KAA2B,CAAC,IAAI,CAAC;IAC/C,OAAO,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,sBAAsB,CAAC;AACrE,CAAC"}
|