@agent-play/intercom 3.1.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/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # @agent-play/intercom
2
+
3
+ Shared **wire contracts** for Agent Play intercom: Zod parsers, channel key helpers, event names, and payload types used by `@agent-play/sdk`, the web UI, and `@agent-play/play-ui`.
4
+
5
+ Publish order in this monorepo: **`@agent-play/node-tools`** → **`@agent-play/intercom`** → packages that depend on them (e.g. `@agent-play/sdk`).
6
+
7
+ See the [monorepo overview](../../docs/monorepo.md) and [release notes](../../docs/releases/agent-play-3.1.0.md).
@@ -0,0 +1,256 @@
1
+ import { z } from 'zod';
2
+
3
+ type IntercomChannelParts = {
4
+ humanNodeId: string;
5
+ agentStableKey: string;
6
+ };
7
+ declare function encodeHumanStableKeyForIntercom(humanNodeId: string): string;
8
+ declare function buildIntercomChannelKey(parts: IntercomChannelParts): string;
9
+ declare function agentStableKeyFromToPlayerId(toPlayerId: string): string;
10
+
11
+ type IntercomCommandKind = "assist" | "chat";
12
+ type WorldIntercomStatus = "started" | "stream" | "completed" | "failed" | "forwarded";
13
+
14
+ declare const WORLD_INTERCOM_EVENT: "world:intercom";
15
+
16
+ declare const INTERCOM_COMMAND_OP: "intercomCommand";
17
+ declare const INTERCOM_RESPONSE_OP: "intercomResponse";
18
+ declare const CREATE_HUMAN_NODE_OP: "createHumanNode";
19
+
20
+ type IntercomChannelLifecycle = "opened" | "active" | "stale" | "closed";
21
+ declare function openOrReuseIntercomChannel(channelKey: string): "opened" | "reused";
22
+ declare function resetIntercomChannelStateForTests(): void;
23
+
24
+ declare const IntercomCommandPayloadSchema: z.ZodEffects<z.ZodObject<{
25
+ requestId: z.ZodString;
26
+ mainNodeId: z.ZodString;
27
+ fromPlayerId: z.ZodString;
28
+ toPlayerId: z.ZodString;
29
+ kind: z.ZodEnum<["assist", "chat"]>;
30
+ toolName: z.ZodOptional<z.ZodString>;
31
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
32
+ text: z.ZodOptional<z.ZodString>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ requestId: string;
35
+ mainNodeId: string;
36
+ fromPlayerId: string;
37
+ toPlayerId: string;
38
+ kind: "assist" | "chat";
39
+ toolName?: string | undefined;
40
+ args?: Record<string, unknown> | undefined;
41
+ text?: string | undefined;
42
+ }, {
43
+ requestId: string;
44
+ mainNodeId: string;
45
+ fromPlayerId: string;
46
+ toPlayerId: string;
47
+ kind: "assist" | "chat";
48
+ toolName?: string | undefined;
49
+ args?: Record<string, unknown> | undefined;
50
+ text?: string | undefined;
51
+ }>, {
52
+ requestId: string;
53
+ mainNodeId: string;
54
+ fromPlayerId: string;
55
+ toPlayerId: string;
56
+ kind: "assist" | "chat";
57
+ toolName?: string | undefined;
58
+ args?: Record<string, unknown> | undefined;
59
+ text?: string | undefined;
60
+ }, {
61
+ requestId: string;
62
+ mainNodeId: string;
63
+ fromPlayerId: string;
64
+ toPlayerId: string;
65
+ kind: "assist" | "chat";
66
+ toolName?: string | undefined;
67
+ args?: Record<string, unknown> | undefined;
68
+ text?: string | undefined;
69
+ }>;
70
+ declare const WorldIntercomEventPayloadSchema: z.ZodObject<{
71
+ requestId: z.ZodString;
72
+ mainNodeId: z.ZodString;
73
+ toPlayerId: z.ZodString;
74
+ fromPlayerId: z.ZodString;
75
+ kind: z.ZodEnum<["assist", "chat"]>;
76
+ status: z.ZodEnum<["started", "stream", "completed", "failed", "forwarded"]>;
77
+ toolName: z.ZodOptional<z.ZodString>;
78
+ message: z.ZodOptional<z.ZodString>;
79
+ result: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
80
+ error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
81
+ ts: z.ZodString;
82
+ channelKey: z.ZodOptional<z.ZodString>;
83
+ command: z.ZodOptional<z.ZodEffects<z.ZodObject<{
84
+ requestId: z.ZodString;
85
+ mainNodeId: z.ZodString;
86
+ fromPlayerId: z.ZodString;
87
+ toPlayerId: z.ZodString;
88
+ kind: z.ZodEnum<["assist", "chat"]>;
89
+ toolName: z.ZodOptional<z.ZodString>;
90
+ args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
91
+ text: z.ZodOptional<z.ZodString>;
92
+ }, "strip", z.ZodTypeAny, {
93
+ requestId: string;
94
+ mainNodeId: string;
95
+ fromPlayerId: string;
96
+ toPlayerId: string;
97
+ kind: "assist" | "chat";
98
+ toolName?: string | undefined;
99
+ args?: Record<string, unknown> | undefined;
100
+ text?: string | undefined;
101
+ }, {
102
+ requestId: string;
103
+ mainNodeId: string;
104
+ fromPlayerId: string;
105
+ toPlayerId: string;
106
+ kind: "assist" | "chat";
107
+ toolName?: string | undefined;
108
+ args?: Record<string, unknown> | undefined;
109
+ text?: string | undefined;
110
+ }>, {
111
+ requestId: string;
112
+ mainNodeId: string;
113
+ fromPlayerId: string;
114
+ toPlayerId: string;
115
+ kind: "assist" | "chat";
116
+ toolName?: string | undefined;
117
+ args?: Record<string, unknown> | undefined;
118
+ text?: string | undefined;
119
+ }, {
120
+ requestId: string;
121
+ mainNodeId: string;
122
+ fromPlayerId: string;
123
+ toPlayerId: string;
124
+ kind: "assist" | "chat";
125
+ toolName?: string | undefined;
126
+ args?: Record<string, unknown> | undefined;
127
+ text?: string | undefined;
128
+ }>>;
129
+ }, "strip", z.ZodTypeAny, {
130
+ requestId: string;
131
+ mainNodeId: string;
132
+ fromPlayerId: string;
133
+ toPlayerId: string;
134
+ kind: "assist" | "chat";
135
+ status: "started" | "stream" | "completed" | "failed" | "forwarded";
136
+ ts: string;
137
+ message?: string | undefined;
138
+ toolName?: string | undefined;
139
+ result?: Record<string, unknown> | undefined;
140
+ error?: string | null | undefined;
141
+ channelKey?: string | undefined;
142
+ command?: {
143
+ requestId: string;
144
+ mainNodeId: string;
145
+ fromPlayerId: string;
146
+ toPlayerId: string;
147
+ kind: "assist" | "chat";
148
+ toolName?: string | undefined;
149
+ args?: Record<string, unknown> | undefined;
150
+ text?: string | undefined;
151
+ } | undefined;
152
+ }, {
153
+ requestId: string;
154
+ mainNodeId: string;
155
+ fromPlayerId: string;
156
+ toPlayerId: string;
157
+ kind: "assist" | "chat";
158
+ status: "started" | "stream" | "completed" | "failed" | "forwarded";
159
+ ts: string;
160
+ message?: string | undefined;
161
+ toolName?: string | undefined;
162
+ result?: Record<string, unknown> | undefined;
163
+ error?: string | null | undefined;
164
+ channelKey?: string | undefined;
165
+ command?: {
166
+ requestId: string;
167
+ mainNodeId: string;
168
+ fromPlayerId: string;
169
+ toPlayerId: string;
170
+ kind: "assist" | "chat";
171
+ toolName?: string | undefined;
172
+ args?: Record<string, unknown> | undefined;
173
+ text?: string | undefined;
174
+ } | undefined;
175
+ }>;
176
+ declare const IntercomResponsePayloadSchema: z.ZodEffects<z.ZodObject<{
177
+ requestId: z.ZodString;
178
+ mainNodeId: z.ZodString;
179
+ toPlayerId: z.ZodString;
180
+ fromPlayerId: z.ZodString;
181
+ kind: z.ZodEnum<["assist", "chat"]>;
182
+ status: z.ZodEnum<["stream", "completed", "failed"]>;
183
+ toolName: z.ZodOptional<z.ZodString>;
184
+ message: z.ZodOptional<z.ZodString>;
185
+ result: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
186
+ error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
187
+ ts: z.ZodString;
188
+ }, "strip", z.ZodTypeAny, {
189
+ requestId: string;
190
+ mainNodeId: string;
191
+ fromPlayerId: string;
192
+ toPlayerId: string;
193
+ kind: "assist" | "chat";
194
+ status: "stream" | "completed" | "failed";
195
+ ts: string;
196
+ message?: string | undefined;
197
+ toolName?: string | undefined;
198
+ result?: Record<string, unknown> | undefined;
199
+ error?: string | null | undefined;
200
+ }, {
201
+ requestId: string;
202
+ mainNodeId: string;
203
+ fromPlayerId: string;
204
+ toPlayerId: string;
205
+ kind: "assist" | "chat";
206
+ status: "stream" | "completed" | "failed";
207
+ ts: string;
208
+ message?: string | undefined;
209
+ toolName?: string | undefined;
210
+ result?: Record<string, unknown> | undefined;
211
+ error?: string | null | undefined;
212
+ }>, {
213
+ requestId: string;
214
+ mainNodeId: string;
215
+ fromPlayerId: string;
216
+ toPlayerId: string;
217
+ kind: "assist" | "chat";
218
+ status: "stream" | "completed" | "failed";
219
+ ts: string;
220
+ message?: string | undefined;
221
+ toolName?: string | undefined;
222
+ result?: Record<string, unknown> | undefined;
223
+ error?: string | null | undefined;
224
+ }, {
225
+ requestId: string;
226
+ mainNodeId: string;
227
+ fromPlayerId: string;
228
+ toPlayerId: string;
229
+ kind: "assist" | "chat";
230
+ status: "stream" | "completed" | "failed";
231
+ ts: string;
232
+ message?: string | undefined;
233
+ toolName?: string | undefined;
234
+ result?: Record<string, unknown> | undefined;
235
+ error?: string | null | undefined;
236
+ }>;
237
+ declare const CreateHumanNodePayloadSchema: z.ZodObject<{
238
+ consent: z.ZodLiteral<true>;
239
+ passw: z.ZodString;
240
+ }, "strict", z.ZodTypeAny, {
241
+ consent: true;
242
+ passw: string;
243
+ }, {
244
+ consent: true;
245
+ passw: string;
246
+ }>;
247
+ type IntercomCommandPayload = z.infer<typeof IntercomCommandPayloadSchema>;
248
+ type WorldIntercomEventPayload = z.infer<typeof WorldIntercomEventPayloadSchema>;
249
+ type IntercomResponsePayload = z.infer<typeof IntercomResponsePayloadSchema>;
250
+ type CreateHumanNodePayload = z.infer<typeof CreateHumanNodePayloadSchema>;
251
+ declare function parseIntercomCommandPayload(payload: unknown): IntercomCommandPayload;
252
+ declare function parseWorldIntercomEventPayload(payload: unknown): WorldIntercomEventPayload;
253
+ declare function parseIntercomResponsePayload(payload: unknown): IntercomResponsePayload;
254
+ declare function parseCreateHumanNodePayload(payload: unknown): CreateHumanNodePayload;
255
+
256
+ export { CREATE_HUMAN_NODE_OP, type CreateHumanNodePayload, INTERCOM_COMMAND_OP, INTERCOM_RESPONSE_OP, type IntercomChannelLifecycle, type IntercomChannelParts, type IntercomCommandKind, type IntercomCommandPayload, type IntercomResponsePayload, WORLD_INTERCOM_EVENT, type WorldIntercomEventPayload, type WorldIntercomStatus, agentStableKeyFromToPlayerId, buildIntercomChannelKey, encodeHumanStableKeyForIntercom, openOrReuseIntercomChannel, parseCreateHumanNodePayload, parseIntercomCommandPayload, parseIntercomResponsePayload, parseWorldIntercomEventPayload, resetIntercomChannelStateForTests };
package/dist/index.js ADDED
@@ -0,0 +1,143 @@
1
+ // src/channels.ts
2
+ function encodeHumanStableKeyForIntercom(humanNodeId) {
3
+ return humanNodeId.trim();
4
+ }
5
+ function agentIdSegmentForIntercomChannel(agentStableKey) {
6
+ const t = agentStableKey.trim();
7
+ if (t.startsWith("agent:")) {
8
+ return t.slice("agent:".length);
9
+ }
10
+ return t;
11
+ }
12
+ function buildIntercomChannelKey(parts) {
13
+ const human = encodeHumanStableKeyForIntercom(parts.humanNodeId);
14
+ const agentId = agentIdSegmentForIntercomChannel(parts.agentStableKey);
15
+ return `intercom:human:${human}:agent:${agentId}`;
16
+ }
17
+ function agentStableKeyFromToPlayerId(toPlayerId) {
18
+ const t = toPlayerId.trim();
19
+ if (t.startsWith("agent:")) {
20
+ return t;
21
+ }
22
+ return `agent:${t}`;
23
+ }
24
+
25
+ // src/event-types.ts
26
+ var WORLD_INTERCOM_EVENT = "world:intercom";
27
+
28
+ // src/ids.ts
29
+ var INTERCOM_COMMAND_OP = "intercomCommand";
30
+ var INTERCOM_RESPONSE_OP = "intercomResponse";
31
+ var CREATE_HUMAN_NODE_OP = "createHumanNode";
32
+
33
+ // src/intercom-channel-state.ts
34
+ var channelLifecycle = /* @__PURE__ */ new Map();
35
+ function openOrReuseIntercomChannel(channelKey) {
36
+ const prev = channelLifecycle.get(channelKey);
37
+ if (prev === void 0) {
38
+ channelLifecycle.set(channelKey, "active");
39
+ return "opened";
40
+ }
41
+ channelLifecycle.set(channelKey, "active");
42
+ return "reused";
43
+ }
44
+ function resetIntercomChannelStateForTests() {
45
+ channelLifecycle.clear();
46
+ }
47
+
48
+ // src/validator.ts
49
+ import { z } from "zod";
50
+ var NonEmpty = z.string().trim().min(1);
51
+ var IntercomCommandPayloadSchema = z.object({
52
+ requestId: NonEmpty,
53
+ mainNodeId: NonEmpty,
54
+ fromPlayerId: NonEmpty,
55
+ toPlayerId: NonEmpty,
56
+ kind: z.enum(["assist", "chat"]),
57
+ toolName: z.string().optional(),
58
+ args: z.record(z.string(), z.unknown()).optional(),
59
+ text: z.string().optional()
60
+ }).superRefine((value, ctx) => {
61
+ if (value.kind === "assist" && (value.toolName ?? "").trim().length === 0) {
62
+ ctx.addIssue({
63
+ code: z.ZodIssueCode.custom,
64
+ path: ["toolName"],
65
+ message: "toolName is required for assist"
66
+ });
67
+ }
68
+ if (value.kind === "chat" && (value.text ?? "").trim().length === 0) {
69
+ ctx.addIssue({
70
+ code: z.ZodIssueCode.custom,
71
+ path: ["text"],
72
+ message: "text is required for chat"
73
+ });
74
+ }
75
+ });
76
+ var WorldIntercomEventPayloadSchema = z.object({
77
+ requestId: NonEmpty,
78
+ mainNodeId: NonEmpty,
79
+ toPlayerId: NonEmpty,
80
+ fromPlayerId: NonEmpty,
81
+ kind: z.enum(["assist", "chat"]),
82
+ status: z.enum(["started", "stream", "completed", "failed", "forwarded"]),
83
+ toolName: z.string().optional(),
84
+ message: z.string().optional(),
85
+ result: z.record(z.string(), z.unknown()).optional(),
86
+ error: z.string().nullable().optional(),
87
+ ts: NonEmpty,
88
+ channelKey: z.string().optional(),
89
+ command: IntercomCommandPayloadSchema.optional()
90
+ });
91
+ var IntercomResponsePayloadSchema = z.object({
92
+ requestId: NonEmpty,
93
+ mainNodeId: NonEmpty,
94
+ toPlayerId: NonEmpty,
95
+ fromPlayerId: NonEmpty,
96
+ kind: z.enum(["assist", "chat"]),
97
+ status: z.enum(["stream", "completed", "failed"]),
98
+ toolName: z.string().optional(),
99
+ message: z.string().optional(),
100
+ result: z.record(z.string(), z.unknown()).optional(),
101
+ error: z.string().nullable().optional(),
102
+ ts: NonEmpty
103
+ }).superRefine((value, ctx) => {
104
+ if (value.status === "failed" && (value.error ?? "").trim().length === 0) {
105
+ ctx.addIssue({
106
+ code: z.ZodIssueCode.custom,
107
+ path: ["error"],
108
+ message: "error is required when status is failed"
109
+ });
110
+ }
111
+ });
112
+ var CreateHumanNodePayloadSchema = z.object({
113
+ consent: z.literal(true),
114
+ passw: NonEmpty
115
+ }).strict();
116
+ function parseIntercomCommandPayload(payload) {
117
+ return IntercomCommandPayloadSchema.parse(payload);
118
+ }
119
+ function parseWorldIntercomEventPayload(payload) {
120
+ return WorldIntercomEventPayloadSchema.parse(payload);
121
+ }
122
+ function parseIntercomResponsePayload(payload) {
123
+ return IntercomResponsePayloadSchema.parse(payload);
124
+ }
125
+ function parseCreateHumanNodePayload(payload) {
126
+ return CreateHumanNodePayloadSchema.parse(payload);
127
+ }
128
+ export {
129
+ CREATE_HUMAN_NODE_OP,
130
+ INTERCOM_COMMAND_OP,
131
+ INTERCOM_RESPONSE_OP,
132
+ WORLD_INTERCOM_EVENT,
133
+ agentStableKeyFromToPlayerId,
134
+ buildIntercomChannelKey,
135
+ encodeHumanStableKeyForIntercom,
136
+ openOrReuseIntercomChannel,
137
+ parseCreateHumanNodePayload,
138
+ parseIntercomCommandPayload,
139
+ parseIntercomResponsePayload,
140
+ parseWorldIntercomEventPayload,
141
+ resetIntercomChannelStateForTests
142
+ };
143
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/channels.ts","../src/event-types.ts","../src/ids.ts","../src/intercom-channel-state.ts","../src/validator.ts"],"sourcesContent":["export type IntercomChannelParts = {\n humanNodeId: string;\n agentStableKey: string;\n};\n\nexport function encodeHumanStableKeyForIntercom(humanNodeId: string): string {\n return humanNodeId.trim();\n}\n\nfunction agentIdSegmentForIntercomChannel(agentStableKey: string): string {\n const t = agentStableKey.trim();\n if (t.startsWith(\"agent:\")) {\n return t.slice(\"agent:\".length);\n }\n return t;\n}\n\nexport function buildIntercomChannelKey(parts: IntercomChannelParts): string {\n const human = encodeHumanStableKeyForIntercom(parts.humanNodeId);\n const agentId = agentIdSegmentForIntercomChannel(parts.agentStableKey);\n return `intercom:human:${human}:agent:${agentId}`;\n}\n\nexport function agentStableKeyFromToPlayerId(toPlayerId: string): string {\n const t = toPlayerId.trim();\n if (t.startsWith(\"agent:\")) {\n return t;\n }\n return `agent:${t}`;\n}\n","export const WORLD_INTERCOM_EVENT = \"world:intercom\" as const;\n","export const INTERCOM_COMMAND_OP = \"intercomCommand\" as const;\n\nexport const INTERCOM_RESPONSE_OP = \"intercomResponse\" as const;\n\nexport const CREATE_HUMAN_NODE_OP = \"createHumanNode\" as const;\n","export type IntercomChannelLifecycle = \"opened\" | \"active\" | \"stale\" | \"closed\";\n\nconst channelLifecycle = new Map<string, IntercomChannelLifecycle>();\n\nexport function openOrReuseIntercomChannel(\n channelKey: string\n): \"opened\" | \"reused\" {\n const prev = channelLifecycle.get(channelKey);\n if (prev === undefined) {\n channelLifecycle.set(channelKey, \"active\");\n return \"opened\";\n }\n channelLifecycle.set(channelKey, \"active\");\n return \"reused\";\n}\n\nexport function resetIntercomChannelStateForTests(): void {\n channelLifecycle.clear();\n}\n","import { z } from \"zod\";\n\nconst NonEmpty = z.string().trim().min(1);\n\nconst IntercomCommandPayloadSchema = z\n .object({\n requestId: NonEmpty,\n mainNodeId: NonEmpty,\n fromPlayerId: NonEmpty,\n toPlayerId: NonEmpty,\n kind: z.enum([\"assist\", \"chat\"]),\n toolName: z.string().optional(),\n args: z.record(z.string(), z.unknown()).optional(),\n text: z.string().optional(),\n })\n .superRefine((value, ctx) => {\n if (value.kind === \"assist\" && (value.toolName ?? \"\").trim().length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"toolName\"],\n message: \"toolName is required for assist\",\n });\n }\n if (value.kind === \"chat\" && (value.text ?? \"\").trim().length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"text\"],\n message: \"text is required for chat\",\n });\n }\n });\n\nconst WorldIntercomEventPayloadSchema = z.object({\n requestId: NonEmpty,\n mainNodeId: NonEmpty,\n toPlayerId: NonEmpty,\n fromPlayerId: NonEmpty,\n kind: z.enum([\"assist\", \"chat\"]),\n status: z.enum([\"started\", \"stream\", \"completed\", \"failed\", \"forwarded\"]),\n toolName: z.string().optional(),\n message: z.string().optional(),\n result: z.record(z.string(), z.unknown()).optional(),\n error: z.string().nullable().optional(),\n ts: NonEmpty,\n channelKey: z.string().optional(),\n command: IntercomCommandPayloadSchema.optional(),\n});\n\nconst IntercomResponsePayloadSchema = z\n .object({\n requestId: NonEmpty,\n mainNodeId: NonEmpty,\n toPlayerId: NonEmpty,\n fromPlayerId: NonEmpty,\n kind: z.enum([\"assist\", \"chat\"]),\n status: z.enum([\"stream\", \"completed\", \"failed\"]),\n toolName: z.string().optional(),\n message: z.string().optional(),\n result: z.record(z.string(), z.unknown()).optional(),\n error: z.string().nullable().optional(),\n ts: NonEmpty,\n })\n .superRefine((value, ctx) => {\n if (value.status === \"failed\" && (value.error ?? \"\").trim().length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"error\"],\n message: \"error is required when status is failed\",\n });\n }\n });\n\nconst CreateHumanNodePayloadSchema = z\n .object({\n consent: z.literal(true),\n passw: NonEmpty,\n })\n .strict();\n\nexport type IntercomCommandPayload = z.infer<typeof IntercomCommandPayloadSchema>;\nexport type WorldIntercomEventPayload = z.infer<\n typeof WorldIntercomEventPayloadSchema\n>;\nexport type IntercomResponsePayload = z.infer<\n typeof IntercomResponsePayloadSchema\n>;\nexport type CreateHumanNodePayload = z.infer<typeof CreateHumanNodePayloadSchema>;\n\nexport function parseIntercomCommandPayload(\n payload: unknown\n): IntercomCommandPayload {\n return IntercomCommandPayloadSchema.parse(payload);\n}\n\nexport function parseWorldIntercomEventPayload(\n payload: unknown\n): WorldIntercomEventPayload {\n return WorldIntercomEventPayloadSchema.parse(payload);\n}\n\nexport function parseIntercomResponsePayload(\n payload: unknown\n): IntercomResponsePayload {\n return IntercomResponsePayloadSchema.parse(payload);\n}\n\nexport function parseCreateHumanNodePayload(\n payload: unknown\n): CreateHumanNodePayload {\n return CreateHumanNodePayloadSchema.parse(payload);\n}\n"],"mappings":"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","names":[]}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@agent-play/intercom",
3
+ "version": "3.1.0",
4
+ "description": "Shared wire types, Zod parsers, and channel keys for Agent Play human–agent intercom (assist/chat). Consumed by @agent-play/sdk and browser bundles.",
5
+ "private": false,
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "README.md"
18
+ ],
19
+ "author": "Isaac Williams",
20
+ "license": "MIT",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://github.com/wilforlan/agent-play.git",
24
+ "directory": "packages/intercom"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "scripts": {
30
+ "build": "tsup",
31
+ "test": "vitest run"
32
+ },
33
+ "dependencies": {
34
+ "zod": "^3.24.2"
35
+ },
36
+ "devDependencies": {
37
+ "@types/node": "^22.10.0",
38
+ "tsup": "^8.5.1",
39
+ "typescript": "~5.9.3",
40
+ "vitest": "^4.1.1"
41
+ }
42
+ }