@tangle-network/agent-app 0.63.75 → 0.63.77
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/{DesignCanvas-566V5KVC.js → DesignCanvas-JA5O6Y6C.js} +4 -5
- package/dist/{DesignCanvasEditor-PUO5Y6FB.js → DesignCanvasEditor-6SQAQGOY.js} +5 -6
- package/dist/agent-profiles/d1.js +3 -3
- package/dist/agent-profiles/index.js +3 -3
- package/dist/app-auth/index.js +1 -2
- package/dist/app-auth/index.js.map +1 -1
- package/dist/assistant/index.js +5 -6
- package/dist/assistant/index.js.map +1 -1
- package/dist/chat-routes/agent-producers.d.ts +5 -2
- package/dist/chat-routes/index.js +9 -10
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-store/index.js +1 -1
- package/dist/chat-store/parts.d.ts +4 -1
- package/dist/{chunk-JLFFTSWN.js → chunk-2CRRXINH.js} +20 -8
- package/dist/chunk-2CRRXINH.js.map +1 -0
- package/dist/{chunk-WYQTPFPI.js → chunk-3ELC7F62.js} +2 -2
- package/dist/{chunk-XJ7DC2DI.js → chunk-DNM5CN3R.js} +3 -3
- package/dist/{chunk-E2JMXA2V.js → chunk-DURND7YS.js} +5 -5
- package/dist/{chunk-E2JMXA2V.js.map → chunk-DURND7YS.js.map} +1 -1
- package/dist/{chunk-GAYWV565.js → chunk-H3XWDX4Z.js} +2 -2
- package/dist/chunk-H3XWDX4Z.js.map +1 -0
- package/dist/{chunk-RKNNMC6T.js → chunk-H6BRJU5M.js} +1 -1
- package/dist/{chunk-YG3DSMPS.js → chunk-IWEGCOQR.js} +40 -21
- package/dist/chunk-IWEGCOQR.js.map +1 -0
- package/dist/{chunk-6IMNAZR7.js → chunk-M42DQ6HM.js} +2 -2
- package/dist/{chunk-2ACI3WYT.js → chunk-OWNWWT76.js} +2 -2
- package/dist/{chunk-5ERXADSW.js → chunk-Q54SXI57.js} +2 -2
- package/dist/{chunk-62BPUU3A.js → chunk-V2BC73KQ.js} +5 -5
- package/dist/{chunk-VKJEH6DG.js → chunk-X32H7TXZ.js} +2 -2
- package/dist/{chunk-I4CFBLSJ.js → chunk-Y3HRQVAO.js} +10 -10
- package/dist/{chunk-KBJZMR4E.js → chunk-Y5WTAHWY.js} +1 -1
- package/dist/chunk-Y5WTAHWY.js.map +1 -0
- package/dist/{chunk-YQD2RISF.js → chunk-YAIUAUWJ.js} +3 -3
- package/dist/{chunk-7O62NYGT.js → chunk-YHA6W3OW.js} +2 -2
- package/dist/{chunk-OBKVNZPH.js → chunk-YL5JDX7K.js} +4 -4
- package/dist/{chunk-OBKVNZPH.js.map → chunk-YL5JDX7K.js.map} +1 -1
- package/dist/design-canvas/index.js +1 -2
- package/dist/design-canvas/index.js.map +1 -1
- package/dist/design-canvas-react/engine.js +1 -2
- package/dist/design-canvas-react/index.js +10 -11
- package/dist/design-canvas-react/index.js.map +1 -1
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/platform/index.js +9 -10
- package/dist/platform/index.js.map +1 -1
- package/dist/preset-cloudflare/index.js +7 -7
- package/dist/public-consultation/index.js +8 -9
- package/dist/public-consultation/index.js.map +1 -1
- package/dist/sandbox/index.js +4 -4
- package/dist/sequences/index.js +1 -2
- package/dist/sequences/index.js.map +1 -1
- package/dist/settings-react/index.js +64 -31
- package/dist/settings-react/index.js.map +1 -1
- package/dist/settings-react/members-section.d.ts +15 -5
- package/dist/stories/chat/fixtures.d.ts +5 -5
- package/dist/stories/settings/settings-demo.d.ts +4 -1
- package/dist/teams/index.js +1 -1
- package/dist/teams/invitations-api.d.ts +6 -4
- package/dist/teams/invitations-api.js +4 -2
- package/dist/teams/invitations-api.js.map +1 -1
- package/dist/teams/invitations.d.ts +2 -0
- package/dist/teams/members-api.js +2 -2
- package/dist/teams-react/components/invitation-detail.d.ts +4 -2
- package/dist/teams-react/index.js +2 -2
- package/dist/theme/tokens.css +19 -19
- package/dist/tools/index.js +4 -4
- package/dist/web/index.d.ts +0 -1
- package/dist/web/index.js +1 -7
- package/dist/web-react/chat-stream.d.ts +3 -1
- package/dist/web-react/index.js +9 -10
- package/dist/web-react/message-projection.d.ts +2 -2
- package/dist/work-product/index.js +2 -2
- package/dist/worker-build/index.d.ts +26 -0
- package/dist/worker-build/index.js +73 -0
- package/dist/worker-build/index.js.map +1 -0
- package/package.json +12 -7
- package/dist/chunk-GAYWV565.js.map +0 -1
- package/dist/chunk-JLFFTSWN.js.map +0 -1
- package/dist/chunk-KBJZMR4E.js.map +0 -1
- package/dist/chunk-XBBXPZJI.js +0 -47
- package/dist/chunk-XBBXPZJI.js.map +0 -1
- package/dist/chunk-YG3DSMPS.js.map +0 -1
- package/dist/web/speakers.d.ts +0 -30
- /package/dist/{DesignCanvas-566V5KVC.js.map → DesignCanvas-JA5O6Y6C.js.map} +0 -0
- /package/dist/{DesignCanvasEditor-PUO5Y6FB.js.map → DesignCanvasEditor-6SQAQGOY.js.map} +0 -0
- /package/dist/{chunk-WYQTPFPI.js.map → chunk-3ELC7F62.js.map} +0 -0
- /package/dist/{chunk-XJ7DC2DI.js.map → chunk-DNM5CN3R.js.map} +0 -0
- /package/dist/{chunk-RKNNMC6T.js.map → chunk-H6BRJU5M.js.map} +0 -0
- /package/dist/{chunk-6IMNAZR7.js.map → chunk-M42DQ6HM.js.map} +0 -0
- /package/dist/{chunk-2ACI3WYT.js.map → chunk-OWNWWT76.js.map} +0 -0
- /package/dist/{chunk-5ERXADSW.js.map → chunk-Q54SXI57.js.map} +0 -0
- /package/dist/{chunk-62BPUU3A.js.map → chunk-V2BC73KQ.js.map} +0 -0
- /package/dist/{chunk-VKJEH6DG.js.map → chunk-X32H7TXZ.js.map} +0 -0
- /package/dist/{chunk-I4CFBLSJ.js.map → chunk-Y3HRQVAO.js.map} +0 -0
- /package/dist/{chunk-YQD2RISF.js.map → chunk-YAIUAUWJ.js.map} +0 -0
- /package/dist/{chunk-7O62NYGT.js.map → chunk-YHA6W3OW.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/teams/invitations.ts"],"sourcesContent":["/**\n * Pure invitation helpers for the teams capability. Zero dependencies: no\n * drizzle, no env, no react, no network. The lifecycle API (`./invitations-api`)\n * and an app's own mail transport build on these; the invitation email itself\n * is `inviteEmail` from `@tangle-network/agent-app/email`.\n */\n\nimport type { AssignableWorkspaceRole } from './roles'\n\n/** The role an invitation grants — the assignable workspace ladder (never owner). */\nexport type InvitationPermission = AssignableWorkspaceRole\n\n/** Define possible states for an invitation's lifecycle including pending, accepted, expired, and revoked */\nexport type InvitationStatus = 'pending' | 'accepted' | 'expired' | 'revoked'\n/** Define possible statuses for the sending state of an invitation email */\nexport type InvitationEmailStatus = 'not_sent' | 'sent' | 'failed'\n\n/** Define the number of days before an invitation expires */\nexport const INVITATION_EXPIRY_DAYS = 7\n\nconst INVITATION_PERMISSIONS = ['admin', 'editor', 'viewer'] as const\nconst TOKEN_BYTE_LENGTH = 32\n\n/** Normalize an invitation email by trimming whitespace and converting to lowercase */\nexport function normalizeInvitationEmail(email: string): string {\n return email.trim().toLowerCase()\n}\n\n// One `@`, a local part, and a domain with a dot and a 2+ letter ending. It is\n// the shape a mail server can deliver to, not full RFC 5322: the invite email\n// itself is the real check, and this only stops `founder@` or `founder@example`.\nconst DELIVERABLE_EMAIL = /^[^\\s@]+@[^\\s@.]+(\\.[^\\s@.]+)*\\.[^\\s@.]{2,}$/\n\n/** Whether an address has the shape an invitation can be delivered to. */\nexport function isInvitationEmail(email: string): boolean {\n return DELIVERABLE_EMAIL.test(email.trim())\n}\n\n/** What to tell someone whose invite address cannot be delivered to. */\nexport const INVITATION_EMAIL_HINT = 'Enter a full email address, such as name@company.com.'\n\n/** Resolve invitation permission from a string or return null if invalid */\nexport function parseInvitationPermission(value: string | undefined): InvitationPermission | null {\n return INVITATION_PERMISSIONS.includes(value as InvitationPermission) ? (value as InvitationPermission) : null\n}\n\n/** Calculate the expiration date of an invitation based on the given or current date */\nexport function getInvitationExpiresAt(now: Date = new Date()): Date {\n return new Date(now.getTime() + INVITATION_EXPIRY_DAYS * 24 * 60 * 60 * 1000)\n}\n\n/**\n * A cryptographically-random, URL-safe invitation token. `inv_`-prefixed so a\n * token is self-identifying and never collides with the workspaceMember invite\n * tokens minted by `members-api` (`generateInviteToken`).\n */\nexport function generateInvitationToken(): string {\n const bytes = new Uint8Array(TOKEN_BYTE_LENGTH)\n globalThis.crypto.getRandomValues(bytes)\n const token = Array.from(bytes, (byte) => String.fromCharCode(byte)).join('')\n return `inv_${btoa(token).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/g, '')}`\n}\n\n/** Generate an invite URL by combining the origin with an encoded token */\nexport function inviteUrlForToken(origin: string, token: string): string {\n return `${origin.replace(/\\/+$/, '')}/invite/${encodeURIComponent(token)}`\n}\n"],"mappings":";AAkBO,IAAM,yBAAyB;AAEtC,IAAM,yBAAyB,CAAC,SAAS,UAAU,QAAQ;AAC3D,IAAM,oBAAoB;AAGnB,SAAS,yBAAyB,OAAuB;AAC9D,SAAO,MAAM,KAAK,EAAE,YAAY;AAClC;AAKA,IAAM,oBAAoB;AAGnB,SAAS,kBAAkB,OAAwB;AACxD,SAAO,kBAAkB,KAAK,MAAM,KAAK,CAAC;AAC5C;AAGO,IAAM,wBAAwB;AAG9B,SAAS,0BAA0B,OAAwD;AAChG,SAAO,uBAAuB,SAAS,KAA6B,IAAK,QAAiC;AAC5G;AAGO,SAAS,uBAAuB,MAAY,oBAAI,KAAK,GAAS;AACnE,SAAO,IAAI,KAAK,IAAI,QAAQ,IAAI,yBAAyB,KAAK,KAAK,KAAK,GAAI;AAC9E;AAOO,SAAS,0BAAkC;AAChD,QAAM,QAAQ,IAAI,WAAW,iBAAiB;AAC9C,aAAW,OAAO,gBAAgB,KAAK;AACvC,QAAM,QAAQ,MAAM,KAAK,OAAO,CAAC,SAAS,OAAO,aAAa,IAAI,CAAC,EAAE,KAAK,EAAE;AAC5E,SAAO,OAAO,KAAK,KAAK,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,OAAO,GAAG,EAAE,QAAQ,QAAQ,EAAE,CAAC;AACvF;AAGO,SAAS,kBAAkB,QAAgB,OAAuB;AACvE,SAAO,GAAG,OAAO,QAAQ,QAAQ,EAAE,CAAC,WAAW,mBAAmB,KAAK,CAAC;AAC1E;","names":[]}
|
package/dist/chunk-XBBXPZJI.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// src/web/speakers.ts
|
|
2
|
-
var isSpeaker = (value) => {
|
|
3
|
-
const part = value;
|
|
4
|
-
return !!part && typeof part === "object" && part.type === "speaker" && typeof part.id === "string" && typeof part.name === "string";
|
|
5
|
-
};
|
|
6
|
-
var asRecord = (value) => value;
|
|
7
|
-
var SPEAKER_ROLE_LABEL = "Agent";
|
|
8
|
-
function expandSpeakerRows(rows) {
|
|
9
|
-
const out = [];
|
|
10
|
-
for (const row of rows) {
|
|
11
|
-
const parts = (row.role === "assistant" ? row.parts ?? [] : []).map(asRecord);
|
|
12
|
-
if (!parts.some(isSpeaker)) {
|
|
13
|
-
out.push(row);
|
|
14
|
-
continue;
|
|
15
|
-
}
|
|
16
|
-
let current = null;
|
|
17
|
-
const groups = [];
|
|
18
|
-
for (const part of parts) {
|
|
19
|
-
if (isSpeaker(part)) {
|
|
20
|
-
current = { speaker: { id: part.id, name: part.name, ...typeof part.handle === "string" ? { handle: part.handle } : {} }, parts: [] };
|
|
21
|
-
groups.push(current);
|
|
22
|
-
} else if (current) {
|
|
23
|
-
current.parts.push(part);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
groups.forEach((group, index) => {
|
|
27
|
-
const content = group.parts.filter((part) => part.type === "text" && typeof part.text === "string").map((part) => part.text).join("");
|
|
28
|
-
out.push({
|
|
29
|
-
...row,
|
|
30
|
-
id: `${row.id}#${index}:${group.speaker.id}`,
|
|
31
|
-
author: { id: group.speaker.id, name: group.speaker.name, role: SPEAKER_ROLE_LABEL },
|
|
32
|
-
content,
|
|
33
|
-
parts: group.parts,
|
|
34
|
-
// Client-built views of the whole row do not apply to one speaker's slice.
|
|
35
|
-
segments: void 0,
|
|
36
|
-
toolCalls: void 0
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
return out;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export {
|
|
44
|
-
SPEAKER_ROLE_LABEL,
|
|
45
|
-
expandSpeakerRows
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=chunk-XBBXPZJI.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/web/speakers.ts"],"sourcesContent":["/**\n * A turn addressed to several agents is persisted as ONE assistant row whose\n * parts carry a `speaker` part before each responder's parts. A transcript\n * draws each answer under its author, so this splits such a row into one row\n * per speaker in stored order. Rows without a speaker part pass through\n * untouched, byte for byte. Pure and renderer-neutral: no React, no DOM.\n */\nexport interface SpeakerRow {\n id: string | number\n role?: string\n content: string\n /** Stored parts; the typed store union and raw records are both read. */\n parts?: ReadonlyArray<unknown>\n author?: { id: string; name: string; role?: string; avatarUrl?: string }\n segments?: unknown\n toolCalls?: unknown\n}\n\nexport interface Speaker {\n id: string\n name: string\n handle?: string\n}\n\nconst isSpeaker = (value: unknown): value is Record<string, unknown> & Speaker & { type: 'speaker' } => {\n const part = value as Record<string, unknown> | null\n return !!part && typeof part === 'object' && part.type === 'speaker' && typeof part.id === 'string' && typeof part.name === 'string'\n}\nconst asRecord = (value: unknown): Record<string, unknown> => value as Record<string, unknown>\n\n/** The role label a split row shows beside the agent's name. */\nexport const SPEAKER_ROLE_LABEL = 'Agent'\n\nexport function expandSpeakerRows<T extends SpeakerRow>(rows: readonly T[]): Array<T & Pick<SpeakerRow, 'author'>> {\n const out: Array<T & Pick<SpeakerRow, 'author'>> = []\n for (const row of rows) {\n const parts = (row.role === 'assistant' ? row.parts ?? [] : []).map(asRecord)\n if (!parts.some(isSpeaker)) { out.push(row); continue }\n let current: { speaker: Speaker; parts: Record<string, unknown>[] } | null = null\n const groups: Array<{ speaker: Speaker; parts: Record<string, unknown>[] }> = []\n for (const part of parts) {\n if (isSpeaker(part)) {\n current = { speaker: { id: part.id, name: part.name, ...(typeof part.handle === 'string' ? { handle: part.handle } : {}) }, parts: [] }\n groups.push(current)\n } else if (current) {\n current.parts.push(part)\n }\n // Parts before the first speaker belong to no one and are dropped; the\n // route writes a speaker part first.\n }\n groups.forEach((group, index) => {\n const content = group.parts\n .filter((part) => part.type === 'text' && typeof part.text === 'string')\n .map((part) => part.text as string)\n .join('')\n out.push({\n ...row,\n id: `${row.id}#${index}:${group.speaker.id}`,\n author: { id: group.speaker.id, name: group.speaker.name, role: SPEAKER_ROLE_LABEL },\n content,\n parts: group.parts,\n // Client-built views of the whole row do not apply to one speaker's slice.\n segments: undefined,\n toolCalls: undefined,\n })\n })\n }\n return out\n}\n"],"mappings":";AAwBA,IAAM,YAAY,CAAC,UAAqF;AACtG,QAAM,OAAO;AACb,SAAO,CAAC,CAAC,QAAQ,OAAO,SAAS,YAAY,KAAK,SAAS,aAAa,OAAO,KAAK,OAAO,YAAY,OAAO,KAAK,SAAS;AAC9H;AACA,IAAM,WAAW,CAAC,UAA4C;AAGvD,IAAM,qBAAqB;AAE3B,SAAS,kBAAwC,MAA2D;AACjH,QAAM,MAA6C,CAAC;AACpD,aAAW,OAAO,MAAM;AACtB,UAAM,SAAS,IAAI,SAAS,cAAc,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,QAAQ;AAC5E,QAAI,CAAC,MAAM,KAAK,SAAS,GAAG;AAAE,UAAI,KAAK,GAAG;AAAG;AAAA,IAAS;AACtD,QAAI,UAAyE;AAC7E,UAAM,SAAwE,CAAC;AAC/E,eAAW,QAAQ,OAAO;AACxB,UAAI,UAAU,IAAI,GAAG;AACnB,kBAAU,EAAE,SAAS,EAAE,IAAI,KAAK,IAAI,MAAM,KAAK,MAAM,GAAI,OAAO,KAAK,WAAW,WAAW,EAAE,QAAQ,KAAK,OAAO,IAAI,CAAC,EAAG,GAAG,OAAO,CAAC,EAAE;AACtI,eAAO,KAAK,OAAO;AAAA,MACrB,WAAW,SAAS;AAClB,gBAAQ,MAAM,KAAK,IAAI;AAAA,MACzB;AAAA,IAGF;AACA,WAAO,QAAQ,CAAC,OAAO,UAAU;AAC/B,YAAM,UAAU,MAAM,MACnB,OAAO,CAAC,SAAS,KAAK,SAAS,UAAU,OAAO,KAAK,SAAS,QAAQ,EACtE,IAAI,CAAC,SAAS,KAAK,IAAc,EACjC,KAAK,EAAE;AACV,UAAI,KAAK;AAAA,QACP,GAAG;AAAA,QACH,IAAI,GAAG,IAAI,EAAE,IAAI,KAAK,IAAI,MAAM,QAAQ,EAAE;AAAA,QAC1C,QAAQ,EAAE,IAAI,MAAM,QAAQ,IAAI,MAAM,MAAM,QAAQ,MAAM,MAAM,mBAAmB;AAAA,QACnF;AAAA,QACA,OAAO,MAAM;AAAA;AAAA,QAEb,UAAU;AAAA,QACV,WAAW;AAAA,MACb,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACA,SAAO;AACT;","names":[]}
|