@streamapp/stream 0.0.1 → 0.0.2

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/bin/stream.mjs CHANGED
@@ -70,7 +70,7 @@ if (opts.help) {
70
70
  process.exit(0);
71
71
  }
72
72
  if (opts.version) {
73
- console.log(true ? "0.0.1" : "dev");
73
+ console.log(true ? "0.0.2" : "dev");
74
74
  process.exit(0);
75
75
  }
76
76
  var here = dirname(fileURLToPath(import.meta.url));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamapp/stream",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Stream — a self-hostable information-flow layer: many sources into one inbox, exposed to AI over MCP",
5
5
  "type": "module",
6
6
  "bin": {
@@ -174330,26 +174330,37 @@ async function runDesktopRecipeLocked(recipe, params, driver) {
174330
174330
  if (recipe.loginCheck) {
174331
174331
  if ((await find2(subQuery(recipe.loginCheck.wall, params))).length > 0) return blocked("needsLogin");
174332
174332
  }
174333
- for (const step of recipe.steps) {
174333
+ const t0 = Date.now();
174334
+ const probe2 = (msg2) => console.log(`[desktop-probe] ${recipe.sourceId} +${Date.now() - t0}ms ${msg2}`);
174335
+ for (const [i, step] of recipe.steps.entries()) {
174336
+ probe2(`#${i} ${step.kind}${step.label ? ` (${step.label.slice(0, 24)}\u2026)` : ""}`);
174334
174337
  if (step.skipIf && (await find2(subQuery(step.skipIf, params))).length > 0) continue;
174335
174338
  if (step.kind === "window") {
174336
174339
  const win = await waitForWindow(driver, step.match, step.timeoutMs ?? 12e3);
174340
+ if (!win && step.optional) continue;
174337
174341
  if (!win) return stepFailed(step, `window not found: ${JSON.stringify(step.match)}`);
174342
+ probe2(`#${i} window hit \u300C${win.title}\u300D (${win.process})`);
174338
174343
  scoped = { process: win.process, title: win.title };
174339
- await driver.scopeWindow(scoped);
174344
+ try {
174345
+ await driver.scopeWindow(scoped);
174346
+ } catch (e) {
174347
+ if (step.optional) continue;
174348
+ const now = (await driver.windows()).map((w) => w.title).join("\u3001");
174349
+ return stepFailed(step, `\u7A97\u53E3\u300C${win.title}\u300D\u5728\u88AB scope \u4E4B\u524D\u5C31\u6D88\u5931\u4E86\uFF08${e.message}\uFF09\uFF1B\u6B64\u523B\u8FD8\u5728\u7684\u7A97\u53E3\uFF1A${now}`);
174350
+ }
174340
174351
  if (step.focus) await foreground();
174341
174352
  if (step.waitFor) {
174342
174353
  const q = subQuery(step.waitFor, params);
174343
174354
  const rounds = Math.max(1, Math.ceil((step.timeoutMs ?? 12e3) / WINDOW_POLL_MS));
174344
174355
  let seen2 = false;
174345
- for (let i = 0; i < rounds; i++) {
174356
+ for (let i2 = 0; i2 < rounds; i2++) {
174346
174357
  if ((await find2(q)).length > 0) {
174347
174358
  seen2 = true;
174348
174359
  break;
174349
174360
  }
174350
174361
  await driver.sleep(WINDOW_POLL_MS);
174351
174362
  }
174352
- if (!seen2) return stepFailed(step, `window is up but its UI never appeared: ${JSON.stringify(q)}`);
174363
+ if (!seen2 && !step.optional) return stepFailed(step, `window is up but its UI never appeared: ${JSON.stringify(q)}`);
174353
174364
  }
174354
174365
  } else if (step.kind === "focus") {
174355
174366
  await foreground();
@@ -218852,7 +218863,7 @@ var DSH_UI_PLUGIN_PACKAGE = "@streamapp/dsh-plugin-stream-ui";
218852
218863
  var DSH_UI_PLUGIN_VERSION = "0.1.0";
218853
218864
  var DSH_DESKTOP_PLUGIN_ROW_ID = "stream-desktop";
218854
218865
  var DSH_DESKTOP_PLUGIN_PACKAGE = "@streamapp/dsh-plugin-desktop";
218855
- var DSH_DESKTOP_PLUGIN_VERSION = "0.4.0";
218866
+ var DSH_DESKTOP_PLUGIN_VERSION = "0.4.1";
218856
218867
  var EXCLUDED_LOCAL_EXECUTION_ROWS = [
218857
218868
  "tool-bash",
218858
218869
  "tool-pwsh",
@@ -228231,7 +228242,7 @@ var LOAD_UNPACKED_BUTTON = {
228231
228242
  role: "Button",
228232
228243
  names: ["\u52A0\u8F7D\u672A\u6253\u5305\u7684\u6269\u5C55\u7A0B\u5E8F", "Load unpacked"]
228233
228244
  };
228234
- var EXTENSIONS_WINDOW_TITLES = ["\u6269\u5C55\u7A0B\u5E8F", "Extensions"];
228245
+ var EXTENSIONS_WINDOW_TITLES = ["\u6269\u5C55\u7A0B\u5E8F - Google Chrome", "Extensions - Google Chrome"];
228235
228246
  var BLANK_URL = "about:blank";
228236
228247
  var EXTENSIONS_URL = "chrome://extensions";
228237
228248
  var CHROME_WINDOW_TITLES = ["Google Chrome"];
@@ -228354,8 +228365,10 @@ var INSTALL_EXTENSION_RECIPE = {
228354
228365
  kind: "window",
228355
228366
  match: { process: "chrome.exe", titleAnyOf: EXTENSIONS_WINDOW_TITLES },
228356
228367
  focus: true,
228357
- // 这里**故意不 waitFor**:等不到就失败,而固定这几步是锦上添花,不该拖垮一趟已经
228358
- // 成功的安装。工具栏是原生 chrome 的一部分,窗口在了它就在。
228368
+ // 这里**故意不 waitFor**:工具栏是原生 chrome 的一部分,窗口在了它就在。
228369
+ // `optional` 和后面那三步一致——这一段整体是锦上添花,任何一步都不该把一趟已经成功的
228370
+ // 安装判死(漏标它正是活体上那次误报的第二半,见 `EXTENSIONS_WINDOW_TITLES` 的头注)。
228371
+ optional: true,
228359
228372
  label: "\u88C5\u5B8C\u4E4B\u540E\u6CA1\u80FD\u56DE\u5230\u6269\u5C55\u7BA1\u7406\u9875\u7A97\u53E3\uFF08\u56FE\u6807\u6CA1\u80FD\u9489\u5230\u5DE5\u5177\u680F\u4E0A\uFF0C\u6269\u5C55\u672C\u8EAB\u662F\u88C5\u597D\u7684\uFF09"
228360
228373
  },
228361
228374
  {