@standardagents/builder 0.40.5 → 0.40.7
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/built-in-routes.js +46 -76
- package/dist/built-in-routes.js.map +1 -1
- package/dist/client/{ApiKeysView-DoYvZZ7e.js → ApiKeysView-BxzKL9jO.js} +1 -1
- package/dist/client/{CenteredContentView-53PY0cqY.js → CenteredContentView-CV4-cE9D.js} +1 -1
- package/dist/client/{CompositionView-fp-0YnPt.js → CompositionView-DUqt-Wt6.js} +1 -1
- package/dist/client/{ConfirmDialog.vue_vue_type_script_setup_true_lang-Cvcagja2.js → ConfirmDialog.vue_vue_type_script_setup_true_lang-Byhp8Dqp.js} +1 -1
- package/dist/client/{CopyButton.vue_vue_type_script_setup_true_lang-jYvO2v1K.js → CopyButton.vue_vue_type_script_setup_true_lang-CRIQcs5M.js} +1 -1
- package/dist/client/{DataTable.vue_vue_type_script_setup_true_lang-DQ3Ufa7y.js → DataTable.vue_vue_type_script_setup_true_lang-CF8Rkus3.js} +1 -1
- package/dist/client/{JsonViewer-6aaGzutE.js → JsonViewer-DTVICtSp.js} +1 -1
- package/dist/client/{LoginView-DwpCmNw9.js → LoginView-ZH47dgDr.js} +1 -1
- package/dist/client/{MarketplaceView-Da02L0J5.js → MarketplaceView-BZjX33dc.js} +1 -1
- package/dist/client/{Modal.vue_vue_type_script_setup_true_lang-Bi8OjiBf.js → Modal.vue_vue_type_script_setup_true_lang-BWSRc4ps.js} +1 -1
- package/dist/client/{ModelModal.vue_vue_type_script_setup_true_lang-cYZLOYY7.js → ModelModal.vue_vue_type_script_setup_true_lang-BHxhT6vM.js} +1 -1
- package/dist/client/{ModelsView-BLlHO9Ud.js → ModelsView-2apBcrqz.js} +1 -1
- package/dist/client/{PromptEditView-EeNwTDtT.js → PromptEditView-Cx086YBJ.js} +1 -1
- package/dist/client/{PromptModal-BkwrKJ2d.js → PromptModal-BMsTD8dU.js} +1 -1
- package/dist/client/{PromptsView-D1r7tsLu.js → PromptsView-l_FfpOuf.js} +1 -1
- package/dist/client/{ProvidersView-CmUDl5nM.js → ProvidersView-PEV9VV4X.js} +1 -1
- package/dist/client/{ThreadInspectorPane.vue_vue_type_script_setup_true_lang-cRs3tApQ.js → ThreadInspectorPane.vue_vue_type_script_setup_true_lang-Cu2SwqZ1.js} +1 -1
- package/dist/client/{ThreadsView-Bl5fSIO1.js → ThreadsView-CPStu4IQ.js} +1 -1
- package/dist/client/{ToolsView-DlVEF8-7.js → ToolsView-spgLDP4C.js} +1 -1
- package/dist/client/{UsersView-CGlA7a7R.js → UsersView-BznU6bH2.js} +1 -1
- package/dist/client/{VariablesView-BpYmJL4V.js → VariablesView-No5zHXK8.js} +1 -1
- package/dist/client/{index-CKtIkI0N.js → index-9HZDcx7i.js} +6 -6
- package/dist/client/index.html +1 -1
- package/dist/{index-0NI3m5DR.d.ts → index-DYhbT5Eq.d.ts} +44 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +256 -154
- package/dist/index.js.map +1 -1
- package/dist/runtime.d.ts +17 -17
- package/dist/runtime.js +256 -154
- package/dist/runtime.js.map +1 -1
- package/dist/test.d.ts +1 -1
- package/package.json +5 -5
package/dist/built-in-routes.js
CHANGED
|
@@ -99,12 +99,6 @@ function encodeStreamChunk(bytes) {
|
|
|
99
99
|
}
|
|
100
100
|
return btoa(binary);
|
|
101
101
|
}
|
|
102
|
-
function decodeStreamChunk(data) {
|
|
103
|
-
const binary = atob(data);
|
|
104
|
-
const bytes = new Uint8Array(binary.length);
|
|
105
|
-
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
|
|
106
|
-
return bytes;
|
|
107
|
-
}
|
|
108
102
|
var init_client_forwarding = __esm({
|
|
109
103
|
"src/agents/client-forwarding.ts"() {
|
|
110
104
|
}
|
|
@@ -13978,27 +13972,51 @@ var init_ThreadStateImpl = __esm({
|
|
|
13978
13972
|
const withWake = (threadId) => wakeUserId ? { ...request, wake: { threadId, userId: wakeUserId } } : request;
|
|
13979
13973
|
const local = await instance.openClientStream(withWake(this._metadata.id));
|
|
13980
13974
|
if (local.ok || !this.isNoClient(local)) return local;
|
|
13981
|
-
|
|
13982
|
-
|
|
13975
|
+
if (typeof instance.createProxyStreamReceiver !== "function" || typeof instance.proxyStreamReceive !== "function") {
|
|
13976
|
+
return local;
|
|
13977
|
+
}
|
|
13978
|
+
let abortRemote = null;
|
|
13979
|
+
const receiver = instance.createProxyStreamReceiver((error) => abortRemote?.(error));
|
|
13980
|
+
const discardReceiver = async (error) => {
|
|
13981
|
+
await instance.proxyStreamReceive(receiver.id, { type: "abort", error });
|
|
13982
|
+
};
|
|
13983
|
+
const namespace = instance.env.AGENT_BUILDER_THREAD;
|
|
13983
13984
|
const seen = /* @__PURE__ */ new Set([this._metadata.id]);
|
|
13984
13985
|
let parentId = await this.resolveParentThreadId(this._metadata.id);
|
|
13985
13986
|
while (parentId && !seen.has(parentId)) {
|
|
13986
13987
|
seen.add(parentId);
|
|
13987
13988
|
try {
|
|
13988
|
-
const stub =
|
|
13989
|
+
const stub = namespace.get(namespace.idFromName(parentId));
|
|
13989
13990
|
if (typeof stub.proxyStreamOpen === "function") {
|
|
13990
|
-
const opened = await stub.proxyStreamOpen(withWake(parentId)
|
|
13991
|
+
const opened = await stub.proxyStreamOpen(withWake(parentId), {
|
|
13992
|
+
threadId: this._metadata.id,
|
|
13993
|
+
receiverId: receiver.id
|
|
13994
|
+
});
|
|
13991
13995
|
if (opened.ok && opened.id) {
|
|
13996
|
+
if (opened.eventDriven !== true) {
|
|
13997
|
+
await stub.proxyStreamAbort(opened.id).catch(() => {
|
|
13998
|
+
});
|
|
13999
|
+
await discardReceiver("The ancestor runtime does not support event-driven streams.");
|
|
14000
|
+
return {
|
|
14001
|
+
ok: false,
|
|
14002
|
+
error: "The ancestor runtime does not support event-driven streams.",
|
|
14003
|
+
data: { code: "unsupported" }
|
|
14004
|
+
};
|
|
14005
|
+
}
|
|
14006
|
+
abortRemote = (error) => {
|
|
14007
|
+
void stub.proxyStreamAbort(opened.id).catch(() => {
|
|
14008
|
+
});
|
|
14009
|
+
if (error) {
|
|
14010
|
+
void instance.proxyStreamReceive(receiver.id, { type: "abort", error });
|
|
14011
|
+
}
|
|
14012
|
+
};
|
|
13992
14013
|
return {
|
|
13993
14014
|
ok: true,
|
|
13994
|
-
duplex: this.
|
|
13995
|
-
stub,
|
|
13996
|
-
opened.id,
|
|
13997
|
-
opened.parkedPull === true
|
|
13998
|
-
)
|
|
14015
|
+
duplex: this.buildEventProxyDuplex(stub, opened.id, receiver, instance)
|
|
13999
14016
|
};
|
|
14000
14017
|
}
|
|
14001
14018
|
if (opened.error && !opened.noClient) {
|
|
14019
|
+
await discardReceiver(opened.error);
|
|
14002
14020
|
return {
|
|
14003
14021
|
ok: false,
|
|
14004
14022
|
error: opened.error,
|
|
@@ -14010,69 +14028,21 @@ var init_ThreadStateImpl = __esm({
|
|
|
14010
14028
|
}
|
|
14011
14029
|
parentId = await this.resolveParentThreadId(parentId);
|
|
14012
14030
|
}
|
|
14031
|
+
await discardReceiver(local.error ?? "No execution-owner bridge is available.");
|
|
14013
14032
|
return local;
|
|
14014
14033
|
}
|
|
14015
14034
|
/**
|
|
14016
14035
|
* Build a client duplex that bridges to a stream opened on an ancestor DO
|
|
14017
|
-
* (the bridge holder)
|
|
14018
|
-
*
|
|
14019
|
-
* error, or abort, so an idle open stream performs zero repeated pulls.
|
|
14020
|
-
* Older ancestors use the bounded long-pull compatibility path. `writable`
|
|
14021
|
-
* forwards each chunk with `proxyStreamWrite`; teardown calls
|
|
14022
|
-
* `proxyStreamAbort`.
|
|
14036
|
+
* (the bridge holder). The readable is the receiver registered on this DO;
|
|
14037
|
+
* writes and terminal actions are the only child-to-ancestor RPCs.
|
|
14023
14038
|
*/
|
|
14024
|
-
|
|
14025
|
-
buildProxyDuplex(stub, id, supportsParkedPull = false) {
|
|
14026
|
-
let settleDone;
|
|
14027
|
-
const done = new Promise((r) => settleDone = r);
|
|
14039
|
+
buildEventProxyDuplex(stub, id, receiver, instance) {
|
|
14028
14040
|
let closed = false;
|
|
14029
|
-
|
|
14030
|
-
|
|
14031
|
-
|
|
14032
|
-
|
|
14033
|
-
settleDone(result);
|
|
14041
|
+
const settleLocal = (error) => {
|
|
14042
|
+
if (typeof instance.proxyStreamReceive !== "function") return;
|
|
14043
|
+
const frame = error ? { type: "abort", error } : { type: "end" };
|
|
14044
|
+
void instance.proxyStreamReceive(receiver.id, frame);
|
|
14034
14045
|
};
|
|
14035
|
-
const readable = new ReadableStream({
|
|
14036
|
-
async pull(controller) {
|
|
14037
|
-
while (!closed) {
|
|
14038
|
-
const pullStartedAt = Date.now();
|
|
14039
|
-
let res;
|
|
14040
|
-
try {
|
|
14041
|
-
res = await stub.proxyStreamPull(
|
|
14042
|
-
id,
|
|
14043
|
-
supportsParkedPull ? void 0 : _ThreadStateImpl.PROXY_PULL_MAX_WAIT_MS
|
|
14044
|
-
);
|
|
14045
|
-
} catch (error) {
|
|
14046
|
-
controller.error(error instanceof Error ? error : new Error(String(error)));
|
|
14047
|
-
settle({ ok: false, error: "proxy stream pull failed" });
|
|
14048
|
-
return;
|
|
14049
|
-
}
|
|
14050
|
-
for (const chunk of res.chunks) {
|
|
14051
|
-
controller.enqueue(decodeStreamChunk(chunk));
|
|
14052
|
-
}
|
|
14053
|
-
if (res.done) {
|
|
14054
|
-
controller.close();
|
|
14055
|
-
settle(res.error ? { ok: false, error: res.error } : { ok: true });
|
|
14056
|
-
return;
|
|
14057
|
-
}
|
|
14058
|
-
if (res.chunks.length > 0) return;
|
|
14059
|
-
if (supportsParkedPull) {
|
|
14060
|
-
controller.error(new Error("parked proxy pull returned without data"));
|
|
14061
|
-
settle({ ok: false, error: "parked proxy pull returned without data" });
|
|
14062
|
-
return;
|
|
14063
|
-
}
|
|
14064
|
-
if (Date.now() - pullStartedAt < 250) {
|
|
14065
|
-
await new Promise((r) => setTimeout(r, 250));
|
|
14066
|
-
}
|
|
14067
|
-
}
|
|
14068
|
-
},
|
|
14069
|
-
cancel() {
|
|
14070
|
-
closed = true;
|
|
14071
|
-
void stub.proxyStreamAbort(id).catch(() => {
|
|
14072
|
-
});
|
|
14073
|
-
settle({ ok: false, error: "proxy stream reader canceled" });
|
|
14074
|
-
}
|
|
14075
|
-
});
|
|
14076
14046
|
const writable = new WritableStream({
|
|
14077
14047
|
async write(chunk) {
|
|
14078
14048
|
await stub.proxyStreamWrite(id, encodeStreamChunk(chunk));
|
|
@@ -14085,20 +14055,20 @@ var init_ThreadStateImpl = __esm({
|
|
|
14085
14055
|
closed = true;
|
|
14086
14056
|
void stub.proxyStreamAbort(id).catch(() => {
|
|
14087
14057
|
});
|
|
14088
|
-
|
|
14058
|
+
settleLocal("The proxy stream writer was aborted.");
|
|
14089
14059
|
}
|
|
14090
14060
|
});
|
|
14091
14061
|
return {
|
|
14092
|
-
readable,
|
|
14062
|
+
readable: receiver.readable,
|
|
14093
14063
|
writable,
|
|
14094
14064
|
close: (error) => {
|
|
14095
14065
|
if (closed) return;
|
|
14096
14066
|
closed = true;
|
|
14097
14067
|
void stub.proxyStreamAbort(id).catch(() => {
|
|
14098
14068
|
});
|
|
14099
|
-
|
|
14069
|
+
settleLocal(error);
|
|
14100
14070
|
},
|
|
14101
|
-
done
|
|
14071
|
+
done: receiver.done
|
|
14102
14072
|
};
|
|
14103
14073
|
}
|
|
14104
14074
|
isNoClient(res) {
|
|
@@ -68892,7 +68862,7 @@ var config_get_default = defineController2(async ({ config, env: env2, req }) =>
|
|
|
68892
68862
|
});
|
|
68893
68863
|
|
|
68894
68864
|
// src/version.ts
|
|
68895
|
-
var BUILDER_VERSION = "0.40.
|
|
68865
|
+
var BUILDER_VERSION = "0.40.7".length > 0 ? "0.40.7" : "dev";
|
|
68896
68866
|
|
|
68897
68867
|
// src/api/diagnostics.get.ts
|
|
68898
68868
|
init_LLMRequest();
|