apick-api 3.11.0 → 4.0.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/CHANGELOG.md +172 -159
- package/LICENSE +21 -21
- package/README.md +461 -463
- package/SECURITY.md +11 -11
- package/docs/guide.en.md +359 -361
- package/docs/guide.ko.md +368 -369
- package/docs/subagent.md +39 -39
- package/docs/tts.md +34 -54
- package/package.json +1 -1
- package/src/index.cjs +58 -50
- package/src/index.d.ts +59 -42
package/docs/subagent.md
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# 서브에이전트 / Subagent
|
|
2
|
-
|
|
3
|
-
`apick-agent`는 설치형 상품이며 `quoteSkill`·`runSkill` 대신 전용 API를 사용합니다. 성공 작업의 확인된 원가에 40%를 가산하며 승인된 동일 결과 캐시는 무료입니다. 충전 잔액 외 상품 사용량 한도는 없습니다.
|
|
4
|
-
|
|
5
|
-
`apick-agent` is an installed-agent product. Use the dedicated API rather than `quoteSkill` or `runSkill`. Successful work is billed at confirmed model cost plus 40%; approved identical-result cache reuse is free. There are no product usage quotas beyond prepaid balance.
|
|
6
|
-
|
|
7
|
-
```js
|
|
8
|
-
import { ApickClient } from 'apick-api';
|
|
9
|
-
import { createHash } from 'node:crypto';
|
|
10
|
-
const api = new ApickClient({ apiKey: process.env.APICK_API_KEY });
|
|
11
|
-
const bytes = Buffer.from('검토할 공개 문서입니다.');
|
|
12
|
-
const file = await api.createSubagentFile({
|
|
13
|
-
path: 'docs/sample.txt', bytes: bytes.length,
|
|
14
|
-
sha256: createHash('sha256').update(bytes).digest('hex'), retention: 'seven_days'
|
|
15
|
-
});
|
|
16
|
-
if (file.data.state !== 'ready') {
|
|
17
|
-
for (let offset = 0; offset < bytes.length; offset += file.data.part_bytes) {
|
|
18
|
-
await api.uploadSubagentPart(file.data.file_id, offset / file.data.part_bytes,
|
|
19
|
-
bytes.subarray(offset, offset + file.data.part_bytes).toString('base64'));
|
|
20
|
-
}
|
|
21
|
-
await api.completeSubagentFile(file.data.file_id);
|
|
22
|
-
}
|
|
23
|
-
const job = await api.dispatchSubagent({kind:'summarize', goal:'핵심 내용과 근거를 정리하세요',
|
|
24
|
-
file_ids:[file.data.file_id]}, {idempotencyKey:'sample-summary-20261004-001'});
|
|
25
|
-
const result = await api.collectSubagent(job.data.job_id);
|
|
26
|
-
// 완료 후 evidence_ids를 조회하여 인용·해시를 직접 검토하세요.
|
|
27
|
-
// Once complete, fetch evidence_ids and independently review quotes and hashes.
|
|
28
|
-
console.log(result.data.state);
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
접수 응답은 작업 ID를 신속히 반환합니다. 같은 멱등 키와 같은 내용은 기존 작업을 반환하며 내용이 다르면 409입니다. 연결 종료는 취소가 아닙니다. `cancelSubagent`로 명시적으로 취소하세요. `retention:'none'`은 검수 완료 후 삭제하고 임시 보관은 최대 1시간입니다.
|
|
32
|
-
|
|
33
|
-
Submission returns a job ID promptly. Replay the same idempotency key and payload after response loss; a changed payload conflicts with HTTP 409. Disconnecting does not cancel work; use `cancelSubagent`. `retention:'none'` deletes after review, with temporary retention capped at one hour.
|
|
34
|
-
|
|
35
|
-
`subagentUsage`는 호출·토큰·예약·청구·해제·캐시·전송 지표를 반환합니다. 캐시 예상 회피 비용은 동일 작업의 최초 계산 비용 기준이며 주 모델의 실제 청구 절감액이 아닙니다.
|
|
36
|
-
|
|
37
|
-
`subagentUsage` returns calls, tokens, reservations, charges, releases, cache and transfer metrics. Estimated avoided cache cost uses the original job's calculated cost and is not a measured reduction in the main model's bill.
|
|
38
|
-
|
|
39
|
-
[전체 REST·MCP 가이드 / Full guide](https://apick.app/dev_guide/subagent)
|
|
1
|
+
# 서브에이전트 / Subagent
|
|
2
|
+
|
|
3
|
+
`apick-agent`는 설치형 상품이며 `quoteSkill`·`runSkill` 대신 전용 API를 사용합니다. 성공 작업의 확인된 원가에 40%를 가산하며 승인된 동일 결과 캐시는 무료입니다. 충전 잔액 외 상품 사용량 한도는 없습니다.
|
|
4
|
+
|
|
5
|
+
`apick-agent` is an installed-agent product. Use the dedicated API rather than `quoteSkill` or `runSkill`. Successful work is billed at confirmed model cost plus 40%; approved identical-result cache reuse is free. There are no product usage quotas beyond prepaid balance.
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import { ApickClient } from 'apick-api';
|
|
9
|
+
import { createHash } from 'node:crypto';
|
|
10
|
+
const api = new ApickClient({ apiKey: process.env.APICK_API_KEY });
|
|
11
|
+
const bytes = Buffer.from('검토할 공개 문서입니다.');
|
|
12
|
+
const file = await api.createSubagentFile({
|
|
13
|
+
path: 'docs/sample.txt', bytes: bytes.length,
|
|
14
|
+
sha256: createHash('sha256').update(bytes).digest('hex'), retention: 'seven_days'
|
|
15
|
+
});
|
|
16
|
+
if (file.data.state !== 'ready') {
|
|
17
|
+
for (let offset = 0; offset < bytes.length; offset += file.data.part_bytes) {
|
|
18
|
+
await api.uploadSubagentPart(file.data.file_id, offset / file.data.part_bytes,
|
|
19
|
+
bytes.subarray(offset, offset + file.data.part_bytes).toString('base64'));
|
|
20
|
+
}
|
|
21
|
+
await api.completeSubagentFile(file.data.file_id);
|
|
22
|
+
}
|
|
23
|
+
const job = await api.dispatchSubagent({kind:'summarize', goal:'핵심 내용과 근거를 정리하세요',
|
|
24
|
+
file_ids:[file.data.file_id]}, {idempotencyKey:'sample-summary-20261004-001'});
|
|
25
|
+
const result = await api.collectSubagent(job.data.job_id);
|
|
26
|
+
// 완료 후 evidence_ids를 조회하여 인용·해시를 직접 검토하세요.
|
|
27
|
+
// Once complete, fetch evidence_ids and independently review quotes and hashes.
|
|
28
|
+
console.log(result.data.state);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
접수 응답은 작업 ID를 신속히 반환합니다. 같은 멱등 키와 같은 내용은 기존 작업을 반환하며 내용이 다르면 409입니다. 연결 종료는 취소가 아닙니다. `cancelSubagent`로 명시적으로 취소하세요. `retention:'none'`은 검수 완료 후 삭제하고 임시 보관은 최대 1시간입니다.
|
|
32
|
+
|
|
33
|
+
Submission returns a job ID promptly. Replay the same idempotency key and payload after response loss; a changed payload conflicts with HTTP 409. Disconnecting does not cancel work; use `cancelSubagent`. `retention:'none'` deletes after review, with temporary retention capped at one hour.
|
|
34
|
+
|
|
35
|
+
`subagentUsage`는 호출·토큰·예약·청구·해제·캐시·전송 지표를 반환합니다. 캐시 예상 회피 비용은 동일 작업의 최초 계산 비용 기준이며 주 모델의 실제 청구 절감액이 아닙니다.
|
|
36
|
+
|
|
37
|
+
`subagentUsage` returns calls, tokens, reservations, charges, releases, cache and transfer metrics. Estimated avoided cache cost uses the original job's calculated cost and is not a measured reduction in the main model's bill.
|
|
38
|
+
|
|
39
|
+
[전체 REST·MCP 가이드 / Full guide](https://apick.app/dev_guide/subagent)
|
package/docs/tts.md
CHANGED
|
@@ -1,54 +1,34 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`api.cost`는 접수 예약금을 확정액으로 표시하지 않습니다. `data.billing`의 `synthesis`, `skill`, `total`, `reserved`, `released`, `refunded`, `status`를 확인하세요. `voice_id`는 원래 요청을 보존하고 실제 엔진·모델·목소리는 `synthesis`에 표시합니다. 서버·공급자의 최종 제작 실패는 정규화까지 전액 환불합니다. 클라이언트 연결 종료는 정상 과금하고, 명시 취소는 이미 수행된 유료 처리분을 정산합니다.
|
|
37
|
-
|
|
38
|
-
MP3 24kHz·모노·48kbps와 입력 원문 ASS를 완료 후 24시간 제공합니다. 파일별 한 번 다운로드, 중단 시 재시도가 가능합니다. 동일 요청의 접수 재시도에는 같은 `idempotencyKey`를 사용하세요. 이전 방식 작업의 품질·후보·재개 API는 해당 이전 작업에만 적용됩니다.
|
|
39
|
-
|
|
40
|
-
[개발가이드](https://apick.app/dev_guide/tts) · [정규화 스킬](https://apick.app/skills/korean-text-normalize) · [공식 가격표](https://ai.google.dev/gemini-api/docs/pricing#gemini-3.8-flash-lite-tts)
|
|
41
|
-
|
|
42
|
-
# TTS · English
|
|
43
|
-
|
|
44
|
-
`createTtsJob` supports APICK synthesis and optional Gemini fallback. `createGeminiTtsJob` accepts Gemini voices, style, text or per-speaker utterances. All three paths share `getTtsJob`, `downloadTtsResult`, and `downloadTtsSubtitles`. The MP3/ASS format and response structure match; the generated voices differ.
|
|
45
|
-
|
|
46
|
-
Fallback policies: `never` (default) queues APICK and returns 429 when its queue is full; `queue_full` uses Gemini only when the waiting queue is full; `busy` uses Gemini whenever immediate APICK execution is unavailable. `fallbackOptions.voice_id/style` apply only after fallback. Unsupported explicit voice IDs are rejected. `listGeminiTtsVoices` returns public basic and extended voices without case-alias duplicates, while existing aliases remain accepted. Automatic matching prioritizes Korean voices of the same gender, then the closest supported age band and vocal traits. `age_basis: catalog_description` refers to an age explicitly stated in the official voice description, not a real speaker's biological age. Voices without age evidence remain unverified.
|
|
47
|
-
|
|
48
|
-
Text normalization is **on by default and costs extra**. Set `normalizeText: false` on SDK APICK options or `normalize_text: false` in a request body to skip both the skill and its charge. Normalization allows 2,000 characters across utterances including separating newlines. Gemini without normalization allows 8,000 characters; APICK retains its 800-character limit. The original spelling appears in ASS subtitles.
|
|
49
|
-
|
|
50
|
-
External AI charges equal verified provider cost × the pinned USD/KRW exchange rate × 1.4. A skill adds its base fee once, including seller amount and base commission, without a second markup on AI usage. Gemini provider input/output prices per million tokens are $0.50/$6.00 through December 31, 2026, then $1.00/$12.00 from January 1, 2027, 00:00 UTC. The approximate $0.54/hour figure is informational, not a billing unit. Fallback may change the price and voice.
|
|
51
|
-
|
|
52
|
-
Read the job's `billing` breakdown for reserved, released, captured, and refunded amounts. Submission `api.cost` does not treat a reservation as a final charge. Top-level `voice_id` preserves the APICK request; `synthesis` reports the actual provider/model/voice. Final server/provider failures refund synthesis and normalization. Disconnecting does not cancel background work or billing; explicit cancellation settles work already performed.
|
|
53
|
-
|
|
54
|
-
Results are MP3 (24 kHz, mono, 48 kbps) and ASS, retained for 24 hours after completion. Each file permits one completed download; interrupted transfers may be retried. Reuse the same `idempotencyKey` and input after a lost submission response. Legacy quality/candidate/retry methods apply only to legacy jobs.
|
|
1
|
+
# Gemini·ChatGPT TTS
|
|
2
|
+
|
|
3
|
+
기존 APICK 목소리와 자동 전환은 종료되었습니다. `createTtsJob`은 Gemini 기본 목소리 `Kore`를 사용합니다. `getTtsQuality`, `retryTtsJob`, `downloadTtsCandidate`의 기존 경로는 HTTP 409를 반환합니다.
|
|
4
|
+
|
|
5
|
+
Legacy APICK voices and automatic fallback have retired. `createTtsJob` now defaults to Gemini voice `Kore`. The legacy quality, retry and candidate endpoints return HTTP 409.
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
const job = await client.createTtsJob('기온은 오 도입니다.', { voiceId: 'Kore', normalizeText: false, idempotencyKey: 'tts-001' });
|
|
9
|
+
const dialogue = await client.createOpenAiTtsJob({
|
|
10
|
+
utterances: [{ speaker: '진행', text: '반갑습니다.' }, { speaker: '손님', text: '안녕하세요.' }],
|
|
11
|
+
speakers: { 진행: { voice_id: 'alloy' }, 손님: { voice_id: 'nova', emotion: 'calm' } },
|
|
12
|
+
multi_speaker: true, normalize_text: false
|
|
13
|
+
}, { idempotencyKey: 'tts-002' });
|
|
14
|
+
const voices = await client.listGeminiTtsVoices();
|
|
15
|
+
const otherVoices = await client.listOpenAiTtsVoices();
|
|
16
|
+
const options = await client.getTtsOptions();
|
|
17
|
+
const quote = await client.quoteTts({ engine: 'gemini', text: '본문', voice_id: 'Kore' });
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`style`, `emotion`, `tone`, `accent`, `pace`(0.5–2), `pitch`(-12–12), `volume_gain_db`(-12–12)는 최상위·화자·발화에 지정할 수 있습니다. `speakers`는 화자 이름별 설정이고 `multi_speaker: true`는 Gemini 최대 2명, ChatGPT 최대 8명입니다. 엔진에 따라 표현 효과가 달라지며 정확한 속도 배율·반음·dB 적용을 보장하지 않습니다. 특히 ChatGPT는 수치의 방향을 낭독 지시로 전달합니다.
|
|
21
|
+
|
|
22
|
+
Style, emotion, tone, accent, pace, pitch and volume options can be set per request, speaker or utterance. Gemini supports up to two native speakers; ChatGPT supports up to eight speakers across utterances. Numeric acoustic adjustments are not guaranteed: ChatGPT receives directional instructions rather than precise rate, semitone or decibel controls.
|
|
23
|
+
|
|
24
|
+
정규화는 기본 켜짐이며 추가 스킬 요금이 합산됩니다. `normalize_text: false`(SDK 문자열 호출은 `normalizeText: false`)로 끌 수 있습니다. 정규화 입력은 발화 사이 줄바꿈을 포함해 최대 2,000자, 정규화 없이 최대 8,000자입니다. 견적은 `quoteTts`, 현재 목소리는 엔진별 목록, 옵션은 `getTtsOptions`로 조회합니다.
|
|
25
|
+
|
|
26
|
+
Normalization is enabled by default and costs extra. Disable it with `normalize_text: false` (`normalizeText: false` for the string SDK helper). Input limits are 2,000 characters including utterance separators with normalization, or 8,000 without it. Query a quote, engine-specific voices and supported options before submitting.
|
|
27
|
+
|
|
28
|
+
실제 AI 원가 × 고정된 환율 × 1.4에 정규화 요금을 더해 정산합니다. Gemini 프로모션 입력/출력 단가는 2026-12-31까지 백만 토큰당 $0.50/$6.00이며 2027-01-01 00:00 UTC부터 $1.00/$12.00입니다. 약 $0.54/시간은 참고값이며 시간 단위 청구가 아닙니다. 엔진별 요금이 다릅니다.
|
|
29
|
+
|
|
30
|
+
AI usage is charged at verified cost × the pinned exchange rate × 1.4, plus normalization. Gemini promotional input/output rates are $0.50/$6.00 per million tokens through 2026-12-31, then $1.00/$12.00 from 2027-01-01 00:00 UTC. The approximate hourly figure is informational; billing uses actual usage and differs by engine.
|
|
31
|
+
|
|
32
|
+
두 엔진은 같은 작업 조회·취소·MP3·원문 ASS 계약을 사용합니다. `billing`의 예약·해제·확정·환불을 확인하세요. MP3는 24kHz 모노 48kbps, 결과는 완료 후 24시간 보관합니다. MP3와 ASS는 각각 완료된 다운로드 1회만 허용하며 전송 중단은 재시도할 수 있습니다. 접수 응답 유실 시 같은 입력과 멱등 키를 재사용하세요. 서버·공급자 최종 실패는 정규화까지 환불하며, 연결 종료는 작업 취소가 아닙니다. 취소 시 이미 수행된 작업분을 정산합니다.
|
|
33
|
+
|
|
34
|
+
Both engines share job status, cancellation, MP3 and original-text ASS downloads. Check reserved, released, captured and refunded amounts in `billing`. MP3 is 24 kHz mono at 48 kbps. Files are kept for 24 hours; each permits one completed download, and interrupted transfers can be retried. Reuse the same input and idempotency key after a lost response. Final server/provider failures refund synthesis and normalization; disconnecting does not cancel work. Explicit cancellation settles work already performed.
|
package/package.json
CHANGED
package/src/index.cjs
CHANGED
|
@@ -6,6 +6,8 @@ const MAX_OCR_BYTES = 50 * 1024 * 1024;
|
|
|
6
6
|
const MAX_IMAGE_AI_BYTES = 50 * 1024 * 1024;
|
|
7
7
|
const IMAGE_AI_SIZES = Object.freeze(['1024x1024', '1536x1024', '1024x1536', '1152x864', '864x1152']);
|
|
8
8
|
const IMAGE_AI_SIZE_SET = new Set(IMAGE_AI_SIZES);
|
|
9
|
+
// 품질별 장당 고정가: basic 40P(기본) · advanced 350P · premium 1,400P
|
|
10
|
+
const IMAGE_AI_QUALITIES = Object.freeze(['basic', 'advanced', 'premium']);
|
|
9
11
|
const TTS_VOICE_IDS = Object.freeze([
|
|
10
12
|
'v2_ann_m_30s_01', 'v2_ann_m_30s_02', 'v2_ann_m_30s_04', 'v2_ann_m_30s_05', 'v2_ann_f_30s_02', 'v2_ann_f_30s_03', 'v2_ann_f_30s_04', 'v2_ann_f_30s_05', 'v2_m_teen_01', 'v2_m_young_01', 'v2_m_mid_01', 'v2_m_senior_01', 'v2_f_young_01', 'v2_f_senior_01'
|
|
11
13
|
]);
|
|
@@ -63,8 +65,8 @@ const SERVICES = Object.freeze(Object.fromEntries(
|
|
|
63
65
|
])
|
|
64
66
|
));
|
|
65
67
|
|
|
66
|
-
function normalizeSubagentId(value,prefix){if(typeof value!=='string'||!new RegExp('^'+prefix+'_[a-f0-9]{32}$').test(value))throw new TypeError('Invalid subagent identifier.');return value;}
|
|
67
|
-
function redact(value, apiKey) {
|
|
68
|
+
function normalizeSubagentId(value,prefix){if(typeof value!=='string'||!new RegExp('^'+prefix+'_[a-f0-9]{32}$').test(value))throw new TypeError('Invalid subagent identifier.');return value;}
|
|
69
|
+
function redact(value, apiKey) {
|
|
68
70
|
let text = String(value || '');
|
|
69
71
|
if (apiKey) text = text.split(apiKey).join('***');
|
|
70
72
|
return text.replace(/(Authorization\s*:\s*Bearer\s*)\S+/gi, '$1***').replace(/(CL_AUTH_KEY\s*[:=]\s*)\S+/gi, '$1***');
|
|
@@ -119,8 +121,8 @@ function normalizeTtsJobId(value) {
|
|
|
119
121
|
}
|
|
120
122
|
|
|
121
123
|
function normalizeTtsVoice(value) {
|
|
122
|
-
const voiceId = requiredString('voiceId', value);
|
|
123
|
-
if (
|
|
124
|
+
const voiceId = requiredString('voiceId', value, 160);
|
|
125
|
+
if (TTS_VOICE_ID_SET.has(voiceId)) throw new RangeError('This voiceId has retired. Select a current Gemini voice with listGeminiTtsVoices().');
|
|
124
126
|
return voiceId;
|
|
125
127
|
}
|
|
126
128
|
|
|
@@ -379,17 +381,17 @@ class ApickClient {
|
|
|
379
381
|
Accept: definition.output === 'binary' ? '*/*' : 'application/json',
|
|
380
382
|
Authorization: `Bearer ${this.#apiKey}`
|
|
381
383
|
};
|
|
382
|
-
const method = definition.method || 'POST';
|
|
383
|
-
if (definition.idempotencyKey) headers['X-Idempotency-Key'] = requiredString('idempotencyKey', definition.idempotencyKey, 128);
|
|
384
|
+
const method = definition.method || 'POST';
|
|
385
|
+
if (definition.idempotencyKey) headers['X-Idempotency-Key'] = requiredString('idempotencyKey', definition.idempotencyKey, 128);
|
|
384
386
|
const request = {
|
|
385
387
|
method,
|
|
386
388
|
headers,
|
|
387
389
|
signal: controller.signal,
|
|
388
390
|
redirect: 'error'
|
|
389
391
|
};
|
|
390
|
-
if (method !== 'GET') {
|
|
391
|
-
if (definition.json) { headers['Content-Type']='application/json'; request.body=JSON.stringify(payload||{}); }
|
|
392
|
-
else request.body = formData || require('./form.cjs').createForm(payload || {}, definition.endpoint);
|
|
392
|
+
if (method !== 'GET') {
|
|
393
|
+
if (definition.json) { headers['Content-Type']='application/json'; request.body=JSON.stringify(payload||{}); }
|
|
394
|
+
else request.body = formData || require('./form.cjs').createForm(payload || {}, definition.endpoint);
|
|
393
395
|
}
|
|
394
396
|
|
|
395
397
|
let response;
|
|
@@ -630,26 +632,31 @@ class ApickClient {
|
|
|
630
632
|
return this._call('createVideoJob', null, null, { endpoint:'/rest/'+model+'/jobs/'+jobId+'/result', method:'GET', output:'binary', filename:jobId+'.mp4', timeoutMs:60_000 });
|
|
631
633
|
}
|
|
632
634
|
|
|
633
|
-
createTtsJob(text, options) {
|
|
634
|
-
const config = options || {};
|
|
635
|
-
const payload = typeof text==='object' && text!==null ? {...text} : {
|
|
636
|
-
voice_id: normalizeTtsVoice(config.voiceId || '
|
|
637
|
-
text: requiredString('text', text,
|
|
638
|
-
};
|
|
639
|
-
if(config.normalizeText!==undefined)payload.normalize_text=config.normalizeText;
|
|
640
|
-
if(config.fallbackPolicy!==undefined
|
|
641
|
-
if(
|
|
642
|
-
if(payload.
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
|
|
635
|
+
createTtsJob(text, options) {
|
|
636
|
+
const config = options || {};
|
|
637
|
+
const payload = typeof text==='object' && text!==null ? {...text} : {
|
|
638
|
+
voice_id: normalizeTtsVoice(config.voiceId || 'Kore'),
|
|
639
|
+
text: requiredString('text', text, config.normalizeText === false ? 8000 : 2000)
|
|
640
|
+
};
|
|
641
|
+
if(config.normalizeText!==undefined)payload.normalize_text=config.normalizeText;
|
|
642
|
+
if(config.fallbackPolicy!==undefined||config.fallbackOptions!==undefined||payload.fallback_policy!==undefined||payload.fallback_options!==undefined)throw new TypeError('TTS fallback has retired. Use createGeminiTtsJob or createOpenAiTtsJob.');
|
|
643
|
+
if(payload.normalize_text!==undefined&&typeof payload.normalize_text!=='boolean')throw new TypeError('normalizeText must be boolean.');
|
|
644
|
+
if(payload.voice_id!==undefined)normalizeTtsVoice(payload.voice_id);
|
|
645
|
+
return this._call('createTtsJob',payload,null,{json:true,idempotencyKey:config.idempotencyKey});
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
createGeminiTtsJob(input, options) {
|
|
649
|
+
if(!input||typeof input!=='object'||Array.isArray(input))throw new TypeError('Gemini TTS input is required.');
|
|
650
|
+
return this._call('createTtsJob', input, null, {endpoint:'/rest/tts/gemini/jobs',json:true,idempotencyKey:options?.idempotencyKey});
|
|
651
|
+
}
|
|
652
|
+
listGeminiTtsVoices() { return this._call('createTtsJob',null,null,{endpoint:'/rest/tts/gemini/voices',method:'GET'}); }
|
|
653
|
+
createOpenAiTtsJob(input, options) {
|
|
654
|
+
if(!input||typeof input!=='object'||Array.isArray(input))throw new TypeError('OpenAI TTS input is required.');
|
|
655
|
+
return this._call('createTtsJob',input,null,{endpoint:'/rest/tts/openai/jobs',json:true,idempotencyKey:options?.idempotencyKey});
|
|
656
|
+
}
|
|
657
|
+
listOpenAiTtsVoices() { return this._call('createTtsJob',null,null,{endpoint:'/rest/tts/openai/voices',method:'GET'}); }
|
|
658
|
+
getTtsOptions() { return this._call('createTtsJob',null,null,{endpoint:'/rest/tts/options',method:'GET'}); }
|
|
659
|
+
quoteTts(input) { return this._call('createTtsJob',input,null,{endpoint:'/rest/tts/quote',json:true}); }
|
|
653
660
|
|
|
654
661
|
getTtsJob(jobId) {
|
|
655
662
|
const id = normalizeTtsJobId(jobId);
|
|
@@ -731,7 +738,7 @@ class ApickClient {
|
|
|
731
738
|
|
|
732
739
|
_imageOptions(prompt, options, maxCount) {
|
|
733
740
|
const config = options || {};
|
|
734
|
-
for (const key of ['model', '
|
|
741
|
+
for (const key of ['model', 'count', 'n', 'outputCompression', 'input_fidelity', 'moderation', 'mask', 'maskFilename', 'maskContentType']) {
|
|
735
742
|
if (Object.prototype.hasOwnProperty.call(config, key)) throw new TypeError(`${key} is not a supported image option.`);
|
|
736
743
|
}
|
|
737
744
|
const imageCount = positiveInteger('imageCount', config.imageCount, 1);
|
|
@@ -743,10 +750,11 @@ class ApickClient {
|
|
|
743
750
|
size, output_format: config.outputFormat || 'png',
|
|
744
751
|
background: config.background || 'auto'
|
|
745
752
|
};
|
|
746
|
-
if (config.
|
|
747
|
-
|
|
748
|
-
|
|
753
|
+
if (config.quality !== undefined) {
|
|
754
|
+
if (!IMAGE_AI_QUALITIES.includes(config.quality)) throw new TypeError(`quality must be one of: ${IMAGE_AI_QUALITIES.join(', ')}.`);
|
|
755
|
+
payload.quality = config.quality;
|
|
749
756
|
}
|
|
757
|
+
// 서버가 같은 요청도 매번 새로 생성·과금하므로 idempotencyKey 는 보내지 않는다(예전 코드 호환을 위해 받기만 한다).
|
|
750
758
|
return payload;
|
|
751
759
|
}
|
|
752
760
|
|
|
@@ -964,24 +972,24 @@ class ApickClient {
|
|
|
964
972
|
return this._skills('GET', '/rest/skills', { query });
|
|
965
973
|
}
|
|
966
974
|
|
|
967
|
-
getSkillPerformance() {
|
|
975
|
+
getSkillPerformance() {
|
|
968
976
|
return this._skills('GET', '/skills/performance/data.json');
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
_subagent(method, route, options) { return this._skills(method, '/rest/subagent/v1' + route, options); }
|
|
972
|
-
subagentStatus() { return this._subagent('GET', '/status'); }
|
|
973
|
-
subagentUsage() { return this._subagent('GET', '/usage'); }
|
|
974
|
-
createSubagentFile(input) { return this._subagent('POST', '/files', {body: input}); }
|
|
975
|
-
getSubagentFile(fileId) { return this._subagent('GET', '/files/' + normalizeSubagentId(fileId,'saf')); }
|
|
976
|
-
uploadSubagentPart(fileId, partNo, data) { if(!Number.isSafeInteger(partNo)||partNo<0||typeof data!=='string')throw new TypeError('Invalid upload part.');return this._subagent('POST','/files/'+normalizeSubagentId(fileId,'saf')+'/parts',{body:{part_no:partNo,data}}); }
|
|
977
|
-
completeSubagentFile(fileId) { return this._subagent('POST','/files/'+normalizeSubagentId(fileId,'saf')+'/complete',{body:{}}); }
|
|
978
|
-
deleteSubagentFile(fileId) { return this._subagent('DELETE','/files/'+normalizeSubagentId(fileId,'saf')); }
|
|
979
|
-
dispatchSubagent(input, options) { const key=requiredString('idempotencyKey',options?.idempotencyKey,200);if(key.length<8)throw new TypeError('idempotencyKey must contain at least 8 characters.');return this._subagent('POST','/jobs',{body:input,idempotencyKey:key}); }
|
|
980
|
-
collectSubagent(jobId, options) { return this._subagent('GET','/jobs/'+normalizeSubagentId(jobId,'saj'),{query:options?.cursor?{cursor:String(options.cursor)}:{}}); }
|
|
981
|
-
subagentEvidence(jobId,evidenceIds) { return this._subagent('POST','/jobs/'+normalizeSubagentId(jobId,'saj')+'/evidence',{body:{evidence_ids:evidenceIds}}); }
|
|
982
|
-
reviewSubagent(jobId,resultHash,decision) { if(!['accepted','rejected'].includes(decision)||!/^[a-f0-9]{64}$/.test(resultHash))throw new TypeError('Invalid review.');return this._subagent('POST','/jobs/'+normalizeSubagentId(jobId,'saj')+'/review',{body:{result_hash:resultHash,decision}}); }
|
|
983
|
-
cancelSubagent(jobId) { return this._subagent('POST','/jobs/'+normalizeSubagentId(jobId,'saj')+'/cancel',{body:{}}); }
|
|
984
|
-
deleteSubagentJob(jobId) { return this._subagent('DELETE','/jobs/'+normalizeSubagentId(jobId,'saj')); }
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
_subagent(method, route, options) { return this._skills(method, '/rest/subagent/v1' + route, options); }
|
|
980
|
+
subagentStatus() { return this._subagent('GET', '/status'); }
|
|
981
|
+
subagentUsage() { return this._subagent('GET', '/usage'); }
|
|
982
|
+
createSubagentFile(input) { return this._subagent('POST', '/files', {body: input}); }
|
|
983
|
+
getSubagentFile(fileId) { return this._subagent('GET', '/files/' + normalizeSubagentId(fileId,'saf')); }
|
|
984
|
+
uploadSubagentPart(fileId, partNo, data) { if(!Number.isSafeInteger(partNo)||partNo<0||typeof data!=='string')throw new TypeError('Invalid upload part.');return this._subagent('POST','/files/'+normalizeSubagentId(fileId,'saf')+'/parts',{body:{part_no:partNo,data}}); }
|
|
985
|
+
completeSubagentFile(fileId) { return this._subagent('POST','/files/'+normalizeSubagentId(fileId,'saf')+'/complete',{body:{}}); }
|
|
986
|
+
deleteSubagentFile(fileId) { return this._subagent('DELETE','/files/'+normalizeSubagentId(fileId,'saf')); }
|
|
987
|
+
dispatchSubagent(input, options) { const key=requiredString('idempotencyKey',options?.idempotencyKey,200);if(key.length<8)throw new TypeError('idempotencyKey must contain at least 8 characters.');return this._subagent('POST','/jobs',{body:input,idempotencyKey:key}); }
|
|
988
|
+
collectSubagent(jobId, options) { return this._subagent('GET','/jobs/'+normalizeSubagentId(jobId,'saj'),{query:options?.cursor?{cursor:String(options.cursor)}:{}}); }
|
|
989
|
+
subagentEvidence(jobId,evidenceIds) { return this._subagent('POST','/jobs/'+normalizeSubagentId(jobId,'saj')+'/evidence',{body:{evidence_ids:evidenceIds}}); }
|
|
990
|
+
reviewSubagent(jobId,resultHash,decision) { if(!['accepted','rejected'].includes(decision)||!/^[a-f0-9]{64}$/.test(resultHash))throw new TypeError('Invalid review.');return this._subagent('POST','/jobs/'+normalizeSubagentId(jobId,'saj')+'/review',{body:{result_hash:resultHash,decision}}); }
|
|
991
|
+
cancelSubagent(jobId) { return this._subagent('POST','/jobs/'+normalizeSubagentId(jobId,'saj')+'/cancel',{body:{}}); }
|
|
992
|
+
deleteSubagentJob(jobId) { return this._subagent('DELETE','/jobs/'+normalizeSubagentId(jobId,'saj')); }
|
|
985
993
|
|
|
986
994
|
getSkill(skillId) {
|
|
987
995
|
return this._skills('GET', '/rest/skills/' + normalizeSkillId(skillId));
|
package/src/index.d.ts
CHANGED
|
@@ -31,14 +31,18 @@ export interface OcrOptions {
|
|
|
31
31
|
export type ImageAiFormat = 'png' | 'jpeg' | 'webp';
|
|
32
32
|
export type ImageAiBackground = 'auto' | 'opaque' | 'transparent';
|
|
33
33
|
export type ImageAiSize = '1024x1024' | '1536x1024' | '1024x1536' | '1152x864' | '864x1152';
|
|
34
|
+
/** basic 40P(default) · advanced 350P · premium 1,400P per image */
|
|
35
|
+
export type ImageAiQuality = 'basic' | 'advanced' | 'premium';
|
|
34
36
|
export type ImageAiStatus = 'waiting' | 'processing' | 'completed' | 'completed_partial' | 'failed';
|
|
35
37
|
export type ApickImageErrorCode = `APICK_IMAGE_${string}`;
|
|
36
|
-
export interface ImageAiOptions { imageCount?: number; size?: ImageAiSize; outputFormat?: ImageAiFormat; background?: ImageAiBackground;
|
|
38
|
+
export interface ImageAiOptions { imageCount?: number; size?: ImageAiSize; outputFormat?: ImageAiFormat; background?: ImageAiBackground; quality?: ImageAiQuality;
|
|
39
|
+
/** @deprecated Ignored. Every image request is generated and charged as a new request. */
|
|
40
|
+
idempotencyKey?: string; }
|
|
37
41
|
export interface ImageAiGenerateOptions extends ImageAiOptions { referenceImage?: string|BinaryInput|ArrayBuffer|ArrayBufferView; referenceFilename?: string; referenceContentType?: 'image/png'|'image/jpeg'|'image/webp'; }
|
|
38
42
|
export interface ImageAiEditOptions extends ImageAiOptions { filename?: string; contentType?: 'image/png'|'image/jpeg'|'image/webp'; }
|
|
39
43
|
export interface ImageAiResultImage { index:number; b64_json:string; mime_type:'image/png'|'image/jpeg'|'image/webp'; width:number; height:number; }
|
|
40
|
-
export interface ImageAiResultData { request_id:string; image_count:number; images:ImageAiResultImage[]; idempotent_replay?:boolean; }
|
|
41
|
-
export interface ImageAiPendingData {request_id:string;job_id:string;status:'processing';billing_status:'pending';reserved_point:number;}
|
|
44
|
+
export interface ImageAiResultData { request_id:string; image_count:number; images:ImageAiResultImage[]; idempotent_replay?:boolean; }
|
|
45
|
+
export interface ImageAiPendingData {request_id:string;job_id:string;status:'processing';billing_status:'pending';reserved_point:number;}
|
|
42
46
|
export interface ImageAiJobData { job_id:string; status:ImageAiStatus; requested_count:number; completed_count?:number; failed_count?:number; prepaid_point?:number; charged_point?:number; refunded_point?:number; result_available?:boolean; expires_at?:string|null; error_code?:ApickImageErrorCode|null; }
|
|
43
47
|
|
|
44
48
|
export interface MaskResidentNumberOptions extends OcrOptions {
|
|
@@ -200,26 +204,33 @@ export interface YoutubeSubtitleList {
|
|
|
200
204
|
}
|
|
201
205
|
export interface YoutubeSubtitleOptions { format?: 'vtt' | 'srt' | 'txt'; type?: 'any' | 'manual' | 'auto'; }
|
|
202
206
|
|
|
207
|
+
/** @deprecated Retired APICK voice IDs. Query listGeminiTtsVoices or listOpenAiTtsVoices. */
|
|
203
208
|
export const TTS_VOICE_IDS: readonly [
|
|
204
209
|
'v2_ann_m_30s_01', 'v2_ann_m_30s_02', 'v2_ann_m_30s_04', 'v2_ann_m_30s_05', 'v2_ann_f_30s_02', 'v2_ann_f_30s_03', 'v2_ann_f_30s_04', 'v2_ann_f_30s_05', 'v2_m_teen_01', 'v2_m_young_01', 'v2_m_mid_01', 'v2_m_senior_01', 'v2_f_young_01', 'v2_f_senior_01'
|
|
205
210
|
];
|
|
206
|
-
export type TtsVoiceId =
|
|
207
|
-
|
|
208
|
-
export
|
|
209
|
-
export interface
|
|
210
|
-
|
|
211
|
-
export interface
|
|
212
|
-
export interface
|
|
213
|
-
export interface
|
|
211
|
+
export type TtsVoiceId = string;
|
|
212
|
+
/** @deprecated Automatic fallback is no longer supported. */
|
|
213
|
+
export type TtsFallbackPolicy = 'never' | 'queue_full' | 'busy';
|
|
214
|
+
export interface TtsFallbackOptions { voice_id?: string; style?: string; }
|
|
215
|
+
/** @deprecated Retired APICK request shape. Use GeminiTtsInput or OpenAiTtsInput. */
|
|
216
|
+
export interface ApickTtsInput { voice_id: TtsVoiceId; text?: string; utterances?: Array<{text:string;emotion?:string;speed?:number;pause_after_ms?:number}>; normalize_text?:boolean; fallback_policy?:TtsFallbackPolicy; fallback_options?:TtsFallbackOptions; }
|
|
217
|
+
export interface TtsStyleOptions { style?:string; emotion?:'neutral'|'calm'|'cheerful'|'excited'|'sad'|'serious'|'friendly'|'empathetic'|'confident'|'gentle'|'whisper'|'narration'; tone?:'narration'|'news'|'audiobook'|'documentary'|'ad'|'conversation'|'announcement'|'tutorial'|'storytelling'; accent?:'standard'|'seoul'|'gyeongsang'|'jeolla'|'chungcheong'; pace?:number; pitch?:number; volume_gain_db?:number; }
|
|
218
|
+
export interface TtsSpeakerOptions extends TtsStyleOptions { voice_id?:string; }
|
|
219
|
+
export interface TtsUtterance extends TtsSpeakerOptions { text:string; speaker?:string; }
|
|
220
|
+
export interface GeminiTtsInput extends TtsStyleOptions { voice_id?:string; text?:string; utterances?:TtsUtterance[]; speakers?:Record<string,TtsSpeakerOptions>; multi_speaker?:boolean; normalize_text?:boolean; language_code?:'ko'|'ko-KR'; }
|
|
221
|
+
export interface OpenAiTtsInput extends GeminiTtsInput {}
|
|
222
|
+
export interface TtsOptions { voiceId?:TtsVoiceId; normalizeText?:boolean; idempotencyKey?:string; }
|
|
223
|
+
export interface GeminiTtsVoice { voice_id:string; name:string; gender:string|null; tone:string; age_band:string|null; age_years?:number|null; age_verified?:boolean; age_basis?:'catalog_description'|'reviewed'; age_source?:string; description?:string; language_code?:string|null; reviewed_at?:string; library:string; }
|
|
224
|
+
export interface TtsQuote { synthesis:number; normalization:number; estimated_total:number; maximum:number; synthesis_maximum:number; normalization_maximum:number; estimated_only:true; currency:'POINT'; fallback_price_may_change:boolean; }
|
|
214
225
|
|
|
215
226
|
export interface TtsJobData {
|
|
216
227
|
job_id: string;
|
|
217
228
|
status: 'waiting' | 'processing' | 'completed' | 'cancelled' | 'failed';
|
|
218
|
-
voice_id?: string;
|
|
219
|
-
synthesis?: {engine:'apick'|'gemini';model:string;voice_id:string;fallback_reason:string|null;age_verified:boolean;notice:string|null};
|
|
220
|
-
normalization?: {enabled:boolean;run_id:string|null;status:string;skill_id:string|null};
|
|
221
|
-
billing?: {status:string;synthesis:number;skill:number;total:number;reserved:number;refunded:number;released:number;currency:'POINT'};
|
|
222
|
-
expires_at?:string|null;
|
|
229
|
+
voice_id?: string;
|
|
230
|
+
synthesis?: {engine:'apick'|'gemini'|'openai';model:string;voice_id:string;fallback_reason:string|null;age_verified:boolean;notice:string|null};
|
|
231
|
+
normalization?: {enabled:boolean;run_id:string|null;status:string;skill_id:string|null};
|
|
232
|
+
billing?: {status:string;synthesis:number;skill:number;total:number;reserved:number;refunded:number;released:number;currency:'POINT'};
|
|
233
|
+
expires_at?:string|null;
|
|
223
234
|
character_count?: number;
|
|
224
235
|
result_available?: boolean;
|
|
225
236
|
subtitles_available?: boolean;
|
|
@@ -302,23 +313,29 @@ export class ApickClient {
|
|
|
302
313
|
youtubeThumbnail(url: string): Promise<ApickBinaryResult>;
|
|
303
314
|
youtubeSubtitleList(url: string): Promise<ApickResult<YoutubeSubtitleList>>;
|
|
304
315
|
youtubeSubtitle(url: string, lang: string, options?: YoutubeSubtitleOptions): Promise<ApickBinaryResult>;
|
|
305
|
-
createTtsJob(text: string |
|
|
306
|
-
createGeminiTtsJob(input:GeminiTtsInput, options?:{idempotencyKey?:string}):Promise<ApickResult<TtsJobData>>;
|
|
307
|
-
listGeminiTtsVoices():Promise<ApickResult<{voices:GeminiTtsVoice[];complete:boolean;checked_at:string|null}>>;
|
|
308
|
-
|
|
316
|
+
createTtsJob(text: string | GeminiTtsInput, options?: TtsOptions): Promise<ApickResult<TtsJobData>>;
|
|
317
|
+
createGeminiTtsJob(input:GeminiTtsInput, options?:{idempotencyKey?:string}):Promise<ApickResult<TtsJobData>>;
|
|
318
|
+
listGeminiTtsVoices():Promise<ApickResult<{voices:GeminiTtsVoice[];complete:boolean;checked_at:string|null}>>;
|
|
319
|
+
createOpenAiTtsJob(input:OpenAiTtsInput, options?:{idempotencyKey?:string}):Promise<ApickResult<TtsJobData>>;
|
|
320
|
+
listOpenAiTtsVoices():Promise<ApickResult<{voices:GeminiTtsVoice[];complete:boolean;checked_at:string|null}>>;
|
|
321
|
+
getTtsOptions():Promise<ApickResult<{engines:Record<'gemini'|'openai',Record<string,unknown>>}>>;
|
|
322
|
+
quoteTts(input:GeminiTtsInput&{engine?:'gemini'|'openai'}):Promise<ApickResult<TtsQuote>>;
|
|
309
323
|
getTtsJob(jobId: string): Promise<ApickResult<TtsJobData>>;
|
|
310
324
|
cancelTtsJob(jobId: string): Promise<ApickResult<TtsJobData>>;
|
|
311
325
|
downloadTtsResult(jobId: string): Promise<ApickBinaryResult>;
|
|
312
326
|
downloadTtsSubtitles(jobId: string): Promise<ApickBinaryResult>;
|
|
327
|
+
/** @deprecated Retired endpoint; the service returns HTTP 409. */
|
|
313
328
|
getTtsQuality(jobId: string): Promise<ApickResult<TtsQualityData>>;
|
|
329
|
+
/** @deprecated Retired endpoint; the service returns HTTP 409. */
|
|
314
330
|
retryTtsJob(jobId: string, utteranceIds: string[], idempotencyKey: string): Promise<ApickResult<TtsJobData>>;
|
|
331
|
+
/** @deprecated Retired endpoint; the service returns HTTP 409. */
|
|
315
332
|
downloadTtsCandidate(jobId: string, candidateId: string): Promise<ApickBinaryResult>;
|
|
316
333
|
htmlToPdf(html: string, options?: { pagination?: boolean }): Promise<ApickBinaryResult>;
|
|
317
334
|
jsonToExcel(data: unknown[], options?: { sheetName?: string }): Promise<ApickBinaryResult>;
|
|
318
335
|
summarize(text: string): Promise<ApickResult>;
|
|
319
336
|
polish(text: string): Promise<ApickResult>;
|
|
320
|
-
generateImages(prompt:string, options?:ImageAiGenerateOptions): Promise<ApickResult<ImageAiResultData|ImageAiPendingData>>;
|
|
321
|
-
editImages(image:string|BinaryInput|ArrayBuffer|ArrayBufferView, prompt:string, options?:ImageAiEditOptions): Promise<ApickResult<ImageAiResultData|ImageAiPendingData>>;
|
|
337
|
+
generateImages(prompt:string, options?:ImageAiGenerateOptions): Promise<ApickResult<ImageAiResultData|ImageAiPendingData>>;
|
|
338
|
+
editImages(image:string|BinaryInput|ArrayBuffer|ArrayBufferView, prompt:string, options?:ImageAiEditOptions): Promise<ApickResult<ImageAiResultData|ImageAiPendingData>>;
|
|
322
339
|
createImageGenerationJob(prompt:string, options?:ImageAiGenerateOptions): Promise<ApickResult<ImageAiJobData>>;
|
|
323
340
|
createImageEditJob(image:string|BinaryInput|ArrayBuffer|ArrayBufferView, prompt:string, options?:ImageAiEditOptions): Promise<ApickResult<ImageAiJobData>>;
|
|
324
341
|
getImageJob(jobId:string): Promise<ApickResult<ImageAiJobData>>;
|
|
@@ -340,20 +357,20 @@ export class ApickClient {
|
|
|
340
357
|
getTaxReturnHistory(transactionId: string): Promise<ApickResult<DataRequestResult<TaxReturnHistoryResultPayload>>>;
|
|
341
358
|
searchSkills(options?: SkillSearchOptions): Promise<ApickResult<SkillPage<SkillSummary>>>;
|
|
342
359
|
/** Public measured results and methods; model scores are not accuracy guarantees. */
|
|
343
|
-
getSkillPerformance(): Promise<ApickResult<SkillPerformanceReport>>;
|
|
344
|
-
subagentStatus(): Promise<ApickResult<Record<string, unknown>>>;
|
|
345
|
-
subagentUsage(): Promise<ApickResult<Record<string, unknown>>>;
|
|
346
|
-
createSubagentFile(input: {path:string;bytes:number;sha256:string;retention?:'seven_days'|'none'}): Promise<ApickResult<SubagentFile>>;
|
|
347
|
-
getSubagentFile(fileId:string): Promise<ApickResult<SubagentFile>>;
|
|
348
|
-
uploadSubagentPart(fileId:string,partNo:number,data:string): Promise<ApickResult<Record<string,unknown>>>;
|
|
349
|
-
completeSubagentFile(fileId:string): Promise<ApickResult<SubagentFile>>;
|
|
350
|
-
deleteSubagentFile(fileId:string): Promise<ApickResult<Record<string,unknown>>>;
|
|
351
|
-
dispatchSubagent(input:SubagentTask,options:{idempotencyKey:string}): Promise<ApickResult<SubagentJob>>;
|
|
352
|
-
collectSubagent(jobId:string,options?:{cursor?:string}): Promise<ApickResult<SubagentJob>>;
|
|
353
|
-
subagentEvidence(jobId:string,evidenceIds:string[]): Promise<ApickResult<Record<string,unknown>>>;
|
|
354
|
-
reviewSubagent(jobId:string,resultHash:string,decision:'accepted'|'rejected'): Promise<ApickResult<Record<string,unknown>>>;
|
|
355
|
-
cancelSubagent(jobId:string): Promise<ApickResult<SubagentJob>>;
|
|
356
|
-
deleteSubagentJob(jobId:string): Promise<ApickResult<Record<string,unknown>>>;
|
|
360
|
+
getSkillPerformance(): Promise<ApickResult<SkillPerformanceReport>>;
|
|
361
|
+
subagentStatus(): Promise<ApickResult<Record<string, unknown>>>;
|
|
362
|
+
subagentUsage(): Promise<ApickResult<Record<string, unknown>>>;
|
|
363
|
+
createSubagentFile(input: {path:string;bytes:number;sha256:string;retention?:'seven_days'|'none'}): Promise<ApickResult<SubagentFile>>;
|
|
364
|
+
getSubagentFile(fileId:string): Promise<ApickResult<SubagentFile>>;
|
|
365
|
+
uploadSubagentPart(fileId:string,partNo:number,data:string): Promise<ApickResult<Record<string,unknown>>>;
|
|
366
|
+
completeSubagentFile(fileId:string): Promise<ApickResult<SubagentFile>>;
|
|
367
|
+
deleteSubagentFile(fileId:string): Promise<ApickResult<Record<string,unknown>>>;
|
|
368
|
+
dispatchSubagent(input:SubagentTask,options:{idempotencyKey:string}): Promise<ApickResult<SubagentJob>>;
|
|
369
|
+
collectSubagent(jobId:string,options?:{cursor?:string}): Promise<ApickResult<SubagentJob>>;
|
|
370
|
+
subagentEvidence(jobId:string,evidenceIds:string[]): Promise<ApickResult<Record<string,unknown>>>;
|
|
371
|
+
reviewSubagent(jobId:string,resultHash:string,decision:'accepted'|'rejected'): Promise<ApickResult<Record<string,unknown>>>;
|
|
372
|
+
cancelSubagent(jobId:string): Promise<ApickResult<SubagentJob>>;
|
|
373
|
+
deleteSubagentJob(jobId:string): Promise<ApickResult<Record<string,unknown>>>;
|
|
357
374
|
getSkill(skillId: string): Promise<ApickResult<SkillDetail>>;
|
|
358
375
|
quoteSkill(skillId: string, input: Record<string, unknown>, options?: { version?: string }): Promise<ApickResult<SkillQuote>>;
|
|
359
376
|
runSkill<T = Record<string, unknown>>(skillId: string, input: Record<string, unknown>, options: SkillRunOptions): Promise<ApickResult<SkillRun<T>>>;
|
|
@@ -448,8 +465,8 @@ export interface SkillSummary {
|
|
|
448
465
|
rating_average: number | null;
|
|
449
466
|
}
|
|
450
467
|
export interface SkillDetail extends SkillSummary {
|
|
451
|
-
description: string; billing_rule: 'validated_result' | 'subagent_usage'; limits: SkillLimits | null;
|
|
452
|
-
delivery?: 'installed_agent'; installation?: {package:string;command:string;api_key_env:string;guide:string;usage:string};
|
|
468
|
+
description: string; billing_rule: 'validated_result' | 'subagent_usage'; limits: SkillLimits | null;
|
|
469
|
+
delivery?: 'installed_agent'; installation?: {package:string;command:string;api_key_env:string;guide:string;usage:string};
|
|
453
470
|
billing?: {markup_percent:number;installation_points:number;base_points:number;complete_cache_points:number;quota:null};
|
|
454
471
|
input_schema: Record<string, unknown>; output_schema: Record<string, unknown>;
|
|
455
472
|
examples: unknown[]; stats: Record<string, unknown> | null; published_at: string | null;
|
|
@@ -510,7 +527,7 @@ export interface VideoJobData {
|
|
|
510
527
|
result_expires_at?: string | null; idempotent_replay?: boolean;
|
|
511
528
|
error?: { code: string; message: string };
|
|
512
529
|
}
|
|
513
|
-
|
|
514
|
-
export interface SubagentTask { kind:'inventory'|'extract'|'summarize'|'compare';goal:string;file_ids:string[];focus?:string[];acceptance?:string[];retention?:'seven_days'|'none'; }
|
|
515
|
-
export interface SubagentFile { file_id:string;path:string;sha256:string;bytes:number;state:string;expires_at:string;part_bytes?:number; }
|
|
516
|
-
export interface SubagentJob { job_id:string;kind:SubagentTask['kind'];state:string;billing_state:string;cache_hit:boolean;reserved_points:number;charged_points:number;accrued_points:string;result_hash?:string;result?:Record<string,unknown>; }
|
|
530
|
+
|
|
531
|
+
export interface SubagentTask { kind:'inventory'|'extract'|'summarize'|'compare';goal:string;file_ids:string[];focus?:string[];acceptance?:string[];retention?:'seven_days'|'none'; }
|
|
532
|
+
export interface SubagentFile { file_id:string;path:string;sha256:string;bytes:number;state:string;expires_at:string;part_bytes?:number; }
|
|
533
|
+
export interface SubagentJob { job_id:string;kind:SubagentTask['kind'];state:string;billing_state:string;cache_hit:boolean;reserved_points:number;charged_points:number;accrued_points:string;result_hash?:string;result?:Record<string,unknown>; }
|