@ycodium-ai/agent-grok 0.2.3935 → 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.
- package/dist/index.js +9 -42
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -6,6 +6,11 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/index.ts
|
|
8
8
|
import { definePlugin } from "@ycodium-ai/plugin-api";
|
|
9
|
+
|
|
10
|
+
// ../../packages/plugin-api/src/version.ts
|
|
11
|
+
var PLUGIN_API_VERSION = 76;
|
|
12
|
+
|
|
13
|
+
// src/index.ts
|
|
9
14
|
import {
|
|
10
15
|
EXECUTOR_EFFECTIVE_PAYLOAD_SCHEMA,
|
|
11
16
|
executorHomeEffectiveValue,
|
|
@@ -27047,9 +27052,7 @@ function createExecutorRuntime({
|
|
|
27047
27052
|
if (shared.disposed) {
|
|
27048
27053
|
return;
|
|
27049
27054
|
}
|
|
27050
|
-
eventStream.publish(
|
|
27051
|
-
options.originBindingGeneration === void 0 ? event : { ...event, originBindingGeneration: options.originBindingGeneration }
|
|
27052
|
-
);
|
|
27055
|
+
eventStream.publish(event);
|
|
27053
27056
|
};
|
|
27054
27057
|
const emit = publish;
|
|
27055
27058
|
const emitArtifacts = makeArtifactEmitter({
|
|
@@ -30571,38 +30574,6 @@ var RESUME_SCHEMA_VERSION = 1;
|
|
|
30571
30574
|
var yieldTick = () => new Promise((resolve2) => {
|
|
30572
30575
|
setImmediate(resolve2);
|
|
30573
30576
|
});
|
|
30574
|
-
var EventBus = class {
|
|
30575
|
-
#queued = [];
|
|
30576
|
-
#waiters = [];
|
|
30577
|
-
#closed = false;
|
|
30578
|
-
push(event) {
|
|
30579
|
-
const waiter = this.#waiters.shift();
|
|
30580
|
-
if (waiter) {
|
|
30581
|
-
waiter({ done: false, value: event });
|
|
30582
|
-
return;
|
|
30583
|
-
}
|
|
30584
|
-
this.#queued.push(event);
|
|
30585
|
-
}
|
|
30586
|
-
close() {
|
|
30587
|
-
if (this.#closed) return;
|
|
30588
|
-
this.#closed = true;
|
|
30589
|
-
while (this.#waiters.length > 0) {
|
|
30590
|
-
this.#waiters.shift()?.({ done: true, value: void 0 });
|
|
30591
|
-
}
|
|
30592
|
-
}
|
|
30593
|
-
[Symbol.asyncIterator]() {
|
|
30594
|
-
return {
|
|
30595
|
-
next: () => {
|
|
30596
|
-
const queued = this.#queued.shift();
|
|
30597
|
-
if (queued !== void 0) return Promise.resolve({ done: false, value: queued });
|
|
30598
|
-
if (this.#closed) return Promise.resolve({ done: true, value: void 0 });
|
|
30599
|
-
return new Promise((resolve2) => {
|
|
30600
|
-
this.#waiters.push(resolve2);
|
|
30601
|
-
});
|
|
30602
|
-
}
|
|
30603
|
-
};
|
|
30604
|
-
}
|
|
30605
|
-
};
|
|
30606
30577
|
function nowIso() {
|
|
30607
30578
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
30608
30579
|
}
|
|
@@ -30623,7 +30594,6 @@ function modelIdFromSelection(selection) {
|
|
|
30623
30594
|
}
|
|
30624
30595
|
var createGrokInstance = (config2, host) => {
|
|
30625
30596
|
const recipe = parseGrokInstanceConfig(config2);
|
|
30626
|
-
const events = new EventBus();
|
|
30627
30597
|
const threads = /* @__PURE__ */ new Map();
|
|
30628
30598
|
let disposed = false;
|
|
30629
30599
|
const { requireThread, registerSession, stopSession, stopAll } = createAcpSessionRegistry(
|
|
@@ -30634,7 +30604,6 @@ var createGrokInstance = (config2, host) => {
|
|
|
30634
30604
|
const disposeOnce = createRetryableClose(async () => {
|
|
30635
30605
|
await signIn.close();
|
|
30636
30606
|
await stopAll();
|
|
30637
|
-
events.close();
|
|
30638
30607
|
});
|
|
30639
30608
|
const probeAuth = () => {
|
|
30640
30609
|
if ((recipe.environment["XAI_API_KEY"] ?? "").trim().length > 0) {
|
|
@@ -30874,7 +30843,6 @@ var createGrokInstance = (config2, host) => {
|
|
|
30874
30843
|
},
|
|
30875
30844
|
...requestedModelId === void 0 ? {} : { requestedModelId },
|
|
30876
30845
|
refreshCatalogForSend: () => modelCatalog.refreshForSend(),
|
|
30877
|
-
...input2.bindingGeneration === void 0 ? {} : { originBindingGeneration: input2.bindingGeneration },
|
|
30878
30846
|
// 内置编排那一条排第一,后面跟用户在插件中心配的;缺了这一栏,
|
|
30879
30847
|
// `mcp__ycodium__*` 整套工具(浏览器等)在这只手的会话里都不存在。
|
|
30880
30848
|
// http / sse 由执行器按握手里的 `mcpCapabilities` 再筛。
|
|
@@ -30883,7 +30851,7 @@ var createGrokInstance = (config2, host) => {
|
|
|
30883
30851
|
});
|
|
30884
30852
|
const forwarding = (async () => {
|
|
30885
30853
|
for await (const event of executor.events) {
|
|
30886
|
-
events.
|
|
30854
|
+
input2.events.emit(await turnUsage.attach(event));
|
|
30887
30855
|
}
|
|
30888
30856
|
})();
|
|
30889
30857
|
try {
|
|
@@ -30929,7 +30897,7 @@ var createGrokInstance = (config2, host) => {
|
|
|
30929
30897
|
});
|
|
30930
30898
|
const caveat = grokRuntimeModeCaveat(permissionMode);
|
|
30931
30899
|
if (caveat !== void 0) {
|
|
30932
|
-
events.
|
|
30900
|
+
input2.events.emit({
|
|
30933
30901
|
type: "runtime.warning",
|
|
30934
30902
|
eventId: NodeCrypto3.randomUUID(),
|
|
30935
30903
|
provider: GROK_DRIVER_KIND,
|
|
@@ -31032,7 +31000,6 @@ var createGrokInstance = (config2, host) => {
|
|
|
31032
31000
|
const booked = requireThread(threadId);
|
|
31033
31001
|
return { threadId, turns: booked.turns };
|
|
31034
31002
|
},
|
|
31035
|
-
events,
|
|
31036
31003
|
// 额度读实例自己的账号目录与连接(与它的 CLI 同源);token 走编排账本,见 grokTurnUsage.ts。
|
|
31037
31004
|
usage: createGrokUsage({
|
|
31038
31005
|
homePath: resolveAccountHomePath(recipe, recipe.homePath),
|
|
@@ -31063,7 +31030,7 @@ var executors = [
|
|
|
31063
31030
|
];
|
|
31064
31031
|
var index_default = definePlugin({
|
|
31065
31032
|
id: "agent-grok",
|
|
31066
|
-
apiVersion:
|
|
31033
|
+
apiVersion: PLUGIN_API_VERSION,
|
|
31067
31034
|
executors,
|
|
31068
31035
|
activate(ctx) {
|
|
31069
31036
|
ctx.command({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/agent-grok",
|
|
3
|
-
"version": "0.2.
|
|
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
|
-
"
|
|
25
|
-
"ycodium-
|
|
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": {
|