@roll-agent/runtime 0.9.0 → 0.10.0
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/engine/agent-bootstrap.d.ts +6 -0
- package/dist/engine/agent-bootstrap.js +1 -0
- package/dist/engine/compaction-checkpoint.d.ts +192 -192
- package/dist/engine/compaction-semantic-state.d.ts +90 -90
- package/dist/engine/conversation-engine.d.ts +3 -2
- package/dist/engine/conversation-engine.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const AGENT_BOOTSTRAP_MAX_CONCURRENCY = 4;
|
|
2
|
+
export interface BoundedConcurrencyOptions<Input, Output> {
|
|
3
|
+
readonly signal: AbortSignal;
|
|
4
|
+
readonly onSkipped: (input: Input, index: number) => Output;
|
|
5
|
+
}
|
|
6
|
+
export declare function mapWithBoundedConcurrency<Input, Output>(inputs: readonly Input[], maxConcurrency: number, mapper: (input: Input, index: number) => Promise<Output>, options?: BoundedConcurrencyOptions<Input, Output>): Promise<Output[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const AGENT_BOOTSTRAP_MAX_CONCURRENCY=4;export async function mapWithBoundedConcurrency(e,r,n,t){if(!Number.isSafeInteger(r)||r<1)throw new RangeError("maxConcurrency must be a positive safe integer");if(0===e.length)return[];const o=e.entries(),i=Array.from({length:e.length}),a=Math.min(r,e.length),s=(await Promise.allSettled(Array.from({length:a},async()=>{for(;;){if(!0===t?.signal.aborted)return;const e=o.next();if(e.done)return;const[r,a]=e.value;i[r]={value:await n(a,r)}}}))).find(e=>"rejected"===e.status);if(void 0!==s)throw s.reason;if(!0===t?.signal.aborted)for(const[r,n]of e.entries())void 0===i[r]&&(i[r]={value:t.onSkipped(n,r)});return i.map((e,r)=>{if(void 0===e)throw new Error(`Missing bounded-concurrency result at index ${r}`);return e.value})}
|