@tidblink/server 0.0.0-stage → 0.3.0-rc.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/LICENSE +201 -0
- package/README.md +993 -2
- package/dist/audio.d.ts +63 -0
- package/dist/audio.d.ts.map +1 -0
- package/dist/audio.js +163 -0
- package/dist/audio.js.map +1 -0
- package/dist/client-tools.d.ts +46 -0
- package/dist/client-tools.d.ts.map +1 -0
- package/dist/client-tools.js +114 -0
- package/dist/client-tools.js.map +1 -0
- package/dist/control.d.ts +17 -0
- package/dist/control.d.ts.map +1 -0
- package/dist/control.js +52 -0
- package/dist/control.js.map +1 -0
- package/dist/errors.d.ts +80 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +87 -0
- package/dist/errors.js.map +1 -0
- package/dist/files.d.ts +129 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +388 -0
- package/dist/files.js.map +1 -0
- package/dist/history.d.ts +242 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +91 -0
- package/dist/history.js.map +1 -0
- package/dist/http.d.ts +64 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +282 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/organization.d.ts +70 -0
- package/dist/organization.d.ts.map +1 -0
- package/dist/organization.js +118 -0
- package/dist/organization.js.map +1 -0
- package/dist/progress.d.ts +34 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +154 -0
- package/dist/progress.js.map +1 -0
- package/dist/realtime.d.ts +91 -0
- package/dist/realtime.d.ts.map +1 -0
- package/dist/realtime.js +112 -0
- package/dist/realtime.js.map +1 -0
- package/dist/schedulers.d.ts +129 -0
- package/dist/schedulers.d.ts.map +1 -0
- package/dist/schedulers.js +91 -0
- package/dist/schedulers.js.map +1 -0
- package/dist/session.d.ts +136 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +226 -0
- package/dist/session.js.map +1 -0
- package/dist/sse.d.ts +7 -0
- package/dist/sse.d.ts.map +1 -0
- package/dist/sse.js +45 -0
- package/dist/sse.js.map +1 -0
- package/dist/turn.d.ts +43 -0
- package/dist/turn.d.ts.map +1 -0
- package/dist/turn.js +206 -0
- package/dist/turn.js.map +1 -0
- package/dist/usage.d.ts +462 -0
- package/dist/usage.d.ts.map +1 -0
- package/dist/usage.js +20 -0
- package/dist/usage.js.map +1 -0
- package/dist/user.d.ts +96 -0
- package/dist/user.d.ts.map +1 -0
- package/dist/user.js +139 -0
- package/dist/user.js.map +1 -0
- package/examples/answer-client-tool.mjs +69 -0
- package/examples/control-turn.mjs +48 -0
- package/examples/create-session.mjs +69 -0
- package/examples/observe-message.mjs +44 -0
- package/examples/organization-session.mjs +66 -0
- package/examples/prepare-realtime-connection.mjs +61 -0
- package/examples/provision-user.mjs +83 -0
- package/examples/read-usage.mjs +62 -0
- package/examples/schedule-task.mjs +67 -0
- package/examples/send-message.mjs +43 -0
- package/examples/submit-audio.mjs +52 -0
- package/examples/upload-file.mjs +53 -0
- package/package.json +65 -4
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { open } from "node:fs/promises";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import {
|
|
4
|
+
ConflictError,
|
|
5
|
+
OrganizationClient,
|
|
6
|
+
OutcomeUnknownError,
|
|
7
|
+
} from "@tidblink/server";
|
|
8
|
+
|
|
9
|
+
/** Each successful invocation issues a new credential. Retain it in your secret manager. */
|
|
10
|
+
export async function provisionUser({
|
|
11
|
+
baseUrl,
|
|
12
|
+
organizationApiKey,
|
|
13
|
+
externalId,
|
|
14
|
+
displayName,
|
|
15
|
+
}) {
|
|
16
|
+
const client = new OrganizationClient({
|
|
17
|
+
baseUrl,
|
|
18
|
+
apiKey: organizationApiKey,
|
|
19
|
+
});
|
|
20
|
+
const organization = await client.getOrganization();
|
|
21
|
+
const mapping = externalId.trim();
|
|
22
|
+
if (!mapping)
|
|
23
|
+
throw new TypeError("externalId is required for reconciliation");
|
|
24
|
+
const find = async () =>
|
|
25
|
+
(await client.listEndUsers()).find((user) => user.externalId === mapping);
|
|
26
|
+
let user = await find();
|
|
27
|
+
if (!user) {
|
|
28
|
+
try {
|
|
29
|
+
user = await client.createEndUser({
|
|
30
|
+
externalId: mapping,
|
|
31
|
+
...(displayName === undefined ? {} : { displayName }),
|
|
32
|
+
});
|
|
33
|
+
} catch (error) {
|
|
34
|
+
if (
|
|
35
|
+
!(error instanceof OutcomeUnknownError) &&
|
|
36
|
+
!(error instanceof ConflictError && error.code === "resource_conflict")
|
|
37
|
+
)
|
|
38
|
+
throw error;
|
|
39
|
+
user = await find().catch(() => undefined);
|
|
40
|
+
if (!user) throw error;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Metadata cannot recover a lost token. This issuance is deliberately never repeated here.
|
|
44
|
+
const issued = await client.createUserApiKey(user.userId, {
|
|
45
|
+
name: "application-backend",
|
|
46
|
+
});
|
|
47
|
+
return { organization, user, ...issued };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (
|
|
51
|
+
process.argv[1] &&
|
|
52
|
+
import.meta.url === pathToFileURL(process.argv[1]).href
|
|
53
|
+
) {
|
|
54
|
+
const {
|
|
55
|
+
AGENT_SERVICE_URL,
|
|
56
|
+
ORGANIZATION_API_KEY,
|
|
57
|
+
END_USER_EXTERNAL_ID,
|
|
58
|
+
USER_CREDENTIAL_FILE,
|
|
59
|
+
} = process.env;
|
|
60
|
+
if (
|
|
61
|
+
!AGENT_SERVICE_URL ||
|
|
62
|
+
!ORGANIZATION_API_KEY ||
|
|
63
|
+
!END_USER_EXTERNAL_ID ||
|
|
64
|
+
!USER_CREDENTIAL_FILE
|
|
65
|
+
) {
|
|
66
|
+
throw new Error(
|
|
67
|
+
"Set AGENT_SERVICE_URL, ORGANIZATION_API_KEY, END_USER_EXTERNAL_ID and USER_CREDENTIAL_FILE",
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
// Reserve a new private destination before issuing a credential; never overwrite an existing secret.
|
|
71
|
+
const destination = await open(USER_CREDENTIAL_FILE, "wx", 0o600);
|
|
72
|
+
try {
|
|
73
|
+
const result = await provisionUser({
|
|
74
|
+
baseUrl: AGENT_SERVICE_URL,
|
|
75
|
+
organizationApiKey: ORGANIZATION_API_KEY,
|
|
76
|
+
externalId: END_USER_EXTERNAL_ID,
|
|
77
|
+
});
|
|
78
|
+
await destination.writeFile(JSON.stringify(result) + "\n");
|
|
79
|
+
console.log("User credential saved to USER_CREDENTIAL_FILE");
|
|
80
|
+
} finally {
|
|
81
|
+
await destination.close();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { pathToFileURL } from "node:url";
|
|
2
|
+
import { UserClient, OrganizationClient } from "@tidblink/server";
|
|
3
|
+
|
|
4
|
+
export async function readOwnUsage({ baseUrl, userApiKey, options = {} }) {
|
|
5
|
+
const user = new UserClient({ baseUrl, apiKey: userApiKey });
|
|
6
|
+
return {
|
|
7
|
+
summary: await user.getUsage(options),
|
|
8
|
+
details: await user.getUsageDetails(options),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Organization details return the first page; retain nextCursor and the original filters. */
|
|
13
|
+
export async function readUserUsage({
|
|
14
|
+
baseUrl,
|
|
15
|
+
organizationApiKey,
|
|
16
|
+
userId,
|
|
17
|
+
options,
|
|
18
|
+
}) {
|
|
19
|
+
const organization = new OrganizationClient({
|
|
20
|
+
baseUrl,
|
|
21
|
+
apiKey: organizationApiKey,
|
|
22
|
+
});
|
|
23
|
+
const { interval, ...range } = options;
|
|
24
|
+
return {
|
|
25
|
+
summary: await organization.getUserUsage(userId, options),
|
|
26
|
+
details: await organization.getUserUsageDetails(userId, range),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (
|
|
31
|
+
process.argv[1] &&
|
|
32
|
+
import.meta.url === pathToFileURL(process.argv[1]).href
|
|
33
|
+
) {
|
|
34
|
+
try {
|
|
35
|
+
const options = {
|
|
36
|
+
from: process.env.USAGE_FROM,
|
|
37
|
+
to: process.env.USAGE_TO,
|
|
38
|
+
tagKey: process.env.TAG_KEY,
|
|
39
|
+
tagValue: process.env.TAG_VALUE,
|
|
40
|
+
};
|
|
41
|
+
const baseUrl = process.env.AGENT_SERVICE_URL;
|
|
42
|
+
let result;
|
|
43
|
+
if (process.env.USAGE_AUTHORITY === "user")
|
|
44
|
+
result = await readOwnUsage({
|
|
45
|
+
baseUrl,
|
|
46
|
+
userApiKey: process.env.USER_API_KEY,
|
|
47
|
+
options,
|
|
48
|
+
});
|
|
49
|
+
else if (process.env.USAGE_AUTHORITY === "organization")
|
|
50
|
+
result = await readUserUsage({
|
|
51
|
+
baseUrl,
|
|
52
|
+
organizationApiKey: process.env.ORGANIZATION_API_KEY,
|
|
53
|
+
userId: process.env.END_USER_ID,
|
|
54
|
+
options,
|
|
55
|
+
});
|
|
56
|
+
else throw new TypeError("USAGE_AUTHORITY must be user or organization");
|
|
57
|
+
console.log(JSON.stringify(result));
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.error(error instanceof Error ? error.message : "Usage read failed");
|
|
60
|
+
process.exitCode = 1;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import { UserClient } from "@tidblink/server";
|
|
4
|
+
|
|
5
|
+
/** Persist the exact runAt, prompt and creation key before calling. */
|
|
6
|
+
export async function scheduleTaskWorkflow({
|
|
7
|
+
baseUrl,
|
|
8
|
+
userApiKey,
|
|
9
|
+
agentId,
|
|
10
|
+
idempotencyKey,
|
|
11
|
+
runAt,
|
|
12
|
+
prompt,
|
|
13
|
+
title = "Scheduled task",
|
|
14
|
+
timeoutMs = 30000,
|
|
15
|
+
}) {
|
|
16
|
+
const user = new UserClient({ baseUrl, apiKey: userApiKey });
|
|
17
|
+
const created = await user.schedulers.create({
|
|
18
|
+
agentId,
|
|
19
|
+
idempotencyKey,
|
|
20
|
+
title,
|
|
21
|
+
prompt,
|
|
22
|
+
schedule: { kind: "once", runAt },
|
|
23
|
+
});
|
|
24
|
+
const deadline = Date.now() + timeoutMs;
|
|
25
|
+
while (Date.now() < deadline) {
|
|
26
|
+
const { fires } = await user.schedulers.fires(
|
|
27
|
+
created.scheduler.schedulerId,
|
|
28
|
+
);
|
|
29
|
+
const fire = fires.find((item) => item.executionStatus !== "pending");
|
|
30
|
+
if (fire) {
|
|
31
|
+
const turn =
|
|
32
|
+
fire.result.sessionId && fire.result.turnId
|
|
33
|
+
? await user
|
|
34
|
+
.session(fire.result.sessionId)
|
|
35
|
+
.getTurn(fire.result.turnId)
|
|
36
|
+
: null;
|
|
37
|
+
return { scheduler: created.scheduler, fire, turn };
|
|
38
|
+
}
|
|
39
|
+
await delay(100);
|
|
40
|
+
}
|
|
41
|
+
throw new Error(
|
|
42
|
+
`Waiting stopped; read Scheduler ${created.scheduler.schedulerId} fires later. Its schedule remains active.`,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (
|
|
47
|
+
process.argv[1] &&
|
|
48
|
+
import.meta.url === pathToFileURL(process.argv[1]).href
|
|
49
|
+
) {
|
|
50
|
+
try {
|
|
51
|
+
const result = await scheduleTaskWorkflow({
|
|
52
|
+
baseUrl: process.env.AGENT_SERVICE_URL,
|
|
53
|
+
userApiKey: process.env.USER_API_KEY,
|
|
54
|
+
agentId: process.env.AGENT_ID,
|
|
55
|
+
idempotencyKey: process.env.SCHEDULER_IDEMPOTENCY_KEY,
|
|
56
|
+
runAt: process.env.SCHEDULE_RUN_AT,
|
|
57
|
+
prompt: process.env.SCHEDULE_PROMPT,
|
|
58
|
+
});
|
|
59
|
+
console.log(JSON.stringify(result));
|
|
60
|
+
if (result.fire.executionStatus === "failed") process.exitCode = 1;
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.error(
|
|
63
|
+
error instanceof Error ? error.message : "Scheduled task failed",
|
|
64
|
+
);
|
|
65
|
+
process.exitCode = 1;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { pathToFileURL } from "node:url";
|
|
2
|
+
import { UserClient } from "@tidblink/server";
|
|
3
|
+
|
|
4
|
+
/** Persist sessionId, clientEventId and text before calling; reuse them for recovery. */
|
|
5
|
+
export async function sendMessageWorkflow({
|
|
6
|
+
baseUrl,
|
|
7
|
+
userApiKey,
|
|
8
|
+
sessionId,
|
|
9
|
+
clientEventId,
|
|
10
|
+
text,
|
|
11
|
+
timeoutMs,
|
|
12
|
+
signal,
|
|
13
|
+
}) {
|
|
14
|
+
const session = new UserClient({ baseUrl, apiKey: userApiKey }).session(
|
|
15
|
+
sessionId,
|
|
16
|
+
);
|
|
17
|
+
return session.turn(
|
|
18
|
+
{ clientEventId, text, ...(signal ? { signal } : {}) },
|
|
19
|
+
{
|
|
20
|
+
...(timeoutMs === undefined ? {} : { timeoutMs }),
|
|
21
|
+
...(signal ? { signal } : {}),
|
|
22
|
+
},
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (
|
|
27
|
+
process.argv[1] &&
|
|
28
|
+
import.meta.url === pathToFileURL(process.argv[1]).href
|
|
29
|
+
) {
|
|
30
|
+
try {
|
|
31
|
+
const result = await sendMessageWorkflow({
|
|
32
|
+
baseUrl: process.env.AGENT_SERVICE_URL,
|
|
33
|
+
userApiKey: process.env.USER_API_KEY,
|
|
34
|
+
sessionId: process.env.SESSION_ID,
|
|
35
|
+
clientEventId: process.env.CLIENT_EVENT_ID,
|
|
36
|
+
text: process.env.MESSAGE_TEXT,
|
|
37
|
+
});
|
|
38
|
+
console.log(result.text);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error(error instanceof Error ? error.message : "Message failed");
|
|
41
|
+
process.exitCode = 1;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { basename } from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { UserClient } from "@tidblink/server";
|
|
5
|
+
|
|
6
|
+
/** This recording request owns its response; aborting it may interrupt the Turn. */
|
|
7
|
+
export async function submitAudioWorkflow({
|
|
8
|
+
baseUrl,
|
|
9
|
+
userApiKey,
|
|
10
|
+
sessionId,
|
|
11
|
+
bytes,
|
|
12
|
+
filename,
|
|
13
|
+
contentType,
|
|
14
|
+
billingTag,
|
|
15
|
+
signal,
|
|
16
|
+
}) {
|
|
17
|
+
return new UserClient({ baseUrl, apiKey: userApiKey })
|
|
18
|
+
.session(sessionId)
|
|
19
|
+
.audio({
|
|
20
|
+
bytes,
|
|
21
|
+
filename,
|
|
22
|
+
...(contentType === undefined ? {} : { contentType }),
|
|
23
|
+
...(billingTag === undefined ? {} : { billingTag }),
|
|
24
|
+
...(signal ? { signal } : {}),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (
|
|
29
|
+
process.argv[1] &&
|
|
30
|
+
import.meta.url === pathToFileURL(process.argv[1]).href
|
|
31
|
+
) {
|
|
32
|
+
try {
|
|
33
|
+
if (!process.env.AUDIO_FILE_PATH)
|
|
34
|
+
throw new Error("Set AUDIO_FILE_PATH to an existing recording");
|
|
35
|
+
const result = await submitAudioWorkflow({
|
|
36
|
+
baseUrl: process.env.AGENT_SERVICE_URL,
|
|
37
|
+
userApiKey: process.env.USER_API_KEY,
|
|
38
|
+
sessionId: process.env.SESSION_ID,
|
|
39
|
+
filename: basename(process.env.AUDIO_FILE_PATH),
|
|
40
|
+
bytes: await readFile(process.env.AUDIO_FILE_PATH),
|
|
41
|
+
contentType: process.env.AUDIO_CONTENT_TYPE,
|
|
42
|
+
});
|
|
43
|
+
console.log(result.text);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error(
|
|
46
|
+
error instanceof Error ? error.message : "Audio request failed",
|
|
47
|
+
);
|
|
48
|
+
if (typeof error?.turnId === "string")
|
|
49
|
+
console.error(`Turn: ${error.turnId}`);
|
|
50
|
+
process.exitCode = 1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { basename } from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { UserClient } from "@tidblink/server";
|
|
5
|
+
|
|
6
|
+
/** Persist both identities and exact file/message input before calling. */
|
|
7
|
+
export async function uploadFileWorkflow({
|
|
8
|
+
baseUrl,
|
|
9
|
+
userApiKey,
|
|
10
|
+
sessionId,
|
|
11
|
+
originalName,
|
|
12
|
+
bytes,
|
|
13
|
+
idempotencyKey,
|
|
14
|
+
clientEventId,
|
|
15
|
+
text = "Read the attached file.",
|
|
16
|
+
timeoutMs,
|
|
17
|
+
}) {
|
|
18
|
+
const user = new UserClient({ baseUrl, apiKey: userApiKey });
|
|
19
|
+
const file = await user.files.upload({ originalName, bytes, idempotencyKey });
|
|
20
|
+
const result = await user
|
|
21
|
+
.session(sessionId)
|
|
22
|
+
.turn(
|
|
23
|
+
{ clientEventId, text, userFileIds: [file.fileId] },
|
|
24
|
+
{ ...(timeoutMs === undefined ? {} : { timeoutMs }) },
|
|
25
|
+
);
|
|
26
|
+
return { file, result };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (
|
|
30
|
+
process.argv[1] &&
|
|
31
|
+
import.meta.url === pathToFileURL(process.argv[1]).href
|
|
32
|
+
) {
|
|
33
|
+
try {
|
|
34
|
+
if (!process.env.FILE_PATH)
|
|
35
|
+
throw new Error("Set FILE_PATH to the file to attach");
|
|
36
|
+
const { result } = await uploadFileWorkflow({
|
|
37
|
+
baseUrl: process.env.AGENT_SERVICE_URL,
|
|
38
|
+
userApiKey: process.env.USER_API_KEY,
|
|
39
|
+
sessionId: process.env.SESSION_ID,
|
|
40
|
+
originalName: basename(process.env.FILE_PATH),
|
|
41
|
+
bytes: await readFile(process.env.FILE_PATH),
|
|
42
|
+
idempotencyKey: process.env.UPLOAD_IDEMPOTENCY_KEY,
|
|
43
|
+
clientEventId: process.env.CLIENT_EVENT_ID,
|
|
44
|
+
text: process.env.MESSAGE_TEXT,
|
|
45
|
+
});
|
|
46
|
+
console.log(result.text);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error(
|
|
49
|
+
error instanceof Error ? error.message : "File workflow failed",
|
|
50
|
+
);
|
|
51
|
+
process.exitCode = 1;
|
|
52
|
+
}
|
|
53
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,67 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tidblink/server",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.3.0-rc.0",
|
|
4
|
+
"description": "Official TypeScript SDK for TiDB Link",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22.12"
|
|
9
|
+
},
|
|
10
|
+
"tidbLinkApiVersion": "0.0.1",
|
|
11
|
+
"tidbLinkRevision": "882287809f91d9a3fdf60537460431d9f0fc23e7",
|
|
12
|
+
"tidbLinkOpenApiSha256": "906515e4c8d38c5ac9fce6390d9d646220b2d06100fbcb64e180419899989a5b",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./examples/provision-user.mjs": "./examples/provision-user.mjs",
|
|
19
|
+
"./examples/prepare-realtime-connection.mjs": "./examples/prepare-realtime-connection.mjs",
|
|
20
|
+
"./examples/create-session.mjs": "./examples/create-session.mjs",
|
|
21
|
+
"./examples/send-message.mjs": "./examples/send-message.mjs",
|
|
22
|
+
"./examples/control-turn.mjs": "./examples/control-turn.mjs",
|
|
23
|
+
"./examples/observe-message.mjs": "./examples/observe-message.mjs",
|
|
24
|
+
"./examples/read-usage.mjs": "./examples/read-usage.mjs",
|
|
25
|
+
"./examples/upload-file.mjs": "./examples/upload-file.mjs",
|
|
26
|
+
"./examples/schedule-task.mjs": "./examples/schedule-task.mjs",
|
|
27
|
+
"./examples/answer-client-tool.mjs": "./examples/answer-client-tool.mjs",
|
|
28
|
+
"./examples/submit-audio.mjs": "./examples/submit-audio.mjs",
|
|
29
|
+
"./examples/organization-session.mjs": "./examples/organization-session.mjs"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md",
|
|
34
|
+
"examples/provision-user.mjs",
|
|
35
|
+
"examples/prepare-realtime-connection.mjs",
|
|
36
|
+
"examples/create-session.mjs",
|
|
37
|
+
"examples/send-message.mjs",
|
|
38
|
+
"examples/control-turn.mjs",
|
|
39
|
+
"examples/observe-message.mjs",
|
|
40
|
+
"examples/read-usage.mjs",
|
|
41
|
+
"examples/upload-file.mjs",
|
|
42
|
+
"examples/schedule-task.mjs",
|
|
43
|
+
"examples/answer-client-tool.mjs",
|
|
44
|
+
"examples/submit-audio.mjs",
|
|
45
|
+
"examples/organization-session.mjs"
|
|
46
|
+
],
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "node --eval \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
|
|
49
|
+
"typecheck": "npm run build",
|
|
50
|
+
"test": "npm run build && node --test 'test/**/*.test.mjs'",
|
|
51
|
+
"test:service-contract": "node --test 'service-contract/**/*.test.mjs'",
|
|
52
|
+
"pack:check": "npm pack --dry-run",
|
|
53
|
+
"test:service": "npm run build && node test/service/run.mjs"
|
|
54
|
+
},
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"repository": {
|
|
59
|
+
"type": "git",
|
|
60
|
+
"url": "git+https://github.com/mem9-ai/tidblink-sdk.git",
|
|
61
|
+
"directory": "typescript"
|
|
62
|
+
},
|
|
63
|
+
"bugs": {
|
|
64
|
+
"url": "https://github.com/mem9-ai/tidblink-sdk/issues"
|
|
65
|
+
},
|
|
66
|
+
"homepage": "https://github.com/mem9-ai/tidblink-sdk#readme"
|
|
67
|
+
}
|