@bastani/atomic 0.9.23-alpha.1 → 0.9.24-alpha.1
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/CHANGELOG.md +29 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/CHANGELOG.md +6 -0
- package/dist/builtin/mcp/README.md +1 -0
- package/dist/builtin/mcp/index.bundle.mjs +244 -58
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +18 -0
- package/dist/builtin/workflows/builtin/{chunk-d3xhj946.js → chunk-cpw5gtzg.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-kgn5wz1c.js → chunk-e1254zvd.js} +139 -15
- package/dist/builtin/workflows/builtin/{chunk-hj8mh07f.js → chunk-qy6g0baf.js} +1 -1
- package/dist/builtin/workflows/builtin/goal.js +2 -2
- package/dist/builtin/workflows/builtin/index.js +3 -3
- package/dist/builtin/workflows/builtin/ralph.js +2 -2
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +1 -0
- package/dist/builtin/workflows/skills/prompt-engineer/references/claude_sonnet_5_5.md +131 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +187 -25
- package/dist/builtin/workflows/src/index.js +147 -17
- package/dist/core/agent-session-events.js +1 -1
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-state.js +5 -2
- package/dist/core/agent-session-state.js.map +1 -1
- package/dist/core/extensions/api-types.d.ts +12 -0
- package/dist/core/extensions/api-types.d.ts.map +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +42 -0
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-bindings.d.ts.map +1 -1
- package/dist/core/extensions/loader-bindings.js +13 -7
- package/dist/core/extensions/loader-bindings.js.map +1 -1
- package/dist/core/extensions/loader-resources.d.ts +3 -0
- package/dist/core/extensions/loader-resources.d.ts.map +1 -1
- package/dist/core/extensions/loader-resources.js.map +1 -1
- package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
- package/dist/core/extensions/loader-runtime.js +2 -0
- package/dist/core/extensions/loader-runtime.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +2 -0
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/extensions/mcp-server-registry.d.ts +22 -0
- package/dist/core/extensions/mcp-server-registry.d.ts.map +1 -0
- package/dist/core/extensions/mcp-server-registry.js +51 -0
- package/dist/core/extensions/mcp-server-registry.js.map +1 -0
- package/dist/core/extensions/runtime-types.d.ts +3 -0
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/keybindings.d.ts +1 -1
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +1 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/mcp-servers.d.ts +39 -0
- package/dist/core/mcp-servers.d.ts.map +1 -0
- package/dist/core/mcp-servers.js +2 -0
- package/dist/core/mcp-servers.js.map +1 -0
- package/dist/core/model-resolver-defaults.js +2 -2
- package/dist/core/model-resolver-defaults.js.map +1 -1
- package/dist/core/package-manager-manifest.d.ts +3 -0
- package/dist/core/package-manager-manifest.d.ts.map +1 -1
- package/dist/core/package-manager-manifest.js +14 -0
- package/dist/core/package-manager-manifest.js.map +1 -1
- package/dist/core/package-manager-mcp-servers.d.ts +4 -0
- package/dist/core/package-manager-mcp-servers.d.ts.map +1 -0
- package/dist/core/package-manager-mcp-servers.js +53 -0
- package/dist/core/package-manager-mcp-servers.js.map +1 -0
- package/dist/core/package-manager-resource-accumulator.d.ts.map +1 -1
- package/dist/core/package-manager-resource-accumulator.js +2 -0
- package/dist/core/package-manager-resource-accumulator.js.map +1 -1
- package/dist/core/package-manager-resource-collector.d.ts.map +1 -1
- package/dist/core/package-manager-resource-collector.js +2 -0
- package/dist/core/package-manager-resource-collector.js.map +1 -1
- package/dist/core/package-manager-resource-patterns.d.ts +4 -0
- package/dist/core/package-manager-resource-patterns.d.ts.map +1 -1
- package/dist/core/package-manager-resource-patterns.js +36 -12
- package/dist/core/package-manager-resource-patterns.js.map +1 -1
- package/dist/core/package-manager-types.d.ts +14 -0
- package/dist/core/package-manager-types.d.ts.map +1 -1
- package/dist/core/package-manager-types.js.map +1 -1
- package/dist/core/package-manager.d.ts +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/resource-loader-core.d.ts +4 -0
- package/dist/core/resource-loader-core.d.ts.map +1 -1
- package/dist/core/resource-loader-core.js +7 -0
- package/dist/core/resource-loader-core.js.map +1 -1
- package/dist/core/resource-loader-helpers.d.ts.map +1 -1
- package/dist/core/resource-loader-helpers.js +1 -0
- package/dist/core/resource-loader-helpers.js.map +1 -1
- package/dist/core/resource-loader-internals.d.ts +2 -0
- package/dist/core/resource-loader-internals.d.ts.map +1 -1
- package/dist/core/resource-loader-internals.js.map +1 -1
- package/dist/core/resource-loader-package-resources.d.ts +3 -0
- package/dist/core/resource-loader-package-resources.d.ts.map +1 -1
- package/dist/core/resource-loader-package-resources.js +25 -2
- package/dist/core/resource-loader-package-resources.js.map +1 -1
- package/dist/core/resource-loader-reload.d.ts.map +1 -1
- package/dist/core/resource-loader-reload.js +4 -1
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +2 -0
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +6 -1
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/settings-types.d.ts +1 -0
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +37 -10
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/chat-input-actions.d.ts +12 -0
- package/dist/modes/interactive/chat-input-actions.d.ts.map +1 -1
- package/dist/modes/interactive/chat-input-actions.js +44 -18
- package/dist/modes/interactive/chat-input-actions.js.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-editor.d.ts +11 -0
- package/dist/modes/interactive/components/chat-session-host-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-session-host-editor.js +7 -1
- package/dist/modes/interactive/components/chat-session-host-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-hotkeys-debug.js +1 -1
- package/dist/modes/interactive/interactive-hotkeys-debug.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +3 -1
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-helpers.js +1 -6
- package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
- package/dist/utils/clipboard-native.d.ts +2 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -1
- package/dist/utils/clipboard-native.js.map +1 -1
- package/dist/utils/clipboard.d.ts +7 -0
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +37 -1
- package/dist/utils/clipboard.js.map +1 -1
- package/docs/extensions/api-reference.md +19 -0
- package/docs/extensions.md +4 -0
- package/docs/keybindings.md +2 -2
- package/docs/llama-cpp.md +13 -0
- package/docs/mcp-servers.md +18 -0
- package/docs/models/evals.md +16 -4
- package/docs/packages/authoring.md +27 -0
- package/docs/packages/reference.md +3 -2
- package/docs/packages.md +3 -2
- package/docs/skills.md +3 -1
- package/examples/extensions/gondolin/package-lock.json +3 -3
- package/npm-shrinkwrap.json +46 -46
- package/package.json +4 -4
|
@@ -11864,7 +11864,7 @@ var require_query = __commonJS(function(exports, module) {
|
|
|
11864
11864
|
if (typeof this.text !== "string" && typeof this.name !== "string") {
|
|
11865
11865
|
return new Error("A query must have either text or a name. Supplying neither is unsupported.");
|
|
11866
11866
|
}
|
|
11867
|
-
const previous = connection.parsedStatements[this.name];
|
|
11867
|
+
const previous = connection.parsedStatements[this.name] || connection.submittedNamedStatements[this.name];
|
|
11868
11868
|
if (this.text && previous && this.text !== previous) {
|
|
11869
11869
|
return new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);
|
|
11870
11870
|
}
|
|
@@ -11884,7 +11884,7 @@ var require_query = __commonJS(function(exports, module) {
|
|
|
11884
11884
|
return null;
|
|
11885
11885
|
}
|
|
11886
11886
|
hasBeenParsed(connection) {
|
|
11887
|
-
return this.name && connection.parsedStatements[this.name];
|
|
11887
|
+
return this.name && (connection.parsedStatements[this.name] || connection.submittedNamedStatements[this.name]);
|
|
11888
11888
|
}
|
|
11889
11889
|
handlePortalSuspended(connection) {
|
|
11890
11890
|
this._getRows(connection, this.rows);
|
|
@@ -11907,6 +11907,9 @@ var require_query = __commonJS(function(exports, module) {
|
|
|
11907
11907
|
name: this.name,
|
|
11908
11908
|
types: this.types
|
|
11909
11909
|
});
|
|
11910
|
+
if (this.name) {
|
|
11911
|
+
connection.submittedNamedStatements[this.name] = this.text;
|
|
11912
|
+
}
|
|
11910
11913
|
}
|
|
11911
11914
|
try {
|
|
11912
11915
|
connection.bind({
|
|
@@ -12638,7 +12641,7 @@ var require_parser2 = __commonJS(function(exports) {
|
|
|
12638
12641
|
const parameterCount = reader.int16();
|
|
12639
12642
|
const message = new messages_1.ParameterDescriptionMessage(LATEINIT_LENGTH, parameterCount);
|
|
12640
12643
|
for (let i = 0;i < parameterCount; i++) {
|
|
12641
|
-
message.dataTypeIDs[i] = reader.
|
|
12644
|
+
message.dataTypeIDs[i] = reader.uint32();
|
|
12642
12645
|
}
|
|
12643
12646
|
return message;
|
|
12644
12647
|
};
|
|
@@ -12840,6 +12843,7 @@ var require_connection = __commonJS(function(exports, module) {
|
|
|
12840
12843
|
this._keepAlive = config.keepAlive;
|
|
12841
12844
|
this._keepAliveInitialDelayMillis = config.keepAliveInitialDelayMillis;
|
|
12842
12845
|
this.parsedStatements = {};
|
|
12846
|
+
this.submittedNamedStatements = {};
|
|
12843
12847
|
this.ssl = config.ssl || false;
|
|
12844
12848
|
this.sslNegotiation = config.sslNegotiation || "postgres";
|
|
12845
12849
|
this._ending = false;
|
|
@@ -13360,6 +13364,8 @@ var require_client = __commonJS(function(exports, module) {
|
|
|
13360
13364
|
encoding: this.connectionParameters.client_encoding || "utf8"
|
|
13361
13365
|
});
|
|
13362
13366
|
this._queryQueue = [];
|
|
13367
|
+
this._sentQueryQueue = [];
|
|
13368
|
+
this.pipeline = Boolean(c.pipeline);
|
|
13363
13369
|
this.binary = c.binary || defaults.binary;
|
|
13364
13370
|
this.processID = null;
|
|
13365
13371
|
this.secretKey = null;
|
|
@@ -13394,6 +13400,8 @@ var require_client = __commonJS(function(exports, module) {
|
|
|
13394
13400
|
enqueueError(activeQuery);
|
|
13395
13401
|
this._activeQuery = null;
|
|
13396
13402
|
}
|
|
13403
|
+
this._sentQueryQueue.forEach(enqueueError);
|
|
13404
|
+
this._sentQueryQueue.length = 0;
|
|
13397
13405
|
this._queryQueue.forEach(enqueueError);
|
|
13398
13406
|
this._queryQueue.length = 0;
|
|
13399
13407
|
}
|
|
@@ -13621,6 +13629,9 @@ var require_client = __commonJS(function(exports, module) {
|
|
|
13621
13629
|
return;
|
|
13622
13630
|
}
|
|
13623
13631
|
this._activeQuery = null;
|
|
13632
|
+
if (activeQuery.name) {
|
|
13633
|
+
delete this.connection.submittedNamedStatements[activeQuery.name];
|
|
13634
|
+
}
|
|
13624
13635
|
activeQuery.handleError(msg, this.connection);
|
|
13625
13636
|
}
|
|
13626
13637
|
_handleRowDescription(msg) {
|
|
@@ -13677,6 +13688,7 @@ var require_client = __commonJS(function(exports, module) {
|
|
|
13677
13688
|
}
|
|
13678
13689
|
if (activeQuery.name) {
|
|
13679
13690
|
this.connection.parsedStatements[activeQuery.name] = activeQuery.text;
|
|
13691
|
+
delete this.connection.submittedNamedStatements[activeQuery.name];
|
|
13680
13692
|
}
|
|
13681
13693
|
}
|
|
13682
13694
|
_handleCopyInResponse(msg) {
|
|
@@ -13743,6 +13755,8 @@ var require_client = __commonJS(function(exports, module) {
|
|
|
13743
13755
|
});
|
|
13744
13756
|
} else if (client._queryQueue.indexOf(query) !== -1) {
|
|
13745
13757
|
client._queryQueue.splice(client._queryQueue.indexOf(query), 1);
|
|
13758
|
+
} else if (client._sentQueryQueue.indexOf(query) !== -1) {
|
|
13759
|
+
query.callback = () => {};
|
|
13746
13760
|
}
|
|
13747
13761
|
}
|
|
13748
13762
|
setTypeParser(oid, format, parseFn) {
|
|
@@ -13758,6 +13772,10 @@ var require_client = __commonJS(function(exports, module) {
|
|
|
13758
13772
|
return utils.escapeLiteral(str);
|
|
13759
13773
|
}
|
|
13760
13774
|
_pulseQueryQueue() {
|
|
13775
|
+
if (this.pipeline) {
|
|
13776
|
+
this._pulsePipelinedQueryQueue();
|
|
13777
|
+
return;
|
|
13778
|
+
}
|
|
13761
13779
|
if (this.readyForQuery === true) {
|
|
13762
13780
|
this._activeQuery = this._queryQueue.shift();
|
|
13763
13781
|
const activeQuery = this._getActiveQuery();
|
|
@@ -13778,6 +13796,30 @@ var require_client = __commonJS(function(exports, module) {
|
|
|
13778
13796
|
}
|
|
13779
13797
|
}
|
|
13780
13798
|
}
|
|
13799
|
+
_pulsePipelinedQueryQueue() {
|
|
13800
|
+
if (!this._connected || !this._queryable) {
|
|
13801
|
+
return;
|
|
13802
|
+
}
|
|
13803
|
+
while (this._queryQueue.length > 0) {
|
|
13804
|
+
const query = this._queryQueue.shift();
|
|
13805
|
+
this.hasExecuted = true;
|
|
13806
|
+
const queryError = query.submit(this.connection);
|
|
13807
|
+
if (queryError) {
|
|
13808
|
+
process.nextTick(() => {
|
|
13809
|
+
query.handleError(queryError, this.connection);
|
|
13810
|
+
});
|
|
13811
|
+
continue;
|
|
13812
|
+
}
|
|
13813
|
+
this._sentQueryQueue.push(query);
|
|
13814
|
+
}
|
|
13815
|
+
if (this.readyForQuery && !this._activeQuery && this._sentQueryQueue.length > 0) {
|
|
13816
|
+
this._activeQuery = this._sentQueryQueue.shift();
|
|
13817
|
+
this.readyForQuery = false;
|
|
13818
|
+
}
|
|
13819
|
+
if (!this._activeQuery && this._sentQueryQueue.length === 0 && this._queryQueue.length === 0 && this.hasExecuted) {
|
|
13820
|
+
this.emit("drain");
|
|
13821
|
+
}
|
|
13822
|
+
}
|
|
13781
13823
|
query(config, values, callback) {
|
|
13782
13824
|
let query;
|
|
13783
13825
|
let result;
|
|
@@ -13819,6 +13861,9 @@ var require_client = __commonJS(function(exports, module) {
|
|
|
13819
13861
|
const index = this._queryQueue.indexOf(query);
|
|
13820
13862
|
if (index > -1) {
|
|
13821
13863
|
this._queryQueue.splice(index, 1);
|
|
13864
|
+
} else if (this.pipeline) {
|
|
13865
|
+
this.connection.stream.destroy();
|
|
13866
|
+
return;
|
|
13822
13867
|
}
|
|
13823
13868
|
this._pulseQueryQueue();
|
|
13824
13869
|
}, readTimeout);
|
|
@@ -13845,7 +13890,7 @@ var require_client = __commonJS(function(exports, module) {
|
|
|
13845
13890
|
});
|
|
13846
13891
|
return result;
|
|
13847
13892
|
}
|
|
13848
|
-
if (this._queryQueue.length > 0) {
|
|
13893
|
+
if (this._queryQueue.length > 0 && !this.pipeline) {
|
|
13849
13894
|
queryQueueLengthDeprecationNotice();
|
|
13850
13895
|
}
|
|
13851
13896
|
this._queryQueue.push(query);
|
|
@@ -13871,7 +13916,11 @@ var require_client = __commonJS(function(exports, module) {
|
|
|
13871
13916
|
return this._Promise.resolve();
|
|
13872
13917
|
}
|
|
13873
13918
|
}
|
|
13874
|
-
if (
|
|
13919
|
+
if (!this._queryable) {
|
|
13920
|
+
this.connection.stream.destroy();
|
|
13921
|
+
} else if (this.pipeline && (this._getActiveQuery() || this._sentQueryQueue.length > 0 || this._queryQueue.length > 0)) {
|
|
13922
|
+
this.once("drain", () => this.connection.end());
|
|
13923
|
+
} else if (this._getActiveQuery()) {
|
|
13875
13924
|
this.connection.stream.destroy();
|
|
13876
13925
|
} else {
|
|
13877
13926
|
this.connection.end();
|
|
@@ -14342,7 +14391,7 @@ var require_query2 = __commonJS(function(exports, module) {
|
|
|
14342
14391
|
sourceFunction: "routine"
|
|
14343
14392
|
};
|
|
14344
14393
|
NativeQuery.prototype.handleError = function(err) {
|
|
14345
|
-
const fields = this.native.pq.resultErrorFields();
|
|
14394
|
+
const fields = this.native && this.native.pq.resultErrorFields();
|
|
14346
14395
|
if (fields) {
|
|
14347
14396
|
for (const key in fields) {
|
|
14348
14397
|
const normalizedFieldName = errorFieldMap[key] || key;
|
|
@@ -14469,6 +14518,8 @@ var require_client2 = __commonJS(function(exports, module) {
|
|
|
14469
14518
|
this._connecting = false;
|
|
14470
14519
|
this._connected = false;
|
|
14471
14520
|
this._queryable = true;
|
|
14521
|
+
this.pipeline = Boolean(config.pipeline);
|
|
14522
|
+
this._pipelineInFlight = false;
|
|
14472
14523
|
const cp = this.connectionParameters = new ConnectionParameters(config);
|
|
14473
14524
|
if (config.nativeConnectionString)
|
|
14474
14525
|
cp.nativeConnectionString = config.nativeConnectionString;
|
|
@@ -14613,7 +14664,7 @@ var require_client2 = __commonJS(function(exports, module) {
|
|
|
14613
14664
|
});
|
|
14614
14665
|
return result;
|
|
14615
14666
|
}
|
|
14616
|
-
if (this._queryQueue.length > 0) {
|
|
14667
|
+
if (this._queryQueue.length > 0 && !this.pipeline) {
|
|
14617
14668
|
queryQueueLengthDeprecationNotice();
|
|
14618
14669
|
}
|
|
14619
14670
|
this._queryQueue.push(query);
|
|
@@ -14634,15 +14685,22 @@ var require_client2 = __commonJS(function(exports, module) {
|
|
|
14634
14685
|
cb = (err) => err ? reject(err) : resolve();
|
|
14635
14686
|
});
|
|
14636
14687
|
}
|
|
14637
|
-
|
|
14638
|
-
self.
|
|
14639
|
-
|
|
14640
|
-
|
|
14641
|
-
|
|
14642
|
-
|
|
14643
|
-
cb
|
|
14688
|
+
const doEnd = function() {
|
|
14689
|
+
self.native.end(function() {
|
|
14690
|
+
self._connected = false;
|
|
14691
|
+
self._errorAllQueries(new Error("Connection terminated"));
|
|
14692
|
+
process.nextTick(() => {
|
|
14693
|
+
self.emit("end");
|
|
14694
|
+
if (cb)
|
|
14695
|
+
cb();
|
|
14696
|
+
});
|
|
14644
14697
|
});
|
|
14645
|
-
}
|
|
14698
|
+
};
|
|
14699
|
+
if (this.pipeline && (this._pipelineInFlight || this._queryQueue.length > 0)) {
|
|
14700
|
+
this.once("drain", doEnd);
|
|
14701
|
+
} else {
|
|
14702
|
+
doEnd();
|
|
14703
|
+
}
|
|
14646
14704
|
return result;
|
|
14647
14705
|
};
|
|
14648
14706
|
Client.prototype._hasActiveQuery = function() {
|
|
@@ -14652,6 +14710,9 @@ var require_client2 = __commonJS(function(exports, module) {
|
|
|
14652
14710
|
if (!this._connected) {
|
|
14653
14711
|
return;
|
|
14654
14712
|
}
|
|
14713
|
+
if (this.pipeline && !initialConnection) {
|
|
14714
|
+
return this._pulsePipelinedQueryQueue();
|
|
14715
|
+
}
|
|
14655
14716
|
if (this._hasActiveQuery()) {
|
|
14656
14717
|
return;
|
|
14657
14718
|
}
|
|
@@ -14669,6 +14730,69 @@ var require_client2 = __commonJS(function(exports, module) {
|
|
|
14669
14730
|
self._pulseQueryQueue();
|
|
14670
14731
|
});
|
|
14671
14732
|
};
|
|
14733
|
+
Client.prototype._pulsePipelinedQueryQueue = function() {
|
|
14734
|
+
if (!this._connected || this._pipelineInFlight) {
|
|
14735
|
+
return;
|
|
14736
|
+
}
|
|
14737
|
+
if (this._queryQueue.length === 0) {
|
|
14738
|
+
if (this.hasExecuted) {
|
|
14739
|
+
this.emit("drain");
|
|
14740
|
+
}
|
|
14741
|
+
return;
|
|
14742
|
+
}
|
|
14743
|
+
this._pipelineInFlight = true;
|
|
14744
|
+
const self = this;
|
|
14745
|
+
const queries = [];
|
|
14746
|
+
const nativeQueries = [];
|
|
14747
|
+
const utils = require_utils2();
|
|
14748
|
+
while (this._queryQueue.length > 0) {
|
|
14749
|
+
const query = this._queryQueue.shift();
|
|
14750
|
+
this.hasExecuted = true;
|
|
14751
|
+
nativeQueries.push(query);
|
|
14752
|
+
const values = query.values ? query.values.map(utils.prepareValue) : null;
|
|
14753
|
+
const pipelineEntry = { text: query.text, name: query.name };
|
|
14754
|
+
if (values) {
|
|
14755
|
+
pipelineEntry.values = values;
|
|
14756
|
+
}
|
|
14757
|
+
if (query.name && this.namedQueries[query.name]) {
|
|
14758
|
+
pipelineEntry._alreadyPrepared = true;
|
|
14759
|
+
}
|
|
14760
|
+
queries.push(pipelineEntry);
|
|
14761
|
+
}
|
|
14762
|
+
this.native.pipeline(queries, function(err, results) {
|
|
14763
|
+
self._pipelineInFlight = false;
|
|
14764
|
+
if (err) {
|
|
14765
|
+
for (let i = 0;i < nativeQueries.length; i++) {
|
|
14766
|
+
const q = nativeQueries[i];
|
|
14767
|
+
q.native = self.native;
|
|
14768
|
+
q.handleError(err);
|
|
14769
|
+
}
|
|
14770
|
+
self._pulsePipelinedQueryQueue();
|
|
14771
|
+
return;
|
|
14772
|
+
}
|
|
14773
|
+
for (let i = 0;i < nativeQueries.length; i++) {
|
|
14774
|
+
const q = nativeQueries[i];
|
|
14775
|
+
const r = results[i];
|
|
14776
|
+
q.native = self.native;
|
|
14777
|
+
if (r.err) {
|
|
14778
|
+
q.handleError(r.err);
|
|
14779
|
+
} else {
|
|
14780
|
+
if (q.name) {
|
|
14781
|
+
self.namedQueries[q.name] = q.text;
|
|
14782
|
+
}
|
|
14783
|
+
q.state = "end";
|
|
14784
|
+
q.emit("end", r.result);
|
|
14785
|
+
if (q.callback) {
|
|
14786
|
+
q.callback(null, r.result);
|
|
14787
|
+
}
|
|
14788
|
+
}
|
|
14789
|
+
setImmediate(function() {
|
|
14790
|
+
q.emit("_done");
|
|
14791
|
+
});
|
|
14792
|
+
}
|
|
14793
|
+
self._pulsePipelinedQueryQueue();
|
|
14794
|
+
});
|
|
14795
|
+
};
|
|
14672
14796
|
Client.prototype.cancel = function(query) {
|
|
14673
14797
|
if (this._activeQuery === query) {
|
|
14674
14798
|
this.native.cancel(function() {});
|
|
@@ -93808,9 +93932,21 @@ function registerWorkflowLifecycleHandlers(pi, deps) {
|
|
|
93808
93932
|
return confirmSessionSwitch(reason, ctx);
|
|
93809
93933
|
});
|
|
93810
93934
|
pi.on("session_before_fork", async (_event, ctx) => confirmSessionSwitch("fork", ctx));
|
|
93935
|
+
const notifyDiscoveryDiagnostics = (ctx) => {
|
|
93936
|
+
if (!ctx?.ui)
|
|
93937
|
+
return;
|
|
93938
|
+
const diagnostics = formatStartupDiagnostics(null, runtimeState.discoveryRef.current);
|
|
93939
|
+
if (diagnostics !== null)
|
|
93940
|
+
ctx.ui.notify?.(diagnostics, "warning");
|
|
93941
|
+
};
|
|
93942
|
+
const warmWorkflowDiscovery = (ctx) => {
|
|
93943
|
+
runtimeState.startWorkflowDiscoveryWarmup(() => notifyDiscoveryDiagnostics(ctx));
|
|
93944
|
+
};
|
|
93945
|
+
let startupResourcesDiscovered = false;
|
|
93811
93946
|
pi.on("session_start", async (event, ctx) => {
|
|
93812
93947
|
lifetime.release ??= getDurableBackendProcessOwner().injectedBackend === undefined ? acquireDbosLease() : async () => {};
|
|
93813
93948
|
const reason = typeof event === "object" && event !== null && "reason" in event ? event.reason : undefined;
|
|
93949
|
+
startupResourcesDiscovered = false;
|
|
93814
93950
|
runtimeState.resetWorkflowDiscoveryForSession();
|
|
93815
93951
|
await runtimeState.ensureWorkflowConfigLoaded();
|
|
93816
93952
|
if (replacementStopsWorkflows(reason)) {
|
|
@@ -93825,13 +93961,7 @@ function registerWorkflowLifecycleHandlers(pi, deps) {
|
|
|
93825
93961
|
else
|
|
93826
93962
|
await stageControlRegistry.clearDetached();
|
|
93827
93963
|
runtimeState.setNotificationsActive(true);
|
|
93828
|
-
|
|
93829
|
-
if (!ctx?.ui)
|
|
93830
|
-
return;
|
|
93831
|
-
const diagnostics = formatStartupDiagnostics(null, runtimeState.discoveryRef.current);
|
|
93832
|
-
if (diagnostics !== null)
|
|
93833
|
-
ctx.ui.notify?.(diagnostics, "warning");
|
|
93834
|
-
});
|
|
93964
|
+
warmWorkflowDiscovery(ctx);
|
|
93835
93965
|
if (ctx?.ui) {
|
|
93836
93966
|
const diagnostics = formatStartupDiagnostics(runtimeState.configLoadRef.current, null);
|
|
93837
93967
|
if (diagnostics !== null)
|
|
@@ -93841,6 +93971,16 @@ function registerWorkflowLifecycleHandlers(pi, deps) {
|
|
|
93841
93971
|
}
|
|
93842
93972
|
runtimeState.updateHostStageSessionDir(ctx?.sessionManager ?? pi.sessionManager);
|
|
93843
93973
|
});
|
|
93974
|
+
pi.on("resources_discover", (event, ctx) => {
|
|
93975
|
+
if (eventReason(event) !== "startup")
|
|
93976
|
+
return;
|
|
93977
|
+
if (!startupResourcesDiscovered) {
|
|
93978
|
+
startupResourcesDiscovered = true;
|
|
93979
|
+
return;
|
|
93980
|
+
}
|
|
93981
|
+
runtimeState.refreshWorkflowDiscovery(() => notifyDiscoveryDiagnostics(ctx));
|
|
93982
|
+
return;
|
|
93983
|
+
});
|
|
93844
93984
|
installCompactionHook(pi, store);
|
|
93845
93985
|
pi.on("session_shutdown", async (event) => {
|
|
93846
93986
|
const reason = eventReason(event);
|
|
@@ -111170,7 +111310,7 @@ class StageSessionController {
|
|
|
111170
111310
|
await session?.closeWorkflowStageGeneration?.();
|
|
111171
111311
|
this.artifactCapture.close();
|
|
111172
111312
|
}
|
|
111173
|
-
async promptWithFallback(text, sdkOptions, consumer = "prompt") {
|
|
111313
|
+
async promptWithFallback(text, sdkOptions, consumer = "prompt", newSessionText) {
|
|
111174
111314
|
if (this.effectiveStageOptions?.model === "auto")
|
|
111175
111315
|
await this.preparePrompt(text);
|
|
111176
111316
|
if (this.session !== undefined && this.activeCreation === undefined && this.ownedCreationPromise === undefined && this.startupWait.signal.aborted) {
|
|
@@ -111229,6 +111369,8 @@ class StageSessionController {
|
|
|
111229
111369
|
let promptText = resumedText ?? text;
|
|
111230
111370
|
if (await this.tryResumeCurrentSession(promptText, sdkOptions, candidates))
|
|
111231
111371
|
return;
|
|
111372
|
+
if (resumedText === undefined && newSessionText !== undefined)
|
|
111373
|
+
promptText = newSessionText;
|
|
111232
111374
|
let index = this.activeCandidateIndex ?? 0;
|
|
111233
111375
|
while (index < candidates.length) {
|
|
111234
111376
|
if (this.ownedCreationPromise !== undefined || this.activeCreation !== undefined) {
|
|
@@ -112529,11 +112671,12 @@ function createStageContext2(opts) {
|
|
|
112529
112671
|
let structuredOutputError = STRUCTURED_OUTPUT_MISSING_ERROR;
|
|
112530
112672
|
while (!structuredOutputCapture.called) {
|
|
112531
112673
|
let nextPrompt = promptText;
|
|
112674
|
+
let newSessionPrompt;
|
|
112532
112675
|
let correctiveAttempts = 0;
|
|
112533
112676
|
controller.beginStructuredOutputCandidateCycle();
|
|
112534
112677
|
while (!structuredOutputCapture.called) {
|
|
112535
112678
|
controller.resetStructuredOutputToolError();
|
|
112536
|
-
await controller.promptWithFallback(nextPrompt, sdkOptions);
|
|
112679
|
+
await controller.promptWithFallback(nextPrompt, sdkOptions, "prompt", newSessionPrompt);
|
|
112537
112680
|
if (structuredOutputCapture.called)
|
|
112538
112681
|
break;
|
|
112539
112682
|
structuredOutputError = controller.structuredOutputFailureReason();
|
|
@@ -112541,6 +112684,9 @@ function createStageContext2(opts) {
|
|
|
112541
112684
|
break;
|
|
112542
112685
|
correctiveAttempts += 1;
|
|
112543
112686
|
nextPrompt = formatStructuredOutputCorrectionPrompt(structuredOutputError, correctiveAttempts, hasOutputArtifact);
|
|
112687
|
+
newSessionPrompt = `${promptText}
|
|
112688
|
+
|
|
112689
|
+
${nextPrompt}`;
|
|
112544
112690
|
}
|
|
112545
112691
|
if (structuredOutputCapture.called)
|
|
112546
112692
|
break;
|
|
@@ -117033,6 +117179,20 @@ function createWorkflowExtensionRuntimeState(pi, adapters, options = {}) {
|
|
|
117033
117179
|
}
|
|
117034
117180
|
}).catch(() => {});
|
|
117035
117181
|
}
|
|
117182
|
+
function refreshWorkflowDiscovery(onApplied) {
|
|
117183
|
+
workflowDiscoveryGeneration += 1;
|
|
117184
|
+
lazyDiscoveryPromise = null;
|
|
117185
|
+
if (discoveryRef.current === null) {
|
|
117186
|
+
startWorkflowDiscoveryWarmup(onApplied);
|
|
117187
|
+
return;
|
|
117188
|
+
}
|
|
117189
|
+
const discoveryStart = workflowDiscoveryGeneration;
|
|
117190
|
+
reloadWorkflowResources().then((report) => {
|
|
117191
|
+
if (report.outcome === "applied" && isWorkflowDiscoveryCurrent(discoveryStart) && notificationsActive) {
|
|
117192
|
+
onApplied?.();
|
|
117193
|
+
}
|
|
117194
|
+
}).catch(() => {});
|
|
117195
|
+
}
|
|
117036
117196
|
return {
|
|
117037
117197
|
persistenceRef,
|
|
117038
117198
|
mcpPort,
|
|
@@ -117049,6 +117209,7 @@ function createWorkflowExtensionRuntimeState(pi, adapters, options = {}) {
|
|
|
117049
117209
|
ensureWorkflowResourcesLoaded,
|
|
117050
117210
|
reloadWorkflowResources,
|
|
117051
117211
|
startWorkflowDiscoveryWarmup,
|
|
117212
|
+
refreshWorkflowDiscovery,
|
|
117052
117213
|
runWithLifecycleSuppressedForPolicy(policy, fn) {
|
|
117053
117214
|
return policy.mode !== "non_interactive" || policy.awaitTerminalRun !== true ? fn() : withWorkflowLifecycleNotificationsSuppressedAsync(lifecycleNotificationState, fn);
|
|
117054
117215
|
},
|
|
@@ -117844,7 +118005,8 @@ function clonePackageSource(source) {
|
|
|
117844
118005
|
...source.skills === undefined ? {} : { skills: [...source.skills] },
|
|
117845
118006
|
...source.prompts === undefined ? {} : { prompts: [...source.prompts] },
|
|
117846
118007
|
...source.themes === undefined ? {} : { themes: [...source.themes] },
|
|
117847
|
-
...source.workflows === undefined ? {} : { workflows: [...source.workflows] }
|
|
118008
|
+
...source.workflows === undefined ? {} : { workflows: [...source.workflows] },
|
|
118009
|
+
...source.mcpServers === undefined ? {} : { mcpServers: [...source.mcpServers] }
|
|
117848
118010
|
};
|
|
117849
118011
|
}
|
|
117850
118012
|
function packageSourcePath(source) {
|