@nocha/cli 4.6.1 → 4.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/NOCHA.schema.json +1670 -3
- package/dist/build-info.json +4 -4
- package/dist/dev-offline-compiler.js +682 -7
- package/dist/dev-offline-runner.js +48 -6
- package/dist/development-live-host.js +13 -1
- package/dist/nocha.js +804 -60
- package/dist/reference-integrity.json +135 -101
- package/dist/references/api/README.md +24 -23
- package/dist/references/api/signatures.md +23 -2
- package/dist/references/base/server/tooling/sdk-sources.ts +2 -2
- package/dist/references/base/src/platform/failure.ts +1 -1
- package/dist/references/base/src/types/nocha/assets-media.d.ts +8 -0
- package/dist/references/base/src/types/nocha/assets-operations.d.ts +3 -0
- package/dist/references/base/src/types/nocha/capability-deadlines.d.ts +6 -0
- package/dist/references/base/src/types/nocha/capability-needs.d.ts +7 -0
- package/dist/references/base/src/types/nocha/capability-operations.d.ts +3 -1
- package/dist/references/base/src/types/nocha/drive-operations.d.ts +56 -0
- package/dist/references/base/src/types/nocha/drive-types.d.ts +77 -0
- package/dist/references/base/src/types/nocha/drive.d.ts +54 -0
- package/dist/references/base/src/types/nocha/error-codes.d.ts +9 -0
- package/dist/references/base/src/types/nocha/execution.d.ts +1 -1
- package/dist/references/base/src/types/nocha/index.d.ts +4 -0
- package/dist/references/base/src/types/nocha/media-read.d.ts +29 -0
- package/dist/references/base/src/types/nocha/operation-waiting.d.ts +8 -0
- package/dist/references/base/src/types/nocha/operation-wire-types.d.ts +30 -2
- package/dist/references/base/src/types/nocha/protocol.d.ts +7 -3
- package/dist/references/base/src/types/nocha/types/ai-wire.d.ts +40 -1
- package/dist/references/base/src/types/nocha/types/ai.d.ts +1 -1
- package/dist/references/base/src/types/nocha/types/assets-wire.d.ts +9 -1
- package/dist/references/base/src/types/nocha/types/assets.d.ts +22 -5
- package/dist/references/base/src/types/nocha/types/video-sdk-wire.d.ts +174 -13
- package/dist/references/base/src/types/nocha/types/video-wire.d.ts +120 -7
- package/dist/references/base/src/types/nocha/types/video.d.ts +5 -2
- package/dist/references/base/src/types/nocha/video-analysis.d.ts +10 -0
- package/dist/references/base/src/types/nocha/video-media.d.ts +1 -3
- package/dist/references/duel/server/tooling/sdk-sources.ts +2 -2
- package/dist/references/duel/src/types/nocha/assets-media.d.ts +8 -0
- package/dist/references/duel/src/types/nocha/assets-operations.d.ts +3 -0
- package/dist/references/duel/src/types/nocha/capability-deadlines.d.ts +6 -0
- package/dist/references/duel/src/types/nocha/capability-needs.d.ts +7 -0
- package/dist/references/duel/src/types/nocha/capability-operations.d.ts +3 -1
- package/dist/references/duel/src/types/nocha/drive-operations.d.ts +56 -0
- package/dist/references/duel/src/types/nocha/drive-types.d.ts +77 -0
- package/dist/references/duel/src/types/nocha/drive.d.ts +54 -0
- package/dist/references/duel/src/types/nocha/error-codes.d.ts +9 -0
- package/dist/references/duel/src/types/nocha/execution.d.ts +1 -1
- package/dist/references/duel/src/types/nocha/index.d.ts +4 -0
- package/dist/references/duel/src/types/nocha/media-read.d.ts +29 -0
- package/dist/references/duel/src/types/nocha/operation-waiting.d.ts +8 -0
- package/dist/references/duel/src/types/nocha/operation-wire-types.d.ts +30 -2
- package/dist/references/duel/src/types/nocha/protocol.d.ts +7 -3
- package/dist/references/duel/src/types/nocha/types/ai-wire.d.ts +40 -1
- package/dist/references/duel/src/types/nocha/types/ai.d.ts +1 -1
- package/dist/references/duel/src/types/nocha/types/assets-wire.d.ts +9 -1
- package/dist/references/duel/src/types/nocha/types/assets.d.ts +22 -5
- package/dist/references/duel/src/types/nocha/types/video-sdk-wire.d.ts +174 -13
- package/dist/references/duel/src/types/nocha/types/video-wire.d.ts +120 -7
- package/dist/references/duel/src/types/nocha/types/video.d.ts +5 -2
- package/dist/references/duel/src/types/nocha/video-analysis.d.ts +10 -0
- package/dist/references/duel/src/types/nocha/video-media.d.ts +1 -3
- package/dist/references/recipes/README.md +1 -0
- package/dist/references/recipes/backend-transaction/src/platform/failure.ts +1 -1
- package/dist/references/recipes/drive/NOCHA.json +24 -0
- package/dist/references/recipes/drive/README.md +15 -0
- package/dist/references/recipes/drive/SKILL.md +24 -0
- package/dist/references/recipes/drive/recipe.ts +34 -0
- package/dist/references/recipes/music/README.md +1 -1
- package/dist/references/recipes/types/nocha/assets-media.d.ts +8 -0
- package/dist/references/recipes/types/nocha/assets-operations.d.ts +3 -0
- package/dist/references/recipes/types/nocha/capability-deadlines.d.ts +6 -0
- package/dist/references/recipes/types/nocha/capability-needs.d.ts +7 -0
- package/dist/references/recipes/types/nocha/capability-operations.d.ts +3 -1
- package/dist/references/recipes/types/nocha/drive-operations.d.ts +56 -0
- package/dist/references/recipes/types/nocha/drive-types.d.ts +77 -0
- package/dist/references/recipes/types/nocha/drive.d.ts +54 -0
- package/dist/references/recipes/types/nocha/error-codes.d.ts +9 -0
- package/dist/references/recipes/types/nocha/execution.d.ts +1 -1
- package/dist/references/recipes/types/nocha/index.d.ts +4 -0
- package/dist/references/recipes/types/nocha/media-read.d.ts +29 -0
- package/dist/references/recipes/types/nocha/operation-waiting.d.ts +8 -0
- package/dist/references/recipes/types/nocha/operation-wire-types.d.ts +30 -2
- package/dist/references/recipes/types/nocha/protocol.d.ts +7 -3
- package/dist/references/recipes/types/nocha/types/ai-wire.d.ts +40 -1
- package/dist/references/recipes/types/nocha/types/ai.d.ts +1 -1
- package/dist/references/recipes/types/nocha/types/assets-wire.d.ts +9 -1
- package/dist/references/recipes/types/nocha/types/assets.d.ts +22 -5
- package/dist/references/recipes/types/nocha/types/video-sdk-wire.d.ts +174 -13
- package/dist/references/recipes/types/nocha/types/video-wire.d.ts +120 -7
- package/dist/references/recipes/types/nocha/types/video.d.ts +5 -2
- package/dist/references/recipes/types/nocha/video-analysis.d.ts +10 -0
- package/dist/references/recipes/types/nocha/video-media.d.ts +1 -3
- package/dist/references/stage/server/tooling/sdk-sources.ts +2 -2
- package/dist/references/stage/src/types/nocha/assets-media.d.ts +8 -0
- package/dist/references/stage/src/types/nocha/assets-operations.d.ts +3 -0
- package/dist/references/stage/src/types/nocha/capability-deadlines.d.ts +6 -0
- package/dist/references/stage/src/types/nocha/capability-needs.d.ts +7 -0
- package/dist/references/stage/src/types/nocha/capability-operations.d.ts +3 -1
- package/dist/references/stage/src/types/nocha/drive-operations.d.ts +56 -0
- package/dist/references/stage/src/types/nocha/drive-types.d.ts +77 -0
- package/dist/references/stage/src/types/nocha/drive.d.ts +54 -0
- package/dist/references/stage/src/types/nocha/error-codes.d.ts +9 -0
- package/dist/references/stage/src/types/nocha/execution.d.ts +1 -1
- package/dist/references/stage/src/types/nocha/index.d.ts +4 -0
- package/dist/references/stage/src/types/nocha/media-read.d.ts +29 -0
- package/dist/references/stage/src/types/nocha/operation-waiting.d.ts +8 -0
- package/dist/references/stage/src/types/nocha/operation-wire-types.d.ts +30 -2
- package/dist/references/stage/src/types/nocha/protocol.d.ts +7 -3
- package/dist/references/stage/src/types/nocha/types/ai-wire.d.ts +40 -1
- package/dist/references/stage/src/types/nocha/types/ai.d.ts +1 -1
- package/dist/references/stage/src/types/nocha/types/assets-wire.d.ts +9 -1
- package/dist/references/stage/src/types/nocha/types/assets.d.ts +22 -5
- package/dist/references/stage/src/types/nocha/types/video-sdk-wire.d.ts +174 -13
- package/dist/references/stage/src/types/nocha/types/video-wire.d.ts +120 -7
- package/dist/references/stage/src/types/nocha/types/video.d.ts +5 -2
- package/dist/references/stage/src/types/nocha/video-analysis.d.ts +10 -0
- package/dist/references/stage/src/types/nocha/video-media.d.ts +1 -3
- package/dist/references/workshop/server/tooling/sdk-sources.ts +2 -2
- package/dist/references/workshop/src/types/nocha/assets-media.d.ts +8 -0
- package/dist/references/workshop/src/types/nocha/assets-operations.d.ts +3 -0
- package/dist/references/workshop/src/types/nocha/capability-deadlines.d.ts +6 -0
- package/dist/references/workshop/src/types/nocha/capability-needs.d.ts +7 -0
- package/dist/references/workshop/src/types/nocha/capability-operations.d.ts +3 -1
- package/dist/references/workshop/src/types/nocha/drive-operations.d.ts +56 -0
- package/dist/references/workshop/src/types/nocha/drive-types.d.ts +77 -0
- package/dist/references/workshop/src/types/nocha/drive.d.ts +54 -0
- package/dist/references/workshop/src/types/nocha/error-codes.d.ts +9 -0
- package/dist/references/workshop/src/types/nocha/execution.d.ts +1 -1
- package/dist/references/workshop/src/types/nocha/index.d.ts +4 -0
- package/dist/references/workshop/src/types/nocha/media-read.d.ts +29 -0
- package/dist/references/workshop/src/types/nocha/operation-waiting.d.ts +8 -0
- package/dist/references/workshop/src/types/nocha/operation-wire-types.d.ts +30 -2
- package/dist/references/workshop/src/types/nocha/protocol.d.ts +7 -3
- package/dist/references/workshop/src/types/nocha/types/ai-wire.d.ts +40 -1
- package/dist/references/workshop/src/types/nocha/types/ai.d.ts +1 -1
- package/dist/references/workshop/src/types/nocha/types/assets-wire.d.ts +9 -1
- package/dist/references/workshop/src/types/nocha/types/assets.d.ts +22 -5
- package/dist/references/workshop/src/types/nocha/types/video-sdk-wire.d.ts +174 -13
- package/dist/references/workshop/src/types/nocha/types/video-wire.d.ts +120 -7
- package/dist/references/workshop/src/types/nocha/types/video.d.ts +5 -2
- package/dist/references/workshop/src/types/nocha/video-analysis.d.ts +10 -0
- package/dist/references/workshop/src/types/nocha/video-media.d.ts +1 -3
- package/dist/sdk-versions.json +1 -1
- package/dist/sdks/@nocha/sdk/dist/assets-operations.d.ts +3 -0
- package/dist/sdks/@nocha/sdk/dist/bridge.js +3 -3
- package/dist/sdks/@nocha/sdk/dist/capabilities.js +2 -2
- package/dist/sdks/@nocha/sdk/dist/capability-deadlines.d.ts +6 -0
- package/dist/sdks/@nocha/sdk/dist/capability-needs.d.ts +7 -0
- package/dist/sdks/@nocha/sdk/dist/capability-operations.d.ts +3 -1
- package/dist/sdks/@nocha/sdk/dist/{chunk-A3QFRV4K.js → chunk-7SH7NNX6.js} +2 -2
- package/dist/sdks/@nocha/sdk/dist/{chunk-3ULBSRGX.js → chunk-B34FPFNB.js} +1 -1
- package/dist/sdks/@nocha/sdk/dist/{chunk-MNRQELK7.js → chunk-EAC27UOG.js} +152 -7
- package/dist/sdks/{@watchirl/experience-sdk/dist/nocha/network-operations.d.ts → @nocha/sdk/dist/drive-operations.d.ts} +21 -18
- package/dist/sdks/@nocha/sdk/dist/drive-types.d.ts +76 -0
- package/dist/sdks/@nocha/sdk/dist/drive.d.ts +53 -0
- package/dist/sdks/@nocha/sdk/dist/error-codes.d.ts +9 -0
- package/dist/sdks/@nocha/sdk/dist/execution.d.ts +1 -1
- package/dist/sdks/@nocha/sdk/dist/host.js +1 -1
- package/dist/sdks/@nocha/sdk/dist/index.d.ts +4 -0
- package/dist/sdks/@nocha/sdk/dist/index.js +521 -125
- package/dist/sdks/@nocha/sdk/dist/operation-wire-types.d.ts +30 -2
- package/dist/sdks/@nocha/sdk/dist/protocol.d.ts +7 -3
- package/dist/sdks/@nocha/sdk/dist/protocol.js +19 -1
- package/dist/sdks/@nocha/sdk/dist/types/ai-wire.d.ts +40 -1
- package/dist/sdks/@nocha/sdk/dist/types/ai.d.ts +1 -1
- package/dist/sdks/@nocha/sdk/dist/types/assets-wire.d.ts +9 -1
- package/dist/sdks/@nocha/sdk/dist/types/assets.d.ts +22 -5
- package/dist/sdks/@nocha/sdk/dist/types/video-sdk-wire.d.ts +174 -13
- package/dist/sdks/@nocha/sdk/dist/types/video-wire.d.ts +120 -7
- package/dist/sdks/@nocha/sdk/dist/types/video.d.ts +5 -2
- package/dist/sdks/@nocha/sdk/dist/video-analysis.d.ts +9 -0
- package/dist/sdks/@nocha/sdk/dist/vite.js +3 -1
- package/dist/sdks/@nocha/sdk/package.json +1 -1
- package/dist/sdks/@watchirl/experience-sdk/dist/index.d.ts +2 -2
- package/dist/sdks/@watchirl/experience-sdk/dist/index.js +339 -4523
- package/dist/sdks/@watchirl/experience-sdk/dist/legacy-video.d.ts +2 -2
- package/dist/sdks/@watchirl/experience-sdk/dist/types.d.ts +1 -1
- package/dist/watchirl-sdk.js +333 -4515
- package/package.json +1 -1
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/access.d.ts +0 -23
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/ai-operations.d.ts +0 -252
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/assets-operations.d.ts +0 -102
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/assistant-contract.d.ts +0 -29
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/assistant-controls.d.ts +0 -11
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/assistant.d.ts +0 -57
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/automations-operations.d.ts +0 -377
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/automations-types.d.ts +0 -156
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/automations.d.ts +0 -27
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/backend-database.d.ts +0 -17
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/backend-operations.d.ts +0 -71
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/backend-requests.d.ts +0 -57
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/backend-runtime.d.ts +0 -106
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/backend-transactions.d.ts +0 -53
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/bridge.d.ts +0 -6
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/capability-deadlines.d.ts +0 -63
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/capability-needs.d.ts +0 -154
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/capability-operations.d.ts +0 -73
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/clipping-types.d.ts +0 -134
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/connectors-operations.d.ts +0 -103
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/connectors-types.d.ts +0 -10
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/connectors.d.ts +0 -14
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/context.d.ts +0 -18
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/device-operations.d.ts +0 -452
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/device-types.d.ts +0 -53
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/email-operations.d.ts +0 -30
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/email.d.ts +0 -9
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/error-codes.d.ts +0 -299
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/errors.d.ts +0 -36
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/execution.d.ts +0 -15
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/experience-context-types.d.ts +0 -12
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/experience-context.d.ts +0 -8
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/inbox-operations.d.ts +0 -58
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/inbox.d.ts +0 -23
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/index.d.ts +0 -101
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/multiplayer-facade.d.ts +0 -44
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/multiplayer-operations.d.ts +0 -80
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/multiplayer.d.ts +0 -16
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/navigation.d.ts +0 -16
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/network.d.ts +0 -13
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/notifications-operations.d.ts +0 -29
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/notifications.d.ts +0 -9
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/operation-metadata.d.ts +0 -67
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/operation-wire-types.d.ts +0 -319
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/outirl-operations.d.ts +0 -352
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/outirl.d.ts +0 -31
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/presence-operations.d.ts +0 -24
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/protocol.d.ts +0 -378
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/state.d.ts +0 -13
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/storage-operation-types.d.ts +0 -49
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/storage-operations.d.ts +0 -229
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/storage.d.ts +0 -32
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/transport.d.ts +0 -36
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/types/ai-wire.d.ts +0 -337
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/types/ai.d.ts +0 -20
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/types/assets-wire.d.ts +0 -27
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/types/assets.d.ts +0 -40
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/types/json.d.ts +0 -8
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/types/network.d.ts +0 -16
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/types/outirl.d.ts +0 -326
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/types/storage.d.ts +0 -74
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/types/video-sdk-wire.d.ts +0 -460
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/types/video-wire.d.ts +0 -440
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/types/video.d.ts +0 -164
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/types/voice-wire.d.ts +0 -17
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/video-operations.d.ts +0 -646
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/video-properties.d.ts +0 -6
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/viewport-types.d.ts +0 -14
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/viewport.d.ts +0 -7
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/voice.d.ts +0 -13
- package/dist/sdks/@watchirl/experience-sdk/dist/nocha/workspace.d.ts +0 -7
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type StateObservation } from './state.js';
|
|
2
|
-
import type { NochaContext, RequestOptions } from './context.js';
|
|
3
|
-
import type { DatabaseGetInput, DatabaseGetOutput, DatabaseInsertInput, DatabaseInsertOutput, DatabaseQueryInput, DatabaseQueryOutput, DatabaseRemoveInput, DatabaseRemoveOutput, DatabaseUpdateInput, DatabaseUpdateOutput, MemoryValue, StateSnapshot, StateSetInput, MemoryGetInput, MemorySetInput } from './types/storage.js';
|
|
4
|
-
export type NochaState = {
|
|
5
|
-
get(options?: RequestOptions): Promise<StateSnapshot>;
|
|
6
|
-
/** With `expectedSequence`, compare-and-set rejects `state_conflict` without writing when the sequence changed.
|
|
7
|
-
* Replaying the same idempotency key returns the first write. */
|
|
8
|
-
set(input: StateSetInput, options?: RequestOptions): Promise<StateSnapshot>;
|
|
9
|
-
/** Subscribes before reading, buffers live updates and only moves the sequence forward.
|
|
10
|
-
* Ends with `closed` and the error when the failure is not transient. */
|
|
11
|
-
watch(listener: (observation: StateObservation) => void, options?: RequestOptions): () => void;
|
|
12
|
-
};
|
|
13
|
-
export type NochaMemory = {
|
|
14
|
-
get(input: MemoryGetInput, options?: RequestOptions): Promise<MemoryValue>;
|
|
15
|
-
/** Compare-and-set rejects `memory_conflict` without writing when the document sequence changed.
|
|
16
|
-
* Not idempotent: after a timeout, read the key again before retrying. */
|
|
17
|
-
set(input: MemorySetInput, options?: RequestOptions): Promise<MemoryValue>;
|
|
18
|
-
};
|
|
19
|
-
export type NochaDatabase = {
|
|
20
|
-
/** Requires a persisted idempotency key: replaying it returns the first insert. */
|
|
21
|
-
insert(input: DatabaseInsertInput, options: RequestOptions & {
|
|
22
|
-
idempotencyKey: string;
|
|
23
|
-
}): Promise<DatabaseInsertOutput>;
|
|
24
|
-
get(input: DatabaseGetInput, options?: RequestOptions): Promise<DatabaseGetOutput>;
|
|
25
|
-
query(input: DatabaseQueryInput, options?: RequestOptions): Promise<DatabaseQueryOutput>;
|
|
26
|
-
/** Compare-and-set rejects `database_conflict` without writing when expectedRevision does not match. */
|
|
27
|
-
update(input: DatabaseUpdateInput, options?: RequestOptions): Promise<DatabaseUpdateOutput>;
|
|
28
|
-
remove(input: DatabaseRemoveInput, options?: RequestOptions): Promise<DatabaseRemoveOutput>;
|
|
29
|
-
};
|
|
30
|
-
export declare function createState(context: NochaContext, watch: NochaState['watch']): NochaState;
|
|
31
|
-
export declare function createMemory(context: NochaContext): NochaMemory;
|
|
32
|
-
export declare function createDatabase(context: NochaContext): NochaDatabase;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { NochaError } from './errors.js';
|
|
2
|
-
import { type BridgeEvent } from './protocol.js';
|
|
3
|
-
/** Nocha iframe transport. Credentials and capability authorization stay in the host. */
|
|
4
|
-
export { NOCHA_BRIDGE_PROTOCOL } from './protocol.js';
|
|
5
|
-
export type { BridgeEvent, BridgeReply, BridgeRequest } from './protocol.js';
|
|
6
|
-
export type BridgeRequestOptions = {
|
|
7
|
-
idempotencyKey?: string;
|
|
8
|
-
/** Stable usage declared by this revision in NOCHA.json. */
|
|
9
|
-
usageId?: string;
|
|
10
|
-
/** Local waiting deadline only: timeout/abort never cancel a remote paid operation. */
|
|
11
|
-
timeoutMs?: number;
|
|
12
|
-
signal?: AbortSignal;
|
|
13
|
-
};
|
|
14
|
-
export type BridgePortResult = {
|
|
15
|
-
result: unknown;
|
|
16
|
-
port: MessagePort;
|
|
17
|
-
};
|
|
18
|
-
/** Standalone pages (custom domains, `nocha-mode` meta) have no Nocha host to answer. */
|
|
19
|
-
export declare function assertHostCapability(capability: string): void;
|
|
20
|
-
/** Replies come from the parent window. WKWebView can deliver them without a source;
|
|
21
|
-
* the player-host shim restores it when present, so a missing source is accepted too. */
|
|
22
|
-
export declare function isFromHost(event: MessageEvent): boolean;
|
|
23
|
-
/** 8 to 200 characters without control characters, as the host and the API require. */
|
|
24
|
-
export declare function isIdempotencyKey(value: unknown): value is string;
|
|
25
|
-
type LateResult = {
|
|
26
|
-
signal: AbortSignal;
|
|
27
|
-
onResult(): void;
|
|
28
|
-
onError(error: NochaError): void;
|
|
29
|
-
onExpired(): void;
|
|
30
|
-
};
|
|
31
|
-
export declare function invokeBridge(capability: string, operation: string, input?: unknown, options?: BridgeRequestOptions): Promise<unknown>;
|
|
32
|
-
/** Internal resource cleanup hook; deliberately absent from the public bridge entry point. */
|
|
33
|
-
export declare function invokeBridgeWithLateResult(capability: string, operation: string, input: unknown, options: BridgeRequestOptions, lateResult: LateResult): Promise<unknown>;
|
|
34
|
-
/** A composite operation whose successful reply transfers one host-owned port. */
|
|
35
|
-
export declare function invokeBridgeWithPort(capability: string, operation: string, input?: unknown, options?: BridgeRequestOptions): Promise<BridgePortResult>;
|
|
36
|
-
export declare function subscribeBridgeEvents(listener: (event: BridgeEvent) => void): () => void;
|
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
import type { JsonObject, JsonValue } from './json.js';
|
|
2
|
-
import type { AiGenerateNeed, AssistantVoice, imageSizes, imageQualities, imageAspectRatios } from '../protocol.js';
|
|
3
|
-
export type { AiGenerateNeed } from '../protocol.js';
|
|
4
|
-
export type GenerationEffort = 'auto' | 'low' | 'medium' | 'high';
|
|
5
|
-
export type DesiredTextLength = 'short' | 'medium' | 'long';
|
|
6
|
-
export type ImageSize = typeof imageSizes[number];
|
|
7
|
-
export type ImageQuality = typeof imageQualities[number];
|
|
8
|
-
export type ImageAspectRatio = typeof imageAspectRatios[number];
|
|
9
|
-
/** Positive decimal integer string; 10 000 microcredits are one credit. */
|
|
10
|
-
export type Microcredits = string;
|
|
11
|
-
/** Budget shared by every need: a quote from `ai.estimate` and the participant's confirmed maximum. */
|
|
12
|
-
export type AiBudgetInput = {
|
|
13
|
-
quoteId?: string;
|
|
14
|
-
maximumCostMicrocredits?: Microcredits;
|
|
15
|
-
};
|
|
16
|
-
/** Adjustable needs also accept the intensity allowed by the experience's generation policy. */
|
|
17
|
-
export type AiPolicyInput = AiBudgetInput & {
|
|
18
|
-
effort?: GenerationEffort;
|
|
19
|
-
generationUsage?: string;
|
|
20
|
-
};
|
|
21
|
-
type TextInput = AiPolicyInput & {
|
|
22
|
-
prompt: string;
|
|
23
|
-
inputAssetIds?: string[];
|
|
24
|
-
desiredLength?: DesiredTextLength;
|
|
25
|
-
};
|
|
26
|
-
type ImageInput = AiPolicyInput & {
|
|
27
|
-
prompt: string;
|
|
28
|
-
size?: ImageSize;
|
|
29
|
-
aspectRatio?: ImageAspectRatio;
|
|
30
|
-
quality?: ImageQuality;
|
|
31
|
-
outputFormat?: 'png' | 'jpeg' | 'webp';
|
|
32
|
-
background?: 'transparent' | 'opaque' | 'auto';
|
|
33
|
-
};
|
|
34
|
-
export type AiTextInput = TextInput & {
|
|
35
|
-
need: 'text.short' | 'text.chat' | 'text.long';
|
|
36
|
-
};
|
|
37
|
-
/** `schema` describes the JSON object the model must return (strict JSON schema). */
|
|
38
|
-
export type AiStructuredInput = TextInput & {
|
|
39
|
-
need: 'text.structured';
|
|
40
|
-
schema: JsonObject;
|
|
41
|
-
schemaName?: string;
|
|
42
|
-
};
|
|
43
|
-
export type AiResearchInput = AiPolicyInput & {
|
|
44
|
-
need: 'web.research';
|
|
45
|
-
prompt: string;
|
|
46
|
-
schema: JsonObject;
|
|
47
|
-
schemaName?: string;
|
|
48
|
-
allowedDomains: readonly string[];
|
|
49
|
-
maxToolCalls: number;
|
|
50
|
-
};
|
|
51
|
-
/** Opaque voice id from `ai.voices`; the historical names (alloy…cedar) remain accepted as aliases. */
|
|
52
|
-
export type SpeechVoice = AssistantVoice | (string & {});
|
|
53
|
-
/** `model` absent: Nocha's default speech model. `voice` absent: that model's default voice; a listed voice
|
|
54
|
-
* other than a historical name is sent with the `model` it was listed for. `language` is BCP-47 (`fr`, `en-GB`,
|
|
55
|
-
* `pt-BR`); absent, it is detected from the text. */
|
|
56
|
-
export type AiSpeechInput = AiPolicyInput & {
|
|
57
|
-
need: 'audio.synthesize';
|
|
58
|
-
prompt: string;
|
|
59
|
-
model?: string;
|
|
60
|
-
voice?: SpeechVoice;
|
|
61
|
-
language?: string;
|
|
62
|
-
};
|
|
63
|
-
/** Speech to text. `audioDataUrl` is a base64 `audio/wav|mp4|webm|ogg|mpeg` data URL of at most 4 MiB, for example a bounded recording made from `device.media.getUserMedia()`. Alternatively pass one authorized stored audio asset in `inputAssetIds`. `prompt` is an optional vocabulary hint. */
|
|
64
|
-
export type AiTranscriptionInput = AiPolicyInput & {
|
|
65
|
-
need: 'audio.transcribe';
|
|
66
|
-
language?: string;
|
|
67
|
-
prompt?: string;
|
|
68
|
-
} & ({
|
|
69
|
-
audioDataUrl: string;
|
|
70
|
-
inputAssetIds?: never;
|
|
71
|
-
} | {
|
|
72
|
-
inputAssetIds: [string];
|
|
73
|
-
audioDataUrl?: never;
|
|
74
|
-
});
|
|
75
|
-
export type AiMusicInput = AiPolicyInput & {
|
|
76
|
-
need: 'audio.generate';
|
|
77
|
-
prompt: string;
|
|
78
|
-
durationSeconds?: number;
|
|
79
|
-
lyrics?: string;
|
|
80
|
-
seed?: number;
|
|
81
|
-
bpm?: number;
|
|
82
|
-
vocalLanguage?: string;
|
|
83
|
-
keyScale?: string;
|
|
84
|
-
timeSignature?: 2 | 3 | 4 | 6;
|
|
85
|
-
outputFormat?: 'mp3' | 'wav' | 'flac' | 'ogg';
|
|
86
|
-
};
|
|
87
|
-
export type AiImageInput = (ImageInput & {
|
|
88
|
-
need: 'image.generate';
|
|
89
|
-
}) | (ImageInput & {
|
|
90
|
-
need: 'image.edit';
|
|
91
|
-
inputAssetIds: string[];
|
|
92
|
-
});
|
|
93
|
-
/** Prompt-only video generation. Duration defaults to 6 seconds and must be between 4 and 30. */
|
|
94
|
-
export type AiVideoInput = AiPolicyInput & {
|
|
95
|
-
need: 'video.generate';
|
|
96
|
-
prompt: string;
|
|
97
|
-
durationSeconds?: number;
|
|
98
|
-
};
|
|
99
|
-
/** Fixed media operations: one authorized source asset (except sound), no adjustable intensity. */
|
|
100
|
-
export type AiMediaTransformInput = AiBudgetInput & {
|
|
101
|
-
need: 'image.remove_background';
|
|
102
|
-
inputAssetIds: [string];
|
|
103
|
-
outputFormat?: 'png';
|
|
104
|
-
} | AiBudgetInput & {
|
|
105
|
-
need: 'image.upscale';
|
|
106
|
-
inputAssetIds: [string];
|
|
107
|
-
scale?: 2 | 4;
|
|
108
|
-
outputFormat?: 'png' | 'jpeg';
|
|
109
|
-
} | AiBudgetInput & {
|
|
110
|
-
need: 'audio.sound_effect';
|
|
111
|
-
prompt: string;
|
|
112
|
-
durationSeconds?: number;
|
|
113
|
-
loop?: boolean;
|
|
114
|
-
} | AiBudgetInput & {
|
|
115
|
-
need: 'video.extend';
|
|
116
|
-
inputAssetIds: [string];
|
|
117
|
-
prompt?: string;
|
|
118
|
-
durationSeconds?: number;
|
|
119
|
-
mode?: 'start' | 'end';
|
|
120
|
-
};
|
|
121
|
-
/** One input shape per need; `need` is always explicit. */
|
|
122
|
-
export type AiGenerateInput = AiTextInput | AiStructuredInput | AiResearchInput | AiSpeechInput | AiTranscriptionInput | AiMusicInput | AiImageInput | AiVideoInput | AiMediaTransformInput;
|
|
123
|
-
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
124
|
-
/** Prices a recording length before recording. Its quote cannot be consumed by `generate`, which always sends the recording. */
|
|
125
|
-
export type AiTranscriptionEstimateInput = Omit<AiTranscriptionInput, 'quoteId' | 'audioDataUrl' | 'inputAssetIds'> & {
|
|
126
|
-
durationSeconds: number;
|
|
127
|
-
};
|
|
128
|
-
/** The generation request without the quote it produces. */
|
|
129
|
-
export type AiEstimateInput = DistributiveOmit<AiGenerateInput, 'quoteId'> | AiTranscriptionEstimateInput;
|
|
130
|
-
export type AiBilling = {
|
|
131
|
-
payer_mode: 'participants' | 'project';
|
|
132
|
-
payer_account_id?: string;
|
|
133
|
-
capability_calls: 'initiator' | 'project';
|
|
134
|
-
participant_captured_microcredits: string;
|
|
135
|
-
charged_microcredits?: string;
|
|
136
|
-
base_charge_microcredits?: string;
|
|
137
|
-
creator_fee_microcredits?: string;
|
|
138
|
-
};
|
|
139
|
-
export type AiSource = {
|
|
140
|
-
url: string;
|
|
141
|
-
title?: string;
|
|
142
|
-
};
|
|
143
|
-
type AiResultBase<N> = {
|
|
144
|
-
need: N;
|
|
145
|
-
capability: string;
|
|
146
|
-
operation_id: string;
|
|
147
|
-
billing: AiBilling;
|
|
148
|
-
};
|
|
149
|
-
/** Result of `ai.generate` for one need, in the wire format. `T` types `structured` (see the `decode` option). */
|
|
150
|
-
export type AiGenerateResult<N extends AiGenerateNeed = AiGenerateNeed, T = JsonValue> = N extends 'text.short' | 'text.chat' | 'text.long' ? AiResultBase<N> & {
|
|
151
|
-
text: string;
|
|
152
|
-
} : N extends 'text.structured' ? AiResultBase<N> & {
|
|
153
|
-
text: string;
|
|
154
|
-
structured: T;
|
|
155
|
-
} : N extends 'web.research' ? AiResultBase<N> & {
|
|
156
|
-
structured: T;
|
|
157
|
-
sources: AiSource[];
|
|
158
|
-
search_call_count: number;
|
|
159
|
-
} : N extends 'audio.synthesize' ? AiResultBase<N> & {
|
|
160
|
-
audio_base64: string;
|
|
161
|
-
mime_type: string;
|
|
162
|
-
asset_ids?: string[];
|
|
163
|
-
assets?: Array<{
|
|
164
|
-
id: string;
|
|
165
|
-
}>;
|
|
166
|
-
} : N extends 'audio.transcribe' ? AiResultBase<N> & {
|
|
167
|
-
text: string;
|
|
168
|
-
duration_seconds?: number;
|
|
169
|
-
} : AiResultBase<N> & {
|
|
170
|
-
asset_ids: string[];
|
|
171
|
-
assets: Array<{
|
|
172
|
-
id: string;
|
|
173
|
-
}>;
|
|
174
|
-
model?: string;
|
|
175
|
-
duration_seconds?: number;
|
|
176
|
-
seed?: number;
|
|
177
|
-
};
|
|
178
|
-
/** Real-time decision (`text.decision`): typed questions about a bounded JSON state, no prompt, no quote, no effort. */
|
|
179
|
-
export type AiDecisionQuestion = {
|
|
180
|
-
type: 'choice';
|
|
181
|
-
instructions: string;
|
|
182
|
-
criteria: Record<string, string>;
|
|
183
|
-
} | {
|
|
184
|
-
type: 'score';
|
|
185
|
-
instructions: string;
|
|
186
|
-
criteria: string[];
|
|
187
|
-
} | {
|
|
188
|
-
type: 'noul';
|
|
189
|
-
instructions: string;
|
|
190
|
-
};
|
|
191
|
-
export type AiDecideInput = {
|
|
192
|
-
state: JsonValue;
|
|
193
|
-
questions: Record<string, AiDecisionQuestion>;
|
|
194
|
-
maximumCostMicrocredits?: Microcredits;
|
|
195
|
-
};
|
|
196
|
-
export type AiChoiceAnswer = {
|
|
197
|
-
type: 'choice';
|
|
198
|
-
choice: string;
|
|
199
|
-
confidence: number;
|
|
200
|
-
probabilities: Record<string, number>;
|
|
201
|
-
};
|
|
202
|
-
export type AiScoreAnswer = {
|
|
203
|
-
type: 'score';
|
|
204
|
-
score: number;
|
|
205
|
-
confidence: number;
|
|
206
|
-
legend: Record<string, string>;
|
|
207
|
-
probabilities: Record<string, number>;
|
|
208
|
-
};
|
|
209
|
-
export type AiNoulAnswer = {
|
|
210
|
-
type: 'noul';
|
|
211
|
-
noul: number;
|
|
212
|
-
};
|
|
213
|
-
export type AiDecisionAnswer = AiChoiceAnswer | AiScoreAnswer | AiNoulAnswer;
|
|
214
|
-
export type AiDecideResult<T = Record<string, AiDecisionAnswer>> = {
|
|
215
|
-
answers: T;
|
|
216
|
-
model: string;
|
|
217
|
-
capability: 'text.decide';
|
|
218
|
-
need: 'text.decision';
|
|
219
|
-
operation_id: string;
|
|
220
|
-
billing: AiBilling;
|
|
221
|
-
};
|
|
222
|
-
/** A quote fixes the accepted route, parameters and price for fifteen minutes. */
|
|
223
|
-
export type AiGenerationEstimate = {
|
|
224
|
-
quote_id: string;
|
|
225
|
-
expires_at: string;
|
|
226
|
-
estimated_cost_micro_usd: string;
|
|
227
|
-
payer_mode?: 'initiator' | 'project';
|
|
228
|
-
payer_account_id?: string;
|
|
229
|
-
/** User maximum including the creator fee; provider microdollars are not credits. */
|
|
230
|
-
estimated_charge_microcredits?: string;
|
|
231
|
-
base_charge_microcredits?: string;
|
|
232
|
-
creator_fee_microcredits?: string;
|
|
233
|
-
creator_policy_version?: string;
|
|
234
|
-
estimated_usage: Record<string, string>;
|
|
235
|
-
rate_card_id: string;
|
|
236
|
-
};
|
|
237
|
-
export type AiGenerationOperation = {
|
|
238
|
-
operation_id: string;
|
|
239
|
-
status: 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
240
|
-
need: AiGenerateNeed;
|
|
241
|
-
asset_ids: string[];
|
|
242
|
-
text?: string;
|
|
243
|
-
duration_seconds?: number;
|
|
244
|
-
structured?: JsonValue;
|
|
245
|
-
sources?: AiSource[];
|
|
246
|
-
search_call_count?: number;
|
|
247
|
-
audio_base64?: string;
|
|
248
|
-
mime_type?: string;
|
|
249
|
-
assets?: Array<{
|
|
250
|
-
id: string;
|
|
251
|
-
}>;
|
|
252
|
-
model?: string;
|
|
253
|
-
seed?: number;
|
|
254
|
-
billing?: AiBilling;
|
|
255
|
-
poll_after_ms?: number;
|
|
256
|
-
failure?: {
|
|
257
|
-
code: string;
|
|
258
|
-
message: string;
|
|
259
|
-
retryable: boolean;
|
|
260
|
-
};
|
|
261
|
-
};
|
|
262
|
-
export type GenerationOptions = {
|
|
263
|
-
version: number;
|
|
264
|
-
usage: string;
|
|
265
|
-
family: 'text' | 'image' | 'video' | 'voice' | 'music' | 'sound' | 'research' | 'import';
|
|
266
|
-
efforts: Array<Exclude<GenerationEffort, 'auto'>>;
|
|
267
|
-
formats?: string[];
|
|
268
|
-
dimensions?: Array<{
|
|
269
|
-
width: number;
|
|
270
|
-
height: number;
|
|
271
|
-
}>;
|
|
272
|
-
durations?: {
|
|
273
|
-
min: number;
|
|
274
|
-
max: number;
|
|
275
|
-
default: number;
|
|
276
|
-
};
|
|
277
|
-
scale?: {
|
|
278
|
-
default: number;
|
|
279
|
-
values: number[];
|
|
280
|
-
};
|
|
281
|
-
maximum_output_pixels?: number;
|
|
282
|
-
maximum_input_bytes?: number;
|
|
283
|
-
combinations?: Array<Record<string, string | number | boolean>>;
|
|
284
|
-
};
|
|
285
|
-
export type AiOptionsInput = {
|
|
286
|
-
need: AiGenerateNeed;
|
|
287
|
-
inputAssetIds?: string[];
|
|
288
|
-
generationUsage?: string;
|
|
289
|
-
};
|
|
290
|
-
/** Speech models available to experiences; `default` marks the model used when `model` is omitted. */
|
|
291
|
-
export type AiModelsInput = {
|
|
292
|
-
need: 'audio.synthesize';
|
|
293
|
-
};
|
|
294
|
-
export type AiModel = {
|
|
295
|
-
model: string;
|
|
296
|
-
label: string;
|
|
297
|
-
default: boolean;
|
|
298
|
-
languages?: string[];
|
|
299
|
-
};
|
|
300
|
-
export type AiModels = {
|
|
301
|
-
need: 'audio.synthesize';
|
|
302
|
-
default_model: string;
|
|
303
|
-
models: AiModel[];
|
|
304
|
-
};
|
|
305
|
-
/** One page of voices for a speech model (the default one when `model` is omitted). `standard` voices are
|
|
306
|
-
* built in; `library` voices come from a shared catalogue searchable with `query`. Pass `next_cursor` back as `cursor`. */
|
|
307
|
-
export type AiVoicesInput = {
|
|
308
|
-
model?: string;
|
|
309
|
-
language?: string;
|
|
310
|
-
collection?: 'standard' | 'library';
|
|
311
|
-
query?: string;
|
|
312
|
-
cursor?: string;
|
|
313
|
-
limit?: number;
|
|
314
|
-
};
|
|
315
|
-
export type AiVoice = {
|
|
316
|
-
id: string;
|
|
317
|
-
name: string;
|
|
318
|
-
description?: string;
|
|
319
|
-
gender?: string;
|
|
320
|
-
age?: string;
|
|
321
|
-
accent?: string;
|
|
322
|
-
languages: string[];
|
|
323
|
-
collection: 'standard' | 'library';
|
|
324
|
-
alias?: AssistantVoice;
|
|
325
|
-
};
|
|
326
|
-
export type AiVoices = {
|
|
327
|
-
model: string;
|
|
328
|
-
default_voice: string;
|
|
329
|
-
voices: AiVoice[];
|
|
330
|
-
next_cursor: string | null;
|
|
331
|
-
};
|
|
332
|
-
/** Recover an accepted operation by its id or by the original request's idempotency key. */
|
|
333
|
-
export type AiGetInput = {
|
|
334
|
-
operationId: string;
|
|
335
|
-
} | {
|
|
336
|
-
idempotencyKey: string;
|
|
337
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { RequestOptions } from '../context.js';
|
|
2
|
-
import type { JsonValue } from './json.js';
|
|
3
|
-
import type { AiGenerateInput, AiGenerateResult, AiEstimateInput, AiGenerationEstimate, AiDecisionAnswer, AiDecideInput, AiDecideResult, AiOptionsInput, GenerationOptions, AiGetInput, AiGenerationOperation, AiModelsInput, AiModels, AiVoicesInput, AiVoices } from './ai-wire.js';
|
|
4
|
-
export type * from './ai-wire.js';
|
|
5
|
-
/** `decode` validates and types `structured` (generate) or `answers` (decide), after the SDK's own checks. */
|
|
6
|
-
export type AiRequestOptions<T = JsonValue> = RequestOptions & {
|
|
7
|
-
decode?: (value: unknown) => T;
|
|
8
|
-
};
|
|
9
|
-
export type NochaAi = {
|
|
10
|
-
generate<I extends AiGenerateInput, T = JsonValue>(input: I, options?: AiRequestOptions<T>): Promise<AiGenerateResult<I['need'], T>>;
|
|
11
|
-
estimate(input: AiEstimateInput, options?: RequestOptions): Promise<AiGenerationEstimate>;
|
|
12
|
-
/** Answers in well under a second; the host applies a provider deadline and a fixed per-call ceiling. */
|
|
13
|
-
decide<T = Record<string, AiDecisionAnswer>>(input: AiDecideInput, options?: AiRequestOptions<T>): Promise<AiDecideResult<T>>;
|
|
14
|
-
options(input: AiOptionsInput, options?: RequestOptions): Promise<GenerationOptions>;
|
|
15
|
-
get(input: AiGetInput, options?: RequestOptions): Promise<AiGenerationOperation>;
|
|
16
|
-
/** Speech models selectable with `model` in `audio.synthesize`. */
|
|
17
|
-
models(input: AiModelsInput, options?: RequestOptions): Promise<AiModels>;
|
|
18
|
-
/** Voices selectable with `voice` in `audio.synthesize`, one page at a time. */
|
|
19
|
-
voices(input: AiVoicesInput, options?: RequestOptions): Promise<AiVoices>;
|
|
20
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export type UploadableImageType = 'image/jpeg' | 'image/png' | 'image/webp';
|
|
2
|
-
/** Videos `assets.upload` stores, such as the `source_video` reference of a video workflow; `read` never returns them. */
|
|
3
|
-
export type UploadableVideoType = 'video/mp4' | 'video/quicktime';
|
|
4
|
-
export type ReadableAssetType = UploadableImageType | 'audio/mpeg' | 'audio/wav' | 'audio/flac' | 'audio/ogg';
|
|
5
|
-
/** Bytes of a stored image or audio asset; `data_url` is ready for an `<img>` or `<audio>` source. */
|
|
6
|
-
export type ReadAssetResult = {
|
|
7
|
-
id: string;
|
|
8
|
-
mime_type: ReadableAssetType;
|
|
9
|
-
data_base64: string;
|
|
10
|
-
data_url: string;
|
|
11
|
-
};
|
|
12
|
-
export type UploadedAsset = {
|
|
13
|
-
id: string;
|
|
14
|
-
mime_type: string;
|
|
15
|
-
size_bytes: string;
|
|
16
|
-
};
|
|
17
|
-
export type AttachmentMime = 'image/jpeg' | 'image/png' | 'image/webp' | 'video/mp4' | 'audio/wav' | 'audio/mp4';
|
|
18
|
-
/** An attachment linked to a record of the current workspace. */
|
|
19
|
-
export type AttachmentUrlInput = {
|
|
20
|
-
postId: string;
|
|
21
|
-
assetId: string;
|
|
22
|
-
collection?: string;
|
|
23
|
-
};
|
|
24
|
-
export type AttachmentUrlResult = {
|
|
25
|
-
url: string;
|
|
26
|
-
mime_type: AttachmentMime;
|
|
27
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export type * from './assets-wire.js';
|
|
2
|
-
import type { ReadAssetResult, UploadedAsset, AttachmentUrlInput, AttachmentUrlResult } from './assets-wire.js';
|
|
3
|
-
import type { RequestOptions } from '../context.js';
|
|
4
|
-
export type AssetUploadInput = {
|
|
5
|
-
file: Blob;
|
|
6
|
-
filename?: string;
|
|
7
|
-
};
|
|
8
|
-
/** `onProgress` reports the bytes the host has sent, for a video only. */
|
|
9
|
-
export type AssetUploadOptions = RequestOptions & {
|
|
10
|
-
onProgress?: (progress: {
|
|
11
|
-
loaded: number;
|
|
12
|
-
total: number;
|
|
13
|
-
}) => void;
|
|
14
|
-
};
|
|
15
|
-
/** A JPEG, PNG, WebP or MP4 file of at most 64 MiB, or a WAV or M4A audio file of at most 4 MiB. */
|
|
16
|
-
export type AttachmentUploadInput = {
|
|
17
|
-
file: Blob;
|
|
18
|
-
filename?: string;
|
|
19
|
-
};
|
|
20
|
-
export type AttachmentUploadOptions = RequestOptions & {
|
|
21
|
-
onProgress?: (progress: {
|
|
22
|
-
loaded: number;
|
|
23
|
-
total: number;
|
|
24
|
-
}) => void;
|
|
25
|
-
};
|
|
26
|
-
export type NochaAssets = {
|
|
27
|
-
/** Reads an asset this participant may see. Store asset ids, never base64 or data URLs. */
|
|
28
|
-
read(input: {
|
|
29
|
-
assetId: string;
|
|
30
|
-
}, options?: RequestOptions): Promise<ReadAssetResult>;
|
|
31
|
-
/** Uploads a JPEG, PNG or WebP image (12 MiB at most), or an MP4 or QuickTime video (64 MiB at most) sent through the
|
|
32
|
-
* host's binary transport, such as the `source_video` reference of a video workflow. The asset follows the media
|
|
33
|
-
* usage's retention (`durable` keeps it) and stays readable by its author only; `read` returns images and audio, never
|
|
34
|
-
* a video. Persist the `idempotencyKey` before a video upload and reuse it after a lost reply. */
|
|
35
|
-
upload(input: AssetUploadInput, options?: AssetUploadOptions): Promise<UploadedAsset>;
|
|
36
|
-
/** Uploads a workspace attachment through the host's binary transport; the host checks the workspace contribution right. */
|
|
37
|
-
uploadAttachment(input: AttachmentUploadInput, options?: AttachmentUploadOptions): Promise<UploadedAsset>;
|
|
38
|
-
/** Short-lived URL of an attachment linked to a record of the current workspace. */
|
|
39
|
-
attachmentUrl(input: AttachmentUrlInput, options?: RequestOptions): Promise<AttachmentUrlResult>;
|
|
40
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** Application state, memory and structured AI output are open JSON documents. */
|
|
2
|
-
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
3
|
-
[key: string]: JsonValue;
|
|
4
|
-
};
|
|
5
|
-
export type JsonObject = {
|
|
6
|
-
[key: string]: JsonValue;
|
|
7
|
-
};
|
|
8
|
-
export type EmptyInput = Record<string, never>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type NetworkRequestInput = {
|
|
2
|
-
recipientId: string;
|
|
3
|
-
path: string;
|
|
4
|
-
method: 'GET' | 'POST';
|
|
5
|
-
body?: unknown;
|
|
6
|
-
};
|
|
7
|
-
export type NetworkResponse = {
|
|
8
|
-
status: number;
|
|
9
|
-
contentType: string;
|
|
10
|
-
body: string;
|
|
11
|
-
};
|
|
12
|
-
export type NetworkAsset = {
|
|
13
|
-
mimeType: string;
|
|
14
|
-
base64: string;
|
|
15
|
-
sha256: string;
|
|
16
|
-
};
|