@novalabai/adk 2.15.1 → 2.18.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/README.md +152 -28
- package/dist/client.d.ts +26 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +35 -4
- package/dist/client.js.map +1 -1
- package/dist/core/errors.d.ts +56 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +75 -1
- package/dist/core/errors.js.map +1 -1
- package/dist/core/http.d.ts +26 -5
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +118 -51
- package/dist/core/http.js.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -4
- package/dist/index.js.map +1 -1
- package/dist/resources/billing.d.ts +16 -0
- package/dist/resources/billing.d.ts.map +1 -1
- package/dist/resources/billing.js +30 -0
- package/dist/resources/billing.js.map +1 -1
- package/dist/resources/chat.d.ts +7 -0
- package/dist/resources/chat.d.ts.map +1 -1
- package/dist/resources/chat.js +10 -1
- package/dist/resources/chat.js.map +1 -1
- package/dist/resources/files.d.ts +12 -1
- package/dist/resources/files.d.ts.map +1 -1
- package/dist/resources/files.js +12 -1
- package/dist/resources/files.js.map +1 -1
- package/dist/resources/messages.d.ts +34 -0
- package/dist/resources/messages.d.ts.map +1 -0
- package/dist/resources/messages.js +54 -0
- package/dist/resources/messages.js.map +1 -0
- package/dist/resources/models-list.d.ts +9 -0
- package/dist/resources/models-list.d.ts.map +1 -0
- package/dist/resources/models-list.js +15 -0
- package/dist/resources/models-list.js.map +1 -0
- package/dist/resources/staff.d.ts +92 -0
- package/dist/resources/staff.d.ts.map +1 -0
- package/dist/resources/staff.js +186 -0
- package/dist/resources/staff.js.map +1 -0
- package/dist/types/account.d.ts +137 -0
- package/dist/types/account.d.ts.map +1 -0
- package/dist/types/account.js +4 -0
- package/dist/types/account.js.map +1 -0
- package/dist/types/files.d.ts +10 -0
- package/dist/types/files.d.ts.map +1 -1
- package/dist/types/messages.d.ts +159 -0
- package/dist/types/messages.d.ts.map +1 -0
- package/dist/types/messages.js +68 -0
- package/dist/types/messages.js.map +1 -0
- package/dist/types/staff.d.ts +212 -0
- package/dist/types/staff.d.ts.map +1 -0
- package/dist/types/staff.js +22 -0
- package/dist/types/staff.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StaffResource = exports.staffTimers = void 0;
|
|
4
|
+
const errors_js_1 = require("../core/errors.js");
|
|
5
|
+
const staff_js_1 = require("../types/staff.js");
|
|
6
|
+
/** Waits between polls; replaced in tests. */
|
|
7
|
+
exports.staffTimers = {
|
|
8
|
+
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* AI employees (2.18): give your company's AI employees jobs from code.
|
|
12
|
+
*
|
|
13
|
+
* An API key works as the person who made it: it sees that person's
|
|
14
|
+
* company's AI employees and may do what that person may do in the app
|
|
15
|
+
* (owner or admin for the routine limit, one of her managers to approve).
|
|
16
|
+
* Hiring, paying and connecting systems are done in the app.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const nova = new NovaClient(); // reads NOVA_API_KEY
|
|
21
|
+
* nova.staff.language = 'en'; // texts in English (default: Norwegian)
|
|
22
|
+
* const sander = (await nova.staff.listEmployees()).find((e) => e.template === 'sales')!;
|
|
23
|
+
* let job = await nova.staff.createJob(sander.id, 'lead_research', {
|
|
24
|
+
* note: 'Find 20 property management companies that fit our profile.',
|
|
25
|
+
* });
|
|
26
|
+
* job = await nova.staff.waitForJob(job.id);
|
|
27
|
+
* if (jobNeedsYou(job)) console.log('Waiting for you:', job.approval_id || job.credit_ask);
|
|
28
|
+
* else console.log(job.result_text, job.result_files, job.sources);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
class StaffResource {
|
|
32
|
+
http;
|
|
33
|
+
/** Language of the texts in the answers (`Accept-Language`), e.g. `'en'` or `'nb'`. Default: the server's (Norwegian). */
|
|
34
|
+
language;
|
|
35
|
+
constructor(http, language) {
|
|
36
|
+
this.http = http;
|
|
37
|
+
this.language = language;
|
|
38
|
+
}
|
|
39
|
+
headers() {
|
|
40
|
+
return this.language ? { 'Accept-Language': this.language } : undefined;
|
|
41
|
+
}
|
|
42
|
+
// ── Employees ─────────────────────────────────────────────────────────
|
|
43
|
+
/** Whether AI employees are on for you and your company, and whether you can manage them. */
|
|
44
|
+
async status() {
|
|
45
|
+
return this.http.get('/staff/status', undefined, this.headers());
|
|
46
|
+
}
|
|
47
|
+
/** Your company's AI employees, with what each does (`job_types`) and this period's usage. */
|
|
48
|
+
async listEmployees() {
|
|
49
|
+
const data = await this.http.get('/staff/employees', undefined, this.headers());
|
|
50
|
+
return data.employees ?? [];
|
|
51
|
+
}
|
|
52
|
+
/** One employee and her 50 newest jobs. */
|
|
53
|
+
async getEmployee(employeeId) {
|
|
54
|
+
const data = await this.http.get(`/staff/employees/${employeeId}`, undefined, this.headers());
|
|
55
|
+
return { employee: data.employee, jobs: data.jobs ?? [] };
|
|
56
|
+
}
|
|
57
|
+
/** One employee's jobs, newest first (`limit` 1 to 500). */
|
|
58
|
+
async employeeJobs(employeeId, limit = 100) {
|
|
59
|
+
const data = await this.http.get(`/staff/employees/${employeeId}/jobs`, { limit }, this.headers());
|
|
60
|
+
return data.jobs ?? [];
|
|
61
|
+
}
|
|
62
|
+
// ── Jobs ──────────────────────────────────────────────────────────────
|
|
63
|
+
/** Upload a file to give with a job (most 25 MB); put its `id` in `files` of `createJob`. */
|
|
64
|
+
async uploadJobFile(employeeId, params) {
|
|
65
|
+
const form = new FormData();
|
|
66
|
+
const blob = params.content instanceof Blob
|
|
67
|
+
? params.content
|
|
68
|
+
: new Blob([params.content], { type: params.contentType ?? 'application/octet-stream' });
|
|
69
|
+
form.append('file', blob, params.filename);
|
|
70
|
+
const data = await this.http.postMultipart(`/staff/employees/${employeeId}/job-files`, form, this.headers());
|
|
71
|
+
return data.file;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Give an employee a job. `jobType` is one of her `job_types[].id` (for
|
|
75
|
+
* Sander: `lead_research`, `offer_draft`, ...). It starts at once (or waits
|
|
76
|
+
* for credits) and uses your Nova credits while she works.
|
|
77
|
+
*/
|
|
78
|
+
async createJob(employeeId, jobType, params = {}) {
|
|
79
|
+
const input = { ...(params.input ?? {}) };
|
|
80
|
+
if (params.note !== undefined)
|
|
81
|
+
input.note = params.note;
|
|
82
|
+
if (params.files?.length)
|
|
83
|
+
input.files = [...params.files];
|
|
84
|
+
const body = { employee_id: employeeId, job_type: jobType, input };
|
|
85
|
+
if (params.title)
|
|
86
|
+
body.title = params.title;
|
|
87
|
+
if (params.clientName)
|
|
88
|
+
body.client_name = params.clientName;
|
|
89
|
+
const data = await this.http.post('/staff/jobs', body, this.headers());
|
|
90
|
+
return data.job;
|
|
91
|
+
}
|
|
92
|
+
/** All your company's jobs, newest first. */
|
|
93
|
+
async listJobs(params = {}) {
|
|
94
|
+
const data = await this.http.get('/staff/jobs', { limit: params.limit ?? 300, employee_id: params.employeeId, month: params.month }, this.headers());
|
|
95
|
+
return data.jobs ?? [];
|
|
96
|
+
}
|
|
97
|
+
/** One job: status, result text, files, sources, approval and credit questions, timeline. */
|
|
98
|
+
async getJob(jobId) {
|
|
99
|
+
const data = await this.http.get(`/staff/jobs/${jobId}`, undefined, this.headers());
|
|
100
|
+
return data.job;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Poll the job until it is `delivered` or `cancelled`. The wait between
|
|
104
|
+
* polls starts at `pollInterval` seconds and grows by `backoff` up to
|
|
105
|
+
* `maxInterval`. With `returnWhenWaiting` (default) it also returns as soon
|
|
106
|
+
* as she waits for you (`jobNeedsYou(job)`). Throws `NovaTimeoutError` after
|
|
107
|
+
* `timeout` seconds of waiting; the job keeps running.
|
|
108
|
+
*/
|
|
109
|
+
async waitForJob(jobId, options = {}) {
|
|
110
|
+
const timeout = options.timeout ?? 1800;
|
|
111
|
+
const maxInterval = options.maxInterval ?? 60;
|
|
112
|
+
const backoff = options.backoff ?? 1.5;
|
|
113
|
+
const returnWhenWaiting = options.returnWhenWaiting ?? true;
|
|
114
|
+
let delay = Math.max(0.1, options.pollInterval ?? 3);
|
|
115
|
+
let waited = 0;
|
|
116
|
+
for (;;) {
|
|
117
|
+
const job = await this.getJob(jobId);
|
|
118
|
+
if ((0, staff_js_1.jobDone)(job) || (returnWhenWaiting && (0, staff_js_1.jobNeedsYou)(job)))
|
|
119
|
+
return job;
|
|
120
|
+
if (waited >= timeout) {
|
|
121
|
+
throw new errors_js_1.NovaTimeoutError(`Job ${jobId} is still ${job.status} after ${Math.floor(waited)} s (it keeps running; call again later)`);
|
|
122
|
+
}
|
|
123
|
+
const step = Math.min(delay, timeout - waited);
|
|
124
|
+
await exports.staffTimers.sleep(step * 1000);
|
|
125
|
+
waited += step;
|
|
126
|
+
delay = Math.min(maxInterval, delay * backoff);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/** Stop a job that has not been delivered. */
|
|
130
|
+
async cancelJob(jobId) {
|
|
131
|
+
return (await this.http.post(`/staff/jobs/${jobId}/cancel`, undefined, this.headers())).job;
|
|
132
|
+
}
|
|
133
|
+
/** Answer `credit_ask`: go on (raises this job's credit brake by what it asked for). */
|
|
134
|
+
async continueJob(jobId) {
|
|
135
|
+
return (await this.http.post(`/staff/jobs/${jobId}/continue`, undefined, this.headers())).job;
|
|
136
|
+
}
|
|
137
|
+
/** Answer `credit_ask`: stop now and deliver what is done. */
|
|
138
|
+
async finishJob(jobId) {
|
|
139
|
+
return (await this.http.post(`/staff/jobs/${jobId}/finish`, undefined, this.headers())).job;
|
|
140
|
+
}
|
|
141
|
+
/** The bytes of a file she made (`result_files`) or one given with the job. */
|
|
142
|
+
async downloadFile(jobId, fileId) {
|
|
143
|
+
return this.http.getRaw(`/staff/jobs/${jobId}/files/${fileId}`, undefined, this.headers());
|
|
144
|
+
}
|
|
145
|
+
// ── Approvals ─────────────────────────────────────────────────────────
|
|
146
|
+
/** Jobs that wait for an approval now; decide each with `approve` / `reject` and its `approval_id`. */
|
|
147
|
+
async pendingApprovals(params = {}) {
|
|
148
|
+
const jobs = await this.listJobs({ employeeId: params.employeeId });
|
|
149
|
+
return jobs.filter((j) => j.waiting_approval && j.approval_id);
|
|
150
|
+
}
|
|
151
|
+
/** What she wants to send or change, the second check, `status` and `can_decide`. */
|
|
152
|
+
async getApproval(itemId) {
|
|
153
|
+
return (await this.http.get(`/staff/approvals/${itemId}`, undefined, this.headers())).approval;
|
|
154
|
+
}
|
|
155
|
+
/** Approve as one of her approvers (else `NovaPermissionError` `not_approver`). */
|
|
156
|
+
async approve(itemId) {
|
|
157
|
+
return this.decide(itemId, 'approve');
|
|
158
|
+
}
|
|
159
|
+
/** Reject; `reason` (optional) tells her why. */
|
|
160
|
+
async reject(itemId, reason = '') {
|
|
161
|
+
return this.decide(itemId, 'reject', reason);
|
|
162
|
+
}
|
|
163
|
+
async decide(itemId, decision, reason = '') {
|
|
164
|
+
const body = { decision };
|
|
165
|
+
if (reason)
|
|
166
|
+
body.reason = reason.slice(0, 500);
|
|
167
|
+
return (await this.http.post(`/staff/approvals/${itemId}/decide`, body, this.headers()))
|
|
168
|
+
.approval;
|
|
169
|
+
}
|
|
170
|
+
// ── Routine credit limit ──────────────────────────────────────────────
|
|
171
|
+
/** The daily credit limit for her own routine jobs and today's use (owner or admin). */
|
|
172
|
+
async routineCap(employeeId) {
|
|
173
|
+
const data = await this.http.get(`/staff/employees/${employeeId}/routine-cap`, undefined, this.headers());
|
|
174
|
+
return data.routine_cap;
|
|
175
|
+
}
|
|
176
|
+
/** `cap`: 150 or more credits a day, or `null` for no limit (owner or admin). */
|
|
177
|
+
async setRoutineCap(employeeId, cap) {
|
|
178
|
+
if (cap !== null && (!Number.isInteger(cap) || cap < 150)) {
|
|
179
|
+
throw new RangeError('cap must be an integer of 150 or more, or null for no limit');
|
|
180
|
+
}
|
|
181
|
+
const data = await this.http.put(`/staff/employees/${employeeId}/routine-cap`, { cap }, this.headers());
|
|
182
|
+
return data.routine_cap;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
exports.StaffResource = StaffResource;
|
|
186
|
+
//# sourceMappingURL=staff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"staff.js","sourceRoot":"","sources":["../../src/resources/staff.ts"],"names":[],"mappings":";;;AACA,iDAAqD;AACrD,gDAa2B;AAS3B,8CAA8C;AACjC,QAAA,WAAW,GAAG;IACzB,KAAK,EAAE,CAAC,EAAU,EAAiB,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;CACxF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,aAAa;IACP,IAAI,CAAa;IAClC,0HAA0H;IAC1H,QAAQ,CAAU;IAElB,YAAY,IAAgB,EAAE,QAAiB;QAC7C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEO,OAAO;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1E,CAAC;IAED,yEAAyE;IAEzE,6FAA6F;IAC7F,KAAK,CAAC,MAAM;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAc,eAAe,EAAE,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,8FAA8F;IAC9F,KAAK,CAAC,aAAa;QACjB,MAAM,IAAI,GAAG,M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C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAC9B,oBAAoB,UAAU,cAAc,EAC5C,SAAS,EACT,IAAI,CAAC,OAAO,EAAE,CACf,CAAC;QACF,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,iFAAiF;IACjF,KAAK,CAAC,aAAa,CAAC,UAAkB,EAAE,GAAkB;QACxD,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC;YAC1D,MAAM,IAAI,UAAU,CAAC,6DAA6D,CAAC,CAAC;QACtF,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAC9B,oBAAoB,UAAU,cAAc,EAC5C,EAAE,GAAG,EAAE,EACP,IAAI,CAAC,OAAO,EAAE,CACf,CAAC;QACF,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF;AAhMD,sCAgMC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/** Types for your plan, credits and the billing calls of the public API. */
|
|
2
|
+
export interface FeatureStatus {
|
|
3
|
+
/** You can use it now. */
|
|
4
|
+
allowed: boolean;
|
|
5
|
+
/** Your plan includes it. */
|
|
6
|
+
in_plan: boolean;
|
|
7
|
+
enforced?: boolean;
|
|
8
|
+
/** The first plan that has it. */
|
|
9
|
+
required_plan?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
/** GET /v1/plan/features */
|
|
13
|
+
export interface PlanFeaturesInfo {
|
|
14
|
+
plan: string;
|
|
15
|
+
known_plan?: boolean;
|
|
16
|
+
legacy?: boolean;
|
|
17
|
+
free?: boolean;
|
|
18
|
+
enforced?: boolean;
|
|
19
|
+
features: Record<string, FeatureStatus>;
|
|
20
|
+
/** Number limits (null: no fixed limit): monthly_credits, api_rate_limit_rpm, scheduled_tasks, ... */
|
|
21
|
+
limits: Record<string, number | null>;
|
|
22
|
+
modes?: string[];
|
|
23
|
+
quality_tier?: string;
|
|
24
|
+
priority?: string;
|
|
25
|
+
upgrade_url: string;
|
|
26
|
+
not_built?: string[];
|
|
27
|
+
[extra: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
/** GET /v1/billing/credits */
|
|
30
|
+
export interface CreditBalance {
|
|
31
|
+
plan: string;
|
|
32
|
+
plan_credits?: number;
|
|
33
|
+
seats?: number | null;
|
|
34
|
+
/** Credits you can spend now (monthly plus credit packs). */
|
|
35
|
+
balance: number;
|
|
36
|
+
monthly_balance?: number;
|
|
37
|
+
topup_balance?: number;
|
|
38
|
+
granted?: number;
|
|
39
|
+
used: number;
|
|
40
|
+
used_pct?: number;
|
|
41
|
+
warning_80pct?: boolean;
|
|
42
|
+
warning_100pct?: boolean;
|
|
43
|
+
/** `block`: at 0 a new request is refused with 402 (CreditsExhausted). */
|
|
44
|
+
at_zero: string;
|
|
45
|
+
billing_state?: 'ok' | 'grace' | 'downgraded' | (string & {});
|
|
46
|
+
topup_url: string;
|
|
47
|
+
upgrade_url: string;
|
|
48
|
+
[extra: string]: unknown;
|
|
49
|
+
}
|
|
50
|
+
export interface DailyUsage {
|
|
51
|
+
days: Array<{
|
|
52
|
+
date: string;
|
|
53
|
+
day: string;
|
|
54
|
+
calls: number;
|
|
55
|
+
}>;
|
|
56
|
+
total?: number;
|
|
57
|
+
max?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface OperationCost {
|
|
60
|
+
workspace_credits: number;
|
|
61
|
+
input_per_1k_credits?: number;
|
|
62
|
+
output_per_1k_credits?: number;
|
|
63
|
+
[extra: string]: unknown;
|
|
64
|
+
}
|
|
65
|
+
export interface PlanCatalog {
|
|
66
|
+
currency?: string;
|
|
67
|
+
on_sale?: boolean;
|
|
68
|
+
plans: Array<Record<string, unknown>>;
|
|
69
|
+
current?: Record<string, unknown>;
|
|
70
|
+
[extra: string]: unknown;
|
|
71
|
+
}
|
|
72
|
+
export interface TopupPack {
|
|
73
|
+
credits: number;
|
|
74
|
+
price_cents: number;
|
|
75
|
+
currency: string;
|
|
76
|
+
lookup_key?: string;
|
|
77
|
+
[extra: string]: unknown;
|
|
78
|
+
}
|
|
79
|
+
export interface CheckoutLink {
|
|
80
|
+
checkout_url: string;
|
|
81
|
+
session_id?: string;
|
|
82
|
+
credits?: number;
|
|
83
|
+
[extra: string]: unknown;
|
|
84
|
+
}
|
|
85
|
+
export interface NovaModelEntry {
|
|
86
|
+
id: string;
|
|
87
|
+
object?: string;
|
|
88
|
+
label?: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
status?: string;
|
|
91
|
+
}
|
|
92
|
+
/** GET /v1/models */
|
|
93
|
+
export interface ModelList {
|
|
94
|
+
object: 'list';
|
|
95
|
+
data: NovaModelEntry[];
|
|
96
|
+
residency?: string;
|
|
97
|
+
[extra: string]: unknown;
|
|
98
|
+
}
|
|
99
|
+
export interface ChatCompletionParams {
|
|
100
|
+
model?: string;
|
|
101
|
+
messages: Array<{
|
|
102
|
+
role: string;
|
|
103
|
+
content?: unknown;
|
|
104
|
+
[k: string]: unknown;
|
|
105
|
+
}>;
|
|
106
|
+
max_tokens?: number;
|
|
107
|
+
temperature?: number;
|
|
108
|
+
tools?: unknown[];
|
|
109
|
+
tool_choice?: unknown;
|
|
110
|
+
response_format?: {
|
|
111
|
+
type: 'text' | 'json_object' | 'json_schema';
|
|
112
|
+
[k: string]: unknown;
|
|
113
|
+
};
|
|
114
|
+
[extra: string]: unknown;
|
|
115
|
+
}
|
|
116
|
+
export interface ChatCompletion {
|
|
117
|
+
id: string;
|
|
118
|
+
object: 'chat.completion';
|
|
119
|
+
created?: number;
|
|
120
|
+
model: string;
|
|
121
|
+
choices: Array<{
|
|
122
|
+
index: number;
|
|
123
|
+
finish_reason: string;
|
|
124
|
+
message: {
|
|
125
|
+
role: string;
|
|
126
|
+
content: string | null;
|
|
127
|
+
tool_calls?: unknown[];
|
|
128
|
+
};
|
|
129
|
+
}>;
|
|
130
|
+
usage?: {
|
|
131
|
+
prompt_tokens: number;
|
|
132
|
+
completion_tokens: number;
|
|
133
|
+
total_tokens: number;
|
|
134
|
+
};
|
|
135
|
+
[extra: string]: unknown;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/types/account.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,MAAM,WAAW,aAAa;IAC5B,0BAA0B;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,6BAA6B;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,4BAA4B;AAC5B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACxC,sGAAsG;IACtG,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,8BAA8B;AAC9B,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MA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CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,aAAa,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACzF,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,KAAK,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,MAAM,CAAC;QACtB,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,UAAU,CAAC,EAAE,OAAO,EAAE,CAAA;SAAE,CAAC;KAC3E,CAAC,CAAC;IACH,KAAK,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IACnF,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/types/account.ts"],"names":[],"mappings":";AAAA,4EAA4E"}
|
package/dist/types/files.d.ts
CHANGED
|
@@ -7,6 +7,16 @@ export interface FileUploadResponse {
|
|
|
7
7
|
content_type: string;
|
|
8
8
|
/** Bytes */
|
|
9
9
|
size: number;
|
|
10
|
+
/** 2.17: pages (PDF) or slides (PowerPoint); 0 for files without pages. */
|
|
11
|
+
pages?: number;
|
|
12
|
+
/** 2.17: 'page', 'slide' or null. */
|
|
13
|
+
page_unit?: 'page' | 'slide' | null;
|
|
14
|
+
/** 2.17: the file id works this many days in messages (or until deleted). */
|
|
15
|
+
expires_in_days?: number;
|
|
16
|
+
extracted_chars?: number;
|
|
17
|
+
/** Kinds of secrets found in the file and removed. */
|
|
18
|
+
credential_kinds_redacted?: string[];
|
|
19
|
+
preview_url?: string | null;
|
|
10
20
|
/** Backend storage key (null when running on local /tmp fallback) */
|
|
11
21
|
s3_key?: string | null;
|
|
12
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/types/files.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAE3D,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC"}
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/types/files.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAE3D,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IACpC,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sDAAsD;IACtD,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for POST /v1/messages (content blocks, tools, images, streaming;
|
|
3
|
+
* 2.17: JSON answers, documents with page citations, thinking).
|
|
4
|
+
*/
|
|
5
|
+
/** The Nova models POST /v1/messages accepts. The model you name is the model that runs. */
|
|
6
|
+
export declare const MESSAGE_MODELS: readonly ["nova-max", "nova-flagship", "nova-reasoning", "nova-fast"];
|
|
7
|
+
export type MessageModel = (typeof MESSAGE_MODELS)[number];
|
|
8
|
+
export interface TextBlock {
|
|
9
|
+
type: 'text';
|
|
10
|
+
text: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ImageBlock {
|
|
13
|
+
type: 'image';
|
|
14
|
+
source: {
|
|
15
|
+
type: 'base64';
|
|
16
|
+
media_type: 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp';
|
|
17
|
+
data: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface ToolUseBlock {
|
|
21
|
+
type: 'tool_use';
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
input: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
export interface ToolResultBlock {
|
|
27
|
+
type: 'tool_result';
|
|
28
|
+
tool_use_id: string;
|
|
29
|
+
content?: string | TextBlock[];
|
|
30
|
+
is_error?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** A file you uploaded (`nova.files.upload`), in a user message. The answer cites its pages. */
|
|
33
|
+
export interface DocumentBlock {
|
|
34
|
+
type: 'document';
|
|
35
|
+
source: {
|
|
36
|
+
type: 'file';
|
|
37
|
+
file_id: string;
|
|
38
|
+
};
|
|
39
|
+
title?: string;
|
|
40
|
+
}
|
|
41
|
+
/** With `thinking` on: how the model worked it out (before the answer). Send it back unchanged in a tool loop. */
|
|
42
|
+
export interface ThinkingBlock {
|
|
43
|
+
type: 'thinking';
|
|
44
|
+
thinking: string;
|
|
45
|
+
signature?: string;
|
|
46
|
+
}
|
|
47
|
+
/** A page an answer cites (`document` blocks). */
|
|
48
|
+
export interface Citation {
|
|
49
|
+
file_id: string;
|
|
50
|
+
filename: string;
|
|
51
|
+
page: number;
|
|
52
|
+
unit: 'page' | 'slide';
|
|
53
|
+
quote: string;
|
|
54
|
+
}
|
|
55
|
+
/** JSON answers: the answer text is JSON that validates against `json_schema.schema` (checked by Nova). */
|
|
56
|
+
export interface ResponseFormat {
|
|
57
|
+
type: 'json_schema' | 'json_object' | 'text';
|
|
58
|
+
json_schema?: {
|
|
59
|
+
name?: string;
|
|
60
|
+
schema: Record<string, unknown>;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** Think longer: `{ effort: 'low' | 'medium' | 'high' }` or `{ type: 'enabled', budget_tokens }` (Pro plan and higher). */
|
|
64
|
+
export type ThinkingConfig = {
|
|
65
|
+
effort: 'low' | 'medium' | 'high';
|
|
66
|
+
} | {
|
|
67
|
+
type: 'enabled';
|
|
68
|
+
budget_tokens: number;
|
|
69
|
+
} | {
|
|
70
|
+
type: 'disabled';
|
|
71
|
+
};
|
|
72
|
+
export type ContentBlock = TextBlock | ImageBlock | ToolUseBlock | ToolResultBlock | DocumentBlock | ThinkingBlock;
|
|
73
|
+
export interface MessageParam {
|
|
74
|
+
role: 'user' | 'assistant';
|
|
75
|
+
content: string | ContentBlock[];
|
|
76
|
+
}
|
|
77
|
+
export interface Tool {
|
|
78
|
+
name: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
/** JSON Schema of the tool's input. */
|
|
81
|
+
input_schema: Record<string, unknown>;
|
|
82
|
+
}
|
|
83
|
+
export interface MessageCreateParams {
|
|
84
|
+
/** `nova-max`, `nova-flagship`, `nova-reasoning` or `nova-fast` (default `nova-flagship`). */
|
|
85
|
+
model?: MessageModel | (string & {});
|
|
86
|
+
/** Most tokens to write (default 1024). */
|
|
87
|
+
max_tokens?: number;
|
|
88
|
+
messages: MessageParam[];
|
|
89
|
+
system?: string | TextBlock[];
|
|
90
|
+
tools?: Tool[];
|
|
91
|
+
tool_choice?: {
|
|
92
|
+
type: 'auto' | 'any' | 'tool';
|
|
93
|
+
name?: string;
|
|
94
|
+
};
|
|
95
|
+
temperature?: number;
|
|
96
|
+
top_p?: number;
|
|
97
|
+
top_k?: number;
|
|
98
|
+
stop_sequences?: string[];
|
|
99
|
+
/** JSON answers (not with `stream` or `tools`). See `jsonSchemaFormat`. */
|
|
100
|
+
response_format?: ResponseFormat;
|
|
101
|
+
/** Think longer (Pro plan and higher, else `FeatureNotInPlan`). */
|
|
102
|
+
thinking?: ThinkingConfig;
|
|
103
|
+
[extra: string]: unknown;
|
|
104
|
+
}
|
|
105
|
+
export interface Message {
|
|
106
|
+
id: string;
|
|
107
|
+
type: 'message';
|
|
108
|
+
role: 'assistant';
|
|
109
|
+
/** The model you asked for. */
|
|
110
|
+
model: string;
|
|
111
|
+
content: Array<TextBlock | ToolUseBlock | ThinkingBlock | {
|
|
112
|
+
type: string;
|
|
113
|
+
[k: string]: unknown;
|
|
114
|
+
}>;
|
|
115
|
+
stop_reason: 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | (string & {}) | null;
|
|
116
|
+
stop_sequence: string | null;
|
|
117
|
+
usage: {
|
|
118
|
+
input_tokens: number;
|
|
119
|
+
output_tokens: number;
|
|
120
|
+
};
|
|
121
|
+
/** With `document` blocks: the pages the answer cites, in order. */
|
|
122
|
+
citations?: Citation[];
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* One server-sent event of a streamed answer: `message_start`,
|
|
126
|
+
* `content_block_start`, `content_block_delta`, `content_block_stop`,
|
|
127
|
+
* `message_delta`, `message_stop` or `error`.
|
|
128
|
+
*/
|
|
129
|
+
export interface MessageStreamEvent {
|
|
130
|
+
type: string;
|
|
131
|
+
index?: number;
|
|
132
|
+
delta?: {
|
|
133
|
+
type?: string;
|
|
134
|
+
text?: string;
|
|
135
|
+
partial_json?: string;
|
|
136
|
+
stop_reason?: string;
|
|
137
|
+
[k: string]: unknown;
|
|
138
|
+
};
|
|
139
|
+
[k: string]: unknown;
|
|
140
|
+
}
|
|
141
|
+
/** All text blocks of an answer, joined. */
|
|
142
|
+
export declare function messageText(message: Pick<Message, 'content'>): string;
|
|
143
|
+
/** The answer as JSON (with `response_format` it already matches your schema). Throws when the text is not JSON. */
|
|
144
|
+
export declare function messageJson<T = unknown>(message: Pick<Message, 'content'>): T;
|
|
145
|
+
/** The thinking text (with `thinking` on), else ''. */
|
|
146
|
+
export declare function messageThinking(message: Pick<Message, 'content'>): string;
|
|
147
|
+
/** A file you uploaded, in a user message (`nova.files.upload(...)` gives the id). */
|
|
148
|
+
export declare function documentBlock(fileId: string, title?: string): DocumentBlock;
|
|
149
|
+
/** `response_format` for a JSON answer that matches `schema`. */
|
|
150
|
+
export declare function jsonSchemaFormat(schema: Record<string, unknown>, name?: string): ResponseFormat;
|
|
151
|
+
/** The tool calls the model asked for (stop_reason `tool_use`). */
|
|
152
|
+
export declare function toolUses(message: Pick<Message, 'content'>): ToolUseBlock[];
|
|
153
|
+
/** The new text of a `content_block_delta` event ('' for other events). */
|
|
154
|
+
export declare function eventText(event: MessageStreamEvent): string;
|
|
155
|
+
/** An image content block from bytes (sent base64). */
|
|
156
|
+
export declare function imageBlock(data: Uint8Array | ArrayBuffer, mediaType?: ImageBlock['source']['media_type']): ImageBlock;
|
|
157
|
+
/** The block that sends your tool's result back to the model. */
|
|
158
|
+
export declare function toolResultBlock(toolUseId: string, content: string | TextBlock[], isError?: boolean): ToolResultBlock;
|
|
159
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
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,QAAQ,CAAC,CAAC,YAAY,CAAe,GAC1D,UAAU,CAGZ;AAED,iEAAiE;AACjE,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,EAAE,OAAO,UAAQ,GAAG,eAAe,CAElH"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Types for POST /v1/messages (content blocks, tools, images, streaming;
|
|
4
|
+
* 2.17: JSON answers, documents with page citations, thinking).
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.MESSAGE_MODELS = void 0;
|
|
8
|
+
exports.messageText = messageText;
|
|
9
|
+
exports.messageJson = messageJson;
|
|
10
|
+
exports.messageThinking = messageThinking;
|
|
11
|
+
exports.documentBlock = documentBlock;
|
|
12
|
+
exports.jsonSchemaFormat = jsonSchemaFormat;
|
|
13
|
+
exports.toolUses = toolUses;
|
|
14
|
+
exports.eventText = eventText;
|
|
15
|
+
exports.imageBlock = imageBlock;
|
|
16
|
+
exports.toolResultBlock = toolResultBlock;
|
|
17
|
+
/** The Nova models POST /v1/messages accepts. The model you name is the model that runs. */
|
|
18
|
+
exports.MESSAGE_MODELS = ['nova-max', 'nova-flagship', 'nova-reasoning', 'nova-fast'];
|
|
19
|
+
/** All text blocks of an answer, joined. */
|
|
20
|
+
function messageText(message) {
|
|
21
|
+
return message.content
|
|
22
|
+
.filter((b) => b.type === 'text')
|
|
23
|
+
.map((b) => b.text)
|
|
24
|
+
.join('');
|
|
25
|
+
}
|
|
26
|
+
/** The answer as JSON (with `response_format` it already matches your schema). Throws when the text is not JSON. */
|
|
27
|
+
function messageJson(message) {
|
|
28
|
+
const text = messageText(message);
|
|
29
|
+
try {
|
|
30
|
+
return JSON.parse(text);
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
throw new Error(`The answer is not JSON: ${e.message}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** The thinking text (with `thinking` on), else ''. */
|
|
37
|
+
function messageThinking(message) {
|
|
38
|
+
return message.content
|
|
39
|
+
.filter((b) => b.type === 'thinking')
|
|
40
|
+
.map((b) => b.thinking)
|
|
41
|
+
.join('');
|
|
42
|
+
}
|
|
43
|
+
/** A file you uploaded, in a user message (`nova.files.upload(...)` gives the id). */
|
|
44
|
+
function documentBlock(fileId, title) {
|
|
45
|
+
return { type: 'document', source: { type: 'file', file_id: fileId }, ...(title ? { title } : {}) };
|
|
46
|
+
}
|
|
47
|
+
/** `response_format` for a JSON answer that matches `schema`. */
|
|
48
|
+
function jsonSchemaFormat(schema, name = 'answer') {
|
|
49
|
+
return { type: 'json_schema', json_schema: { name, schema } };
|
|
50
|
+
}
|
|
51
|
+
/** The tool calls the model asked for (stop_reason `tool_use`). */
|
|
52
|
+
function toolUses(message) {
|
|
53
|
+
return message.content.filter((b) => b.type === 'tool_use');
|
|
54
|
+
}
|
|
55
|
+
/** The new text of a `content_block_delta` event ('' for other events). */
|
|
56
|
+
function eventText(event) {
|
|
57
|
+
return event.type === 'content_block_delta' && event.delta?.type === 'text_delta' ? String(event.delta.text ?? '') : '';
|
|
58
|
+
}
|
|
59
|
+
/** An image content block from bytes (sent base64). */
|
|
60
|
+
function imageBlock(data, mediaType = 'image/png') {
|
|
61
|
+
const bytes = data instanceof Uint8Array ? data : new Uint8Array(data);
|
|
62
|
+
return { type: 'image', source: { type: 'base64', media_type: mediaType, data: Buffer.from(bytes).toString('base64') } };
|
|
63
|
+
}
|
|
64
|
+
/** The block that sends your tool's result back to the model. */
|
|
65
|
+
function toolResultBlock(toolUseId, content, isError = false) {
|
|
66
|
+
return { type: 'tool_result', tool_use_id: toolUseId, content, ...(isError ? { is_error: true } : {}) };
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","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