@autohq/cli 0.1.288 → 0.1.290
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/agent-bridge.js +37 -21
- package/dist/index.js +38 -22
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -23384,7 +23384,7 @@ Object.assign(lookup, {
|
|
|
23384
23384
|
// package.json
|
|
23385
23385
|
var package_default = {
|
|
23386
23386
|
name: "@autohq/cli",
|
|
23387
|
-
version: "0.1.
|
|
23387
|
+
version: "0.1.290",
|
|
23388
23388
|
license: "SEE LICENSE IN README.md",
|
|
23389
23389
|
publishConfig: {
|
|
23390
23390
|
access: "public"
|
|
@@ -25904,6 +25904,11 @@ var BINDING_TARGET_TYPES = [
|
|
|
25904
25904
|
"chat.message",
|
|
25905
25905
|
"agent.singleton"
|
|
25906
25906
|
];
|
|
25907
|
+
var TRIGGER_BINDING_TARGET_TYPES = [
|
|
25908
|
+
"github.pull_request",
|
|
25909
|
+
"slack.thread",
|
|
25910
|
+
"agent.singleton"
|
|
25911
|
+
];
|
|
25907
25912
|
var SESSION_BINDING_SOURCES = [
|
|
25908
25913
|
"trigger_spawn",
|
|
25909
25914
|
"agent_tool",
|
|
@@ -25912,6 +25917,9 @@ var SESSION_BINDING_SOURCES = [
|
|
|
25912
25917
|
];
|
|
25913
25918
|
var SESSION_BINDING_STATUSES = ["active", "released"];
|
|
25914
25919
|
var BindingTargetTypeSchema = external_exports.enum(BINDING_TARGET_TYPES);
|
|
25920
|
+
var TriggerBindingTargetTypeSchema = external_exports.enum(
|
|
25921
|
+
TRIGGER_BINDING_TARGET_TYPES
|
|
25922
|
+
);
|
|
25915
25923
|
var SessionBindingSourceSchema = external_exports.enum(SESSION_BINDING_SOURCES);
|
|
25916
25924
|
var SessionBindingStatusSchema = external_exports.enum(SESSION_BINDING_STATUSES);
|
|
25917
25925
|
var BindingTargetSchema = external_exports.object({
|
|
@@ -25968,7 +25976,7 @@ var SingletonRouteBySchema = external_exports.object({
|
|
|
25968
25976
|
});
|
|
25969
25977
|
var OnUnmatchedSchema = external_exports.enum(["drop", "warn", "error"]).default("drop");
|
|
25970
25978
|
var SpawnBindSchema = external_exports.object({
|
|
25971
|
-
target:
|
|
25979
|
+
target: TriggerBindingTargetTypeSchema
|
|
25972
25980
|
});
|
|
25973
25981
|
var TriggerRoutingSchema = external_exports.discriminatedUnion("kind", [
|
|
25974
25982
|
external_exports.object({
|
|
@@ -25990,7 +25998,7 @@ var TriggerRoutingSchema = external_exports.discriminatedUnion("kind", [
|
|
|
25990
25998
|
// backs; ownedArtifact remains a working alias that resolves bindings-first.
|
|
25991
25999
|
external_exports.object({
|
|
25992
26000
|
kind: external_exports.literal("bind"),
|
|
25993
|
-
target:
|
|
26001
|
+
target: TriggerBindingTargetTypeSchema,
|
|
25994
26002
|
onUnmatched: OnUnmatchedSchema
|
|
25995
26003
|
})
|
|
25996
26004
|
]);
|
|
@@ -36728,25 +36736,11 @@ var AgentBridgeOutputBuffer = class {
|
|
|
36728
36736
|
);
|
|
36729
36737
|
if (!completedMessage || !completedMessage.id.trim()) {
|
|
36730
36738
|
if (isTerminalUiMessageChunk(projection.chunk)) {
|
|
36731
|
-
|
|
36732
|
-
if (statusText) {
|
|
36733
|
-
await this.enqueueProjectionAndDrain(context, {
|
|
36734
|
-
type: "entry",
|
|
36735
|
-
entry: {
|
|
36736
|
-
role: "system",
|
|
36737
|
-
kind: "status",
|
|
36738
|
-
status: terminalEntryStatus(projection),
|
|
36739
|
-
...projection.turnStatus ? { turnStatus: projection.turnStatus } : {},
|
|
36740
|
-
...projection.usage ? { usage: projection.usage } : {},
|
|
36741
|
-
content: {
|
|
36742
|
-
parts: [{ type: "text", text: statusText }]
|
|
36743
|
-
}
|
|
36744
|
-
}
|
|
36745
|
-
});
|
|
36746
|
-
}
|
|
36739
|
+
await this.emitTerminalStatusEntry(context, projection);
|
|
36747
36740
|
}
|
|
36748
36741
|
return;
|
|
36749
36742
|
}
|
|
36743
|
+
const turnFailed = projection.turnStatus === "failed";
|
|
36750
36744
|
this.outputSeq += 1;
|
|
36751
36745
|
const completedAt = now2();
|
|
36752
36746
|
const completedOutput = buildUiMessageCompletedOutputEnvelope({
|
|
@@ -36754,13 +36748,35 @@ var AgentBridgeOutputBuffer = class {
|
|
|
36754
36748
|
outputSeq: this.outputSeq,
|
|
36755
36749
|
message: completedMessage,
|
|
36756
36750
|
status: terminalEntryStatus(projection),
|
|
36757
|
-
turnStatus: projection.turnStatus,
|
|
36758
|
-
usage: projection.usage,
|
|
36751
|
+
turnStatus: turnFailed ? void 0 : projection.turnStatus,
|
|
36752
|
+
usage: turnFailed ? void 0 : projection.usage,
|
|
36759
36753
|
createdAt: completedAt,
|
|
36760
36754
|
completedAt
|
|
36761
36755
|
});
|
|
36762
36756
|
this.enqueueOutput(completedOutput);
|
|
36763
36757
|
await this.drainPendingOutputs();
|
|
36758
|
+
if (turnFailed) {
|
|
36759
|
+
await this.emitTerminalStatusEntry(context, projection);
|
|
36760
|
+
}
|
|
36761
|
+
}
|
|
36762
|
+
async emitTerminalStatusEntry(context, projection) {
|
|
36763
|
+
const statusText = terminalStatusText(projection);
|
|
36764
|
+
if (!statusText) {
|
|
36765
|
+
return;
|
|
36766
|
+
}
|
|
36767
|
+
await this.enqueueProjectionAndDrain(context, {
|
|
36768
|
+
type: "entry",
|
|
36769
|
+
entry: {
|
|
36770
|
+
role: "system",
|
|
36771
|
+
kind: "status",
|
|
36772
|
+
status: terminalEntryStatus(projection),
|
|
36773
|
+
...projection.turnStatus ? { turnStatus: projection.turnStatus } : {},
|
|
36774
|
+
...projection.usage ? { usage: projection.usage } : {},
|
|
36775
|
+
content: {
|
|
36776
|
+
parts: [{ type: "text", text: statusText }]
|
|
36777
|
+
}
|
|
36778
|
+
}
|
|
36779
|
+
});
|
|
36764
36780
|
}
|
|
36765
36781
|
async emitLiveUiMessageChunk(context, chunk) {
|
|
36766
36782
|
this.outputSeq += 1;
|
package/dist/index.js
CHANGED
|
@@ -17456,7 +17456,7 @@ var init_tools = __esm({
|
|
|
17456
17456
|
});
|
|
17457
17457
|
|
|
17458
17458
|
// ../../packages/schemas/src/session-bindings.ts
|
|
17459
|
-
var BINDING_TARGET_TYPES, SESSION_BINDING_SOURCES, SESSION_BINDING_STATUSES, BindingTargetTypeSchema, SessionBindingSourceSchema, SessionBindingStatusSchema, BindingTargetSchema;
|
|
17459
|
+
var BINDING_TARGET_TYPES, TRIGGER_BINDING_TARGET_TYPES, SESSION_BINDING_SOURCES, SESSION_BINDING_STATUSES, BindingTargetTypeSchema, TriggerBindingTargetTypeSchema, SessionBindingSourceSchema, SessionBindingStatusSchema, BindingTargetSchema;
|
|
17460
17460
|
var init_session_bindings = __esm({
|
|
17461
17461
|
"../../packages/schemas/src/session-bindings.ts"() {
|
|
17462
17462
|
"use strict";
|
|
@@ -17467,6 +17467,11 @@ var init_session_bindings = __esm({
|
|
|
17467
17467
|
"chat.message",
|
|
17468
17468
|
"agent.singleton"
|
|
17469
17469
|
];
|
|
17470
|
+
TRIGGER_BINDING_TARGET_TYPES = [
|
|
17471
|
+
"github.pull_request",
|
|
17472
|
+
"slack.thread",
|
|
17473
|
+
"agent.singleton"
|
|
17474
|
+
];
|
|
17470
17475
|
SESSION_BINDING_SOURCES = [
|
|
17471
17476
|
"trigger_spawn",
|
|
17472
17477
|
"agent_tool",
|
|
@@ -17475,6 +17480,9 @@ var init_session_bindings = __esm({
|
|
|
17475
17480
|
];
|
|
17476
17481
|
SESSION_BINDING_STATUSES = ["active", "released"];
|
|
17477
17482
|
BindingTargetTypeSchema = external_exports.enum(BINDING_TARGET_TYPES);
|
|
17483
|
+
TriggerBindingTargetTypeSchema = external_exports.enum(
|
|
17484
|
+
TRIGGER_BINDING_TARGET_TYPES
|
|
17485
|
+
);
|
|
17478
17486
|
SessionBindingSourceSchema = external_exports.enum(SESSION_BINDING_SOURCES);
|
|
17479
17487
|
SessionBindingStatusSchema = external_exports.enum(SESSION_BINDING_STATUSES);
|
|
17480
17488
|
BindingTargetSchema = external_exports.object({
|
|
@@ -17555,7 +17563,7 @@ var init_trigger_router = __esm({
|
|
|
17555
17563
|
});
|
|
17556
17564
|
OnUnmatchedSchema = external_exports.enum(["drop", "warn", "error"]).default("drop");
|
|
17557
17565
|
SpawnBindSchema = external_exports.object({
|
|
17558
|
-
target:
|
|
17566
|
+
target: TriggerBindingTargetTypeSchema
|
|
17559
17567
|
});
|
|
17560
17568
|
TriggerRoutingSchema = external_exports.discriminatedUnion("kind", [
|
|
17561
17569
|
external_exports.object({
|
|
@@ -17577,7 +17585,7 @@ var init_trigger_router = __esm({
|
|
|
17577
17585
|
// backs; ownedArtifact remains a working alias that resolves bindings-first.
|
|
17578
17586
|
external_exports.object({
|
|
17579
17587
|
kind: external_exports.literal("bind"),
|
|
17580
|
-
target:
|
|
17588
|
+
target: TriggerBindingTargetTypeSchema,
|
|
17581
17589
|
onUnmatched: OnUnmatchedSchema
|
|
17582
17590
|
})
|
|
17583
17591
|
]);
|
|
@@ -23173,7 +23181,7 @@ var init_package = __esm({
|
|
|
23173
23181
|
"package.json"() {
|
|
23174
23182
|
package_default = {
|
|
23175
23183
|
name: "@autohq/cli",
|
|
23176
|
-
version: "0.1.
|
|
23184
|
+
version: "0.1.290",
|
|
23177
23185
|
license: "SEE LICENSE IN README.md",
|
|
23178
23186
|
publishConfig: {
|
|
23179
23187
|
access: "public"
|
|
@@ -33745,25 +33753,11 @@ var AgentBridgeOutputBuffer = class {
|
|
|
33745
33753
|
);
|
|
33746
33754
|
if (!completedMessage || !completedMessage.id.trim()) {
|
|
33747
33755
|
if (isTerminalUiMessageChunk(projection.chunk)) {
|
|
33748
|
-
|
|
33749
|
-
if (statusText) {
|
|
33750
|
-
await this.enqueueProjectionAndDrain(context, {
|
|
33751
|
-
type: "entry",
|
|
33752
|
-
entry: {
|
|
33753
|
-
role: "system",
|
|
33754
|
-
kind: "status",
|
|
33755
|
-
status: terminalEntryStatus(projection),
|
|
33756
|
-
...projection.turnStatus ? { turnStatus: projection.turnStatus } : {},
|
|
33757
|
-
...projection.usage ? { usage: projection.usage } : {},
|
|
33758
|
-
content: {
|
|
33759
|
-
parts: [{ type: "text", text: statusText }]
|
|
33760
|
-
}
|
|
33761
|
-
}
|
|
33762
|
-
});
|
|
33763
|
-
}
|
|
33756
|
+
await this.emitTerminalStatusEntry(context, projection);
|
|
33764
33757
|
}
|
|
33765
33758
|
return;
|
|
33766
33759
|
}
|
|
33760
|
+
const turnFailed = projection.turnStatus === "failed";
|
|
33767
33761
|
this.outputSeq += 1;
|
|
33768
33762
|
const completedAt = now2();
|
|
33769
33763
|
const completedOutput = buildUiMessageCompletedOutputEnvelope({
|
|
@@ -33771,13 +33765,35 @@ var AgentBridgeOutputBuffer = class {
|
|
|
33771
33765
|
outputSeq: this.outputSeq,
|
|
33772
33766
|
message: completedMessage,
|
|
33773
33767
|
status: terminalEntryStatus(projection),
|
|
33774
|
-
turnStatus: projection.turnStatus,
|
|
33775
|
-
usage: projection.usage,
|
|
33768
|
+
turnStatus: turnFailed ? void 0 : projection.turnStatus,
|
|
33769
|
+
usage: turnFailed ? void 0 : projection.usage,
|
|
33776
33770
|
createdAt: completedAt,
|
|
33777
33771
|
completedAt
|
|
33778
33772
|
});
|
|
33779
33773
|
this.enqueueOutput(completedOutput);
|
|
33780
33774
|
await this.drainPendingOutputs();
|
|
33775
|
+
if (turnFailed) {
|
|
33776
|
+
await this.emitTerminalStatusEntry(context, projection);
|
|
33777
|
+
}
|
|
33778
|
+
}
|
|
33779
|
+
async emitTerminalStatusEntry(context, projection) {
|
|
33780
|
+
const statusText = terminalStatusText(projection);
|
|
33781
|
+
if (!statusText) {
|
|
33782
|
+
return;
|
|
33783
|
+
}
|
|
33784
|
+
await this.enqueueProjectionAndDrain(context, {
|
|
33785
|
+
type: "entry",
|
|
33786
|
+
entry: {
|
|
33787
|
+
role: "system",
|
|
33788
|
+
kind: "status",
|
|
33789
|
+
status: terminalEntryStatus(projection),
|
|
33790
|
+
...projection.turnStatus ? { turnStatus: projection.turnStatus } : {},
|
|
33791
|
+
...projection.usage ? { usage: projection.usage } : {},
|
|
33792
|
+
content: {
|
|
33793
|
+
parts: [{ type: "text", text: statusText }]
|
|
33794
|
+
}
|
|
33795
|
+
}
|
|
33796
|
+
});
|
|
33781
33797
|
}
|
|
33782
33798
|
async emitLiveUiMessageChunk(context, chunk) {
|
|
33783
33799
|
this.outputSeq += 1;
|