@nimiplatform/sdk 0.10.0 → 0.12.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/dist/core/ai/index.d.ts +1 -0
- package/dist/core/ai/index.d.ts.map +1 -1
- package/dist/core/ai/index.js +1 -0
- package/dist/core/ai/index.js.map +1 -1
- package/dist/core/ai/local-app-model.d.ts +8 -0
- package/dist/core/ai/local-app-model.d.ts.map +1 -0
- package/dist/core/ai/local-app-model.js +117 -0
- package/dist/core/ai/local-app-model.js.map +1 -0
- package/dist/core/app/index.d.ts +8 -1
- package/dist/core/app/index.d.ts.map +1 -1
- package/dist/core/app/index.js +5 -0
- package/dist/core/app/index.js.map +1 -1
- package/dist/core/app/local-app-runtime-platform-ai.d.ts +52 -7
- package/dist/core/app/local-app-runtime-platform-ai.d.ts.map +1 -1
- package/dist/core/app/local-app-runtime-platform-ai.js +178 -86
- package/dist/core/app/local-app-runtime-platform-ai.js.map +1 -1
- package/dist/core/app/local-app-runtime-platform-direct-realtime-shared.d.ts +1 -1
- package/dist/core/app/local-app-runtime-platform-validation.d.ts +1 -1
- package/dist/core/app/local-app-runtime-platform-validation.d.ts.map +1 -1
- package/dist/core/app/local-app-runtime-platform-validation.js +4 -4
- package/dist/core/app/local-app-runtime-platform-validation.js.map +1 -1
- package/dist/core/app/local-app-runtime-platform-video.d.ts +58 -0
- package/dist/core/app/local-app-runtime-platform-video.d.ts.map +1 -0
- package/dist/core/app/local-app-runtime-platform-video.js +155 -0
- package/dist/core/app/local-app-runtime-platform-video.js.map +1 -0
- package/dist/core/app/local-app-runtime-platform-world-creator.d.ts +50 -0
- package/dist/core/app/local-app-runtime-platform-world-creator.d.ts.map +1 -0
- package/dist/core/app/local-app-runtime-platform-world-creator.js +246 -0
- package/dist/core/app/local-app-runtime-platform-world-creator.js.map +1 -0
- package/dist/core/app/local-app-runtime-platform.d.ts +9 -10
- package/dist/core/app/local-app-runtime-platform.d.ts.map +1 -1
- package/dist/core/app/local-app-runtime-platform.js +8 -3
- package/dist/core/app/local-app-runtime-platform.js.map +1 -1
- package/dist/core/app/local-app-text.d.ts +51 -0
- package/dist/core/app/local-app-text.d.ts.map +1 -0
- package/dist/core/app/local-app-text.js +228 -0
- package/dist/core/app/local-app-text.js.map +1 -0
- package/dist/core-generated/realm-client.js +6 -6
- package/dist/core-generated/realm-client.js.map +1 -1
- package/dist/core-generated/realm-typed-client.d.ts +12 -12
- package/dist/core-generated/realm-typed-client.d.ts.map +1 -1
- package/dist/core-generated/realm-typed-client.js +13 -13
- package/dist/core-generated/realm-typed-client.js.map +1 -1
- package/dist/core-generated/runtime-client.d.ts.map +1 -1
- package/dist/core-generated/runtime-client.js +96 -0
- package/dist/core-generated/runtime-client.js.map +1 -1
- package/dist/core-generated/runtime-protobuf/runtime/v1/ai.d.ts +725 -6
- package/dist/core-generated/runtime-protobuf/runtime/v1/ai.d.ts.map +1 -1
- package/dist/core-generated/runtime-protobuf/runtime/v1/ai.js +1758 -261
- package/dist/core-generated/runtime-protobuf/runtime/v1/ai.js.map +1 -1
- package/dist/core-generated/runtime-protobuf/runtime/v1/app.d.ts +579 -1
- package/dist/core-generated/runtime-protobuf/runtime/v1/app.d.ts.map +1 -1
- package/dist/core-generated/runtime-protobuf/runtime/v1/app.js +1306 -37
- package/dist/core-generated/runtime-protobuf/runtime/v1/app.js.map +1 -1
- package/dist/core-generated/runtime-protobuf/runtime/v1/common.d.ts +37 -1
- package/dist/core-generated/runtime-protobuf/runtime/v1/common.d.ts.map +1 -1
- package/dist/core-generated/runtime-protobuf/runtime/v1/common.js +36 -0
- package/dist/core-generated/runtime-protobuf/runtime/v1/common.js.map +1 -1
- package/dist/core-generated/runtime-public-client.d.ts.map +1 -1
- package/dist/core-generated/runtime-public-client.js +96 -0
- package/dist/core-generated/runtime-public-client.js.map +1 -1
- package/dist/core-generated/runtime-public-rpc-auth-posture.d.ts.map +1 -1
- package/dist/core-generated/runtime-public-rpc-auth-posture.js +12 -0
- package/dist/core-generated/runtime-public-rpc-auth-posture.js.map +1 -1
- package/dist/core-generated/runtime-public-wire-codecs.d.ts +14 -2
- package/dist/core-generated/runtime-public-wire-codecs.d.ts.map +1 -1
- package/dist/core-generated/runtime-public-wire-codecs.js +14 -2
- package/dist/core-generated/runtime-public-wire-codecs.js.map +1 -1
- package/dist/core-generated/runtime-rpc-auth-posture.d.ts.map +1 -1
- package/dist/core-generated/runtime-rpc-auth-posture.js +12 -0
- package/dist/core-generated/runtime-rpc-auth-posture.js.map +1 -1
- package/dist/core-generated/runtime-typed-client.d.ts +17 -5
- package/dist/core-generated/runtime-typed-client.d.ts.map +1 -1
- package/dist/core-generated/runtime-typed-client.js +121 -1
- package/dist/core-generated/runtime-typed-client.js.map +1 -1
- package/dist/core-generated/runtime-wire-codecs.d.ts +14 -2
- package/dist/core-generated/runtime-wire-codecs.d.ts.map +1 -1
- package/dist/core-generated/runtime-wire-codecs.js +14 -2
- package/dist/core-generated/runtime-wire-codecs.js.map +1 -1
- package/dist/realm/index.d.ts +1 -1
- package/dist/realm/index.d.ts.map +1 -1
- package/dist/realm/index.js +1 -1
- package/dist/realm/index.js.map +1 -1
- package/dist/runtime/desktop-first-party-runtime.d.ts +1 -1
- package/dist/runtime/desktop-first-party-runtime.d.ts.map +1 -1
- package/dist/runtime/desktop-first-party-runtime.js +8 -0
- package/dist/runtime/desktop-first-party-runtime.js.map +1 -1
- package/dist/runtime/first-party-protected-runtime-profiles.generated.d.ts +67 -3
- package/dist/runtime/first-party-protected-runtime-profiles.generated.d.ts.map +1 -1
- package/dist/runtime/first-party-protected-runtime-profiles.generated.js +19 -3
- package/dist/runtime/first-party-protected-runtime-profiles.generated.js.map +1 -1
- package/dist/runtime/wire-types/ai-scenario-enums.d.ts +12 -1
- package/dist/runtime/wire-types/ai-scenario-enums.d.ts.map +1 -1
- package/dist/runtime/wire-types/ai-scenario-enums.js +13 -0
- package/dist/runtime/wire-types/ai-scenario-enums.js.map +1 -1
- package/dist/runtime/wire-types/ai-scenario-types.d.ts +2 -2
- package/dist/runtime/wire-types/ai-scenario-types.d.ts.map +1 -1
- package/dist/runtime/wire-types/identity-app-enums.d.ts +2 -1
- package/dist/runtime/wire-types/identity-app-enums.d.ts.map +1 -1
- package/dist/runtime/wire-types/identity-app-enums.js +1 -0
- package/dist/runtime/wire-types/identity-app-enums.js.map +1 -1
- package/dist/runtime/wire-types/identity-app-types.d.ts +2 -2
- package/dist/runtime/wire-types/identity-app-types.d.ts.map +1 -1
- package/dist/runtime/wire-types/reason-code-enums.d.ts +10 -1
- package/dist/runtime/wire-types/reason-code-enums.d.ts.map +1 -1
- package/dist/runtime/wire-types/reason-code-enums.js +9 -0
- package/dist/runtime/wire-types/reason-code-enums.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { base64decode, base64encode } from '@protobuf-ts/runtime';
|
|
2
|
+
import { asRecord, assertExactKeys, assertExactProjectionKeys, localAppError, localAppProjectionError } from './local-app-runtime-platform-validation.js';
|
|
3
|
+
const FRAME_BYTES = 1280 * 720 * 3;
|
|
4
|
+
function encodeFrame(frame) {
|
|
5
|
+
const native = frame.toBase64;
|
|
6
|
+
return native ? native.call(frame) : base64encode(frame);
|
|
7
|
+
}
|
|
8
|
+
function decodeFrame(value) {
|
|
9
|
+
const native = Uint8Array.fromBase64;
|
|
10
|
+
return native ? native(value) : base64decode(value);
|
|
11
|
+
}
|
|
12
|
+
function invalid(field) { return localAppError(`Video Session input is invalid: ${field}.`, 'SDK_LOCAL_APP_INPUT_INVALID', 'provide_exact_video_session_input'); }
|
|
13
|
+
function decimal(value, zero = false) {
|
|
14
|
+
if (typeof value !== 'string' || !(zero ? /^(0|[1-9][0-9]{0,19})$/u : /^[1-9][0-9]{0,19}$/u).test(value) || BigInt(value) > 18446744073709551615n)
|
|
15
|
+
invalid('unsigned integer');
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
function identifier(value) { if (typeof value !== 'string' || !value || value.length > 128 || value.trim() !== value || /[\u0000-\u001f\u007f]/u.test(value))
|
|
19
|
+
invalid('identifier'); return value; }
|
|
20
|
+
function scope(input) { return { videoSessionId: identifier(input.videoSessionId), generation: decimal(input.generation) }; }
|
|
21
|
+
function format(value) {
|
|
22
|
+
const record = asRecord(value);
|
|
23
|
+
assertExactKeys(record, ['width', 'height', 'pixelFormat'], 'video format');
|
|
24
|
+
if (record.width !== 1280 || record.height !== 720 || record.pixelFormat !== 'rgb8')
|
|
25
|
+
invalid('format');
|
|
26
|
+
return Object.freeze({ width: 1280, height: 720, pixelFormat: 'rgb8' });
|
|
27
|
+
}
|
|
28
|
+
// @nimi-authority: rule.nimi.sdks.feature-clients.face-swap-video-session
|
|
29
|
+
export function createNimiVideoSessionClient(shell) {
|
|
30
|
+
const states = new Map();
|
|
31
|
+
const stateFor = (value) => {
|
|
32
|
+
const key = `${value.videoSessionId}:${value.generation}`;
|
|
33
|
+
let state = states.get(key);
|
|
34
|
+
if (!state) {
|
|
35
|
+
state = { pending: 0, reading: false, closed: false, waits: new Set() };
|
|
36
|
+
states.set(key, state);
|
|
37
|
+
}
|
|
38
|
+
return state;
|
|
39
|
+
};
|
|
40
|
+
const unavailable = () => localAppError('Video Session is closed or its transport was lost.', 'SDK_LOCAL_APP_OPERATION_UNAVAILABLE', 'open_a_new_video_session');
|
|
41
|
+
const overloaded = () => localAppError('Video Session has reached its unfinished-call bound.', 'AI_VIDEO_SESSION_OVERLOADED', 'wait_for_video_session_capacity');
|
|
42
|
+
const stop = (state) => {
|
|
43
|
+
state.closed = true;
|
|
44
|
+
for (const finish of state.waits)
|
|
45
|
+
finish();
|
|
46
|
+
state.waits.clear();
|
|
47
|
+
};
|
|
48
|
+
const whileOpen = async (state, operation) => {
|
|
49
|
+
let finish;
|
|
50
|
+
const ended = new Promise(resolve => { finish = resolve; });
|
|
51
|
+
state.waits.add(finish);
|
|
52
|
+
try {
|
|
53
|
+
return await Promise.race([operation(), ended.then(unavailable)]);
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
state.waits.delete(finish);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return Object.freeze({
|
|
60
|
+
open: async (input) => {
|
|
61
|
+
assertExactKeys(input, ['referenceImageArtifactId', 'format'], 'video Session open');
|
|
62
|
+
const requested = format(input.format);
|
|
63
|
+
const value = asRecord(await shell.open({ referenceImageArtifactId: identifier(input.referenceImageArtifactId), ...requested }));
|
|
64
|
+
assertExactProjectionKeys(value, ['videoSessionId', 'generation', 'format', 'maximumInFlightSubmissions'], 'video Session open');
|
|
65
|
+
if (value.maximumInFlightSubmissions !== 2)
|
|
66
|
+
localAppProjectionError('video Session submission bound');
|
|
67
|
+
const selected = scope(value);
|
|
68
|
+
stateFor(selected);
|
|
69
|
+
return Object.freeze({ ...selected, format: format(value.format), maximumInFlightSubmissions: 2 });
|
|
70
|
+
},
|
|
71
|
+
submitFrame: async (input) => {
|
|
72
|
+
assertExactKeys(input, ['videoSessionId', 'generation', 'sequence', 'timestampUs', 'frame'], 'video frame');
|
|
73
|
+
const selected = scope(input), sequence = decimal(input.sequence), timestampUs = decimal(input.timestampUs, true);
|
|
74
|
+
if (!(input.frame instanceof Uint8Array) || input.frame.byteLength !== FRAME_BYTES)
|
|
75
|
+
invalid('frame size');
|
|
76
|
+
const state = stateFor(selected);
|
|
77
|
+
if (state.closed)
|
|
78
|
+
return unavailable();
|
|
79
|
+
if (state.pending >= 2)
|
|
80
|
+
return overloaded();
|
|
81
|
+
state.pending++;
|
|
82
|
+
try {
|
|
83
|
+
const response = asRecord(await whileOpen(state, () => shell.submitFrame({ ...selected, sequence, timestampUs, frameBase64: encodeFrame(input.frame) })));
|
|
84
|
+
assertExactProjectionKeys(response, ['accepted', 'sequence'], 'video frame receipt');
|
|
85
|
+
if (response.accepted !== true || response.sequence !== sequence)
|
|
86
|
+
localAppProjectionError('video frame receipt');
|
|
87
|
+
return Object.freeze({ accepted: true, sequence });
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
const reason = String(error?.reasonCode ?? '').toLowerCase().replaceAll('_', '-');
|
|
91
|
+
if (!['ai-input-invalid', 'ai-media-option-unsupported', 'ai-video-session-generation-invalid', 'protocol-envelope-invalid'].includes(reason))
|
|
92
|
+
stop(state);
|
|
93
|
+
throw error;
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
state.pending--;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
read: async (input) => {
|
|
100
|
+
assertExactKeys(input, ['videoSessionId', 'generation'], 'video result read');
|
|
101
|
+
const selected = scope(input), state = stateFor(selected);
|
|
102
|
+
if (state.closed)
|
|
103
|
+
return unavailable();
|
|
104
|
+
if (state.reading)
|
|
105
|
+
return overloaded();
|
|
106
|
+
state.reading = true;
|
|
107
|
+
try {
|
|
108
|
+
const response = asRecord(await whileOpen(state, () => shell.read(selected)));
|
|
109
|
+
assertExactProjectionKeys(response, ['result'], 'video result response');
|
|
110
|
+
if (response.result === null)
|
|
111
|
+
return null;
|
|
112
|
+
const record = asRecord(response.result);
|
|
113
|
+
const terminal = record?.type === 'session-terminal';
|
|
114
|
+
const transformed = record?.type === 'transformed';
|
|
115
|
+
assertExactProjectionKeys(record, ['videoSessionId', 'generation', 'type', ...(terminal ? [] : ['sequence', 'timestampUs']), ...(transformed ? ['frameBase64'] : ['reasonCode'])], 'video result');
|
|
116
|
+
if (record.videoSessionId !== selected.videoSessionId || record.generation !== selected.generation)
|
|
117
|
+
localAppProjectionError('video result scope');
|
|
118
|
+
if (terminal) {
|
|
119
|
+
stop(state);
|
|
120
|
+
return Object.freeze({ ...selected, type: 'session-terminal', reasonCode: identifier(record.reasonCode) });
|
|
121
|
+
}
|
|
122
|
+
const sequence = decimal(record.sequence), timestampUs = decimal(record.timestampUs, true);
|
|
123
|
+
if (transformed) {
|
|
124
|
+
if (typeof record.frameBase64 !== 'string' || record.frameBase64.length !== FRAME_BYTES / 3 * 4)
|
|
125
|
+
localAppProjectionError('video frame bytes');
|
|
126
|
+
const frame = decodeFrame(record.frameBase64);
|
|
127
|
+
if (frame.byteLength !== FRAME_BYTES)
|
|
128
|
+
localAppProjectionError('video frame bytes');
|
|
129
|
+
return Object.freeze({ ...selected, type: 'transformed', sequence, timestampUs, frame });
|
|
130
|
+
}
|
|
131
|
+
if (!['no-target-face', 'input-dropped', 'input-rejected'].includes(String(record.type)))
|
|
132
|
+
localAppProjectionError('video result variant');
|
|
133
|
+
return Object.freeze({ ...selected, type: record.type, sequence, timestampUs, reasonCode: identifier(record.reasonCode) });
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
stop(state);
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
139
|
+
finally {
|
|
140
|
+
state.reading = false;
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
close: async (input) => {
|
|
144
|
+
assertExactKeys(input, ['videoSessionId', 'generation'], 'video Session close');
|
|
145
|
+
const selected = scope(input), state = stateFor(selected);
|
|
146
|
+
stop(state);
|
|
147
|
+
const response = asRecord(await shell.close(selected));
|
|
148
|
+
assertExactProjectionKeys(response, ['closed'], 'video Session close');
|
|
149
|
+
if (response.closed !== true)
|
|
150
|
+
localAppProjectionError('video Session close');
|
|
151
|
+
return Object.freeze({ closed: true });
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=local-app-runtime-platform-video.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-app-runtime-platform-video.js","sourceRoot":"","sources":["../../../core/app/local-app-runtime-platform-video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,yBAAyB,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAwB1J,MAAM,WAAW,GAAG,IAAI,GAAG,GAAG,GAAG,CAAC,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C;gBAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAAC,MAAM,KAAK,CAAC;YAAC,CAAC;oBACrC,CAAC;gBAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;YAAC,CAAC;QACpC,CAAC;QACD,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACrB,eAAe,CAAC,KAAK,EAAE,CAAC,gBAAgB,EAAE,YAAY,CAAC,EAAE,qBAAqB,CAAC,CAAC;YAChF,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAC1D,IAAI,CAAC,KAAK,CAAC,CAAC;YACZ,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;YACvD,yBAAyB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAC,CAAC;YACvE,IAAI,QAAQ,CAAC,MAAM,KAAK,IAAI;gBAAE,uBAAuB,CAAC,qBAAqB,CAAC,CAAC;YAC7E,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAa,EAAE,CAAC,CAAC;QAClD,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { RealmModel } from '../../realm/generated.js';
|
|
2
|
+
export type NimiLocalAppWorldCharacterListInput = {
|
|
3
|
+
readonly visibility?: 'private' | 'unlisted' | 'public' | 'system';
|
|
4
|
+
readonly afterId?: string;
|
|
5
|
+
readonly take?: number;
|
|
6
|
+
};
|
|
7
|
+
export type NimiLocalAppWorldEntityListInput = {
|
|
8
|
+
readonly kind?: string;
|
|
9
|
+
readonly afterId?: string;
|
|
10
|
+
readonly take?: number;
|
|
11
|
+
};
|
|
12
|
+
export type NimiLocalAppWorldRelationshipListInput = {
|
|
13
|
+
readonly entityId?: string;
|
|
14
|
+
readonly sourceEntityId?: string;
|
|
15
|
+
readonly targetEntityId?: string;
|
|
16
|
+
readonly type?: string;
|
|
17
|
+
readonly afterId?: string;
|
|
18
|
+
readonly take?: number;
|
|
19
|
+
};
|
|
20
|
+
export type NimiLocalAppWorldCreatorShell = {
|
|
21
|
+
readonly getCreationEligibility: () => Promise<unknown>;
|
|
22
|
+
readonly get: (worldId: string) => Promise<unknown>;
|
|
23
|
+
readonly replace: (worldId: string, input: unknown) => Promise<unknown>;
|
|
24
|
+
readonly listCharacters: (worldId: string, input?: NimiLocalAppWorldCharacterListInput) => Promise<unknown>;
|
|
25
|
+
readonly getCharacter: (characterId: string) => Promise<unknown>;
|
|
26
|
+
readonly createCharacter: (worldId: string, input: unknown) => Promise<unknown>;
|
|
27
|
+
readonly replaceCharacter: (characterId: string, input: unknown) => Promise<unknown>;
|
|
28
|
+
readonly listEntities: (worldId: string, input?: NimiLocalAppWorldEntityListInput) => Promise<unknown>;
|
|
29
|
+
readonly getEntity: (entityId: string) => Promise<unknown>;
|
|
30
|
+
readonly createEntity: (worldId: string, input: unknown) => Promise<unknown>;
|
|
31
|
+
readonly listRelationships: (worldId: string, input?: NimiLocalAppWorldRelationshipListInput) => Promise<unknown>;
|
|
32
|
+
readonly getRelationship: (relationshipId: string) => Promise<unknown>;
|
|
33
|
+
};
|
|
34
|
+
export type NimiLocalAppWorldCreatorClient = {
|
|
35
|
+
readonly getCreationEligibility: () => Promise<RealmModel<'WorldCreationEligibilityDto'>>;
|
|
36
|
+
readonly get: (worldId: string) => Promise<RealmModel<'WorldCoreDto'>>;
|
|
37
|
+
readonly replace: (worldId: string, input: RealmModel<'ReplaceWorldCoreDto'>) => Promise<RealmModel<'WorldCoreDto'>>;
|
|
38
|
+
readonly listCharacters: (worldId: string, input?: NimiLocalAppWorldCharacterListInput) => Promise<readonly RealmModel<'WorldCharacterCoreDto'>[]>;
|
|
39
|
+
readonly getCharacter: (characterId: string) => Promise<RealmModel<'WorldCharacterCoreDto'>>;
|
|
40
|
+
readonly createCharacter: (worldId: string, input: RealmModel<'CreateWorldCharacterCoreDto'>) => Promise<RealmModel<'WorldCharacterCoreDto'>>;
|
|
41
|
+
readonly replaceCharacter: (characterId: string, input: RealmModel<'ReplaceWorldCharacterCoreDto'>) => Promise<RealmModel<'WorldCharacterCoreDto'>>;
|
|
42
|
+
readonly listEntities: (worldId: string, input?: NimiLocalAppWorldEntityListInput) => Promise<readonly RealmModel<'WorldEntityCoreDto'>[]>;
|
|
43
|
+
readonly getEntity: (entityId: string) => Promise<RealmModel<'WorldEntityCoreDto'>>;
|
|
44
|
+
readonly createEntity: (worldId: string, input: RealmModel<'CreateWorldEntityCoreDto'>) => Promise<RealmModel<'WorldEntityCoreDto'>>;
|
|
45
|
+
readonly listRelationships: (worldId: string, input?: NimiLocalAppWorldRelationshipListInput) => Promise<readonly RealmModel<'WorldRelationshipCoreDto'>[]>;
|
|
46
|
+
readonly getRelationship: (relationshipId: string) => Promise<RealmModel<'WorldRelationshipCoreDto'>>;
|
|
47
|
+
};
|
|
48
|
+
export declare function createNimiLocalAppWorldCreatorClient(shell: NimiLocalAppWorldCreatorShell): NimiLocalAppWorldCreatorClient;
|
|
49
|
+
export declare function assertSafeWorldCreatorProjection(record: Record<string, unknown>): void;
|
|
50
|
+
//# sourceMappingURL=local-app-runtime-platform-world-creator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-app-runtime-platform-world-creator.d.ts","sourceRoot":"","sources":["../../../core/app/local-app-runtime-platform-world-creator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,MAAM,MAAM,mCAAmC,GAAG;IAChD,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACnE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,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CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAUtF"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { asRecord, assertExactKeys, assertSafeProjection, localAppError, localAppProjectionError } from './local-app-runtime-platform-validation.js';
|
|
2
|
+
// @nimi-authority: rule.nimi.platform.core-protocol.world-creator-app-operations
|
|
3
|
+
export function createNimiLocalAppWorldCreatorClient(shell) {
|
|
4
|
+
return Object.freeze({
|
|
5
|
+
getCreationEligibility: async () => {
|
|
6
|
+
const value = closedRecord(await shell.getCreationEligibility(), ['canCreateWorld'], ['canCreateWorld'], 'world creation eligibility', true);
|
|
7
|
+
if (typeof value.canCreateWorld !== 'boolean')
|
|
8
|
+
localAppProjectionError('world creation eligibility');
|
|
9
|
+
return Object.freeze({ canCreateWorld: value.canCreateWorld });
|
|
10
|
+
},
|
|
11
|
+
get: async (worldId) => {
|
|
12
|
+
creatorId(worldId, 'worldId');
|
|
13
|
+
const value = await shell.get(worldId);
|
|
14
|
+
const record = creatorResult(value, 'world', worldId, undefined);
|
|
15
|
+
return record;
|
|
16
|
+
},
|
|
17
|
+
replace: async (worldId, input) => {
|
|
18
|
+
creatorId(worldId, 'worldId');
|
|
19
|
+
validateCreatorWrite(input, 'world', true, worldId);
|
|
20
|
+
const value = await shell.replace(worldId, input);
|
|
21
|
+
const record = creatorResult(value, 'world', worldId, undefined);
|
|
22
|
+
assertCreatorWriteResult(record, input, 'world');
|
|
23
|
+
return record;
|
|
24
|
+
},
|
|
25
|
+
listCharacters: async (worldId, input = {}) => {
|
|
26
|
+
creatorId(worldId, 'worldId');
|
|
27
|
+
const query = creatorQuery(input, ['visibility', 'afterId', 'take']);
|
|
28
|
+
const value = await shell.listCharacters(worldId, query);
|
|
29
|
+
if (!Array.isArray(value) || value.length > 500)
|
|
30
|
+
localAppProjectionError('WorldCharacterCoreDto list');
|
|
31
|
+
return Object.freeze(value.map(item => creatorResult(item, 'character', undefined, worldId)));
|
|
32
|
+
},
|
|
33
|
+
getCharacter: async (characterId) => {
|
|
34
|
+
creatorId(characterId, 'characterId');
|
|
35
|
+
const value = await shell.getCharacter(characterId);
|
|
36
|
+
const record = creatorResult(value, 'character', characterId, undefined);
|
|
37
|
+
return record;
|
|
38
|
+
},
|
|
39
|
+
createCharacter: async (worldId, input) => {
|
|
40
|
+
creatorId(worldId, 'worldId');
|
|
41
|
+
validateCreatorWrite(input, 'character', false, undefined);
|
|
42
|
+
if (input.worldEntityRef.worldId !== worldId)
|
|
43
|
+
invalidInput('worldEntityRef.worldId');
|
|
44
|
+
const value = await shell.createCharacter(worldId, input);
|
|
45
|
+
const record = creatorResult(value, 'character', input.id, worldId);
|
|
46
|
+
assertCreatorWriteResult(record, input, 'character');
|
|
47
|
+
return record;
|
|
48
|
+
},
|
|
49
|
+
replaceCharacter: async (characterId, input) => {
|
|
50
|
+
creatorId(characterId, 'characterId');
|
|
51
|
+
validateCreatorWrite(input, 'character', true, characterId);
|
|
52
|
+
const value = await shell.replaceCharacter(characterId, input);
|
|
53
|
+
const record = creatorResult(value, 'character', characterId, undefined);
|
|
54
|
+
assertCreatorWriteResult(record, input, 'character');
|
|
55
|
+
return record;
|
|
56
|
+
},
|
|
57
|
+
listEntities: async (worldId, input = {}) => {
|
|
58
|
+
creatorId(worldId, 'worldId');
|
|
59
|
+
const query = creatorQuery(input, ['kind', 'afterId', 'take']);
|
|
60
|
+
const value = await shell.listEntities(worldId, query);
|
|
61
|
+
if (!Array.isArray(value) || value.length > 500)
|
|
62
|
+
localAppProjectionError('WorldEntityCoreDto list');
|
|
63
|
+
return Object.freeze(value.map(item => creatorResult(item, 'entity', undefined, worldId)));
|
|
64
|
+
},
|
|
65
|
+
getEntity: async (entityId) => {
|
|
66
|
+
creatorId(entityId, 'entityId');
|
|
67
|
+
const value = await shell.getEntity(entityId);
|
|
68
|
+
const record = creatorResult(value, 'entity', entityId, undefined);
|
|
69
|
+
return record;
|
|
70
|
+
},
|
|
71
|
+
createEntity: async (worldId, input) => {
|
|
72
|
+
creatorId(worldId, 'worldId');
|
|
73
|
+
validateCreatorWrite(input, 'entity', false, undefined);
|
|
74
|
+
const value = await shell.createEntity(worldId, input);
|
|
75
|
+
const record = creatorResult(value, 'entity', input.id, worldId);
|
|
76
|
+
assertCreatorWriteResult(record, input, 'entity');
|
|
77
|
+
return record;
|
|
78
|
+
},
|
|
79
|
+
listRelationships: async (worldId, input = {}) => {
|
|
80
|
+
creatorId(worldId, 'worldId');
|
|
81
|
+
const query = creatorQuery(input, ['entityId', 'sourceEntityId', 'targetEntityId', 'type', 'afterId', 'take']);
|
|
82
|
+
const value = await shell.listRelationships(worldId, query);
|
|
83
|
+
if (!Array.isArray(value) || value.length > 500)
|
|
84
|
+
localAppProjectionError('WorldRelationshipCoreDto list');
|
|
85
|
+
return Object.freeze(value.map(item => creatorResult(item, 'relationship', undefined, worldId)));
|
|
86
|
+
},
|
|
87
|
+
getRelationship: async (relationshipId) => {
|
|
88
|
+
creatorId(relationshipId, 'relationshipId');
|
|
89
|
+
const value = await shell.getRelationship(relationshipId);
|
|
90
|
+
const record = creatorResult(value, 'relationship', relationshipId, undefined);
|
|
91
|
+
return record;
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function invalidInput(field) {
|
|
96
|
+
return localAppError(`World creator input is invalid: ${field}.`, 'SDK_LOCAL_APP_INPUT_INVALID', 'provide_typed_world_creator_input');
|
|
97
|
+
}
|
|
98
|
+
function creatorId(value, field) {
|
|
99
|
+
if (typeof value !== 'string' || !value || value.trim() !== value || value.length > 512 || value.includes('\0'))
|
|
100
|
+
invalidInput(field);
|
|
101
|
+
}
|
|
102
|
+
function creatorQuery(input, keys) {
|
|
103
|
+
assertExactKeys(input, keys, 'world creator list');
|
|
104
|
+
const result = {};
|
|
105
|
+
for (const [key, value] of Object.entries(input)) {
|
|
106
|
+
if (value === undefined)
|
|
107
|
+
continue;
|
|
108
|
+
if (key === 'take') {
|
|
109
|
+
if (typeof value !== 'number' || !Number.isSafeInteger(value) || value < 1 || value > 500)
|
|
110
|
+
invalidInput(key);
|
|
111
|
+
result[key] = value;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
creatorId(value, key);
|
|
115
|
+
if (key === 'visibility' && !['private', 'unlisted', 'public', 'system'].includes(value))
|
|
116
|
+
invalidInput(key);
|
|
117
|
+
result[key] = value;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
function creatorJSON(value, output = false) {
|
|
123
|
+
const fail = () => output ? localAppProjectionError('world creator JSON') : invalidInput('JSON');
|
|
124
|
+
let text;
|
|
125
|
+
try {
|
|
126
|
+
text = JSON.stringify(value);
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return fail();
|
|
130
|
+
}
|
|
131
|
+
if (!text || new TextEncoder().encode(text).length > (output ? 1048576 : 2097152))
|
|
132
|
+
fail();
|
|
133
|
+
}
|
|
134
|
+
function closedRecord(value, allowed, required, field, output = false) {
|
|
135
|
+
const record = asRecord(value);
|
|
136
|
+
if (!record || Object.keys(record).some(key => !allowed.includes(key)) || required.some(key => record[key] === undefined)) {
|
|
137
|
+
return output ? localAppProjectionError(field) : invalidInput(field);
|
|
138
|
+
}
|
|
139
|
+
return record;
|
|
140
|
+
}
|
|
141
|
+
function entityRef(value, output = false) {
|
|
142
|
+
const ref = closedRecord(value, ['kind', 'worldId', 'entityId'], ['kind', 'worldId', 'entityId'], 'worldEntityRef', output);
|
|
143
|
+
if (ref.kind !== 'worldEntity' || typeof ref.worldId !== 'string' || !ref.worldId || typeof ref.entityId !== 'string' || !ref.entityId) {
|
|
144
|
+
return output ? localAppProjectionError('worldEntityRef') : invalidInput('worldEntityRef');
|
|
145
|
+
}
|
|
146
|
+
return ref;
|
|
147
|
+
}
|
|
148
|
+
function validateCreatorWrite(value, family, replace, id) {
|
|
149
|
+
const required = family === 'world' ? ['core', 'lorebookDeclaration', 'origin'] : family === 'character' ? ['profile', 'worldEntityRef', 'lorebookDeclaration', 'origin'] : ['core', 'kind', 'origin'];
|
|
150
|
+
const allowed = [...required, 'id', ...(family === 'entity' ? [] : ['visibility']), ...(replace ? ['baseContentHash'] : [])];
|
|
151
|
+
const record = closedRecord(value, allowed, [...required, ...(replace ? ['baseContentHash'] : [])], 'world creator write');
|
|
152
|
+
if (record.id !== undefined) {
|
|
153
|
+
creatorId(record.id, 'id');
|
|
154
|
+
if (replace && record.id !== id)
|
|
155
|
+
invalidInput('immutable id');
|
|
156
|
+
}
|
|
157
|
+
if (replace && (typeof record.baseContentHash !== 'string' || !/^[a-f0-9]{64}$/.test(record.baseContentHash)))
|
|
158
|
+
invalidInput('baseContentHash');
|
|
159
|
+
if (record.visibility !== undefined && !['private', 'unlisted', 'public'].includes(String(record.visibility)))
|
|
160
|
+
invalidInput('visibility');
|
|
161
|
+
const origin = closedRecord(record.origin, ['kind', 'parentCharacterId', 'parentWorldId', 'sourceContentHash', 'sourceId', 'sourceVersion'], ['kind'], 'origin');
|
|
162
|
+
if (!['manual', 'forge', 'worldCharacterDerivation', 'import', 'system'].includes(String(origin.kind)))
|
|
163
|
+
invalidInput('origin.kind');
|
|
164
|
+
if (family === 'character') {
|
|
165
|
+
entityRef(record.worldEntityRef);
|
|
166
|
+
const profile = asRecord(record.profile);
|
|
167
|
+
if (!profile || Object.hasOwn(profile, 'profileHash') || Object.hasOwn(profile, 'profileCoverage'))
|
|
168
|
+
invalidInput('profile');
|
|
169
|
+
}
|
|
170
|
+
else if (!asRecord(record.core))
|
|
171
|
+
invalidInput('core');
|
|
172
|
+
if (family !== 'entity' && !asRecord(record.lorebookDeclaration))
|
|
173
|
+
invalidInput('lorebookDeclaration');
|
|
174
|
+
if (family === 'entity')
|
|
175
|
+
creatorId(record.kind, 'kind');
|
|
176
|
+
creatorJSON(record);
|
|
177
|
+
}
|
|
178
|
+
function creatorResult(value, family, id, worldId) {
|
|
179
|
+
const common = ['id', 'schemaVersion', 'contentRevision', 'contentHash', 'origin', 'createdAt', 'updatedAt'];
|
|
180
|
+
const specific = family === 'world' ? ['core', 'visibility', 'lorebookDeclaration'] : family === 'character' ? ['worldId', 'creatorId', 'worldEntityRef', 'visibility', 'lorebookDeclaration', 'profile', 'validity', 'materializationReadiness', 'sourceHash'] : family === 'entity' ? ['worldId', 'kind', 'core'] : ['worldId', 'sourceEntityId', 'targetEntityId', 'type', 'core'];
|
|
181
|
+
const keys = [...common, ...specific];
|
|
182
|
+
const record = closedRecord(value, family === 'world' ? [...keys, 'creatorId'] : keys, keys, family, true);
|
|
183
|
+
for (const field of ['id', 'schemaVersion', 'contentHash', 'createdAt', 'updatedAt', ...(family === 'world' ? [] : ['worldId'])]) {
|
|
184
|
+
if (typeof record[field] !== 'string' || !record[field].trim())
|
|
185
|
+
localAppProjectionError(`${family}.${field}`);
|
|
186
|
+
}
|
|
187
|
+
if (id !== undefined && record.id !== id)
|
|
188
|
+
localAppProjectionError(`${family} identity mismatch`);
|
|
189
|
+
if (worldId !== undefined && record.worldId !== worldId)
|
|
190
|
+
localAppProjectionError(`${family} parent mismatch`);
|
|
191
|
+
if (!Number.isSafeInteger(record.contentRevision) || Number(record.contentRevision) < 1 || !asRecord(record.origin))
|
|
192
|
+
localAppProjectionError(`${family} metadata`);
|
|
193
|
+
if (family === 'world' || family === 'character') {
|
|
194
|
+
if (!['private', 'unlisted', 'public', 'system'].includes(String(record.visibility)) || (record.lorebookDeclaration !== null && !asRecord(record.lorebookDeclaration)))
|
|
195
|
+
localAppProjectionError(`${family} declaration`);
|
|
196
|
+
}
|
|
197
|
+
if (family === 'character') {
|
|
198
|
+
const ref = entityRef(record.worldEntityRef, true);
|
|
199
|
+
const profile = asRecord(record.profile);
|
|
200
|
+
if (ref.worldId !== record.worldId || record.schemaVersion !== 'realm.world-character-core/v1' || typeof record.creatorId !== 'string' || !record.creatorId || typeof record.sourceHash !== 'string' || !record.sourceHash || !profile || profile.profileSchemaVersion !== 'realm.character-profile-core/v1' || typeof profile.profileHash !== 'string' || !asRecord(profile.profileCoverage) || !asRecord(record.validity) || !asRecord(record.materializationReadiness))
|
|
201
|
+
localAppProjectionError('world character source');
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
const core = asRecord(record.core);
|
|
205
|
+
const requiredCore = family === 'world' ? ['identity', 'presentation', 'ontology', 'timeModel', 'timeline', 'entities', 'relationships', 'systems', 'scenes', 'assets', 'authoring'] : family === 'entity' ? ['identity', 'classification', 'facts', 'assets', 'evidence', 'authoring'] : ['endpoints', 'evidence', 'presentation', 'authoring'];
|
|
206
|
+
if (!core || requiredCore.some(key => core[key] === undefined))
|
|
207
|
+
localAppProjectionError(`${family} core`);
|
|
208
|
+
}
|
|
209
|
+
if (family === 'entity' && (typeof record.kind !== 'string' || !record.kind))
|
|
210
|
+
localAppProjectionError('entity kind');
|
|
211
|
+
if (family === 'relationship') {
|
|
212
|
+
const endpoints = asRecord(asRecord(record.core)?.endpoints);
|
|
213
|
+
for (const key of ['sourceEntityId', 'targetEntityId', 'type'])
|
|
214
|
+
if (typeof record[key] !== 'string' || !record[key] || endpoints?.[key] !== record[key])
|
|
215
|
+
localAppProjectionError('relationship endpoints');
|
|
216
|
+
}
|
|
217
|
+
assertSafeWorldCreatorProjection(record);
|
|
218
|
+
return Object.freeze({ ...record });
|
|
219
|
+
}
|
|
220
|
+
// @nimi-authority: rule.nimi.platform.core-protocol.world-creator-app-operations
|
|
221
|
+
export function assertSafeWorldCreatorProjection(record) {
|
|
222
|
+
creatorJSON(record, true);
|
|
223
|
+
// Canonical source content may contain ordinary keys such as token or generation.
|
|
224
|
+
const { core, profile, ...frame } = record;
|
|
225
|
+
assertSafeProjection(frame);
|
|
226
|
+
if (core !== undefined)
|
|
227
|
+
assertSafeProjection(core, new Set(), true);
|
|
228
|
+
if (profile !== undefined)
|
|
229
|
+
assertSafeProjection(profile, new Set(), true);
|
|
230
|
+
const source = asRecord(profile) ?? asRecord(core);
|
|
231
|
+
const assets = asRecord(source?.assets);
|
|
232
|
+
if (assets?.externalRefs !== undefined)
|
|
233
|
+
assertSafeProjection(assets.externalRefs);
|
|
234
|
+
}
|
|
235
|
+
function assertCreatorWriteResult(record, input, family) {
|
|
236
|
+
const body = asRecord(input);
|
|
237
|
+
if (family !== 'entity' && record.lorebookDeclaration === null)
|
|
238
|
+
localAppProjectionError('world creator write declaration');
|
|
239
|
+
if (family === 'character') {
|
|
240
|
+
const expected = entityRef(body.worldEntityRef);
|
|
241
|
+
const actual = entityRef(record.worldEntityRef, true);
|
|
242
|
+
if (expected.worldId !== actual.worldId || expected.entityId !== actual.entityId)
|
|
243
|
+
localAppProjectionError('world character write binding');
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=local-app-runtime-platform-world-creator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-app-runtime-platform-world-creator.js","sourceRoot":"","sources":["../../../core/app/local-app-runtime-platform-world-creator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,oBAAoB,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAqDrJ,iFAAiF;AACjF,MAAM,UAAU,oCAAoC,CAAC,KAAoC;IACvF,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,sBAAsB,EAAE,KAAK,IAAwD,EAAE;YACrF,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,KAAK,CAAC,sBAAsB,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,4BAA4B,EAAE,IAAI,CAAC,CAAC;YAC7I,IAAI,OAAO,KAAK,CAAC,cAAc,KAAK,SAAS;gBAAE,uBAAuB,CAAC,4BAA4B,CAAC,CAAC;YACrG,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,GAAG,EAAE,KAAK,EAAE,OAAe,EAAuC,E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MAAM,CAAC,OAAO,IAAI,QAAQ,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ;YAAE,uBAAuB,CAAC,+BAA+B,CAAC,CAAC;IAC7I,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { type NimiLocalAppWorldCreatorShell, type NimiLocalAppWorldCreatorClient } from './local-app-runtime-platform-world-creator.js';
|
|
1
2
|
import type { JsonValue } from '../../types/index.js';
|
|
3
|
+
export type { NimiLocalAppTextTurnInput, NimiLocalAppTextMessage, NimiLocalAppTextTurnItem, NimiLocalAppTextOutputItem, NimiLocalAppFunctionTool, NimiLocalAppToolCall } from './local-app-text.js';
|
|
4
|
+
import { type NimiVideoSessionClient, type NimiVideoSessionShell } from './local-app-runtime-platform-video.js';
|
|
5
|
+
export type { NimiVideoSessionClient, NimiVideoSessionFormat, NimiVideoSessionOpened, NimiVideoSessionResult, NimiVideoSessionScope, NimiVideoSessionShell } from './local-app-runtime-platform-video.js';
|
|
2
6
|
import type { RealmModel } from '../../realm/generated.js';
|
|
3
7
|
import { type NimiLocalAppAIConfigClient, type NimiLocalAppAIConfigShell } from './local-app-runtime-platform-ai-config.js';
|
|
4
8
|
import { type NimiLocalAppAIConsumptionClient, type NimiLocalAppAIConsumptionShell } from './local-app-runtime-platform-ai.js';
|
|
@@ -28,7 +32,7 @@ export type { NimiAgentRealtimeRuntime, } from './local-app-runtime-platform-dir
|
|
|
28
32
|
export type { NimiAiRealtimeRuntime, } from './local-app-runtime-platform-direct-ai-realtime.js';
|
|
29
33
|
export type { NimiRealmRealtimeRuntime, } from './local-app-runtime-platform-direct-realm-realtime.js';
|
|
30
34
|
export { projectNimiLocalAppPersonaCharacter, projectNimiLocalAppPersonaCharacterDeleteResult, projectNimiLocalAppPersonaCharacterList, toNimiLocalAppPersonaCharacterProfileInput, validateNimiLocalAppPersonaCharacterWriteInput, } from './local-app-runtime-platform-persona-character.js';
|
|
31
|
-
export type { NimiLocalAppAIConsumptionClient, NimiLocalAppAIConsumptionShell,
|
|
35
|
+
export type { NimiLocalAppAIConsumptionClient, NimiLocalAppAIConsumptionShell, NimiLocalAppArtifactUploadMime, NimiLocalAppVideoFaceSwapSummary, NimiLocalAppArtifactUploadResult, NimiLocalAppImageGenerateSpec, NimiLocalAppScenarioArtifact, NimiLocalAppScenarioExecuteResult, NimiLocalAppScenarioExecuteSpec, NimiLocalAppScenarioJob, NimiLocalAppScenarioJobEvent, NimiLocalAppScenarioJobSpec, NimiLocalAppScenarioJobSubmitOptions, NimiLocalAppScenarioJobSubmitResult, NimiLocalAppScenarioJobGetResult, NimiLocalAppExecutionInterruption, NimiLocalAppVisionLocateResult, NimiLocalAppVisionLocation, NimiLocalAppScenarioTimestamp, NimiLocalAppSubscription, NimiLocalAppTextTurnEvent, NimiLocalAppVideoContent, NimiLocalAppVideoContentRole, NimiLocalAppVoiceAsset, } from './local-app-runtime-platform-ai.js';
|
|
32
36
|
export type { NimiLocalAppAgentReference, NimiLocalAppAgentReferencesClient, NimiLocalAppAgentReferencesRuntime, NimiLocalAppAgentReferencesShell, } from './local-app-runtime-platform-agent-references.js';
|
|
33
37
|
export { createNimiLocalAppEmbodimentClient, createNimiLocalAppEmbodimentRuntimeClient, } from './local-app-runtime-platform-embodiment.js';
|
|
34
38
|
export type { NimiLocalAppEmbodimentActivity, NimiLocalAppEmbodimentClient, NimiLocalAppEmbodimentRuntime, NimiLocalAppEmbodimentEmotion, NimiLocalAppEmbodimentEvent, NimiLocalAppEmbodimentPosture, NimiLocalAppEmbodimentScopeInput, NimiLocalAppEmbodimentShell, NimiLocalAppEmbodimentShellSubscription, NimiLocalAppEmbodimentSnapshot, NimiLocalAppEmbodimentSubscribeInput, NimiLocalAppEmbodimentSubscription, NimiLocalAppEmbodimentVoiceTiming, } from './local-app-runtime-platform-embodiment.js';
|
|
@@ -76,13 +80,6 @@ export type NimiLocalAppTextCandidateInput = {
|
|
|
76
80
|
readonly topP?: number;
|
|
77
81
|
readonly maxTokens?: number;
|
|
78
82
|
};
|
|
79
|
-
export type NimiLocalAppTextTurnInput = NimiLocalAppTextCandidateInput & {
|
|
80
|
-
readonly topK?: number;
|
|
81
|
-
readonly presencePenalty?: number;
|
|
82
|
-
readonly frequencyPenalty?: number;
|
|
83
|
-
readonly stop?: readonly string[];
|
|
84
|
-
readonly seed?: number;
|
|
85
|
-
};
|
|
86
83
|
export type NimiLocalAppTextCandidateResult = {
|
|
87
84
|
readonly text: string;
|
|
88
85
|
readonly finishReason: 'stop' | 'length' | 'content-filter';
|
|
@@ -107,6 +104,7 @@ export type NimiLocalAppStandardShell = {
|
|
|
107
104
|
readonly artifacts: NimiLocalAppAIConsumptionShell['artifacts'];
|
|
108
105
|
readonly voiceAssets: NimiLocalAppAIConsumptionShell['voiceAssets'];
|
|
109
106
|
readonly realtime: NimiAiRealtimeShell;
|
|
107
|
+
readonly videoSessions: NimiVideoSessionShell;
|
|
110
108
|
};
|
|
111
109
|
readonly aiConfig: NimiLocalAppAIConfigShell;
|
|
112
110
|
readonly storage: {
|
|
@@ -120,7 +118,7 @@ export type NimiLocalAppStandardShell = {
|
|
|
120
118
|
readonly worldCore: {
|
|
121
119
|
readonly list: (input?: NimiLocalAppWorldCoreListInput) => Promise<unknown>;
|
|
122
120
|
readonly create: (input: unknown) => Promise<unknown>;
|
|
123
|
-
};
|
|
121
|
+
} & NimiLocalAppWorldCreatorShell;
|
|
124
122
|
readonly personaCharacter: NimiLocalAppPersonaCharacterShell;
|
|
125
123
|
readonly realtime: NimiRealmRealtimeShell;
|
|
126
124
|
};
|
|
@@ -150,6 +148,7 @@ export type NimiLocalAppClient = {
|
|
|
150
148
|
readonly artifacts: NimiLocalAppAIConsumptionClient['artifacts'];
|
|
151
149
|
readonly voiceAssets: NimiLocalAppAIConsumptionClient['voiceAssets'];
|
|
152
150
|
readonly realtime: NimiAiRealtimeClient;
|
|
151
|
+
readonly videoSessions: NimiVideoSessionClient;
|
|
153
152
|
};
|
|
154
153
|
readonly aiConfig: NimiLocalAppAIConfigClient;
|
|
155
154
|
readonly storage: {
|
|
@@ -163,7 +162,7 @@ export type NimiLocalAppClient = {
|
|
|
163
162
|
readonly worldCore: {
|
|
164
163
|
readonly list: (input?: NimiLocalAppWorldCoreListInput) => Promise<readonly RealmModel<'WorldCoreDto'>[]>;
|
|
165
164
|
readonly create: (input: RealmModel<'CreateWorldCoreDto'>) => Promise<RealmModel<'WorldCoreDto'>>;
|
|
166
|
-
};
|
|
165
|
+
} & NimiLocalAppWorldCreatorClient;
|
|
167
166
|
readonly personaCharacter: NimiLocalAppPersonaCharacterClient;
|
|
168
167
|
readonly realtime: NimiRealmRealtimeClient;
|
|
169
168
|
};
|