@narumitw/pi-chrome-devtools 0.1.17 → 0.1.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-chrome-devtools",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Pi extension that exposes Chrome DevTools Protocol tools.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -46,7 +46,7 @@ const listPagesTool = defineTool({
46
46
  promptSnippet: "List Chrome tabs/pages available over Chrome DevTools Protocol",
47
47
  parameters: Type.Object({}),
48
48
  async execute(_toolCallId, _params, _signal, _onUpdate, ctx) {
49
- return withStatus(ctx, "cdp: list pages", async () => {
49
+ return withStatus(ctx, "🌐 list pages", async () => {
50
50
  const pages = await listPages();
51
51
  return textResult(JSON.stringify(pages.map(formatPage), null, 2), { pages });
52
52
  });
@@ -62,7 +62,7 @@ const selectPageTool = defineTool({
62
62
  pageId: Type.String({ description: "Page id from chrome_devtools_list_pages." }),
63
63
  }),
64
64
  async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
65
- return withStatus(ctx, "cdp: select page", async () => {
65
+ return withStatus(ctx, "🌐 select page", async () => {
66
66
  const page = await getPage(params.pageId);
67
67
  state.activePageId = page.id;
68
68
  return textResult(`Selected page ${page.id}: ${page.title}\n${page.url}`, {
@@ -84,7 +84,7 @@ const navigateTool = defineTool({
84
84
  ),
85
85
  }),
86
86
  async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
87
- return withStatus(ctx, "cdp: navigate", async () => {
87
+ return withStatus(ctx, "🌐 navigate", async () => {
88
88
  const page = await resolvePage(params.pageId);
89
89
  const result = await withCdp(page, async (client) => {
90
90
  await client.send("Page.enable");
@@ -112,7 +112,7 @@ const evaluateTool = defineTool({
112
112
  ),
113
113
  }),
114
114
  async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
115
- return withStatus(ctx, "cdp: evaluate", async () => {
115
+ return withStatus(ctx, "🌐 evaluate", async () => {
116
116
  const page = await resolvePage(params.pageId);
117
117
  const result = await withCdp(page, (client) =>
118
118
  client.send("Runtime.evaluate", {
@@ -142,7 +142,7 @@ const screenshotTool = defineTool({
142
142
  ),
143
143
  }),
144
144
  async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
145
- return withStatus(ctx, "cdp: screenshot", async () => {
145
+ return withStatus(ctx, "🌐 screenshot", async () => {
146
146
  const page = await resolvePage(params.pageId);
147
147
  const result = await withCdp(page, async (client) => {
148
148
  await client.send("Page.enable");