@molecule/api-ai-decisions-intern-decision 1.0.0 → 1.1.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/LICENSE +111 -24
- package/README.md +73 -60
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +3 -0
- package/dist/provider.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/wire.d.ts +2 -0
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +2 -0
- package/dist/wire.js.map +1 -1
- package/package.json +4 -4
package/LICENSE
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
Apache License
|
|
2
3
|
Version 2.0, January 2004
|
|
3
4
|
http://www.apache.org/licenses/
|
|
@@ -34,21 +35,33 @@
|
|
|
34
35
|
|
|
35
36
|
"Work" shall mean the work of authorship, whether in Source or
|
|
36
37
|
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
38
40
|
|
|
39
41
|
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
42
|
form, that is based on (or derived from) the Work and for which the
|
|
41
43
|
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
-
represent, as a whole, an original work of authorship.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
49
62
|
|
|
50
63
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
51
|
-
on behalf of whom a Contribution has been received by
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
52
65
|
subsequently incorporated within the Work.
|
|
53
66
|
|
|
54
67
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
@@ -61,8 +74,18 @@
|
|
|
61
74
|
3. Grant of Patent License. Subject to the terms and conditions of
|
|
62
75
|
this License, each Contributor hereby grants to You a perpetual,
|
|
63
76
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
64
|
-
|
|
65
|
-
and otherwise transfer the Work
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
66
89
|
|
|
67
90
|
4. Redistribution. You may reproduce and distribute copies of the
|
|
68
91
|
Work or Derivative Works thereof in any medium, with or without
|
|
@@ -84,23 +107,87 @@
|
|
|
84
107
|
(d) If the Work includes a "NOTICE" text file as part of its
|
|
85
108
|
distribution, then any Derivative Works that You distribute must
|
|
86
109
|
include a readable copy of the attribution notices contained
|
|
87
|
-
within such NOTICE file
|
|
88
|
-
|
|
89
|
-
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
90
138
|
|
|
91
139
|
6. Trademarks. This License does not grant permission to use the trade
|
|
92
|
-
names, trademarks, service marks, or product names of the Licensor
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
93
143
|
|
|
94
144
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
95
|
-
agreed to in writing, Licensor provides the Work
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
104
191
|
|
|
105
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
106
193
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -3,15 +3,11 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-
|
|
6
|
+
Generated: 2026-10-16T23:28:10.587Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/api-ai-decisions-intern-decision
|
|
10
10
|
|
|
11
|
-
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
12
|
-
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
13
|
-
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
14
|
-
|
|
15
11
|
Intern-Decision decisions provider for molecule.dev — typed decisions about
|
|
16
12
|
text AND images from the open-weights Intern-Decision models on a server
|
|
17
13
|
you run.
|
|
@@ -25,6 +21,10 @@ for the 2B (33 ms on an RTX 4090). This bond speaks the service's
|
|
|
25
21
|
`POST /v1/decisions` route; the question and answer shapes match the Jev /
|
|
26
22
|
Laya / Jeff bonds, so swapping is a one-line change.
|
|
27
23
|
|
|
24
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
25
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
26
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
27
|
+
|
|
28
28
|
## Quick Start
|
|
29
29
|
|
|
30
30
|
```bash
|
|
@@ -89,27 +89,25 @@ interface InternDecisionConfig {
|
|
|
89
89
|
* no authentication. Defaults to the `INTERN_DECISION_API_KEY` env var.
|
|
90
90
|
*/
|
|
91
91
|
apiKey?: string
|
|
92
|
+
/**
|
|
93
|
+
* Extra request headers, resolved before each call and merged over the
|
|
94
|
+
* defaults — for a host whose auth expires or is not a bearer token (a Cloud
|
|
95
|
+
* Run ID token, Modal proxy auth). Pair with `@molecule/api-model-hosting`:
|
|
96
|
+
* `headers: () => hosting.authHeaders(endpoint.id)`.
|
|
97
|
+
*/
|
|
98
|
+
headers?: () => Record<string, string> | Promise<Record<string, string>>
|
|
92
99
|
}
|
|
93
100
|
```
|
|
94
101
|
|
|
95
|
-
#### `
|
|
102
|
+
#### `WireQuestion`
|
|
96
103
|
|
|
97
|
-
|
|
104
|
+
One question as sent on the wire.
|
|
98
105
|
|
|
99
106
|
```typescript
|
|
100
|
-
interface
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
apiKey?: string
|
|
105
|
-
/** Request body. */
|
|
106
|
-
body: Record<string, unknown>
|
|
107
|
-
/** Abort signal. */
|
|
108
|
-
signal?: AbortSignal
|
|
109
|
-
/** Label for error messages (`'Intern-Decision'`). */
|
|
110
|
-
label: string
|
|
111
|
-
/** Max retries on a retryable status (default 3). */
|
|
112
|
-
maxRetries?: number
|
|
107
|
+
interface WireQuestion {
|
|
108
|
+
type: 'choice' | 'score' | 'noul'
|
|
109
|
+
instructions: string
|
|
110
|
+
criteria?: Record<string, string> | string[]
|
|
113
111
|
}
|
|
114
112
|
```
|
|
115
113
|
|
|
@@ -127,18 +125,6 @@ interface WireAnswer {
|
|
|
127
125
|
}
|
|
128
126
|
```
|
|
129
127
|
|
|
130
|
-
#### `WireQuestion`
|
|
131
|
-
|
|
132
|
-
One question as sent on the wire.
|
|
133
|
-
|
|
134
|
-
```typescript
|
|
135
|
-
interface WireQuestion {
|
|
136
|
-
type: 'choice' | 'score' | 'noul'
|
|
137
|
-
instructions: string
|
|
138
|
-
criteria?: Record<string, string> | string[]
|
|
139
|
-
}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
128
|
#### `WireResponse`
|
|
143
129
|
|
|
144
130
|
The response body (only the fields we read).
|
|
@@ -151,6 +137,29 @@ interface WireResponse {
|
|
|
151
137
|
}
|
|
152
138
|
```
|
|
153
139
|
|
|
140
|
+
#### `PostOptions`
|
|
141
|
+
|
|
142
|
+
Options for {@link postDecisions}.
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
interface PostOptions {
|
|
146
|
+
/** Full endpoint URL. */
|
|
147
|
+
url: string
|
|
148
|
+
/** Bearer token, if any. */
|
|
149
|
+
apiKey?: string
|
|
150
|
+
/** Extra headers resolved before the request (merged over the defaults). */
|
|
151
|
+
headers?: () => Record<string, string> | Promise<Record<string, string>>
|
|
152
|
+
/** Request body. */
|
|
153
|
+
body: Record<string, unknown>
|
|
154
|
+
/** Abort signal. */
|
|
155
|
+
signal?: AbortSignal
|
|
156
|
+
/** Label for error messages (`'Intern-Decision'`). */
|
|
157
|
+
label: string
|
|
158
|
+
/** Max retries on a retryable status (default 3). */
|
|
159
|
+
maxRetries?: number
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
154
163
|
### Functions
|
|
155
164
|
|
|
156
165
|
#### `createProvider(config)`
|
|
@@ -165,6 +174,18 @@ function createProvider(config?: InternDecisionConfig): AIDecisionsProvider
|
|
|
165
174
|
|
|
166
175
|
**Returns:** An `AIDecisionsProvider` backed by an Intern-Decision service.
|
|
167
176
|
|
|
177
|
+
#### `toWireQuestions(questions)`
|
|
178
|
+
|
|
179
|
+
Converts the core's questions into wire questions (`yesNo` → `noul`).
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
function toWireQuestions(questions: Record<string, DecisionQuestion>): Record<string, WireQuestion>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
- `questions` — The questions keyed by id.
|
|
186
|
+
|
|
187
|
+
**Returns:** The wire `questions` object.
|
|
188
|
+
|
|
168
189
|
#### `fromWireAnswer(id, question, wire, minConfidence)`
|
|
169
190
|
|
|
170
191
|
Converts one wire answer into the core's answer for `question`.
|
|
@@ -212,28 +233,8 @@ function postDecisions(opts: PostOptions): Promise<WireResponse>
|
|
|
212
233
|
|
|
213
234
|
**Returns:** The parsed response body.
|
|
214
235
|
|
|
215
|
-
#### `toWireQuestions(questions)`
|
|
216
|
-
|
|
217
|
-
Converts the core's questions into wire questions (`yesNo` → `noul`).
|
|
218
|
-
|
|
219
|
-
```typescript
|
|
220
|
-
function toWireQuestions(questions: Record<string, DecisionQuestion>): Record<string, WireQuestion>
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
- `questions` — The questions keyed by id.
|
|
224
|
-
|
|
225
|
-
**Returns:** The wire `questions` object.
|
|
226
|
-
|
|
227
236
|
### Constants
|
|
228
237
|
|
|
229
|
-
#### `aiDecisionsInternDecisionSecretDefinitions`
|
|
230
|
-
|
|
231
|
-
Secret definitions used by the Intern-Decision decisions bond.
|
|
232
|
-
|
|
233
|
-
```typescript
|
|
234
|
-
const aiDecisionsInternDecisionSecretDefinitions: SecretDefinition[]
|
|
235
|
-
```
|
|
236
|
-
|
|
237
238
|
#### `DEFAULT_INTERN_DECISION_URL`
|
|
238
239
|
|
|
239
240
|
The service's default bind (`scripts/demo.sh`: `DEMO_HOST` 127.0.0.1, `DEMO_PORT` 7860).
|
|
@@ -242,14 +243,6 @@ The service's default bind (`scripts/demo.sh`: `DEMO_HOST` 127.0.0.1, `DEMO_PORT
|
|
|
242
243
|
const DEFAULT_INTERN_DECISION_URL: 'http://127.0.0.1:7860'
|
|
243
244
|
```
|
|
244
245
|
|
|
245
|
-
#### `INTERN_DECISION_IMAGE_TYPES`
|
|
246
|
-
|
|
247
|
-
Image media types the service decodes (GIFs must be still).
|
|
248
|
-
|
|
249
|
-
```typescript
|
|
250
|
-
const INTERN_DECISION_IMAGE_TYPES: readonly string[]
|
|
251
|
-
```
|
|
252
|
-
|
|
253
246
|
#### `INTERN_DECISION_LIMITS`
|
|
254
247
|
|
|
255
248
|
The service's request limits (`src/inference/pipeline.py`, `src/service/uploads.py`).
|
|
@@ -264,6 +257,14 @@ const INTERN_DECISION_LIMITS: {
|
|
|
264
257
|
}
|
|
265
258
|
```
|
|
266
259
|
|
|
260
|
+
#### `INTERN_DECISION_IMAGE_TYPES`
|
|
261
|
+
|
|
262
|
+
Image media types the service decodes (GIFs must be still).
|
|
263
|
+
|
|
264
|
+
```typescript
|
|
265
|
+
const INTERN_DECISION_IMAGE_TYPES: readonly string[]
|
|
266
|
+
```
|
|
267
|
+
|
|
267
268
|
#### `provider`
|
|
268
269
|
|
|
269
270
|
The provider implementation — lazy, so env vars are read on first use.
|
|
@@ -272,6 +273,14 @@ The provider implementation — lazy, so env vars are read on first use.
|
|
|
272
273
|
const provider: AIDecisionsProvider
|
|
273
274
|
```
|
|
274
275
|
|
|
276
|
+
#### `aiDecisionsInternDecisionSecretDefinitions`
|
|
277
|
+
|
|
278
|
+
Secret definitions used by the Intern-Decision decisions bond.
|
|
279
|
+
|
|
280
|
+
```typescript
|
|
281
|
+
const aiDecisionsInternDecisionSecretDefinitions: SecretDefinition[]
|
|
282
|
+
```
|
|
283
|
+
|
|
275
284
|
## Core Interface
|
|
276
285
|
|
|
277
286
|
Implements `@molecule/api-ai-decisions` interface.
|
|
@@ -343,6 +352,10 @@ Peer dependencies:
|
|
|
343
352
|
- **License:** the code is Apache-2.0; the weights' Hugging Face cards say
|
|
344
353
|
Apache-2.0 while the repo README says Qwen model terms apply — check
|
|
345
354
|
LICENSE-QWEN before offering it to third parties.
|
|
355
|
+
- **Hosted on rented compute?** Pass `headers: () => hosting.authHeaders(endpoint.id)`
|
|
356
|
+
(`@molecule/api-model-hosting`) when the host's auth expires or is not a
|
|
357
|
+
bearer token — e.g. a Cloud Run ID token or Modal proxy auth. It runs before
|
|
358
|
+
every request and is merged over the defaults.
|
|
346
359
|
- Use the core's `setProvider`, not `bond('ai-decisions', …)` directly.
|
|
347
360
|
|
|
348
361
|
## E2E Tests
|
package/dist/index.d.ts
CHANGED
|
@@ -71,6 +71,10 @@
|
|
|
71
71
|
* - **License:** the code is Apache-2.0; the weights' Hugging Face cards say
|
|
72
72
|
* Apache-2.0 while the repo README says Qwen model terms apply — check
|
|
73
73
|
* LICENSE-QWEN before offering it to third parties.
|
|
74
|
+
* - **Hosted on rented compute?** Pass `headers: () => hosting.authHeaders(endpoint.id)`
|
|
75
|
+
* (`@molecule/api-model-hosting`) when the host's auth expires or is not a
|
|
76
|
+
* bearer token — e.g. a Cloud Run ID token or Modal proxy auth. It runs before
|
|
77
|
+
* every request and is merged over the defaults.
|
|
74
78
|
* - Use the core's `setProvider`, not `bond('ai-decisions', …)` directly.
|
|
75
79
|
*
|
|
76
80
|
* @module
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -71,6 +71,10 @@
|
|
|
71
71
|
* - **License:** the code is Apache-2.0; the weights' Hugging Face cards say
|
|
72
72
|
* Apache-2.0 while the repo README says Qwen model terms apply — check
|
|
73
73
|
* LICENSE-QWEN before offering it to third parties.
|
|
74
|
+
* - **Hosted on rented compute?** Pass `headers: () => hosting.authHeaders(endpoint.id)`
|
|
75
|
+
* (`@molecule/api-model-hosting`) when the host's auth expires or is not a
|
|
76
|
+
* bearer token — e.g. a Cloud Run ID token or Modal proxy auth. It runs before
|
|
77
|
+
* every request and is merged over the defaults.
|
|
74
78
|
* - Use the core's `setProvider`, not `bond('ai-decisions', …)` directly.
|
|
75
79
|
*
|
|
76
80
|
* @module
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EACV,mBAAmB,EAKpB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAGtD,+FAA+F;AAC/F,eAAO,MAAM,2BAA2B,0BAA0B,CAAA;AAElE,4FAA4F;AAC5F,eAAO,MAAM,sBAAsB;IACjC,6BAA6B;;IAE7B,yFAAyF;;IAEzF,0BAA0B;;IAE1B,+BAA+B;;IAE/B,uCAAuC;;CAE/B,CAAA;AAEV,kEAAkE;AAClE,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAKxD,CAAA;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EACV,mBAAmB,EAKpB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAGtD,+FAA+F;AAC/F,eAAO,MAAM,2BAA2B,0BAA0B,CAAA;AAElE,4FAA4F;AAC5F,eAAO,MAAM,sBAAsB;IACjC,6BAA6B;;IAE7B,yFAAyF;;IAEzF,0BAA0B;;IAE1B,+BAA+B;;IAE/B,uCAAuC;;CAE/B,CAAA;AAEV,kEAAkE;AAClE,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAKxD,CAAA;AA+HD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,mBAAmB,CAEjF;AAGD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,mBASrB,CAAA"}
|
package/dist/provider.js
CHANGED
|
@@ -88,6 +88,7 @@ class InternDecisionProvider {
|
|
|
88
88
|
name = 'intern-decision';
|
|
89
89
|
baseUrl;
|
|
90
90
|
apiKey;
|
|
91
|
+
headers;
|
|
91
92
|
/**
|
|
92
93
|
* Creates the provider.
|
|
93
94
|
*
|
|
@@ -98,6 +99,7 @@ class InternDecisionProvider {
|
|
|
98
99
|
process.env.INTERN_DECISION_URL ||
|
|
99
100
|
DEFAULT_INTERN_DECISION_URL).replace(/\/+$/, '');
|
|
100
101
|
this.apiKey = config.apiKey ?? (process.env.INTERN_DECISION_API_KEY || undefined);
|
|
102
|
+
this.headers = config.headers;
|
|
101
103
|
}
|
|
102
104
|
/**
|
|
103
105
|
* Answers every question about `input.state` (and `input.images`) in one request.
|
|
@@ -118,6 +120,7 @@ class InternDecisionProvider {
|
|
|
118
120
|
const body = await postDecisions({
|
|
119
121
|
url: `${this.baseUrl}/v1/decisions`,
|
|
120
122
|
apiKey: this.apiKey,
|
|
123
|
+
headers: this.headers,
|
|
121
124
|
body: {
|
|
122
125
|
state: input.state,
|
|
123
126
|
questions: toWireQuestions(input.questions),
|
package/dist/provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,gEAAgE;AAChE,OAAO,cAAc,CAAA;AAWrB,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE5E,+FAA+F;AAC/F,MAAM,CAAC,MAAM,2BAA2B,GAAG,uBAAuB,CAAA;AAElE,4FAA4F;AAC5F,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,6BAA6B;IAC7B,YAAY,EAAE,EAAE;IAChB,yFAAyF;IACzF,UAAU,EAAE,EAAE;IACd,0BAA0B;IAC1B,SAAS,EAAE,CAAC;IACZ,+BAA+B;IAC/B,aAAa,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;IAC/B,uCAAuC;IACvC,kBAAkB,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;CAC5B,CAAA;AAEV,kEAAkE;AAClE,MAAM,CAAC,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CAAC,SAAS;YAAE,SAAS,GAAG,cAAc,EAAE,CAAA;QAC5C,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IAC/C,CAAC;IACD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK;QAChB,IAAI,CAAC,SAAS;YAAE,SAAS,GAAG,cAAc,EAAE,CAAA;QAC5C,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;IAC5C,CAAC;CACF,CAAC,CAAA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -17,5 +17,12 @@ export interface InternDecisionConfig {
|
|
|
17
17
|
* no authentication. Defaults to the `INTERN_DECISION_API_KEY` env var.
|
|
18
18
|
*/
|
|
19
19
|
apiKey?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Extra request headers, resolved before each call and merged over the
|
|
22
|
+
* defaults — for a host whose auth expires or is not a bearer token (a Cloud
|
|
23
|
+
* Run ID token, Modal proxy auth). Pair with `@molecule/api-model-hosting`:
|
|
24
|
+
* `headers: () => hosting.authHeaders(endpoint.id)`.
|
|
25
|
+
*/
|
|
26
|
+
headers?: () => Record<string, string> | Promise<Record<string, string>>;
|
|
20
27
|
}
|
|
21
28
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACzE"}
|
package/dist/wire.d.ts
CHANGED
|
@@ -72,6 +72,8 @@ export interface PostOptions {
|
|
|
72
72
|
url: string;
|
|
73
73
|
/** Bearer token, if any. */
|
|
74
74
|
apiKey?: string;
|
|
75
|
+
/** Extra headers resolved before the request (merged over the defaults). */
|
|
76
|
+
headers?: () => Record<string, string> | Promise<Record<string, string>>;
|
|
75
77
|
/** Request body. */
|
|
76
78
|
body: Record<string, unknown>;
|
|
77
79
|
/** Abort signal. */
|
package/dist/wire.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../src/wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAEV,YAAY,EACZ,cAAc,EACd,gBAAgB,EAGjB,MAAM,4BAA4B,CAAA;AAEnC,wCAAwC;AACxC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;IACjC,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAAA;CAC7C;AAED,oEAAoE;AACpE,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA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,MAAM,GACrB,cAAc,CAiDhB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,EACzE,SAAS,EAAE,CAAC,EACZ,IAAI,EAAE,YAAY,EAClB,aAAa,CAAC,EAAE,MAAM,GACrB,YAAY,CAAC,CAAC,CAAC,CAiBjB;AAKD,yCAAyC;AACzC,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IACxE,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,oBAAoB;IACpB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAA;IACb,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CA+C5E"}
|
package/dist/wire.js
CHANGED
|
@@ -154,6 +154,8 @@ export async function postDecisions(opts) {
|
|
|
154
154
|
const headers = { 'content-type': 'application/json' };
|
|
155
155
|
if (apiKey)
|
|
156
156
|
headers.authorization = `Bearer ${apiKey}`;
|
|
157
|
+
if (opts.headers)
|
|
158
|
+
Object.assign(headers, await opts.headers());
|
|
157
159
|
for (let attempt = 0;; attempt++) {
|
|
158
160
|
const response = await fetch(url, {
|
|
159
161
|
method: 'POST',
|
package/dist/wire.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire.js","sourceRoot":"","sources":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-decisions-intern-decision",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Intern-Decision decisions provider for molecule.dev — typed choice/score/yes-no answers about text and images from the open-weights Intern-Decision models on your own server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"@molecule/api-secrets": "^1.0.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@molecule/api-ai-decisions": "1.1.
|
|
40
|
+
"@molecule/api-ai-decisions": "1.1.2",
|
|
41
41
|
"@molecule/api-secrets": "1.0.2",
|
|
42
|
-
"@types/node": "26.
|
|
42
|
+
"@types/node": "26.6.5",
|
|
43
43
|
"typescript": "6.0.3",
|
|
44
|
-
"vitest": "4.1.
|
|
44
|
+
"vitest": "4.1.12"
|
|
45
45
|
},
|
|
46
46
|
"repository": {
|
|
47
47
|
"type": "git",
|