@artooi/ag-ui-web-component 0.15.0 → 0.16.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/CHANGELOG.md +72 -1
- package/README.md +13 -2
- package/dist/ag-ui-web-component.bundle.js +40 -39
- package/dist/ag-ui-web-component.bundle.js.map +4 -4
- package/dist/constants.d.ts +9 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/core/agui_client.d.ts.map +1 -1
- package/dist/core/conversation_store.d.ts.map +1 -1
- package/dist/core/remote_conversation_store.d.ts.map +1 -1
- package/dist/core/run_index.d.ts.map +1 -1
- package/dist/index.js +382 -311
- package/dist/index.js.map +4 -4
- package/dist/tools/client_tool_registry.d.ts.map +1 -1
- package/dist/tools/page_action_tools.d.ts.map +1 -1
- package/dist/tools/route_map.d.ts.map +1 -1
- package/dist/ui/attachment_tray.d.ts.map +1 -1
- package/dist/ui/checkpoint_menu.d.ts.map +1 -1
- package/dist/ui/skills_menu.d.ts.map +1 -1
- package/dist/ui/thoughts_block.d.ts.map +1 -1
- package/dist/ui/thread_drawer.d.ts.map +1 -1
- package/dist/ui/tool_call_card.d.ts.map +1 -1
- package/dist/ui/ui_strings.d.ts +4 -0
- package/dist/ui/ui_strings.d.ts.map +1 -1
- package/dist/ui/voice_input.d.ts.map +1 -1
- package/package.json +9 -8
- package/src/constants.ts +10 -0
- package/src/core/ag_ui_chat.ts +86 -3
- package/src/core/remote_conversation_store.ts +2 -2
- package/src/tools/route_map.ts +5 -8
- package/src/ui/ui_strings.ts +7 -0
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_tool_registry.d.ts","sourceRoot":"","sources":["../../src/tools/client_tool_registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxE;AAED;;;;;;GAMG;AACH,qBAAa,kBAAkB;;IAG7B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"client_tool_registry.d.ts","sourceRoot":"","sources":["../../src/tools/client_tool_registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxE;AAED;;;;;;GAMG;AACH,qBAAa,kBAAkB;;IAG7B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAE/B;IAED,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzB;IAED,yCAAyC;IACzC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAM5B;IAED,wDAAwD;IACxD,KAAK,IAAI,IAAI,EAAE,CAMd;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page_action_tools.d.ts","sourceRoot":"","sources":["../../src/tools/page_action_tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,WAAW,GAAG,IAAI,CAAC;AAEvE,8EAA8E;AAC9E,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"page_action_tools.d.ts","sourceRoot":"","sources":["../../src/tools/page_action_tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,WAAW,GAAG,IAAI,CAAC;AAEvE,8EAA8E;AAC9E,eAAO,MAAM,YAAY;aACvB,MAAM,EAAE,QAAQ;aAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAC5B,aAAa,EAAE,iBAAiB,GAC/B,UAAU,EAAE,CASd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route_map.d.ts","sourceRoot":"","sources":["../../src/tools/route_map.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,gEAAgE;AAChE,MAAM,WAAW,KAAK;IACpB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,qDAAqD;AACrD,MAAM,MAAM,QAAQ,GAAG,SAAS,KAAK,EAAE,CAAC;AAExC,yEAAyE;AACzE,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC5C,8EAA8E;IAC9E,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;
|
|
1
|
+
{"version":3,"file":"route_map.d.ts","sourceRoot":"","sources":["../../src/tools/route_map.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,gEAAgE;AAChE,MAAM,WAAW,KAAK;IACpB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,qDAAqD;AACrD,MAAM,MAAM,QAAQ,GAAG,SAAS,KAAK,EAAE,CAAC;AAExC,yEAAyE;AACzE,MAAM,WAAW,eAAgB,SAAQ,KAAK;IAC5C,8EAA8E;IAC9E,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAgDD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,QAAQ,EAC3B,WAAW,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,GACjD,UAAU,EAAE,CA6Cd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment_tray.d.ts","sourceRoot":"","sources":["../../src/ui/attachment_tray.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,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C,OAAO,EAAE,cAAc,CAAC;IAMjC,YAAY,MAAM,EAAE,oBAAoB,EAOvC;IAED,gFAAgF;IAChF,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAsBpB;IAED,8DAA8D;IAC9D,SAAS,IAAI,SAAS,aAAa,EAAE,CAQpC;IAED,gFAAgF;IAChF,UAAU,IAAI,OAAO,CAEpB;IAED,uCAAuC;IACvC,OAAO,IAAI,OAAO,CAEjB;IAED,2EAA2E;IAC3E,UAAU,IAAI,IAAI,CAGjB;IAED,2EAA2E;IAC3E,KAAK,IAAI,IAAI,CAMZ;IAED;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAId;CAoIF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint_menu.d.ts","sourceRoot":"","sources":["../../src/ui/checkpoint_menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,2CAA2C;AAC3C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,qBAAa,cAAc;;IACzB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"checkpoint_menu.d.ts","sourceRoot":"","sources":["../../src/ui/checkpoint_menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,2CAA2C;AAC3C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE/C;;;;;;;;;;;;;GAaG;AACH,qBAAa,cAAc;;IACzB,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAQjC,YACE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,KAAK,IAAI,EACrD,OAAO,GAAE,SAA8B,EA+BxC;IAED,iEAAiE;IACjE,OAAO,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAGrC;IAED,oEAAoE;IACpE,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAKnC;IAED,IAAI,IAAI,IAAI,CAEX;IAED,KAAK,IAAI,IAAI,CAEZ;IAED,IAAI,KAAK,IAAI,OAAO,CAEnB;CA8DF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills_menu.d.ts","sourceRoot":"","sources":["../../src/ui/skills_menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,qBAAa,UAAU;;IACrB,uFAAuF;IACvF,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"skills_menu.d.ts","sourceRoot":"","sources":["../../src/ui/skills_menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,qBAAa,UAAU;;IACrB,uFAAuF;IACvF,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IASjC,YAAY,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,EAWzC;IAED,6DAA6D;IAC7D,SAAS,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,IAAI,CAGxC;IAED,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAGlC;IAED,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAElC;IAED,6CAA6C;IAC7C,MAAM,IAAI,OAAO,CAEhB;IAED;;;OAGG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAM3B;IAED;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAyBvC;IAED,yBAAyB;IACzB,KAAK,IAAI,IAAI,CAGZ;CA0EF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thoughts_block.d.ts","sourceRoot":"","sources":["../../src/ui/thoughts_block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE;;;;;;;;;;;;;GAaG;AACH,qBAAa,aAAa;;IACxB,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"thoughts_block.d.ts","sourceRoot":"","sources":["../../src/ui/thoughts_block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE;;;;;;;;;;;;;GAaG;AACH,qBAAa,aAAa;;IACxB,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAQjC,YAAY,OAAO,GAAE,SAA8B,EA+BlD;IAED,iFAAiF;IACjF,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE3B;IAED;;;;OAIG;IACH,QAAQ,IAAI,IAAI,CAOf;CAOF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread_drawer.d.ts","sourceRoot":"","sources":["../../src/ui/thread_drawer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,sEAAsE;AACtE,MAAM,WAAW,qBAAqB;IACpC,8DAA8D;IAC9D,QAAQ,CAAC,QA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,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAMnC;IAED,MAAM,IAAI,OAAO,CAEhB;IAED,IAAI,IAAI,IAAI,CASX;IAED,KAAK,IAAI,IAAI,CAOZ;IAED,MAAM,IAAI,IAAI,CAMb;IAgCD,4EAA4E;IAC5E,UAAU,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAIjE;CAiJF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool_call_card.d.ts","sourceRoot":"","sources":["../../src/ui/tool_call_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAEtF,sCAAsC;AACtC,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE/E,0EAA0E;AAC1E,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,cAAc,EAAE,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAqBrF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,YAAY;;IACvB,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"tool_call_card.d.ts","sourceRoot":"","sources":["../../src/ui/tool_call_card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErE,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAEtF,sCAAsC;AACtC,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE/E,0EAA0E;AAC1E,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,cAAc,EAAE,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAqBrF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,YAAY;;IACvB,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAQjC,YACE,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,IAAI,GAAE,eAAmC,EACzC,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,GAAE,SAA8B,EA8CxC;IAED,gFAAgF;IAChF,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAyChD;CACF"}
|
package/dist/ui/ui_strings.d.ts
CHANGED
|
@@ -50,6 +50,10 @@ export interface UiStrings {
|
|
|
50
50
|
historyCompacted: string;
|
|
51
51
|
/** Notice shown when the agent loads an agent skill. Token: `{name}`. */
|
|
52
52
|
usingSkill: string;
|
|
53
|
+
/** Notice shown on mount when the previous run never produced a response. */
|
|
54
|
+
runInterrupted: string;
|
|
55
|
+
/** Tool-result content (and card text) when the page moved mid-run. */
|
|
56
|
+
pageMoved: string;
|
|
53
57
|
/** `aria-label` of the message textarea. */
|
|
54
58
|
message: string;
|
|
55
59
|
/** Placeholder of the message textarea. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui_strings.d.ts","sourceRoot":"","sources":["../../src/ui/ui_strings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAA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BAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"voice_input.d.ts","sourceRoot":"","sources":["../../src/ui/voice_input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAKrE,mDAAmD;AACnD,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,UAAU,EAAE,iBAAiB,CAAC;IACvC,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,yCAAyC;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;CAC9B;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,UAAU;;IACrB,kDAAkD;IAClD,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IAWpC,YAAY,OAAO,EAAE,iBAAiB,EAcrC;IAED,uEAAuE;IACjE,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAS5B;IA6BD;;;;;;OAMG;IACH,OAAO,IAAI,IAAI,CAOd;CAyDF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artooi/ag-ui-web-component",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Framework-free <ag-ui-chat> Web Component over the AG-UI protocol. Drop-in chat sidebar with a pluggable client-side tool registry, DOM driver primitives, animations, and destructive-action confirmation modal.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -57,18 +57,19 @@
|
|
|
57
57
|
"@ag-ui/client": ">=0.0.54 <0.1",
|
|
58
58
|
"@ag-ui/core": ">=0.0.54 <0.1",
|
|
59
59
|
"dompurify": "^3.4.13",
|
|
60
|
-
"marked": "^18.0.
|
|
60
|
+
"marked": "^18.0.9"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@biomejs/biome": "^2.
|
|
64
|
-
"@types/node": "^26.1.
|
|
65
|
-
"@vitest/browser": "^
|
|
66
|
-
"@vitest/
|
|
63
|
+
"@biomejs/biome": "^2.5.7",
|
|
64
|
+
"@types/node": "^26.1.2",
|
|
65
|
+
"@vitest/browser": "^4.1.10",
|
|
66
|
+
"@vitest/browser-playwright": "^4.1.10",
|
|
67
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
67
68
|
"esbuild": "^0.28.1",
|
|
68
69
|
"happy-dom": "^20.11.1",
|
|
69
70
|
"playwright": "^1.62.1",
|
|
70
|
-
"typescript": "^
|
|
71
|
-
"vitest": "^
|
|
71
|
+
"typescript": "^7.0.2",
|
|
72
|
+
"vitest": "^4.1.10"
|
|
72
73
|
},
|
|
73
74
|
"scripts": {
|
|
74
75
|
"build": "node esbuild.config.mjs && tsc -p tsconfig.build.json",
|
package/src/constants.ts
CHANGED
|
@@ -66,6 +66,16 @@ export const X_SUMMARY_KEY = "x-summary";
|
|
|
66
66
|
*/
|
|
67
67
|
export const X_NAVIGATES_KEY = "x-navigates";
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* Name of the built-in tool that re-reads the current page.
|
|
71
|
+
*
|
|
72
|
+
* Registered only when a page-map provider is set. Named here because it is
|
|
73
|
+
* also the documented recovery from a stale page, so the stale-page guard has
|
|
74
|
+
* to exempt it — refusing the very call that would refresh the agent's view
|
|
75
|
+
* would be a deadlock.
|
|
76
|
+
*/
|
|
77
|
+
export const READ_PAGE_TOOL = "read_page";
|
|
78
|
+
|
|
69
79
|
/** Upper bound on frontend tool-call → re-run rounds within one send. */
|
|
70
80
|
export const MAX_TOOL_ROUNDS = 10;
|
|
71
81
|
|
package/src/core/ag_ui_chat.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
DEFAULT_ATTACHMENT_MAX_BYTES,
|
|
5
5
|
LOAD_CAPABILITY_TOOL,
|
|
6
6
|
MESSAGE_ROLE,
|
|
7
|
+
READ_PAGE_TOOL,
|
|
7
8
|
STATE_EVENT,
|
|
8
9
|
SUBMIT_EVENT,
|
|
9
10
|
TOGGLE_EVENT,
|
|
@@ -339,6 +340,10 @@ export class AgUiChat extends HTMLElement {
|
|
|
339
340
|
// the Send⇄Stop button: `agent.isRunning` is false between frontend-tool
|
|
340
341
|
// rounds, but the user must still be able to stop there.
|
|
341
342
|
#running = false;
|
|
343
|
+
// The page the current round's context describes, captured when that context
|
|
344
|
+
// was built. `null` until the first round. Compared in `#executeTool` to
|
|
345
|
+
// catch a page that moved under a round still in flight.
|
|
346
|
+
#contextHref: string | null = null;
|
|
342
347
|
// Aborting this dismisses (declines) an open confirmation card when the run
|
|
343
348
|
// is cancelled while the card awaits a decision. One controller per card.
|
|
344
349
|
#confirmAbort: AbortController | null = null;
|
|
@@ -461,7 +466,7 @@ export class AgUiChat extends HTMLElement {
|
|
|
461
466
|
agent,
|
|
462
467
|
handlers: this.#handlers(),
|
|
463
468
|
getTools: () => this.getTools(),
|
|
464
|
-
getContext: () => this
|
|
469
|
+
getContext: () => this.#buildContext(),
|
|
465
470
|
executeTool: (call) => this.#executeTool(call),
|
|
466
471
|
resolveInterrupts: (interrupts) => this.#resolveInterrupts(interrupts),
|
|
467
472
|
connectionLostMessage: this.#strings.connectionLost,
|
|
@@ -555,7 +560,7 @@ export class AgUiChat extends HTMLElement {
|
|
|
555
560
|
}
|
|
556
561
|
return [
|
|
557
562
|
{
|
|
558
|
-
name:
|
|
563
|
+
name: READ_PAGE_TOOL,
|
|
559
564
|
description:
|
|
560
565
|
"Read the current page's structure (fields, buttons, route). Call after " +
|
|
561
566
|
"acting to observe the result within the same turn.",
|
|
@@ -1181,7 +1186,62 @@ export class AgUiChat extends HTMLElement {
|
|
|
1181
1186
|
const checkpoint = this.conversationStore.loadCheckpoint(this.#threadId);
|
|
1182
1187
|
if (checkpoint !== null) {
|
|
1183
1188
|
await this.#resumeFrom(checkpoint);
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
this.#noticeIfRunUnfinished(messages);
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
/**
|
|
1195
|
+
* Notice a previous run that never produced a response.
|
|
1196
|
+
*
|
|
1197
|
+
* {@link AgUiClient.send} persists the user's message *before* starting the
|
|
1198
|
+
* run, so a transcript whose last entry is that user message means nothing
|
|
1199
|
+
* ever came back: the page navigated or reloaded mid-run, the tab closed, or
|
|
1200
|
+
* the process died. No extra persistence is needed to detect it — the shape
|
|
1201
|
+
* of the transcript already says so, which is why this needs no
|
|
1202
|
+
* {@link ClientConversationStore} method and no `pagehide` listener (neither
|
|
1203
|
+
* of which fires on a crash or a force-quit anyway).
|
|
1204
|
+
*
|
|
1205
|
+
* The *agent*-initiated reload is not this case: a navigating tool leaves a
|
|
1206
|
+
* checkpoint and resumes, which is why the caller returns early on one before
|
|
1207
|
+
* reaching here.
|
|
1208
|
+
*
|
|
1209
|
+
* Deliberately a notice and never a resume. AG-UI has no
|
|
1210
|
+
* resume-an-aborted-run primitive; re-sending the accumulated messages is
|
|
1211
|
+
* semantically a **new** run, so any server-side tool the agent had already
|
|
1212
|
+
* executed before the interruption would run a second time. Saying plainly
|
|
1213
|
+
* that the answer was lost is the honest option, and the user can re-ask.
|
|
1214
|
+
*/
|
|
1215
|
+
/**
|
|
1216
|
+
* Build a round's context, recording which page it describes.
|
|
1217
|
+
*
|
|
1218
|
+
* The AG-UI client re-invokes this at the top of **every** tool round, not
|
|
1219
|
+
* once per `send()`, so the page map the agent sees is already refreshed
|
|
1220
|
+
* between rounds and the href captured here is the page it was shown for
|
|
1221
|
+
* *this* round. {@link #executeTool} compares against it to catch a page that
|
|
1222
|
+
* moved under a round still in flight.
|
|
1223
|
+
*/
|
|
1224
|
+
#buildContext(): Context[] {
|
|
1225
|
+
this.#contextHref = window.location.href;
|
|
1226
|
+
return this.getContext();
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
/**
|
|
1230
|
+
* Whether the page moved since the current round's context was built.
|
|
1231
|
+
*
|
|
1232
|
+
* `null` means no round has built context yet (nothing to compare), which is
|
|
1233
|
+
* not a move.
|
|
1234
|
+
*/
|
|
1235
|
+
#pageMoved(): boolean {
|
|
1236
|
+
return this.#contextHref !== null && this.#contextHref !== window.location.href;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
#noticeIfRunUnfinished(messages: readonly Message[] | null): void {
|
|
1240
|
+
const last = messages?.at(-1);
|
|
1241
|
+
if (last === undefined || last.role !== MESSAGE_ROLE.USER) {
|
|
1242
|
+
return;
|
|
1184
1243
|
}
|
|
1244
|
+
this.#appendNotice("⚠", this.#strings.runInterrupted, "interrupted");
|
|
1185
1245
|
}
|
|
1186
1246
|
|
|
1187
1247
|
/**
|
|
@@ -1647,7 +1707,7 @@ export class AgUiChat extends HTMLElement {
|
|
|
1647
1707
|
agent,
|
|
1648
1708
|
handlers: this.#handlers(),
|
|
1649
1709
|
getTools: () => this.getTools(),
|
|
1650
|
-
getContext: () => this
|
|
1710
|
+
getContext: () => this.#buildContext(),
|
|
1651
1711
|
executeTool: (call) => this.#executeTool(call),
|
|
1652
1712
|
resolveInterrupts: (interrupts) => this.#resolveInterrupts(interrupts),
|
|
1653
1713
|
onPersist: (messages) => this.conversationStore.saveMessages(this.#threadId, messages),
|
|
@@ -1704,6 +1764,29 @@ export class AgUiChat extends HTMLElement {
|
|
|
1704
1764
|
}
|
|
1705
1765
|
return null;
|
|
1706
1766
|
}
|
|
1767
|
+
// The page moved under this round. Acting now would target whatever
|
|
1768
|
+
// happens to match on the *new* page — usually nothing, which the handler
|
|
1769
|
+
// would report as a miss anyway, but occasionally a same-named control that
|
|
1770
|
+
// matches silently. That last case is the one worth preventing: it is the
|
|
1771
|
+
// only way the agent acts on the wrong page without either side noticing.
|
|
1772
|
+
//
|
|
1773
|
+
// Placed before the confirmation prompt so the user is never asked to
|
|
1774
|
+
// approve an action that is about to be refused. Navigating tools are
|
|
1775
|
+
// exempt (moving the page is their job — including re-navigating after a
|
|
1776
|
+
// move), as is `read_page`, which is the documented recovery. Gated on a
|
|
1777
|
+
// page-map provider: without one there is no `read_page` to recommend and
|
|
1778
|
+
// the host's tools are not page-scoped in the first place.
|
|
1779
|
+
if (
|
|
1780
|
+
this.getPageMap !== null &&
|
|
1781
|
+
call.name !== READ_PAGE_TOOL &&
|
|
1782
|
+
!isNavigates(tool.parameters) &&
|
|
1783
|
+
this.#pageMoved()
|
|
1784
|
+
) {
|
|
1785
|
+
const message = this.#strings.pageMoved;
|
|
1786
|
+
card.settle(TOOL_CALL_STATUS.ERROR, message);
|
|
1787
|
+
this.#showPending();
|
|
1788
|
+
return { content: `Error: ${message}`, error: message };
|
|
1789
|
+
}
|
|
1707
1790
|
if (await this.#needsConfirmation(call, tool)) {
|
|
1708
1791
|
const request: ConfirmationRequest = { toolName: call.name, args: call.args };
|
|
1709
1792
|
const confirmText = tool.parameters[X_CONFIRM_KEY];
|
|
@@ -92,7 +92,7 @@ export class RemoteConversationStore implements ClientConversationStore {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
async loadMessages(threadId: string): Promise<readonly Message[] | null> {
|
|
95
|
-
const response = await this.#get(this.#url
|
|
95
|
+
const response = await this.#get(`${this.#url}${encodeURIComponent(threadId)}/`);
|
|
96
96
|
if (response === null || !response.ok) {
|
|
97
97
|
return this.#local.loadMessages(threadId);
|
|
98
98
|
}
|
|
@@ -156,7 +156,7 @@ export class RemoteConversationStore implements ClientConversationStore {
|
|
|
156
156
|
): Promise<void> {
|
|
157
157
|
const headers = this.#headers();
|
|
158
158
|
try {
|
|
159
|
-
await fetch(this.#url
|
|
159
|
+
await fetch(`${this.#url}${encodeURIComponent(threadId)}/`, {
|
|
160
160
|
method,
|
|
161
161
|
headers: body === undefined ? headers : { ...headers, "content-type": "application/json" },
|
|
162
162
|
body: body === undefined ? null : JSON.stringify(body),
|
package/src/tools/route_map.ts
CHANGED
|
@@ -33,14 +33,11 @@ const PATH_PARAM_RE = /:([A-Za-z_][A-Za-z0-9_]*)/g;
|
|
|
33
33
|
|
|
34
34
|
/** The `:name` path-parameter names declared in a path template, in order. */
|
|
35
35
|
function pathParamNames(path: string): string[] {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return names;
|
|
36
|
+
// Slicing the ":" off the whole match rather than reading the capture group:
|
|
37
|
+
// the group is mandatory, so under `noUncheckedIndexedAccess` indexing it
|
|
38
|
+
// forces an `undefined` guard on a case the regex cannot produce — an
|
|
39
|
+
// unreachable branch no test can ever cover.
|
|
40
|
+
return [...path.matchAll(PATH_PARAM_RE)].map((match) => match[0].slice(1));
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
/**
|
package/src/ui/ui_strings.ts
CHANGED
|
@@ -53,6 +53,10 @@ export interface UiStrings {
|
|
|
53
53
|
historyCompacted: string;
|
|
54
54
|
/** Notice shown when the agent loads an agent skill. Token: `{name}`. */
|
|
55
55
|
usingSkill: string;
|
|
56
|
+
/** Notice shown on mount when the previous run never produced a response. */
|
|
57
|
+
runInterrupted: string;
|
|
58
|
+
/** Tool-result content (and card text) when the page moved mid-run. */
|
|
59
|
+
pageMoved: string;
|
|
56
60
|
|
|
57
61
|
// ── Composer ────────────────────────────────────────────────────────────────
|
|
58
62
|
/** `aria-label` of the message textarea. */
|
|
@@ -201,6 +205,9 @@ export const DEFAULT_UI_STRINGS: UiStrings = {
|
|
|
201
205
|
navigating: "Navigating…",
|
|
202
206
|
historyCompacted: "Earlier turns condensed to fit the context window ({count} removed)",
|
|
203
207
|
usingSkill: "Using skill {name}",
|
|
208
|
+
runInterrupted: "The previous response didn’t finish — the page changed before it arrived.",
|
|
209
|
+
pageMoved:
|
|
210
|
+
"The page changed since you last looked at it. Call read_page to see the current page, then retry.",
|
|
204
211
|
skillNeeds: "“{title}” needs: {fields}",
|
|
205
212
|
|
|
206
213
|
message: "Message",
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION: string = "0.
|
|
1
|
+
export const VERSION: string = "0.16.0";
|