@mgamadeus/ddd-agents 0.3.13 → 0.3.14

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.
Files changed (45) hide show
  1. package/README.md +33 -0
  2. package/dist/chat.js +12 -12
  3. package/dist/chat.js.map +1 -1
  4. package/dist/chunks/{ConversationMessageInputComposerWidgets-CPV4BK3v.js → ConversationMessageInputComposerWidgets-D5NlHJlV.js} +5 -5
  5. package/dist/chunks/{ConversationMessageInputComposerWidgets-CPV4BK3v.js.map → ConversationMessageInputComposerWidgets-D5NlHJlV.js.map} +1 -1
  6. package/dist/chunks/{WebSearchResultsConversationWidget-DTnsU_C-.js → WebSearchResultsConversationWidget-Dpy5qp4j.js} +237 -120
  7. package/dist/chunks/WebSearchResultsConversationWidget-Dpy5qp4j.js.map +1 -0
  8. package/dist/chunks/{canvas-feature-flags-BmmxC3bz.js → canvas-feature-flags-Cn8xBliA.js} +3 -2
  9. package/dist/chunks/{canvas-feature-flags-BmmxC3bz.js.map → canvas-feature-flags-Cn8xBliA.js.map} +1 -1
  10. package/dist/chunks/{canvas-reducers-8GHP6886.js → canvas-reducers-CgL_H6Oc.js} +2 -3
  11. package/dist/chunks/{canvas-reducers-8GHP6886.js.map → canvas-reducers-CgL_H6Oc.js.map} +1 -1
  12. package/dist/chunks/{canvas-title-slot-context-C43hdu4i.js → canvas-title-slot-context-_Kf45ABB.js} +3 -3
  13. package/dist/chunks/{canvas-title-slot-context-C43hdu4i.js.map → canvas-title-slot-context-_Kf45ABB.js.map} +1 -1
  14. package/dist/chunks/{canvasBodies-DJ-gJy-T.js → canvasBodies-4iDPQLb0.js} +5 -5
  15. package/dist/chunks/{canvasBodies-DJ-gJy-T.js.map → canvasBodies-4iDPQLb0.js.map} +1 -1
  16. package/dist/chunks/{canvasStorage-EZDxQQaK.js → canvasStorage-De3tMK4L.js} +2 -2
  17. package/dist/chunks/{canvasStorage-EZDxQQaK.js.map → canvasStorage-De3tMK4L.js.map} +1 -1
  18. package/dist/chunks/{widget-name-resolver-Ne0vKw4N.js → widget-name-resolver-JEJ1Hd0T.js} +2 -2
  19. package/dist/chunks/{widget-name-resolver-Ne0vKw4N.js.map → widget-name-resolver-JEJ1Hd0T.js.map} +1 -1
  20. package/dist/client-testing.js +4 -4
  21. package/dist/files/widgets/DriveFilesConversationWidget/DriveFilesConversationWidget.md +3 -0
  22. package/dist/image-render.js +7 -7
  23. package/dist/index.js +39 -17
  24. package/dist/index.js.map +1 -1
  25. package/dist/kit.js +2 -2
  26. package/dist/preview.js +5 -6
  27. package/dist/preview.js.map +1 -1
  28. package/dist/renderer.js +61 -57
  29. package/dist/renderer.js.map +1 -1
  30. package/dist/styles.css +8 -0
  31. package/dist/types/entries/index.d.ts +2 -0
  32. package/dist/types/entries/widgets.d.ts +1 -0
  33. package/dist/types/renderer/canvas/canvas-behaviours.d.ts +18 -6
  34. package/dist/types/renderer/canvas/canvas-kind-declarations.d.ts +17 -0
  35. package/dist/types/renderer/canvas/canvas-kinds.d.ts +42 -0
  36. package/dist/types/renderer/canvas/canvas-state.d.ts +12 -0
  37. package/dist/types/widgets/CanvasLauncherWidget/CanvasLauncherWidget.d.ts +6 -1
  38. package/dist/types/widgets/DriveFilesConversationWidget/DriveFilesConversationWidget.d.ts +3 -2
  39. package/dist/types/widgets/DriveFilesConversationWidget/shared/drive-file-canvas-openers.d.ts +29 -0
  40. package/dist/widgets.js +61 -58
  41. package/package.json +1 -1
  42. package/public-api.json +15 -0
  43. package/dist/chunks/WebSearchResultsConversationWidget-DTnsU_C-.js.map +0 -1
  44. package/dist/chunks/canvas-behaviours-C9hzl4a0.js +0 -45
  45. package/dist/chunks/canvas-behaviours-C9hzl4a0.js.map +0 -1
