@vibest/cli 0.0.1-beta.12 → 0.0.1-beta.14
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/harnesses/claude/.claude-plugin/plugin.json +4 -4
- package/harnesses/claude/README.md +48 -117
- package/harnesses/claude/hooks/hooks.json +1 -3
- package/harnesses/claude/hooks/register.mjs +289 -494
- package/harnesses/claude/skills/delegate/SKILL.md +10 -8
- package/harnesses/claude/skills/pipeline/SKILL.md +8 -9
- package/harnesses/cursor/.cursor-plugin/plugin.json +1 -1
- package/harnesses/cursor/hooks/vibest.sh +1 -1
- package/harnesses/cursor/skills/delegate/SKILL.md +10 -8
- package/harnesses/cursor/skills/pipeline/SKILL.md +8 -9
- package/harnesses/pi/extension.mjs +696 -476
- package/harnesses/pi/skills/delegate/SKILL.md +10 -8
- package/harnesses/pi/skills/pipeline/SKILL.md +8 -9
- package/package.json +25 -25
|
@@ -4731,7 +4731,7 @@ var TypeId6 = "~effect/Layer", MemoMapTypeId = "~effect/Layer/MemoMap", makeMemo
|
|
|
4731
4731
|
return forEach(layers, (layer) => layer.build(memoMap, forkUnsafe2(parentScope, "sequential")), {
|
|
4732
4732
|
concurrency: layers.length
|
|
4733
4733
|
}).pipe(map5((context) => mergeAll(...context)));
|
|
4734
|
-
}, mergeAll2 = (...layers) => fromBuild((memoMap, scope) => mergeAllEffect(layers, memoMap, scope)), provideWith = (self, that, f) => fromBuild((memoMap, scope) => flatMap2(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope) : that.build(memoMap, scope), (context) => self.build(memoMap, scope).pipe(provideContext(context), map5((merged) => f(merged, context))))), provide2, provideMerge, flatMap3;
|
|
4734
|
+
}, mergeAll2 = (...layers) => fromBuild((memoMap, scope) => mergeAllEffect(layers, memoMap, scope)), merge2, provideWith = (self, that, f) => fromBuild((memoMap, scope) => flatMap2(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope) : that.build(memoMap, scope), (context) => self.build(memoMap, scope).pipe(provideContext(context), map5((merged) => f(merged, context))))), provide2, provideMerge, flatMap3;
|
|
4735
4735
|
var init_Layer = __esm(() => {
|
|
4736
4736
|
init_Context();
|
|
4737
4737
|
init_Deferred();
|
|
@@ -4798,6 +4798,7 @@ var init_Layer = __esm(() => {
|
|
|
4798
4798
|
buildWithScope = /* @__PURE__ */ dual(2, (self, scope) => withFiber((fiber) => buildWithMemoMap(self, CurrentMemoMap.forkOrCreate(fiber.context), scope)));
|
|
4799
4799
|
empty4 = /* @__PURE__ */ succeedContext(/* @__PURE__ */ empty3());
|
|
4800
4800
|
unwrapKey = /* @__PURE__ */ Service("effect/Layer/unwrap");
|
|
4801
|
+
merge2 = /* @__PURE__ */ dual(2, (self, that) => mergeAll2(self, ...Array.isArray(that) ? that : [that]));
|
|
4801
4802
|
provide2 = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that, identity));
|
|
4802
4803
|
provideMerge = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that, (self, that) => merge(that, self)));
|
|
4803
4804
|
flatMap3 = /* @__PURE__ */ dual(2, (self, f) => fromBuild((memoMap, scope) => flatMap2(self.build(memoMap, scope), (context) => f(context).build(memoMap, scope))));
|
|
@@ -6254,7 +6255,7 @@ var TypeId15 = "~effect/Channel", isChannel = (u) => hasProperty(u, TypeId15), C
|
|
|
6254
6255
|
return flatMap4(close2, () => makePull);
|
|
6255
6256
|
});
|
|
6256
6257
|
return suspend2(() => childPull ?? makePull);
|
|
6257
|
-
})), flatMapConcurrent = (self, f, options) => self.pipe(map8(f), mergeAll3(options)), flatten4 = (channels) => flatMap5(channels, identity), mapAccum, mergeAll3,
|
|
6258
|
+
})), flatMapConcurrent = (self, f, options) => self.pipe(map8(f), mergeAll3(options)), flatten4 = (channels) => flatMap5(channels, identity), mapAccum, mergeAll3, merge3, splitLines = () => fromTransform((upstream, _scope) => sync2(() => {
|
|
6258
6259
|
let stringBuilder = "";
|
|
6259
6260
|
let midCRLF = false;
|
|
6260
6261
|
let done = none2();
|
|
@@ -6492,7 +6493,7 @@ var init_Channel = __esm(() => {
|
|
|
6492
6493
|
}), forkIn2(forkedScope));
|
|
6493
6494
|
return take2(queue);
|
|
6494
6495
|
})));
|
|
6495
|
-
|
|
6496
|
+
merge3 = /* @__PURE__ */ dual((args) => isChannel(args[0]) && isChannel(args[1]), (left, right, options) => fromTransformBracket(fnUntraced2(function* (upstream, _scope, forkedScope) {
|
|
6496
6497
|
const strategy = options?.haltStrategy ?? "both";
|
|
6497
6498
|
const queue = yield* bounded(0);
|
|
6498
6499
|
yield* addFinalizer(forkedScope, shutdown(queue));
|
|
@@ -6646,7 +6647,7 @@ function* concatChannels(self, that) {
|
|
|
6646
6647
|
stack.push(parts[1], parts[0]);
|
|
6647
6648
|
}
|
|
6648
6649
|
}
|
|
6649
|
-
var TypeId19 = "~effect/Stream", isStream = (u) => hasProperty(u, TypeId19), fromChannel3, fromPull2 = (pull) => fromChannel3(fromPull(pull)), transformPull2 = (self, f) => fromChannel3(fromTransform((_, scope) => flatMap4(toPullScoped(self.channel, scope), (pull) => f(pull, scope)))), toChannel2 = (stream) => stream.channel, callback3 = (f, options) => fromChannel3(callbackArray(f, options)), empty6, succeed9 = (value) => fromChannel3(succeed8(of(value))), make13 = (...values) => fromArray2(values), suspend4 = (stream) => fromChannel3(suspend3(() => stream().channel)), fromArray2 = (array) => isReadonlyArrayNonEmpty(array) ? fromChannel3(succeed8(array)) : empty6, fromQueue = (queue) => fromChannel3(fromQueueArray(queue)), never4, unwrap4 = (effect) => fromChannel3(unwrap2(map7(effect, toChannel2))), map9, concat, concatParts,
|
|
6650
|
+
var TypeId19 = "~effect/Stream", isStream = (u) => hasProperty(u, TypeId19), fromChannel3, fromPull2 = (pull) => fromChannel3(fromPull(pull)), transformPull2 = (self, f) => fromChannel3(fromTransform((_, scope) => flatMap4(toPullScoped(self.channel, scope), (pull) => f(pull, scope)))), toChannel2 = (stream) => stream.channel, callback3 = (f, options) => fromChannel3(callbackArray(f, options)), empty6, succeed9 = (value) => fromChannel3(succeed8(of(value))), make13 = (...values) => fromArray2(values), suspend4 = (stream) => fromChannel3(suspend3(() => stream().channel)), fromArray2 = (array) => isReadonlyArrayNonEmpty(array) ? fromChannel3(succeed8(array)) : empty6, fromQueue = (queue) => fromChannel3(fromQueueArray(queue)), never4, unwrap4 = (effect) => fromChannel3(unwrap2(map7(effect, toChannel2))), map9, concat, concatParts, merge4, takeUntil, scan, transduce, decodeText, splitLines2 = (self) => self.channel.pipe(pipeTo(splitLines()), fromChannel3), provideContext4, run, runCollect = (self) => runFold(self.channel, () => [], (acc, chunk) => {
|
|
6650
6651
|
for (let i = 0;i < chunk.length; i++) {
|
|
6651
6652
|
acc.push(chunk[i]);
|
|
6652
6653
|
}
|
|
@@ -6675,7 +6676,7 @@ var init_Stream = __esm(() => {
|
|
|
6675
6676
|
return stream;
|
|
6676
6677
|
});
|
|
6677
6678
|
concatParts = /* @__PURE__ */ new WeakMap;
|
|
6678
|
-
|
|
6679
|
+
merge4 = /* @__PURE__ */ dual((args) => isStream(args[0]) && isStream(args[1]), (self, that, options) => fromChannel3(merge3(toChannel2(self), toChannel2(that), options)));
|
|
6679
6680
|
takeUntil = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, predicate, options) => transformPull2(self, (pull, _scope) => sync2(() => {
|
|
6680
6681
|
let i = 0;
|
|
6681
6682
|
let done = false;
|
|
@@ -10064,7 +10065,7 @@ var TypeId28, Proto5, make20 = (input) => Object.assign(Object.create(Proto5), i
|
|
|
10064
10065
|
}
|
|
10065
10066
|
}
|
|
10066
10067
|
return out;
|
|
10067
|
-
},
|
|
10068
|
+
}, merge5, redact2, CurrentRedactedNames;
|
|
10068
10069
|
var init_Headers = __esm(() => {
|
|
10069
10070
|
init_Context();
|
|
10070
10071
|
init_Equal();
|
|
@@ -10109,7 +10110,7 @@ var init_Headers = __esm(() => {
|
|
|
10109
10110
|
});
|
|
10110
10111
|
Equivalence3 = /* @__PURE__ */ makeEquivalence(/* @__PURE__ */ strictEqual());
|
|
10111
10112
|
empty7 = /* @__PURE__ */ Object.create(Proto5);
|
|
10112
|
-
|
|
10113
|
+
merge5 = /* @__PURE__ */ dual(2, (self, headers) => {
|
|
10113
10114
|
const out = make20(self);
|
|
10114
10115
|
Object.assign(out, headers);
|
|
10115
10116
|
return out;
|
|
@@ -15885,50 +15886,6 @@ var init_dist = __esm(() => {
|
|
|
15885
15886
|
init_Version();
|
|
15886
15887
|
});
|
|
15887
15888
|
|
|
15888
|
-
// ../../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/process/index.js
|
|
15889
|
-
var init_process = __esm(() => {
|
|
15890
|
-
init_ChildProcess();
|
|
15891
|
-
init_ChildProcessSpawner();
|
|
15892
|
-
});
|
|
15893
|
-
|
|
15894
|
-
// ../../schema/src/layout.ts
|
|
15895
|
-
var Layout, VibestCommand, shellQuote = (s) => /^[\w@%+=:,./-]+$/.test(s) ? s : `'${s.replace(/'/g, `'\\''`)}'`;
|
|
15896
|
-
var init_layout = __esm(() => {
|
|
15897
|
-
init_dist();
|
|
15898
|
-
Layout = class Layout extends Service()("vibest/Layout") {
|
|
15899
|
-
static make = (home) => gen2(function* () {
|
|
15900
|
-
const path = yield* Path;
|
|
15901
|
-
return Layout.of({
|
|
15902
|
-
home,
|
|
15903
|
-
database: path.join(home, "vibest.db"),
|
|
15904
|
-
socket: path.join(home, "vibest.sock"),
|
|
15905
|
-
daemonInfo: path.join(home, "vibestd.pid"),
|
|
15906
|
-
results: path.join(home, "results"),
|
|
15907
|
-
reports: path.join(home, "reports"),
|
|
15908
|
-
worktrees: path.join(home, "worktrees"),
|
|
15909
|
-
projects: path.join(home, "projects"),
|
|
15910
|
-
config: path.join(home, "vibest.json"),
|
|
15911
|
-
plugins: path.join(home, "plugins"),
|
|
15912
|
-
resultFile: (id) => path.join(home, "results", `${id}.json`),
|
|
15913
|
-
reportFile: (id) => path.join(home, "reports", `${id}.jsonl`),
|
|
15914
|
-
rulesFile: (id) => path.join(home, "rules", `${id}.md`),
|
|
15915
|
-
coordinatorRules: (key) => path.join(home, "coordinator", `${key}.md`),
|
|
15916
|
-
legacyWorktree: (id) => path.join(home, "worktrees", id),
|
|
15917
|
-
allocationWorktree: (repository, name) => path.join(home, "worktrees", repository, name),
|
|
15918
|
-
project: (key) => path.join(home, "projects", key),
|
|
15919
|
-
scratch: (key) => path.join(home, "projects", key, "scratch"),
|
|
15920
|
-
inboxClaim: (generation, token) => path.join(home, "inbox-claims", `${generation}-${token}`)
|
|
15921
|
-
});
|
|
15922
|
-
});
|
|
15923
|
-
static layer = effect(Layout, gen2(function* () {
|
|
15924
|
-
const path = yield* Path;
|
|
15925
|
-
const home = yield* String7("VIBEST_HOME").pipe(orElse(() => String7("HOME").pipe(map10((h) => path.join(h, ".vibest")))));
|
|
15926
|
-
return yield* Layout.make(home);
|
|
15927
|
-
}));
|
|
15928
|
-
};
|
|
15929
|
-
VibestCommand = Reference("vibest/VibestCommand", { defaultValue: () => ["vibest"] });
|
|
15930
|
-
});
|
|
15931
|
-
|
|
15932
15889
|
// ../../schema/src/session.ts
|
|
15933
15890
|
var AgentStatus, TurnState, InboxKind, InboxStatus, RuntimeAddress, RuntimeLocation, RuntimeMachine, InboxRow, HARNESS_IDS, isHarnessId = (s) => HARNESS_IDS.includes(s), HarnessUnavailable, RuntimeUnreachable, NoRuntime, RuntimeIncompatible, NoSuchSession, AllocationFailed, SessionBusy, LimitReached, NotReady, NoHarnessChosen, LaunchFailed, NotInRepository;
|
|
15934
15891
|
var init_session = __esm(() => {
|
|
@@ -15941,7 +15898,10 @@ var init_session = __esm(() => {
|
|
|
15941
15898
|
machine: String6,
|
|
15942
15899
|
id: String6
|
|
15943
15900
|
});
|
|
15944
|
-
RuntimeLocation = Union2([
|
|
15901
|
+
RuntimeLocation = Union2([
|
|
15902
|
+
Struct({ socketPath: String6 }),
|
|
15903
|
+
Struct({ session: String6 })
|
|
15904
|
+
]);
|
|
15945
15905
|
RuntimeMachine = Struct({
|
|
15946
15906
|
id: String6,
|
|
15947
15907
|
target: optional2(String6)
|
|
@@ -15973,25 +15933,38 @@ var init_session = __esm(() => {
|
|
|
15973
15933
|
message: String6
|
|
15974
15934
|
}) {
|
|
15975
15935
|
};
|
|
15976
|
-
NoSuchSession = class NoSuchSession extends TaggedError3()("NoSuchSession", {
|
|
15936
|
+
NoSuchSession = class NoSuchSession extends TaggedError3()("NoSuchSession", {
|
|
15937
|
+
id: String6,
|
|
15938
|
+
message: String6
|
|
15939
|
+
}) {
|
|
15977
15940
|
};
|
|
15978
|
-
AllocationFailed = class AllocationFailed extends TaggedError3()("AllocationFailed", {
|
|
15941
|
+
AllocationFailed = class AllocationFailed extends TaggedError3()("AllocationFailed", {
|
|
15942
|
+
message: String6
|
|
15943
|
+
}) {
|
|
15979
15944
|
};
|
|
15980
|
-
SessionBusy = class SessionBusy extends TaggedError3()("SessionBusy", {
|
|
15945
|
+
SessionBusy = class SessionBusy extends TaggedError3()("SessionBusy", {
|
|
15946
|
+
id: String6,
|
|
15947
|
+
message: String6
|
|
15948
|
+
}) {
|
|
15981
15949
|
};
|
|
15982
15950
|
LimitReached = class LimitReached extends TaggedError3()("LimitReached", { limit: Number6 }) {
|
|
15983
15951
|
get message() {
|
|
15984
15952
|
return `VIBEST_MAX_SESSIONS=${this.limit} sessions are already open (working or kept); vibest archive one first`;
|
|
15985
15953
|
}
|
|
15986
15954
|
};
|
|
15987
|
-
NotReady = class NotReady extends TaggedError3()("NotReady", {
|
|
15955
|
+
NotReady = class NotReady extends TaggedError3()("NotReady", {
|
|
15956
|
+
id: String6,
|
|
15957
|
+
message: String6
|
|
15958
|
+
}) {
|
|
15988
15959
|
};
|
|
15989
15960
|
NoHarnessChosen = class NoHarnessChosen extends TaggedError3()("NoHarnessChosen", {}) {
|
|
15990
15961
|
get message() {
|
|
15991
15962
|
return "no harness chosen: pass harness, or install a routing plugin";
|
|
15992
15963
|
}
|
|
15993
15964
|
};
|
|
15994
|
-
LaunchFailed = class LaunchFailed extends TaggedError3()("LaunchFailed", {
|
|
15965
|
+
LaunchFailed = class LaunchFailed extends TaggedError3()("LaunchFailed", {
|
|
15966
|
+
message: String6
|
|
15967
|
+
}) {
|
|
15995
15968
|
};
|
|
15996
15969
|
NotInRepository = class NotInRepository extends TaggedError3()("NotInRepository", { path: String6 }) {
|
|
15997
15970
|
get message() {
|
|
@@ -16000,6 +15973,52 @@ var init_session = __esm(() => {
|
|
|
16000
15973
|
};
|
|
16001
15974
|
});
|
|
16002
15975
|
|
|
15976
|
+
// ../../schema/src/layout.ts
|
|
15977
|
+
var Layout, VibestCommand, shellQuote = (s) => /^[\w@%+=:,./-]+$/.test(s) ? s : `'${s.replace(/'/g, `'\\''`)}'`;
|
|
15978
|
+
var init_layout = __esm(() => {
|
|
15979
|
+
init_dist();
|
|
15980
|
+
Layout = class Layout extends Service()("vibest/Layout") {
|
|
15981
|
+
static make = (home) => gen2(function* () {
|
|
15982
|
+
const path = yield* Path;
|
|
15983
|
+
return Layout.of({
|
|
15984
|
+
home,
|
|
15985
|
+
database: path.join(home, "vibest.db"),
|
|
15986
|
+
socket: path.join(home, "vibest.sock"),
|
|
15987
|
+
httpSocket: path.join(home, "vibest-http.sock"),
|
|
15988
|
+
daemonInfo: path.join(home, "vibestd.pid"),
|
|
15989
|
+
results: path.join(home, "results"),
|
|
15990
|
+
reports: path.join(home, "reports"),
|
|
15991
|
+
worktrees: path.join(home, "worktrees"),
|
|
15992
|
+
projects: path.join(home, "projects"),
|
|
15993
|
+
config: path.join(home, "vibest.json"),
|
|
15994
|
+
plugins: path.join(home, "plugins"),
|
|
15995
|
+
resultFile: (id) => path.join(home, "results", `${id}.json`),
|
|
15996
|
+
reportFile: (id) => path.join(home, "reports", `${id}.jsonl`),
|
|
15997
|
+
rulesFile: (id) => path.join(home, "rules", `${id}.md`),
|
|
15998
|
+
coordinatorRules: (key) => path.join(home, "coordinator", `${key}.md`),
|
|
15999
|
+
legacyWorktree: (id) => path.join(home, "worktrees", id),
|
|
16000
|
+
allocationWorktree: (repository, name) => path.join(home, "worktrees", repository, name),
|
|
16001
|
+
project: (key) => path.join(home, "projects", key),
|
|
16002
|
+
scratch: (key) => path.join(home, "projects", key, "scratch")
|
|
16003
|
+
});
|
|
16004
|
+
});
|
|
16005
|
+
static layer = effect(Layout, gen2(function* () {
|
|
16006
|
+
const path = yield* Path;
|
|
16007
|
+
const home = yield* String7("VIBEST_HOME").pipe(orElse(() => String7("HOME").pipe(map10((h) => path.join(h, ".vibest")))));
|
|
16008
|
+
return yield* Layout.make(home);
|
|
16009
|
+
}));
|
|
16010
|
+
};
|
|
16011
|
+
VibestCommand = Reference("vibest/VibestCommand", {
|
|
16012
|
+
defaultValue: () => ["vibest"]
|
|
16013
|
+
});
|
|
16014
|
+
});
|
|
16015
|
+
|
|
16016
|
+
// ../../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/process/index.js
|
|
16017
|
+
var init_process = __esm(() => {
|
|
16018
|
+
init_ChildProcess();
|
|
16019
|
+
init_ChildProcessSpawner();
|
|
16020
|
+
});
|
|
16021
|
+
|
|
16003
16022
|
// ../../core/src/models.ts
|
|
16004
16023
|
var exports_models = {};
|
|
16005
16024
|
__export(exports_models, {
|
|
@@ -16011,7 +16030,14 @@ __export(exports_models, {
|
|
|
16011
16030
|
normalizeModels: () => normalizeModels,
|
|
16012
16031
|
withConfigured: () => withConfigured
|
|
16013
16032
|
});
|
|
16014
|
-
var Model, normalizeModels = (harness, provider, raw) => raw.map((r) => ({
|
|
16033
|
+
var Model, normalizeModels = (harness, provider, raw) => raw.map((r) => ({
|
|
16034
|
+
harness,
|
|
16035
|
+
provider: r.provider ?? provider,
|
|
16036
|
+
model: r.model,
|
|
16037
|
+
name: r.name || r.model,
|
|
16038
|
+
description: r.description ?? "",
|
|
16039
|
+
default: r.default
|
|
16040
|
+
})).filter((m) => !provider || m.provider === provider), jsonLines = (...messages) => messages.map((m) => `${JSON.stringify(m)}
|
|
16015
16041
|
`).join(""), findMessage2 = (schema) => {
|
|
16016
16042
|
const decode = decodeUnknownOption2(fromJsonString2(schema));
|
|
16017
16043
|
return (lines) => {
|
|
@@ -16063,10 +16089,10 @@ var init_models = __esm(() => {
|
|
|
16063
16089
|
// ../../core/src/harness.ts
|
|
16064
16090
|
var encodeCommand, Harnesses, MODELS_TTL, Harness, preflight, harnessOptions;
|
|
16065
16091
|
var init_harness = __esm(() => {
|
|
16066
|
-
init_dist();
|
|
16067
|
-
init_process();
|
|
16068
16092
|
init_layout();
|
|
16069
16093
|
init_session();
|
|
16094
|
+
init_dist();
|
|
16095
|
+
init_process();
|
|
16070
16096
|
init_session();
|
|
16071
16097
|
encodeCommand = encodeSync(fromJsonString2(ArraySchema(String6)));
|
|
16072
16098
|
Harnesses = class Harnesses extends Service()("vibest/Harnesses") {
|
|
@@ -16085,7 +16111,11 @@ var init_harness = __esm(() => {
|
|
|
16085
16111
|
const harnesses = yield* Harnesses;
|
|
16086
16112
|
const self = yield* VibestCommand;
|
|
16087
16113
|
const pkg = self.length === 1 && path.isAbsolute(self[0]) ? path.dirname(path.dirname(self[0])) : undefined;
|
|
16088
|
-
const beside = pkg === undefined ? undefined : yield* findFirst2([
|
|
16114
|
+
const beside = pkg === undefined ? undefined : yield* findFirst2([
|
|
16115
|
+
path.join(pkg, "harnesses"),
|
|
16116
|
+
path.join(pkg, "..", "cli", "harnesses"),
|
|
16117
|
+
path.join(pkg, "..", "..", "..", "harnesses")
|
|
16118
|
+
], (dir) => fs.exists(dir).pipe(orElseSucceed2(() => false))).pipe(map7((found) => getOrElse(found, () => path.join(pkg, "harnesses"))));
|
|
16089
16119
|
const plugins = getOrUndefined(yield* option3(String7("VIBEST_HARNESSES"))) || beside;
|
|
16090
16120
|
const searchPath = (yield* String7("PATH").pipe(withDefault3(""))).split(":").filter(Boolean);
|
|
16091
16121
|
const { listModels } = yield* promise2(() => Promise.resolve().then(() => (init_models(), exports_models)));
|
|
@@ -16135,6 +16165,10 @@ var init_harness = __esm(() => {
|
|
|
16135
16165
|
harnessOptions = forEach2(HARNESS_IDS, (id) => preflight(id, null, null).pipe(map7(() => ({ harness: id, available: true })), catchTag2("HarnessUnavailable", (e) => succeed7({ harness: id, available: false, problem: e.message }))), { concurrency: "unbounded" });
|
|
16136
16166
|
});
|
|
16137
16167
|
|
|
16168
|
+
// src/extension.ts
|
|
16169
|
+
import path from "node:path";
|
|
16170
|
+
import url from "node:url";
|
|
16171
|
+
|
|
16138
16172
|
// ../../../node_modules/.pnpm/@effect+platform-node-shared@4.0.2_effect@4.0.2/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
|
|
16139
16173
|
init_Deferred();
|
|
16140
16174
|
init_Duration();
|
|
@@ -16556,7 +16590,7 @@ var make18 = /* @__PURE__ */ gen2(function* () {
|
|
|
16556
16590
|
if (isSink(stderrConfig.stream)) {
|
|
16557
16591
|
stderr = transduce(stderr, stderrConfig.stream);
|
|
16558
16592
|
}
|
|
16559
|
-
const all =
|
|
16593
|
+
const all = merge4(stdout, stderr);
|
|
16560
16594
|
return {
|
|
16561
16595
|
stdout,
|
|
16562
16596
|
stderr,
|
|
@@ -17797,57 +17831,285 @@ var fromDuplex = (open, options) => withFiber2((fiber) => {
|
|
|
17797
17831
|
}));
|
|
17798
17832
|
});
|
|
17799
17833
|
|
|
17800
|
-
// ../../
|
|
17834
|
+
// ../../protocol/src/protocol.ts
|
|
17835
|
+
var PROTOCOL = 4;
|
|
17836
|
+
var MISMATCH_ACTION = "vibest update";
|
|
17837
|
+
var protocolMismatch = (caller, server, version) => ({
|
|
17838
|
+
protocol: server,
|
|
17839
|
+
version,
|
|
17840
|
+
message: caller !== undefined && caller > server ? `vibestd is older (${version}); run ${MISMATCH_ACTION}` : `vibest was updated to ${version}; run ${MISMATCH_ACTION} to restart this agent on it`,
|
|
17841
|
+
action: MISMATCH_ACTION
|
|
17842
|
+
});
|
|
17843
|
+
var PROTOCOL_HEADER = "vibest-protocol";
|
|
17844
|
+
var CALLER_HEADER = "vibest-caller";
|
|
17845
|
+
var SESSION_HEADER = "vibest-session-id";
|
|
17846
|
+
var REPOSITORY_HEADER = "vibest-repository";
|
|
17847
|
+
var PROJECT_HEADER = "vibest-project-id";
|
|
17848
|
+
var HARNESS_SESSION_HEADER = "vibest-harness-session-id";
|
|
17849
|
+
var AGENT_HEADER = "vibest-agent";
|
|
17850
|
+
var HARNESS_HEADER = "vibest-harness";
|
|
17851
|
+
var CWD_HEADER = "vibest-cwd";
|
|
17852
|
+
var RUNTIME_HEADER = "vibest-runtime";
|
|
17853
|
+
var PLUGIN_VERSION_HEADER = "vibest-plugin-version";
|
|
17854
|
+
var sessionHeaders = (who) => {
|
|
17855
|
+
const headers = {
|
|
17856
|
+
[PROTOCOL_HEADER]: String(PROTOCOL),
|
|
17857
|
+
[CALLER_HEADER]: "session",
|
|
17858
|
+
[SESSION_HEADER]: who.sessionId
|
|
17859
|
+
};
|
|
17860
|
+
const put = (name, value) => {
|
|
17861
|
+
if (value)
|
|
17862
|
+
headers[name] = value;
|
|
17863
|
+
};
|
|
17864
|
+
put(PROJECT_HEADER, who.projectId);
|
|
17865
|
+
put(HARNESS_SESSION_HEADER, who.harnessSessionId);
|
|
17866
|
+
put(AGENT_HEADER, who.agent);
|
|
17867
|
+
put(HARNESS_HEADER, who.harness);
|
|
17868
|
+
put(CWD_HEADER, who.cwd === undefined ? undefined : encodeURIComponent(who.cwd));
|
|
17869
|
+
put(RUNTIME_HEADER, who.runtime);
|
|
17870
|
+
put(PLUGIN_VERSION_HEADER, who.pluginVersion);
|
|
17871
|
+
if (who.repositoryRoot !== undefined)
|
|
17872
|
+
headers[REPOSITORY_HEADER] = who.repositoryRoot;
|
|
17873
|
+
return headers;
|
|
17874
|
+
};
|
|
17875
|
+
|
|
17876
|
+
// ../../schema/src/model.ts
|
|
17801
17877
|
init_dist();
|
|
17802
|
-
|
|
17878
|
+
var ProjectID = brand("ProjectID")(Int);
|
|
17879
|
+
var sessionId = brand("SessionID")(String6.check(isPattern2(/^[0-9a-f]{8}$/)));
|
|
17880
|
+
var SessionID = Object.assign(sessionId, {
|
|
17881
|
+
create: () => {
|
|
17882
|
+
let id = "";
|
|
17883
|
+
for (let i = 0;i < 8; i++)
|
|
17884
|
+
id += Math.floor(Math.random() * 16).toString(16);
|
|
17885
|
+
return id;
|
|
17886
|
+
}
|
|
17887
|
+
});
|
|
17888
|
+
var InboxID = brand("InboxID")(Int);
|
|
17889
|
+
var MessageID = brand("MessageID")(Int);
|
|
17890
|
+
var Time = Number6;
|
|
17891
|
+
var Json3 = Record(String6, Unknown2);
|
|
17892
|
+
var Project = Struct({
|
|
17893
|
+
id: ProjectID,
|
|
17894
|
+
directory: String6,
|
|
17895
|
+
mainSessionId: optional2(SessionID)
|
|
17896
|
+
});
|
|
17897
|
+
var Runtime = Json3;
|
|
17898
|
+
var Session = Struct({
|
|
17899
|
+
id: SessionID,
|
|
17900
|
+
projectId: ProjectID,
|
|
17901
|
+
parentSessionId: optional2(SessionID),
|
|
17902
|
+
agentType: String6,
|
|
17903
|
+
harness: String6,
|
|
17904
|
+
directory: String6,
|
|
17905
|
+
runtime: optional2(Runtime),
|
|
17906
|
+
harnessSessionId: optional2(String6),
|
|
17907
|
+
metadata: Json3,
|
|
17908
|
+
createdAt: Time,
|
|
17909
|
+
endedAt: optional2(Time)
|
|
17910
|
+
});
|
|
17911
|
+
var SenderType = Literals(["user", "session", "system", "plugin"]);
|
|
17912
|
+
var DeliveryStatus = Literals(["pending", "delivering", "delivered", "failed", "dropped"]);
|
|
17913
|
+
var Inbox = Struct({
|
|
17914
|
+
id: InboxID,
|
|
17915
|
+
recipientSessionId: SessionID,
|
|
17916
|
+
senderType: SenderType,
|
|
17917
|
+
senderId: optional2(String6),
|
|
17918
|
+
content: String6,
|
|
17919
|
+
resultMessageId: optional2(MessageID),
|
|
17920
|
+
deliveryStatus: DeliveryStatus
|
|
17921
|
+
});
|
|
17922
|
+
var MessageStatus = Literals(["working", "completed", "failed", "interrupted", "lost", "not_started"]);
|
|
17923
|
+
var Message = Struct({
|
|
17924
|
+
id: MessageID,
|
|
17925
|
+
sessionId: SessionID,
|
|
17926
|
+
inboxId: optional2(InboxID),
|
|
17927
|
+
input: String6,
|
|
17928
|
+
output: optional2(String6),
|
|
17929
|
+
status: MessageStatus,
|
|
17930
|
+
metadata: Json3,
|
|
17931
|
+
startedAt: Time,
|
|
17932
|
+
endedAt: optional2(Time)
|
|
17933
|
+
});
|
|
17803
17934
|
|
|
17804
|
-
//
|
|
17805
|
-
|
|
17806
|
-
init_Option();
|
|
17807
|
-
init_Pipeable();
|
|
17808
|
-
init_PrimaryKey();
|
|
17809
|
-
init_Schema();
|
|
17935
|
+
// ../../schema/src/plugin.ts
|
|
17936
|
+
init_dist();
|
|
17810
17937
|
|
|
17811
|
-
|
|
17812
|
-
|
|
17813
|
-
|
|
17814
|
-
|
|
17815
|
-
|
|
17816
|
-
|
|
17817
|
-
|
|
17818
|
-
return hasProperty(schema, StreamSchemaTypeId);
|
|
17819
|
-
}
|
|
17820
|
-
function getStreamSchemas(schema) {
|
|
17821
|
-
return isStreamSchema(schema) ? some2({
|
|
17822
|
-
success: schema.success,
|
|
17823
|
-
error: schema.error
|
|
17824
|
-
}) : none2();
|
|
17938
|
+
class AgentRefused extends TaggedError3()("AgentRefused", {
|
|
17939
|
+
plugin: String6,
|
|
17940
|
+
reason: String6
|
|
17941
|
+
}) {
|
|
17942
|
+
get message() {
|
|
17943
|
+
return `refused by ${this.plugin}: ${this.reason}`;
|
|
17944
|
+
}
|
|
17825
17945
|
}
|
|
17826
|
-
|
|
17827
|
-
|
|
17828
|
-
return make23(schema2.ast, {
|
|
17829
|
-
[StreamSchemaTypeId]: StreamSchemaTypeId,
|
|
17830
|
-
success,
|
|
17831
|
-
error
|
|
17832
|
-
});
|
|
17946
|
+
|
|
17947
|
+
class HookFailed extends TaggedError3()("HookFailed", { message: String6 }) {
|
|
17833
17948
|
}
|
|
17949
|
+
var Change = Struct({
|
|
17950
|
+
field: String6,
|
|
17951
|
+
from: optional2(Unknown2),
|
|
17952
|
+
to: optional2(Unknown2),
|
|
17953
|
+
overwrote: optional2(String6)
|
|
17954
|
+
});
|
|
17955
|
+
var TraceEntry = Struct({
|
|
17956
|
+
plugin: String6,
|
|
17957
|
+
hook: String6,
|
|
17958
|
+
outcome: Literals(["ok", "refused", "crashed", "timeout"]),
|
|
17959
|
+
ms: Number6,
|
|
17960
|
+
changes: ArraySchema(Change),
|
|
17961
|
+
reason: optional2(String6),
|
|
17962
|
+
error: optional2(String6)
|
|
17963
|
+
});
|
|
17964
|
+
var Routing = Struct({
|
|
17965
|
+
decidedBy: Record(String6, String6),
|
|
17966
|
+
trace: ArraySchema(TraceEntry)
|
|
17967
|
+
});
|
|
17968
|
+
var PluginInfo = Struct({
|
|
17969
|
+
id: String6,
|
|
17970
|
+
source: String6,
|
|
17971
|
+
revision: String6,
|
|
17972
|
+
loadedAt: Number6,
|
|
17973
|
+
status: Literals(["active", "failed"]),
|
|
17974
|
+
error: optional2(String6),
|
|
17975
|
+
calls: Number6,
|
|
17976
|
+
changed: Number6,
|
|
17977
|
+
crashed: Number6,
|
|
17978
|
+
timedOut: Number6,
|
|
17979
|
+
refused: Number6,
|
|
17980
|
+
lastError: optional2(String6)
|
|
17981
|
+
});
|
|
17834
17982
|
|
|
17835
|
-
//
|
|
17836
|
-
|
|
17837
|
-
var
|
|
17838
|
-
|
|
17839
|
-
|
|
17840
|
-
|
|
17841
|
-
|
|
17842
|
-
|
|
17843
|
-
|
|
17844
|
-
|
|
17845
|
-
|
|
17846
|
-
|
|
17847
|
-
|
|
17848
|
-
|
|
17849
|
-
|
|
17850
|
-
|
|
17983
|
+
// ../../schema/src/project.ts
|
|
17984
|
+
init_dist();
|
|
17985
|
+
var ProjectKind = Literals(["docs", "memory", "scratch"]);
|
|
17986
|
+
var ProjectEntry = Struct({
|
|
17987
|
+
path: String6,
|
|
17988
|
+
size: Number6,
|
|
17989
|
+
mtime: String6,
|
|
17990
|
+
version: String6,
|
|
17991
|
+
description: String6
|
|
17992
|
+
});
|
|
17993
|
+
var ProjectInfoResult = Struct({
|
|
17994
|
+
instructions: String6,
|
|
17995
|
+
docs: ArraySchema(ProjectEntry),
|
|
17996
|
+
memory: ArraySchema(ProjectEntry),
|
|
17997
|
+
scratch: ArraySchema(ProjectEntry),
|
|
17998
|
+
scratchPath: String6
|
|
17999
|
+
});
|
|
18000
|
+
var ProjectListInput = Struct({ kind: ProjectKind });
|
|
18001
|
+
var ProjectReadInput = Struct({ kind: ProjectKind, path: String6 });
|
|
18002
|
+
var ProjectReadResult = Struct({ content: String6, version: String6 });
|
|
18003
|
+
var ProjectSearchInput = Struct({ query: String6, kind: optional2(ProjectKind) });
|
|
18004
|
+
var ProjectWriteInput = Struct({
|
|
18005
|
+
kind: ProjectKind,
|
|
18006
|
+
path: String6,
|
|
18007
|
+
content: String6,
|
|
18008
|
+
ifVersion: String6
|
|
18009
|
+
});
|
|
18010
|
+
var ProjectWriteResult = Struct({ version: String6 });
|
|
18011
|
+
var ProjectDeleteInput = Struct({ kind: ProjectKind, path: String6, ifVersion: String6 });
|
|
18012
|
+
|
|
18013
|
+
class ProjectConflict extends TaggedError3()("ProjectConflict", {
|
|
18014
|
+
message: String6
|
|
18015
|
+
}) {
|
|
18016
|
+
}
|
|
18017
|
+
|
|
18018
|
+
class ProjectInvalid extends TaggedError3()("ProjectInvalid", {
|
|
18019
|
+
message: String6
|
|
18020
|
+
}) {
|
|
18021
|
+
}
|
|
18022
|
+
|
|
18023
|
+
// ../../schema/src/remove.ts
|
|
18024
|
+
init_dist();
|
|
18025
|
+
var RemoveOutcome = Struct({
|
|
18026
|
+
id: String6,
|
|
18027
|
+
processes: Literals(["exited", "alive", "unknown"]),
|
|
18028
|
+
pane: Literals(["closed", "kept", "none"]),
|
|
18029
|
+
workspace: Literals(["closed", "kept", "none"]),
|
|
18030
|
+
worktree: Literals(["removed", "kept", "gone"]),
|
|
18031
|
+
path: String6,
|
|
18032
|
+
branch: NullOr(String6),
|
|
18033
|
+
reasons: ArraySchema(String6)
|
|
18034
|
+
});
|
|
18035
|
+
|
|
18036
|
+
// ../../protocol/src/rpc.ts
|
|
18037
|
+
init_session();
|
|
18038
|
+
|
|
18039
|
+
// ../../schema/src/subscription.ts
|
|
18040
|
+
init_dist();
|
|
18041
|
+
init_session();
|
|
18042
|
+
var SubscriptionAccount = Struct({
|
|
18043
|
+
kind: Literals(["subscription", "api-key", "none"]),
|
|
18044
|
+
plan: optional2(String6),
|
|
18045
|
+
provider: optional2(String6)
|
|
18046
|
+
});
|
|
18047
|
+
var SubscriptionLimit = Struct({
|
|
18048
|
+
window: String6,
|
|
18049
|
+
percent: Number6,
|
|
18050
|
+
status: Literals(["available", "limited"]),
|
|
18051
|
+
resetTime: NullOr(Number6)
|
|
18052
|
+
});
|
|
18053
|
+
var Subscription = Struct({
|
|
18054
|
+
harness: Literals(HARNESS_IDS),
|
|
18055
|
+
provider: String6,
|
|
18056
|
+
machine: Literal2("local"),
|
|
18057
|
+
account: SubscriptionAccount,
|
|
18058
|
+
limits: ArraySchema(SubscriptionLimit),
|
|
18059
|
+
updatedAt: Number6,
|
|
18060
|
+
error: optional2(String6)
|
|
18061
|
+
});
|
|
18062
|
+
|
|
18063
|
+
// ../../protocol/src/rpc.ts
|
|
18064
|
+
init_dist();
|
|
18065
|
+
|
|
18066
|
+
// ../../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/rpc/Rpc.js
|
|
18067
|
+
init_Context();
|
|
18068
|
+
init_Option();
|
|
18069
|
+
init_Pipeable();
|
|
18070
|
+
init_PrimaryKey();
|
|
18071
|
+
init_Schema();
|
|
18072
|
+
|
|
18073
|
+
// ../../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/rpc/RpcSchema.js
|
|
18074
|
+
init_Option();
|
|
18075
|
+
init_Predicate();
|
|
18076
|
+
init_Schema();
|
|
18077
|
+
init_Stream();
|
|
18078
|
+
var StreamSchemaTypeId = "~effect/rpc/RpcSchema/StreamSchema";
|
|
18079
|
+
function isStreamSchema(schema) {
|
|
18080
|
+
return hasProperty(schema, StreamSchemaTypeId);
|
|
18081
|
+
}
|
|
18082
|
+
function getStreamSchemas(schema) {
|
|
18083
|
+
return isStreamSchema(schema) ? some2({
|
|
18084
|
+
success: schema.success,
|
|
18085
|
+
error: schema.error
|
|
18086
|
+
}) : none2();
|
|
18087
|
+
}
|
|
18088
|
+
var schema2 = /* @__PURE__ */ declare(isStream);
|
|
18089
|
+
function Stream2(success, error) {
|
|
18090
|
+
return make23(schema2.ast, {
|
|
18091
|
+
[StreamSchemaTypeId]: StreamSchemaTypeId,
|
|
18092
|
+
success,
|
|
18093
|
+
error
|
|
18094
|
+
});
|
|
18095
|
+
}
|
|
18096
|
+
|
|
18097
|
+
// ../../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/rpc/Rpc.js
|
|
18098
|
+
var TypeId50 = "~effect/rpc/Rpc";
|
|
18099
|
+
var Proto18 = {
|
|
18100
|
+
[TypeId50]: TypeId50,
|
|
18101
|
+
pipe() {
|
|
18102
|
+
return pipeArguments(this, arguments);
|
|
18103
|
+
},
|
|
18104
|
+
setSuccess(successSchema) {
|
|
18105
|
+
return makeProto2({
|
|
18106
|
+
_tag: this._tag,
|
|
18107
|
+
payloadSchema: this.payloadSchema,
|
|
18108
|
+
successSchema,
|
|
18109
|
+
errorSchema: this.errorSchema,
|
|
18110
|
+
defectSchema: this.defectSchema,
|
|
18111
|
+
annotations: this.annotations,
|
|
18112
|
+
middlewares: this.middlewares
|
|
17851
18113
|
});
|
|
17852
18114
|
},
|
|
17853
18115
|
setError(errorSchema) {
|
|
@@ -18513,7 +18775,7 @@ var makeNoSerialization = /* @__PURE__ */ fnUntraced2(function* (group, options)
|
|
|
18513
18775
|
spanId: span.spanId,
|
|
18514
18776
|
sampled: span.sampled
|
|
18515
18777
|
} : {},
|
|
18516
|
-
headers:
|
|
18778
|
+
headers: merge5(parentFiber.getRef(CurrentHeaders), headers)
|
|
18517
18779
|
});
|
|
18518
18780
|
if (discard) {
|
|
18519
18781
|
return send;
|
|
@@ -18587,7 +18849,7 @@ var makeNoSerialization = /* @__PURE__ */ fnUntraced2(function* (group, options)
|
|
|
18587
18849
|
spanId: span.spanId,
|
|
18588
18850
|
sampled: span.sampled
|
|
18589
18851
|
} : {},
|
|
18590
|
-
headers:
|
|
18852
|
+
headers: merge5(fiber.getRef(CurrentHeaders), headers)
|
|
18591
18853
|
}).pipe(span ? withParentSpan2(span, {
|
|
18592
18854
|
captureStackTrace: false
|
|
18593
18855
|
}) : identity, onError2((cause) => failCause4(queue, cause)), interruptible2, forkIn2(scope, {
|
|
@@ -18843,7 +19105,7 @@ var makeRpcSchemas = (codecFor) => {
|
|
|
18843
19105
|
var CurrentHeaders = /* @__PURE__ */ Reference("effect/rpc/RpcClient/CurrentHeaders", {
|
|
18844
19106
|
defaultValue: () => empty7
|
|
18845
19107
|
});
|
|
18846
|
-
var withHeaders = /* @__PURE__ */ dual(2, (effect, headers) => updateService2(effect, CurrentHeaders,
|
|
19108
|
+
var withHeaders = /* @__PURE__ */ dual(2, (effect, headers) => updateService2(effect, CurrentHeaders, merge5(fromInput(headers))));
|
|
18847
19109
|
|
|
18848
19110
|
class Protocol extends (/* @__PURE__ */ Service()("effect/rpc/RpcClient/Protocol")) {
|
|
18849
19111
|
static make = withRunClient;
|
|
@@ -19168,200 +19430,13 @@ var Service2 = () => (id, options) => {
|
|
|
19168
19430
|
ServiceClass_.requiredForClient = options?.requiredForClient ?? false;
|
|
19169
19431
|
return ServiceClass;
|
|
19170
19432
|
};
|
|
19171
|
-
// ../../client/src/client.ts
|
|
19172
|
-
init_layout();
|
|
19173
|
-
|
|
19174
|
-
// ../../protocol/src/protocol.ts
|
|
19175
|
-
var PROTOCOL = 3;
|
|
19176
|
-
var PROTOCOL_HEADER = "vibest-protocol";
|
|
19177
|
-
var CALLER_HEADER = "vibest-caller";
|
|
19178
|
-
var SESSION_HEADER = "vibest-session-id";
|
|
19179
|
-
var REPOSITORY_HEADER = "vibest-repository";
|
|
19180
|
-
|
|
19181
|
-
// ../../protocol/src/rpc.ts
|
|
19182
|
-
init_dist();
|
|
19183
|
-
|
|
19184
|
-
// ../../schema/src/plugin.ts
|
|
19185
|
-
init_dist();
|
|
19186
|
-
|
|
19187
|
-
class AgentRefused extends TaggedError3()("AgentRefused", { plugin: String6, reason: String6 }) {
|
|
19188
|
-
get message() {
|
|
19189
|
-
return `refused by ${this.plugin}: ${this.reason}`;
|
|
19190
|
-
}
|
|
19191
|
-
}
|
|
19192
|
-
|
|
19193
|
-
class HookFailed extends TaggedError3()("HookFailed", { message: String6 }) {
|
|
19194
|
-
}
|
|
19195
|
-
var Change = Struct({
|
|
19196
|
-
field: String6,
|
|
19197
|
-
from: optional2(Unknown2),
|
|
19198
|
-
to: optional2(Unknown2),
|
|
19199
|
-
overwrote: optional2(String6)
|
|
19200
|
-
});
|
|
19201
|
-
var TraceEntry = Struct({
|
|
19202
|
-
plugin: String6,
|
|
19203
|
-
hook: String6,
|
|
19204
|
-
outcome: Literals(["ok", "refused", "crashed", "timeout"]),
|
|
19205
|
-
ms: Number6,
|
|
19206
|
-
changes: ArraySchema(Change),
|
|
19207
|
-
reason: optional2(String6),
|
|
19208
|
-
error: optional2(String6)
|
|
19209
|
-
});
|
|
19210
|
-
var Routing = Struct({
|
|
19211
|
-
decidedBy: Record(String6, String6),
|
|
19212
|
-
trace: ArraySchema(TraceEntry)
|
|
19213
|
-
});
|
|
19214
|
-
var PluginInfo = Struct({
|
|
19215
|
-
id: String6,
|
|
19216
|
-
source: String6,
|
|
19217
|
-
revision: String6,
|
|
19218
|
-
loadedAt: Number6,
|
|
19219
|
-
status: Literals(["active", "failed"]),
|
|
19220
|
-
error: optional2(String6),
|
|
19221
|
-
calls: Number6,
|
|
19222
|
-
changed: Number6,
|
|
19223
|
-
crashed: Number6,
|
|
19224
|
-
timedOut: Number6,
|
|
19225
|
-
refused: Number6,
|
|
19226
|
-
lastError: optional2(String6)
|
|
19227
|
-
});
|
|
19228
|
-
|
|
19229
|
-
// ../../schema/src/subscription.ts
|
|
19230
|
-
init_dist();
|
|
19231
|
-
init_session();
|
|
19232
|
-
var SubscriptionAccount = Struct({
|
|
19233
|
-
kind: Literals(["subscription", "api-key", "none"]),
|
|
19234
|
-
plan: optional2(String6),
|
|
19235
|
-
provider: optional2(String6)
|
|
19236
|
-
});
|
|
19237
|
-
var SubscriptionLimit = Struct({
|
|
19238
|
-
window: String6,
|
|
19239
|
-
percent: Number6,
|
|
19240
|
-
status: Literals(["available", "limited"]),
|
|
19241
|
-
resetTime: NullOr(Number6)
|
|
19242
|
-
});
|
|
19243
|
-
var Subscription = Struct({
|
|
19244
|
-
harness: Literals(HARNESS_IDS),
|
|
19245
|
-
provider: String6,
|
|
19246
|
-
machine: Literal2("local"),
|
|
19247
|
-
account: SubscriptionAccount,
|
|
19248
|
-
limits: ArraySchema(SubscriptionLimit),
|
|
19249
|
-
updatedAt: Number6,
|
|
19250
|
-
error: optional2(String6)
|
|
19251
|
-
});
|
|
19252
|
-
|
|
19253
|
-
// ../../schema/src/project.ts
|
|
19254
|
-
init_dist();
|
|
19255
|
-
var ProjectKind = Literals(["docs", "memory", "scratch"]);
|
|
19256
|
-
var ProjectEntry = Struct({
|
|
19257
|
-
path: String6,
|
|
19258
|
-
size: Number6,
|
|
19259
|
-
mtime: String6,
|
|
19260
|
-
version: String6,
|
|
19261
|
-
description: String6
|
|
19262
|
-
});
|
|
19263
|
-
var ProjectInfoResult = Struct({
|
|
19264
|
-
instructions: String6,
|
|
19265
|
-
docs: ArraySchema(ProjectEntry),
|
|
19266
|
-
memory: ArraySchema(ProjectEntry),
|
|
19267
|
-
scratch: ArraySchema(ProjectEntry),
|
|
19268
|
-
scratchPath: String6
|
|
19269
|
-
});
|
|
19270
|
-
var ProjectListInput = Struct({ kind: ProjectKind });
|
|
19271
|
-
var ProjectReadInput = Struct({ kind: ProjectKind, path: String6 });
|
|
19272
|
-
var ProjectReadResult = Struct({ content: String6, version: String6 });
|
|
19273
|
-
var ProjectSearchInput = Struct({ query: String6, kind: optional2(ProjectKind) });
|
|
19274
|
-
var ProjectWriteInput = Struct({ kind: ProjectKind, path: String6, content: String6, ifVersion: String6 });
|
|
19275
|
-
var ProjectWriteResult = Struct({ version: String6 });
|
|
19276
|
-
var ProjectDeleteInput = Struct({ kind: ProjectKind, path: String6, ifVersion: String6 });
|
|
19277
|
-
|
|
19278
|
-
class ProjectConflict extends TaggedError3()("ProjectConflict", { message: String6 }) {
|
|
19279
|
-
}
|
|
19280
|
-
|
|
19281
|
-
class ProjectInvalid extends TaggedError3()("ProjectInvalid", { message: String6 }) {
|
|
19282
|
-
}
|
|
19283
|
-
|
|
19284
|
-
// ../../schema/src/remove.ts
|
|
19285
|
-
init_dist();
|
|
19286
|
-
var RemoveOutcome = Struct({
|
|
19287
|
-
id: String6,
|
|
19288
|
-
processes: Literals(["exited", "alive", "unknown"]),
|
|
19289
|
-
pane: Literals(["closed", "kept", "none"]),
|
|
19290
|
-
workspace: Literals(["closed", "kept", "none"]),
|
|
19291
|
-
worktree: Literals(["removed", "kept", "gone"]),
|
|
19292
|
-
path: String6,
|
|
19293
|
-
branch: NullOr(String6),
|
|
19294
|
-
reasons: ArraySchema(String6)
|
|
19295
|
-
});
|
|
19296
|
-
|
|
19297
|
-
// ../../schema/src/model.ts
|
|
19298
|
-
init_dist();
|
|
19299
|
-
var ProjectID = brand("ProjectID")(Int);
|
|
19300
|
-
var sessionId = brand("SessionID")(String6.check(isPattern2(/^[0-9a-f]{8}$/)));
|
|
19301
|
-
var SessionID = Object.assign(sessionId, {
|
|
19302
|
-
create: () => {
|
|
19303
|
-
let id = "";
|
|
19304
|
-
for (let i = 0;i < 8; i++)
|
|
19305
|
-
id += Math.floor(Math.random() * 16).toString(16);
|
|
19306
|
-
return id;
|
|
19307
|
-
}
|
|
19308
|
-
});
|
|
19309
|
-
var InboxID = brand("InboxID")(Int);
|
|
19310
|
-
var MessageID = brand("MessageID")(Int);
|
|
19311
|
-
var Time = Number6;
|
|
19312
|
-
var Json3 = Record(String6, Unknown2);
|
|
19313
|
-
var Project = Struct({
|
|
19314
|
-
id: ProjectID,
|
|
19315
|
-
directory: String6,
|
|
19316
|
-
mainSessionId: optional2(SessionID)
|
|
19317
|
-
});
|
|
19318
|
-
var Runtime = Json3;
|
|
19319
|
-
var Session = Struct({
|
|
19320
|
-
id: SessionID,
|
|
19321
|
-
projectId: ProjectID,
|
|
19322
|
-
parentSessionId: optional2(SessionID),
|
|
19323
|
-
agentType: String6,
|
|
19324
|
-
harness: String6,
|
|
19325
|
-
directory: String6,
|
|
19326
|
-
runtime: optional2(Runtime),
|
|
19327
|
-
harnessSessionId: optional2(String6),
|
|
19328
|
-
metadata: Json3,
|
|
19329
|
-
createdAt: Time,
|
|
19330
|
-
endedAt: optional2(Time)
|
|
19331
|
-
});
|
|
19332
|
-
var SenderType = Literals(["user", "session", "system", "plugin"]);
|
|
19333
|
-
var DeliveryStatus = Literals(["pending", "delivering", "delivered", "failed", "dropped"]);
|
|
19334
|
-
var Inbox = Struct({
|
|
19335
|
-
id: InboxID,
|
|
19336
|
-
recipientSessionId: SessionID,
|
|
19337
|
-
senderType: SenderType,
|
|
19338
|
-
senderId: optional2(String6),
|
|
19339
|
-
content: String6,
|
|
19340
|
-
resultMessageId: optional2(MessageID),
|
|
19341
|
-
deliveryStatus: DeliveryStatus
|
|
19342
|
-
});
|
|
19343
|
-
var MessageStatus = Literals(["working", "completed", "failed", "interrupted", "lost", "not_started"]);
|
|
19344
|
-
var Message = Struct({
|
|
19345
|
-
id: MessageID,
|
|
19346
|
-
sessionId: SessionID,
|
|
19347
|
-
inboxId: optional2(InboxID),
|
|
19348
|
-
input: String6,
|
|
19349
|
-
output: optional2(String6),
|
|
19350
|
-
status: MessageStatus,
|
|
19351
|
-
metadata: Json3,
|
|
19352
|
-
startedAt: Time,
|
|
19353
|
-
endedAt: optional2(Time)
|
|
19354
|
-
});
|
|
19355
|
-
|
|
19356
|
-
// ../../protocol/src/rpc.ts
|
|
19357
|
-
init_session();
|
|
19358
19433
|
// ../../protocol/package.json
|
|
19359
19434
|
var package_default = {
|
|
19360
19435
|
name: "@vibest/protocol",
|
|
19361
|
-
version: "0.0.1-beta.
|
|
19436
|
+
version: "0.0.1-beta.14",
|
|
19362
19437
|
private: true,
|
|
19363
|
-
type: "module",
|
|
19364
19438
|
license: "MIT",
|
|
19439
|
+
type: "module",
|
|
19365
19440
|
exports: {
|
|
19366
19441
|
"./*": "./src/*.ts"
|
|
19367
19442
|
},
|
|
@@ -19381,28 +19456,43 @@ var DaemonIdentity = Struct({
|
|
|
19381
19456
|
command: optional2(ArraySchema(String6)),
|
|
19382
19457
|
startedAt: optional2(Number6)
|
|
19383
19458
|
});
|
|
19384
|
-
var RuntimeStatus = Struct({
|
|
19459
|
+
var RuntimeStatus = Struct({
|
|
19460
|
+
kind: String6,
|
|
19461
|
+
status: String6,
|
|
19462
|
+
reason: optional2(String6)
|
|
19463
|
+
});
|
|
19385
19464
|
var RuntimeDoctor = Struct({
|
|
19386
19465
|
kind: String6,
|
|
19387
19466
|
status: String6,
|
|
19388
19467
|
reason: optional2(String6),
|
|
19389
19468
|
name: String6,
|
|
19390
|
-
checks: ArraySchema(Struct({
|
|
19469
|
+
checks: ArraySchema(Struct({
|
|
19470
|
+
ok: Boolean3,
|
|
19471
|
+
subject: optional2(String6),
|
|
19472
|
+
text: String6,
|
|
19473
|
+
fix: optional2(String6)
|
|
19474
|
+
}))
|
|
19391
19475
|
});
|
|
19392
19476
|
var PingResult = Struct({
|
|
19393
19477
|
protocol: optional2(Number6),
|
|
19394
19478
|
version: String6,
|
|
19395
19479
|
runtimes: optional2(ArraySchema(RuntimeStatus)),
|
|
19396
|
-
...DaemonIdentity.fields
|
|
19480
|
+
...DaemonIdentity.fields,
|
|
19481
|
+
capabilities: optional2(Record(String6, Boolean3))
|
|
19397
19482
|
});
|
|
19398
19483
|
var VERSION = package_default.version;
|
|
19399
19484
|
class ProtocolRejected extends TaggedError3()("ProtocolRejected", {
|
|
19400
19485
|
method: String6,
|
|
19401
|
-
protocol: NullOr(String6)
|
|
19486
|
+
protocol: NullOr(String6),
|
|
19487
|
+
mismatch: Struct({
|
|
19488
|
+
protocol: Number6,
|
|
19489
|
+
version: String6,
|
|
19490
|
+
message: String6,
|
|
19491
|
+
action: String6
|
|
19492
|
+
})
|
|
19402
19493
|
}) {
|
|
19403
19494
|
get message() {
|
|
19404
|
-
|
|
19405
|
-
return `${this.method} requires vibest protocol ${PROTOCOL}; the request sent ${got}. Restart vibestd with this vibest (\`vibest daemon\`). An old client that cannot read this error is still refused.`;
|
|
19495
|
+
return `${this.method} refused: ${this.mismatch.message}`;
|
|
19406
19496
|
}
|
|
19407
19497
|
}
|
|
19408
19498
|
|
|
@@ -19412,7 +19502,10 @@ class InvalidCaller extends TaggedError3()("InvalidCaller", {
|
|
|
19412
19502
|
}) {
|
|
19413
19503
|
}
|
|
19414
19504
|
|
|
19415
|
-
class Forbidden2 extends TaggedError3()("Forbidden", {
|
|
19505
|
+
class Forbidden2 extends TaggedError3()("Forbidden", {
|
|
19506
|
+
method: String6,
|
|
19507
|
+
message: String6
|
|
19508
|
+
}) {
|
|
19416
19509
|
}
|
|
19417
19510
|
|
|
19418
19511
|
class Caller extends Service()("vibest/Caller") {
|
|
@@ -19427,15 +19520,15 @@ var Blocker = Struct({ id: String6, reason: String6 });
|
|
|
19427
19520
|
|
|
19428
19521
|
class DaemonBusy extends TaggedError3()("DaemonBusy", { blockers: ArraySchema(Blocker) }) {
|
|
19429
19522
|
get message() {
|
|
19430
|
-
return [
|
|
19431
|
-
"vibestd was not stopped; still in use by:",
|
|
19432
|
-
...this.blockers.map((b) => ` ${b.id}: ${b.reason}`)
|
|
19433
|
-
].join(`
|
|
19523
|
+
return ["vibestd was not stopped; still in use by:", ...this.blockers.map((b) => ` ${b.id}: ${b.reason}`)].join(`
|
|
19434
19524
|
`);
|
|
19435
19525
|
}
|
|
19436
19526
|
}
|
|
19437
19527
|
|
|
19438
|
-
class WrongInstance extends TaggedError3()("WrongInstance", {
|
|
19528
|
+
class WrongInstance extends TaggedError3()("WrongInstance", {
|
|
19529
|
+
expected: String6,
|
|
19530
|
+
actual: NullOr(String6)
|
|
19531
|
+
}) {
|
|
19439
19532
|
get message() {
|
|
19440
19533
|
return `vibestd instance ${this.actual ?? "unknown"} answers, not ${this.expected}; nothing was stopped`;
|
|
19441
19534
|
}
|
|
@@ -19458,7 +19551,12 @@ class CallerGate extends Service2()("vibest/CallerGate", {
|
|
|
19458
19551
|
var protocol = (rpc) => rpc.middleware(ProtocolGate);
|
|
19459
19552
|
var admitted = (rpc) => rpc.middleware(Admission);
|
|
19460
19553
|
var scoped4 = (rpc) => rpc.middleware(CallerGate).middleware(ProtocolGate);
|
|
19461
|
-
var GitInfo = Struct({
|
|
19554
|
+
var GitInfo = Struct({
|
|
19555
|
+
branch: String6,
|
|
19556
|
+
pushed: Boolean3,
|
|
19557
|
+
saved: Boolean3,
|
|
19558
|
+
why: String6
|
|
19559
|
+
});
|
|
19462
19560
|
var SessionInfo = Struct({
|
|
19463
19561
|
id: String6,
|
|
19464
19562
|
name: String6,
|
|
@@ -19488,17 +19586,6 @@ var SessionInfo = Struct({
|
|
|
19488
19586
|
});
|
|
19489
19587
|
var InboxMessage = Struct({ ...InboxRow.fields, details: Record(String6, Unknown2) });
|
|
19490
19588
|
var SessionStatusInfo = Struct({ ...SessionInfo.fields, result: NullOr(InboxMessage) });
|
|
19491
|
-
var InboxResult = Struct({
|
|
19492
|
-
generation: optional2(String6),
|
|
19493
|
-
token: optional2(String6),
|
|
19494
|
-
file: optional2(String6),
|
|
19495
|
-
acked: optional2(Boolean3),
|
|
19496
|
-
released: optional2(Boolean3),
|
|
19497
|
-
already: optional2(Boolean3),
|
|
19498
|
-
empty: optional2(Boolean3),
|
|
19499
|
-
error: optional2(String6),
|
|
19500
|
-
bytes: optional2(Number6)
|
|
19501
|
-
});
|
|
19502
19589
|
|
|
19503
19590
|
class VibestRpcs extends make31(make29("Ping", { success: PingResult }), scoped4(admitted(make29("Spawn", {
|
|
19504
19591
|
payload: {
|
|
@@ -19511,8 +19598,7 @@ class VibestRpcs extends make31(make29("Ping", { success: PingResult }), scoped4
|
|
|
19511
19598
|
agent: optional2(String6),
|
|
19512
19599
|
machine: optional2(RuntimeMachine),
|
|
19513
19600
|
peer: optional2(String6),
|
|
19514
|
-
archive: optional2(Boolean3)
|
|
19515
|
-
access: optional2(Literals(["read", "write"]))
|
|
19601
|
+
archive: optional2(Boolean3)
|
|
19516
19602
|
},
|
|
19517
19603
|
success: Struct({
|
|
19518
19604
|
id: String6,
|
|
@@ -19521,17 +19607,41 @@ class VibestRpcs extends make31(make29("Ping", { success: PingResult }), scoped4
|
|
|
19521
19607
|
model: optional2(String6),
|
|
19522
19608
|
...Routing.fields
|
|
19523
19609
|
}),
|
|
19524
|
-
error: Union2([
|
|
19525
|
-
|
|
19610
|
+
error: Union2([
|
|
19611
|
+
InvalidCaller,
|
|
19612
|
+
Forbidden2,
|
|
19613
|
+
LimitReached,
|
|
19614
|
+
AllocationFailed,
|
|
19615
|
+
HarnessUnavailable,
|
|
19616
|
+
NotInRepository,
|
|
19617
|
+
NoHarnessChosen,
|
|
19618
|
+
NoRuntime,
|
|
19619
|
+
AgentRefused,
|
|
19620
|
+
NoSuchSession,
|
|
19621
|
+
RuntimeUnreachable,
|
|
19622
|
+
RuntimeIncompatible
|
|
19623
|
+
])
|
|
19624
|
+
}))), protocol(make29("Plugins", { success: ArraySchema(PluginInfo) })), protocol(make29("Runtimes.Doctor", {
|
|
19625
|
+
payload: { harnesses: ArraySchema(String6) },
|
|
19626
|
+
success: ArraySchema(RuntimeDoctor)
|
|
19627
|
+
})), protocol(make29("Subscriptions", { success: ArraySchema(Subscription) })), protocol(make29("Republish", { success: Number6 })), scoped4(admitted(make29("Launch", {
|
|
19526
19628
|
payload: {
|
|
19527
19629
|
argv: ArraySchema(String6),
|
|
19528
19630
|
focus: Boolean3,
|
|
19529
19631
|
machine: optional2(RuntimeMachine),
|
|
19530
19632
|
runtime: optional2(String6)
|
|
19531
19633
|
},
|
|
19532
|
-
success: Struct({
|
|
19634
|
+
success: Struct({
|
|
19635
|
+
runtime: String6,
|
|
19636
|
+
terminal: String6,
|
|
19637
|
+
place: String6,
|
|
19638
|
+
attach: NullOr(ArraySchema(String6))
|
|
19639
|
+
}),
|
|
19533
19640
|
error: Union2([InvalidCaller, Forbidden2, NotInRepository, LaunchFailed, NoRuntime, AgentRefused])
|
|
19534
|
-
}))), scoped4(admitted(make29("Send", {
|
|
19641
|
+
}))), scoped4(admitted(make29("Send", {
|
|
19642
|
+
payload: { id: String6, message: String6 },
|
|
19643
|
+
error: Union2([Forbidden2, NoSuchSession])
|
|
19644
|
+
}))), scoped4(admitted(make29("Interrupt", {
|
|
19535
19645
|
payload: { id: String6 },
|
|
19536
19646
|
success: Struct({ message: String6 }),
|
|
19537
19647
|
error: Union2([Forbidden2, NoSuchSession, SessionBusy, RuntimeUnreachable, NoRuntime])
|
|
@@ -19543,23 +19653,15 @@ class VibestRpcs extends make31(make29("Ping", { success: PingResult }), scoped4
|
|
|
19543
19653
|
payload: { stopped: optional2(Boolean3), all: optional2(Boolean3) },
|
|
19544
19654
|
success: ArraySchema(SessionInfo),
|
|
19545
19655
|
error: Union2([Forbidden2])
|
|
19546
|
-
})), scoped4(make29("Get", {
|
|
19547
|
-
payload: {
|
|
19548
|
-
success:
|
|
19549
|
-
error: Union2([
|
|
19550
|
-
}))
|
|
19551
|
-
payload: {
|
|
19552
|
-
success:
|
|
19553
|
-
error: Union2([
|
|
19554
|
-
}))
|
|
19555
|
-
payload: { generation: String6, claudeSessionId: String6, token: String6, terminal: String6, machine: optional2(RuntimeMachine) },
|
|
19556
|
-
success: InboxResult,
|
|
19557
|
-
error: Union2([InvalidCaller, Forbidden2, RuntimeUnreachable, RuntimeIncompatible])
|
|
19558
|
-
}))), scoped4(admitted(make29("Inbox.Release", {
|
|
19559
|
-
payload: { generation: String6, claudeSessionId: String6, token: String6, retry: Boolean3, terminal: String6, machine: optional2(RuntimeMachine) },
|
|
19560
|
-
success: InboxResult,
|
|
19561
|
-
error: Union2([InvalidCaller, Forbidden2, RuntimeUnreachable, RuntimeIncompatible])
|
|
19562
|
-
}))), protocol(admitted(make29("ResultReady", { payload: { sessionId: String6 } }))), protocol(admitted(make29("Prompt", { payload: { sessionId: String6, text: String6 } }))), scoped4(admitted(make29("Project.CoordinatorSession", {
|
|
19656
|
+
})), scoped4(make29("Get", {
|
|
19657
|
+
payload: { id: String6 },
|
|
19658
|
+
success: SessionStatusInfo,
|
|
19659
|
+
error: Union2([Forbidden2, NoSuchSession])
|
|
19660
|
+
})), scoped4(make29("Peek", {
|
|
19661
|
+
payload: { id: String6, lines: optional2(Number6) },
|
|
19662
|
+
success: Struct({ text: String6 }),
|
|
19663
|
+
error: Union2([Forbidden2, NoSuchSession, NoRuntime, RuntimeUnreachable])
|
|
19664
|
+
})), scoped4(admitted(make29("Report", { payload: { message: String6 }, error: Union2([Forbidden2, NoSuchSession]) }))), scoped4(make29("Inbox.Subscribe", { success: String6, error: Union2([Forbidden2]), stream: true })), protocol(admitted(make29("ResultReady", { payload: { sessionId: String6 } }))), protocol(admitted(make29("Prompt", { payload: { sessionId: String6, text: String6 } }))), scoped4(admitted(make29("Project.CoordinatorSession", {
|
|
19563
19665
|
payload: {
|
|
19564
19666
|
harness: Literals(HARNESS_IDS),
|
|
19565
19667
|
fresh: Boolean3,
|
|
@@ -19568,9 +19670,16 @@ class VibestRpcs extends make31(make29("Ping", { success: PingResult }), scoped4
|
|
|
19568
19670
|
runtime: optional2(String6),
|
|
19569
19671
|
provider: optional2(String6),
|
|
19570
19672
|
model: optional2(String6),
|
|
19571
|
-
routing: optional2(Routing)
|
|
19673
|
+
routing: optional2(Routing),
|
|
19674
|
+
pid: optional2(Number6),
|
|
19675
|
+
env: optional2(Record(String6, String6))
|
|
19572
19676
|
},
|
|
19573
|
-
success: Struct({
|
|
19677
|
+
success: Struct({
|
|
19678
|
+
sessionId: String6,
|
|
19679
|
+
harnessSessionId: NullOr(String6),
|
|
19680
|
+
projectId: optional2(Number6),
|
|
19681
|
+
runtime: optional2(String6)
|
|
19682
|
+
}),
|
|
19574
19683
|
error: Union2([InvalidCaller, Forbidden2, NotInRepository, RuntimeUnreachable, RuntimeIncompatible])
|
|
19575
19684
|
}))), scoped4(make29("Project.StartMain", {
|
|
19576
19685
|
payload: {
|
|
@@ -19586,14 +19695,30 @@ class VibestRpcs extends make31(make29("Ping", { success: PingResult }), scoped4
|
|
|
19586
19695
|
runtime: String6,
|
|
19587
19696
|
...Routing.fields
|
|
19588
19697
|
}),
|
|
19589
|
-
error: Union2([
|
|
19698
|
+
error: Union2([
|
|
19699
|
+
InvalidCaller,
|
|
19700
|
+
Forbidden2,
|
|
19701
|
+
NotInRepository,
|
|
19702
|
+
NoHarnessChosen,
|
|
19703
|
+
AgentRefused,
|
|
19704
|
+
HarnessUnavailable,
|
|
19705
|
+
NoRuntime
|
|
19706
|
+
])
|
|
19590
19707
|
})), scoped4(make29("Project.RunningCoordinator", {
|
|
19591
19708
|
payload: { terminal: String6, machine: optional2(RuntimeMachine) },
|
|
19592
|
-
success: NullOr(Struct({
|
|
19709
|
+
success: NullOr(Struct({
|
|
19710
|
+
harness: Literals(HARNESS_IDS),
|
|
19711
|
+
place: String6,
|
|
19712
|
+
runtime: String6,
|
|
19713
|
+
address: String6
|
|
19714
|
+
})),
|
|
19593
19715
|
error: Union2([InvalidCaller, Forbidden2, NotInRepository, RuntimeUnreachable, RuntimeIncompatible])
|
|
19594
19716
|
})), scoped4(admitted(make29("Project.StopCoordinator", {
|
|
19595
19717
|
payload: { runtime: String6, address: String6 },
|
|
19596
|
-
success: Struct({
|
|
19718
|
+
success: Struct({
|
|
19719
|
+
result: Literals(["stopped", "running", "moved", "unsupported"]),
|
|
19720
|
+
reason: optional2(String6)
|
|
19721
|
+
}),
|
|
19597
19722
|
error: Union2([Forbidden2, NotInRepository, RuntimeUnreachable, NoRuntime, InvalidCaller])
|
|
19598
19723
|
}))), protocol(admitted(make29("CoordinatorSessionReady", {
|
|
19599
19724
|
payload: { sessionId: String6, harness: Literals(HARNESS_IDS), harnessSessionId: String6 }
|
|
@@ -19620,9 +19745,46 @@ class VibestRpcs extends make31(make29("Ping", { success: PingResult }), scoped4
|
|
|
19620
19745
|
payload: { instance: String6 },
|
|
19621
19746
|
success: Struct({ instance: String6 }),
|
|
19622
19747
|
error: Union2([Forbidden2, WrongInstance, DaemonBusy, DaemonStopping])
|
|
19748
|
+
})), scoped4(make29("Daemon.Handoff", {
|
|
19749
|
+
payload: { instance: String6, command: ArraySchema(String6) },
|
|
19750
|
+
success: Struct({ instance: String6 }),
|
|
19751
|
+
error: Union2([Forbidden2, WrongInstance, DaemonBusy, DaemonStopping, LaunchFailed])
|
|
19752
|
+
})), scoped4(make29("Session.Start", {
|
|
19753
|
+
payload: { id: String6 },
|
|
19754
|
+
success: Struct({
|
|
19755
|
+
harness: Literals(HARNESS_IDS),
|
|
19756
|
+
harnessSessionId: NullOr(String6),
|
|
19757
|
+
provider: NullOr(String6),
|
|
19758
|
+
model: NullOr(String6),
|
|
19759
|
+
projectId: Number6,
|
|
19760
|
+
runtime: optional2(String6),
|
|
19761
|
+
env: Record(String6, String6)
|
|
19762
|
+
}),
|
|
19763
|
+
error: Union2([Forbidden2, NoSuchSession])
|
|
19764
|
+
})), scoped4(make29("Session.Ready", {
|
|
19765
|
+
payload: { id: String6, pid: optional2(Number6) },
|
|
19766
|
+
error: Union2([Forbidden2, NoSuchSession])
|
|
19767
|
+
})), scoped4(make29("Agents.Outdated", {
|
|
19768
|
+
success: ArraySchema(Struct({
|
|
19769
|
+
id: String6,
|
|
19770
|
+
agent: String6,
|
|
19771
|
+
harness: Literals(HARNESS_IDS),
|
|
19772
|
+
integration: NullOr(String6),
|
|
19773
|
+
working: Boolean3,
|
|
19774
|
+
blocked: NullOr(String6)
|
|
19775
|
+
})),
|
|
19776
|
+
error: Forbidden2
|
|
19777
|
+
})), scoped4(make29("Agents.Restart", {
|
|
19778
|
+
payload: { ids: ArraySchema(String6), after: optional2(Number6) },
|
|
19779
|
+
error: Forbidden2
|
|
19623
19780
|
}))) {
|
|
19624
19781
|
}
|
|
19625
19782
|
|
|
19783
|
+
// ../../client/src/client.ts
|
|
19784
|
+
init_layout();
|
|
19785
|
+
init_dist();
|
|
19786
|
+
init_process();
|
|
19787
|
+
|
|
19626
19788
|
// ../../client/src/socket-connector.ts
|
|
19627
19789
|
init_dist();
|
|
19628
19790
|
|
|
@@ -19632,7 +19794,10 @@ class SocketConnector extends Service()("vibest/SocketConnector") {
|
|
|
19632
19794
|
// ../../client/src/client.ts
|
|
19633
19795
|
var DAEMON_START_TIMEOUT = seconds(10);
|
|
19634
19796
|
|
|
19635
|
-
class DaemonUnavailable extends TaggedError3()("DaemonUnavailable", {
|
|
19797
|
+
class DaemonUnavailable extends TaggedError3()("DaemonUnavailable", {
|
|
19798
|
+
socket: String6,
|
|
19799
|
+
message: String6
|
|
19800
|
+
}) {
|
|
19636
19801
|
}
|
|
19637
19802
|
var stopByHand = (socket, pid) => {
|
|
19638
19803
|
const p = pid === undefined ? "<pid>" : String(pid);
|
|
@@ -19653,7 +19818,8 @@ class IncompatibleDaemon extends TaggedError3()("IncompatibleDaemon", {
|
|
|
19653
19818
|
get message() {
|
|
19654
19819
|
const got = this.daemonProtocol === null ? "no protocol" : `protocol ${this.daemonProtocol}`;
|
|
19655
19820
|
const self = `vibest ${this.client.version} (${this.client.command.map(shellQuote).join(" ")})`;
|
|
19656
|
-
|
|
19821
|
+
const mismatch = protocolMismatch(PROTOCOL, this.daemonProtocol ?? 0, this.daemonVersion || "unknown");
|
|
19822
|
+
return `${mismatch.message}. ${described(this.daemonVersion, this.daemon)} on ${this.socket} speaks ${got}; ${self} speaks protocol ${PROTOCOL}. If \`vibest daemon restart\` cannot replace it: ${stopByHand(this.socket, this.daemon.pid).replace(/^To replace it, /, "")}. A package-version difference alone does not require a restart.`;
|
|
19657
19823
|
}
|
|
19658
19824
|
}
|
|
19659
19825
|
var protocolHeaders = () => ({ [PROTOCOL_HEADER]: String(PROTOCOL) });
|
|
@@ -19662,13 +19828,23 @@ var cliHeaders = (repositoryRoot) => ({
|
|
|
19662
19828
|
[CALLER_HEADER]: "cli",
|
|
19663
19829
|
[REPOSITORY_HEADER]: repositoryRoot
|
|
19664
19830
|
});
|
|
19665
|
-
var
|
|
19666
|
-
|
|
19667
|
-
|
|
19668
|
-
|
|
19669
|
-
|
|
19670
|
-
|
|
19671
|
-
|
|
19831
|
+
var fromEnv2 = gen2(function* () {
|
|
19832
|
+
const read = (name) => option3(String7(name)).pipe(map7((v) => getOrUndefined(v) || undefined));
|
|
19833
|
+
return {
|
|
19834
|
+
projectId: yield* read("VIBEST_PROJECT_ID"),
|
|
19835
|
+
agent: yield* read("VIBEST_AGENT"),
|
|
19836
|
+
harness: yield* read("VIBEST_HARNESS"),
|
|
19837
|
+
runtime: yield* read("VIBEST_RUNTIME"),
|
|
19838
|
+
cwd: (yield* Path).resolve(".")
|
|
19839
|
+
};
|
|
19840
|
+
}).pipe(orElseSucceed2(() => ({})));
|
|
19841
|
+
var claimHeaders = (claim) => claim._tag === "cli" ? succeed7(cliHeaders(claim.repositoryRoot)) : map7(fromEnv2, (more) => sessionHeaders({
|
|
19842
|
+
...more,
|
|
19843
|
+
sessionId: claim.sessionId,
|
|
19844
|
+
repositoryRoot: claim.repositoryRoot,
|
|
19845
|
+
harnessSessionId: claim.harnessSessionId,
|
|
19846
|
+
pluginVersion: claim.pluginVersion
|
|
19847
|
+
}));
|
|
19672
19848
|
var connect2 = (socket) => build(layerProtocolSocket({ pingInterval: "1 minute", pingTimeout: "1 day" }).pipe(provide2(effect(Socket, flatMap4(SocketConnector, (dial) => dial(socket)))), provide2(layerNdJsonRpc()))).pipe(flatMap4((protocol) => make30(VibestRpcs).pipe(provide4(protocol))));
|
|
19673
19849
|
var readPing = (socket) => connect2(socket).pipe(flatMap4((client) => client.Ping(undefined)), timeout2("1 second"), option2, scoped2);
|
|
19674
19850
|
var probe = (socket) => readPing(socket).pipe(map7(isSome2), orElseSucceed2(() => false));
|
|
@@ -19680,16 +19856,22 @@ var incompatibleDaemon = (socket, ping, self) => ping.protocol === PROTOCOL ? un
|
|
|
19680
19856
|
daemon: { pid: ping.pid, instance: ping.instance, command: ping.command, startedAt: ping.startedAt },
|
|
19681
19857
|
client: { version: VERSION, command: self }
|
|
19682
19858
|
});
|
|
19683
|
-
var
|
|
19859
|
+
var spawnDaemon = (command, args = []) => gen2(function* () {
|
|
19684
19860
|
const layout = yield* Layout;
|
|
19685
19861
|
const path = yield* Path;
|
|
19686
19862
|
const spawner = yield* ChildProcessSpawner;
|
|
19687
|
-
const self = yield* VibestCommand;
|
|
19688
|
-
const fs = yield* FileSystem;
|
|
19689
19863
|
const log = path.join(layout.home, "vibestd.log");
|
|
19690
|
-
const logAt = yield* fs.stat(log).pipe(map7((info) => Number(info.size)), orElseSucceed2(() => 0));
|
|
19691
19864
|
yield* gen2(function* () {
|
|
19692
|
-
const handle = yield* spawner.spawn(make17("sh", [
|
|
19865
|
+
const handle = yield* spawner.spawn(make17("sh", [
|
|
19866
|
+
"-c",
|
|
19867
|
+
`mkdir -p "$1" && shift && exec "$@" >>"${log}" 2>&1`,
|
|
19868
|
+
"sh",
|
|
19869
|
+
layout.home,
|
|
19870
|
+
...command,
|
|
19871
|
+
"daemon",
|
|
19872
|
+
"--foreground",
|
|
19873
|
+
...args
|
|
19874
|
+
], {
|
|
19693
19875
|
detached: true,
|
|
19694
19876
|
stdin: "ignore",
|
|
19695
19877
|
stdout: "ignore",
|
|
@@ -19697,6 +19879,14 @@ var startDaemon = gen2(function* () {
|
|
|
19697
19879
|
}));
|
|
19698
19880
|
yield* handle.unref;
|
|
19699
19881
|
}).pipe(scoped2, mapError3((e) => new DaemonUnavailable({ socket: layout.socket, message: e.message })));
|
|
19882
|
+
});
|
|
19883
|
+
var startDaemon = gen2(function* () {
|
|
19884
|
+
const layout = yield* Layout;
|
|
19885
|
+
const path = yield* Path;
|
|
19886
|
+
const fs = yield* FileSystem;
|
|
19887
|
+
const log = path.join(layout.home, "vibestd.log");
|
|
19888
|
+
const logAt = yield* fs.stat(log).pipe(map7((info) => Number(info.size)), orElseSucceed2(() => 0));
|
|
19889
|
+
yield* spawnDaemon(yield* VibestCommand);
|
|
19700
19890
|
if (yield* awaitDaemon(layout.socket))
|
|
19701
19891
|
return;
|
|
19702
19892
|
const bytes = yield* fs.readFile(log).pipe(orElseSucceed2(() => new Uint8Array));
|
|
@@ -19713,16 +19903,22 @@ var withVibest = (claim, f, options) => gen2(function* () {
|
|
|
19713
19903
|
const up = yield* readPing(layout.socket);
|
|
19714
19904
|
if (isNone2(up)) {
|
|
19715
19905
|
if (options?.start === false)
|
|
19716
|
-
return yield* new DaemonUnavailable({
|
|
19906
|
+
return yield* new DaemonUnavailable({
|
|
19907
|
+
socket: layout.socket,
|
|
19908
|
+
message: `vibestd is unreachable on ${layout.socket} (not running, or this process may not connect to its socket); ask the user to check it, or to run: vibest daemon`
|
|
19909
|
+
});
|
|
19717
19910
|
yield* startDaemon;
|
|
19718
19911
|
}
|
|
19719
19912
|
const ping = isSome2(up) ? up.value : getOrUndefined(yield* readPing(layout.socket));
|
|
19720
19913
|
if (ping === undefined)
|
|
19721
|
-
return yield* new DaemonUnavailable({
|
|
19914
|
+
return yield* new DaemonUnavailable({
|
|
19915
|
+
socket: layout.socket,
|
|
19916
|
+
message: `vibestd did not answer Ping on ${layout.socket}`
|
|
19917
|
+
});
|
|
19722
19918
|
const incompatible = incompatibleDaemon(layout.socket, ping, yield* VibestCommand);
|
|
19723
19919
|
if (incompatible)
|
|
19724
19920
|
return yield* incompatible;
|
|
19725
|
-
return yield* withHeaders(connect2(layout.socket).pipe(flatMap4((client) => f(client))), claimHeaders(claim));
|
|
19921
|
+
return yield* withHeaders(connect2(layout.socket).pipe(flatMap4((client) => f(client))), yield* claimHeaders(claim));
|
|
19726
19922
|
}).pipe(scoped2);
|
|
19727
19923
|
|
|
19728
19924
|
// ../../core/src/guard.ts
|
|
@@ -19774,7 +19970,21 @@ var interactive = gen2(function* () {
|
|
|
19774
19970
|
});
|
|
19775
19971
|
|
|
19776
19972
|
// ../../core/src/guard.ts
|
|
19777
|
-
var PATH_TOOLS = new Set([
|
|
19973
|
+
var PATH_TOOLS = new Set([
|
|
19974
|
+
"read",
|
|
19975
|
+
"write",
|
|
19976
|
+
"edit",
|
|
19977
|
+
"multiedit",
|
|
19978
|
+
"notebookedit",
|
|
19979
|
+
"notebookread",
|
|
19980
|
+
"ls",
|
|
19981
|
+
"grep",
|
|
19982
|
+
"glob",
|
|
19983
|
+
"find",
|
|
19984
|
+
"delete",
|
|
19985
|
+
"list",
|
|
19986
|
+
"readlints"
|
|
19987
|
+
]);
|
|
19778
19988
|
var SEARCH_TOOLS = new Set(["grep", "glob", "find"]);
|
|
19779
19989
|
var EDIT_TOOLS = new Set(["write", "edit", "multiedit", "notebookedit"]);
|
|
19780
19990
|
var fileWritingTool = (tool) => {
|
|
@@ -19954,69 +20164,14 @@ var HERDR_CONTROL = new Set(["agent", "pane", "tab", "workspace", "worktree", "s
|
|
|
19954
20164
|
var HARNESS_CLIS = new Set(["pi", "claude", "cursor-agent"]);
|
|
19955
20165
|
var GH_UNSAFE = new Set(["alias", "extension", "ext", "config", "auth"]);
|
|
19956
20166
|
var firstWord = (words) => words.find((w) => !w.startsWith("-")) ?? "";
|
|
19957
|
-
var WRITE_BIN = new Set(["rm", "rmdir", "mv", "cp", "tee", "touch", "mkdir", "truncate", "dd", "ln", "unlink", "install"]);
|
|
19958
|
-
var GIT_WRITE = new Set(["add", "commit", "push", "merge", "rebase", "reset", "checkout", "switch", "restore", "clean", "worktree", "pull", "cherry-pick", "revert", "am", "apply", "stash", "init", "mv", "rm"]);
|
|
19959
|
-
var gitSubcommand = (argv) => {
|
|
19960
|
-
for (let i = 1;i < argv.length; i++) {
|
|
19961
|
-
const word = argv[i];
|
|
19962
|
-
if (word === "-c" || word === "-C") {
|
|
19963
|
-
i++;
|
|
19964
|
-
continue;
|
|
19965
|
-
}
|
|
19966
|
-
if (!word.startsWith("-"))
|
|
19967
|
-
return word;
|
|
19968
|
-
}
|
|
19969
|
-
return "";
|
|
19970
|
-
};
|
|
19971
|
-
var writesByRedirect = (command) => {
|
|
19972
|
-
let quote;
|
|
19973
|
-
for (let i = 0;i < command.length; i++) {
|
|
19974
|
-
const c = command[i];
|
|
19975
|
-
if (quote === "'") {
|
|
19976
|
-
if (c === "'")
|
|
19977
|
-
quote = undefined;
|
|
19978
|
-
continue;
|
|
19979
|
-
}
|
|
19980
|
-
if (quote === '"') {
|
|
19981
|
-
if (c === '"')
|
|
19982
|
-
quote = undefined;
|
|
19983
|
-
else if (c === "\\")
|
|
19984
|
-
i++;
|
|
19985
|
-
continue;
|
|
19986
|
-
}
|
|
19987
|
-
if (c === "'" || c === '"') {
|
|
19988
|
-
quote = c;
|
|
19989
|
-
continue;
|
|
19990
|
-
}
|
|
19991
|
-
if (c === "\\") {
|
|
19992
|
-
i++;
|
|
19993
|
-
continue;
|
|
19994
|
-
}
|
|
19995
|
-
if (c === ">" && command[i + 1] !== "&")
|
|
19996
|
-
return true;
|
|
19997
|
-
}
|
|
19998
|
-
return false;
|
|
19999
|
-
};
|
|
20000
|
-
var writeLike = (command) => {
|
|
20001
|
-
if (writesByRedirect(command))
|
|
20002
|
-
return true;
|
|
20003
|
-
for (const p of programsOf(command)) {
|
|
20004
|
-
const name = base(p.argv[0] ?? "");
|
|
20005
|
-
if (WRITE_BIN.has(name))
|
|
20006
|
-
return true;
|
|
20007
|
-
if (name === "git" && GIT_WRITE.has(gitSubcommand(p.argv)))
|
|
20008
|
-
return true;
|
|
20009
|
-
if ((name === "sed" || name === "perl") && p.argv.slice(1).some((a) => a === "-i" || a.startsWith("-i") || a === "--in-place" || a.startsWith("--in-place=")))
|
|
20010
|
-
return true;
|
|
20011
|
-
}
|
|
20012
|
-
return false;
|
|
20013
|
-
};
|
|
20014
20167
|
var shellBlock = (command, vibest, coordinator) => {
|
|
20015
20168
|
for (const p of programsOf(command)) {
|
|
20016
20169
|
const [program = "", ...rest] = p.argv;
|
|
20017
20170
|
const name = base(program);
|
|
20018
20171
|
if (name === "herdr" && HERDR_CONTROL.has(firstWord(rest)))
|
|
20019
20172
|
return "Agents must not control herdr agents, panes, tabs, workspaces or worktrees; vibest manages them.";
|
|
20173
|
+
if (name === "herdr" && !coordinator)
|
|
20174
|
+
return "Sessions do not run herdr; vibest manages it.";
|
|
20020
20175
|
if (coordinator && HARNESS_CLIS.has(name))
|
|
20021
20176
|
return `The coordinator does not start ${name} itself: it would inherit the coordinator's identity and report its turns as the coordinator's. Start agents with vibest run.`;
|
|
20022
20177
|
if (coordinator && name === "gh" && GH_UNSAFE.has(firstWord(rest)))
|
|
@@ -20074,8 +20229,7 @@ var coordinator = (call) => gen2(function* () {
|
|
|
20074
20229
|
return "The coordinator does not edit files; hand the change to a session.";
|
|
20075
20230
|
return;
|
|
20076
20231
|
});
|
|
20077
|
-
var OFF_LIMITS = "The
|
|
20078
|
-
var READ_ONLY = "This session is read-only; it does not edit files or run commands that write.";
|
|
20232
|
+
var OFF_LIMITS = "The project directory is off limits to sessions, except your scratchpad.";
|
|
20079
20233
|
var SHELL_WORDS = /[^\s'"`;|&()<>=,]+/g;
|
|
20080
20234
|
var SHELL_SEARCH = /(?:^|[\s;&|(])(?:rg|ag|ack|grep|egrep|find|fd|tree|du)\s/;
|
|
20081
20235
|
var session = fn2("Guard.session")(function* (call) {
|
|
@@ -20084,18 +20238,16 @@ var session = fn2("Guard.session")(function* (call) {
|
|
|
20084
20238
|
const layout = yield* Layout;
|
|
20085
20239
|
const projects = yield* physical(layout.projects);
|
|
20086
20240
|
const vibestHome = yield* physical(layout.home);
|
|
20087
|
-
const
|
|
20088
|
-
const
|
|
20089
|
-
const rel = path.relative(projectsRoot, target);
|
|
20090
|
-
return rel !== "" && !rel.startsWith("..") && !path.isAbsolute(rel) && rel.split(path.sep).includes("scratch");
|
|
20091
|
-
};
|
|
20241
|
+
const own = getOrUndefined(yield* option3(String7("VIBEST_SCRATCH")));
|
|
20242
|
+
const scratch = own ? yield* physical(own) : undefined;
|
|
20092
20243
|
const inside = (p, dir) => p === dir || p.startsWith(dir + path.sep);
|
|
20244
|
+
const inScratch = (target) => scratch !== undefined && inside(target, scratch);
|
|
20093
20245
|
const resolve = (raw) => gen2(function* () {
|
|
20094
20246
|
const p = yield* toolPath(raw, call.cwd, home);
|
|
20095
20247
|
return p === undefined ? undefined : [yield* physical(p), yield* physical(path.normalize(p))];
|
|
20096
20248
|
});
|
|
20097
20249
|
const BAD_URL = "The call names a file URL vibest cannot read; refused.";
|
|
20098
|
-
const blocked = (target, search) => (
|
|
20250
|
+
const blocked = (target, search) => search && inside(projects, target) || inside(target, projects) && !inScratch(target);
|
|
20099
20251
|
const tool = call.tool.toLowerCase();
|
|
20100
20252
|
if (SHELL_TOOLS.has(tool)) {
|
|
20101
20253
|
const command = shellCommand(call.input);
|
|
@@ -20144,18 +20296,7 @@ var decodePreToolUse = decodeUnknownEffect2(fromJsonString2(Struct({
|
|
|
20144
20296
|
workspace_roots: optional2(ArraySchema(String6))
|
|
20145
20297
|
})));
|
|
20146
20298
|
var COORDINATOR = "coordinator";
|
|
20147
|
-
var
|
|
20148
|
-
const denied = yield* session(call);
|
|
20149
|
-
if (denied)
|
|
20150
|
-
return denied;
|
|
20151
|
-
if (fileWritingTool(call.tool))
|
|
20152
|
-
return READ_ONLY;
|
|
20153
|
-
const command = SHELL_TOOLS.has(call.tool.toLowerCase()) ? shellCommand(call.input) : undefined;
|
|
20154
|
-
if (command !== undefined && writeLike(command))
|
|
20155
|
-
return READ_ONLY;
|
|
20156
|
-
return;
|
|
20157
|
-
});
|
|
20158
|
-
var rulesOf = (agent, access = "write") => agent === COORDINATOR ? coordinator : access === "read" ? readSession : session;
|
|
20299
|
+
var rulesOf = (agent) => agent === COORDINATOR ? coordinator : session;
|
|
20159
20300
|
|
|
20160
20301
|
// ../../core/src/results.ts
|
|
20161
20302
|
init_dist();
|
|
@@ -20170,7 +20311,12 @@ var encodeReportLine = (line) => `${JSON.stringify(line)}
|
|
|
20170
20311
|
`;
|
|
20171
20312
|
var ReportLineJson = fromJsonString2(Union2([
|
|
20172
20313
|
Struct({ turn: Literals(["start"]), ts: Number6, prompt: String6 }),
|
|
20173
|
-
Struct({
|
|
20314
|
+
Struct({
|
|
20315
|
+
turn: Literals(["end"]),
|
|
20316
|
+
ts: Number6,
|
|
20317
|
+
harness: Literals(HARNESS_IDS),
|
|
20318
|
+
payload: Record(String6, Unknown2)
|
|
20319
|
+
})
|
|
20174
20320
|
]));
|
|
20175
20321
|
var appendReportLine = (file, line) => gen2(function* () {
|
|
20176
20322
|
const fs = yield* FileSystem;
|
|
@@ -20199,15 +20345,14 @@ var readResult = fn2("readResult")(function* (file) {
|
|
|
20199
20345
|
mtimeMs: match(info.mtime, { onNone: () => 0, onSome: (d) => d.getTime() }),
|
|
20200
20346
|
text: typeof text === "string" ? text : "",
|
|
20201
20347
|
error: typeof error === "string" && error ? typeof details === "string" && details ? `${error}: ${details}` : error : undefined,
|
|
20202
|
-
conversationId: typeof conversation === "string" && /^\w[\w.:-]{0,127}$/.test(conversation) ? conversation : undefined
|
|
20348
|
+
conversationId: typeof conversation === "string" && /^\w[\w.:-]{0,127}$/.test(conversation) ? conversation : undefined,
|
|
20349
|
+
interrupted: envelope.payload.aborted === true
|
|
20203
20350
|
};
|
|
20204
20351
|
}).pipe(option2);
|
|
20205
20352
|
});
|
|
20206
20353
|
|
|
20207
20354
|
// src/extension.ts
|
|
20208
20355
|
init_dist();
|
|
20209
|
-
import path from "node:path";
|
|
20210
|
-
import url from "node:url";
|
|
20211
20356
|
|
|
20212
20357
|
// src/pi.ts
|
|
20213
20358
|
init_dist();
|
|
@@ -20447,7 +20592,13 @@ function tool_groups_default(pi) {
|
|
|
20447
20592
|
for (const call of nested) {
|
|
20448
20593
|
if (!call?.id || calls.has(call.id))
|
|
20449
20594
|
continue;
|
|
20450
|
-
remember(call.id, {
|
|
20595
|
+
remember(call.id, {
|
|
20596
|
+
name: call.name,
|
|
20597
|
+
args: call.arguments,
|
|
20598
|
+
parentId: message.toolCallId,
|
|
20599
|
+
isError: call.status === "error",
|
|
20600
|
+
isPartial: call.status === "unfinished"
|
|
20601
|
+
});
|
|
20451
20602
|
}
|
|
20452
20603
|
return;
|
|
20453
20604
|
}
|
|
@@ -20555,7 +20706,18 @@ function tool_groups_default(pi) {
|
|
|
20555
20706
|
const search = named("tool_search").length;
|
|
20556
20707
|
if (search)
|
|
20557
20708
|
parts.push(times(search, "tool search", "tool searches"));
|
|
20558
|
-
const known = new Set([
|
|
20709
|
+
const known = new Set([
|
|
20710
|
+
"codemode",
|
|
20711
|
+
"read",
|
|
20712
|
+
"write",
|
|
20713
|
+
"edit",
|
|
20714
|
+
"bash",
|
|
20715
|
+
"powershell",
|
|
20716
|
+
"grep",
|
|
20717
|
+
"find",
|
|
20718
|
+
"ls",
|
|
20719
|
+
"tool_search"
|
|
20720
|
+
]);
|
|
20559
20721
|
const other = all.filter((item) => item.name && !known.has(item.name)).length;
|
|
20560
20722
|
if (other)
|
|
20561
20723
|
parts.push(times(other, "other tool call", "other tool calls"));
|
|
@@ -20729,12 +20891,24 @@ function tool_groups_default(pi) {
|
|
|
20729
20891
|
if (!event?.toolCallId)
|
|
20730
20892
|
return;
|
|
20731
20893
|
runActive = true;
|
|
20732
|
-
remember(event.toolCallId, {
|
|
20894
|
+
remember(event.toolCallId, {
|
|
20895
|
+
name: event.toolName,
|
|
20896
|
+
args: event.args,
|
|
20897
|
+
parentId: event.parentToolCallId,
|
|
20898
|
+
isPartial: true
|
|
20899
|
+
});
|
|
20733
20900
|
});
|
|
20734
20901
|
pi.on("tool_execution_end", (event) => {
|
|
20735
20902
|
if (!event?.toolCallId)
|
|
20736
20903
|
return;
|
|
20737
|
-
remember(event.toolCallId, {
|
|
20904
|
+
remember(event.toolCallId, {
|
|
20905
|
+
name: event.toolName,
|
|
20906
|
+
args: event.args,
|
|
20907
|
+
parentId: event.parentToolCallId,
|
|
20908
|
+
isError: event.isError === true,
|
|
20909
|
+
isPartial: false,
|
|
20910
|
+
result: event.result
|
|
20911
|
+
});
|
|
20738
20912
|
});
|
|
20739
20913
|
pi.registerToolRenderer((toolName, next) => {
|
|
20740
20914
|
const later = next();
|
|
@@ -20767,15 +20941,21 @@ function tool_groups_default(pi) {
|
|
|
20767
20941
|
let native;
|
|
20768
20942
|
if (renderers?.renderCall) {
|
|
20769
20943
|
try {
|
|
20770
|
-
native = renderers.renderCall(args, theme, {
|
|
20944
|
+
native = renderers.renderCall(args, theme, {
|
|
20945
|
+
...ctx,
|
|
20946
|
+
expanded: true,
|
|
20947
|
+
lastComponent: ctx.lastComponent?.native
|
|
20948
|
+
});
|
|
20771
20949
|
} catch {
|
|
20772
20950
|
native = undefined;
|
|
20773
20951
|
}
|
|
20774
20952
|
}
|
|
20775
|
-
const body = native ? frameComponent(renderers, native, ctx.outputPad) : {
|
|
20776
|
-
|
|
20777
|
-
|
|
20778
|
-
|
|
20953
|
+
const body = native ? frameComponent(renderers, native, ctx.outputPad) : {
|
|
20954
|
+
render(innerWidth) {
|
|
20955
|
+
const { pad, limit } = gutter(innerWidth, ctx.outputPad);
|
|
20956
|
+
return indent(plainCall(toolName, args, limit), pad);
|
|
20957
|
+
}
|
|
20958
|
+
};
|
|
20779
20959
|
return {
|
|
20780
20960
|
native,
|
|
20781
20961
|
invalidate() {
|
|
@@ -20832,15 +21012,20 @@ function tool_groups_default(pi) {
|
|
|
20832
21012
|
let native;
|
|
20833
21013
|
if (renderers?.renderResult) {
|
|
20834
21014
|
try {
|
|
20835
|
-
native = renderers.renderResult(result, { ...options, expanded: true }, theme, {
|
|
21015
|
+
native = renderers.renderResult(result, { ...options, expanded: true }, theme, {
|
|
21016
|
+
...ctx,
|
|
21017
|
+
lastComponent: ctx.lastComponent?.native
|
|
21018
|
+
});
|
|
20836
21019
|
} catch {
|
|
20837
21020
|
native = undefined;
|
|
20838
21021
|
}
|
|
20839
21022
|
}
|
|
20840
|
-
const body = native ? frameComponent(renderers, native, ctx.outputPad) : {
|
|
20841
|
-
|
|
20842
|
-
|
|
20843
|
-
|
|
21023
|
+
const body = native ? frameComponent(renderers, native, ctx.outputPad) : {
|
|
21024
|
+
render(innerWidth) {
|
|
21025
|
+
const { pad, limit } = gutter(innerWidth, ctx.outputPad);
|
|
21026
|
+
return indent(plainResult(result, ctx.isError, limit), pad);
|
|
21027
|
+
}
|
|
21028
|
+
};
|
|
20844
21029
|
return {
|
|
20845
21030
|
native,
|
|
20846
21031
|
invalidate() {
|
|
@@ -20867,7 +21052,12 @@ function readLease(proto) {
|
|
|
20867
21052
|
}
|
|
20868
21053
|
function writeLease(proto, lease) {
|
|
20869
21054
|
if (lease)
|
|
20870
|
-
Object.defineProperty(proto, "vibestCompactUserMessagesLease", {
|
|
21055
|
+
Object.defineProperty(proto, "vibestCompactUserMessagesLease", {
|
|
21056
|
+
value: lease,
|
|
21057
|
+
configurable: true,
|
|
21058
|
+
enumerable: false,
|
|
21059
|
+
writable: false
|
|
21060
|
+
});
|
|
20871
21061
|
else
|
|
20872
21062
|
delete proto.vibestCompactUserMessagesLease;
|
|
20873
21063
|
}
|
|
@@ -21028,6 +21218,12 @@ var lastReply = (messages) => {
|
|
|
21028
21218
|
const text = (message?.content ?? []).flatMap((c) => c.type === "text" ? [c.text] : []).join("");
|
|
21029
21219
|
return { text, error: message?.stopReason === "error" ? message.errorMessage || "error" : "" };
|
|
21030
21220
|
};
|
|
21221
|
+
var piHeaders = (sessionId, ctx) => claimHeaders({
|
|
21222
|
+
_tag: "session",
|
|
21223
|
+
sessionId,
|
|
21224
|
+
harnessSessionId: ctx.sessionManager.getSessionId(),
|
|
21225
|
+
pluginVersion: VERSION
|
|
21226
|
+
});
|
|
21031
21227
|
var session2 = (sessionId) => effectDiscard(gen2(function* () {
|
|
21032
21228
|
const pi = yield* Pi;
|
|
21033
21229
|
const layout = yield* Layout;
|
|
@@ -21035,11 +21231,16 @@ var session2 = (sessionId) => effectDiscard(gen2(function* () {
|
|
|
21035
21231
|
const reply = yield* make28({ text: "", error: "" });
|
|
21036
21232
|
yield* pi.handle("session_start", (_e, ctx) => set2(root, ctx.mode === "tui"));
|
|
21037
21233
|
yield* pi.handle("agent_end", (e) => set2(reply, lastReply(e.messages)));
|
|
21038
|
-
yield* pi.handle("input", (e) => gen2(function* () {
|
|
21234
|
+
yield* pi.handle("input", (e, ctx) => gen2(function* () {
|
|
21039
21235
|
if (e.source === "extension" || e.text.trim() === "")
|
|
21040
21236
|
return;
|
|
21041
|
-
|
|
21042
|
-
yield*
|
|
21237
|
+
const headers = yield* piHeaders(sessionId, ctx);
|
|
21238
|
+
yield* connect2(layout.socket).pipe(flatMap4((client) => client.Prompt({ sessionId, text: e.text }, { headers })), scoped2, timeout2("500 millis"), ignore2);
|
|
21239
|
+
yield* appendReportLine(layout.reportFile(sessionId), {
|
|
21240
|
+
turn: "start",
|
|
21241
|
+
ts: yield* currentTimeMillis2,
|
|
21242
|
+
prompt: e.text
|
|
21243
|
+
});
|
|
21043
21244
|
yield* writeTerminalStatus("working");
|
|
21044
21245
|
}));
|
|
21045
21246
|
yield* pi.handle("agent_settled", (e, ctx) => gen2(function* () {
|
|
@@ -21049,9 +21250,15 @@ var session2 = (sessionId) => effectDiscard(gen2(function* () {
|
|
|
21049
21250
|
const ts = Math.floor((yield* currentTimeMillis2) / 1000);
|
|
21050
21251
|
const payload = { text, error: error || (e.aborted ? "aborted" : ""), aborted: e.aborted };
|
|
21051
21252
|
yield* writeAtomic(layout.resultFile(sessionId), encodeJson({ harness: "pi", ts, payload }));
|
|
21052
|
-
yield* appendReportLine(layout.reportFile(sessionId), {
|
|
21253
|
+
yield* appendReportLine(layout.reportFile(sessionId), {
|
|
21254
|
+
turn: "end",
|
|
21255
|
+
ts: yield* currentTimeMillis2,
|
|
21256
|
+
harness: "pi",
|
|
21257
|
+
payload
|
|
21258
|
+
});
|
|
21053
21259
|
yield* writeTerminalStatus("idle");
|
|
21054
|
-
|
|
21260
|
+
const headers = yield* piHeaders(sessionId, ctx);
|
|
21261
|
+
yield* connect2(layout.socket).pipe(flatMap4((client) => client.ResultReady({ sessionId }, { headers })), scoped2, timeout2("500 millis"), ignore2);
|
|
21055
21262
|
}));
|
|
21056
21263
|
}));
|
|
21057
21264
|
var reportSession = fn2("reportSession")(function* (sessionId) {
|
|
@@ -21063,7 +21270,8 @@ var reportSession = fn2("reportSession")(function* (sessionId) {
|
|
|
21063
21270
|
const harnessSessionId = ctx.sessionManager.getSessionId();
|
|
21064
21271
|
if (ctx.mode !== "tui" || (yield* get2(reported)) === harnessSessionId)
|
|
21065
21272
|
return;
|
|
21066
|
-
|
|
21273
|
+
const headers = yield* piHeaders(sessionId, ctx);
|
|
21274
|
+
yield* connect2(layout.socket).pipe(flatMap4((client) => client.CoordinatorSessionReady({ sessionId, harness: "pi", harnessSessionId }, { headers })), scoped2, timeout2("1 second"), andThen2(set2(reported, harnessSessionId)), catchCause2((cause) => hasInterruptsOnly2(cause) ? void_3 : sync2(() => ctx.ui.notify(`vibest: the coordinator's conversation may not have been saved: ${pretty(cause)}`, "warning"))), forkIn2(scope));
|
|
21067
21275
|
});
|
|
21068
21276
|
yield* pi.handle("session_start", (event, ctx) => event.reason === "new" || event.reason === "resume" || event.reason === "fork" ? send(ctx) : void_3);
|
|
21069
21277
|
yield* pi.handle("agent_end", (_event, ctx) => send(ctx));
|
|
@@ -21082,18 +21290,30 @@ var coordinator2 = effectDiscard(gen2(function* () {
|
|
|
21082
21290
|
yield* reportSession(sessionId.value);
|
|
21083
21291
|
const started = yield* make6();
|
|
21084
21292
|
yield* pi.handle("session_start", (_e, ctx) => ctx.mode === "tui" ? succeed4(started, ctx).pipe(asVoid2) : void_3);
|
|
21085
|
-
const subscribe =
|
|
21086
|
-
|
|
21293
|
+
const subscribe = (ctx) => withVibest({
|
|
21294
|
+
_tag: "session",
|
|
21295
|
+
sessionId: sessionId.value,
|
|
21296
|
+
harnessSessionId: ctx.sessionManager.getSessionId(),
|
|
21297
|
+
pluginVersion: VERSION
|
|
21298
|
+
}, (client) => client["Inbox.Subscribe"](undefined).pipe(runForEach2((content) => pi.sendMessage({ customType: "vibest", content, display: false }, { triggerTurn: true, deliverAs: "followUp" })), catchCause2((cause) => hasInterruptsOnly2(cause) ? void_3 : failCause3(cause))), { start: false }).pipe(retry2({
|
|
21299
|
+
while: (e) => e._tag === "RpcClientError" || e._tag === "DaemonUnavailable",
|
|
21300
|
+
schedule: spaced("2 seconds")
|
|
21301
|
+
}), repeat2(spaced("2 seconds")));
|
|
21302
|
+
yield* _await(started).pipe(flatMap4((ctx) => subscribe(ctx).pipe(catchCause2((cause) => hasInterruptsOnly2(cause) ? void_3 : sync2(() => ctx.ui.notify(`vibest: inbox subscription ended: ${pretty(cause)}`, "error"))))), forkScoped2);
|
|
21303
|
+
}));
|
|
21304
|
+
var ready = (sessionId) => effectDiscard(gen2(function* () {
|
|
21305
|
+
const pi = yield* Pi;
|
|
21306
|
+
yield* pi.handle("session_start", (_e, ctx) => ctx.mode !== "tui" ? void_3 : withVibest({ _tag: "session", sessionId, pluginVersion: VERSION }, (client) => client["Session.Ready"]({ id: sessionId, pid: process.pid }), { start: false }).pipe(timeout2("2 seconds"), ignore2));
|
|
21087
21307
|
}));
|
|
21088
21308
|
var extension2 = unwrap(gen2(function* () {
|
|
21089
21309
|
const agent = getOrUndefined(yield* option3(String7("VIBEST_AGENT")));
|
|
21090
21310
|
if (!agent)
|
|
21091
21311
|
return empty4;
|
|
21092
|
-
const
|
|
21093
|
-
const
|
|
21312
|
+
const guarding = effectDiscard(guarded(rulesOf(agent)));
|
|
21313
|
+
const sessionId = getOrUndefined(yield* option3(String7("VIBEST_SESSION_ID")));
|
|
21314
|
+
const guard = sessionId ? merge2(guarding, ready(sessionId)) : guarding;
|
|
21094
21315
|
if (agent === COORDINATOR)
|
|
21095
21316
|
return coordinator2.pipe(provideMerge(guard));
|
|
21096
|
-
const sessionId = getOrUndefined(yield* option3(String7("VIBEST_SESSION_ID")));
|
|
21097
21317
|
return sessionId ? session2(sessionId).pipe(provideMerge(guard)) : guard;
|
|
21098
21318
|
}));
|
|
21099
21319
|
var vibestCommand = effect(VibestCommand, schema(fromJsonString2(ArraySchema(String6)), "VIBEST_COMMAND").pipe(withDefault3(["vibest"])));
|