lalph 0.3.63 → 0.3.64
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/cli.mjs +148 -139
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -11964,6 +11964,42 @@ const interruptors = causeInterruptors;
|
|
|
11964
11964
|
*/
|
|
11965
11965
|
const filterInterruptors = causeFilterInterruptors;
|
|
11966
11966
|
/**
|
|
11967
|
+
* Renders a {@link Cause} as a human-readable string for logging or
|
|
11968
|
+
* debugging.
|
|
11969
|
+
*
|
|
11970
|
+
* Delegates to {@link prettyErrors} to convert each reason to an `Error`,
|
|
11971
|
+
* then joins their stack traces with newlines. Nested `Error.cause` chains
|
|
11972
|
+
* are rendered inline with indentation:
|
|
11973
|
+
*
|
|
11974
|
+
* ```text
|
|
11975
|
+
* ErrorName: message
|
|
11976
|
+
* at ...
|
|
11977
|
+
* at ... {
|
|
11978
|
+
* [cause]: NestedError: message
|
|
11979
|
+
* at ...
|
|
11980
|
+
* }
|
|
11981
|
+
* ```
|
|
11982
|
+
*
|
|
11983
|
+
* Span annotations are appended to the relevant stack frames when available.
|
|
11984
|
+
*
|
|
11985
|
+
* **Example** (rendering a cause)
|
|
11986
|
+
*
|
|
11987
|
+
* ```ts
|
|
11988
|
+
* import { Cause } from "effect"
|
|
11989
|
+
*
|
|
11990
|
+
* const cause = Cause.fail("something went wrong")
|
|
11991
|
+
* console.log(Cause.pretty(cause))
|
|
11992
|
+
* // Error: something went wrong
|
|
11993
|
+
* // at ...
|
|
11994
|
+
* ```
|
|
11995
|
+
*
|
|
11996
|
+
* @see {@link prettyErrors} — get the individual `Error` instances
|
|
11997
|
+
*
|
|
11998
|
+
* @since 4.0.0
|
|
11999
|
+
* @category rendering
|
|
12000
|
+
*/
|
|
12001
|
+
const pretty$1 = causePretty;
|
|
12002
|
+
/**
|
|
11967
12003
|
* Tests if an arbitrary value is a {@link NoSuchElementError}.
|
|
11968
12004
|
*
|
|
11969
12005
|
* **Example** (runtime type check)
|
|
@@ -12690,6 +12726,7 @@ const matchEffect$1 = /* @__PURE__ */ dual(2, (self, options) => matchCauseEffec
|
|
|
12690
12726
|
* @since 2.0.0
|
|
12691
12727
|
*/
|
|
12692
12728
|
const TypeId$66 = "~effect/Schedule";
|
|
12729
|
+
const randomNext = /* @__PURE__ */ Random$1.useSync((random) => random.nextDoubleUnsafe());
|
|
12693
12730
|
/**
|
|
12694
12731
|
* @since 4.0.0
|
|
12695
12732
|
* @category Metadata
|
|
@@ -13026,6 +13063,51 @@ const exponential = (base, factor = 2) => {
|
|
|
13026
13063
|
}));
|
|
13027
13064
|
};
|
|
13028
13065
|
/**
|
|
13066
|
+
* Returns a new `Schedule` that modifies the delay of the next recurrence
|
|
13067
|
+
* of the schedule using the specified effectual function.
|
|
13068
|
+
*
|
|
13069
|
+
* @example
|
|
13070
|
+
* ```ts
|
|
13071
|
+
* import { Console, Duration, Effect, Schedule } from "effect"
|
|
13072
|
+
*
|
|
13073
|
+
* // Modify delays based on output - increase delay on high iteration counts
|
|
13074
|
+
* const adaptiveDelay = Schedule.recurs(10).pipe(
|
|
13075
|
+
* Schedule.modifyDelay((output, delay) => {
|
|
13076
|
+
* // Double the delay if we're seeing high iteration counts
|
|
13077
|
+
* return Effect.succeed(output > 5 ? Duration.times(delay, 2) : delay)
|
|
13078
|
+
* })
|
|
13079
|
+
* )
|
|
13080
|
+
*
|
|
13081
|
+
* const program = Effect.gen(function*() {
|
|
13082
|
+
* let counter = 0
|
|
13083
|
+
* yield* Effect.repeat(
|
|
13084
|
+
* Effect.gen(function*() {
|
|
13085
|
+
* counter++
|
|
13086
|
+
* yield* Console.log(`Attempt ${counter}`)
|
|
13087
|
+
* return counter
|
|
13088
|
+
* }),
|
|
13089
|
+
* adaptiveDelay.pipe(Schedule.take(8))
|
|
13090
|
+
* )
|
|
13091
|
+
* })
|
|
13092
|
+
* ```
|
|
13093
|
+
*
|
|
13094
|
+
* @since 2.0.0
|
|
13095
|
+
* @category utilities
|
|
13096
|
+
*/
|
|
13097
|
+
const modifyDelay = /* @__PURE__ */ dual(2, (self, f) => fromStep(map$11(toStep(self), (step) => (now, input) => flatMap$6(step(now, input), ([output, delay]) => map$11(f(output, delay), (delay) => [output, fromInputUnsafe(delay)])))));
|
|
13098
|
+
/**
|
|
13099
|
+
* Returns a new `Schedule` that randomly adjusts each recurrence delay.
|
|
13100
|
+
*
|
|
13101
|
+
* Delays are jittered between `80%` and `120%` of the original delay.
|
|
13102
|
+
*
|
|
13103
|
+
* @since 2.0.0
|
|
13104
|
+
* @category utilities
|
|
13105
|
+
*/
|
|
13106
|
+
const jittered = (self) => modifyDelay(self, (_, delay) => map$11(randomNext, (random) => {
|
|
13107
|
+
const millis$2 = toMillis(fromInputUnsafe(delay));
|
|
13108
|
+
return millis(millis$2 * .8 * (1 - random) + millis$2 * 1.2 * random);
|
|
13109
|
+
}));
|
|
13110
|
+
/**
|
|
13029
13111
|
* Returns a new `Schedule` that outputs the inputs of the specified schedule.
|
|
13030
13112
|
*
|
|
13031
13113
|
* @example
|
|
@@ -177949,7 +178031,7 @@ var ji = Bt, Ii = Object.assign(Qe, { sync: Bt }), zi = Ut, Bi = Object.assign(e
|
|
|
177949
178031
|
});
|
|
177950
178032
|
Ze.glob = Ze;
|
|
177951
178033
|
//#endregion
|
|
177952
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
178034
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/ApplyPatch.js
|
|
177953
178035
|
/**
|
|
177954
178036
|
* @since 1.0.0
|
|
177955
178037
|
*/
|
|
@@ -192822,7 +192904,7 @@ var StreamableHTTPClientTransport = class {
|
|
|
192822
192904
|
}
|
|
192823
192905
|
};
|
|
192824
192906
|
//#endregion
|
|
192825
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
192907
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/McpClient.js
|
|
192826
192908
|
/**
|
|
192827
192909
|
* @since 1.0.0
|
|
192828
192910
|
*/
|
|
@@ -192867,7 +192949,7 @@ const layer$7 = effect$1(McpClient, gen(function* () {
|
|
|
192867
192949
|
});
|
|
192868
192950
|
}));
|
|
192869
192951
|
//#endregion
|
|
192870
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
192952
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/ExaSearch.js
|
|
192871
192953
|
/**
|
|
192872
192954
|
* @since 1.0.0
|
|
192873
192955
|
*/
|
|
@@ -207817,7 +207899,7 @@ var require_lib = /* @__PURE__ */ __commonJSMin$1(((exports) => {
|
|
|
207817
207899
|
exports.impl = impl;
|
|
207818
207900
|
}));
|
|
207819
207901
|
//#endregion
|
|
207820
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
207902
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/WebToMarkdown.js
|
|
207821
207903
|
/**
|
|
207822
207904
|
* @since 1.0.0
|
|
207823
207905
|
*/
|
|
@@ -210899,7 +210981,7 @@ const unsafeSecureJsonParse = (text) => {
|
|
|
210899
210981
|
}
|
|
210900
210982
|
};
|
|
210901
210983
|
//#endregion
|
|
210902
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
210984
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/AgentTools.js
|
|
210903
210985
|
/**
|
|
210904
210986
|
* @since 1.0.0
|
|
210905
210987
|
*/
|
|
@@ -211249,7 +211331,7 @@ const AgentToolHandlers = AgentToolHandlersNoDeps.pipe(provide$3([layer$6, layer
|
|
|
211249
211331
|
AgentToolHandlersNoDeps.pipe(provide$3([mock(ExaSearch)({}), mock(WebToMarkdown)({})]));
|
|
211250
211332
|
var ApplyPatchError = class extends TaggedClass$1("ApplyPatchError") {};
|
|
211251
211333
|
//#endregion
|
|
211252
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
211334
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/TypeBuilder.js
|
|
211253
211335
|
const resolveDocumentation = resolveAt("documentation");
|
|
211254
211336
|
const identifierPattern = /^[$A-Z_a-z][$0-9A-Z_a-z]*$/u;
|
|
211255
211337
|
const Precedence = {
|
|
@@ -211522,7 +211604,7 @@ const render = (schema, options) => {
|
|
|
211522
211604
|
return printNode({ text: documentation === void 0 ? rendered.text : `${renderJsDoc(documentation, 0, printerOptions)}${printerOptions.newLine}${rendered.text}` }, printerOptions);
|
|
211523
211605
|
};
|
|
211524
211606
|
//#endregion
|
|
211525
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
211607
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/ToolkitRenderer.js
|
|
211526
211608
|
/**
|
|
211527
211609
|
* @since 1.0.0
|
|
211528
211610
|
*/
|
|
@@ -211544,7 +211626,7 @@ declare function ${name}(${params}): Promise<${render(tool.successSchema)}>`);
|
|
|
211544
211626
|
}) });
|
|
211545
211627
|
};
|
|
211546
211628
|
//#endregion
|
|
211547
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
211629
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/AgentExecutor.js
|
|
211548
211630
|
/**
|
|
211549
211631
|
* @since 1.0.0
|
|
211550
211632
|
*/
|
|
@@ -211698,7 +211780,7 @@ var QueueWriteStream = class extends Writable {
|
|
|
211698
211780
|
}
|
|
211699
211781
|
};
|
|
211700
211782
|
//#endregion
|
|
211701
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
211783
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/ScriptExtraction.js
|
|
211702
211784
|
const stripWrappingCodeFence = (script) => {
|
|
211703
211785
|
const lines = script.split(/\r?\n/);
|
|
211704
211786
|
if (lines.length < 2) return script;
|
|
@@ -213081,7 +213163,7 @@ const applySpanTransformer = (transformer, response, options) => {
|
|
|
213081
213163
|
});
|
|
213082
213164
|
};
|
|
213083
213165
|
//#endregion
|
|
213084
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
213166
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/Agent.js
|
|
213085
213167
|
/**
|
|
213086
213168
|
* @since 1.0.0
|
|
213087
213169
|
*/
|
|
@@ -213125,12 +213207,11 @@ ${content}
|
|
|
213125
213207
|
const modelConfig = yield* AgentModelConfig;
|
|
213126
213208
|
const services$5 = yield* services();
|
|
213127
213209
|
let finalSummary = none$4();
|
|
213128
|
-
const singleToolMode = modelConfig.supportsNoTools !== true;
|
|
213129
213210
|
const output = yield* make$64();
|
|
213130
213211
|
const prompt = opts.disableHistory ? make$66(empty) : history;
|
|
213131
213212
|
update(prompt, concat(opts.prompt));
|
|
213132
213213
|
let system = (typeof opts.system === "function" ? opts.system : defaultSystem)({
|
|
213133
|
-
toolInstructions: generateSystemTools(toolsDts
|
|
213214
|
+
toolInstructions: generateSystemTools(toolsDts),
|
|
213134
213215
|
agentsMd: getOrElse$2(agentsMd, () => "")
|
|
213135
213216
|
});
|
|
213136
213217
|
if (typeof opts.system === "string") system += `\n${opts.system}\n`;
|
|
@@ -213224,17 +213305,8 @@ ${content}
|
|
|
213224
213305
|
return output;
|
|
213225
213306
|
});
|
|
213226
213307
|
if (!modelConfig.systemPromptTransform) update(prompt, setSystem(system));
|
|
213227
|
-
let currentScript = "";
|
|
213228
213308
|
yield* gen(function* () {
|
|
213229
213309
|
while (true) {
|
|
213230
|
-
if (!singleToolMode && currentScript.length > 0) {
|
|
213231
|
-
const result = yield* executeScript(currentScript);
|
|
213232
|
-
update(prompt, concat([{
|
|
213233
|
-
role: modelConfig.supportsAssistantPrefill ? "assistant" : "user",
|
|
213234
|
-
content: `Console output from executing javascript code:\n\n${result}`
|
|
213235
|
-
}]));
|
|
213236
|
-
currentScript = "";
|
|
213237
|
-
}
|
|
213238
213310
|
if (isSome(finalSummary)) {
|
|
213239
213311
|
yield* fail$4(output, new AgentFinished({ summary: finalSummary.value }));
|
|
213240
213312
|
return;
|
|
@@ -213252,75 +213324,20 @@ ${content}
|
|
|
213252
213324
|
let response = empty$17();
|
|
213253
213325
|
let reasoningStarted = false;
|
|
213254
213326
|
let hadReasoningDelta = false;
|
|
213255
|
-
yield* pipe$1(ai.streamText(
|
|
213327
|
+
yield* pipe$1(ai.streamText({
|
|
213256
213328
|
prompt: prompt.current,
|
|
213257
213329
|
toolkit: singleTool
|
|
213258
|
-
}
|
|
213259
|
-
if (!singleToolMode && part.type === "text-end" && currentScript.trim().length > 0) return true;
|
|
213330
|
+
}), takeUntil((part) => {
|
|
213260
213331
|
if ((part.type === "text-end" || part.type === "reasoning-end") && pendingMessages.size > 0) return true;
|
|
213261
213332
|
return false;
|
|
213262
213333
|
}), runForEachArray((parts) => {
|
|
213263
213334
|
response.push(...parts);
|
|
213264
213335
|
for (const part of parts) switch (part.type) {
|
|
213265
213336
|
case "text-start":
|
|
213266
|
-
if (singleToolMode) {
|
|
213267
|
-
if (hadReasoningDelta) {
|
|
213268
|
-
hadReasoningDelta = false;
|
|
213269
|
-
maybeSend({
|
|
213270
|
-
agentId,
|
|
213271
|
-
part: new ReasoningEnd(),
|
|
213272
|
-
release: true
|
|
213273
|
-
});
|
|
213274
|
-
}
|
|
213275
|
-
reasoningStarted = true;
|
|
213276
|
-
break;
|
|
213277
|
-
}
|
|
213278
|
-
currentScript = "";
|
|
213279
|
-
break;
|
|
213280
|
-
case "text-delta":
|
|
213281
|
-
if (singleToolMode) {
|
|
213282
|
-
hadReasoningDelta = true;
|
|
213283
|
-
if (reasoningStarted) {
|
|
213284
|
-
reasoningStarted = false;
|
|
213285
|
-
maybeSend({
|
|
213286
|
-
agentId,
|
|
213287
|
-
part: new ReasoningStart(),
|
|
213288
|
-
acquire: true
|
|
213289
|
-
});
|
|
213290
|
-
}
|
|
213291
|
-
maybeSend({
|
|
213292
|
-
agentId,
|
|
213293
|
-
part: new ReasoningDelta({ delta: part.delta })
|
|
213294
|
-
});
|
|
213295
|
-
break;
|
|
213296
|
-
}
|
|
213297
|
-
if (currentScript === "" && part.delta.length > 0) maybeSend({
|
|
213298
|
-
agentId,
|
|
213299
|
-
part: new ScriptStart(),
|
|
213300
|
-
acquire: true
|
|
213301
|
-
});
|
|
213302
|
-
maybeSend({
|
|
213303
|
-
agentId,
|
|
213304
|
-
part: new ScriptDelta({ delta: part.delta })
|
|
213305
|
-
});
|
|
213306
|
-
currentScript += part.delta;
|
|
213307
|
-
break;
|
|
213308
|
-
case "text-end":
|
|
213309
|
-
if (singleToolMode) {
|
|
213310
|
-
reasoningStarted = false;
|
|
213311
|
-
if (hadReasoningDelta) {
|
|
213312
|
-
hadReasoningDelta = false;
|
|
213313
|
-
maybeSend({
|
|
213314
|
-
agentId,
|
|
213315
|
-
part: new ReasoningEnd(),
|
|
213316
|
-
release: true
|
|
213317
|
-
});
|
|
213318
|
-
}
|
|
213319
|
-
}
|
|
213320
|
-
break;
|
|
213321
213337
|
case "reasoning-start":
|
|
213322
213338
|
reasoningStarted = true;
|
|
213323
213339
|
break;
|
|
213340
|
+
case "text-delta":
|
|
213324
213341
|
case "reasoning-delta":
|
|
213325
213342
|
hadReasoningDelta = true;
|
|
213326
213343
|
if (reasoningStarted) {
|
|
@@ -213336,6 +213353,7 @@ ${content}
|
|
|
213336
213353
|
part: new ReasoningDelta({ delta: part.delta })
|
|
213337
213354
|
});
|
|
213338
213355
|
break;
|
|
213356
|
+
case "text-end":
|
|
213339
213357
|
case "reasoning-end":
|
|
213340
213358
|
reasoningStarted = false;
|
|
213341
213359
|
if (hadReasoningDelta) {
|
|
@@ -213350,12 +213368,18 @@ ${content}
|
|
|
213350
213368
|
case "finish": break;
|
|
213351
213369
|
}
|
|
213352
213370
|
return void_$1;
|
|
213353
|
-
}), retry$3({
|
|
213354
|
-
|
|
213355
|
-
|
|
213356
|
-
|
|
213371
|
+
}), retry$3({
|
|
213372
|
+
while: (err) => {
|
|
213373
|
+
response = [];
|
|
213374
|
+
if (err.isRetryable) maybeSend({
|
|
213375
|
+
agentId,
|
|
213376
|
+
part: new ErrorRetry({ error: err })
|
|
213377
|
+
});
|
|
213378
|
+
return err.isRetryable;
|
|
213379
|
+
},
|
|
213380
|
+
schedule: retryPolicy
|
|
213381
|
+
}), modelConfig.systemPromptTransform ? (effect) => modelConfig.systemPromptTransform(system, effect) : identity);
|
|
213357
213382
|
update(prompt, concat(fromResponseParts(response)));
|
|
213358
|
-
currentScript = currentScript.trim();
|
|
213359
213383
|
}
|
|
213360
213384
|
}).pipe(provideService$2(ScriptExecutor, (script) => {
|
|
213361
213385
|
maybeSend({
|
|
@@ -213397,6 +213421,7 @@ ${content}
|
|
|
213397
213421
|
})
|
|
213398
213422
|
});
|
|
213399
213423
|
});
|
|
213424
|
+
const retryPolicy = exponential(100, 1.5).pipe(either(spaced(5e3)), jittered);
|
|
213400
213425
|
const defaultSystem = (options) => `You are a world-class software engineer: precise, rigorous, thoughtful, and relentlessly careful. You fully understand the task, verify assumptions, and produce minimal, correct, maintainable solutions. You make no mistakes.
|
|
213401
213426
|
|
|
213402
213427
|
- **Fully read and understand your task** before proceeding.
|
|
@@ -213407,8 +213432,26 @@ ${options.toolInstructions}
|
|
|
213407
213432
|
|
|
213408
213433
|
${options.agentsMd}
|
|
213409
213434
|
`;
|
|
213410
|
-
const generateSystemTools = (toolsDts
|
|
213411
|
-
|
|
213435
|
+
const generateSystemTools = (toolsDts) => `**YOU ONLY HAVE ACCESS TO ONE TOOL** "execute", to run javascript code to do your work.
|
|
213436
|
+
|
|
213437
|
+
- Use \`console.log\` to print any output you need.
|
|
213438
|
+
- Top level await is supported.
|
|
213439
|
+
- AVOID passing scripts into the "bash" function, and instead write javascript.
|
|
213440
|
+
- Do as much work as possible in a single script, using \`Promise.all\` to run multiple functions in parallel.
|
|
213441
|
+
- Variables **are not shared** between executions, so you must include all necessary code in each script you execute.
|
|
213442
|
+
|
|
213443
|
+
**When you have fully completed your task**, call the "taskComplete" function with the final output.
|
|
213444
|
+
DO NOT output the final result without wrapping it with "taskComplete".
|
|
213445
|
+
Make sure every detail of the task is done before calling "taskComplete".
|
|
213446
|
+
|
|
213447
|
+
You have the following functions available to you:
|
|
213448
|
+
|
|
213449
|
+
\`\`\`ts
|
|
213450
|
+
${toolsDts}
|
|
213451
|
+
|
|
213452
|
+
/** The global Fetch API available for making HTTP requests. */
|
|
213453
|
+
declare const fetch: typeof globalThis.fetch
|
|
213454
|
+
\`\`\`
|
|
213412
213455
|
|
|
213413
213456
|
For example, here is how you would read a file. First you would respond with
|
|
213414
213457
|
javascript code that uses the "readFile" function:
|
|
@@ -213433,37 +213476,6 @@ Console output from executing javascript code:
|
|
|
213433
213476
|
"version": "1.0.0"
|
|
213434
213477
|
}
|
|
213435
213478
|
\`\`\``;
|
|
213436
|
-
};
|
|
213437
|
-
const generateSystemMulti = (toolsDts) => {
|
|
213438
|
-
return `You complete your tasks by **only writing javascript code** to interact with your environment.
|
|
213439
|
-
|
|
213440
|
-
${systemToolsCommon(toolsDts)}`;
|
|
213441
|
-
};
|
|
213442
|
-
const generateSystemSingle = (toolsDts) => {
|
|
213443
|
-
return `**YOU ONLY HAVE ACCESS TO ONE TOOL** "execute", to run javascript code to do your work.
|
|
213444
|
-
|
|
213445
|
-
${systemToolsCommon(toolsDts)}`;
|
|
213446
|
-
};
|
|
213447
|
-
const systemToolsCommon = (toolsDts) => `- Use \`console.log\` to print any output you need.
|
|
213448
|
-
- Top level await is supported.
|
|
213449
|
-
- AVOID passing scripts into the "bash" function, and instead write javascript.
|
|
213450
|
-
- PREFER the "search" function over "rg" for finding information or code
|
|
213451
|
-
- Do as much work as possible in a single script, using \`Promise.all\` to run multiple functions in parallel.
|
|
213452
|
-
- Variables **are not shared** between executions, so you must include all necessary code in each script you execute.
|
|
213453
|
-
- Make use of the "delegate" tool to delegate exploration and small research tasks. You can delegate multiple tasks in parallel with Promise.all
|
|
213454
|
-
|
|
213455
|
-
**When you have fully completed your task**, call the "taskComplete" function with the final output.
|
|
213456
|
-
DO NOT output the final result without wrapping it with "taskComplete".
|
|
213457
|
-
Make sure every detail of the task is done before calling "taskComplete".
|
|
213458
|
-
|
|
213459
|
-
You have the following functions available to you:
|
|
213460
|
-
|
|
213461
|
-
\`\`\`ts
|
|
213462
|
-
${toolsDts}
|
|
213463
|
-
|
|
213464
|
-
/** The global Fetch API available for making HTTP requests. */
|
|
213465
|
-
declare const fetch: typeof globalThis.fetch
|
|
213466
|
-
\`\`\``;
|
|
213467
213479
|
var ScriptExecutor = class extends Service$1()("clanka/Agent/ScriptExecutor") {};
|
|
213468
213480
|
const SingleTools = make$9(make$8("execute", {
|
|
213469
213481
|
description: "Execute javascript code and return the output",
|
|
@@ -213551,6 +213563,11 @@ var ScriptEnd = class extends TaggedClass()("ScriptEnd", {}) {};
|
|
|
213551
213563
|
* @since 1.0.0
|
|
213552
213564
|
* @category Output
|
|
213553
213565
|
*/
|
|
213566
|
+
var ErrorRetry = class extends TaggedClass()("ErrorRetry", { error: AiError }) {};
|
|
213567
|
+
/**
|
|
213568
|
+
* @since 1.0.0
|
|
213569
|
+
* @category Output
|
|
213570
|
+
*/
|
|
213554
213571
|
var ScriptOutput = class extends TaggedClass()("ScriptOutput", { output: String$1 }) {};
|
|
213555
213572
|
/**
|
|
213556
213573
|
* @since 1.0.0
|
|
@@ -213581,7 +213598,8 @@ const ContentPart = Union([
|
|
|
213581
213598
|
ScriptStart,
|
|
213582
213599
|
ScriptDelta,
|
|
213583
213600
|
ScriptEnd,
|
|
213584
|
-
ScriptOutput
|
|
213601
|
+
ScriptOutput,
|
|
213602
|
+
ErrorRetry
|
|
213585
213603
|
]);
|
|
213586
213604
|
/**
|
|
213587
213605
|
* @since 1.0.0
|
|
@@ -213602,7 +213620,8 @@ Union([
|
|
|
213602
213620
|
ScriptOutput,
|
|
213603
213621
|
SubagentStart,
|
|
213604
213622
|
SubagentComplete,
|
|
213605
|
-
SubagentPart
|
|
213623
|
+
SubagentPart,
|
|
213624
|
+
ErrorRetry
|
|
213606
213625
|
]);
|
|
213607
213626
|
/**
|
|
213608
213627
|
* @since 1.0.0
|
|
@@ -224224,7 +224243,7 @@ const transformToolCallParams = /* @__PURE__ */ fnUntraced(function* (tools, too
|
|
|
224224
224243
|
})));
|
|
224225
224244
|
});
|
|
224226
224245
|
//#endregion
|
|
224227
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
224246
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/CodexAuth.js
|
|
224228
224247
|
/**
|
|
224229
224248
|
* @since 1.0.0
|
|
224230
224249
|
*/
|
|
@@ -224444,7 +224463,7 @@ var CodexAuth = class CodexAuth extends Service$1()("clanka/CodexAuth") {
|
|
|
224444
224463
|
static layerClient = this.layerClientNoDeps.pipe(provide$3(CodexAuth.layer));
|
|
224445
224464
|
};
|
|
224446
224465
|
//#endregion
|
|
224447
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
224466
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/Codex.js
|
|
224448
224467
|
/**
|
|
224449
224468
|
* @since 1.0.0
|
|
224450
224469
|
*/
|
|
@@ -224460,22 +224479,14 @@ const layerClient$1 = layer$3({ apiUrl: "https://chatgpt.com/backend-api/codex"
|
|
|
224460
224479
|
const model$1 = (model, options) => make$11("openai", model, merge$6(layer$2({
|
|
224461
224480
|
model,
|
|
224462
224481
|
config: {
|
|
224463
|
-
...omit$2(options ?? {}, [
|
|
224464
|
-
"reasoning",
|
|
224465
|
-
"supportsNoTools",
|
|
224466
|
-
"supportsAssistantPrefill"
|
|
224467
|
-
]),
|
|
224482
|
+
...omit$2(options ?? {}, ["reasoning"]),
|
|
224468
224483
|
store: false,
|
|
224469
224484
|
reasoning: {
|
|
224470
224485
|
effort: options?.reasoning?.effort ?? "medium",
|
|
224471
224486
|
summary: "auto"
|
|
224472
224487
|
}
|
|
224473
224488
|
}
|
|
224474
|
-
}), AgentModelConfig.layer({
|
|
224475
|
-
systemPromptTransform: (system, effect) => withConfigOverride(effect, { instructions: system }),
|
|
224476
|
-
supportsAssistantPrefill: options?.supportsAssistantPrefill ?? true,
|
|
224477
|
-
supportsNoTools: options?.supportsNoTools ?? true
|
|
224478
|
-
})).pipe(provide$3(layerClient$1)));
|
|
224489
|
+
}), AgentModelConfig.layer({ systemPromptTransform: (system, effect) => withConfigOverride(effect, { instructions: system }) })).pipe(provide$3(layerClient$1)));
|
|
224479
224490
|
//#endregion
|
|
224480
224491
|
//#region node_modules/.pnpm/@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31/node_modules/@effect/ai-openai-compat/dist/internal/errors.js
|
|
224481
224492
|
/** @internal */
|
|
@@ -225763,7 +225774,7 @@ const getUsageDetailNumber = (details, field) => {
|
|
|
225763
225774
|
return typeof value === "number" ? value : void 0;
|
|
225764
225775
|
};
|
|
225765
225776
|
//#endregion
|
|
225766
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
225777
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/CopilotAuth.js
|
|
225767
225778
|
/**
|
|
225768
225779
|
* @since 1.0.0
|
|
225769
225780
|
*/
|
|
@@ -225954,7 +225965,7 @@ var GithubCopilotAuth = class GithubCopilotAuth extends Service$1()("clanka/Gith
|
|
|
225954
225965
|
static layerClient = this.layerClientNoDeps.pipe(provide$3(GithubCopilotAuth.layer));
|
|
225955
225966
|
};
|
|
225956
225967
|
//#endregion
|
|
225957
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
225968
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/Copilot.js
|
|
225958
225969
|
/**
|
|
225959
225970
|
* @since 1.0.0
|
|
225960
225971
|
*/
|
|
@@ -225970,10 +225981,7 @@ const layerClient = layer$1({ apiUrl: API_URL }).pipe(provide$3(GithubCopilotAut
|
|
|
225970
225981
|
const model = (model, options) => make$11("openai", model, merge$6(layer({
|
|
225971
225982
|
model,
|
|
225972
225983
|
config: omit$2(options ?? {}, ["supportsNoTools", "supportsAssistantPrefill"])
|
|
225973
|
-
}), AgentModelConfig.layer({
|
|
225974
|
-
supportsAssistantPrefill: options?.supportsAssistantPrefill ?? false,
|
|
225975
|
-
supportsNoTools: options?.supportsNoTools ?? false
|
|
225976
|
-
})).pipe(provide$3(layerClient)));
|
|
225984
|
+
}), AgentModelConfig.layer({ systemPromptTransform: options?.systemPromptTransform })).pipe(provide$3(layerClient)));
|
|
225977
225985
|
//#endregion
|
|
225978
225986
|
//#region node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
225979
225987
|
const ANSI_BACKGROUND_OFFSET = 10;
|
|
@@ -226377,7 +226385,7 @@ Object.defineProperties(createChalk.prototype, styles);
|
|
|
226377
226385
|
const chalk = createChalk();
|
|
226378
226386
|
createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
226379
226387
|
//#endregion
|
|
226380
|
-
//#region node_modules/.pnpm/clanka@0.1.
|
|
226388
|
+
//#region node_modules/.pnpm/clanka@0.1.12_@effect+ai-openai-compat@4.0.0-beta.31_effect@4.0.0-beta.31__@effect+ai-o_61f0bbdf524c97c4279eaf4823af00ef/node_modules/clanka/dist/OutputFormatter.js
|
|
226381
226389
|
/**
|
|
226382
226390
|
* @since 1.0.0
|
|
226383
226391
|
*/
|
|
@@ -226410,6 +226418,7 @@ ${output.summary}\n\n`;
|
|
|
226410
226418
|
const truncated = lines.length > 20 ? lines.slice(0, 20).join("\n") + "\n... (truncated)" : output.output;
|
|
226411
226419
|
return `${prefix}${chalkScriptHeading(`${scriptIcon} Script output`)}\n\n${chalk.dim(truncated)}\n\n`;
|
|
226412
226420
|
}
|
|
226421
|
+
case "ErrorRetry": return `${prefix}${chalk.red(`Error: ${output.error}. Retrying...`)}\n\n${chalk.dim(pretty$1(fail$7(output.error)))}\n\n`;
|
|
226413
226422
|
}
|
|
226414
226423
|
}), catchTag("AgentFinished", (finished) => succeed$1(`\n${chalk.bold.green(`${doneIcon} Task complete:`)}\n\n${finished.summary}`)));
|
|
226415
226424
|
const promptToString = (prompt) => {
|
|
@@ -235710,7 +235719,7 @@ const commandEdit = make$49("edit").pipe(withDescription("Open the selected proj
|
|
|
235710
235719
|
const commandSource = make$49("source").pipe(withDescription("Select the issue source to use (e.g. GitHub Issues or Linear). This applies to all projects."), withHandler(() => selectIssueSource), provide(Settings.layer));
|
|
235711
235720
|
//#endregion
|
|
235712
235721
|
//#region package.json
|
|
235713
|
-
var version = "0.3.
|
|
235722
|
+
var version = "0.3.64";
|
|
235714
235723
|
//#endregion
|
|
235715
235724
|
//#region src/commands/projects/ls.ts
|
|
235716
235725
|
const commandProjectsLs = make$49("ls").pipe(withDescription("List configured projects and how they run (enabled state, concurrency, branch, git flow, review agent)."), withHandler(fnUntraced(function* () {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lalph",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.64",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@linear/sdk": "^77.0.0",
|
|
30
30
|
"@octokit/plugin-rest-endpoint-methods": "^17.0.0",
|
|
31
31
|
"@octokit/types": "^16.0.0",
|
|
32
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
33
|
-
"clanka": "^0.1.
|
|
32
|
+
"@typescript/native-preview": "7.0.0-dev.20260315.1",
|
|
33
|
+
"clanka": "^0.1.12",
|
|
34
34
|
"concurrently": "^9.2.1",
|
|
35
35
|
"effect": "4.0.0-beta.31",
|
|
36
36
|
"husky": "^9.1.7",
|