@@ -1,45 +0,0 @@
1
- "use client";
2
- import { O as getFurtherCanvasBehaviours } from "./link-navigation-DH3f2g9a.js";
3
- const DEFAULT_CANVAS_WIDTH_PERCENT = 50;
4
- const CANVAS_MIN_WIDTH_PX = 420;
5
- const CHAT_COLUMN_MIN_WIDTH_PX = 360;
6
- const CANVAS_BOXED_INSET_PX = 8;
7
- const CANVAS_FILLS_SCREEN_WIDTH_PERCENT = 72;
8
- const packageCanvasBehaviours = {
9
- conversationSearchResults: { lifetime: "turn", layout: "split", narrowViewport: "none", fullBleed: false },
10
- webSearchResults: { lifetime: "turn", layout: "split", narrowViewport: "none", fullBleed: false },
11
- // One entity's detail, opened from a ComposedView row (`openEntity`) — a click, never a live delivery.
12
- entityDetail: { lifetime: "turn", layout: "split", widthPercent: 40, narrowViewport: "none", fullBleed: false },
13
- // A ComposedView `Map` node, full screen — the widest split a turn canvas takes, the map flush.
14
- mapFullScreen: { lifetime: "turn", layout: "split", widthPercent: 65, narrowViewport: "none", fullBleed: true }
15
- };
16
- const hasOwnCanvasBehaviour = (behaviours, canvasId) => Object.prototype.hasOwnProperty.call(behaviours, canvasId);
17
- const canvasBehaviourOf = (canvasId) => {
18
- if (hasOwnCanvasBehaviour(packageCanvasBehaviours, canvasId)) {
19
- return packageCanvasBehaviours[canvasId];
20
- }
21
- const furtherCanvasBehaviours = getFurtherCanvasBehaviours();
22
- return hasOwnCanvasBehaviour(furtherCanvasBehaviours, canvasId) ? furtherCanvasBehaviours[canvasId] : void 0;
23
- };
24
- const getDeclaredCanvasIds = () => {
25
- const packageCanvasIds = Object.keys(packageCanvasBehaviours);
26
- const furtherCanvasIds = Object.keys(getFurtherCanvasBehaviours()).filter(
27
- (canvasId) => !packageCanvasIds.includes(canvasId)
28
- );
29
- return [...packageCanvasIds, ...furtherCanvasIds];
30
- };
31
- const isCanvasId = (value) => typeof value === "string" && canvasBehaviourOf(value) !== void 0;
32
- const canvasWidthPercentOf = (behaviour) => behaviour.layout === "canvasFillsScreen" ? CANVAS_FILLS_SCREEN_WIDTH_PERCENT : behaviour.widthPercent ?? DEFAULT_CANVAS_WIDTH_PERCENT;
33
- export {
34
- CANVAS_BOXED_INSET_PX as C,
35
- DEFAULT_CANVAS_WIDTH_PERCENT as D,
36
- CANVAS_FILLS_SCREEN_WIDTH_PERCENT as a,
37
- CANVAS_MIN_WIDTH_PX as b,
38
- canvasBehaviourOf as c,
39
- CHAT_COLUMN_MIN_WIDTH_PX as d,
40
- canvasWidthPercentOf as e,
41
- getDeclaredCanvasIds as g,
42
- isCanvasId as i,
43
- packageCanvasBehaviours as p
44
- };
45
- //# sourceMappingURL=canvas-behaviours-C9hzl4a0.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"canvas-behaviours-C9hzl4a0.js","sources":["../../src/renderer/canvas/canvas-behaviours.ts"],"sourcesContent":["import { getFurtherCanvasBehaviours } from \"../../provider/environment\";\n\n/**\n * The CANVAS BEHAVIOURS — one declaration per canvas of how it lives on the surface: how long it stays (`lifetime`),\n * how it takes the screen (`layout`), what happens on a narrow viewport and whether its body starts flush at the top.\n *\n * Keyed on a CANVAS id, not a widget name: one body may have several openers, and one widget can be inline with a\n * detail canvas. The widget registry lists which canvases a widget may open (`opensCanvases`); the canvas BODIES (React\n * components) live in `canvasBodies.tsx`, imported only by the shell. The package declares the canvases of its own\n * widgets here (`packageCanvasBehaviours`); an app declares the canvases of its widgets on its agents environment\n * (`AgentsEnvironment.furtherCanvasBehaviours`), read at every lookup. This module imports nothing but the environment\n * module (which has no runtime imports), so the conversation slice and its specs can read it during store\n * initialisation (the widget registry is downstream of the store; a slice → registry import forms a temporal-dead-zone\n * cycle).\n */\n\n/** The canvases of the package's own widgets. */\nexport type PackageCanvasId = \"conversationSearchResults\" | \"webSearchResults\" | \"entityDetail\" | \"mapFullScreen\";\n\n/**\n * The id of a canvas: one of the package's (`PackageCanvasId`) or one an app declares\n * (`AgentsEnvironment.furtherCanvasBehaviours`). Append-only while a stored pointer (`canvasStorage.ts`) may still name\n * the id. A string, because the app's ids are not known to the package; `isCanvasId` checks a value against both.\n */\nexport type CanvasId = PackageCanvasId | (string & {});\n\n/**\n * `turn`: the canvas belongs to one question — the next SEND closes it for good (the card in the transcript is the\n * way back). `pinned`: a work surface for the whole conversation — it stays through sends and stays re-openable after\n * the customer closes it. Lifetime says nothing about a reload: the canvas open at reload time is restored for BOTH.\n */\nexport type CanvasLifetime = \"turn\" | \"pinned\";\n\n/**\n * `split`: the canvas is the right pane beside the chat. `canvasFillsScreen`: the canvas takes the screen and the chat\n * becomes the narrow companion (a full work surface such as an editor); the host's compact mode is overridden while it\n * is open.\n */\nexport type CanvasLayout = \"split\" | \"canvasFillsScreen\";\n\n/**\n * Below the viable split width (`CANVAS_VIABLE_MIN_WIDTH`): `none` — a live delivery does not take the phone screen\n * over (the card stays, the customer taps it), and the wide → narrow crossing closes an open canvas; `overlay` — the\n * canvas is the widget's only surface, so it opens as the full-screen overlay and survives the crossing.\n */\nexport type CanvasNarrowViewport = \"none\" | \"overlay\";\n\nexport interface CanvasBehaviour {\n readonly lifetime: CanvasLifetime;\n readonly layout: CanvasLayout;\n /** Width of the canvas pane as a percentage of the split. Only read for `layout: \"split\"`; default 50. */\n readonly widthPercent?: number;\n readonly narrowViewport: CanvasNarrowViewport;\n /**\n * The body starts flush at its top edge (a hero image, an iframe) — the pane keeps its gap under the close row, unless\n * `overlayCloseButton` floats the row over the body.\n */\n readonly fullBleed: boolean;\n /**\n * The close button floats over the body's top edge instead of reserving a row of its own, and the pane drops its top\n * and side padding — for a body whose top (a hero image) may sit under the button. The button is then muted\n * `inverted` + `onDark`, since it sits on the dark image. Default false: the row stays in flow so it never covers\n * content.\n */\n readonly overlayCloseButton?: boolean;\n /**\n * The body's title sits in the close button's row instead of in a row of its own below it: the body portals it into\n * the pane's title slot (`useCanvasTitleSlot`). Default false: the row holds the button alone.\n */\n readonly titleBesideCloseButton?: boolean;\n}\n\n/** Width of the canvas pane (% of the split) when a behaviour declares none. */\nexport const DEFAULT_CANVAS_WIDTH_PERCENT = 50;\n\n/** The narrowest the customer can pull the canvas (px); pulling further and holding folds the tab into \"close\". */\nexport const CANVAS_MIN_WIDTH_PX = 420;\n\n/** What the chat column keeps beside the widest canvas (px). */\nexport const CHAT_COLUMN_MIN_WIDTH_PX = 360;\n\n/**\n * The boxed canvas card's inset from its pane edge (px) — the pull tab sits on the card's edge, not the pane's. The\n * pane's padding reads it as `--agents-canvas-inset` (`.splitViewPaneBoxed`), so this is the one place it is set.\n */\nexport const CANVAS_BOXED_INSET_PX = 8;\n\n/** Width of the canvas pane for `layout: \"canvasFillsScreen\"` — the chat keeps a narrow companion column. */\nexport const CANVAS_FILLS_SCREEN_WIDTH_PERCENT = 72;\n\n/** The canvases of the package's own widgets. */\nexport const packageCanvasBehaviours: Readonly<Record<PackageCanvasId, CanvasBehaviour>> = {\n conversationSearchResults: { lifetime: \"turn\", layout: \"split\", narrowViewport: \"none\", fullBleed: false },\n webSearchResults: { lifetime: \"turn\", layout: \"split\", narrowViewport: \"none\", fullBleed: false },\n // One entity's detail, opened from a ComposedView row (`openEntity`) — a click, never a live delivery.\n entityDetail: { lifetime: \"turn\", layout: \"split\", widthPercent: 40, narrowViewport: \"none\", fullBleed: false },\n // A ComposedView `Map` node, full screen — the widest split a turn canvas takes, the map flush.\n mapFullScreen: { lifetime: \"turn\", layout: \"split\", widthPercent: 65, narrowViewport: \"none\", fullBleed: true },\n};\n\nconst hasOwnCanvasBehaviour = (behaviours: Readonly<Record<string, CanvasBehaviour>>, canvasId: string): boolean =>\n Object.prototype.hasOwnProperty.call(behaviours, canvasId);\n\n/**\n * The behaviour of a canvas: the package's own, else the one the app declares\n * (`AgentsEnvironment.furtherCanvasBehaviours`); undefined for an id nobody declared (a stale stored pointer, a typo —\n * the opening rule ignores it). An app cannot replace a package canvas's behaviour.\n */\nexport const canvasBehaviourOf = (canvasId: CanvasId): CanvasBehaviour | undefined => {\n if (hasOwnCanvasBehaviour(packageCanvasBehaviours, canvasId)) {\n return packageCanvasBehaviours[canvasId as PackageCanvasId];\n }\n const furtherCanvasBehaviours = getFurtherCanvasBehaviours();\n return hasOwnCanvasBehaviour(furtherCanvasBehaviours, canvasId) ? furtherCanvasBehaviours[canvasId] : undefined;\n};\n\n/** Every declared canvas id: the package's own first, then the app's further ones. */\nexport const getDeclaredCanvasIds = (): readonly CanvasId[] => {\n const packageCanvasIds = Object.keys(packageCanvasBehaviours);\n const furtherCanvasIds = Object.keys(getFurtherCanvasBehaviours()).filter(\n (canvasId) => !packageCanvasIds.includes(canvasId),\n );\n return [...packageCanvasIds, ...furtherCanvasIds];\n};\n\n/** Type guard for a value read from untrusted input (`sessionStorage`, a URL): is it a declared canvas id? */\nexport const isCanvasId = (value: unknown): value is CanvasId =>\n typeof value === \"string\" && canvasBehaviourOf(value) !== undefined;\n\nexport const canvasWidthPercentOf = (behaviour: CanvasBehaviour): number =>\n behaviour.layout === \"canvasFillsScreen\"\n ? CANVAS_FILLS_SCREEN_WIDTH_PERCENT\n : (behaviour.widthPercent ?? DEFAULT_CANVAS_WIDTH_PERCENT);\n"],"names":[],"mappings":";;AAyEO,MAAM,+BAA+B;AAGrC,MAAM,sBAAsB;AAG5B,MAAM,2BAA2B;AAMjC,MAAM,wBAAwB;AAG9B,MAAM,oCAAoC;AAG1C,MAAM,0BAA8E;AAAA,EACzF,2BAA2B,EAAE,UAAU,QAAQ,QAAQ,SAAS,gBAAgB,QAAQ,WAAW,MAAA;AAAA,EACnG,kBAAkB,EAAE,UAAU,QAAQ,QAAQ,SAAS,gBAAgB,QAAQ,WAAW,MAAA;AAAA;AAAA,EAE1F,cAAc,EAAE,UAAU,QAAQ,QAAQ,SAAS,cAAc,IAAI,gBAAgB,QAAQ,WAAW,MAAA;AAAA;AAAA,EAExG,eAAe,EAAE,UAAU,QAAQ,QAAQ,SAAS,cAAc,IAAI,gBAAgB,QAAQ,WAAW,KAAA;AAC3G;AAEA,MAAM,wBAAwB,CAAC,YAAuD,aACpF,OAAO,UAAU,eAAe,KAAK,YAAY,QAAQ;AAOpD,MAAM,oBAAoB,CAAC,aAAoD;AACpF,MAAI,sBAAsB,yBAAyB,QAAQ,GAAG;AAC5D,WAAO,wBAAwB,QAA2B;AAAA,EAC5D;AACA,QAAM,0BAA0B,2BAAA;AAChC,SAAO,sBAAsB,yBAAyB,QAAQ,IAAI,wBAAwB,QAAQ,IAAI;AACxG;AAGO,MAAM,uBAAuB,MAA2B;AAC7D,QAAM,mBAAmB,OAAO,KAAK,uBAAuB;AAC5D,QAAM,mBAAmB,OAAO,KAAK,2BAAA,CAA4B,EAAE;AAAA,IACjE,CAAC,aAAa,CAAC,iBAAiB,SAAS,QAAQ;AAAA,EAAA;AAEnD,SAAO,CAAC,GAAG,kBAAkB,GAAG,gBAAgB;AAClD;AAGO,MAAM,aAAa,CAAC,UACzB,OAAO,UAAU,YAAY,kBAAkB,KAAK,MAAM;AAErD,MAAM,uBAAuB,CAAC,cACnC,UAAU,WAAW,sBACjB,oCACC,UAAU,gBAAgB;"}