@ycodium-ai/agent-grok 0.2.3976 → 0.2.3982

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 (2) hide show
  1. package/dist/index.js +4 -42
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ var __export = (target, all) => {
8
8
  import { definePlugin } from "@ycodium-ai/plugin-api";
9
9
 
10
10
  // ../../packages/plugin-api/src/version.ts
11
- var PLUGIN_API_VERSION = 75;
11
+ var PLUGIN_API_VERSION = 76;
12
12
 
13
13
  // src/index.ts
14
14
  import {
@@ -27052,9 +27052,7 @@ function createExecutorRuntime({
27052
27052
  if (shared.disposed) {
27053
27053
  return;
27054
27054
  }
27055
- eventStream.publish(
27056
- options.originBindingGeneration === void 0 ? event : { ...event, originBindingGeneration: options.originBindingGeneration }
27057
- );
27055
+ eventStream.publish(event);
27058
27056
  };
27059
27057
  const emit = publish;
27060
27058
  const emitArtifacts = makeArtifactEmitter({
@@ -30576,38 +30574,6 @@ var RESUME_SCHEMA_VERSION = 1;
30576
30574
  var yieldTick = () => new Promise((resolve2) => {
30577
30575
  setImmediate(resolve2);
30578
30576
  });
30579
- var EventBus = class {
30580
- #queued = [];
30581
- #waiters = [];
30582
- #closed = false;
30583
- push(event) {
30584
- const waiter = this.#waiters.shift();
30585
- if (waiter) {
30586
- waiter({ done: false, value: event });
30587
- return;
30588
- }
30589
- this.#queued.push(event);
30590
- }
30591
- close() {
30592
- if (this.#closed) return;
30593
- this.#closed = true;
30594
- while (this.#waiters.length > 0) {
30595
- this.#waiters.shift()?.({ done: true, value: void 0 });
30596
- }
30597
- }
30598
- [Symbol.asyncIterator]() {
30599
- return {
30600
- next: () => {
30601
- const queued = this.#queued.shift();
30602
- if (queued !== void 0) return Promise.resolve({ done: false, value: queued });
30603
- if (this.#closed) return Promise.resolve({ done: true, value: void 0 });
30604
- return new Promise((resolve2) => {
30605
- this.#waiters.push(resolve2);
30606
- });
30607
- }
30608
- };
30609
- }
30610
- };
30611
30577
  function nowIso() {
30612
30578
  return (/* @__PURE__ */ new Date()).toISOString();
30613
30579
  }
@@ -30628,7 +30594,6 @@ function modelIdFromSelection(selection) {
30628
30594
  }
30629
30595
  var createGrokInstance = (config2, host) => {
30630
30596
  const recipe = parseGrokInstanceConfig(config2);
30631
- const events = new EventBus();
30632
30597
  const threads = /* @__PURE__ */ new Map();
30633
30598
  let disposed = false;
30634
30599
  const { requireThread, registerSession, stopSession, stopAll } = createAcpSessionRegistry(
@@ -30639,7 +30604,6 @@ var createGrokInstance = (config2, host) => {
30639
30604
  const disposeOnce = createRetryableClose(async () => {
30640
30605
  await signIn.close();
30641
30606
  await stopAll();
30642
- events.close();
30643
30607
  });
30644
30608
  const probeAuth = () => {
30645
30609
  if ((recipe.environment["XAI_API_KEY"] ?? "").trim().length > 0) {
@@ -30879,7 +30843,6 @@ var createGrokInstance = (config2, host) => {
30879
30843
  },
30880
30844
  ...requestedModelId === void 0 ? {} : { requestedModelId },
30881
30845
  refreshCatalogForSend: () => modelCatalog.refreshForSend(),
30882
- ...input2.bindingGeneration === void 0 ? {} : { originBindingGeneration: input2.bindingGeneration },
30883
30846
  // 内置编排那一条排第一,后面跟用户在插件中心配的;缺了这一栏,
30884
30847
  // `mcp__ycodium__*` 整套工具(浏览器等)在这只手的会话里都不存在。
30885
30848
  // http / sse 由执行器按握手里的 `mcpCapabilities` 再筛。
@@ -30888,7 +30851,7 @@ var createGrokInstance = (config2, host) => {
30888
30851
  });
30889
30852
  const forwarding = (async () => {
30890
30853
  for await (const event of executor.events) {
30891
- events.push(await turnUsage.attach(event));
30854
+ input2.events.emit(await turnUsage.attach(event));
30892
30855
  }
30893
30856
  })();
30894
30857
  try {
@@ -30934,7 +30897,7 @@ var createGrokInstance = (config2, host) => {
30934
30897
  });
30935
30898
  const caveat = grokRuntimeModeCaveat(permissionMode);
30936
30899
  if (caveat !== void 0) {
30937
- events.push({
30900
+ input2.events.emit({
30938
30901
  type: "runtime.warning",
30939
30902
  eventId: NodeCrypto3.randomUUID(),
30940
30903
  provider: GROK_DRIVER_KIND,
@@ -31037,7 +31000,6 @@ var createGrokInstance = (config2, host) => {
31037
31000
  const booked = requireThread(threadId);
31038
31001
  return { threadId, turns: booked.turns };
31039
31002
  },
31040
- events,
31041
31003
  // 额度读实例自己的账号目录与连接(与它的 CLI 同源);token 走编排账本,见 grokTurnUsage.ts。
31042
31004
  usage: createGrokUsage({
31043
31005
  homePath: resolveAccountHomePath(recipe, recipe.homePath),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-grok",
3
- "version": "0.2.3976",
3
+ "version": "0.2.3982",
4
4
  "description": "Grok executor: grok CLI over Agent Client Protocol stdio.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -21,8 +21,8 @@
21
21
  "@types/node": "24.12.4",
22
22
  "esbuild": "0.28.1",
23
23
  "vite-plus": "0.2.2",
24
- "@ycodium-ai/plugin-api": "0.2.3976",
25
- "ycodium-acp-executor": "0.2.3976",
24
+ "ycodium-acp-executor": "0.2.3982",
25
+ "@ycodium-ai/plugin-api": "0.2.3982",
26
26
  "ycodium-executor-testing": "0.0.0"
27
27
  },
28
28
  "ycodium": {