@p4code/cli 0.1.11 → 0.1.12
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/bin.mjs +222 -11
- package/dist/client/assets/{DiffPanel-1GboPEhP.js → DiffPanel-DLEF2Os4.js} +2 -2
- package/dist/client/assets/{FilePreviewPanel-BZACyKlO.js → FilePreviewPanel-8D_2Xs92.js} +2 -2
- package/dist/client/assets/{PreviewPanel-By-_LFU1.js → PreviewPanel-DiR-_u2D.js} +2 -2
- package/dist/client/assets/{angular-html-DWf2nx2U.js → angular-html-CMBWPyD3.js} +2 -2
- package/dist/client/assets/{angular-ts-CIx5TGhT.js → angular-ts-BatZhjLf.js} +2 -2
- package/dist/client/assets/{apl-DafQ1-an.js → apl-Cx1sW3hC.js} +2 -2
- package/dist/client/assets/arrow-right-D6CCHJEU.js +2 -0
- package/dist/client/assets/{astro-Bep3tY5t.js → astro-nMa7HQcv.js} +2 -2
- package/dist/client/assets/{blade-DCuMesAS.js → blade-JxAt8tFv.js} +2 -2
- package/dist/client/assets/{c-DZs6Etpe.js → c-C-yEqtHp.js} +2 -2
- package/dist/client/assets/{cobol-DFZb1h1z.js → cobol-CA3DrkO1.js} +2 -2
- package/dist/client/assets/{coffee-CR0gjEco.js → coffee-CNzul851.js} +2 -2
- package/dist/client/assets/{cpp-U48aiClT.js → cpp-DYasO6ny.js} +2 -2
- package/dist/client/assets/{crystal-CNaWREX9.js → crystal-BkYnv3Y5.js} +2 -2
- package/dist/client/assets/{css-DQTD4ObL.js → css-GnxXZE-U.js} +2 -2
- package/dist/client/assets/{edge-CGgCvH7u.js → edge-DHx6AdO-.js} +2 -2
- package/dist/client/assets/{elixir-QEF-Vb-O.js → elixir-XiEvMT4-.js} +2 -2
- package/dist/client/assets/{elm-UIYYfgyY.js → elm-BY4GYI5F.js} +2 -2
- package/dist/client/assets/{erb-CObSr7xt.js → erb-DDG6lOki.js} +2 -2
- package/dist/client/assets/{fileCommentAnnotations-BQPQAflx.js → fileCommentAnnotations-BTZDcAeh.js} +2 -2
- package/dist/client/assets/{git-rebase-D-Kfui1X.js → git-rebase-BDUy60An.js} +2 -2
- package/dist/client/assets/{glimmer-js-Bj7zsPRR.js → glimmer-js-Dpr_XG7j.js} +2 -2
- package/dist/client/assets/{glimmer-ts-BsEDRgeG.js → glimmer-ts-CtZ0ZipS.js} +2 -2
- package/dist/client/assets/{glsl-D98j42v3.js → glsl-DHtQlcKL.js} +2 -2
- package/dist/client/assets/{graphql-B1Bl3yQr.js → graphql-DtNuYKEb.js} +2 -2
- package/dist/client/assets/{hack-C5SdJhmY.js → hack-BqNfldCe.js} +2 -2
- package/dist/client/assets/{haml-fOHEdRRk.js → haml-mPiLB45s.js} +2 -2
- package/dist/client/assets/{handlebars-BprpyHwi.js → handlebars-BLxX_l2A.js} +2 -2
- package/dist/client/assets/{html-DY94fJQ8.js → html-DU5G3F4s.js} +2 -2
- package/dist/client/assets/{html-derivative-BijLMkmB.js → html-derivative-BMJPXTuS.js} +2 -2
- package/dist/client/assets/{http-DgLF_F-Y.js → http-6kGF1eof.js} +2 -2
- package/dist/client/assets/{hurl-Lf_gtANJ.js → hurl-CvT1bXUG.js} +2 -2
- package/dist/client/assets/index-JvBwT8k1.js +660 -0
- package/dist/client/assets/{java-CvbaU0rW.js → java-bBnbDfw8.js} +2 -2
- package/dist/client/assets/{javascript-Y_90CTbK.js → javascript-CpOINVUc.js} +2 -2
- package/dist/client/assets/{jinja-Dz3cSyss.js → jinja-CItwptlU.js} +2 -2
- package/dist/client/assets/{jison-Cy5HwlPH.js → jison-BWvHru6a.js} +2 -2
- package/dist/client/assets/{json-BX9adxsl.js → json-ClObSVU5.js} +2 -2
- package/dist/client/assets/{jsx-uMzR21MU.js → jsx-vHozUqKh.js} +2 -2
- package/dist/client/assets/{julia-BfKnOvts.js → julia-CITEF0SC.js} +2 -2
- package/dist/client/assets/{just-gPqomEDo.js → just-CAMHq4cU.js} +2 -2
- package/dist/client/assets/{latex-HAmg84zi.js → latex-BHB-Vy2g.js} +2 -2
- package/dist/client/assets/{liquid-CAfKVpt2.js → liquid-rsijXGco.js} +2 -2
- package/dist/client/assets/{lua-MJ-soRMY.js → lua-CPA1zmkS.js} +2 -2
- package/dist/client/assets/{marko-Bk2APM9P.js → marko-D9CJEgH2.js} +2 -2
- package/dist/client/assets/{mdc-D-ETA9xK.js → mdc-DL5ptUuf.js} +2 -2
- package/dist/client/assets/{nginx-NwHNwVvi.js → nginx-DAAmFPDe.js} +2 -2
- package/dist/client/assets/{nim-uboMGtnG.js → nim-DmaHLOWa.js} +2 -2
- package/dist/client/assets/{perl-DZO_qrRW.js → perl-Bw03qQ4D.js} +2 -2
- package/dist/client/assets/{php-BudgHX29.js → php-DdSlZ5fF.js} +2 -2
- package/dist/client/assets/{pug-1FhoiZN2.js → pug-CgQdUdQK.js} +2 -2
- package/dist/client/assets/{qml-B6ycgh-7.js → qml-6-Z__KDk.js} +2 -2
- package/dist/client/assets/{r-M2HClZBy.js → r-BwsNM1XU.js} +2 -2
- package/dist/client/assets/{razor-EiO_nOGU.js → razor-DRWY5qRs.js} +2 -2
- package/dist/client/assets/{regexp-BF12zF9R.js → regexp-BGiLplmg.js} +2 -2
- package/dist/client/assets/{rst-BW8dKb0T.js → rst-CND1NmX_.js} +2 -2
- package/dist/client/assets/{ruby-BcJiTtn_.js → ruby-Dlxt-z_r.js} +2 -2
- package/dist/client/assets/{sas--CMYy3z3.js → sas-DFeunfku.js} +2 -2
- package/dist/client/assets/{scss-CBaO992p.js → scss-D_BTo2XD.js} +2 -2
- package/dist/client/assets/{shellscript-IGSv-HCQ.js → shellscript-cEuOjvsv.js} +2 -2
- package/dist/client/assets/{shellsession-tY9I_iRt.js → shellsession-CeWrE-Lw.js} +2 -2
- package/dist/client/assets/{soy-BvSCSsmo.js → soy-DdFNKMwD.js} +2 -2
- package/dist/client/assets/{sql-BuK6MJNF.js → sql-3jzdtF3L.js} +2 -2
- package/dist/client/assets/{stata-VS9vYyft.js → stata-CfftDdbo.js} +2 -2
- package/dist/client/assets/{surrealql-D4pAe4SW.js → surrealql-BgLa39M_.js} +2 -2
- package/dist/client/assets/{svelte-05AEGqMV.js → svelte-CJNznzEX.js} +2 -2
- package/dist/client/assets/{templ-amlaVpnD.js → templ-DiQ0ONH_.js} +2 -2
- package/dist/client/assets/{tex-B8w-z73a.js → tex-Dj5-ewTi.js} +2 -2
- package/dist/client/assets/textarea-CtwXMNmJ.js +46 -0
- package/dist/client/assets/{ts-tags-CWOgRloL.js → ts-tags-Rut2YPAl.js} +2 -2
- package/dist/client/assets/{tsx-DcSMCm_G.js → tsx-TxGWIfKc.js} +2 -2
- package/dist/client/assets/{twig-BoFkWRc3.js → twig-CEDmL9ir.js} +2 -2
- package/dist/client/assets/{typescript-CnosOGRY.js → typescript-B1NW_Svr.js} +2 -2
- package/dist/client/assets/{vue-BkQYyvUc.js → vue-CEjpLlUp.js} +2 -2
- package/dist/client/assets/{vue-html-DQkUheyK.js → vue-html-BLRayXbW.js} +2 -2
- package/dist/client/assets/{vue-vine-PP4GiTEY.js → vue-vine-BaZ_eWYq.js} +2 -2
- package/dist/client/assets/{xml-B3yPYALE.js → xml-WjUY_YSL.js} +2 -2
- package/dist/client/assets/{xsl-Cgr4RWex.js → xsl-rMBkkP2N.js} +2 -2
- package/dist/client/assets/{yaml-B7fPykX3.js → yaml-BVcdKGq_.js} +2 -2
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/arrow-right-qu8MQub2.js +0 -2
- package/dist/client/assets/index-BWiBk__A.js +0 -660
- package/dist/client/assets/textarea-sGc0UkUx.js +0 -46
package/dist/bin.mjs
CHANGED
|
@@ -233,7 +233,7 @@ const make$73 = () => {
|
|
|
233
233
|
const layer$69 = Layer.sync(NetService, make$73);
|
|
234
234
|
//#endregion
|
|
235
235
|
//#region package.json
|
|
236
|
-
var version = "0.1.
|
|
236
|
+
var version = "0.1.12";
|
|
237
237
|
//#endregion
|
|
238
238
|
//#region src/config.ts
|
|
239
239
|
/**
|
|
@@ -1651,6 +1651,12 @@ const RuntimeMode = Schema$1.Literals([
|
|
|
1651
1651
|
const DEFAULT_RUNTIME_MODE$2 = "full-access";
|
|
1652
1652
|
const ProviderInteractionMode = Schema$1.Literals(["default", "plan"]);
|
|
1653
1653
|
const DEFAULT_PROVIDER_INTERACTION_MODE = "default";
|
|
1654
|
+
const CompressMode = Schema$1.Literals([
|
|
1655
|
+
"off",
|
|
1656
|
+
"lite",
|
|
1657
|
+
"full",
|
|
1658
|
+
"ultra"
|
|
1659
|
+
]);
|
|
1654
1660
|
const ProviderRequestKind = Schema$1.Literals([
|
|
1655
1661
|
"command",
|
|
1656
1662
|
"file-read",
|
|
@@ -1827,6 +1833,7 @@ const OrchestrationThread = Schema$1.Struct({
|
|
|
1827
1833
|
modelSelection: ModelSelection,
|
|
1828
1834
|
runtimeMode: RuntimeMode,
|
|
1829
1835
|
interactionMode: ProviderInteractionMode.pipe(Schema$1.withDecodingDefault(Effect.succeed(DEFAULT_PROVIDER_INTERACTION_MODE))),
|
|
1836
|
+
compressMode: CompressMode.pipe(Schema$1.withDecodingDefault(Effect.succeed("off"))),
|
|
1830
1837
|
branch: Schema$1.NullOr(TrimmedNonEmptyString),
|
|
1831
1838
|
worktreePath: Schema$1.NullOr(TrimmedNonEmptyString),
|
|
1832
1839
|
latestTurn: Schema$1.NullOr(OrchestrationLatestTurn),
|
|
@@ -1867,6 +1874,7 @@ const OrchestrationThreadShell = Schema$1.Struct({
|
|
|
1867
1874
|
modelSelection: ModelSelection,
|
|
1868
1875
|
runtimeMode: RuntimeMode,
|
|
1869
1876
|
interactionMode: ProviderInteractionMode.pipe(Schema$1.withDecodingDefault(Effect.succeed(DEFAULT_PROVIDER_INTERACTION_MODE))),
|
|
1877
|
+
compressMode: CompressMode.pipe(Schema$1.withDecodingDefault(Effect.succeed("off"))),
|
|
1870
1878
|
branch: Schema$1.NullOr(TrimmedNonEmptyString),
|
|
1871
1879
|
worktreePath: Schema$1.NullOr(TrimmedNonEmptyString),
|
|
1872
1880
|
latestTurn: Schema$1.NullOr(OrchestrationLatestTurn),
|
|
@@ -1989,6 +1997,7 @@ const ThreadCreateCommand = Schema$1.Struct({
|
|
|
1989
1997
|
modelSelection: ModelSelection,
|
|
1990
1998
|
runtimeMode: RuntimeMode,
|
|
1991
1999
|
interactionMode: ProviderInteractionMode.pipe(Schema$1.withDecodingDefault(Effect.succeed(DEFAULT_PROVIDER_INTERACTION_MODE))),
|
|
2000
|
+
compressMode: CompressMode.pipe(Schema$1.withDecodingDefault(Effect.succeed("off"))),
|
|
1992
2001
|
branch: Schema$1.NullOr(TrimmedNonEmptyString),
|
|
1993
2002
|
worktreePath: Schema$1.NullOr(TrimmedNonEmptyString),
|
|
1994
2003
|
createdAt: IsoDateTime
|
|
@@ -2055,12 +2064,20 @@ const ThreadInteractionModeSetCommand = Schema$1.Struct({
|
|
|
2055
2064
|
interactionMode: ProviderInteractionMode,
|
|
2056
2065
|
createdAt: IsoDateTime
|
|
2057
2066
|
});
|
|
2067
|
+
const ThreadCompressModeSetCommand = Schema$1.Struct({
|
|
2068
|
+
type: Schema$1.Literal("thread.compress-mode.set"),
|
|
2069
|
+
commandId: CommandId,
|
|
2070
|
+
threadId: ThreadId,
|
|
2071
|
+
compressMode: CompressMode,
|
|
2072
|
+
createdAt: IsoDateTime
|
|
2073
|
+
});
|
|
2058
2074
|
const ThreadTurnStartBootstrapCreateThread = Schema$1.Struct({
|
|
2059
2075
|
projectId: ProjectId,
|
|
2060
2076
|
title: TrimmedNonEmptyString,
|
|
2061
2077
|
modelSelection: ModelSelection,
|
|
2062
2078
|
runtimeMode: RuntimeMode,
|
|
2063
2079
|
interactionMode: ProviderInteractionMode,
|
|
2080
|
+
compressMode: CompressMode.pipe(Schema$1.withDecodingDefault(Effect.succeed("off"))),
|
|
2064
2081
|
branch: Schema$1.NullOr(TrimmedNonEmptyString),
|
|
2065
2082
|
worktreePath: Schema$1.NullOr(TrimmedNonEmptyString),
|
|
2066
2083
|
createdAt: IsoDateTime
|
|
@@ -2090,6 +2107,7 @@ const ThreadTurnStartCommand = Schema$1.Struct({
|
|
|
2090
2107
|
titleSeed: Schema$1.optional(TrimmedNonEmptyString),
|
|
2091
2108
|
runtimeMode: RuntimeMode.pipe(Schema$1.withDecodingDefault(Effect.succeed(DEFAULT_RUNTIME_MODE$2))),
|
|
2092
2109
|
interactionMode: ProviderInteractionMode.pipe(Schema$1.withDecodingDefault(Effect.succeed(DEFAULT_PROVIDER_INTERACTION_MODE))),
|
|
2110
|
+
compressMode: CompressMode.pipe(Schema$1.withDecodingDefault(Effect.succeed("off"))),
|
|
2093
2111
|
bootstrap: Schema$1.optional(ThreadTurnStartBootstrap),
|
|
2094
2112
|
sourceProposedPlan: Schema$1.optional(SourceProposedPlanReference),
|
|
2095
2113
|
createdAt: IsoDateTime
|
|
@@ -2108,6 +2126,7 @@ const ClientThreadTurnStartCommand = Schema$1.Struct({
|
|
|
2108
2126
|
titleSeed: Schema$1.optional(TrimmedNonEmptyString),
|
|
2109
2127
|
runtimeMode: RuntimeMode,
|
|
2110
2128
|
interactionMode: ProviderInteractionMode,
|
|
2129
|
+
compressMode: CompressMode.pipe(Schema$1.withDecodingDefault(Effect.succeed("off"))),
|
|
2111
2130
|
bootstrap: Schema$1.optional(ThreadTurnStartBootstrap),
|
|
2112
2131
|
sourceProposedPlan: Schema$1.optional(SourceProposedPlanReference),
|
|
2113
2132
|
createdAt: IsoDateTime
|
|
@@ -2163,6 +2182,7 @@ const DispatchableClientOrchestrationCommand = Schema$1.Union([
|
|
|
2163
2182
|
ThreadMetaUpdateCommand,
|
|
2164
2183
|
ThreadRuntimeModeSetCommand,
|
|
2165
2184
|
ThreadInteractionModeSetCommand,
|
|
2185
|
+
ThreadCompressModeSetCommand,
|
|
2166
2186
|
ThreadTurnStartCommand,
|
|
2167
2187
|
ThreadTurnInterruptCommand,
|
|
2168
2188
|
ThreadApprovalRespondCommand,
|
|
@@ -2185,6 +2205,7 @@ const ClientOrchestrationCommand = Schema$1.Union([
|
|
|
2185
2205
|
ThreadMetaUpdateCommand,
|
|
2186
2206
|
ThreadRuntimeModeSetCommand,
|
|
2187
2207
|
ThreadInteractionModeSetCommand,
|
|
2208
|
+
ThreadCompressModeSetCommand,
|
|
2188
2209
|
ClientThreadTurnStartCommand,
|
|
2189
2210
|
ThreadTurnInterruptCommand,
|
|
2190
2211
|
ThreadApprovalRespondCommand,
|
|
@@ -2275,6 +2296,7 @@ const OrchestrationEventType = Schema$1.Literals([
|
|
|
2275
2296
|
"thread.meta-updated",
|
|
2276
2297
|
"thread.runtime-mode-set",
|
|
2277
2298
|
"thread.interaction-mode-set",
|
|
2299
|
+
"thread.compress-mode-set",
|
|
2278
2300
|
"thread.message-sent",
|
|
2279
2301
|
"thread.turn-start-requested",
|
|
2280
2302
|
"thread.turn-interrupt-requested",
|
|
@@ -2324,6 +2346,7 @@ const ThreadCreatedPayload$1 = Schema$1.Struct({
|
|
|
2324
2346
|
modelSelection: ModelSelection,
|
|
2325
2347
|
runtimeMode: RuntimeMode.pipe(Schema$1.withDecodingDefault(Effect.succeed(DEFAULT_RUNTIME_MODE$2))),
|
|
2326
2348
|
interactionMode: ProviderInteractionMode.pipe(Schema$1.withDecodingDefault(Effect.succeed(DEFAULT_PROVIDER_INTERACTION_MODE))),
|
|
2349
|
+
compressMode: CompressMode.pipe(Schema$1.withDecodingDefault(Effect.succeed("off"))),
|
|
2327
2350
|
branch: Schema$1.NullOr(TrimmedNonEmptyString),
|
|
2328
2351
|
worktreePath: Schema$1.NullOr(TrimmedNonEmptyString),
|
|
2329
2352
|
createdAt: IsoDateTime,
|
|
@@ -2381,6 +2404,11 @@ const ThreadInteractionModeSetPayload$1 = Schema$1.Struct({
|
|
|
2381
2404
|
interactionMode: ProviderInteractionMode.pipe(Schema$1.withDecodingDefault(Effect.succeed(DEFAULT_PROVIDER_INTERACTION_MODE))),
|
|
2382
2405
|
updatedAt: IsoDateTime
|
|
2383
2406
|
});
|
|
2407
|
+
const ThreadCompressModeSetPayload$1 = Schema$1.Struct({
|
|
2408
|
+
threadId: ThreadId,
|
|
2409
|
+
compressMode: CompressMode.pipe(Schema$1.withDecodingDefault(Effect.succeed("off"))),
|
|
2410
|
+
updatedAt: IsoDateTime
|
|
2411
|
+
});
|
|
2384
2412
|
const ThreadMessageSentPayload = Schema$1.Struct({
|
|
2385
2413
|
threadId: ThreadId,
|
|
2386
2414
|
messageId: MessageId,
|
|
@@ -2399,6 +2427,7 @@ const ThreadTurnStartRequestedPayload = Schema$1.Struct({
|
|
|
2399
2427
|
titleSeed: Schema$1.optional(TrimmedNonEmptyString),
|
|
2400
2428
|
runtimeMode: RuntimeMode.pipe(Schema$1.withDecodingDefault(Effect.succeed(DEFAULT_RUNTIME_MODE$2))),
|
|
2401
2429
|
interactionMode: ProviderInteractionMode.pipe(Schema$1.withDecodingDefault(Effect.succeed(DEFAULT_PROVIDER_INTERACTION_MODE))),
|
|
2430
|
+
compressMode: CompressMode.pipe(Schema$1.withDecodingDefault(Effect.succeed("off"))),
|
|
2402
2431
|
sourceProposedPlan: Schema$1.optional(SourceProposedPlanReference),
|
|
2403
2432
|
createdAt: IsoDateTime
|
|
2404
2433
|
});
|
|
@@ -2543,6 +2572,11 @@ const OrchestrationEvent = Schema$1.Union([
|
|
|
2543
2572
|
type: Schema$1.Literal("thread.interaction-mode-set"),
|
|
2544
2573
|
payload: ThreadInteractionModeSetPayload$1
|
|
2545
2574
|
}),
|
|
2575
|
+
Schema$1.Struct({
|
|
2576
|
+
...EventBaseFields,
|
|
2577
|
+
type: Schema$1.Literal("thread.compress-mode-set"),
|
|
2578
|
+
payload: ThreadCompressModeSetPayload$1
|
|
2579
|
+
}),
|
|
2546
2580
|
Schema$1.Struct({
|
|
2547
2581
|
...EventBaseFields,
|
|
2548
2582
|
type: Schema$1.Literal("thread.message-sent"),
|
|
@@ -4518,14 +4552,16 @@ const ProviderSessionStartInput = Schema$1.Struct({
|
|
|
4518
4552
|
resumeCursor: Schema$1.optional(Schema$1.Unknown),
|
|
4519
4553
|
approvalPolicy: Schema$1.optional(ProviderApprovalPolicy),
|
|
4520
4554
|
sandboxMode: Schema$1.optional(ProviderSandboxMode),
|
|
4521
|
-
runtimeMode: RuntimeMode
|
|
4555
|
+
runtimeMode: RuntimeMode,
|
|
4556
|
+
compressMode: Schema$1.optional(CompressMode)
|
|
4522
4557
|
});
|
|
4523
4558
|
const ProviderSendTurnInput = Schema$1.Struct({
|
|
4524
4559
|
threadId: ThreadId,
|
|
4525
4560
|
input: Schema$1.optional(TrimmedNonEmptyString.check(Schema$1.isMaxLength(PROVIDER_SEND_TURN_MAX_INPUT_CHARS))),
|
|
4526
4561
|
attachments: Schema$1.optional(Schema$1.Array(ChatAttachment).check(Schema$1.isMaxLength(8))),
|
|
4527
4562
|
modelSelection: Schema$1.optional(ModelSelection),
|
|
4528
|
-
interactionMode: Schema$1.optional(ProviderInteractionMode)
|
|
4563
|
+
interactionMode: Schema$1.optional(ProviderInteractionMode),
|
|
4564
|
+
compressMode: Schema$1.optional(CompressMode)
|
|
4529
4565
|
});
|
|
4530
4566
|
Schema$1.Struct({
|
|
4531
4567
|
threadId: ThreadId,
|
|
@@ -12225,6 +12261,14 @@ var _038_TaskOrderKeys_default = Effect.gen(function* () {
|
|
|
12225
12261
|
yield* (yield* SqlClient.SqlClient)`ALTER TABLE tasks ADD COLUMN order_key TEXT`;
|
|
12226
12262
|
});
|
|
12227
12263
|
//#endregion
|
|
12264
|
+
//#region src/persistence/Migrations/039_ProjectionThreadsCompressMode.ts
|
|
12265
|
+
var _039_ProjectionThreadsCompressMode_default = Effect.gen(function* () {
|
|
12266
|
+
yield* (yield* SqlClient.SqlClient)`
|
|
12267
|
+
ALTER TABLE projection_threads
|
|
12268
|
+
ADD COLUMN compress_mode TEXT NOT NULL DEFAULT 'off'
|
|
12269
|
+
`;
|
|
12270
|
+
});
|
|
12271
|
+
//#endregion
|
|
12228
12272
|
//#region src/persistence/Migrations.ts
|
|
12229
12273
|
/**
|
|
12230
12274
|
* MigrationsLive - Migration runner with inline loader
|
|
@@ -12435,6 +12479,11 @@ const migrationEntries = [
|
|
|
12435
12479
|
38,
|
|
12436
12480
|
"TaskOrderKeys",
|
|
12437
12481
|
_038_TaskOrderKeys_default
|
|
12482
|
+
],
|
|
12483
|
+
[
|
|
12484
|
+
39,
|
|
12485
|
+
"ProjectionThreadsCompressMode",
|
|
12486
|
+
_039_ProjectionThreadsCompressMode_default
|
|
12438
12487
|
]
|
|
12439
12488
|
];
|
|
12440
12489
|
const makeMigrationLoader = (throughId) => Migrator.fromRecord(Object.fromEntries(migrationEntries.filter(([id]) => throughId === void 0 || id <= throughId).map(([id, name, migration]) => [`${id}_${name}`, migration])));
|
|
@@ -18131,6 +18180,7 @@ const ThreadSettledPayload = ThreadSettledPayload$1;
|
|
|
18131
18180
|
const ThreadMetaUpdatedPayload = ThreadMetaUpdatedPayload$1;
|
|
18132
18181
|
const ThreadRuntimeModeSetPayload = ThreadRuntimeModeSetPayload$1;
|
|
18133
18182
|
const ThreadInteractionModeSetPayload = ThreadInteractionModeSetPayload$1;
|
|
18183
|
+
const ThreadCompressModeSetPayload = ThreadCompressModeSetPayload$1;
|
|
18134
18184
|
const ThreadDeletedPayload = ThreadDeletedPayload$1;
|
|
18135
18185
|
const ThreadUnarchivedPayload = ThreadUnarchivedPayload$1;
|
|
18136
18186
|
const ThreadUnsettledPayload = ThreadUnsettledPayload$1;
|
|
@@ -18270,6 +18320,7 @@ function projectEvent(model, event) {
|
|
|
18270
18320
|
modelSelection: payload.modelSelection,
|
|
18271
18321
|
runtimeMode: payload.runtimeMode,
|
|
18272
18322
|
interactionMode: payload.interactionMode,
|
|
18323
|
+
compressMode: payload.compressMode,
|
|
18273
18324
|
branch: payload.branch,
|
|
18274
18325
|
worktreePath: payload.worktreePath,
|
|
18275
18326
|
latestTurn: null,
|
|
@@ -18369,6 +18420,13 @@ function projectEvent(model, event) {
|
|
|
18369
18420
|
updatedAt: payload.updatedAt
|
|
18370
18421
|
})
|
|
18371
18422
|
})));
|
|
18423
|
+
case "thread.compress-mode-set": return decodeForEvent(ThreadCompressModeSetPayload, event.payload, event.type, "payload").pipe(Effect.map((payload) => ({
|
|
18424
|
+
...nextBase,
|
|
18425
|
+
threads: updateThread(nextBase.threads, payload.threadId, {
|
|
18426
|
+
compressMode: payload.compressMode,
|
|
18427
|
+
updatedAt: payload.updatedAt
|
|
18428
|
+
})
|
|
18429
|
+
})));
|
|
18372
18430
|
case "thread.message-sent": return Effect.gen(function* () {
|
|
18373
18431
|
const payload = yield* decodeForEvent(MessageSentPayloadSchema, event.payload, event.type, "payload");
|
|
18374
18432
|
const thread = nextBase.threads.find((entry) => entry.id === payload.threadId);
|
|
@@ -18734,6 +18792,7 @@ const decideOrchestrationCommand = Effect.fn("decideOrchestrationCommand")(funct
|
|
|
18734
18792
|
modelSelection: command.modelSelection,
|
|
18735
18793
|
runtimeMode: command.runtimeMode,
|
|
18736
18794
|
interactionMode: command.interactionMode,
|
|
18795
|
+
compressMode: command.compressMode,
|
|
18737
18796
|
branch: command.branch,
|
|
18738
18797
|
worktreePath: command.worktreePath,
|
|
18739
18798
|
createdAt: command.createdAt,
|
|
@@ -18991,6 +19050,28 @@ const decideOrchestrationCommand = Effect.fn("decideOrchestrationCommand")(funct
|
|
|
18991
19050
|
}
|
|
18992
19051
|
};
|
|
18993
19052
|
}
|
|
19053
|
+
case "thread.compress-mode.set": {
|
|
19054
|
+
yield* requireThread({
|
|
19055
|
+
readModel,
|
|
19056
|
+
command,
|
|
19057
|
+
threadId: command.threadId
|
|
19058
|
+
});
|
|
19059
|
+
const occurredAt = yield* nowIso$8;
|
|
19060
|
+
return {
|
|
19061
|
+
...yield* withEventBase({
|
|
19062
|
+
aggregateKind: "thread",
|
|
19063
|
+
aggregateId: command.threadId,
|
|
19064
|
+
occurredAt,
|
|
19065
|
+
commandId: command.commandId
|
|
19066
|
+
}),
|
|
19067
|
+
type: "thread.compress-mode-set",
|
|
19068
|
+
payload: {
|
|
19069
|
+
threadId: command.threadId,
|
|
19070
|
+
compressMode: command.compressMode,
|
|
19071
|
+
updatedAt: occurredAt
|
|
19072
|
+
}
|
|
19073
|
+
};
|
|
19074
|
+
}
|
|
18994
19075
|
case "thread.turn.start": {
|
|
18995
19076
|
const targetThread = yield* requireThread({
|
|
18996
19077
|
readModel,
|
|
@@ -19048,6 +19129,7 @@ const decideOrchestrationCommand = Effect.fn("decideOrchestrationCommand")(funct
|
|
|
19048
19129
|
...command.titleSeed !== void 0 ? { titleSeed: command.titleSeed } : {},
|
|
19049
19130
|
runtimeMode: targetThread.runtimeMode,
|
|
19050
19131
|
interactionMode: targetThread.interactionMode,
|
|
19132
|
+
compressMode: targetThread.compressMode,
|
|
19051
19133
|
...sourceProposedPlan !== void 0 ? { sourceProposedPlan } : {},
|
|
19052
19134
|
createdAt: command.createdAt
|
|
19053
19135
|
}
|
|
@@ -19813,6 +19895,7 @@ const ProjectionThread = Schema$1.Struct({
|
|
|
19813
19895
|
modelSelection: ModelSelection,
|
|
19814
19896
|
runtimeMode: RuntimeMode,
|
|
19815
19897
|
interactionMode: ProviderInteractionMode,
|
|
19898
|
+
compressMode: CompressMode,
|
|
19816
19899
|
branch: Schema$1.NullOr(Schema$1.String),
|
|
19817
19900
|
worktreePath: Schema$1.NullOr(Schema$1.String),
|
|
19818
19901
|
latestTurnId: Schema$1.NullOr(TurnId),
|
|
@@ -20700,6 +20783,7 @@ const makeProjectionThreadRepository = Effect.gen(function* () {
|
|
|
20700
20783
|
model_selection_json,
|
|
20701
20784
|
runtime_mode,
|
|
20702
20785
|
interaction_mode,
|
|
20786
|
+
compress_mode,
|
|
20703
20787
|
branch,
|
|
20704
20788
|
worktree_path,
|
|
20705
20789
|
latest_turn_id,
|
|
@@ -20723,6 +20807,7 @@ const makeProjectionThreadRepository = Effect.gen(function* () {
|
|
|
20723
20807
|
${JSON.stringify(row.modelSelection)},
|
|
20724
20808
|
${row.runtimeMode},
|
|
20725
20809
|
${row.interactionMode},
|
|
20810
|
+
${row.compressMode},
|
|
20726
20811
|
${row.branch},
|
|
20727
20812
|
${row.worktreePath},
|
|
20728
20813
|
${row.latestTurnId},
|
|
@@ -20746,6 +20831,7 @@ const makeProjectionThreadRepository = Effect.gen(function* () {
|
|
|
20746
20831
|
model_selection_json = excluded.model_selection_json,
|
|
20747
20832
|
runtime_mode = excluded.runtime_mode,
|
|
20748
20833
|
interaction_mode = excluded.interaction_mode,
|
|
20834
|
+
compress_mode = excluded.compress_mode,
|
|
20749
20835
|
branch = excluded.branch,
|
|
20750
20836
|
worktree_path = excluded.worktree_path,
|
|
20751
20837
|
latest_turn_id = excluded.latest_turn_id,
|
|
@@ -20774,6 +20860,7 @@ const makeProjectionThreadRepository = Effect.gen(function* () {
|
|
|
20774
20860
|
model_selection_json AS "modelSelection",
|
|
20775
20861
|
runtime_mode AS "runtimeMode",
|
|
20776
20862
|
interaction_mode AS "interactionMode",
|
|
20863
|
+
compress_mode AS "compressMode",
|
|
20777
20864
|
branch,
|
|
20778
20865
|
worktree_path AS "worktreePath",
|
|
20779
20866
|
latest_turn_id AS "latestTurnId",
|
|
@@ -20804,6 +20891,7 @@ const makeProjectionThreadRepository = Effect.gen(function* () {
|
|
|
20804
20891
|
model_selection_json AS "modelSelection",
|
|
20805
20892
|
runtime_mode AS "runtimeMode",
|
|
20806
20893
|
interaction_mode AS "interactionMode",
|
|
20894
|
+
compress_mode AS "compressMode",
|
|
20807
20895
|
branch,
|
|
20808
20896
|
worktree_path AS "worktreePath",
|
|
20809
20897
|
latest_turn_id AS "latestTurnId",
|
|
@@ -21270,6 +21358,7 @@ const makeOrchestrationProjectionPipeline = Effect.fn("makeOrchestrationProjecti
|
|
|
21270
21358
|
modelSelection: event.payload.modelSelection,
|
|
21271
21359
|
runtimeMode: event.payload.runtimeMode,
|
|
21272
21360
|
interactionMode: event.payload.interactionMode,
|
|
21361
|
+
compressMode: event.payload.compressMode,
|
|
21273
21362
|
branch: event.payload.branch,
|
|
21274
21363
|
worktreePath: event.payload.worktreePath,
|
|
21275
21364
|
latestTurnId: null,
|
|
@@ -21384,6 +21473,16 @@ const makeOrchestrationProjectionPipeline = Effect.fn("makeOrchestrationProjecti
|
|
|
21384
21473
|
});
|
|
21385
21474
|
return;
|
|
21386
21475
|
}
|
|
21476
|
+
case "thread.compress-mode-set": {
|
|
21477
|
+
const existingRow = yield* projectionThreadRepository.getById({ threadId: event.payload.threadId });
|
|
21478
|
+
if (Option.isNone(existingRow)) return;
|
|
21479
|
+
yield* projectionThreadRepository.upsert({
|
|
21480
|
+
...existingRow.value,
|
|
21481
|
+
compressMode: event.payload.compressMode,
|
|
21482
|
+
updatedAt: event.payload.updatedAt
|
|
21483
|
+
});
|
|
21484
|
+
return;
|
|
21485
|
+
}
|
|
21387
21486
|
case "thread.deleted": {
|
|
21388
21487
|
attachmentSideEffects.deletedThreadIds.add(event.payload.threadId);
|
|
21389
21488
|
const existingRow = yield* projectionThreadRepository.getById({ threadId: event.payload.threadId });
|
|
@@ -22705,6 +22804,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
22705
22804
|
model_selection_json AS "modelSelection",
|
|
22706
22805
|
runtime_mode AS "runtimeMode",
|
|
22707
22806
|
interaction_mode AS "interactionMode",
|
|
22807
|
+
compress_mode AS "compressMode",
|
|
22708
22808
|
branch,
|
|
22709
22809
|
worktree_path AS "worktreePath",
|
|
22710
22810
|
latest_turn_id AS "latestTurnId",
|
|
@@ -22735,6 +22835,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
22735
22835
|
model_selection_json AS "modelSelection",
|
|
22736
22836
|
runtime_mode AS "runtimeMode",
|
|
22737
22837
|
interaction_mode AS "interactionMode",
|
|
22838
|
+
compress_mode AS "compressMode",
|
|
22738
22839
|
branch,
|
|
22739
22840
|
worktree_path AS "worktreePath",
|
|
22740
22841
|
latest_turn_id AS "latestTurnId",
|
|
@@ -22767,6 +22868,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
22767
22868
|
model_selection_json AS "modelSelection",
|
|
22768
22869
|
runtime_mode AS "runtimeMode",
|
|
22769
22870
|
interaction_mode AS "interactionMode",
|
|
22871
|
+
compress_mode AS "compressMode",
|
|
22770
22872
|
branch,
|
|
22771
22873
|
worktree_path AS "worktreePath",
|
|
22772
22874
|
latest_turn_id AS "latestTurnId",
|
|
@@ -23099,6 +23201,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
23099
23201
|
model_selection_json AS "modelSelection",
|
|
23100
23202
|
runtime_mode AS "runtimeMode",
|
|
23101
23203
|
interaction_mode AS "interactionMode",
|
|
23204
|
+
compress_mode AS "compressMode",
|
|
23102
23205
|
branch,
|
|
23103
23206
|
worktree_path AS "worktreePath",
|
|
23104
23207
|
latest_turn_id AS "latestTurnId",
|
|
@@ -23400,6 +23503,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
23400
23503
|
modelSelection: row.modelSelection,
|
|
23401
23504
|
runtimeMode: row.runtimeMode,
|
|
23402
23505
|
interactionMode: row.interactionMode,
|
|
23506
|
+
compressMode: row.compressMode,
|
|
23403
23507
|
branch: row.branch,
|
|
23404
23508
|
worktreePath: row.worktreePath,
|
|
23405
23509
|
latestTurn: latestTurnByThread.get(row.threadId) ?? null,
|
|
@@ -23511,6 +23615,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
23511
23615
|
modelSelection: row.modelSelection,
|
|
23512
23616
|
runtimeMode: row.runtimeMode,
|
|
23513
23617
|
interactionMode: row.interactionMode,
|
|
23618
|
+
compressMode: row.compressMode,
|
|
23514
23619
|
branch: row.branch,
|
|
23515
23620
|
worktreePath: row.worktreePath,
|
|
23516
23621
|
latestTurn: latestTurnByThread.get(row.threadId) ?? null,
|
|
@@ -23569,6 +23674,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
23569
23674
|
modelSelection: row.modelSelection,
|
|
23570
23675
|
runtimeMode: row.runtimeMode,
|
|
23571
23676
|
interactionMode: row.interactionMode,
|
|
23677
|
+
compressMode: row.compressMode,
|
|
23572
23678
|
branch: row.branch,
|
|
23573
23679
|
worktreePath: row.worktreePath,
|
|
23574
23680
|
latestTurn: latestTurnByThread.get(row.threadId) ?? null,
|
|
@@ -23623,6 +23729,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
23623
23729
|
modelSelection: row.modelSelection,
|
|
23624
23730
|
runtimeMode: row.runtimeMode,
|
|
23625
23731
|
interactionMode: row.interactionMode,
|
|
23732
|
+
compressMode: row.compressMode,
|
|
23626
23733
|
branch: row.branch,
|
|
23627
23734
|
worktreePath: row.worktreePath,
|
|
23628
23735
|
latestTurn: latestTurnByThread.get(row.threadId) ?? null,
|
|
@@ -23713,6 +23820,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
23713
23820
|
modelSelection: threadRow.value.modelSelection,
|
|
23714
23821
|
runtimeMode: threadRow.value.runtimeMode,
|
|
23715
23822
|
interactionMode: threadRow.value.interactionMode,
|
|
23823
|
+
compressMode: threadRow.value.compressMode,
|
|
23716
23824
|
branch: threadRow.value.branch,
|
|
23717
23825
|
worktreePath: threadRow.value.worktreePath,
|
|
23718
23826
|
latestTurn: Option.isSome(latestTurnRow) ? mapLatestTurn(latestTurnRow.value) : null,
|
|
@@ -23748,6 +23856,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
|
|
|
23748
23856
|
modelSelection: threadRow.value.modelSelection,
|
|
23749
23857
|
runtimeMode: threadRow.value.runtimeMode,
|
|
23750
23858
|
interactionMode: threadRow.value.interactionMode,
|
|
23859
|
+
compressMode: threadRow.value.compressMode,
|
|
23751
23860
|
branch: threadRow.value.branch,
|
|
23752
23861
|
worktreePath: threadRow.value.worktreePath,
|
|
23753
23862
|
latestTurn: Option.isSome(latestTurnRow) ? mapLatestTurn(latestTurnRow.value) : null,
|
|
@@ -27101,6 +27210,7 @@ const resolveAutoBootstrapWelcomeTargets = Effect.gen(function* () {
|
|
|
27101
27210
|
title: "New thread",
|
|
27102
27211
|
modelSelection: nextProjectDefaultModelSelection,
|
|
27103
27212
|
interactionMode: DEFAULT_PROVIDER_INTERACTION_MODE,
|
|
27213
|
+
compressMode: "off",
|
|
27104
27214
|
runtimeMode: "full-access",
|
|
27105
27215
|
branch: null,
|
|
27106
27216
|
worktreePath: null,
|
|
@@ -43521,6 +43631,7 @@ const makeWsRpcLayer = (currentSession, previewAutomationBroker) => WsRpcGroup.t
|
|
|
43521
43631
|
modelSelection: bootstrap.createThread.modelSelection,
|
|
43522
43632
|
runtimeMode: bootstrap.createThread.runtimeMode,
|
|
43523
43633
|
interactionMode: bootstrap.createThread.interactionMode,
|
|
43634
|
+
compressMode: bootstrap.createThread.compressMode,
|
|
43524
43635
|
branch: bootstrap.createThread.branch,
|
|
43525
43636
|
worktreePath: bootstrap.createThread.worktreePath,
|
|
43526
43637
|
createdAt: bootstrap.createThread.createdAt
|
|
@@ -43784,12 +43895,14 @@ const makeWsRpcLayer = (currentSession, previewAutomationBroker) => WsRpcGroup.t
|
|
|
43784
43895
|
titleSeed: threadTitle,
|
|
43785
43896
|
runtimeMode: DEFAULT_RUNTIME_MODE$2,
|
|
43786
43897
|
interactionMode: DEFAULT_PROVIDER_INTERACTION_MODE,
|
|
43898
|
+
compressMode: "off",
|
|
43787
43899
|
bootstrap: { createThread: {
|
|
43788
43900
|
projectId: plan.projectId,
|
|
43789
43901
|
title: threadTitle,
|
|
43790
43902
|
modelSelection,
|
|
43791
43903
|
runtimeMode: DEFAULT_RUNTIME_MODE$2,
|
|
43792
43904
|
interactionMode: DEFAULT_PROVIDER_INTERACTION_MODE,
|
|
43905
|
+
compressMode: "off",
|
|
43793
43906
|
branch: null,
|
|
43794
43907
|
worktreePath: null,
|
|
43795
43908
|
createdAt
|
|
@@ -47857,6 +47970,88 @@ function formatAskUserQuestionAnswers(answers) {
|
|
|
47857
47970
|
return formatted;
|
|
47858
47971
|
}
|
|
47859
47972
|
//#endregion
|
|
47973
|
+
//#region src/provider/CompressPrompts.ts
|
|
47974
|
+
/**
|
|
47975
|
+
* Caveman-style response compression rulesets, adapted from the caveman
|
|
47976
|
+
* plugin's SKILL.md. Pre-baked per level so injection is a lookup, not a
|
|
47977
|
+
* runtime template. Applies to assistant prose only: code blocks, commits,
|
|
47978
|
+
* PRs, error strings, and safety-critical text stay uncompressed.
|
|
47979
|
+
*/
|
|
47980
|
+
const COMPRESS_SHARED_RULES = `Respond terse. All technical substance stays. Only fluff dies.
|
|
47981
|
+
|
|
47982
|
+
## Persistence
|
|
47983
|
+
|
|
47984
|
+
Active every response. No revert after many turns. No filler drift. Still active if unsure.
|
|
47985
|
+
|
|
47986
|
+
## Rules
|
|
47987
|
+
|
|
47988
|
+
Drop filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Short synonyms (big not extensive, fix not "implement a solution for"). No tool-call narration, no decorative tables/emoji, no dumping long raw error logs unless asked - quote shortest decisive line. Standard well-known tech acronyms OK (DB/API/HTTP); never invent new abbreviations (cfg/impl/req/res/fn) - tokenizers split them same as the full word: zero tokens saved, reader still decodes. No causal arrows (->) in prose. Technical terms exact. Code blocks unchanged. Errors quoted exact.
|
|
47989
|
+
|
|
47990
|
+
Preserve the user's dominant language: compress the style, not the language. Always keep technical terms, code, API names, CLI commands, commit-type keywords (feat/fix/...), and exact error strings verbatim unless the user explicitly asks for translation.
|
|
47991
|
+
|
|
47992
|
+
No self-reference. Never name or announce the style. No compressed answer plus normal recap - compressed output only. Exception: user explicitly asks what the mode is.
|
|
47993
|
+
|
|
47994
|
+
## Auto-Clarity
|
|
47995
|
+
|
|
47996
|
+
Drop compression and write normally when:
|
|
47997
|
+
- Security warnings
|
|
47998
|
+
- Irreversible action confirmations
|
|
47999
|
+
- Multi-step sequences where fragment order or omitted conjunctions risk misread
|
|
48000
|
+
- Compression itself creates technical ambiguity
|
|
48001
|
+
- User asks to clarify or repeats a question
|
|
48002
|
+
|
|
48003
|
+
Resume compression after the clear part is done.
|
|
48004
|
+
|
|
48005
|
+
## Boundaries
|
|
48006
|
+
|
|
48007
|
+
Code, commit messages, and PR descriptions: write normal, uncompressed.`;
|
|
48008
|
+
const COMPRESS_RULESETS = {
|
|
48009
|
+
lite: `## Response compression: lite
|
|
48010
|
+
|
|
48011
|
+
${COMPRESS_SHARED_RULES}
|
|
48012
|
+
|
|
48013
|
+
## Intensity: lite
|
|
48014
|
+
|
|
48015
|
+
No filler or hedging. Keep articles and full sentences. Professional but tight.
|
|
48016
|
+
|
|
48017
|
+
Example - "Why does my React component re-render?"
|
|
48018
|
+
"Your component re-renders because you create a new object reference each render. Wrap it in \`useMemo\`."`,
|
|
48019
|
+
full: `## Response compression: full
|
|
48020
|
+
|
|
48021
|
+
${COMPRESS_SHARED_RULES}
|
|
48022
|
+
|
|
48023
|
+
## Intensity: full
|
|
48024
|
+
|
|
48025
|
+
Drop articles (a/an/the), fragments OK, short synonyms. Pattern: [thing] [action] [reason]. [next step].
|
|
48026
|
+
|
|
48027
|
+
Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
|
|
48028
|
+
Yes: "Bug in auth middleware. Token expiry check use \`<\` not \`<=\`. Fix:"
|
|
48029
|
+
|
|
48030
|
+
Example - "Why does my React component re-render?"
|
|
48031
|
+
"New object ref each render. Inline object prop = new ref = re-render. Wrap in \`useMemo\`."`,
|
|
48032
|
+
ultra: `## Response compression: ultra
|
|
48033
|
+
|
|
48034
|
+
${COMPRESS_SHARED_RULES}
|
|
48035
|
+
|
|
48036
|
+
## Intensity: ultra
|
|
48037
|
+
|
|
48038
|
+
Drop articles, fragments OK, short synonyms. Also strip conjunctions when cause-then-effect stays unambiguous. One word when one word is enough. State each fact once. Code symbols, function names, API names, error strings: never touch.
|
|
48039
|
+
|
|
48040
|
+
Example - "Why does my React component re-render?"
|
|
48041
|
+
"Inline object prop, new ref, re-render. \`useMemo\`."`
|
|
48042
|
+
};
|
|
48043
|
+
const COMPRESS_TURN_REMINDERS = {
|
|
48044
|
+
lite: "[response style: compressed lite - no filler/hedging, full sentences; code/commits/security text normal]",
|
|
48045
|
+
full: "[response style: compressed full - terse fragments, drop articles/filler; code/commits/security text normal]",
|
|
48046
|
+
ultra: "[response style: compressed ultra - maximum terseness, one word when enough; code/commits/security text normal]"
|
|
48047
|
+
};
|
|
48048
|
+
function compressRulesetFor(mode) {
|
|
48049
|
+
return mode === "off" ? void 0 : COMPRESS_RULESETS[mode];
|
|
48050
|
+
}
|
|
48051
|
+
function compressTurnReminderFor(mode) {
|
|
48052
|
+
return mode === "off" ? void 0 : COMPRESS_TURN_REMINDERS[mode];
|
|
48053
|
+
}
|
|
48054
|
+
//#endregion
|
|
47860
48055
|
//#region src/provider/Layers/ClaudeAdapter.ts
|
|
47861
48056
|
/**
|
|
47862
48057
|
* ClaudeAdapterLive - Scoped live implementation for the Claude Agent provider adapter.
|
|
@@ -50246,6 +50441,8 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (claudeSettin
|
|
|
50246
50441
|
const mcpSession = readMcpProviderSession(input.threadId);
|
|
50247
50442
|
const externalMcpServers = options?.resolveMcpServers === void 0 ? {} : yield* options.resolveMcpServers;
|
|
50248
50443
|
const narrateBeforeTools = options?.resolveToolCallNarration === void 0 ? DEFAULT_SERVER_SETTINGS.enableToolCallNarration : yield* options.resolveToolCallNarration;
|
|
50444
|
+
const compressRuleset = compressRulesetFor(input.compressMode ?? "off");
|
|
50445
|
+
const systemPromptAppend = [...narrateBeforeTools ? [NARRATE_BEFORE_TOOLS_PROMPT] : [], ...compressRuleset !== void 0 ? [compressRuleset] : []].join("\n\n");
|
|
50249
50446
|
const queryOptions = {
|
|
50250
50447
|
...input.cwd ? { cwd: input.cwd } : {},
|
|
50251
50448
|
...apiModelId ? { model: apiModelId } : {},
|
|
@@ -50253,7 +50450,7 @@ const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (claudeSettin
|
|
|
50253
50450
|
systemPrompt: {
|
|
50254
50451
|
type: "preset",
|
|
50255
50452
|
preset: "claude_code",
|
|
50256
|
-
...
|
|
50453
|
+
...systemPromptAppend.length > 0 ? { append: systemPromptAppend } : {}
|
|
50257
50454
|
},
|
|
50258
50455
|
settingSources: [...CLAUDE_SETTING_SOURCES],
|
|
50259
50456
|
...effectiveEffort ? { effort: effectiveEffort } : {},
|
|
@@ -69563,8 +69760,12 @@ ${P4_CODE_BROWSER_TOOL_INSTRUCTIONS}
|
|
|
69563
69760
|
function toSingleLine(value) {
|
|
69564
69761
|
return value.replaceAll(/\s+/g, " ").trim();
|
|
69565
69762
|
}
|
|
69566
|
-
function buildCodexDeveloperInstructions(interactionMode, runtime) {
|
|
69567
|
-
|
|
69763
|
+
function buildCodexDeveloperInstructions(interactionMode, runtime, compressMode) {
|
|
69764
|
+
const base = interactionMode === "plan" ? CODEX_PLAN_MODE_DEVELOPER_INSTRUCTIONS : CODEX_DEFAULT_MODE_DEVELOPER_INSTRUCTIONS;
|
|
69765
|
+
const compressRuleset = compressRulesetFor(compressMode ?? "off");
|
|
69766
|
+
return `${base}${compressRuleset === void 0 ? "" : `
|
|
69767
|
+
|
|
69768
|
+
<response_style>${compressRuleset}</response_style>`}
|
|
69568
69769
|
|
|
69569
69770
|
<runtime_info>In case you're asked: you are running in P4Code through the Codex harness, as ${toSingleLine(runtime.model)} with ${toSingleLine(runtime.reasoningEffort)} reasoning effort. No need to mention this otherwise.</runtime_info>`;
|
|
69570
69771
|
}
|
|
@@ -69682,7 +69883,7 @@ function buildCodexCollaborationMode(input) {
|
|
|
69682
69883
|
developer_instructions: buildCodexDeveloperInstructions(input.interactionMode, {
|
|
69683
69884
|
model,
|
|
69684
69885
|
reasoningEffort
|
|
69685
|
-
})
|
|
69886
|
+
}, input.compressMode)
|
|
69686
69887
|
}
|
|
69687
69888
|
};
|
|
69688
69889
|
}
|
|
@@ -69696,6 +69897,7 @@ function buildTurnStartParams(input) {
|
|
|
69696
69897
|
const config = runtimeModeToThreadConfig(input.runtimeMode);
|
|
69697
69898
|
const collaborationMode = buildCodexCollaborationMode({
|
|
69698
69899
|
...input.interactionMode ? { interactionMode: input.interactionMode } : {},
|
|
69900
|
+
...input.compressMode ? { compressMode: input.compressMode } : {},
|
|
69699
69901
|
...input.model ? { model: input.model } : {},
|
|
69700
69902
|
...input.effort ? { effort: input.effort } : {}
|
|
69701
69903
|
});
|
|
@@ -70234,7 +70436,8 @@ const makeCodexSessionRuntime = (options) => Effect.gen(function* () {
|
|
|
70234
70436
|
...normalizedModel ? { model: normalizedModel } : {},
|
|
70235
70437
|
...input.serviceTier ? { serviceTier: input.serviceTier } : {},
|
|
70236
70438
|
...input.effort ? { effort: input.effort } : {},
|
|
70237
|
-
...input.interactionMode ? { interactionMode: input.interactionMode } : {}
|
|
70439
|
+
...input.interactionMode ? { interactionMode: input.interactionMode } : {},
|
|
70440
|
+
...input.compressMode ? { compressMode: input.compressMode } : {}
|
|
70238
70441
|
});
|
|
70239
70442
|
const rawResponse = yield* client.raw.request("turn/start", params);
|
|
70240
70443
|
const response = yield* decodeV2TurnStartResponse(rawResponse).pipe(Effect.mapError((error) => CodexAppServerProtocolParseError.fromSchemaError("decode-response-payload", error, { method: "turn/start" })));
|
|
@@ -71226,6 +71429,7 @@ const makeCodexAdapter = Effect.fn("makeCodexAdapter")(function* (codexConfig, o
|
|
|
71226
71429
|
...reasoningEffort ? { effort: reasoningEffort } : {},
|
|
71227
71430
|
...serviceTier ? { serviceTier } : {},
|
|
71228
71431
|
...input.interactionMode !== void 0 ? { interactionMode: input.interactionMode } : {},
|
|
71432
|
+
...input.compressMode !== void 0 ? { compressMode: input.compressMode } : {},
|
|
71229
71433
|
...codexAttachments.length > 0 ? { attachments: codexAttachments } : {}
|
|
71230
71434
|
}).pipe(Effect.mapError((cause) => mapCodexRuntimeError(input.threadId, "turn/start", cause)));
|
|
71231
71435
|
});
|
|
@@ -83877,7 +84081,8 @@ const make$2 = Effect.gen(function* () {
|
|
|
83877
84081
|
...effectiveCwd ? { cwd: effectiveCwd } : {},
|
|
83878
84082
|
modelSelection: desiredModelSelection,
|
|
83879
84083
|
...input?.resumeCursor !== void 0 ? { resumeCursor: input.resumeCursor } : {},
|
|
83880
|
-
runtimeMode: desiredRuntimeMode
|
|
84084
|
+
runtimeMode: desiredRuntimeMode,
|
|
84085
|
+
compressMode: thread.compressMode
|
|
83881
84086
|
});
|
|
83882
84087
|
const bindSessionToThread = (session) => Effect.gen(function* () {
|
|
83883
84088
|
if (session.providerInstanceId === void 0) return yield* new ProviderAdapterRequestError({
|
|
@@ -83950,6 +84155,7 @@ const make$2 = Effect.gen(function* () {
|
|
|
83950
84155
|
const buildSendTurnRequestForThread = Effect.fnUntraced(function* (input) {
|
|
83951
84156
|
const thread = yield* resolveThread(input.threadId);
|
|
83952
84157
|
if (!thread) return yield* Effect.die(/* @__PURE__ */ new Error(`Thread '${input.threadId}' was not found in read model.`));
|
|
84158
|
+
const hadActiveSession = thread.session !== null && thread.session.status !== "stopped";
|
|
83953
84159
|
yield* ensureSessionForThread(input.threadId, input.createdAt, {
|
|
83954
84160
|
...input.modelSelection !== void 0 ? { modelSelection: input.modelSelection } : {},
|
|
83955
84161
|
pendingTurnStart: true
|
|
@@ -83968,12 +84174,17 @@ const make$2 = Effect.gen(function* () {
|
|
|
83968
84174
|
...requestedModelSelection,
|
|
83969
84175
|
model: activeSession.model
|
|
83970
84176
|
} : requestedModelSelection : input.modelSelection;
|
|
84177
|
+
const compressMode = thread.compressMode;
|
|
84178
|
+
const hasSessionLevelRuleset = activeSession?.provider === "claudeAgent" || activeSession?.provider === "codex";
|
|
84179
|
+
const compressPrefix = !hadActiveSession && !hasSessionLevelRuleset ? compressRulesetFor(compressMode) : compressTurnReminderFor(compressMode);
|
|
84180
|
+
const inputWithCompressPrefix = normalizedInput !== void 0 && compressPrefix !== void 0 ? `${compressPrefix}\n\n${normalizedInput}` : normalizedInput;
|
|
83971
84181
|
return {
|
|
83972
84182
|
threadId: input.threadId,
|
|
83973
|
-
...
|
|
84183
|
+
...inputWithCompressPrefix ? { input: inputWithCompressPrefix } : {},
|
|
83974
84184
|
...normalizedAttachments.length > 0 ? { attachments: normalizedAttachments } : {},
|
|
83975
84185
|
...modelForTurn !== void 0 ? { modelSelection: modelForTurn } : {},
|
|
83976
|
-
...input.interactionMode !== void 0 ? { interactionMode: input.interactionMode } : {}
|
|
84186
|
+
...input.interactionMode !== void 0 ? { interactionMode: input.interactionMode } : {},
|
|
84187
|
+
compressMode
|
|
83977
84188
|
};
|
|
83978
84189
|
});
|
|
83979
84190
|
const maybeGenerateAndRenameWorktreeBranchForFirstTurn = Effect.fn("maybeGenerateAndRenameWorktreeBranchForFirstTurn")(function* (input) {
|