@consciousclouds/conductor-sdk 0.1.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/CHANGELOG.md +30 -0
- package/LICENSE +171 -0
- package/README.md +64 -0
- package/dist/capabilities.d.ts +17 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +18 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/client/conductor-client.d.ts +88 -0
- package/dist/client/conductor-client.d.ts.map +1 -0
- package/dist/client/conductor-client.js +213 -0
- package/dist/client/conductor-client.js.map +1 -0
- package/dist/generated/index.d.ts +2 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +3 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/types.d.ts +208 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +3 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/personalities.d.ts +12 -0
- package/dist/personalities.d.ts.map +1 -0
- package/dist/personalities.js +9 -0
- package/dist/personalities.js.map +1 -0
- package/dist/tools.d.ts +13 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +10 -0
- package/dist/tools.js.map +1 -0
- package/dist/types/index.d.ts +27 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +11 -0
- package/dist/types/index.js.map +1 -0
- package/dist/validate/index.d.ts +219 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/dist/validate/index.js +131 -0
- package/dist/validate/index.js.map +1 -0
- package/package.json +61 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Changelog — @consciousclouds/conductor-sdk
|
|
2
|
+
|
|
3
|
+
Versioned on the independent frontend-SDK lifecycle (NOT `contract_version`).
|
|
4
|
+
|
|
5
|
+
## [0.1.0] — 2026-06-16
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Conductor wire types (`TurnRequest`, `ResolveRequest`, `ResolveResult`, the
|
|
10
|
+
seven frozen SSE event payloads, `ConductorEventName`/`ConductorEventDataMap`),
|
|
11
|
+
generated from `platform/contracts/conductor/v1/` by
|
|
12
|
+
`platform/codegen/conductor/generate.py`.
|
|
13
|
+
- Tool / personality / capability declaration types
|
|
14
|
+
(`ToolDeclaration`, `PersonalityDeclaration`, `Capability`).
|
|
15
|
+
- A thin `createConductorClient({ baseUrl, headers?, fetchImpl?, validate? })`:
|
|
16
|
+
`stream()` (SSE), `turn()` (delta accumulation + completed), and
|
|
17
|
+
`resolveApproval()`. `ConductorClientError` for transport failures.
|
|
18
|
+
- A reusable, transport-agnostic SSE frame parser (`parseSseFrames`).
|
|
19
|
+
- `validateTurnRequest()` / `validateResolveRequest()` / `validateSseEvent()`
|
|
20
|
+
(zod) mirroring the JSON Schema.
|
|
21
|
+
|
|
22
|
+
### Notes
|
|
23
|
+
|
|
24
|
+
- Authoritative contract is the JSON Schema under
|
|
25
|
+
`platform/contracts/conductor/v1/`. The generated types derive from it.
|
|
26
|
+
- `baseUrl` is a configurable Conductor-compatible endpoint. The SDK never
|
|
27
|
+
hard-codes a gateway URL, never adds a gateway route, and never mints
|
|
28
|
+
identity — it forwards the `Authorization` / `X-Tenant-ID` headers the caller
|
|
29
|
+
supplies.
|
|
30
|
+
- No business logic, no caching, no retries-with-elevation (the locked SDK rule).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship made available under
|
|
36
|
+
the License, as indicated by a copyright notice that is included in
|
|
37
|
+
or attached to the work (an example is provided in the Appendix below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
43
|
+
of this License, Derivative Works shall not include works that remain
|
|
44
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
|
+
the Work and Derivative Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean, as submitted to the Licensor for inclusion
|
|
48
|
+
in the Work by the copyright owner or by an individual or Legal Entity
|
|
49
|
+
authorized to submit on behalf of the copyright owner. For the purposes
|
|
50
|
+
of this definition, "submitted" means any form of electronic, verbal,
|
|
51
|
+
or written communication sent to the Licensor or its representatives,
|
|
52
|
+
including but not limited to communication on electronic mailing lists,
|
|
53
|
+
source code control systems, and issue tracking systems that are managed
|
|
54
|
+
by, or on behalf of, the Licensor for the purpose of discussing and
|
|
55
|
+
improving the Work, but excluding communication that is conspicuously
|
|
56
|
+
marked or designated in writing by the copyright owner as "Not a
|
|
57
|
+
Contribution."
|
|
58
|
+
|
|
59
|
+
"Contributor" shall mean Licensor and any Legal Entity on behalf of
|
|
60
|
+
whom a Contribution has been received by the Licensor and included
|
|
61
|
+
within the Work.
|
|
62
|
+
|
|
63
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
64
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
65
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
66
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
67
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
68
|
+
Work and such Derivative Works in Source or Object form.
|
|
69
|
+
|
|
70
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
71
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
72
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
73
|
+
(except as stated in this section) patent license to make, have made,
|
|
74
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
75
|
+
where such license applies only to those patent claims licensable
|
|
76
|
+
by such Contributor that are necessarily infringed by their
|
|
77
|
+
Contribution(s) alone or by the combination of their Contribution(s)
|
|
78
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
79
|
+
institute patent litigation against any entity (including a cross-claim
|
|
80
|
+
or counterclaim in a lawsuit) alleging that the Work or any
|
|
81
|
+
Contribution embodied within the Work constitutes direct or contributory
|
|
82
|
+
patent infringement, then any patent licenses granted to You under
|
|
83
|
+
this License for that Work shall terminate as of the date such
|
|
84
|
+
litigation is filed.
|
|
85
|
+
|
|
86
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
87
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
88
|
+
modifications, and in Source or Object form, provided that You
|
|
89
|
+
meet the following conditions:
|
|
90
|
+
|
|
91
|
+
(a) You must give any other recipients of the Work or Derivative Works
|
|
92
|
+
a copy of this License; and
|
|
93
|
+
|
|
94
|
+
(b) You must cause any modified files to carry prominent notices
|
|
95
|
+
stating that You changed the files; and
|
|
96
|
+
|
|
97
|
+
(c) You must retain, in the Source form of any Derivative Works that
|
|
98
|
+
You distribute, all copyright, patent, trademark, and attribution
|
|
99
|
+
notices from the Source form of the Work, excluding those notices
|
|
100
|
+
that do not pertain to any part of the Derivative Works; and
|
|
101
|
+
|
|
102
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
103
|
+
distribution, You must include a readable copy of the attribution
|
|
104
|
+
notices contained within such NOTICE file, in at least one of the
|
|
105
|
+
following places: within a NOTICE text provided as part of the
|
|
106
|
+
Derivative Works; within the Source form or documentation, if
|
|
107
|
+
provided along with the Derivative Works; or, within a display
|
|
108
|
+
generated by the Derivative Works, if and wherever such third-party
|
|
109
|
+
notices normally appear. The contents of the NOTICE file are for
|
|
110
|
+
informational purposes only and do not modify the License. You may
|
|
111
|
+
add Your own attribution notices within Derivative Works that You
|
|
112
|
+
distribute, alongside or in addition to the NOTICE text from the
|
|
113
|
+
Work, provided that such additional attribution notices cannot be
|
|
114
|
+
construed as modifying the License.
|
|
115
|
+
|
|
116
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
117
|
+
any Contribution intentionally submitted for inclusion in the Work by
|
|
118
|
+
You to the Licensor shall be under the terms and conditions of this
|
|
119
|
+
License, without any additional terms or conditions.
|
|
120
|
+
|
|
121
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
122
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
123
|
+
except as required for reasonable and customary use in describing the
|
|
124
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
125
|
+
|
|
126
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
127
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
128
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
129
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
130
|
+
implied, including, without limitation, any conditions of TITLE,
|
|
131
|
+
MERCHANTIBILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
|
|
132
|
+
responsible for determining the appropriateness of using or
|
|
133
|
+
redistributing the Work and assume any risks associated with Your
|
|
134
|
+
exercise of permissions under this License.
|
|
135
|
+
|
|
136
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
137
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
138
|
+
unless required by applicable law (such as deliberate and grossly
|
|
139
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
140
|
+
liable to You for damages, including any direct, indirect, special,
|
|
141
|
+
incidental, or exemplary damages of any character arising as a result
|
|
142
|
+
of this License or out of the use or inability to use the Work
|
|
143
|
+
(including but not limited to damages for loss of goodwill, work
|
|
144
|
+
stoppage, computer failure or malfunction, or all other commercial
|
|
145
|
+
damages or losses), even if such Contributor has been advised of the
|
|
146
|
+
possibility of such damages.
|
|
147
|
+
|
|
148
|
+
9. Accepting Warranty or Liability. While redistributing the Work or
|
|
149
|
+
Derivative Works thereof, You may choose to offer, and charge a fee
|
|
150
|
+
for, acceptance of support, warranty, indemnity, or other liability
|
|
151
|
+
obligations and/or rights consistent with this License. However, in
|
|
152
|
+
accepting such obligations, You may offer such obligations only on
|
|
153
|
+
Your own behalf and on Your sole responsibility, not on behalf of any
|
|
154
|
+
other Contributor, and only if You agree to indemnify, defend, and
|
|
155
|
+
hold each Contributor harmless for any liability incurred by, or
|
|
156
|
+
claims asserted against, such Contributor by reason of your accepting
|
|
157
|
+
any such warranty or additional liability.
|
|
158
|
+
|
|
159
|
+
Copyright 2024 Conscious Clouds
|
|
160
|
+
|
|
161
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
162
|
+
you may not use this file except in compliance with the License.
|
|
163
|
+
You may obtain a copy of the License at
|
|
164
|
+
|
|
165
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
166
|
+
|
|
167
|
+
Unless required by applicable law or agreed to in writing, software
|
|
168
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
169
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
170
|
+
See the License for the specific language governing permissions and
|
|
171
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# @consciousclouds/conductor-sdk
|
|
2
|
+
|
|
3
|
+
Types + a thin client for the **Conductor** runtime — the single AI engine the
|
|
4
|
+
platform's products consume as registered personalities. Two endpoints: a
|
|
5
|
+
streaming **turn** (Server-Sent Events) and an approval **resolve**.
|
|
6
|
+
|
|
7
|
+
Framework-agnostic and provider-agnostic — no product nouns, no React, no model
|
|
8
|
+
provider. The authoritative contract is the JSON Schema under
|
|
9
|
+
`platform/contracts/conductor/v1/`; the generated types derive from it.
|
|
10
|
+
|
|
11
|
+
`baseUrl` is a **configurable Conductor-compatible endpoint** — the SDK never
|
|
12
|
+
hard-codes a gateway URL, never adds a gateway route, and never mints identity.
|
|
13
|
+
It forwards the `Authorization` / `X-Tenant-ID` headers the caller supplies.
|
|
14
|
+
|
|
15
|
+
## Exports
|
|
16
|
+
|
|
17
|
+
| Subpath | What |
|
|
18
|
+
|---|---|
|
|
19
|
+
| `.` | everything below |
|
|
20
|
+
| `./client` | `createConductorClient()`, `ConductorClientError`, `parseSseFrames()` |
|
|
21
|
+
| `./types` | `TurnRequest`, `ResolveResult`, the SSE event payloads, `CompletedResult` |
|
|
22
|
+
| `./tools` | `ToolDeclaration`, `TOOL_CATEGORIES` |
|
|
23
|
+
| `./personalities` | `PersonalityDeclaration`, `PERSONALITY_TIERS` |
|
|
24
|
+
| `./capabilities` | `Capability`, `CAPABILITY_PATTERN`, `isCapability()` |
|
|
25
|
+
| `./validate` | `validateTurnRequest()`, `validateResolveRequest()`, `validateSseEvent()` |
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { createConductorClient } from '@consciousclouds/conductor-sdk';
|
|
31
|
+
|
|
32
|
+
const conductor = createConductorClient({
|
|
33
|
+
baseUrl: process.env.CONDUCTOR_BASE_URL!, // a Conductor-compatible endpoint
|
|
34
|
+
headers: () => ({
|
|
35
|
+
Authorization: `Bearer ${getToken()}`,
|
|
36
|
+
'X-Tenant-ID': getTenantId(),
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Stream a turn, frame by frame.
|
|
41
|
+
await conductor.stream({ prompt: 'Summarize my environments' }, (name, data) => {
|
|
42
|
+
if (name === 'delta') process.stdout.write(data.text);
|
|
43
|
+
if (name === 'approval_required') {
|
|
44
|
+
void conductor.resolveApproval(data.approval_id, 'approve');
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Or the convenience form: accumulate text + get the completed payload.
|
|
49
|
+
const result = await conductor.turn({ prompt: 'Hello' });
|
|
50
|
+
console.log(result.text, result.cost_usd);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## The frozen event set
|
|
54
|
+
|
|
55
|
+
`started`, `delta`, `tool_start`, `tool_done`, `approval_required`,
|
|
56
|
+
`completed`, `error`. Adding an event is additive in
|
|
57
|
+
`platform/contracts/conductor/v1/`; regenerate with
|
|
58
|
+
`python platform/codegen/conductor/generate.py` (or `bun run generate:conductor`).
|
|
59
|
+
|
|
60
|
+
## SDK rule
|
|
61
|
+
|
|
62
|
+
Types + thin HTTP wrapper only — no business logic, no caching, no
|
|
63
|
+
retries-with-elevation. The runtime authorizes every request against the
|
|
64
|
+
*caller's* identity; this SDK never decides authorization.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability vocabulary. A capability is a `<primitive>.<verb>` string
|
|
3
|
+
* (e.g. canvas.read, graph.contribute, conductor.invoke). Re-exported from the
|
|
4
|
+
* generated contract types.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
export type { Capability } from './generated/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* The capability string pattern, mirroring
|
|
11
|
+
* platform/contracts/conductor/v1/capability.schema.json. Both segments are
|
|
12
|
+
* lower_snake_case.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CAPABILITY_PATTERN: RegExp;
|
|
15
|
+
/** True when `value` is a well-formed capability string. */
|
|
16
|
+
export declare function isCapability(value: string): boolean;
|
|
17
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,QAAuB,CAAC;AAEvD,4DAA4D;AAC5D,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEnD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability vocabulary. A capability is a `<primitive>.<verb>` string
|
|
3
|
+
* (e.g. canvas.read, graph.contribute, conductor.invoke). Re-exported from the
|
|
4
|
+
* generated contract types.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The capability string pattern, mirroring
|
|
10
|
+
* platform/contracts/conductor/v1/capability.schema.json. Both segments are
|
|
11
|
+
* lower_snake_case.
|
|
12
|
+
*/
|
|
13
|
+
export const CAPABILITY_PATTERN = /^[a-z_]+\.[a-z_]+$/;
|
|
14
|
+
/** True when `value` is a well-formed capability string. */
|
|
15
|
+
export function isCapability(value) {
|
|
16
|
+
return CAPABILITY_PATTERN.test(value);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEvD,4DAA4D;AAC5D,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin Conductor client — types + HTTP wrapper only (the locked SDK rule).
|
|
3
|
+
* No business logic, no caching, no retries, no elevation. It forwards the
|
|
4
|
+
* identity headers the caller supplies and never mints identity.
|
|
5
|
+
*
|
|
6
|
+
* The one transport-mechanics affordance it exposes is cancellation: `stream()`
|
|
7
|
+
* and `turn()` accept an optional `AbortSignal`. Aborting tears down the fetch +
|
|
8
|
+
* reader. This is NOT a retry/timeout/reconnect policy — resilience POLICY
|
|
9
|
+
* (backoff, idle-stall, token refresh) lives in the coordination layer
|
|
10
|
+
* (`@consciousclouds/ai-client`), never here.
|
|
11
|
+
*
|
|
12
|
+
* `baseUrl` is a configurable Conductor-compatible HTTP endpoint. The SDK never
|
|
13
|
+
* hard-codes a gateway URL and never adds a gateway route.
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
import type { TurnRequest, ResolveResult, ConductorEventName, ConductorEventDataMap, CompletedResult } from '../types/index.js';
|
|
18
|
+
import type { ApprovalDecision } from '../types/index.js';
|
|
19
|
+
export interface ConductorClientOptions {
|
|
20
|
+
/**
|
|
21
|
+
* Base URL of a Conductor-compatible HTTP endpoint, e.g.
|
|
22
|
+
* https://conductor.example.com. Required — the SDK never hard-codes one.
|
|
23
|
+
*/
|
|
24
|
+
baseUrl: string;
|
|
25
|
+
/** Optional fetch implementation (defaults to global fetch). */
|
|
26
|
+
fetchImpl?: typeof fetch;
|
|
27
|
+
/**
|
|
28
|
+
* Optional per-request headers (auth, tenant, correlation). The caller owns
|
|
29
|
+
* identity: typically returns `Authorization` and `X-Tenant-ID`. The SDK
|
|
30
|
+
* forwards whatever is returned and adds nothing of its own.
|
|
31
|
+
*/
|
|
32
|
+
headers?: () => Record<string, string> | Promise<Record<string, string>>;
|
|
33
|
+
/** Reserved for symmetry with other SDK clients; unused today. */
|
|
34
|
+
validate?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** Callback invoked once per parsed SSE frame, in arrival order. */
|
|
37
|
+
export type ConductorEventHandler = (name: ConductorEventName, data: ConductorEventDataMap[ConductorEventName]) => void;
|
|
38
|
+
/** Per-call transport options. Cancellation only — no policy. */
|
|
39
|
+
export interface ConductorStreamOptions {
|
|
40
|
+
/**
|
|
41
|
+
* Aborts the in-flight request. Aborting tears down the fetch + reader; the
|
|
42
|
+
* returned promise rejects with the abort reason (an `AbortError`). The SDK
|
|
43
|
+
* does nothing else with it — no retry, no reconnect.
|
|
44
|
+
*/
|
|
45
|
+
signal?: AbortSignal;
|
|
46
|
+
}
|
|
47
|
+
export interface ConductorClient {
|
|
48
|
+
/**
|
|
49
|
+
* POST /api/v1/conductor/turn/stream — opens the SSE stream and invokes
|
|
50
|
+
* `onEvent` for every frame until the stream ends. Resolves when the stream
|
|
51
|
+
* is fully consumed; rejects on transport / non-2xx errors. Pass
|
|
52
|
+
* `opts.signal` to cancel.
|
|
53
|
+
*/
|
|
54
|
+
stream(input: TurnRequest, onEvent: ConductorEventHandler, opts?: ConductorStreamOptions): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Convenience over stream(): accumulates `delta` text and resolves with the
|
|
57
|
+
* `completed` payload (+ accumulated text). Rejects on an `error` event or if
|
|
58
|
+
* the stream ends without a `completed` event.
|
|
59
|
+
*/
|
|
60
|
+
turn(input: TurnRequest, opts?: ConductorStreamOptions): Promise<CompletedResult>;
|
|
61
|
+
/**
|
|
62
|
+
* POST /api/v1/conductor/approvals/:id/resolve — approve or reject a pending
|
|
63
|
+
* approval surfaced by an `approval_required` event.
|
|
64
|
+
*/
|
|
65
|
+
resolveApproval(approvalId: string, decision: ApprovalDecision): Promise<ResolveResult>;
|
|
66
|
+
}
|
|
67
|
+
export declare class ConductorClientError extends Error {
|
|
68
|
+
readonly status?: number | undefined;
|
|
69
|
+
readonly details?: unknown | undefined;
|
|
70
|
+
constructor(message: string, status?: number | undefined, details?: unknown | undefined);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Parse a raw SSE buffer into complete `{ event, data }` frames.
|
|
74
|
+
*
|
|
75
|
+
* Frames are separated by a blank line (`\n\n`). Within a frame, `event:` lines
|
|
76
|
+
* name the event and `data:` lines carry the JSON payload (multiple `data:`
|
|
77
|
+
* lines are joined with `\n` per the SSE spec). Returns the complete frames and
|
|
78
|
+
* the unconsumed remainder (a partial frame still being received).
|
|
79
|
+
*/
|
|
80
|
+
export declare function parseSseFrames(buffer: string): {
|
|
81
|
+
frames: {
|
|
82
|
+
event: string;
|
|
83
|
+
data: string;
|
|
84
|
+
}[];
|
|
85
|
+
rest: string;
|
|
86
|
+
};
|
|
87
|
+
export declare function createConductorClient(options: ConductorClientOptions): ConductorClient;
|
|
88
|
+
//# sourceMappingURL=conductor-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conductor-client.d.ts","sourceRoot":"","sources":["../../src/client/conductor-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,WAAW,sBAAsB;IACrC;;;OA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AAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;CACd,CAgCA;AAeD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAiKtF"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin Conductor client — types + HTTP wrapper only (the locked SDK rule).
|
|
3
|
+
* No business logic, no caching, no retries, no elevation. It forwards the
|
|
4
|
+
* identity headers the caller supplies and never mints identity.
|
|
5
|
+
*
|
|
6
|
+
* The one transport-mechanics affordance it exposes is cancellation: `stream()`
|
|
7
|
+
* and `turn()` accept an optional `AbortSignal`. Aborting tears down the fetch +
|
|
8
|
+
* reader. This is NOT a retry/timeout/reconnect policy — resilience POLICY
|
|
9
|
+
* (backoff, idle-stall, token refresh) lives in the coordination layer
|
|
10
|
+
* (`@consciousclouds/ai-client`), never here.
|
|
11
|
+
*
|
|
12
|
+
* `baseUrl` is a configurable Conductor-compatible HTTP endpoint. The SDK never
|
|
13
|
+
* hard-codes a gateway URL and never adds a gateway route.
|
|
14
|
+
*
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
export class ConductorClientError extends Error {
|
|
18
|
+
constructor(message, status, details) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.status = status;
|
|
21
|
+
this.details = details;
|
|
22
|
+
this.name = 'ConductorClientError';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Parse a raw SSE buffer into complete `{ event, data }` frames.
|
|
27
|
+
*
|
|
28
|
+
* Frames are separated by a blank line (`\n\n`). Within a frame, `event:` lines
|
|
29
|
+
* name the event and `data:` lines carry the JSON payload (multiple `data:`
|
|
30
|
+
* lines are joined with `\n` per the SSE spec). Returns the complete frames and
|
|
31
|
+
* the unconsumed remainder (a partial frame still being received).
|
|
32
|
+
*/
|
|
33
|
+
export function parseSseFrames(buffer) {
|
|
34
|
+
// Normalize CRLF → LF so frame splitting is robust across servers.
|
|
35
|
+
const normalized = buffer.replace(/\r\n/g, '\n');
|
|
36
|
+
const frames = [];
|
|
37
|
+
let searchFrom = 0;
|
|
38
|
+
let sep = normalized.indexOf('\n\n', searchFrom);
|
|
39
|
+
while (sep !== -1) {
|
|
40
|
+
const block = normalized.slice(searchFrom, sep);
|
|
41
|
+
searchFrom = sep + 2;
|
|
42
|
+
sep = normalized.indexOf('\n\n', searchFrom);
|
|
43
|
+
let event = '';
|
|
44
|
+
const dataLines = [];
|
|
45
|
+
for (const line of block.split('\n')) {
|
|
46
|
+
if (line === '' || line.startsWith(':'))
|
|
47
|
+
continue; // blank / comment line
|
|
48
|
+
const colon = line.indexOf(':');
|
|
49
|
+
const field = colon === -1 ? line : line.slice(0, colon);
|
|
50
|
+
// A single leading space after the colon is stripped per the SSE spec.
|
|
51
|
+
let value = colon === -1 ? '' : line.slice(colon + 1);
|
|
52
|
+
if (value.startsWith(' '))
|
|
53
|
+
value = value.slice(1);
|
|
54
|
+
if (field === 'event')
|
|
55
|
+
event = value;
|
|
56
|
+
else if (field === 'data')
|
|
57
|
+
dataLines.push(value);
|
|
58
|
+
}
|
|
59
|
+
// Only surface frames that actually named an event (skip keep-alives).
|
|
60
|
+
if (event !== '') {
|
|
61
|
+
frames.push({ event, data: dataLines.join('\n') });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return { frames, rest: normalized.slice(searchFrom) };
|
|
65
|
+
}
|
|
66
|
+
function isFrozenEvent(name) {
|
|
67
|
+
return (name === 'started' ||
|
|
68
|
+
name === 'delta' ||
|
|
69
|
+
name === 'tool_start' ||
|
|
70
|
+
name === 'tool_done' ||
|
|
71
|
+
name === 'approval_required' ||
|
|
72
|
+
name === 'completed' ||
|
|
73
|
+
name === 'error' ||
|
|
74
|
+
name === 'routed');
|
|
75
|
+
}
|
|
76
|
+
export function createConductorClient(options) {
|
|
77
|
+
if (!options.baseUrl) {
|
|
78
|
+
throw new ConductorClientError('createConductorClient requires a baseUrl');
|
|
79
|
+
}
|
|
80
|
+
const base = options.baseUrl.replace(/\/$/, '');
|
|
81
|
+
const doFetch = options.fetchImpl ?? globalThis.fetch;
|
|
82
|
+
async function resolvedHeaders() {
|
|
83
|
+
return options.headers ? await options.headers() : {};
|
|
84
|
+
}
|
|
85
|
+
const client = {
|
|
86
|
+
async stream(input, onEvent, opts) {
|
|
87
|
+
const url = `${base}/api/v1/conductor/turn/stream`;
|
|
88
|
+
// Bail before any network work if already aborted. Explicit (not throwIfAborted) so the guard
|
|
89
|
+
// never silently no-ops on a runtime missing that method.
|
|
90
|
+
if (opts?.signal?.aborted) {
|
|
91
|
+
throw opts.signal.reason ?? new DOMException('Aborted', 'AbortError');
|
|
92
|
+
}
|
|
93
|
+
const headers = await resolvedHeaders();
|
|
94
|
+
const res = await doFetch(url, {
|
|
95
|
+
method: 'POST',
|
|
96
|
+
headers: {
|
|
97
|
+
'Content-Type': 'application/json',
|
|
98
|
+
Accept: 'text/event-stream',
|
|
99
|
+
...headers,
|
|
100
|
+
},
|
|
101
|
+
body: JSON.stringify(input),
|
|
102
|
+
signal: opts?.signal,
|
|
103
|
+
});
|
|
104
|
+
if (!res.ok) {
|
|
105
|
+
let body;
|
|
106
|
+
try {
|
|
107
|
+
body = await res.json();
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
body = undefined;
|
|
111
|
+
}
|
|
112
|
+
throw new ConductorClientError(`Conductor turn request failed (${res.status})`, res.status, body);
|
|
113
|
+
}
|
|
114
|
+
if (!res.body) {
|
|
115
|
+
throw new ConductorClientError('Conductor turn response has no body', res.status);
|
|
116
|
+
}
|
|
117
|
+
const reader = res.body.getReader();
|
|
118
|
+
const decoder = new TextDecoder();
|
|
119
|
+
let buffer = '';
|
|
120
|
+
const dispatch = (frames) => {
|
|
121
|
+
for (const frame of frames) {
|
|
122
|
+
if (!isFrozenEvent(frame.event))
|
|
123
|
+
continue; // ignore unknown event names
|
|
124
|
+
let parsed = undefined;
|
|
125
|
+
if (frame.data !== '') {
|
|
126
|
+
try {
|
|
127
|
+
parsed = JSON.parse(frame.data);
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
parsed = frame.data; // surface the raw string if not JSON
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
onEvent(frame.event, parsed);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
// eslint-disable-next-line no-constant-condition
|
|
137
|
+
while (true) {
|
|
138
|
+
const { value, done } = await reader.read();
|
|
139
|
+
if (done)
|
|
140
|
+
break;
|
|
141
|
+
buffer += decoder.decode(value, { stream: true });
|
|
142
|
+
const { frames, rest } = parseSseFrames(buffer);
|
|
143
|
+
buffer = rest;
|
|
144
|
+
dispatch(frames);
|
|
145
|
+
}
|
|
146
|
+
// Flush any trailing frame that lacked a final blank line.
|
|
147
|
+
buffer += decoder.decode();
|
|
148
|
+
if (buffer.trim() !== '') {
|
|
149
|
+
const { frames } = parseSseFrames(buffer.endsWith('\n\n') ? buffer : `${buffer}\n\n`);
|
|
150
|
+
dispatch(frames);
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
async turn(input, opts) {
|
|
154
|
+
let text = '';
|
|
155
|
+
let completed;
|
|
156
|
+
let failure;
|
|
157
|
+
let routed;
|
|
158
|
+
await client.stream(input, (name, data) => {
|
|
159
|
+
if (name === 'delta') {
|
|
160
|
+
text += data.text ?? '';
|
|
161
|
+
}
|
|
162
|
+
else if (name === 'completed') {
|
|
163
|
+
completed = data;
|
|
164
|
+
}
|
|
165
|
+
else if (name === 'error') {
|
|
166
|
+
failure = data;
|
|
167
|
+
}
|
|
168
|
+
else if (name === 'routed') {
|
|
169
|
+
routed = data;
|
|
170
|
+
}
|
|
171
|
+
}, opts);
|
|
172
|
+
if (failure) {
|
|
173
|
+
throw new ConductorClientError(failure.message, undefined, failure);
|
|
174
|
+
}
|
|
175
|
+
if (routed && !completed) {
|
|
176
|
+
// A deterministic navigation/action turn produces no text+usage result — the host must
|
|
177
|
+
// PERFORM the directive. The collapse-to-result convenience cannot express that; the caller
|
|
178
|
+
// must use stream() to receive `routed`. Fail with the directive attached, not a generic miss.
|
|
179
|
+
throw new ConductorClientError('Conductor turn ended in a navigation/action directive; use stream() to receive `routed` events', undefined, routed);
|
|
180
|
+
}
|
|
181
|
+
if (!completed) {
|
|
182
|
+
throw new ConductorClientError('Conductor turn ended without a completed event');
|
|
183
|
+
}
|
|
184
|
+
return { ...completed, text };
|
|
185
|
+
},
|
|
186
|
+
async resolveApproval(approvalId, decision) {
|
|
187
|
+
const url = `${base}/api/v1/conductor/approvals/${encodeURIComponent(approvalId)}/resolve`;
|
|
188
|
+
const headers = await resolvedHeaders();
|
|
189
|
+
const res = await doFetch(url, {
|
|
190
|
+
method: 'POST',
|
|
191
|
+
headers: {
|
|
192
|
+
'Content-Type': 'application/json',
|
|
193
|
+
Accept: 'application/json',
|
|
194
|
+
...headers,
|
|
195
|
+
},
|
|
196
|
+
body: JSON.stringify({ decision }),
|
|
197
|
+
});
|
|
198
|
+
if (!res.ok) {
|
|
199
|
+
let body;
|
|
200
|
+
try {
|
|
201
|
+
body = await res.json();
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
body = undefined;
|
|
205
|
+
}
|
|
206
|
+
throw new ConductorClientError(`Conductor approval resolve failed (${res.status})`, res.status, body);
|
|
207
|
+
}
|
|
208
|
+
return (await res.json());
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
return client;
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=conductor-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conductor-client.js","sourceRoot":"","sources":["../../src/client/conductor-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAsEH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YACE,OAAe,EACC,MAAe,EACf,OAAiB;QAEjC,KAAK,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A,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AAAA,4IAA4I;AAE5I,cAAc,YAAY,CAAC"}
|