@pinecall/agents 0.9.20
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 +202 -0
- package/README.md +121 -0
- package/dist/agent/accepts.d.ts +31 -0
- package/dist/agent/accepts.d.ts.map +1 -0
- package/dist/agent/accepts.js +27 -0
- package/dist/agent/accepts.js.map +1 -0
- package/dist/agent/agent.d.ts +151 -0
- package/dist/agent/agent.d.ts.map +1 -0
- package/dist/agent/agent.js +240 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/authors.d.ts +12 -0
- package/dist/agent/authors.d.ts.map +1 -0
- package/dist/agent/authors.js +26 -0
- package/dist/agent/authors.js.map +1 -0
- package/dist/agent/decorators.d.ts +16 -0
- package/dist/agent/decorators.d.ts.map +1 -0
- package/dist/agent/decorators.js +43 -0
- package/dist/agent/decorators.js.map +1 -0
- package/dist/agent/docstrings.d.ts +35 -0
- package/dist/agent/docstrings.d.ts.map +1 -0
- package/dist/agent/docstrings.js +301 -0
- package/dist/agent/docstrings.js.map +1 -0
- package/dist/agent/knowledge.d.ts +9 -0
- package/dist/agent/knowledge.d.ts.map +1 -0
- package/dist/agent/knowledge.js +3 -0
- package/dist/agent/knowledge.js.map +1 -0
- package/dist/agent/lifecycle.d.ts +29 -0
- package/dist/agent/lifecycle.d.ts.map +1 -0
- package/dist/agent/lifecycle.js +9 -0
- package/dist/agent/lifecycle.js.map +1 -0
- package/dist/agent/searching.d.ts +7 -0
- package/dist/agent/searching.d.ts.map +1 -0
- package/dist/agent/searching.js +35 -0
- package/dist/agent/searching.js.map +1 -0
- package/dist/agent/stages.d.ts +23 -0
- package/dist/agent/stages.d.ts.map +1 -0
- package/dist/agent/stages.js +29 -0
- package/dist/agent/stages.js.map +1 -0
- package/dist/agent/state.d.ts +36 -0
- package/dist/agent/state.d.ts.map +1 -0
- package/dist/agent/state.js +93 -0
- package/dist/agent/state.js.map +1 -0
- package/dist/agent/tools.d.ts +61 -0
- package/dist/agent/tools.d.ts.map +1 -0
- package/dist/agent/tools.js +145 -0
- package/dist/agent/tools.js.map +1 -0
- package/dist/agent/view.d.ts +29 -0
- package/dist/agent/view.d.ts.map +1 -0
- package/dist/agent/view.js +29 -0
- package/dist/agent/view.js.map +1 -0
- package/dist/agent/visibility.d.ts +32 -0
- package/dist/agent/visibility.d.ts.map +1 -0
- package/dist/agent/visibility.js +77 -0
- package/dist/agent/visibility.js.map +1 -0
- package/dist/call/call.d.ts +137 -0
- package/dist/call/call.d.ts.map +1 -0
- package/dist/call/call.js +228 -0
- package/dist/call/call.js.map +1 -0
- package/dist/call/history.d.ts +28 -0
- package/dist/call/history.d.ts.map +1 -0
- package/dist/call/history.js +32 -0
- package/dist/call/history.js.map +1 -0
- package/dist/call/room.d.ts +56 -0
- package/dist/call/room.d.ts.map +1 -0
- package/dist/call/room.js +66 -0
- package/dist/call/room.js.map +1 -0
- package/dist/client/agent.d.ts +93 -0
- package/dist/client/agent.d.ts.map +1 -0
- package/dist/client/agent.js +230 -0
- package/dist/client/agent.js.map +1 -0
- package/dist/client/calls.d.ts +87 -0
- package/dist/client/calls.d.ts.map +1 -0
- package/dist/client/calls.js +180 -0
- package/dist/client/calls.js.map +1 -0
- package/dist/client/client.d.ts +112 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/client.js +284 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/connection.d.ts +52 -0
- package/dist/client/connection.d.ts.map +1 -0
- package/dist/client/connection.js +157 -0
- package/dist/client/connection.js.map +1 -0
- package/dist/client/endpoints.d.ts +9 -0
- package/dist/client/endpoints.d.ts.map +1 -0
- package/dist/client/endpoints.js +25 -0
- package/dist/client/endpoints.js.map +1 -0
- package/dist/client/frames.d.ts +29 -0
- package/dist/client/frames.d.ts.map +1 -0
- package/dist/client/frames.js +51 -0
- package/dist/client/frames.js.map +1 -0
- package/dist/client/index.d.ts +18 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +13 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/listeners.d.ts +35 -0
- package/dist/client/listeners.d.ts.map +1 -0
- package/dist/client/listeners.js +60 -0
- package/dist/client/listeners.js.map +1 -0
- package/dist/client/lost.d.ts +4 -0
- package/dist/client/lost.d.ts.map +1 -0
- package/dist/client/lost.js +8 -0
- package/dist/client/lost.js.map +1 -0
- package/dist/client/observe.d.ts +50 -0
- package/dist/client/observe.d.ts.map +1 -0
- package/dist/client/observe.js +125 -0
- package/dist/client/observe.js.map +1 -0
- package/dist/client/signed.d.ts +14 -0
- package/dist/client/signed.d.ts.map +1 -0
- package/dist/client/signed.js +18 -0
- package/dist/client/signed.js.map +1 -0
- package/dist/client/testing/gateway.d.ts +58 -0
- package/dist/client/testing/gateway.d.ts.map +1 -0
- package/dist/client/testing/gateway.js +175 -0
- package/dist/client/testing/gateway.js.map +1 -0
- package/dist/client/testing/index.d.ts +4 -0
- package/dist/client/testing/index.d.ts.map +1 -0
- package/dist/client/testing/index.js +4 -0
- package/dist/client/testing/index.js.map +1 -0
- package/dist/client/testing/log.d.ts +24 -0
- package/dist/client/testing/log.d.ts.map +1 -0
- package/dist/client/testing/log.js +106 -0
- package/dist/client/testing/log.js.map +1 -0
- package/dist/client/testing/loopback.d.ts +3 -0
- package/dist/client/testing/loopback.d.ts.map +1 -0
- package/dist/client/testing/loopback.js +3 -0
- package/dist/client/testing/loopback.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/connect.d.ts +42 -0
- package/dist/runtime/connect.d.ts.map +1 -0
- package/dist/runtime/connect.js +234 -0
- package/dist/runtime/connect.js.map +1 -0
- package/dist/runtime/dispatch.d.ts +32 -0
- package/dist/runtime/dispatch.d.ts.map +1 -0
- package/dist/runtime/dispatch.js +46 -0
- package/dist/runtime/dispatch.js.map +1 -0
- package/dist/runtime/environment.d.ts +7 -0
- package/dist/runtime/environment.d.ts.map +1 -0
- package/dist/runtime/environment.js +30 -0
- package/dist/runtime/environment.js.map +1 -0
- package/dist/runtime/recall.d.ts +9 -0
- package/dist/runtime/recall.d.ts.map +1 -0
- package/dist/runtime/recall.js +13 -0
- package/dist/runtime/recall.js.map +1 -0
- package/dist/runtime/run-tool.d.ts +18 -0
- package/dist/runtime/run-tool.d.ts.map +1 -0
- package/dist/runtime/run-tool.js +70 -0
- package/dist/runtime/run-tool.js.map +1 -0
- package/dist/serve/index.d.ts +5 -0
- package/dist/serve/index.d.ts.map +1 -0
- package/dist/serve/index.js +50 -0
- package/dist/serve/index.js.map +1 -0
- package/dist/serve/io.d.ts +14 -0
- package/dist/serve/io.d.ts.map +1 -0
- package/dist/serve/io.js +6 -0
- package/dist/serve/io.js.map +1 -0
- package/dist/serve/leaving.d.ts +12 -0
- package/dist/serve/leaving.d.ts.map +1 -0
- package/dist/serve/leaving.js +61 -0
- package/dist/serve/leaving.js.map +1 -0
- package/dist/serve/lines.d.ts +7 -0
- package/dist/serve/lines.d.ts.map +1 -0
- package/dist/serve/lines.js +25 -0
- package/dist/serve/lines.js.map +1 -0
- package/dist/serve/load.d.ts +26 -0
- package/dist/serve/load.d.ts.map +1 -0
- package/dist/serve/load.js +61 -0
- package/dist/serve/load.js.map +1 -0
- package/dist/serve/machine.d.ts +4 -0
- package/dist/serve/machine.d.ts.map +1 -0
- package/dist/serve/machine.js +33 -0
- package/dist/serve/machine.js.map +1 -0
- package/dist/serve/prompt.d.ts +7 -0
- package/dist/serve/prompt.d.ts.map +1 -0
- package/dist/serve/prompt.js +51 -0
- package/dist/serve/prompt.js.map +1 -0
- package/dist/serve/start.d.ts +7 -0
- package/dist/serve/start.d.ts.map +1 -0
- package/dist/serve/start.js +95 -0
- package/dist/serve/start.js.map +1 -0
- package/dist/serve/viewing.d.ts +17 -0
- package/dist/serve/viewing.d.ts.map +1 -0
- package/dist/serve/viewing.js +42 -0
- package/dist/serve/viewing.js.map +1 -0
- package/dist/views/built-in-rules.d.ts +9 -0
- package/dist/views/built-in-rules.d.ts.map +1 -0
- package/dist/views/built-in-rules.js +28 -0
- package/dist/views/built-in-rules.js.map +1 -0
- package/dist/views/components.d.ts +17 -0
- package/dist/views/components.d.ts.map +1 -0
- package/dist/views/components.js +33 -0
- package/dist/views/components.js.map +1 -0
- package/dist/views/jsx-dev-runtime.d.ts +3 -0
- package/dist/views/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/views/jsx-dev-runtime.js +4 -0
- package/dist/views/jsx-dev-runtime.js.map +1 -0
- package/dist/views/jsx-runtime.d.ts +46 -0
- package/dist/views/jsx-runtime.d.ts.map +1 -0
- package/dist/views/jsx-runtime.js +63 -0
- package/dist/views/jsx-runtime.js.map +1 -0
- package/dist/views/layout.d.ts +19 -0
- package/dist/views/layout.d.ts.map +1 -0
- package/dist/views/layout.js +58 -0
- package/dist/views/layout.js.map +1 -0
- package/dist/views/nodes.d.ts +48 -0
- package/dist/views/nodes.d.ts.map +1 -0
- package/dist/views/nodes.js +45 -0
- package/dist/views/nodes.js.map +1 -0
- package/dist/views/panels.d.ts +17 -0
- package/dist/views/panels.d.ts.map +1 -0
- package/dist/views/panels.js +62 -0
- package/dist/views/panels.js.map +1 -0
- package/dist/views/render.d.ts +11 -0
- package/dist/views/render.d.ts.map +1 -0
- package/dist/views/render.js +19 -0
- package/dist/views/render.js.map +1 -0
- package/dist/wire/agent-config.d.ts +213 -0
- package/dist/wire/agent-config.d.ts.map +1 -0
- package/dist/wire/agent-config.js +126 -0
- package/dist/wire/agent-config.js.map +1 -0
- package/dist/wire/codec.d.ts +43 -0
- package/dist/wire/codec.d.ts.map +1 -0
- package/dist/wire/codec.js +51 -0
- package/dist/wire/codec.js.map +1 -0
- package/dist/wire/commands.d.ts +443 -0
- package/dist/wire/commands.d.ts.map +1 -0
- package/dist/wire/commands.js +203 -0
- package/dist/wire/commands.js.map +1 -0
- package/dist/wire/defs.d.ts +373 -0
- package/dist/wire/defs.d.ts.map +1 -0
- package/dist/wire/defs.js +212 -0
- package/dist/wire/defs.js.map +1 -0
- package/dist/wire/envelope.d.ts +29 -0
- package/dist/wire/envelope.d.ts.map +1 -0
- package/dist/wire/envelope.js +27 -0
- package/dist/wire/envelope.js.map +1 -0
- package/dist/wire/events-call.d.ts +446 -0
- package/dist/wire/events-call.d.ts.map +1 -0
- package/dist/wire/events-call.js +196 -0
- package/dist/wire/events-call.js.map +1 -0
- package/dist/wire/events.d.ts +946 -0
- package/dist/wire/events.d.ts.map +1 -0
- package/dist/wire/events.js +309 -0
- package/dist/wire/events.js.map +1 -0
- package/dist/wire/index.d.ts +19 -0
- package/dist/wire/index.d.ts.map +1 -0
- package/dist/wire/index.js +19 -0
- package/dist/wire/index.js.map +1 -0
- package/dist/wire/metrics.d.ts +366 -0
- package/dist/wire/metrics.d.ts.map +1 -0
- package/dist/wire/metrics.js +269 -0
- package/dist/wire/metrics.js.map +1 -0
- package/dist/wire/reduce.d.ts +10 -0
- package/dist/wire/reduce.d.ts.map +1 -0
- package/dist/wire/reduce.js +367 -0
- package/dist/wire/reduce.js.map +1 -0
- package/dist/wire/registry.d.ts +1789 -0
- package/dist/wire/registry.d.ts.map +1 -0
- package/dist/wire/registry.js +118 -0
- package/dist/wire/registry.js.map +1 -0
- package/dist/wire/rest-data.d.ts +170 -0
- package/dist/wire/rest-data.d.ts.map +1 -0
- package/dist/wire/rest-data.js +78 -0
- package/dist/wire/rest-data.js.map +1 -0
- package/dist/wire/rest-hosting.d.ts +74 -0
- package/dist/wire/rest-hosting.d.ts.map +1 -0
- package/dist/wire/rest-hosting.js +38 -0
- package/dist/wire/rest-hosting.js.map +1 -0
- package/dist/wire/rest-retrieval.d.ts +214 -0
- package/dist/wire/rest-retrieval.d.ts.map +1 -0
- package/dist/wire/rest-retrieval.js +161 -0
- package/dist/wire/rest-retrieval.js.map +1 -0
- package/dist/wire/rest.d.ts +786 -0
- package/dist/wire/rest.d.ts.map +1 -0
- package/dist/wire/rest.js +238 -0
- package/dist/wire/rest.js.map +1 -0
- package/dist/wire/room.d.ts +106 -0
- package/dist/wire/room.d.ts.map +1 -0
- package/dist/wire/room.js +73 -0
- package/dist/wire/room.js.map +1 -0
- package/dist/wire/state.d.ts +915 -0
- package/dist/wire/state.d.ts.map +1 -0
- package/dist/wire/state.js +189 -0
- package/dist/wire/state.js.map +1 -0
- package/dist/wire/verbs.d.ts +73 -0
- package/dist/wire/verbs.d.ts.map +1 -0
- package/dist/wire/verbs.js +50 -0
- package/dist/wire/verbs.js.map +1 -0
- package/package.json +74 -0
- package/tsconfig.tenant.json +24 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rest.d.ts","sourceRoot":"","sources":["../../src/wire/rest.ts"],"names":[],"mappings":"AAAA,yGAAyG;AAEzG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;kBAK7B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;;;EAAgD,CAAC;AAE/E,gGAAgG;AAChG,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmB5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,qGAAqG;AACrG,eAAO,MAAM,gBAAgB;;;kBAG3B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;kBAS3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;kBAExB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO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CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;;;;kBAMtB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEhD,qGAAqG;AACrG,eAAO,MAAM,eAAe;;;;;;;;;;;kBAE1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,6FAA6F;AAC7F,eAAO,MAAM,cAAc;;;;;;kBAGzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/** The read doors the CLI answers from: calls, apps, the line, settings, the lexicon, voices, judges. */
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { DocsConfigSchema, GreetingConfigSchema, HangupConfigSchema, MemoryConfigSchema, PronunciationSchema, TurnConfigSchema, } from "./agent-config.js";
|
|
4
|
+
import { ChannelSchema, ContactSchema, CostSchema, DirectionSchema, EndReasonSchema, EnvSchema, } from "./defs.js";
|
|
5
|
+
import { AttentionStateSchema, CallStatusSchema } from "./state.js";
|
|
6
|
+
/**
|
|
7
|
+
* One call's call.score as a list draws it: how many judges held of how many answered, and why the
|
|
8
|
+
* first one that broke did.
|
|
9
|
+
*/
|
|
10
|
+
export const SessionScoreSchema = z.strictObject({
|
|
11
|
+
held: z.int(),
|
|
12
|
+
judged: z.int(),
|
|
13
|
+
passed: z.boolean(),
|
|
14
|
+
reason: z.string().nullable(),
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* escalated: a person took part — a transfer, a supervisor taking the line, saying something, or
|
|
18
|
+
* ending the call. low_score: a judge answered broken. promise: the promises judge found the agent
|
|
19
|
+
* committing the business to something no tool call records.
|
|
20
|
+
*/
|
|
21
|
+
export const SessionFlagSchema = z.enum(["escalated", "low_score", "promise"]);
|
|
22
|
+
/** One call as a list draws it: which call, how far the log got, and the state's own fields. */
|
|
23
|
+
export const SessionLineSchema = z.strictObject({
|
|
24
|
+
call: z.string(),
|
|
25
|
+
agent: z.string(),
|
|
26
|
+
live: z.boolean(),
|
|
27
|
+
last_seq: z.int(),
|
|
28
|
+
status: CallStatusSchema,
|
|
29
|
+
channel: ChannelSchema.nullable(),
|
|
30
|
+
direction: DirectionSchema.nullable(),
|
|
31
|
+
from: z.string().nullable(),
|
|
32
|
+
to: z.string().nullable(),
|
|
33
|
+
caller: ContactSchema.nullable(),
|
|
34
|
+
started_at: z.number().nullable(),
|
|
35
|
+
ended_at: z.number().nullable(),
|
|
36
|
+
end_reason: EndReasonSchema.nullable(),
|
|
37
|
+
outcome: z.string().nullable(),
|
|
38
|
+
cost: CostSchema.nullable(),
|
|
39
|
+
score: SessionScoreSchema.nullable().nullish(),
|
|
40
|
+
flags: z.array(SessionFlagSchema).nullish(),
|
|
41
|
+
attention: AttentionStateSchema.nullable().nullish(),
|
|
42
|
+
});
|
|
43
|
+
/** One corner of a world holding an agent: the member whose it is, named so a person can read it. */
|
|
44
|
+
export const LineHolderSchema = z.strictObject({
|
|
45
|
+
holder: z.string().nullable(),
|
|
46
|
+
name: z.string().nullable(),
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* One app connected to the gateway right now: one process on one machine, holding one or more
|
|
50
|
+
* agents in one world.
|
|
51
|
+
*/
|
|
52
|
+
export const AppProcessSchema = z.strictObject({
|
|
53
|
+
app: z.string(),
|
|
54
|
+
agents: z.array(z.string()),
|
|
55
|
+
env: EnvSchema,
|
|
56
|
+
host: z.string().nullable(),
|
|
57
|
+
address: z.string().nullable(),
|
|
58
|
+
sdk: z.string().nullable(),
|
|
59
|
+
holder: LineHolderSchema.nullable(),
|
|
60
|
+
connected_at: z.number(),
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* GET /v1/apps: every app connected in the request's world that this key may see — its own
|
|
64
|
+
* corner's and the org's, every corner's with `team`.
|
|
65
|
+
*/
|
|
66
|
+
export const AppListSchema = z.strictObject({
|
|
67
|
+
apps: z.array(AppProcessSchema),
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* POST /v1/apps/{app}/stop, the answer: the socket was closed with the stop code, and the app
|
|
71
|
+
* exits rather than reconnect.
|
|
72
|
+
*/
|
|
73
|
+
export const AppStoppedSchema = z.strictObject({
|
|
74
|
+
app: z.string(),
|
|
75
|
+
stopped: z.boolean(),
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* GET /v1/agents/{slug}/line: whose terminal a call that RINGS at this agent's doors lands in. An
|
|
79
|
+
* org shares one sandbox number, so it rings in one place and which one is claimed.
|
|
80
|
+
*/
|
|
81
|
+
export const TheLineSchema = z.strictObject({
|
|
82
|
+
agent: z.string(),
|
|
83
|
+
env: EnvSchema,
|
|
84
|
+
held: z.boolean(),
|
|
85
|
+
holding: LineHolderSchema.nullable().nullish(),
|
|
86
|
+
yours: z.boolean(),
|
|
87
|
+
waiting: z.array(LineHolderSchema),
|
|
88
|
+
calling: z.array(z.string()),
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* An agent's settings: what the org set, per world and per corner. Every field is optional; one
|
|
92
|
+
* left out is not set, and the runtime's own default stands for it.
|
|
93
|
+
*/
|
|
94
|
+
export const TuningBodySchema = z.strictObject({
|
|
95
|
+
voice: z.string().nullish(),
|
|
96
|
+
tts: z.string().nullish(),
|
|
97
|
+
tts_model: z.string().nullish(),
|
|
98
|
+
stt: z.string().nullish(),
|
|
99
|
+
llm: z.string().nullish(),
|
|
100
|
+
/** A language tag (`en`, `pt-BR`) the voice and the ears are set to; unset, each vendor's own. */
|
|
101
|
+
language: z.string().nullish(),
|
|
102
|
+
greeting: GreetingConfigSchema.nullish(),
|
|
103
|
+
hangup: HangupConfigSchema.nullish(),
|
|
104
|
+
turn: TurnConfigSchema.nullish(),
|
|
105
|
+
memory: MemoryConfigSchema.nullish(),
|
|
106
|
+
record: z.boolean().nullish(),
|
|
107
|
+
max_duration_s: z.int().nullish(),
|
|
108
|
+
knowledge: z.string().nullish(),
|
|
109
|
+
bases: z.array(DocsConfigSchema).nullish(),
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* One kept version of an agent's tuning: whose corner, which version, who set it and when, and
|
|
113
|
+
* what it says.
|
|
114
|
+
*/
|
|
115
|
+
export const TuningRowSchema = z.strictObject({
|
|
116
|
+
holder: z.string(),
|
|
117
|
+
version: z.int(),
|
|
118
|
+
author: z.string(),
|
|
119
|
+
note: z.string().nullable(),
|
|
120
|
+
set_at: z.number(),
|
|
121
|
+
config: TuningBodySchema,
|
|
122
|
+
});
|
|
123
|
+
/**
|
|
124
|
+
* GET /v1/agents/{slug}/settings: the agent's tuning as this key sees it — its own corner's, the
|
|
125
|
+
* team's and production's, each corner's own newest row, or null when that corner set nothing.
|
|
126
|
+
*/
|
|
127
|
+
export const TuningAnswerSchema = z.strictObject({
|
|
128
|
+
world: EnvSchema,
|
|
129
|
+
yours: TuningRowSchema.nullable(),
|
|
130
|
+
team: TuningRowSchema.nullable(),
|
|
131
|
+
production: TuningRowSchema.nullable(),
|
|
132
|
+
});
|
|
133
|
+
/** GET /v1/agents/{slug}/settings/history: one corner's versions, newest first. */
|
|
134
|
+
export const TuningHistorySchema = z.strictObject({
|
|
135
|
+
world: EnvSchema,
|
|
136
|
+
holder: z.string(),
|
|
137
|
+
rows: z.array(TuningRowSchema),
|
|
138
|
+
});
|
|
139
|
+
/**
|
|
140
|
+
* GET /v1/agents/{slug}/settings/diff: what this key's corner reads against another corner's
|
|
141
|
+
* newest, and which fields differ.
|
|
142
|
+
*/
|
|
143
|
+
export const TuningDiffSchema = z.strictObject({
|
|
144
|
+
ours: TuningRowSchema.nullable(),
|
|
145
|
+
theirs: TuningRowSchema.nullable(),
|
|
146
|
+
changed: z.array(z.string()),
|
|
147
|
+
});
|
|
148
|
+
/**
|
|
149
|
+
* An agent's lexicon: how the voice says the words it would get wrong, and the words the ears must
|
|
150
|
+
* know. The class sets neither: these are the agent's says and hears.
|
|
151
|
+
*/
|
|
152
|
+
export const LexiconBodySchema = z.strictObject({
|
|
153
|
+
said: z.array(PronunciationSchema),
|
|
154
|
+
heard: z.array(z.string()),
|
|
155
|
+
});
|
|
156
|
+
/** One kept version of an agent's lexicon. */
|
|
157
|
+
export const LexiconRowSchema = z.strictObject({
|
|
158
|
+
holder: z.string(),
|
|
159
|
+
version: z.int(),
|
|
160
|
+
author: z.string(),
|
|
161
|
+
note: z.string().nullable(),
|
|
162
|
+
set_at: z.number(),
|
|
163
|
+
lexicon: LexiconBodySchema,
|
|
164
|
+
});
|
|
165
|
+
/**
|
|
166
|
+
* GET /v1/agents/{slug}/lexicon: the agent's words as this key sees them — its own corner's, the
|
|
167
|
+
* team's and production's, each corner's own newest, or null.
|
|
168
|
+
*/
|
|
169
|
+
export const LexiconAnswerSchema = z.strictObject({
|
|
170
|
+
world: EnvSchema,
|
|
171
|
+
yours: LexiconRowSchema.nullable(),
|
|
172
|
+
team: LexiconRowSchema.nullable(),
|
|
173
|
+
production: LexiconRowSchema.nullable(),
|
|
174
|
+
});
|
|
175
|
+
/** GET /v1/agents/{slug}/lexicon/history: one corner's versions, newest first. */
|
|
176
|
+
export const LexiconHistorySchema = z.strictObject({
|
|
177
|
+
world: EnvSchema,
|
|
178
|
+
holder: z.string(),
|
|
179
|
+
rows: z.array(LexiconRowSchema),
|
|
180
|
+
});
|
|
181
|
+
/**
|
|
182
|
+
* One voice a picker offers, as GET /v1/voices lists it: the id the `voice` setting takes, and
|
|
183
|
+
* what a person chooses by. `country` and `accent` are the vendor's own words (`ES` is Spain, `MX`
|
|
184
|
+
* Mexico), empty when the vendor said none.
|
|
185
|
+
*/
|
|
186
|
+
export const ListedVoiceSchema = z.strictObject({
|
|
187
|
+
id: z.string(),
|
|
188
|
+
name: z.string(),
|
|
189
|
+
language: z.string(),
|
|
190
|
+
description: z.string(),
|
|
191
|
+
gender: z.string(),
|
|
192
|
+
country: z.string(),
|
|
193
|
+
accent: z.string(),
|
|
194
|
+
});
|
|
195
|
+
/**
|
|
196
|
+
* GET /v1/voices?tts=&language=: a voice vendor's own voices in one language, in the vendor's
|
|
197
|
+
* order.
|
|
198
|
+
*/
|
|
199
|
+
export const VoicesListedSchema = z.strictObject({
|
|
200
|
+
tts: z.string(),
|
|
201
|
+
language: z.string().nullable(),
|
|
202
|
+
voices: z.array(ListedVoiceSchema),
|
|
203
|
+
});
|
|
204
|
+
/**
|
|
205
|
+
* POST /v1/voices/sample, the body: which vendor, which voice, which model and which words to
|
|
206
|
+
* hear. The answer is the WAV itself (`audio/wav`), with `Server-Timing: first-audio;dur=…,
|
|
207
|
+
* total;dur=…` in milliseconds.
|
|
208
|
+
*/
|
|
209
|
+
export const VoiceSampleSchema = z.strictObject({
|
|
210
|
+
tts: z.string(),
|
|
211
|
+
voice: z.string(),
|
|
212
|
+
model: z.string().nullable().nullish(),
|
|
213
|
+
language: z.string().nullable().nullish(),
|
|
214
|
+
text: z.string().nullable().nullish(),
|
|
215
|
+
});
|
|
216
|
+
/** When one of the agent's own judges reads a call: every call, or only one a persona played. */
|
|
217
|
+
export const RunsOnSchema = z.enum(["every-call", "simulations"]);
|
|
218
|
+
/**
|
|
219
|
+
* One judge of an agent's own: a question about its job that the judge model answers held or
|
|
220
|
+
* broken at hang-up, beside the runtime's panel. One list per agent, the same in both worlds.
|
|
221
|
+
*/
|
|
222
|
+
export const JudgeSchema = z.strictObject({
|
|
223
|
+
name: z.string(),
|
|
224
|
+
question: z.string(),
|
|
225
|
+
runs_on: RunsOnSchema,
|
|
226
|
+
author: z.string(),
|
|
227
|
+
set_at: z.number(),
|
|
228
|
+
});
|
|
229
|
+
/** GET /v1/agents/{slug}/judges, and what PUT and DELETE answer: the agent's own judges, by name. */
|
|
230
|
+
export const JudgeListSchema = z.strictObject({
|
|
231
|
+
judges: z.array(JudgeSchema),
|
|
232
|
+
});
|
|
233
|
+
/** PUT /v1/agents/{slug}/judges/{name}, the body: the question, and which calls it reads. */
|
|
234
|
+
export const JudgePutSchema = z.strictObject({
|
|
235
|
+
question: z.string(),
|
|
236
|
+
runs_on: RunsOnSchema.nullish(),
|
|
237
|
+
});
|
|
238
|
+
//# sourceMappingURL=rest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rest.js","sourceRoot":"","sources":["../../src/wire/rest.ts"],"names":[],"mappings":"AAAA,yGAAyG;AAEzG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,aAAa,EACb,aAAa,EACb,UAAU,EACV,eAAe,EACf,eAAe,EACf,SAAS,GACV,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEpE;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC/C,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE;IACb,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE;IACf,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;AAE/E,gGAAgG;AAChG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC9C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,C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CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE;IACzC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE;CACtC,CAAC,CAAC;AAIH,iGAAiG;AACjG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;AAIlE;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,YAAY,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAIH,qGAAqG;AACrG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,YAAY,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;CAC7B,CAAC,CAAC;AAIH,6FAA6F;AAC7F,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,YAAY,CAAC;IAC3C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,YAAY,CAAC,OAAO,EAAE;CAChC,CAAC,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** The room's facts: who joined, who left, what they published. */
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/**
|
|
4
|
+
* The LiveKit room exists and the call lives in it. Phone and web calls have one; a text session
|
|
5
|
+
* has no room and never logs this.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RoomOpenedSchema: z.ZodObject<{
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
sid: z.ZodString;
|
|
10
|
+
channel: z.ZodEnum<{
|
|
11
|
+
phone: "phone";
|
|
12
|
+
web: "web";
|
|
13
|
+
whatsapp: "whatsapp";
|
|
14
|
+
}>;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
/**
|
|
17
|
+
* Somebody joined the room: the caller over SIP or the widget, the agent, a supervisor, a
|
|
18
|
+
* listener, or a second SIP leg. Their attributes travel verbatim: the caller's number is a fact
|
|
19
|
+
* of the room, not a field we invent.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ParticipantJoinedSchema: z.ZodObject<{
|
|
22
|
+
identity: z.ZodString;
|
|
23
|
+
kind: z.ZodEnum<{
|
|
24
|
+
agent: "agent";
|
|
25
|
+
caller: "caller";
|
|
26
|
+
listener: "listener";
|
|
27
|
+
sip: "sip";
|
|
28
|
+
supervisor: "supervisor";
|
|
29
|
+
}>;
|
|
30
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
attributes: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
export type ParticipantJoined = z.infer<typeof ParticipantJoinedSchema>;
|
|
34
|
+
/** Somebody left the room. When it is the caller, call.ended follows. */
|
|
35
|
+
export declare const ParticipantLeftSchema: z.ZodObject<{
|
|
36
|
+
identity: z.ZodString;
|
|
37
|
+
reason: z.ZodString;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
/**
|
|
40
|
+
* The room's own voice activity for one participant flipped. Ephemeral: it is a light for the
|
|
41
|
+
* console, and the turns say who spoke.
|
|
42
|
+
*/
|
|
43
|
+
export declare const ParticipantSpeakingSchema: z.ZodObject<{
|
|
44
|
+
identity: z.ZodString;
|
|
45
|
+
speaking: z.ZodBoolean;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
/** A participant put a track on the room: their microphone, their camera, a screen. */
|
|
48
|
+
export declare const TrackPublishedSchema: z.ZodObject<{
|
|
49
|
+
identity: z.ZodString;
|
|
50
|
+
kind: z.ZodEnum<{
|
|
51
|
+
audio: "audio";
|
|
52
|
+
screen: "screen";
|
|
53
|
+
video: "video";
|
|
54
|
+
}>;
|
|
55
|
+
source: z.ZodEnum<{
|
|
56
|
+
camera: "camera";
|
|
57
|
+
microphone: "microphone";
|
|
58
|
+
screen_share: "screen_share";
|
|
59
|
+
screen_share_audio: "screen_share_audio";
|
|
60
|
+
unknown: "unknown";
|
|
61
|
+
}>;
|
|
62
|
+
}, z.core.$strict>;
|
|
63
|
+
/**
|
|
64
|
+
* A participant's track left the room: they stopped sharing, or a participant.mute took their
|
|
65
|
+
* audio away.
|
|
66
|
+
*/
|
|
67
|
+
export declare const TrackUnpublishedSchema: z.ZodObject<{
|
|
68
|
+
identity: z.ZodString;
|
|
69
|
+
kind: z.ZodEnum<{
|
|
70
|
+
audio: "audio";
|
|
71
|
+
screen: "screen";
|
|
72
|
+
video: "video";
|
|
73
|
+
}>;
|
|
74
|
+
source: z.ZodEnum<{
|
|
75
|
+
camera: "camera";
|
|
76
|
+
microphone: "microphone";
|
|
77
|
+
screen_share: "screen_share";
|
|
78
|
+
screen_share_audio: "screen_share_audio";
|
|
79
|
+
unknown: "unknown";
|
|
80
|
+
}>;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
/**
|
|
83
|
+
* A fact arrived from outside the conversation: the tenant's backend sent call.event, or a
|
|
84
|
+
* participant's browser sent pinecall.event. One event for both, told apart by source. It reached
|
|
85
|
+
* the log only because the agent declared the name in its events, from that source; anything else
|
|
86
|
+
* was refused before this.
|
|
87
|
+
*/
|
|
88
|
+
export declare const EventReceivedSchema: z.ZodObject<{
|
|
89
|
+
name: z.ZodString;
|
|
90
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
91
|
+
source: z.ZodEnum<{
|
|
92
|
+
app: "app";
|
|
93
|
+
participant: "participant";
|
|
94
|
+
}>;
|
|
95
|
+
identity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
/**
|
|
98
|
+
* The agent pushed a payload to a browser in the room, on the tenant's room.send. Ephemeral, and
|
|
99
|
+
* the payload stays out of the log: the tenant chose what to send and to whom.
|
|
100
|
+
*/
|
|
101
|
+
export declare const RoomSentSchema: z.ZodObject<{
|
|
102
|
+
topic: z.ZodString;
|
|
103
|
+
to: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
|
+
bytes: z.ZodInt;
|
|
105
|
+
}, z.core.$strict>;
|
|
106
|
+
//# sourceMappingURL=room.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"room.d.ts","sourceRoot":"","sources":["../../src/wire/room.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAEnE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;kBAI3B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;kBAKlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,yEAAyE;AACzE,eAAO,MAAM,qBAAqB;;;kBAGhC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;kBAGpC,CAAC;AAEH,uFAAuF;AACvF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;kBAI/B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;kBAIjC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;kBAK9B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;kBAIzB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/** The room's facts: who joined, who left, what they published. */
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { ChannelSchema, EventSourceSchema, ParticipantKindSchema, TrackKindSchema, TrackSourceSchema, } from "./defs.js";
|
|
4
|
+
/**
|
|
5
|
+
* The LiveKit room exists and the call lives in it. Phone and web calls have one; a text session
|
|
6
|
+
* has no room and never logs this.
|
|
7
|
+
*/
|
|
8
|
+
export const RoomOpenedSchema = z.strictObject({
|
|
9
|
+
name: z.string(),
|
|
10
|
+
sid: z.string(),
|
|
11
|
+
channel: ChannelSchema,
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Somebody joined the room: the caller over SIP or the widget, the agent, a supervisor, a
|
|
15
|
+
* listener, or a second SIP leg. Their attributes travel verbatim: the caller's number is a fact
|
|
16
|
+
* of the room, not a field we invent.
|
|
17
|
+
*/
|
|
18
|
+
export const ParticipantJoinedSchema = z.strictObject({
|
|
19
|
+
identity: z.string(),
|
|
20
|
+
kind: ParticipantKindSchema,
|
|
21
|
+
name: z.string().nullish(),
|
|
22
|
+
attributes: z.record(z.string(), z.unknown()),
|
|
23
|
+
});
|
|
24
|
+
/** Somebody left the room. When it is the caller, call.ended follows. */
|
|
25
|
+
export const ParticipantLeftSchema = z.strictObject({
|
|
26
|
+
identity: z.string(),
|
|
27
|
+
reason: z.string(),
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* The room's own voice activity for one participant flipped. Ephemeral: it is a light for the
|
|
31
|
+
* console, and the turns say who spoke.
|
|
32
|
+
*/
|
|
33
|
+
export const ParticipantSpeakingSchema = z.strictObject({
|
|
34
|
+
identity: z.string(),
|
|
35
|
+
speaking: z.boolean(),
|
|
36
|
+
});
|
|
37
|
+
/** A participant put a track on the room: their microphone, their camera, a screen. */
|
|
38
|
+
export const TrackPublishedSchema = z.strictObject({
|
|
39
|
+
identity: z.string(),
|
|
40
|
+
kind: TrackKindSchema,
|
|
41
|
+
source: TrackSourceSchema,
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* A participant's track left the room: they stopped sharing, or a participant.mute took their
|
|
45
|
+
* audio away.
|
|
46
|
+
*/
|
|
47
|
+
export const TrackUnpublishedSchema = z.strictObject({
|
|
48
|
+
identity: z.string(),
|
|
49
|
+
kind: TrackKindSchema,
|
|
50
|
+
source: TrackSourceSchema,
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* A fact arrived from outside the conversation: the tenant's backend sent call.event, or a
|
|
54
|
+
* participant's browser sent pinecall.event. One event for both, told apart by source. It reached
|
|
55
|
+
* the log only because the agent declared the name in its events, from that source; anything else
|
|
56
|
+
* was refused before this.
|
|
57
|
+
*/
|
|
58
|
+
export const EventReceivedSchema = z.strictObject({
|
|
59
|
+
name: z.string(),
|
|
60
|
+
data: z.record(z.string(), z.unknown()),
|
|
61
|
+
source: EventSourceSchema,
|
|
62
|
+
identity: z.string().nullish(),
|
|
63
|
+
});
|
|
64
|
+
/**
|
|
65
|
+
* The agent pushed a payload to a browser in the room, on the tenant's room.send. Ephemeral, and
|
|
66
|
+
* the payload stays out of the log: the tenant chose what to send and to whom.
|
|
67
|
+
*/
|
|
68
|
+
export const RoomSentSchema = z.strictObject({
|
|
69
|
+
topic: z.string(),
|
|
70
|
+
to: z.string().nullish(),
|
|
71
|
+
bytes: z.int(),
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=room.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"room.js","sourceRoot":"","sources":["../../src/wire/room.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAEnE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,GAClB,MAAM,WAAW,CAAC;AAEnB;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB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