@cmmd-center/forge 0.13.95 → 0.13.97
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/{BunHttpServer-DTG5XWSi.cjs → BunHttpServer-CtFGbsWr.cjs} +2 -2
- package/dist/{BunHttpServer-BpaVqxli.mjs → BunHttpServer-o7ISooSQ.mjs} +2 -2
- package/dist/{HttpServer-5UTabe01.mjs → HttpServer-BbbI8N6_.mjs} +79 -39
- package/dist/{HttpServer-DZ6iaxyk.cjs → HttpServer-CRBqMWdP.cjs} +47 -1
- package/dist/{NodeHttpServer-DePOzmYy.mjs → NodeHttpServer-BngJqAIT.mjs} +2 -2
- package/dist/{NodeHttpServer-RV5QsVeb.cjs → NodeHttpServer-DyI6OyMg.cjs} +2 -2
- package/dist/bin.cjs +781 -406
- package/dist/bin.mjs +891 -516
- package/dist/client/assets/{DiffPanel-CAkf79MN.js → DiffPanel-CYrraC28.js} +2 -2
- package/dist/client/assets/{DiffPanel.logic-B9IU5Q5Q.js → DiffPanel.logic-DyXOs7eK.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-BaJzbqHW.js → DiffWorkerPoolProvider-DMt6DknG.js} +2 -2
- package/dist/client/assets/{PullRequestCodePanel-ItXVNv0A.js → PullRequestCodePanel-CgjWVTVM.js} +2 -2
- package/dist/client/assets/{Virtualizer-D6N688Z0.js → Virtualizer-D0TQdce0.js} +2 -2
- package/dist/client/assets/{WorkerPoolContext-Q7KzTxot.js → WorkerPoolContext-DkMo0hso.js} +4 -4
- package/dist/client/assets/{index-CuTM56F9.js → index-CzgrA9VN.js} +6 -6
- package/dist/client/index.html +4 -4
- package/dist/forge-build.json +1 -1
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -6,7 +6,7 @@ const require_Schema$1 = require("./Schema-DxddW8-V.cjs");
|
|
|
6
6
|
const require_Path = require("./Path-Dp3btyUm.cjs");
|
|
7
7
|
const require_NodeTerminal = require("./NodeTerminal-DQESKR0W.cjs");
|
|
8
8
|
const require_NodeServices = require("./NodeServices-BkfWZHfh.cjs");
|
|
9
|
-
const require_HttpServer = require("./HttpServer-
|
|
9
|
+
const require_HttpServer = require("./HttpServer-CRBqMWdP.cjs");
|
|
10
10
|
const require_Config = require("./Config-pbf0GGHJ.cjs");
|
|
11
11
|
const require_Cache = require("./Cache-D-JaJz5Q.cjs");
|
|
12
12
|
const require_SqlError = require("./SqlError-BqOsoG0V.cjs");
|
|
@@ -14765,7 +14765,7 @@ const isCommand = (u) => require_Schema$1.hasProperty(u, TypeId$10);
|
|
|
14765
14765
|
* @since 4.0.0
|
|
14766
14766
|
* @category constructors
|
|
14767
14767
|
*/
|
|
14768
|
-
const make$
|
|
14768
|
+
const make$33 = (name, config, handler) => {
|
|
14769
14769
|
return makeCommand({
|
|
14770
14770
|
name,
|
|
14771
14771
|
config: parseConfig(config ?? {}),
|
|
@@ -15282,7 +15282,7 @@ require_Schema$1.LogToStderr;
|
|
|
15282
15282
|
* @since 2.0.0
|
|
15283
15283
|
* @category constructors
|
|
15284
15284
|
*/
|
|
15285
|
-
const make$
|
|
15285
|
+
const make$32 = require_Schema$1.loggerMake;
|
|
15286
15286
|
require_Schema$1.defaultLogger;
|
|
15287
15287
|
require_Schema$1.formatJson;
|
|
15288
15288
|
/**
|
|
@@ -15580,7 +15580,7 @@ const makeUnsafe$2 = (value) => {
|
|
|
15580
15580
|
* @since 2.0.0
|
|
15581
15581
|
* @category constructors
|
|
15582
15582
|
*/
|
|
15583
|
-
const make$
|
|
15583
|
+
const make$31 = (value) => require_Schema$1.sync(() => makeUnsafe$2(value));
|
|
15584
15584
|
/**
|
|
15585
15585
|
* @since 2.0.0
|
|
15586
15586
|
* @category getters
|
|
@@ -15650,7 +15650,7 @@ const TypeId$8 = "~effect/transactions/TxRef";
|
|
|
15650
15650
|
* })
|
|
15651
15651
|
* ```
|
|
15652
15652
|
*/
|
|
15653
|
-
const make$
|
|
15653
|
+
const make$30 = (initial) => require_Schema$1.sync(() => makeUnsafe$1(initial));
|
|
15654
15654
|
/**
|
|
15655
15655
|
* Creates a new `TxRef` with the specified initial value.
|
|
15656
15656
|
*
|
|
@@ -15833,7 +15833,7 @@ const TxChunkProto = {
|
|
|
15833
15833
|
* })
|
|
15834
15834
|
* ```
|
|
15835
15835
|
*/
|
|
15836
|
-
const empty = () => require_Schema$1.map(make$
|
|
15836
|
+
const empty = () => require_Schema$1.map(make$30(require_Schema$1.empty()), (ref) => makeUnsafe(ref));
|
|
15837
15837
|
/**
|
|
15838
15838
|
* Creates a new `TxChunk` with the specified TxRef.
|
|
15839
15839
|
*
|
|
@@ -16125,7 +16125,7 @@ const TxQueueProto = {
|
|
|
16125
16125
|
*/
|
|
16126
16126
|
const unbounded = () => require_Schema$1.gen(function* () {
|
|
16127
16127
|
const items = yield* empty();
|
|
16128
|
-
const stateRef = yield* make$
|
|
16128
|
+
const stateRef = yield* make$30({ _tag: "Open" });
|
|
16129
16129
|
const txQueue = Object.create(TxQueueProto);
|
|
16130
16130
|
txQueue.strategy = "unbounded";
|
|
16131
16131
|
txQueue.capacity = Number.POSITIVE_INFINITY;
|
|
@@ -25470,7 +25470,7 @@ const makeProto$1 = (options) => {
|
|
|
25470
25470
|
* @since 4.0.0
|
|
25471
25471
|
* @category constructors
|
|
25472
25472
|
*/
|
|
25473
|
-
const make$
|
|
25473
|
+
const make$29 = (tag, options) => {
|
|
25474
25474
|
const successSchema = options?.success ?? require_Schema$1.Void;
|
|
25475
25475
|
const errorSchema = options?.error ?? require_Schema$1.Never;
|
|
25476
25476
|
const defectSchema = options?.defect ?? require_Schema$1.Defect;
|
|
@@ -25642,7 +25642,7 @@ const makeProto = (options) => Object.assign(function() {}, RpcGroupProto, {
|
|
|
25642
25642
|
* @since 4.0.0
|
|
25643
25643
|
* @category groups
|
|
25644
25644
|
*/
|
|
25645
|
-
const make$
|
|
25645
|
+
const make$28 = (...rpcs) => makeProto({
|
|
25646
25646
|
requests: new Map(rpcs.map((rpc) => [rpc._tag, rpc])),
|
|
25647
25647
|
annotations: require_Schema$1.empty$4()
|
|
25648
25648
|
});
|
|
@@ -26374,319 +26374,319 @@ const WS_METHODS = {
|
|
|
26374
26374
|
attachmentsDelete: "attachments.delete",
|
|
26375
26375
|
providerUploadFeedback: "provider.uploadFeedback"
|
|
26376
26376
|
};
|
|
26377
|
-
const WsServerUpsertKeybindingRpc = make$
|
|
26377
|
+
const WsServerUpsertKeybindingRpc = make$29(WS_METHODS.serverUpsertKeybinding, {
|
|
26378
26378
|
payload: ServerUpsertKeybindingInput,
|
|
26379
26379
|
success: ServerUpsertKeybindingResult,
|
|
26380
26380
|
error: KeybindingsConfigError
|
|
26381
26381
|
});
|
|
26382
|
-
const WsServerRemoveKeybindingRpc = make$
|
|
26382
|
+
const WsServerRemoveKeybindingRpc = make$29(WS_METHODS.serverRemoveKeybinding, {
|
|
26383
26383
|
payload: ServerRemoveKeybindingInput,
|
|
26384
26384
|
success: ServerRemoveKeybindingResult,
|
|
26385
26385
|
error: KeybindingsConfigError
|
|
26386
26386
|
});
|
|
26387
|
-
const WsServerGetConfigRpc = make$
|
|
26387
|
+
const WsServerGetConfigRpc = make$29(WS_METHODS.serverGetConfig, {
|
|
26388
26388
|
payload: require_Schema$1.Struct({}),
|
|
26389
26389
|
success: ServerConfig$1,
|
|
26390
26390
|
error: require_Schema$1.Union([KeybindingsConfigError, ServerSettingsError])
|
|
26391
26391
|
});
|
|
26392
|
-
const WsServerRefreshProvidersRpc = make$
|
|
26392
|
+
const WsServerRefreshProvidersRpc = make$29(WS_METHODS.serverRefreshProviders, {
|
|
26393
26393
|
payload: require_Schema$1.Struct({}),
|
|
26394
26394
|
success: ServerProviderUpdatedPayload
|
|
26395
26395
|
});
|
|
26396
|
-
const WsServerStartProviderAuthRpc = make$
|
|
26396
|
+
const WsServerStartProviderAuthRpc = make$29(WS_METHODS.serverStartProviderAuth, {
|
|
26397
26397
|
payload: ProviderAuthStartInput,
|
|
26398
26398
|
success: ProviderAuthSession
|
|
26399
26399
|
});
|
|
26400
|
-
const WsServerRepairProviderAuthRuntimeRpc = make$
|
|
26400
|
+
const WsServerRepairProviderAuthRuntimeRpc = make$29(WS_METHODS.serverRepairProviderAuthRuntime, {
|
|
26401
26401
|
payload: ProviderAuthRuntimeRepairInput,
|
|
26402
26402
|
success: ProviderAuthRuntimeRepairResult
|
|
26403
26403
|
});
|
|
26404
|
-
const WsServerDisconnectProviderAuthRpc = make$
|
|
26404
|
+
const WsServerDisconnectProviderAuthRpc = make$29(WS_METHODS.serverDisconnectProviderAuth, {
|
|
26405
26405
|
payload: ProviderAuthDisconnectInput,
|
|
26406
26406
|
success: ServerProviderUpdatedPayload
|
|
26407
26407
|
});
|
|
26408
|
-
const WsServerGetProviderAuthSessionRpc = make$
|
|
26408
|
+
const WsServerGetProviderAuthSessionRpc = make$29(WS_METHODS.serverGetProviderAuthSession, {
|
|
26409
26409
|
payload: ProviderAuthSessionInput,
|
|
26410
26410
|
success: ProviderAuthSession
|
|
26411
26411
|
});
|
|
26412
|
-
const WsServerCancelProviderAuthRpc = make$
|
|
26412
|
+
const WsServerCancelProviderAuthRpc = make$29(WS_METHODS.serverCancelProviderAuth, {
|
|
26413
26413
|
payload: ProviderAuthSessionInput,
|
|
26414
26414
|
success: ProviderAuthSession
|
|
26415
26415
|
});
|
|
26416
|
-
const WsServerSubmitProviderAuthCodeRpc = make$
|
|
26416
|
+
const WsServerSubmitProviderAuthCodeRpc = make$29(WS_METHODS.serverSubmitProviderAuthCode, {
|
|
26417
26417
|
payload: ProviderAuthSubmitCodeInput,
|
|
26418
26418
|
success: ProviderAuthSession
|
|
26419
26419
|
});
|
|
26420
|
-
const WsServerSyncPersonalCodexToCloudRpc = make$
|
|
26420
|
+
const WsServerSyncPersonalCodexToCloudRpc = make$29(WS_METHODS.serverSyncPersonalCodexToCloud, {
|
|
26421
26421
|
payload: ProviderCredentialCloudSyncInput,
|
|
26422
26422
|
success: ProviderCredentialCloudSyncResult
|
|
26423
26423
|
});
|
|
26424
|
-
const WsServerSyncPersonalClaudeToCloudRpc = make$
|
|
26424
|
+
const WsServerSyncPersonalClaudeToCloudRpc = make$29(WS_METHODS.serverSyncPersonalClaudeToCloud, {
|
|
26425
26425
|
payload: ProviderCredentialCloudSyncInput,
|
|
26426
26426
|
success: ProviderCredentialCloudSyncResult
|
|
26427
26427
|
});
|
|
26428
|
-
const WsServerGetSettingsRpc = make$
|
|
26428
|
+
const WsServerGetSettingsRpc = make$29(WS_METHODS.serverGetSettings, {
|
|
26429
26429
|
payload: require_Schema$1.Struct({}),
|
|
26430
26430
|
success: ServerSettings,
|
|
26431
26431
|
error: ServerSettingsError
|
|
26432
26432
|
});
|
|
26433
|
-
const WsServerUpdateSettingsRpc = make$
|
|
26433
|
+
const WsServerUpdateSettingsRpc = make$29(WS_METHODS.serverUpdateSettings, {
|
|
26434
26434
|
payload: require_Schema$1.Struct({ patch: ServerSettingsPatch }),
|
|
26435
26435
|
success: ServerSettings,
|
|
26436
26436
|
error: ServerSettingsError
|
|
26437
26437
|
});
|
|
26438
|
-
const WsServerUpdateEnvironmentDisplayNameRpc = make$
|
|
26438
|
+
const WsServerUpdateEnvironmentDisplayNameRpc = make$29(WS_METHODS.serverUpdateEnvironmentDisplayName, {
|
|
26439
26439
|
payload: ServerEnvironmentDisplayNameUpdateInput,
|
|
26440
26440
|
success: ServerEnvironmentDisplayNameUpdateResult
|
|
26441
26441
|
});
|
|
26442
|
-
const WsServerTraceDiagnosticsRpc = make$
|
|
26442
|
+
const WsServerTraceDiagnosticsRpc = make$29(WS_METHODS.serverGetTraceDiagnostics, {
|
|
26443
26443
|
payload: require_Schema$1.Struct({ slowSpanThresholdMs: require_Schema$1.optionalKey(NonNegativeInt) }),
|
|
26444
26444
|
success: ServerTraceDiagnosticsResult
|
|
26445
26445
|
});
|
|
26446
|
-
const WsServerHeartbeatRpc = make$
|
|
26446
|
+
const WsServerHeartbeatRpc = make$29(WS_METHODS.serverHeartbeat, {
|
|
26447
26447
|
payload: require_Schema$1.Struct({}),
|
|
26448
26448
|
success: require_Schema$1.Struct({})
|
|
26449
26449
|
});
|
|
26450
26450
|
const PullRequestRpcError = require_Schema$1.Union([PullRequestUnavailableError, PullRequestOperationError]);
|
|
26451
|
-
const WsPullRequestsListRpc = make$
|
|
26451
|
+
const WsPullRequestsListRpc = make$29(WS_METHODS.pullRequestsList, {
|
|
26452
26452
|
payload: PullRequestListInput,
|
|
26453
26453
|
success: PullRequestListResult,
|
|
26454
26454
|
error: PullRequestRpcError
|
|
26455
26455
|
});
|
|
26456
|
-
const WsPullRequestsListStatsRpc = make$
|
|
26456
|
+
const WsPullRequestsListStatsRpc = make$29(WS_METHODS.pullRequestsListStats, {
|
|
26457
26457
|
payload: PullRequestListStatsInput,
|
|
26458
26458
|
success: PullRequestListStatsResult,
|
|
26459
26459
|
error: PullRequestRpcError
|
|
26460
26460
|
});
|
|
26461
|
-
const WsPullRequestsDetailRpc = make$
|
|
26461
|
+
const WsPullRequestsDetailRpc = make$29(WS_METHODS.pullRequestsDetail, {
|
|
26462
26462
|
payload: PullRequestRef,
|
|
26463
26463
|
success: PullRequestDetail,
|
|
26464
26464
|
error: PullRequestRpcError
|
|
26465
26465
|
});
|
|
26466
|
-
const WsPullRequestsActivityRpc = make$
|
|
26466
|
+
const WsPullRequestsActivityRpc = make$29(WS_METHODS.pullRequestsActivity, {
|
|
26467
26467
|
payload: PullRequestRef,
|
|
26468
26468
|
success: PullRequestActivity,
|
|
26469
26469
|
error: PullRequestRpcError
|
|
26470
26470
|
});
|
|
26471
|
-
const WsPullRequestsThreadCommentsRpc = make$
|
|
26471
|
+
const WsPullRequestsThreadCommentsRpc = make$29(WS_METHODS.pullRequestsThreadComments, {
|
|
26472
26472
|
payload: PullRequestThreadCommentsInput,
|
|
26473
26473
|
success: PullRequestThreadCommentsResult,
|
|
26474
26474
|
error: PullRequestRpcError
|
|
26475
26475
|
});
|
|
26476
|
-
const WsPullRequestsDiffFileContentsRpc = make$
|
|
26476
|
+
const WsPullRequestsDiffFileContentsRpc = make$29(WS_METHODS.pullRequestsDiffFileContents, {
|
|
26477
26477
|
payload: PullRequestDiffFileContentsInput,
|
|
26478
26478
|
success: PullRequestDiffFileContentsResult,
|
|
26479
26479
|
error: PullRequestRpcError
|
|
26480
26480
|
});
|
|
26481
|
-
const WsPullRequestsRunActionRpc = make$
|
|
26481
|
+
const WsPullRequestsRunActionRpc = make$29(WS_METHODS.pullRequestsRunAction, {
|
|
26482
26482
|
payload: PullRequestActionInput,
|
|
26483
26483
|
success: require_Schema$1.Void,
|
|
26484
26484
|
error: PullRequestRpcError
|
|
26485
26485
|
});
|
|
26486
|
-
const WsPullRequestsUpdateRpc = make$
|
|
26486
|
+
const WsPullRequestsUpdateRpc = make$29(WS_METHODS.pullRequestsUpdate, {
|
|
26487
26487
|
payload: PullRequestUpdateInput,
|
|
26488
26488
|
success: require_Schema$1.Void,
|
|
26489
26489
|
error: PullRequestRpcError
|
|
26490
26490
|
});
|
|
26491
|
-
const WsPullRequestsCommentRpc = make$
|
|
26491
|
+
const WsPullRequestsCommentRpc = make$29(WS_METHODS.pullRequestsComment, {
|
|
26492
26492
|
payload: PullRequestCommentInput,
|
|
26493
26493
|
success: require_Schema$1.Void,
|
|
26494
26494
|
error: PullRequestRpcError
|
|
26495
26495
|
});
|
|
26496
|
-
const WsPullRequestsUpdateCommentRpc = make$
|
|
26496
|
+
const WsPullRequestsUpdateCommentRpc = make$29(WS_METHODS.pullRequestsUpdateComment, {
|
|
26497
26497
|
payload: PullRequestCommentUpdateInput,
|
|
26498
26498
|
success: require_Schema$1.Void,
|
|
26499
26499
|
error: PullRequestRpcError
|
|
26500
26500
|
});
|
|
26501
|
-
const WsPullRequestsSubmitReviewRpc = make$
|
|
26501
|
+
const WsPullRequestsSubmitReviewRpc = make$29(WS_METHODS.pullRequestsSubmitReview, {
|
|
26502
26502
|
payload: PullRequestSubmitReviewInput,
|
|
26503
26503
|
success: require_Schema$1.Void,
|
|
26504
26504
|
error: PullRequestRpcError
|
|
26505
26505
|
});
|
|
26506
|
-
const WsPullRequestsReplyToThreadRpc = make$
|
|
26506
|
+
const WsPullRequestsReplyToThreadRpc = make$29(WS_METHODS.pullRequestsReplyToThread, {
|
|
26507
26507
|
payload: PullRequestThreadReplyInput,
|
|
26508
26508
|
success: require_Schema$1.Void,
|
|
26509
26509
|
error: PullRequestRpcError
|
|
26510
26510
|
});
|
|
26511
|
-
const WsPullRequestsSetThreadResolutionRpc = make$
|
|
26511
|
+
const WsPullRequestsSetThreadResolutionRpc = make$29(WS_METHODS.pullRequestsSetThreadResolution, {
|
|
26512
26512
|
payload: PullRequestThreadResolutionInput,
|
|
26513
26513
|
success: require_Schema$1.Void,
|
|
26514
26514
|
error: PullRequestRpcError
|
|
26515
26515
|
});
|
|
26516
|
-
const WsPullRequestsSetReactionRpc = make$
|
|
26516
|
+
const WsPullRequestsSetReactionRpc = make$29(WS_METHODS.pullRequestsSetReaction, {
|
|
26517
26517
|
payload: PullRequestReactionInput,
|
|
26518
26518
|
success: require_Schema$1.Void,
|
|
26519
26519
|
error: PullRequestRpcError
|
|
26520
26520
|
});
|
|
26521
|
-
const WsPullRequestsInvalidateRpc = make$
|
|
26521
|
+
const WsPullRequestsInvalidateRpc = make$29(WS_METHODS.pullRequestsInvalidate, {
|
|
26522
26522
|
payload: PullRequestInvalidateInput,
|
|
26523
26523
|
success: require_Schema$1.Void,
|
|
26524
26524
|
error: PullRequestRpcError
|
|
26525
26525
|
});
|
|
26526
|
-
const WsPullRequestsReviewerCandidatesRpc = make$
|
|
26526
|
+
const WsPullRequestsReviewerCandidatesRpc = make$29(WS_METHODS.pullRequestsReviewerCandidates, {
|
|
26527
26527
|
payload: PullRequestRef,
|
|
26528
26528
|
success: PullRequestReviewerCandidateList,
|
|
26529
26529
|
error: PullRequestRpcError
|
|
26530
26530
|
});
|
|
26531
|
-
const WsPullRequestsRequestReviewersRpc = make$
|
|
26531
|
+
const WsPullRequestsRequestReviewersRpc = make$29(WS_METHODS.pullRequestsRequestReviewers, {
|
|
26532
26532
|
payload: PullRequestReviewerRequestInput,
|
|
26533
26533
|
success: require_Schema$1.Void,
|
|
26534
26534
|
error: PullRequestRpcError
|
|
26535
26535
|
});
|
|
26536
|
-
const WsProjectsSearchContentsRpc = make$
|
|
26536
|
+
const WsProjectsSearchContentsRpc = make$29(WS_METHODS.projectsSearchContents, {
|
|
26537
26537
|
payload: ProjectSearchContentsInput,
|
|
26538
26538
|
success: ProjectSearchContentsResult,
|
|
26539
26539
|
error: ProjectSearchContentsError
|
|
26540
26540
|
});
|
|
26541
|
-
const WsProjectsSearchEntriesRpc = make$
|
|
26541
|
+
const WsProjectsSearchEntriesRpc = make$29(WS_METHODS.projectsSearchEntries, {
|
|
26542
26542
|
payload: ProjectSearchEntriesInput,
|
|
26543
26543
|
success: ProjectSearchEntriesResult,
|
|
26544
26544
|
error: ProjectSearchEntriesError
|
|
26545
26545
|
});
|
|
26546
|
-
const WsProjectsWriteFileRpc = make$
|
|
26546
|
+
const WsProjectsWriteFileRpc = make$29(WS_METHODS.projectsWriteFile, {
|
|
26547
26547
|
payload: ProjectWriteFileInput,
|
|
26548
26548
|
success: ProjectWriteFileResult,
|
|
26549
26549
|
error: ProjectWriteFileError
|
|
26550
26550
|
});
|
|
26551
|
-
const WsProjectCheckoutDeletionPreviewRpc = make$
|
|
26551
|
+
const WsProjectCheckoutDeletionPreviewRpc = make$29(WS_METHODS.projectCheckoutDeletionPreview, {
|
|
26552
26552
|
payload: ProjectCheckoutDeletionPreviewInput,
|
|
26553
26553
|
success: ProjectCheckoutDeletionPreview
|
|
26554
26554
|
});
|
|
26555
|
-
const WsProjectCheckoutDeletionExecuteRpc = make$
|
|
26555
|
+
const WsProjectCheckoutDeletionExecuteRpc = make$29(WS_METHODS.projectCheckoutDeletionExecute, {
|
|
26556
26556
|
payload: ProjectCheckoutDeletionExecuteInput,
|
|
26557
26557
|
success: ProjectCheckoutDeletionResult
|
|
26558
26558
|
});
|
|
26559
|
-
const WsWorkspaceReadFileRpc = make$
|
|
26559
|
+
const WsWorkspaceReadFileRpc = make$29(WS_METHODS.workspaceReadFile, {
|
|
26560
26560
|
payload: BulkTransferReadFileInput,
|
|
26561
26561
|
success: BulkTransferStreamEvent,
|
|
26562
26562
|
error: BulkTransferError,
|
|
26563
26563
|
stream: true
|
|
26564
26564
|
});
|
|
26565
|
-
const WsWorkspaceBeginWriteFileRpc = make$
|
|
26565
|
+
const WsWorkspaceBeginWriteFileRpc = make$29(WS_METHODS.workspaceBeginWriteFile, {
|
|
26566
26566
|
payload: BulkTransferWriteBeginInput,
|
|
26567
26567
|
success: BulkTransferWriteBeginResult,
|
|
26568
26568
|
error: BulkTransferError
|
|
26569
26569
|
});
|
|
26570
|
-
const WsWorkspaceWriteFileChunkRpc = make$
|
|
26570
|
+
const WsWorkspaceWriteFileChunkRpc = make$29(WS_METHODS.workspaceWriteFileChunk, {
|
|
26571
26571
|
payload: BulkTransferWriteChunkInput,
|
|
26572
26572
|
success: BulkTransferWriteChunkResult,
|
|
26573
26573
|
error: BulkTransferError
|
|
26574
26574
|
});
|
|
26575
|
-
const WsWorkspaceCommitWriteFileRpc = make$
|
|
26575
|
+
const WsWorkspaceCommitWriteFileRpc = make$29(WS_METHODS.workspaceCommitWriteFile, {
|
|
26576
26576
|
payload: BulkTransferIdInput,
|
|
26577
26577
|
success: BulkTransferWriteCommitResult,
|
|
26578
26578
|
error: BulkTransferError
|
|
26579
26579
|
});
|
|
26580
|
-
const WsWorkspaceCancelWriteFileRpc = make$
|
|
26580
|
+
const WsWorkspaceCancelWriteFileRpc = make$29(WS_METHODS.workspaceCancelWriteFile, {
|
|
26581
26581
|
payload: BulkTransferIdInput,
|
|
26582
26582
|
success: BulkTransferCancelResult,
|
|
26583
26583
|
error: BulkTransferError
|
|
26584
26584
|
});
|
|
26585
|
-
const WsShellOpenInEditorRpc = make$
|
|
26585
|
+
const WsShellOpenInEditorRpc = make$29(WS_METHODS.shellOpenInEditor, {
|
|
26586
26586
|
payload: OpenInEditorInput,
|
|
26587
26587
|
error: OpenError$1
|
|
26588
26588
|
});
|
|
26589
|
-
const WsSubscribeGitStatusRpc = make$
|
|
26589
|
+
const WsSubscribeGitStatusRpc = make$29(WS_METHODS.subscribeGitStatus, {
|
|
26590
26590
|
payload: GitStatusInput,
|
|
26591
26591
|
success: GitStatusStreamEvent,
|
|
26592
26592
|
error: GitManagerServiceError,
|
|
26593
26593
|
stream: true
|
|
26594
26594
|
});
|
|
26595
|
-
const WsGitPullRpc = make$
|
|
26595
|
+
const WsGitPullRpc = make$29(WS_METHODS.gitPull, {
|
|
26596
26596
|
payload: GitPullInput,
|
|
26597
26597
|
success: GitPullResult,
|
|
26598
26598
|
error: GitCommandError
|
|
26599
26599
|
});
|
|
26600
|
-
const WsGitRefreshStatusRpc = make$
|
|
26600
|
+
const WsGitRefreshStatusRpc = make$29(WS_METHODS.gitRefreshStatus, {
|
|
26601
26601
|
payload: GitStatusInput,
|
|
26602
26602
|
success: GitStatusResult,
|
|
26603
26603
|
error: GitManagerServiceError
|
|
26604
26604
|
});
|
|
26605
|
-
const WsGitRunStackedActionRpc = make$
|
|
26605
|
+
const WsGitRunStackedActionRpc = make$29(WS_METHODS.gitRunStackedAction, {
|
|
26606
26606
|
payload: GitRunStackedActionInput,
|
|
26607
26607
|
success: GitActionProgressEvent,
|
|
26608
26608
|
error: GitManagerServiceError,
|
|
26609
26609
|
stream: true
|
|
26610
26610
|
});
|
|
26611
|
-
const WsGitResolvePullRequestRpc = make$
|
|
26611
|
+
const WsGitResolvePullRequestRpc = make$29(WS_METHODS.gitResolvePullRequest, {
|
|
26612
26612
|
payload: GitPullRequestRefInput,
|
|
26613
26613
|
success: GitResolvePullRequestResult,
|
|
26614
26614
|
error: GitManagerServiceError
|
|
26615
26615
|
});
|
|
26616
|
-
const WsGitPreparePullRequestThreadRpc = make$
|
|
26616
|
+
const WsGitPreparePullRequestThreadRpc = make$29(WS_METHODS.gitPreparePullRequestThread, {
|
|
26617
26617
|
payload: GitPreparePullRequestThreadInput,
|
|
26618
26618
|
success: GitPreparePullRequestThreadResult,
|
|
26619
26619
|
error: GitManagerServiceError
|
|
26620
26620
|
});
|
|
26621
|
-
const WsGitListBranchesRpc = make$
|
|
26621
|
+
const WsGitListBranchesRpc = make$29(WS_METHODS.gitListBranches, {
|
|
26622
26622
|
payload: GitListBranchesInput,
|
|
26623
26623
|
success: GitListBranchesResult,
|
|
26624
26624
|
error: GitCommandError
|
|
26625
26625
|
});
|
|
26626
|
-
const WsVcsListRefsRpc = make$
|
|
26626
|
+
const WsVcsListRefsRpc = make$29(WS_METHODS.vcsListRefs, {
|
|
26627
26627
|
payload: VcsListRefsInput,
|
|
26628
26628
|
success: VcsListRefsResult,
|
|
26629
26629
|
error: GitCommandError
|
|
26630
26630
|
});
|
|
26631
|
-
const WsVcsRefreshStatusRpc = make$
|
|
26631
|
+
const WsVcsRefreshStatusRpc = make$29(WS_METHODS.vcsRefreshStatus, {
|
|
26632
26632
|
payload: GitStatusInput,
|
|
26633
26633
|
success: VcsStatusResult,
|
|
26634
26634
|
error: GitManagerServiceError
|
|
26635
26635
|
});
|
|
26636
|
-
const WsSubscribeVcsStatusRpc = make$
|
|
26636
|
+
const WsSubscribeVcsStatusRpc = make$29(WS_METHODS.subscribeVcsStatus, {
|
|
26637
26637
|
payload: GitStatusInput,
|
|
26638
26638
|
success: VcsStatusStreamEvent,
|
|
26639
26639
|
error: GitManagerServiceError,
|
|
26640
26640
|
stream: true
|
|
26641
26641
|
});
|
|
26642
|
-
const WsVcsPullRpc = make$
|
|
26642
|
+
const WsVcsPullRpc = make$29(WS_METHODS.vcsPull, {
|
|
26643
26643
|
payload: VcsPullInput,
|
|
26644
26644
|
success: VcsPullResult,
|
|
26645
26645
|
error: GitCommandError
|
|
26646
26646
|
});
|
|
26647
|
-
const WsVcsCreateWorktreeRpc = make$
|
|
26647
|
+
const WsVcsCreateWorktreeRpc = make$29(WS_METHODS.vcsCreateWorktree, {
|
|
26648
26648
|
payload: VcsCreateWorktreeInput,
|
|
26649
26649
|
success: VcsCreateWorktreeResult,
|
|
26650
26650
|
error: require_Schema$1.Union([GitCommandError, VcsUnsupportedRequestError])
|
|
26651
26651
|
});
|
|
26652
|
-
const WsVcsRemoveWorktreeRpc = make$
|
|
26652
|
+
const WsVcsRemoveWorktreeRpc = make$29(WS_METHODS.vcsRemoveWorktree, {
|
|
26653
26653
|
payload: GitRemoveWorktreeInput,
|
|
26654
26654
|
error: GitCommandError
|
|
26655
26655
|
});
|
|
26656
|
-
const WsVcsCreateRefRpc = make$
|
|
26656
|
+
const WsVcsCreateRefRpc = make$29(WS_METHODS.vcsCreateRef, {
|
|
26657
26657
|
payload: VcsCreateRefInput,
|
|
26658
26658
|
success: VcsCreateRefResult,
|
|
26659
26659
|
error: GitCommandError
|
|
26660
26660
|
});
|
|
26661
|
-
const WsVcsSwitchRefRpc = make$
|
|
26661
|
+
const WsVcsSwitchRefRpc = make$29(WS_METHODS.vcsSwitchRef, {
|
|
26662
26662
|
payload: VcsSwitchRefInput,
|
|
26663
26663
|
success: VcsSwitchRefResult,
|
|
26664
26664
|
error: GitCommandError
|
|
26665
26665
|
});
|
|
26666
|
-
const WsVcsInitRpc = make$
|
|
26666
|
+
const WsVcsInitRpc = make$29(WS_METHODS.vcsInit, {
|
|
26667
26667
|
payload: VcsInitInput,
|
|
26668
26668
|
error: require_Schema$1.Union([GitCommandError, VcsUnsupportedRequestError])
|
|
26669
26669
|
});
|
|
26670
|
-
const WsGitCreateWorktreeRpc = make$
|
|
26670
|
+
const WsGitCreateWorktreeRpc = make$29(WS_METHODS.gitCreateWorktree, {
|
|
26671
26671
|
payload: GitCreateWorktreeInput,
|
|
26672
26672
|
success: GitCreateWorktreeResult,
|
|
26673
26673
|
error: GitCommandError
|
|
26674
26674
|
});
|
|
26675
|
-
const WsGitRemoveWorktreeRpc = make$
|
|
26675
|
+
const WsGitRemoveWorktreeRpc = make$29(WS_METHODS.gitRemoveWorktree, {
|
|
26676
26676
|
payload: GitRemoveWorktreeInput,
|
|
26677
26677
|
error: GitCommandError
|
|
26678
26678
|
});
|
|
26679
|
-
const WsGitCreateBranchRpc = make$
|
|
26679
|
+
const WsGitCreateBranchRpc = make$29(WS_METHODS.gitCreateBranch, {
|
|
26680
26680
|
payload: GitCreateBranchInput,
|
|
26681
26681
|
success: GitCreateBranchResult,
|
|
26682
26682
|
error: GitCommandError
|
|
26683
26683
|
});
|
|
26684
|
-
const WsGitCheckoutRpc = make$
|
|
26684
|
+
const WsGitCheckoutRpc = make$29(WS_METHODS.gitCheckout, {
|
|
26685
26685
|
payload: GitCheckoutInput,
|
|
26686
26686
|
success: GitCheckoutResult,
|
|
26687
26687
|
error: GitCommandError
|
|
26688
26688
|
});
|
|
26689
|
-
const WsGitInitRpc = make$
|
|
26689
|
+
const WsGitInitRpc = make$29(WS_METHODS.gitInit, {
|
|
26690
26690
|
payload: GitInitInput,
|
|
26691
26691
|
error: GitCommandError
|
|
26692
26692
|
});
|
|
@@ -26694,7 +26694,7 @@ const WsGitInitRpc = make$30(WS_METHODS.gitInit, {
|
|
|
26694
26694
|
* The git half of a review: the branch range and the uncommitted work. The
|
|
26695
26695
|
* per-turn diffs beside it arrive through `orchestration.getTurnDiff`.
|
|
26696
26696
|
*/
|
|
26697
|
-
const WsReviewGetDiffPreviewRpc = make$
|
|
26697
|
+
const WsReviewGetDiffPreviewRpc = make$29(WS_METHODS.reviewGetDiffPreview, {
|
|
26698
26698
|
payload: ReviewDiffPreviewInput,
|
|
26699
26699
|
success: ReviewDiffPreviewResult,
|
|
26700
26700
|
error: require_Schema$1.Union([ReviewDiffPreviewError])
|
|
@@ -26704,12 +26704,12 @@ const WsReviewGetDiffPreviewRpc = make$30(WS_METHODS.reviewGetDiffPreview, {
|
|
|
26704
26704
|
* chunked bulk-transfer stream. A viewer wants the text once; a transfer wants
|
|
26705
26705
|
* offsets and checksums.
|
|
26706
26706
|
*/
|
|
26707
|
-
const WsProjectsReadFileRpc = make$
|
|
26707
|
+
const WsProjectsReadFileRpc = make$29(WS_METHODS.projectsReadFile, {
|
|
26708
26708
|
payload: ProjectReadFileInput,
|
|
26709
26709
|
success: ProjectReadFileResult,
|
|
26710
26710
|
error: require_Schema$1.Union([ProjectReadFileError])
|
|
26711
26711
|
});
|
|
26712
|
-
const WsFilesystemBrowseRpc = make$
|
|
26712
|
+
const WsFilesystemBrowseRpc = make$29(WS_METHODS.filesystemBrowse, {
|
|
26713
26713
|
payload: FilesystemBrowseInput,
|
|
26714
26714
|
success: FilesystemBrowseResult,
|
|
26715
26715
|
error: require_Schema$1.Union([FilesystemBrowseError])
|
|
@@ -26719,87 +26719,87 @@ const WsFilesystemBrowseRpc = make$30(WS_METHODS.filesystemBrowse, {
|
|
|
26719
26719
|
* Routed through the server because the phone keeps only the Forge-minted
|
|
26720
26720
|
* session token, never a CMMD one.
|
|
26721
26721
|
*/
|
|
26722
|
-
const WsCloudListRuntimesRpc = make$
|
|
26722
|
+
const WsCloudListRuntimesRpc = make$29(WS_METHODS.cloudListRuntimes, {
|
|
26723
26723
|
payload: CloudRuntimeListInput,
|
|
26724
26724
|
success: CloudRuntimeListResult,
|
|
26725
26725
|
error: require_Schema$1.Union([CloudRuntimeListError])
|
|
26726
26726
|
});
|
|
26727
|
-
const WsTerminalOpenRpc = make$
|
|
26727
|
+
const WsTerminalOpenRpc = make$29(WS_METHODS.terminalOpen, {
|
|
26728
26728
|
payload: TerminalOpenInput,
|
|
26729
26729
|
success: TerminalSessionSnapshot,
|
|
26730
26730
|
error: TerminalError
|
|
26731
26731
|
});
|
|
26732
|
-
const WsTerminalAttachRpc = make$
|
|
26732
|
+
const WsTerminalAttachRpc = make$29(WS_METHODS.terminalAttach, {
|
|
26733
26733
|
payload: TerminalAttachInput,
|
|
26734
26734
|
success: TerminalAttachStreamEvent,
|
|
26735
26735
|
error: TerminalError,
|
|
26736
26736
|
stream: true
|
|
26737
26737
|
});
|
|
26738
|
-
const WsTerminalWriteRpc = make$
|
|
26738
|
+
const WsTerminalWriteRpc = make$29(WS_METHODS.terminalWrite, {
|
|
26739
26739
|
payload: TerminalWriteRequest,
|
|
26740
26740
|
success: TerminalControlAck,
|
|
26741
26741
|
error: TerminalError
|
|
26742
26742
|
});
|
|
26743
|
-
const WsTerminalResizeRpc = make$
|
|
26743
|
+
const WsTerminalResizeRpc = make$29(WS_METHODS.terminalResize, {
|
|
26744
26744
|
payload: TerminalResizeRequest,
|
|
26745
26745
|
success: TerminalControlAck,
|
|
26746
26746
|
error: TerminalError
|
|
26747
26747
|
});
|
|
26748
|
-
const WsTerminalSignalRpc = make$
|
|
26748
|
+
const WsTerminalSignalRpc = make$29(WS_METHODS.terminalSignal, {
|
|
26749
26749
|
payload: TerminalSignalRequest,
|
|
26750
26750
|
success: TerminalControlAck,
|
|
26751
26751
|
error: TerminalError
|
|
26752
26752
|
});
|
|
26753
|
-
const WsTerminalClearRpc = make$
|
|
26753
|
+
const WsTerminalClearRpc = make$29(WS_METHODS.terminalClear, {
|
|
26754
26754
|
payload: TerminalClearRequest,
|
|
26755
26755
|
success: TerminalControlAck,
|
|
26756
26756
|
error: TerminalError
|
|
26757
26757
|
});
|
|
26758
|
-
const WsTerminalRestartRpc = make$
|
|
26758
|
+
const WsTerminalRestartRpc = make$29(WS_METHODS.terminalRestart, {
|
|
26759
26759
|
payload: TerminalRestartRequest,
|
|
26760
26760
|
success: TerminalRestartResult,
|
|
26761
26761
|
error: TerminalError
|
|
26762
26762
|
});
|
|
26763
|
-
const WsTerminalCloseRpc = make$
|
|
26763
|
+
const WsTerminalCloseRpc = make$29(WS_METHODS.terminalClose, {
|
|
26764
26764
|
payload: TerminalCloseRequest,
|
|
26765
26765
|
success: TerminalControlAck,
|
|
26766
26766
|
error: TerminalError
|
|
26767
26767
|
});
|
|
26768
|
-
const WsBrowserOpenSessionRpc = make$
|
|
26768
|
+
const WsBrowserOpenSessionRpc = make$29(WS_METHODS.browserOpenSession, {
|
|
26769
26769
|
payload: BrowserOpenSessionInput,
|
|
26770
26770
|
success: BrowserSessionSnapshot,
|
|
26771
26771
|
error: BrowserError
|
|
26772
26772
|
});
|
|
26773
|
-
const WsBrowserListSessionsRpc = make$
|
|
26773
|
+
const WsBrowserListSessionsRpc = make$29(WS_METHODS.browserListSessions, {
|
|
26774
26774
|
payload: BrowserListSessionsInput,
|
|
26775
26775
|
success: require_Schema$1.ArraySchema(BrowserSessionSnapshot),
|
|
26776
26776
|
error: BrowserError
|
|
26777
26777
|
});
|
|
26778
|
-
const WsBrowserCloseSessionRpc = make$
|
|
26778
|
+
const WsBrowserCloseSessionRpc = make$29(WS_METHODS.browserCloseSession, {
|
|
26779
26779
|
payload: BrowserCloseSessionInput,
|
|
26780
26780
|
error: BrowserError
|
|
26781
26781
|
});
|
|
26782
|
-
const WsBrowserGetSessionRpc = make$
|
|
26782
|
+
const WsBrowserGetSessionRpc = make$29(WS_METHODS.browserGetSession, {
|
|
26783
26783
|
payload: BrowserGetSessionInput,
|
|
26784
26784
|
success: require_Schema$1.NullOr(BrowserSessionSnapshot),
|
|
26785
26785
|
error: BrowserError
|
|
26786
26786
|
});
|
|
26787
|
-
const WsBrowserCommandRpc = make$
|
|
26787
|
+
const WsBrowserCommandRpc = make$29(WS_METHODS.browserCommand, {
|
|
26788
26788
|
payload: BrowserCommandInput,
|
|
26789
26789
|
success: BrowserCommandResult,
|
|
26790
26790
|
error: BrowserError
|
|
26791
26791
|
});
|
|
26792
|
-
const WsBrowserClearBrowsingDataRpc = make$
|
|
26792
|
+
const WsBrowserClearBrowsingDataRpc = make$29(WS_METHODS.browserClearBrowsingData, {
|
|
26793
26793
|
payload: BrowserClearBrowsingDataInput,
|
|
26794
26794
|
success: BrowserClearBrowsingDataResult,
|
|
26795
26795
|
error: BrowserError
|
|
26796
26796
|
});
|
|
26797
|
-
const WsBrowserAttachDisplayRpc = make$
|
|
26797
|
+
const WsBrowserAttachDisplayRpc = make$29(WS_METHODS.browserAttachDisplay, {
|
|
26798
26798
|
payload: BrowserDisplayAttachInput,
|
|
26799
26799
|
success: BrowserDisplayAttachResult,
|
|
26800
26800
|
error: BrowserError
|
|
26801
26801
|
});
|
|
26802
|
-
const WsBrowserAddDisplayIceCandidateRpc = make$
|
|
26802
|
+
const WsBrowserAddDisplayIceCandidateRpc = make$29(WS_METHODS.browserAddDisplayIceCandidate, {
|
|
26803
26803
|
payload: BrowserDisplayIceCandidateInput,
|
|
26804
26804
|
success: require_Schema$1.Struct({}),
|
|
26805
26805
|
error: BrowserError
|
|
@@ -26811,87 +26811,87 @@ const WsBrowserAddDisplayIceCandidateRpc = make$30(WS_METHODS.browserAddDisplayI
|
|
|
26811
26811
|
* page: it can click a DOM element but cannot touch the dock, a file manager,
|
|
26812
26812
|
* or anything else outside Chromium. This one lands on the display itself.
|
|
26813
26813
|
*/
|
|
26814
|
-
const WsComputerInputRpc = make$
|
|
26814
|
+
const WsComputerInputRpc = make$29(WS_METHODS.computerInput, {
|
|
26815
26815
|
payload: ComputerInputInput,
|
|
26816
26816
|
success: ComputerInputResult,
|
|
26817
26817
|
error: ComputerError
|
|
26818
26818
|
});
|
|
26819
|
-
const WsDevTunnelRegisterRpc = make$
|
|
26819
|
+
const WsDevTunnelRegisterRpc = make$29(WS_METHODS.devTunnelRegister, {
|
|
26820
26820
|
payload: DevTunnelRegisterInput,
|
|
26821
26821
|
success: DevTunnelRecord,
|
|
26822
26822
|
error: DevTunnelError
|
|
26823
26823
|
});
|
|
26824
|
-
const WsDevTunnelUnregisterRpc = make$
|
|
26824
|
+
const WsDevTunnelUnregisterRpc = make$29(WS_METHODS.devTunnelUnregister, {
|
|
26825
26825
|
payload: DevTunnelUnregisterInput,
|
|
26826
26826
|
error: DevTunnelError
|
|
26827
26827
|
});
|
|
26828
|
-
const WsDevTunnelListRpc = make$
|
|
26828
|
+
const WsDevTunnelListRpc = make$29(WS_METHODS.devTunnelList, {
|
|
26829
26829
|
payload: DevTunnelListInput,
|
|
26830
26830
|
success: require_Schema$1.ArraySchema(DevTunnelRecord),
|
|
26831
26831
|
error: DevTunnelError
|
|
26832
26832
|
});
|
|
26833
|
-
const WsThreadDevRuntimeGetRpc = make$
|
|
26833
|
+
const WsThreadDevRuntimeGetRpc = make$29(WS_METHODS.threadDevRuntimeGet, {
|
|
26834
26834
|
payload: ThreadDevRuntimeGetInput,
|
|
26835
26835
|
success: require_Schema$1.NullOr(ThreadDevRuntimeRecord),
|
|
26836
26836
|
error: ThreadDevRuntimeError
|
|
26837
26837
|
});
|
|
26838
|
-
const WsThreadDevRuntimeAllocatePortRpc = make$
|
|
26838
|
+
const WsThreadDevRuntimeAllocatePortRpc = make$29(WS_METHODS.threadDevRuntimeAllocatePort, {
|
|
26839
26839
|
payload: ThreadDevRuntimeAllocatePortInput,
|
|
26840
26840
|
success: ThreadDevRuntimeRecord,
|
|
26841
26841
|
error: ThreadDevRuntimeError
|
|
26842
26842
|
});
|
|
26843
|
-
const WsThreadDevRuntimeReleaseRpc = make$
|
|
26843
|
+
const WsThreadDevRuntimeReleaseRpc = make$29(WS_METHODS.threadDevRuntimeRelease, {
|
|
26844
26844
|
payload: ThreadDevRuntimeReleaseInput,
|
|
26845
26845
|
error: ThreadDevRuntimeError
|
|
26846
26846
|
});
|
|
26847
|
-
const WsWorkspaceEnvironmentPreflightRpc = make$
|
|
26847
|
+
const WsWorkspaceEnvironmentPreflightRpc = make$29(WS_METHODS.workspaceEnvironmentPreflight, {
|
|
26848
26848
|
payload: WorkspaceEnvironmentPreflightInput,
|
|
26849
26849
|
success: WorkspaceEnvironmentPreflightReport,
|
|
26850
26850
|
error: WorkspaceEnvironmentError
|
|
26851
26851
|
});
|
|
26852
|
-
const WsWorkspaceEnsureScratchRpc = make$
|
|
26852
|
+
const WsWorkspaceEnsureScratchRpc = make$29(WS_METHODS.workspaceEnsureScratch, {
|
|
26853
26853
|
payload: WorkspaceEnsureScratchInput,
|
|
26854
26854
|
success: WorkspaceEnsureScratchResult,
|
|
26855
26855
|
error: WorkspaceEnvironmentError
|
|
26856
26856
|
});
|
|
26857
|
-
const WsOrchestrationDispatchCommandRpc = make$
|
|
26857
|
+
const WsOrchestrationDispatchCommandRpc = make$29(ORCHESTRATION_WS_METHODS.dispatchCommand, {
|
|
26858
26858
|
payload: ClientOrchestrationCommand,
|
|
26859
26859
|
success: OrchestrationRpcSchemas.dispatchCommand.output,
|
|
26860
26860
|
error: OrchestrationDispatchCommandError
|
|
26861
26861
|
});
|
|
26862
|
-
const WsOrchestrationGetTurnDiffRpc = make$
|
|
26862
|
+
const WsOrchestrationGetTurnDiffRpc = make$29(ORCHESTRATION_WS_METHODS.getTurnDiff, {
|
|
26863
26863
|
payload: OrchestrationGetTurnDiffInput,
|
|
26864
26864
|
success: OrchestrationRpcSchemas.getTurnDiff.output,
|
|
26865
26865
|
error: OrchestrationGetTurnDiffError
|
|
26866
26866
|
});
|
|
26867
|
-
const WsOrchestrationGetFullThreadDiffRpc = make$
|
|
26867
|
+
const WsOrchestrationGetFullThreadDiffRpc = make$29(ORCHESTRATION_WS_METHODS.getFullThreadDiff, {
|
|
26868
26868
|
payload: OrchestrationGetFullThreadDiffInput,
|
|
26869
26869
|
success: OrchestrationRpcSchemas.getFullThreadDiff.output,
|
|
26870
26870
|
error: OrchestrationGetFullThreadDiffError
|
|
26871
26871
|
});
|
|
26872
|
-
const WsOrchestrationStreamTurnDiffRpc = make$
|
|
26872
|
+
const WsOrchestrationStreamTurnDiffRpc = make$29(ORCHESTRATION_WS_METHODS.streamTurnDiff, {
|
|
26873
26873
|
payload: OrchestrationGetTurnDiffInput,
|
|
26874
26874
|
success: BulkTransferStreamEvent,
|
|
26875
26875
|
error: require_Schema$1.Union([OrchestrationGetTurnDiffError, BulkTransferError]),
|
|
26876
26876
|
stream: true
|
|
26877
26877
|
});
|
|
26878
|
-
const WsOrchestrationStreamFullThreadDiffRpc = make$
|
|
26878
|
+
const WsOrchestrationStreamFullThreadDiffRpc = make$29(ORCHESTRATION_WS_METHODS.streamFullThreadDiff, {
|
|
26879
26879
|
payload: OrchestrationGetFullThreadDiffInput,
|
|
26880
26880
|
success: BulkTransferStreamEvent,
|
|
26881
26881
|
error: require_Schema$1.Union([OrchestrationGetFullThreadDiffError, BulkTransferError]),
|
|
26882
26882
|
stream: true
|
|
26883
26883
|
});
|
|
26884
|
-
const WsOrchestrationReplayEventsRpc = make$
|
|
26884
|
+
const WsOrchestrationReplayEventsRpc = make$29(ORCHESTRATION_WS_METHODS.replayEvents, {
|
|
26885
26885
|
payload: OrchestrationReplayEventsInput,
|
|
26886
26886
|
success: OrchestrationRpcSchemas.replayEvents.output,
|
|
26887
26887
|
error: OrchestrationReplayEventsError
|
|
26888
26888
|
});
|
|
26889
|
-
const WsOrchestrationGetArchivedShellSnapshotRpc = make$
|
|
26889
|
+
const WsOrchestrationGetArchivedShellSnapshotRpc = make$29(ORCHESTRATION_WS_METHODS.getArchivedShellSnapshot, {
|
|
26890
26890
|
payload: OrchestrationRpcSchemas.getArchivedShellSnapshot.input,
|
|
26891
26891
|
success: OrchestrationRpcSchemas.getArchivedShellSnapshot.output,
|
|
26892
26892
|
error: OrchestrationGetSnapshotError
|
|
26893
26893
|
});
|
|
26894
|
-
const WsOrchestrationSearchThreadsRpc = make$
|
|
26894
|
+
const WsOrchestrationSearchThreadsRpc = make$29(ORCHESTRATION_WS_METHODS.searchThreads, {
|
|
26895
26895
|
payload: OrchestrationSearchThreadsInput,
|
|
26896
26896
|
success: OrchestrationRpcSchemas.searchThreads.output,
|
|
26897
26897
|
error: OrchestrationSearchThreadsError
|
|
@@ -26902,7 +26902,7 @@ const WsOrchestrationSearchThreadsRpc = make$30(ORCHESTRATION_WS_METHODS.searchT
|
|
|
26902
26902
|
* route and `subscribeThread`'s fallback snapshot serve, over the RPC socket
|
|
26903
26903
|
* instead.
|
|
26904
26904
|
*/
|
|
26905
|
-
const WsOrchestrationGetThreadDetailPageRpc = make$
|
|
26905
|
+
const WsOrchestrationGetThreadDetailPageRpc = make$29(ORCHESTRATION_WS_METHODS.getThreadDetailPage, {
|
|
26906
26906
|
payload: OrchestrationRpcSchemas.getThreadDetailPage.input,
|
|
26907
26907
|
success: OrchestrationRpcSchemas.getThreadDetailPage.output,
|
|
26908
26908
|
error: OrchestrationGetSnapshotError
|
|
@@ -26915,29 +26915,29 @@ const WsOrchestrationGetThreadDetailPageRpc = make$30(ORCHESTRATION_WS_METHODS.g
|
|
|
26915
26915
|
* also be authorized, and a repository the caller cannot reach is a failure
|
|
26916
26916
|
* here rather than a clone that dies half way.
|
|
26917
26917
|
*/
|
|
26918
|
-
const WsSourceControlLookupRepositoryRpc = make$
|
|
26918
|
+
const WsSourceControlLookupRepositoryRpc = make$29(WS_METHODS.sourceControlLookupRepository, {
|
|
26919
26919
|
payload: SourceControlRepositoryLookupInput,
|
|
26920
26920
|
success: SourceControlRepositoryInfo,
|
|
26921
26921
|
error: SourceControlRepositoryError
|
|
26922
26922
|
});
|
|
26923
|
-
const WsSourceControlCloneRepositoryRpc = make$
|
|
26923
|
+
const WsSourceControlCloneRepositoryRpc = make$29(WS_METHODS.sourceControlCloneRepository, {
|
|
26924
26924
|
payload: SourceControlCloneRepositoryInput,
|
|
26925
26925
|
success: SourceControlCloneRepositoryResult,
|
|
26926
26926
|
error: SourceControlRepositoryError
|
|
26927
26927
|
});
|
|
26928
|
-
const WsOrchestrationSubscribeShellRpc = make$
|
|
26928
|
+
const WsOrchestrationSubscribeShellRpc = make$29(ORCHESTRATION_WS_METHODS.subscribeShell, {
|
|
26929
26929
|
payload: OrchestrationRpcSchemas.subscribeShell.input,
|
|
26930
26930
|
success: OrchestrationRpcSchemas.subscribeShell.output,
|
|
26931
26931
|
error: OrchestrationGetSnapshotError,
|
|
26932
26932
|
stream: true
|
|
26933
26933
|
});
|
|
26934
|
-
const WsOrchestrationSubscribeThreadRpc = make$
|
|
26934
|
+
const WsOrchestrationSubscribeThreadRpc = make$29(ORCHESTRATION_WS_METHODS.subscribeThread, {
|
|
26935
26935
|
payload: OrchestrationRpcSchemas.subscribeThread.input,
|
|
26936
26936
|
success: OrchestrationRpcSchemas.subscribeThread.output,
|
|
26937
26937
|
error: OrchestrationGetSnapshotError,
|
|
26938
26938
|
stream: true
|
|
26939
26939
|
});
|
|
26940
|
-
const WsSubscribeTerminalEventsRpc = make$
|
|
26940
|
+
const WsSubscribeTerminalEventsRpc = make$29(WS_METHODS.subscribeTerminalEvents, {
|
|
26941
26941
|
payload: require_Schema$1.Struct({}),
|
|
26942
26942
|
success: TerminalEvent,
|
|
26943
26943
|
stream: true
|
|
@@ -26958,65 +26958,65 @@ const WsSubscribeTerminalEventsRpc = make$30(WS_METHODS.subscribeTerminalEvents,
|
|
|
26958
26958
|
* The client's activity report, accepted and dropped. See
|
|
26959
26959
|
* packages/contracts/src/clientActivityCompat.ts for why there is no answer.
|
|
26960
26960
|
*/
|
|
26961
|
-
const WsServerReportClientActivityRpc = make$
|
|
26962
|
-
const WsServerDiscoverSourceControlRpc = make$
|
|
26961
|
+
const WsServerReportClientActivityRpc = make$29(WS_METHODS.serverReportClientActivity, { payload: ClientActivityReportInput });
|
|
26962
|
+
const WsServerDiscoverSourceControlRpc = make$29(WS_METHODS.serverDiscoverSourceControl, {
|
|
26963
26963
|
payload: require_Schema$1.Struct({}),
|
|
26964
26964
|
success: SourceControlDiscoveryResult
|
|
26965
26965
|
});
|
|
26966
|
-
const WsProjectsListEntriesRpc = make$
|
|
26966
|
+
const WsProjectsListEntriesRpc = make$29(WS_METHODS.projectsListEntries, {
|
|
26967
26967
|
payload: ProjectListEntriesInput,
|
|
26968
26968
|
success: ProjectListEntriesResult,
|
|
26969
26969
|
error: ProjectListEntriesError
|
|
26970
26970
|
});
|
|
26971
|
-
const WsSubscribeTerminalMetadataRpc = make$
|
|
26971
|
+
const WsSubscribeTerminalMetadataRpc = make$29(WS_METHODS.subscribeTerminalMetadata, {
|
|
26972
26972
|
payload: require_Schema$1.Struct({}),
|
|
26973
26973
|
success: TerminalMetadataStreamEvent,
|
|
26974
26974
|
stream: true
|
|
26975
26975
|
});
|
|
26976
|
-
const WsSubscribeBrowserEventsRpc = make$
|
|
26976
|
+
const WsSubscribeBrowserEventsRpc = make$29(WS_METHODS.subscribeBrowserEvents, {
|
|
26977
26977
|
payload: BrowserSubscribeInput,
|
|
26978
26978
|
success: BrowserStreamEvent,
|
|
26979
26979
|
error: BrowserError,
|
|
26980
26980
|
stream: true
|
|
26981
26981
|
});
|
|
26982
|
-
const WsSubscribeServerConfigRpc = make$
|
|
26982
|
+
const WsSubscribeServerConfigRpc = make$29(WS_METHODS.subscribeServerConfig, {
|
|
26983
26983
|
payload: require_Schema$1.Struct({}),
|
|
26984
26984
|
success: ServerConfigStreamEvent,
|
|
26985
26985
|
error: require_Schema$1.Union([KeybindingsConfigError, ServerSettingsError]),
|
|
26986
26986
|
stream: true
|
|
26987
26987
|
});
|
|
26988
|
-
const WsSubscribeServerLifecycleRpc = make$
|
|
26988
|
+
const WsSubscribeServerLifecycleRpc = make$29(WS_METHODS.subscribeServerLifecycle, {
|
|
26989
26989
|
payload: require_Schema$1.Struct({}),
|
|
26990
26990
|
success: ServerLifecycleStreamEvent,
|
|
26991
26991
|
stream: true
|
|
26992
26992
|
});
|
|
26993
|
-
const WsSubscribeAuthAccessRpc = make$
|
|
26993
|
+
const WsSubscribeAuthAccessRpc = make$29(WS_METHODS.subscribeAuthAccess, {
|
|
26994
26994
|
payload: require_Schema$1.Struct({}),
|
|
26995
26995
|
success: AuthAccessStreamEvent,
|
|
26996
26996
|
stream: true
|
|
26997
26997
|
});
|
|
26998
|
-
const WsSubscribeWorkspaceReadinessRpc = make$
|
|
26998
|
+
const WsSubscribeWorkspaceReadinessRpc = make$29(WS_METHODS.subscribeWorkspaceReadiness, {
|
|
26999
26999
|
payload: WorkspaceReadinessSubscribeInput,
|
|
27000
27000
|
success: PhaseEvent,
|
|
27001
27001
|
error: WorkspaceReadinessError,
|
|
27002
27002
|
stream: true
|
|
27003
27003
|
});
|
|
27004
|
-
const WsRpcGroup = make$
|
|
27004
|
+
const WsRpcGroup = make$28(WsServerGetConfigRpc, WsServerRefreshProvidersRpc, WsServerStartProviderAuthRpc, WsServerRepairProviderAuthRuntimeRpc, WsServerDisconnectProviderAuthRpc, WsServerGetProviderAuthSessionRpc, WsServerCancelProviderAuthRpc, WsServerSubmitProviderAuthCodeRpc, WsServerSyncPersonalCodexToCloudRpc, WsServerSyncPersonalClaudeToCloudRpc, WsServerUpsertKeybindingRpc, WsServerRemoveKeybindingRpc, WsServerGetSettingsRpc, WsServerUpdateSettingsRpc, WsServerUpdateEnvironmentDisplayNameRpc, WsServerTraceDiagnosticsRpc, WsServerHeartbeatRpc, make$29(WS_METHODS.usageGetSummary, {
|
|
27005
27005
|
payload: UsageSummaryInput,
|
|
27006
27006
|
success: UsageSummary,
|
|
27007
27007
|
error: UsageReadError
|
|
27008
|
-
}), WsPullRequestsListRpc, WsPullRequestsListStatsRpc, WsPullRequestsDetailRpc, WsPullRequestsActivityRpc, WsPullRequestsThreadCommentsRpc, WsPullRequestsDiffFileContentsRpc, WsPullRequestsRunActionRpc, WsPullRequestsUpdateRpc, WsPullRequestsCommentRpc, WsPullRequestsUpdateCommentRpc, WsPullRequestsSubmitReviewRpc, WsPullRequestsReplyToThreadRpc, WsPullRequestsSetThreadResolutionRpc, WsPullRequestsSetReactionRpc, WsPullRequestsInvalidateRpc, WsPullRequestsReviewerCandidatesRpc, WsPullRequestsRequestReviewersRpc, WsProjectsSearchContentsRpc, WsProjectsSearchEntriesRpc, WsProjectsWriteFileRpc, WsProjectCheckoutDeletionPreviewRpc, WsProjectCheckoutDeletionExecuteRpc, WsWorkspaceReadFileRpc, WsWorkspaceBeginWriteFileRpc, WsWorkspaceWriteFileChunkRpc, WsWorkspaceCommitWriteFileRpc, WsWorkspaceCancelWriteFileRpc, WsShellOpenInEditorRpc, WsSubscribeGitStatusRpc, WsGitPullRpc, WsGitRefreshStatusRpc, WsGitRunStackedActionRpc, WsGitResolvePullRequestRpc, WsGitPreparePullRequestThreadRpc, WsGitListBranchesRpc, WsVcsListRefsRpc, WsVcsRefreshStatusRpc, WsSubscribeVcsStatusRpc, WsVcsPullRpc, WsVcsCreateWorktreeRpc, WsVcsRemoveWorktreeRpc, WsVcsCreateRefRpc, WsVcsSwitchRefRpc, WsVcsInitRpc, WsGitCreateWorktreeRpc, WsGitRemoveWorktreeRpc, WsGitCreateBranchRpc, WsGitCheckoutRpc, WsGitInitRpc, WsFilesystemBrowseRpc, WsProjectsReadFileRpc, WsReviewGetDiffPreviewRpc, WsCloudListRuntimesRpc, WsTerminalOpenRpc, WsTerminalAttachRpc, WsTerminalWriteRpc, WsTerminalResizeRpc, WsTerminalSignalRpc, WsTerminalClearRpc, WsTerminalRestartRpc, WsTerminalCloseRpc, WsBrowserOpenSessionRpc, WsBrowserListSessionsRpc, WsBrowserCloseSessionRpc, WsBrowserGetSessionRpc, WsBrowserCommandRpc, WsBrowserClearBrowsingDataRpc, WsBrowserAttachDisplayRpc, WsBrowserAddDisplayIceCandidateRpc, WsComputerInputRpc, WsDevTunnelRegisterRpc, WsDevTunnelUnregisterRpc, WsDevTunnelListRpc, WsThreadDevRuntimeGetRpc, WsThreadDevRuntimeAllocatePortRpc, WsThreadDevRuntimeReleaseRpc, WsWorkspaceEnvironmentPreflightRpc, WsWorkspaceEnsureScratchRpc, WsSubscribeTerminalEventsRpc, WsSubscribeTerminalMetadataRpc, WsProjectsListEntriesRpc, WsServerDiscoverSourceControlRpc, WsServerReportClientActivityRpc, WsSubscribeBrowserEventsRpc, WsSubscribeServerConfigRpc, WsSubscribeServerLifecycleRpc, WsSubscribeAuthAccessRpc, WsSubscribeWorkspaceReadinessRpc, WsOrchestrationDispatchCommandRpc, WsOrchestrationGetTurnDiffRpc, WsOrchestrationGetFullThreadDiffRpc, WsOrchestrationStreamTurnDiffRpc, WsOrchestrationStreamFullThreadDiffRpc, WsOrchestrationReplayEventsRpc, WsOrchestrationGetArchivedShellSnapshotRpc, WsOrchestrationSubscribeShellRpc, WsOrchestrationSubscribeThreadRpc, make$
|
|
27008
|
+
}), WsPullRequestsListRpc, WsPullRequestsListStatsRpc, WsPullRequestsDetailRpc, WsPullRequestsActivityRpc, WsPullRequestsThreadCommentsRpc, WsPullRequestsDiffFileContentsRpc, WsPullRequestsRunActionRpc, WsPullRequestsUpdateRpc, WsPullRequestsCommentRpc, WsPullRequestsUpdateCommentRpc, WsPullRequestsSubmitReviewRpc, WsPullRequestsReplyToThreadRpc, WsPullRequestsSetThreadResolutionRpc, WsPullRequestsSetReactionRpc, WsPullRequestsInvalidateRpc, WsPullRequestsReviewerCandidatesRpc, WsPullRequestsRequestReviewersRpc, WsProjectsSearchContentsRpc, WsProjectsSearchEntriesRpc, WsProjectsWriteFileRpc, WsProjectCheckoutDeletionPreviewRpc, WsProjectCheckoutDeletionExecuteRpc, WsWorkspaceReadFileRpc, WsWorkspaceBeginWriteFileRpc, WsWorkspaceWriteFileChunkRpc, WsWorkspaceCommitWriteFileRpc, WsWorkspaceCancelWriteFileRpc, WsShellOpenInEditorRpc, WsSubscribeGitStatusRpc, WsGitPullRpc, WsGitRefreshStatusRpc, WsGitRunStackedActionRpc, WsGitResolvePullRequestRpc, WsGitPreparePullRequestThreadRpc, WsGitListBranchesRpc, WsVcsListRefsRpc, WsVcsRefreshStatusRpc, WsSubscribeVcsStatusRpc, WsVcsPullRpc, WsVcsCreateWorktreeRpc, WsVcsRemoveWorktreeRpc, WsVcsCreateRefRpc, WsVcsSwitchRefRpc, WsVcsInitRpc, WsGitCreateWorktreeRpc, WsGitRemoveWorktreeRpc, WsGitCreateBranchRpc, WsGitCheckoutRpc, WsGitInitRpc, WsFilesystemBrowseRpc, WsProjectsReadFileRpc, WsReviewGetDiffPreviewRpc, WsCloudListRuntimesRpc, WsTerminalOpenRpc, WsTerminalAttachRpc, WsTerminalWriteRpc, WsTerminalResizeRpc, WsTerminalSignalRpc, WsTerminalClearRpc, WsTerminalRestartRpc, WsTerminalCloseRpc, WsBrowserOpenSessionRpc, WsBrowserListSessionsRpc, WsBrowserCloseSessionRpc, WsBrowserGetSessionRpc, WsBrowserCommandRpc, WsBrowserClearBrowsingDataRpc, WsBrowserAttachDisplayRpc, WsBrowserAddDisplayIceCandidateRpc, WsComputerInputRpc, WsDevTunnelRegisterRpc, WsDevTunnelUnregisterRpc, WsDevTunnelListRpc, WsThreadDevRuntimeGetRpc, WsThreadDevRuntimeAllocatePortRpc, WsThreadDevRuntimeReleaseRpc, WsWorkspaceEnvironmentPreflightRpc, WsWorkspaceEnsureScratchRpc, WsSubscribeTerminalEventsRpc, WsSubscribeTerminalMetadataRpc, WsProjectsListEntriesRpc, WsServerDiscoverSourceControlRpc, WsServerReportClientActivityRpc, WsSubscribeBrowserEventsRpc, WsSubscribeServerConfigRpc, WsSubscribeServerLifecycleRpc, WsSubscribeAuthAccessRpc, WsSubscribeWorkspaceReadinessRpc, WsOrchestrationDispatchCommandRpc, WsOrchestrationGetTurnDiffRpc, WsOrchestrationGetFullThreadDiffRpc, WsOrchestrationStreamTurnDiffRpc, WsOrchestrationStreamFullThreadDiffRpc, WsOrchestrationReplayEventsRpc, WsOrchestrationGetArchivedShellSnapshotRpc, WsOrchestrationSubscribeShellRpc, WsOrchestrationSubscribeThreadRpc, make$29(WS_METHODS.assetsCreateUrl, {
|
|
27009
27009
|
payload: AssetsRpcSchemas.createUrl.input,
|
|
27010
27010
|
success: AssetsRpcSchemas.createUrl.output,
|
|
27011
27011
|
error: AssetAccessError
|
|
27012
|
-
}), make$
|
|
27012
|
+
}), make$29(WS_METHODS.attachmentsCreateUploadUrl, {
|
|
27013
27013
|
payload: AttachmentCreateUploadUrlInput,
|
|
27014
27014
|
success: AttachmentCreateUploadUrlResult,
|
|
27015
27015
|
error: AttachmentUploadSigningKeyError
|
|
27016
|
-
}), make$
|
|
27016
|
+
}), make$29(WS_METHODS.attachmentsDelete, {
|
|
27017
27017
|
payload: AttachmentDeleteInput,
|
|
27018
27018
|
success: require_Schema$1.Void
|
|
27019
|
-
}), make$
|
|
27019
|
+
}), make$29(WS_METHODS.providerUploadFeedback, {
|
|
27020
27020
|
payload: ProviderUploadFeedbackInput,
|
|
27021
27021
|
success: ProviderUploadFeedbackResult,
|
|
27022
27022
|
error: ProviderUploadFeedbackError
|
|
@@ -34652,7 +34652,7 @@ function parse$5(input) {
|
|
|
34652
34652
|
const FULL_PATH_REGEXP = /^https?:\/\/.*?\//;
|
|
34653
34653
|
const OPTIONAL_PARAM_REGEXP = /(\/:[^/()]*?)\?(\/?)/;
|
|
34654
34654
|
/** @internal */
|
|
34655
|
-
const make$
|
|
34655
|
+
const make$27 = (options = {}) => new RouterImpl(options);
|
|
34656
34656
|
var RouterImpl = class {
|
|
34657
34657
|
constructor(options = {}) {
|
|
34658
34658
|
this.options = {
|
|
@@ -35171,7 +35171,7 @@ const httpMethods = [
|
|
|
35171
35171
|
* @since 1.0.0
|
|
35172
35172
|
* @category constructors
|
|
35173
35173
|
*/
|
|
35174
|
-
const make$
|
|
35174
|
+
const make$26 = make$27;
|
|
35175
35175
|
//#endregion
|
|
35176
35176
|
//#region ../../node_modules/.bun/effect@4.0.0-beta.51/node_modules/effect/dist/unstable/http/HttpRouter.js
|
|
35177
35177
|
/**
|
|
@@ -35187,8 +35187,8 @@ const HttpRouter = /* @__PURE__ */ require_Schema$1.Service("effect/http/HttpRou
|
|
|
35187
35187
|
* @since 4.0.0
|
|
35188
35188
|
* @category HttpRouter
|
|
35189
35189
|
*/
|
|
35190
|
-
const make$
|
|
35191
|
-
const router = make$
|
|
35190
|
+
const make$25 = /* @__PURE__ */ require_Schema$1.gen(function* () {
|
|
35191
|
+
const router = make$26(yield* RouterConfig);
|
|
35192
35192
|
const middleware = /* @__PURE__ */ new Set();
|
|
35193
35193
|
const addAll = (routes) => require_Schema$1.contextWith((context) => {
|
|
35194
35194
|
const middleware = getMiddleware(context);
|
|
@@ -35318,7 +35318,7 @@ const add$1 = (method, path, handler, options) => use((router) => router.add(met
|
|
|
35318
35318
|
* @since 4.0.0
|
|
35319
35319
|
* @category HttpRouter
|
|
35320
35320
|
*/
|
|
35321
|
-
const layer$5 = /* @__PURE__ */ require_Schema$1.effect(HttpRouter)(make$
|
|
35321
|
+
const layer$5 = /* @__PURE__ */ require_Schema$1.effect(HttpRouter)(make$25);
|
|
35322
35322
|
const RouteTypeId = "~effect/http/HttpRouter/Route";
|
|
35323
35323
|
const makeRoute = (options) => ({
|
|
35324
35324
|
...options,
|
|
@@ -66332,7 +66332,7 @@ function normalizeNumberish(value) {
|
|
|
66332
66332
|
}
|
|
66333
66333
|
//#endregion
|
|
66334
66334
|
//#region package.json
|
|
66335
|
-
var version$1 = "0.13.
|
|
66335
|
+
var version$1 = "0.13.97";
|
|
66336
66336
|
//#endregion
|
|
66337
66337
|
//#region src/sentry.ts
|
|
66338
66338
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -77159,7 +77159,7 @@ let clientIdCounter = 0;
|
|
|
77159
77159
|
* @since 4.0.0
|
|
77160
77160
|
* @category client
|
|
77161
77161
|
*/
|
|
77162
|
-
const make$
|
|
77162
|
+
const make$24 = /* @__PURE__ */ require_Schema$1.fnUntraced(function* (group, options) {
|
|
77163
77163
|
const clientId = clientIdCounter++;
|
|
77164
77164
|
const { run, send, supportsAck, supportsTransferables } = yield* Protocol$1;
|
|
77165
77165
|
const entries = /* @__PURE__ */ new Map();
|
|
@@ -77535,7 +77535,7 @@ const applyMiddleware = (context, handler, options) => {
|
|
|
77535
77535
|
* @since 4.0.0
|
|
77536
77536
|
* @category server
|
|
77537
77537
|
*/
|
|
77538
|
-
const make$
|
|
77538
|
+
const make$23 = /* @__PURE__ */ require_Schema$1.fnUntraced(function* (group, options) {
|
|
77539
77539
|
const { disconnects, end, run, send, supportsAck, supportsSpanPropagation, supportsTransferables } = yield* Protocol;
|
|
77540
77540
|
const services = yield* require_Schema$1.context();
|
|
77541
77541
|
const scope = yield* require_Schema$1.make$3();
|
|
@@ -77708,7 +77708,7 @@ const makeProtocolWithHttpEffectWebsocket = /* @__PURE__ */ require_Schema$1.gen
|
|
|
77708
77708
|
*/
|
|
77709
77709
|
const toHttpEffectWebsocket = /* @__PURE__ */ require_Schema$1.fnUntraced(function* (group, options) {
|
|
77710
77710
|
const { httpEffect, protocol } = yield* makeProtocolWithHttpEffectWebsocket;
|
|
77711
|
-
yield* make$
|
|
77711
|
+
yield* make$23(group, options).pipe(require_Schema$1.provideService(Protocol, protocol), require_Schema$1.forkScoped);
|
|
77712
77712
|
return httpEffect;
|
|
77713
77713
|
});
|
|
77714
77714
|
const makeSocketProtocol = /* @__PURE__ */ require_Schema$1.gen(function* () {
|
|
@@ -78745,7 +78745,7 @@ function readTraceFile(fileSystem, path) {
|
|
|
78745
78745
|
cause
|
|
78746
78746
|
})) }));
|
|
78747
78747
|
}
|
|
78748
|
-
const make$
|
|
78748
|
+
const make$22 = require_Schema$1.gen(function* () {
|
|
78749
78749
|
const fileSystem = yield* require_Path.FileSystem;
|
|
78750
78750
|
const read = require_Schema$1.fn("TraceDiagnostics.read")(function* (options) {
|
|
78751
78751
|
const readAtMs = options.readAtMs ?? Date.now();
|
|
@@ -78789,7 +78789,7 @@ const make$23 = require_Schema$1.gen(function* () {
|
|
|
78789
78789
|
});
|
|
78790
78790
|
return TraceDiagnostics.of({ read });
|
|
78791
78791
|
});
|
|
78792
|
-
const layer$4 = require_Schema$1.effect(TraceDiagnostics, make$
|
|
78792
|
+
const layer$4 = require_Schema$1.effect(TraceDiagnostics, make$22);
|
|
78793
78793
|
require_Schema$1.succeed$1(TraceDiagnostics, TraceDiagnostics.of({ read: (options) => require_Schema$1.succeed(makeEmptyDiagnostics({
|
|
78794
78794
|
traceFilePath: options.traceFilePath,
|
|
78795
78795
|
scannedFilePaths: [],
|
|
@@ -86695,7 +86695,7 @@ function toReviewThreadListing(threads, dismissalsByReviewId) {
|
|
|
86695
86695
|
viewer: threads.metadata.viewer
|
|
86696
86696
|
};
|
|
86697
86697
|
}
|
|
86698
|
-
const make$
|
|
86698
|
+
const make$21 = require_Schema$1.gen(function* () {
|
|
86699
86699
|
const github = yield* GitHubCli$1;
|
|
86700
86700
|
/**
|
|
86701
86701
|
* The pull request's own node id, which is what a mutation against the pull request itself is
|
|
@@ -87400,9 +87400,9 @@ const make$22 = require_Schema$1.gen(function* () {
|
|
|
87400
87400
|
})))
|
|
87401
87401
|
});
|
|
87402
87402
|
});
|
|
87403
|
-
require_Schema$1.effect(GitHubPullRequestCli, make$
|
|
87403
|
+
require_Schema$1.effect(GitHubPullRequestCli, make$21);
|
|
87404
87404
|
/** Builds a PR CLI for one authenticated session without touching global git or auth state. */
|
|
87405
|
-
const makeFromCommandRunner = (runner) => make$
|
|
87405
|
+
const makeFromCommandRunner = (runner) => make$21.pipe(require_Schema$1.provideService(GitHubCli$1, runner));
|
|
87406
87406
|
//#endregion
|
|
87407
87407
|
//#region src/pullRequest/GitHubPullRequestProvider.ts
|
|
87408
87408
|
const CAPABILITIES$3 = {
|
|
@@ -87522,7 +87522,7 @@ function loginAvatarUrl(login, host) {
|
|
|
87522
87522
|
}
|
|
87523
87523
|
/** True where markdown would render nothing: whitespace, or only HTML comments. */
|
|
87524
87524
|
const rendersEmpty = (body) => body.replace(/<!--[\s\S]*?-->/g, "").trim().length === 0;
|
|
87525
|
-
const make$
|
|
87525
|
+
const make$20 = require_Schema$1.gen(function* () {
|
|
87526
87526
|
const cli = yield* GitHubPullRequestCli;
|
|
87527
87527
|
const fail = (operation) => (error) => new PullRequestProviderError({
|
|
87528
87528
|
provider: "github",
|
|
@@ -87731,7 +87731,7 @@ const make$21 = require_Schema$1.gen(function* () {
|
|
|
87731
87731
|
};
|
|
87732
87732
|
});
|
|
87733
87733
|
/** Constructs the provider from a session-bound command service supplied by the caller. */
|
|
87734
|
-
const makeFromCli = (cli) => make$
|
|
87734
|
+
const makeFromCli = (cli) => make$20.pipe(require_Schema$1.provideService(GitHubPullRequestCli, cli));
|
|
87735
87735
|
//#endregion
|
|
87736
87736
|
//#region src/git/AgentAttribution.ts
|
|
87737
87737
|
/**
|
|
@@ -93345,7 +93345,7 @@ function toResolvableLinks(links) {
|
|
|
93345
93345
|
* A Forge project id is installation-local; it must never be sent to CMMD as a project id.
|
|
93346
93346
|
*/
|
|
93347
93347
|
var CmmdProjectIdentityResolver = class extends require_Schema$1.Service()("forge/pullRequest/CmmdProjectIdentityResolver") {};
|
|
93348
|
-
const make$
|
|
93348
|
+
const make$19 = require_Schema$1.gen(function* () {
|
|
93349
93349
|
const environment = yield* ServerEnvironment;
|
|
93350
93350
|
const repositoryIdentity = yield* RepositoryIdentityResolver;
|
|
93351
93351
|
const resolve = (forgeProjectId, cmmdJwt) => require_Schema$1.gen(function* () {
|
|
@@ -93386,7 +93386,7 @@ function resolveCanonicalKey(repositoryIdentity, forgeProjectId) {
|
|
|
93386
93386
|
return (yield* repositoryIdentity.resolve(workspaceRoot))?.canonicalKey ?? null;
|
|
93387
93387
|
}).pipe(require_Schema$1.orElseSucceed(() => null));
|
|
93388
93388
|
}
|
|
93389
|
-
const cmmdProjectIdentityResolverLive = require_Schema$1.effect(CmmdProjectIdentityResolver, make$
|
|
93389
|
+
const cmmdProjectIdentityResolverLive = require_Schema$1.effect(CmmdProjectIdentityResolver, make$19);
|
|
93390
93390
|
//#endregion
|
|
93391
93391
|
//#region src/pullRequest/PullRequestServiceFactory.ts
|
|
93392
93392
|
var PullRequestServiceFactory = class extends require_Schema$1.Service()("forge/pullRequest/PullRequestServiceFactory") {};
|
|
@@ -93416,7 +93416,7 @@ function makePrincipalServiceCache(input) {
|
|
|
93416
93416
|
return entry.value;
|
|
93417
93417
|
};
|
|
93418
93418
|
}
|
|
93419
|
-
const make$
|
|
93419
|
+
const make$18 = require_Schema$1.gen(function* () {
|
|
93420
93420
|
const projections = yield* ProjectionSnapshotQuery;
|
|
93421
93421
|
const settings = yield* ServerSettingsService;
|
|
93422
93422
|
const providerRuntimeSource = yield* require_Schema$1.serviceOption(PullRequestProviderRuntimeSource);
|
|
@@ -93454,7 +93454,7 @@ const make$19 = require_Schema$1.gen(function* () {
|
|
|
93454
93454
|
const forPrincipal = (principal) => require_Schema$1.promise(() => cached(principal));
|
|
93455
93455
|
return PullRequestServiceFactory.of({ forPrincipal });
|
|
93456
93456
|
});
|
|
93457
|
-
const pullRequestServiceFactoryLayer = require_Schema$1.effect(PullRequestServiceFactory, make$
|
|
93457
|
+
const pullRequestServiceFactoryLayer = require_Schema$1.effect(PullRequestServiceFactory, make$18);
|
|
93458
93458
|
//#endregion
|
|
93459
93459
|
//#region ../../packages/shared/src/keybindings.ts
|
|
93460
93460
|
/**
|
|
@@ -94319,7 +94319,7 @@ const launchDetached = (launch) => require_Schema$1.gen(function* () {
|
|
|
94319
94319
|
}))));
|
|
94320
94320
|
});
|
|
94321
94321
|
});
|
|
94322
|
-
const make$
|
|
94322
|
+
const make$17 = require_Schema$1.gen(function* () {
|
|
94323
94323
|
const open = yield* require_Schema$1.tryPromise({
|
|
94324
94324
|
try: () => Promise.resolve().then(() => require("./open-CghsF25U.cjs")),
|
|
94325
94325
|
catch: (cause) => new OpenError$1({
|
|
@@ -94338,7 +94338,7 @@ const make$18 = require_Schema$1.gen(function* () {
|
|
|
94338
94338
|
openInEditor: (input) => require_Schema$1.flatMap(resolveEditorLaunch(input), launchDetached)
|
|
94339
94339
|
};
|
|
94340
94340
|
});
|
|
94341
|
-
const OpenLive = require_Schema$1.effect(Open, make$
|
|
94341
|
+
const OpenLive = require_Schema$1.effect(Open, make$17);
|
|
94342
94342
|
//#endregion
|
|
94343
94343
|
//#region src/workspace/Services/WorkspacePaths.ts
|
|
94344
94344
|
/**
|
|
@@ -98404,6 +98404,119 @@ function providerAuthFailureMessage(message, provider, env = process.env) {
|
|
|
98404
98404
|
}).message;
|
|
98405
98405
|
}
|
|
98406
98406
|
//#endregion
|
|
98407
|
+
//#region ../../packages/shared/src/publicProviderCopy.ts
|
|
98408
|
+
const PUBLIC_PROVIDER_LEAK_PATTERNS = [
|
|
98409
|
+
/\bDeepSeek\b/i,
|
|
98410
|
+
/\bKimi\b/i,
|
|
98411
|
+
/\bMoonshot\b/i,
|
|
98412
|
+
/\bdeepseek[-._a-z0-9]*\b/i,
|
|
98413
|
+
/\bkimi[-._a-z0-9]*\b/i,
|
|
98414
|
+
/\bmoonshot[-._a-z0-9]*\b/i,
|
|
98415
|
+
/\bAPEX_API_KEY\b/,
|
|
98416
|
+
/\bDEEPSEEK_API_KEY\b/,
|
|
98417
|
+
/\bKIMI_API_KEY\b/,
|
|
98418
|
+
/\bOPENAI_API_KEY\b/,
|
|
98419
|
+
/\bANTHROPIC_API_KEY\b/,
|
|
98420
|
+
/\bCURSOR_API_KEY\b/,
|
|
98421
|
+
/\bOPENCODE_API_KEY\b/,
|
|
98422
|
+
/\bforge_proxy_[A-Za-z0-9._-]+\b/,
|
|
98423
|
+
/\bProviderValidationError\b/,
|
|
98424
|
+
/\/forge-server\/node_modules\//,
|
|
98425
|
+
/https?:\/\/[^\s'"<>)]*\/api\/provider-egress\/[^\s'"<>)]*/i,
|
|
98426
|
+
/https?:\/\/[^\s'"<>)]*(?:apex|deepseek|moonshot|kimi)[^\s'"<>)]*/i
|
|
98427
|
+
];
|
|
98428
|
+
const DEFAULT_PUBLIC_PROVIDER_ERROR = "CMMD is temporarily unavailable. Check the workspace AI connection and retry.";
|
|
98429
|
+
function isProviderRateOrQuotaError(message) {
|
|
98430
|
+
if (!message) return false;
|
|
98431
|
+
const normalized = message.toLowerCase();
|
|
98432
|
+
return /\b(rate[\s-]?limit|too\s+many\s+requests|usage[ _-]limit|usage_limit_reached|quota|insufficient_quota)\b/.test(normalized) || /\b429\b/.test(normalized);
|
|
98433
|
+
}
|
|
98434
|
+
function providerLifecycleOrAccountCopy(message) {
|
|
98435
|
+
if (/\bbound to provider account\b/.test(message) && /\bcannot use provider account\b/.test(message)) return "Forge could not switch this conversation to the selected AI account. Retry the account switch.";
|
|
98436
|
+
if (/\bforge_runtime_repairing\b/.test(message) || /\bthis turn was interrupted because the environment is being repaired\b/.test(message)) return "This turn was interrupted because the environment is being repaired. Retry after the repair finishes.";
|
|
98437
|
+
if (/\bforge_runtime_stopped\b/.test(message) || /\bthis turn was interrupted because the environment was stopped\b/.test(message)) return "This turn was interrupted because the environment was stopped. Start the environment and retry.";
|
|
98438
|
+
return null;
|
|
98439
|
+
}
|
|
98440
|
+
/**
|
|
98441
|
+
* Infer a SAFE, clearer failure category from a (possibly leaky) provider error.
|
|
98442
|
+
*
|
|
98443
|
+
* Returns a canned, user-facing message — it never echoes the raw input, so it
|
|
98444
|
+
* is safe to use even when the source message contains provider internals.
|
|
98445
|
+
* Used to give actionable feedback ("model isn't available", "rate-limited",
|
|
98446
|
+
* "auth failed") instead of the blanket "CMMD is temporarily unavailable."
|
|
98447
|
+
* Returns null when no category can be confidently inferred.
|
|
98448
|
+
*/
|
|
98449
|
+
function categorizePublicProviderError(message) {
|
|
98450
|
+
if (!message) return null;
|
|
98451
|
+
const m = message.toLowerCase();
|
|
98452
|
+
const lifecycleOrAccountCopy = providerLifecycleOrAccountCopy(m);
|
|
98453
|
+
if (lifecycleOrAccountCopy !== null) return lifecycleOrAccountCopy;
|
|
98454
|
+
if (/\bforge_provider_model_not_allowed\b/.test(m) || /\bnot\s+scoped\s+to\s+the\s+requested\s+model\b/.test(m)) return "The workspace AI credential does not cover the model this turn asked for. Retry, or pick that model for the thread.";
|
|
98455
|
+
if (/\bmodel\b[\s\S]*\b(not\s+(found|available|supported)|does\s+not\s+exist|unsupported|invalid|unknown)\b/.test(m) || /\b(unsupported|unknown|invalid)\b[\s\S]*\bmodel\b/.test(m) || /\b(model_not_found|invalid_model|model_not_supported)\b/.test(m)) return "The selected model isn't available right now. Pick a different model and retry.";
|
|
98456
|
+
if (isProviderRateOrQuotaError(m)) return "The AI service is rate-limited or out of quota. Wait a moment and retry.";
|
|
98457
|
+
if (/_credential_reconnect_required\b/.test(m)) return "The workspace AI credential needs to be reconnected. Reconnect it in Settings > Providers, then retry.";
|
|
98458
|
+
if (/\b(unauthorized|forbidden|authentication\s+(failed|error|required)|invalid\s+api\s+key|expired\s+(token|credential))\b/.test(m) || /\b40[13]\b/.test(m)) return "Workspace AI authentication failed. Reconnect the workspace and retry.";
|
|
98459
|
+
if (/\b(timed?\s*out|timeout|overloaded|service\s+unavailable)\b/.test(m) || /\b50[234]\b/.test(m)) return "The AI service is temporarily overloaded. Retry in a moment.";
|
|
98460
|
+
return null;
|
|
98461
|
+
}
|
|
98462
|
+
function containsPublicProviderLeak(message) {
|
|
98463
|
+
if (!message) return false;
|
|
98464
|
+
return PUBLIC_PROVIDER_LEAK_PATTERNS.some((pattern) => pattern.test(message));
|
|
98465
|
+
}
|
|
98466
|
+
function sanitizePublicProviderText(message, options = {}) {
|
|
98467
|
+
if (message === void 0 || message === null) return null;
|
|
98468
|
+
const trimmed = message.trim();
|
|
98469
|
+
if (trimmed.length === 0) return null;
|
|
98470
|
+
if (!containsPublicProviderLeak(trimmed)) return trimmed;
|
|
98471
|
+
return categorizePublicProviderError(trimmed) ?? options.fallback ?? "CMMD is temporarily unavailable. Check the workspace AI connection and retry.";
|
|
98472
|
+
}
|
|
98473
|
+
//#endregion
|
|
98474
|
+
//#region src/orchestration/providerRetryableFailure.ts
|
|
98475
|
+
/**
|
|
98476
|
+
* Classifies a provider turn-start failure as a retryable rate-limit or
|
|
98477
|
+
* transient-availability failure (429/503), a terminal failure that names why
|
|
98478
|
+
* it will never clear on its own, or unrecognized (null).
|
|
98479
|
+
*
|
|
98480
|
+
* CMMD-Center/forge#3558: a 429 from CMMD's provider egress used to leave no
|
|
98481
|
+
* trace at all, because nothing in the turn-start path recognized it as a
|
|
98482
|
+
* distinct, retryable failure. `ProviderCommandReactor` uses this to decide
|
|
98483
|
+
* whether to retry a turn start with backoff, and to name the provider,
|
|
98484
|
+
* status and Retry-After in the `provider.turn.start.failed` activity CMMD's
|
|
98485
|
+
* watchdog reads once retries are exhausted.
|
|
98486
|
+
*
|
|
98487
|
+
* Reuses `isProviderRateOrQuotaError` (the same predicate the public-copy
|
|
98488
|
+
* sanitizer uses to recognize a rate-limit message) rather than restating its
|
|
98489
|
+
* word list here.
|
|
98490
|
+
*/
|
|
98491
|
+
const SERVICE_UNAVAILABLE_PATTERN = /\b(503|service\s+unavailable)\b/i;
|
|
98492
|
+
const RATE_LIMITED_PAST_TENSE_PATTERN = /\brate[\s-]?limit(?:ed|ing)?\b/i;
|
|
98493
|
+
const QUOTA_OR_USAGE_LIMIT_PATTERN = /\b(usage[ _-]limit|usage_limit_reached|quota|insufficient_quota)\b/i;
|
|
98494
|
+
const EXPLICIT_429_PATTERN = /\b429\b/;
|
|
98495
|
+
const RETRY_AFTER_SECONDS_PATTERN = /retry-after[^0-9]{0,10}(\d+)|(?:try again|retry)\s+in\s+(\d+)\s*(?:s\b|sec(?:onds?)?\b)?/i;
|
|
98496
|
+
function parseRetryAfterSeconds(detail) {
|
|
98497
|
+
const match = detail.match(RETRY_AFTER_SECONDS_PATTERN);
|
|
98498
|
+
if (!match) return null;
|
|
98499
|
+
const raw = match[1] ?? match[2];
|
|
98500
|
+
const seconds = raw ? Number(raw) : NaN;
|
|
98501
|
+
return Number.isFinite(seconds) ? seconds : null;
|
|
98502
|
+
}
|
|
98503
|
+
function classifyRetryableProviderFailure(detail) {
|
|
98504
|
+
if (!detail || detail.trim().length === 0) return null;
|
|
98505
|
+
if (QUOTA_OR_USAGE_LIMIT_PATTERN.test(detail) && !EXPLICIT_429_PATTERN.test(detail)) return {
|
|
98506
|
+
kind: "terminal",
|
|
98507
|
+
reason: "quota",
|
|
98508
|
+
message: detail
|
|
98509
|
+
};
|
|
98510
|
+
const isRateLimited = isProviderRateOrQuotaError(detail) || RATE_LIMITED_PAST_TENSE_PATTERN.test(detail);
|
|
98511
|
+
const isUnavailable = SERVICE_UNAVAILABLE_PATTERN.test(detail);
|
|
98512
|
+
if (!isRateLimited && !isUnavailable) return null;
|
|
98513
|
+
return {
|
|
98514
|
+
kind: "retryable",
|
|
98515
|
+
status: isRateLimited ? 429 : 503,
|
|
98516
|
+
retryAfterSeconds: parseRetryAfterSeconds(detail)
|
|
98517
|
+
};
|
|
98518
|
+
}
|
|
98519
|
+
//#endregion
|
|
98407
98520
|
//#region src/orchestration/turnFailureReason.ts
|
|
98408
98521
|
/**
|
|
98409
98522
|
* Machine-readable reasons for a turn that failed before it produced any
|
|
@@ -98437,6 +98550,31 @@ function classifyProviderTurnStartFailureReason(detail) {
|
|
|
98437
98550
|
message
|
|
98438
98551
|
};
|
|
98439
98552
|
}
|
|
98553
|
+
/**
|
|
98554
|
+
* Classifies a turn that ended mid-flight, after it had already started
|
|
98555
|
+
* (CMMD-Center/forge#3562 piece A): a `runtime.error` that reached CMMD as
|
|
98556
|
+
* `error_summary`, now also read into a `turn_status: failed` reason.
|
|
98557
|
+
*
|
|
98558
|
+
* `provider_turn_failed` is the code CMMD's own error_summary heuristic
|
|
98559
|
+
* already assigns this class of failure
|
|
98560
|
+
* (`shared/forge-work-session-failure-reasons.ts`), so a Forge-sent
|
|
98561
|
+
* `turn_status` carrying it lines up with what CMMD already infers instead
|
|
98562
|
+
* of teaching it a new code for the common case. `provider_usage_limit`
|
|
98563
|
+
* reuses the same wording `classifyRetryableProviderFailure` already treats
|
|
98564
|
+
* as a wall that will not clear by retrying (CMMD-Center/forge#3558): a
|
|
98565
|
+
* usage-limit message inside a turn that already ended is worth naming
|
|
98566
|
+
* specifically, even without the fuller upstream port (see the piece A PR's
|
|
98567
|
+
* follow-up issue) that would stop Codex from retrying against that wall in
|
|
98568
|
+
* the first place.
|
|
98569
|
+
*/
|
|
98570
|
+
function classifyMidTurnFailureReason(detail) {
|
|
98571
|
+
const message = detail && detail.trim().length > 0 ? detail : "The runtime reported an error while this run was in progress.";
|
|
98572
|
+
const classified = classifyRetryableProviderFailure(detail);
|
|
98573
|
+
return {
|
|
98574
|
+
code: classified?.kind === "terminal" && classified.reason === "quota" ? "provider_usage_limit" : "provider_turn_failed",
|
|
98575
|
+
message
|
|
98576
|
+
};
|
|
98577
|
+
}
|
|
98440
98578
|
function checkpointTimeoutReason(detail) {
|
|
98441
98579
|
return {
|
|
98442
98580
|
code: "checkpoint_timeout",
|
|
@@ -98571,6 +98709,108 @@ function serializeReplicaMessage(message) {
|
|
|
98571
98709
|
};
|
|
98572
98710
|
}
|
|
98573
98711
|
//#endregion
|
|
98712
|
+
//#region src/orchestration/turnTerminalStatus.ts
|
|
98713
|
+
/**
|
|
98714
|
+
* Shared vocabulary between the reactor that records how a turn ended
|
|
98715
|
+
* (`Layers/CheckpointReactor.ts`, on the provider's own `turn.completed`
|
|
98716
|
+
* event) and the serializer that turns that record into CMMD's `turn_status`
|
|
98717
|
+
* terminal event (`runtimeReplication/turnTerminalStatusSerializer.ts`).
|
|
98718
|
+
* CMMD-Center/forge#3562 piece A, CMMD-Center/CMMD#5822.
|
|
98719
|
+
*/
|
|
98720
|
+
/** The activity kind this durable record uses. Never sent to CMMD as-is: the
|
|
98721
|
+
* serializer reads it and emits the wire `turn_status` event instead. */
|
|
98722
|
+
const TURN_TERMINAL_STATUS_ACTIVITY_KIND = "turn.terminal-status";
|
|
98723
|
+
/**
|
|
98724
|
+
* CMMD's three-way outcome from the provider's own four-way `turn.completed`
|
|
98725
|
+
* state. `cancelled` and `interrupted` both read as `interrupted`: neither
|
|
98726
|
+
* the provider wording nor CMMD's Work Session UI distinguishes an
|
|
98727
|
+
* operator-cancelled turn from one the provider gave up on mid-flight.
|
|
98728
|
+
*/
|
|
98729
|
+
function turnTerminalOutcomeFromRuntimeState(state) {
|
|
98730
|
+
if (state === "failed") return "failed";
|
|
98731
|
+
if (state === "completed") return "completed";
|
|
98732
|
+
return "interrupted";
|
|
98733
|
+
}
|
|
98734
|
+
/**
|
|
98735
|
+
* Deterministic activity id for a turn's terminal record: never
|
|
98736
|
+
* `crypto.randomUUID()`. The projector replaces an activity by id
|
|
98737
|
+
* (`thread.activity-appended`), so a redelivered `turn.completed` for the
|
|
98738
|
+
* same turn lands on the same row instead of adding a second one, and the
|
|
98739
|
+
* serializer's own `eventId` (`activity:<id>`) inherits the same guarantee.
|
|
98740
|
+
*/
|
|
98741
|
+
function turnTerminalStatusActivityId(turnId) {
|
|
98742
|
+
return `turn-terminal:${turnId}`;
|
|
98743
|
+
}
|
|
98744
|
+
//#endregion
|
|
98745
|
+
//#region src/runtimeReplication/eventFormatting.ts
|
|
98746
|
+
/**
|
|
98747
|
+
* Small formatting helpers shared by every source `serializer.ts` folds into
|
|
98748
|
+
* a thread's replicated event list. Kept in their own module, with no
|
|
98749
|
+
* dependency on `serializer.ts` itself, so a narrower serializer (such as
|
|
98750
|
+
* `turnTerminalStatusSerializer.ts`) can reuse them without creating an
|
|
98751
|
+
* import cycle back into the file that assembles the full event list.
|
|
98752
|
+
*/
|
|
98753
|
+
function text(value, max) {
|
|
98754
|
+
const normalized = value.trim();
|
|
98755
|
+
return normalized ? normalized.slice(0, max) : null;
|
|
98756
|
+
}
|
|
98757
|
+
function canonicalRuntimeEventTimestamp(value) {
|
|
98758
|
+
let timestamp = new Date(value);
|
|
98759
|
+
if (Number.isNaN(timestamp.getTime())) {
|
|
98760
|
+
const legacyBsdNanoseconds = value.match(/^(.*:\d{2})\.\d+NZ$/);
|
|
98761
|
+
timestamp = new Date(legacyBsdNanoseconds ? `${legacyBsdNanoseconds[1]}Z` : value);
|
|
98762
|
+
}
|
|
98763
|
+
if (Number.isNaN(timestamp.getTime())) throw new Error(`Invalid runtime event timestamp: ${value}`);
|
|
98764
|
+
return timestamp.toISOString();
|
|
98765
|
+
}
|
|
98766
|
+
//#endregion
|
|
98767
|
+
//#region src/runtimeReplication/turnTerminalStatusSerializer.ts
|
|
98768
|
+
function outcomeOf(payload) {
|
|
98769
|
+
if (!payload || typeof payload !== "object") return null;
|
|
98770
|
+
const outcome = payload.outcome;
|
|
98771
|
+
return outcome === "completed" || outcome === "interrupted" || outcome === "failed" ? outcome : null;
|
|
98772
|
+
}
|
|
98773
|
+
function errorMessageOf(payload) {
|
|
98774
|
+
if (!payload || typeof payload !== "object") return null;
|
|
98775
|
+
const message = payload.errorMessage;
|
|
98776
|
+
return typeof message === "string" && message.trim().length > 0 ? message : null;
|
|
98777
|
+
}
|
|
98778
|
+
/**
|
|
98779
|
+
* Turns the one durable activity `Layers/CheckpointReactor.ts` records when a
|
|
98780
|
+
* turn ends into CMMD's `turn_status` terminal event (CMMD-Center/forge#3562
|
|
98781
|
+
* piece A, CMMD-Center/CMMD#5822): `completed`, `interrupted`, or `failed`
|
|
98782
|
+
* with a structured `reason`. `error_summary` (`serializeFailureActivity` in
|
|
98783
|
+
* `serializer.ts`) keeps replicating separately for a mid-turn failure; this
|
|
98784
|
+
* is added next to it, never instead of it.
|
|
98785
|
+
*
|
|
98786
|
+
* The activity's own id is deterministic (`turn-terminal:<turnId>`,
|
|
98787
|
+
* `turnTerminalStatusActivityId`), so this event's `eventId` -- built from
|
|
98788
|
+
* that id the same way every other activity-sourced event on this thread is
|
|
98789
|
+
* (`activity:<id>`) -- can never collide with a second, different terminal
|
|
98790
|
+
* status for the same turn: there is exactly one activity row to read it
|
|
98791
|
+
* from, and the reactor that writes that row never overwrites it once set.
|
|
98792
|
+
*/
|
|
98793
|
+
function serializeTurnTerminalStatusActivity(activity) {
|
|
98794
|
+
if (activity.kind !== "turn.terminal-status" || !activity.turnId) return null;
|
|
98795
|
+
const outcome = outcomeOf(activity.payload);
|
|
98796
|
+
if (outcome === null) return null;
|
|
98797
|
+
const reason = outcome === "failed" ? classifyMidTurnFailureReason(errorMessageOf(activity.payload)) : null;
|
|
98798
|
+
return {
|
|
98799
|
+
sourceSequence: null,
|
|
98800
|
+
event: {
|
|
98801
|
+
eventId: `activity:${activity.id}`,
|
|
98802
|
+
occurredAt: canonicalRuntimeEventTimestamp(activity.createdAt),
|
|
98803
|
+
turnId: activity.turnId,
|
|
98804
|
+
kind: "turn_status",
|
|
98805
|
+
status: outcome,
|
|
98806
|
+
...reason ? { reason: {
|
|
98807
|
+
code: reason.code,
|
|
98808
|
+
message: text(reason.message, 2e3) ?? reason.message
|
|
98809
|
+
} } : {}
|
|
98810
|
+
}
|
|
98811
|
+
};
|
|
98812
|
+
}
|
|
98813
|
+
//#endregion
|
|
98574
98814
|
//#region src/runtimeReplication/serializer.ts
|
|
98575
98815
|
function threadStatus(thread) {
|
|
98576
98816
|
if (thread.archivedAt) return "archived";
|
|
@@ -98637,19 +98877,6 @@ function serializeRuntimeInventory(snapshot, providerInventory) {
|
|
|
98637
98877
|
...providerInventory === void 0 ? {} : { providers: serializeProviderCatalog(providerInventory) }
|
|
98638
98878
|
};
|
|
98639
98879
|
}
|
|
98640
|
-
function text(value, max) {
|
|
98641
|
-
const normalized = value.trim();
|
|
98642
|
-
return normalized ? normalized.slice(0, max) : null;
|
|
98643
|
-
}
|
|
98644
|
-
function canonicalRuntimeEventTimestamp(value) {
|
|
98645
|
-
let timestamp = new Date(value);
|
|
98646
|
-
if (Number.isNaN(timestamp.getTime())) {
|
|
98647
|
-
const legacyBsdNanoseconds = value.match(/^(.*:\d{2})\.\d+NZ$/);
|
|
98648
|
-
timestamp = new Date(legacyBsdNanoseconds ? `${legacyBsdNanoseconds[1]}Z` : value);
|
|
98649
|
-
}
|
|
98650
|
-
if (Number.isNaN(timestamp.getTime())) throw new Error(`Invalid runtime event timestamp: ${value}`);
|
|
98651
|
-
return timestamp.toISOString();
|
|
98652
|
-
}
|
|
98653
98880
|
/** Spread onto an event: present only when the projection knows the turn. */
|
|
98654
98881
|
function eventTurn(turnId) {
|
|
98655
98882
|
return turnId ? { turnId } : {};
|
|
@@ -98954,10 +99181,13 @@ function foldReportedUsage(reported) {
|
|
|
98954
99181
|
* model, so a mid-thread switch used to republish a finished turn as a second
|
|
98955
99182
|
* row for spend that happened once (FOR-36388, fixed in FOR-36438).
|
|
98956
99183
|
*/
|
|
98957
|
-
/** Turns named on this thread's own rows; hydrated replica rows carry no local
|
|
99184
|
+
/** Turns named on this thread's own rows; hydrated replica rows carry no local
|
|
99185
|
+
* turn, and the terminal-status activity (CMMD-Center/forge#3562 piece A) is
|
|
99186
|
+
* a wire-protocol source in its own right, not a Usage signal, so it is
|
|
99187
|
+
* excluded the same way a `replica.*` activity is. */
|
|
98958
99188
|
function localTurnIds(thread) {
|
|
98959
99189
|
const fromMessages = thread.messages.filter((message) => !message.streaming).map((message) => message.turnId);
|
|
98960
|
-
const fromActivities = thread.activities.filter((activity) => !activity.kind.startsWith("replica.")).map((activity) => activity.turnId);
|
|
99190
|
+
const fromActivities = thread.activities.filter((activity) => !activity.kind.startsWith("replica.") && activity.kind !== "turn.terminal-status").map((activity) => activity.turnId);
|
|
98961
99191
|
const turnIds = /* @__PURE__ */ new Set();
|
|
98962
99192
|
for (const turnId of [...fromMessages, ...fromActivities]) if (turnId) turnIds.add(turnId);
|
|
98963
99193
|
return turnIds;
|
|
@@ -98967,8 +99197,12 @@ function settledTurnIds(thread) {
|
|
|
98967
99197
|
if (thread.latestTurn?.state === "running") turnIds.delete(thread.latestTurn.turnId);
|
|
98968
99198
|
return turnIds;
|
|
98969
99199
|
}
|
|
99200
|
+
/** A turn's own activities for Usage derivation, excluding the terminal-status
|
|
99201
|
+
* activity: that record's own `createdAt` (the turn's very end) must never
|
|
99202
|
+
* shift `turnLatestAt`, or an already-acknowledged usage row would rehash
|
|
99203
|
+
* the moment a turn that used to have no terminal activity gains one. */
|
|
98970
99204
|
function turnActivities(thread, turnId) {
|
|
98971
|
-
return thread.activities.filter((activity) => activity.turnId === turnId).toSorted((left, right) => left.createdAt.localeCompare(right.createdAt) || left.id.localeCompare(right.id));
|
|
99205
|
+
return thread.activities.filter((activity) => activity.turnId === turnId && activity.kind !== "turn.terminal-status").toSorted((left, right) => left.createdAt.localeCompare(right.createdAt) || left.id.localeCompare(right.id));
|
|
98972
99206
|
}
|
|
98973
99207
|
/** The last thing that happened in the turn: what the Recorded turn is stamped with. */
|
|
98974
99208
|
function turnLatestAt(thread, turnId, activities) {
|
|
@@ -99177,6 +99411,10 @@ function serializeRuntimeThreadEvents(thread) {
|
|
|
99177
99411
|
const event = serializePlanActivity(activity);
|
|
99178
99412
|
return event === null ? [] : [event];
|
|
99179
99413
|
});
|
|
99414
|
+
const turnTerminalStatuses = thread.activities.flatMap((activity) => {
|
|
99415
|
+
const event = serializeTurnTerminalStatusActivity(activity);
|
|
99416
|
+
return event === null ? [] : [event];
|
|
99417
|
+
});
|
|
99180
99418
|
const recordedTurns = serializeRecordedTurns(thread);
|
|
99181
99419
|
const textGenerations = serializeTextGenerations(thread);
|
|
99182
99420
|
const priorEvents = [
|
|
@@ -99186,6 +99424,7 @@ function serializeRuntimeThreadEvents(thread) {
|
|
|
99186
99424
|
...worktreeLaunchActivities,
|
|
99187
99425
|
...planActivities,
|
|
99188
99426
|
...failureActivities,
|
|
99427
|
+
...turnTerminalStatuses,
|
|
99189
99428
|
...recordedTurns,
|
|
99190
99429
|
...textGenerations
|
|
99191
99430
|
];
|
|
@@ -99331,7 +99570,7 @@ function readFailed(detail) {
|
|
|
99331
99570
|
cause: require_Schema$1.squash(cause)
|
|
99332
99571
|
}));
|
|
99333
99572
|
}
|
|
99334
|
-
const make$
|
|
99573
|
+
const make$16 = require_Schema$1.gen(function* () {
|
|
99335
99574
|
const config = yield* ServerConfig;
|
|
99336
99575
|
const snapshots = yield* ProjectionSnapshotQuery;
|
|
99337
99576
|
const outbox = yield* RuntimeReplicationOutbox;
|
|
@@ -99377,7 +99616,7 @@ const make$17 = require_Schema$1.gen(function* () {
|
|
|
99377
99616
|
};
|
|
99378
99617
|
}) };
|
|
99379
99618
|
});
|
|
99380
|
-
const UsageRecordedSourceLive = require_Schema$1.effect(UsageRecordedSource, make$
|
|
99619
|
+
const UsageRecordedSourceLive = require_Schema$1.effect(UsageRecordedSource, make$16);
|
|
99381
99620
|
//#endregion
|
|
99382
99621
|
//#region src/runtimeReplication/usageSessionLookup.ts
|
|
99383
99622
|
/**
|
|
@@ -99638,7 +99877,7 @@ function askTheLedger(request) {
|
|
|
99638
99877
|
return require_Schema$1.logWarning("usage session lookup failed; local lanes keep their records").pipe(require_Schema$1.annotateLogs({ cause: outcome.error }), require_Schema$1.as(UNAVAILABLE.callFailed));
|
|
99639
99878
|
}));
|
|
99640
99879
|
}
|
|
99641
|
-
const make$
|
|
99880
|
+
const make$15 = (fetchImpl, resolveOwnerCredential) => require_Schema$1.gen(function* () {
|
|
99642
99881
|
const config = yield* ServerConfig;
|
|
99643
99882
|
const sql = yield* require_SqlError.SqlClient;
|
|
99644
99883
|
/** The cloud lane: this runtime's own scoped grant. */
|
|
@@ -99677,7 +99916,7 @@ const make$16 = (fetchImpl, resolveOwnerCredential) => require_Schema$1.gen(func
|
|
|
99677
99916
|
* without a signed-in machine behind it. Both default to the real thing.
|
|
99678
99917
|
*/
|
|
99679
99918
|
function makeUsageSessionLookupLayer(fetchImpl = fetch, resolveOwnerCredential = resolveOwnerCredentialLive) {
|
|
99680
|
-
return require_Schema$1.effect(UsageSessionLookup, make$
|
|
99919
|
+
return require_Schema$1.effect(UsageSessionLookup, make$15(fetchImpl, resolveOwnerCredential));
|
|
99681
99920
|
}
|
|
99682
99921
|
const UsageSessionLookupLive = makeUsageSessionLookupLayer();
|
|
99683
99922
|
//#endregion
|
|
@@ -100487,7 +100726,7 @@ function failedRecordedSources(hostId, detail) {
|
|
|
100487
100726
|
message: detail
|
|
100488
100727
|
}));
|
|
100489
100728
|
}
|
|
100490
|
-
const make$
|
|
100729
|
+
const make$14 = (hooks) => require_Schema$1.gen(function* () {
|
|
100491
100730
|
const fileSystem = yield* require_Path.FileSystem;
|
|
100492
100731
|
const path = yield* require_Path.Path;
|
|
100493
100732
|
const config = yield* ServerConfig;
|
|
@@ -100916,7 +101155,7 @@ const make$15 = (hooks) => require_Schema$1.gen(function* () {
|
|
|
100916
101155
|
});
|
|
100917
101156
|
/** The service with a seam into the scan; tests pass their own hooks. */
|
|
100918
101157
|
function makeUsageServiceLayer(hooks = NOOP_SCAN_HOOKS) {
|
|
100919
|
-
return require_Schema$1.effect(UsageService, make$
|
|
101158
|
+
return require_Schema$1.effect(UsageService, make$14(hooks));
|
|
100920
101159
|
}
|
|
100921
101160
|
const UsageServiceLive = makeUsageServiceLayer();
|
|
100922
101161
|
const DAY_MS = 1440 * 60 * 1e3;
|
|
@@ -115410,7 +115649,7 @@ const PgClient = /* @__PURE__ */ require_Schema$1.Service("@effect/sql-pg/PgClie
|
|
|
115410
115649
|
* @category constructors
|
|
115411
115650
|
* @since 1.0.0
|
|
115412
115651
|
*/
|
|
115413
|
-
const make$
|
|
115652
|
+
const make$13 = (options) => fromPool({
|
|
115414
115653
|
...options,
|
|
115415
115654
|
acquire: require_Schema$1.gen(function* () {
|
|
115416
115655
|
const pool = new Pool({
|
|
@@ -115689,7 +115928,7 @@ const layerFrom = (acquire) => require_Schema$1.effectContext(require_Schema$1.m
|
|
|
115689
115928
|
* @category layers
|
|
115690
115929
|
* @since 1.0.0
|
|
115691
115930
|
*/
|
|
115692
|
-
const layer$3 = (config) => layerFrom(make$
|
|
115931
|
+
const layer$3 = (config) => layerFrom(make$13(config));
|
|
115693
115932
|
/**
|
|
115694
115933
|
* @category constructor
|
|
115695
115934
|
* @since 1.0.0
|
|
@@ -116243,7 +116482,7 @@ var MigrationError = class extends require_Schema$1.TaggedError("MigrationError"
|
|
|
116243
116482
|
* @category constructor
|
|
116244
116483
|
* @since 4.0.0
|
|
116245
116484
|
*/
|
|
116246
|
-
const make$
|
|
116485
|
+
const make$12 = ({ dumpSchema = () => require_Schema$1.void_ }) => ({ loader, schemaDirectory, table = "effect_sql_migrations" }) => require_Schema$1.gen(function* () {
|
|
116247
116486
|
const sql = yield* require_SqlError.SqlClient;
|
|
116248
116487
|
const ensureMigrationsTable = sql.onDialectOrElse({
|
|
116249
116488
|
mssql: () => sql`IF OBJECT_ID(N'${sql.literal(table)}', N'U') IS NULL
|
|
@@ -119322,7 +119561,7 @@ const makeMigrationLoader = (throughId) => fromRecord(Object.fromEntries(migrati
|
|
|
119322
119561
|
* Migrator run function - no schema dumping needed
|
|
119323
119562
|
* Uses the base Migrator.make without platform dependencies
|
|
119324
119563
|
*/
|
|
119325
|
-
const run = make$
|
|
119564
|
+
const run = make$12({});
|
|
119326
119565
|
/**
|
|
119327
119566
|
* Run all pending migrations.
|
|
119328
119567
|
*
|
|
@@ -150718,7 +150957,7 @@ function formatLoggerMessage(message) {
|
|
|
150718
150957
|
return typeof message === "string" ? message : String(message);
|
|
150719
150958
|
}
|
|
150720
150959
|
function makeLineLogger(streamLabel) {
|
|
150721
|
-
return make$
|
|
150960
|
+
return make$32(({ date, message }) => `[${date.toISOString()}] ${streamLabel}: ${formatLoggerMessage(message)}\n`);
|
|
150722
150961
|
}
|
|
150723
150962
|
function resolveStreamLabel(stream) {
|
|
150724
150963
|
switch (stream) {
|
|
@@ -150834,7 +151073,7 @@ const makeEventNdjsonLogger = require_Schema$1.fn("makeEventNdjsonLogger")(funct
|
|
|
150834
151073
|
});
|
|
150835
151074
|
return;
|
|
150836
151075
|
}
|
|
150837
|
-
const stateRef = yield* make$
|
|
151076
|
+
const stateRef = yield* make$31({
|
|
150838
151077
|
threadWriters: /* @__PURE__ */ new Map(),
|
|
150839
151078
|
failedSegments: /* @__PURE__ */ new Set()
|
|
150840
151079
|
});
|
|
@@ -214176,73 +214415,6 @@ const makeCodexAdapter = require_Schema$1.fn("makeCodexAdapter")(function* (opti
|
|
|
214176
214415
|
function makeCodexAdapterLive(options) {
|
|
214177
214416
|
return require_Schema$1.effect(CodexAdapter, makeCodexAdapter(options));
|
|
214178
214417
|
}
|
|
214179
|
-
//#endregion
|
|
214180
|
-
//#region ../../packages/shared/src/publicProviderCopy.ts
|
|
214181
|
-
const PUBLIC_PROVIDER_LEAK_PATTERNS = [
|
|
214182
|
-
/\bDeepSeek\b/i,
|
|
214183
|
-
/\bKimi\b/i,
|
|
214184
|
-
/\bMoonshot\b/i,
|
|
214185
|
-
/\bdeepseek[-._a-z0-9]*\b/i,
|
|
214186
|
-
/\bkimi[-._a-z0-9]*\b/i,
|
|
214187
|
-
/\bmoonshot[-._a-z0-9]*\b/i,
|
|
214188
|
-
/\bAPEX_API_KEY\b/,
|
|
214189
|
-
/\bDEEPSEEK_API_KEY\b/,
|
|
214190
|
-
/\bKIMI_API_KEY\b/,
|
|
214191
|
-
/\bOPENAI_API_KEY\b/,
|
|
214192
|
-
/\bANTHROPIC_API_KEY\b/,
|
|
214193
|
-
/\bCURSOR_API_KEY\b/,
|
|
214194
|
-
/\bOPENCODE_API_KEY\b/,
|
|
214195
|
-
/\bforge_proxy_[A-Za-z0-9._-]+\b/,
|
|
214196
|
-
/\bProviderValidationError\b/,
|
|
214197
|
-
/\/forge-server\/node_modules\//,
|
|
214198
|
-
/https?:\/\/[^\s'"<>)]*\/api\/provider-egress\/[^\s'"<>)]*/i,
|
|
214199
|
-
/https?:\/\/[^\s'"<>)]*(?:apex|deepseek|moonshot|kimi)[^\s'"<>)]*/i
|
|
214200
|
-
];
|
|
214201
|
-
const DEFAULT_PUBLIC_PROVIDER_ERROR = "CMMD is temporarily unavailable. Check the workspace AI connection and retry.";
|
|
214202
|
-
function isProviderRateOrQuotaError(message) {
|
|
214203
|
-
if (!message) return false;
|
|
214204
|
-
const normalized = message.toLowerCase();
|
|
214205
|
-
return /\b(rate[\s-]?limit|too\s+many\s+requests|usage[ _-]limit|usage_limit_reached|quota|insufficient_quota)\b/.test(normalized) || /\b429\b/.test(normalized);
|
|
214206
|
-
}
|
|
214207
|
-
function providerLifecycleOrAccountCopy(message) {
|
|
214208
|
-
if (/\bbound to provider account\b/.test(message) && /\bcannot use provider account\b/.test(message)) return "Forge could not switch this conversation to the selected AI account. Retry the account switch.";
|
|
214209
|
-
if (/\bforge_runtime_repairing\b/.test(message) || /\bthis turn was interrupted because the environment is being repaired\b/.test(message)) return "This turn was interrupted because the environment is being repaired. Retry after the repair finishes.";
|
|
214210
|
-
if (/\bforge_runtime_stopped\b/.test(message) || /\bthis turn was interrupted because the environment was stopped\b/.test(message)) return "This turn was interrupted because the environment was stopped. Start the environment and retry.";
|
|
214211
|
-
return null;
|
|
214212
|
-
}
|
|
214213
|
-
/**
|
|
214214
|
-
* Infer a SAFE, clearer failure category from a (possibly leaky) provider error.
|
|
214215
|
-
*
|
|
214216
|
-
* Returns a canned, user-facing message — it never echoes the raw input, so it
|
|
214217
|
-
* is safe to use even when the source message contains provider internals.
|
|
214218
|
-
* Used to give actionable feedback ("model isn't available", "rate-limited",
|
|
214219
|
-
* "auth failed") instead of the blanket "CMMD is temporarily unavailable."
|
|
214220
|
-
* Returns null when no category can be confidently inferred.
|
|
214221
|
-
*/
|
|
214222
|
-
function categorizePublicProviderError(message) {
|
|
214223
|
-
if (!message) return null;
|
|
214224
|
-
const m = message.toLowerCase();
|
|
214225
|
-
const lifecycleOrAccountCopy = providerLifecycleOrAccountCopy(m);
|
|
214226
|
-
if (lifecycleOrAccountCopy !== null) return lifecycleOrAccountCopy;
|
|
214227
|
-
if (/\bforge_provider_model_not_allowed\b/.test(m) || /\bnot\s+scoped\s+to\s+the\s+requested\s+model\b/.test(m)) return "The workspace AI credential does not cover the model this turn asked for. Retry, or pick that model for the thread.";
|
|
214228
|
-
if (/\bmodel\b[\s\S]*\b(not\s+(found|available|supported)|does\s+not\s+exist|unsupported|invalid|unknown)\b/.test(m) || /\b(unsupported|unknown|invalid)\b[\s\S]*\bmodel\b/.test(m) || /\b(model_not_found|invalid_model|model_not_supported)\b/.test(m)) return "The selected model isn't available right now. Pick a different model and retry.";
|
|
214229
|
-
if (isProviderRateOrQuotaError(m)) return "The AI service is rate-limited or out of quota. Wait a moment and retry.";
|
|
214230
|
-
if (/_credential_reconnect_required\b/.test(m)) return "The workspace AI credential needs to be reconnected. Reconnect it in Settings > Providers, then retry.";
|
|
214231
|
-
if (/\b(unauthorized|forbidden|authentication\s+(failed|error|required)|invalid\s+api\s+key|expired\s+(token|credential))\b/.test(m) || /\b40[13]\b/.test(m)) return "Workspace AI authentication failed. Reconnect the workspace and retry.";
|
|
214232
|
-
if (/\b(timed?\s*out|timeout|overloaded|service\s+unavailable)\b/.test(m) || /\b50[234]\b/.test(m)) return "The AI service is temporarily overloaded. Retry in a moment.";
|
|
214233
|
-
return null;
|
|
214234
|
-
}
|
|
214235
|
-
function containsPublicProviderLeak(message) {
|
|
214236
|
-
if (!message) return false;
|
|
214237
|
-
return PUBLIC_PROVIDER_LEAK_PATTERNS.some((pattern) => pattern.test(message));
|
|
214238
|
-
}
|
|
214239
|
-
function sanitizePublicProviderText(message, options = {}) {
|
|
214240
|
-
if (message === void 0 || message === null) return null;
|
|
214241
|
-
const trimmed = message.trim();
|
|
214242
|
-
if (trimmed.length === 0) return null;
|
|
214243
|
-
if (!containsPublicProviderLeak(trimmed)) return trimmed;
|
|
214244
|
-
return categorizePublicProviderError(trimmed) ?? options.fallback ?? "CMMD is temporarily unavailable. Check the workspace AI connection and retry.";
|
|
214245
|
-
}
|
|
214246
214418
|
function resolveApexBaseUrl(settings, config) {
|
|
214247
214419
|
return config?.forgeApexBaseUrl || settings.baseUrl || "https://apex.cmmd.ai";
|
|
214248
214420
|
}
|
|
@@ -223671,113 +223843,113 @@ function toRpcClientError(error) {
|
|
|
223671
223843
|
}
|
|
223672
223844
|
//#endregion
|
|
223673
223845
|
//#region ../../packages/effect-acp/src/rpc.ts
|
|
223674
|
-
const InitializeRpc = make$
|
|
223846
|
+
const InitializeRpc = make$29(AGENT_METHODS.initialize, {
|
|
223675
223847
|
payload: InitializeRequest,
|
|
223676
223848
|
success: InitializeResponse,
|
|
223677
223849
|
error: Error$1
|
|
223678
223850
|
});
|
|
223679
|
-
const AuthenticateRpc = make$
|
|
223851
|
+
const AuthenticateRpc = make$29(AGENT_METHODS.authenticate, {
|
|
223680
223852
|
payload: AuthenticateRequest,
|
|
223681
223853
|
success: AuthenticateResponse,
|
|
223682
223854
|
error: Error$1
|
|
223683
223855
|
});
|
|
223684
|
-
const LogoutRpc = make$
|
|
223856
|
+
const LogoutRpc = make$29(AGENT_METHODS.logout, {
|
|
223685
223857
|
payload: LogoutRequest,
|
|
223686
223858
|
success: LogoutResponse,
|
|
223687
223859
|
error: Error$1
|
|
223688
223860
|
});
|
|
223689
|
-
const NewSessionRpc = make$
|
|
223861
|
+
const NewSessionRpc = make$29(AGENT_METHODS.session_new, {
|
|
223690
223862
|
payload: NewSessionRequest,
|
|
223691
223863
|
success: NewSessionResponse,
|
|
223692
223864
|
error: Error$1
|
|
223693
223865
|
});
|
|
223694
|
-
const LoadSessionRpc = make$
|
|
223866
|
+
const LoadSessionRpc = make$29(AGENT_METHODS.session_load, {
|
|
223695
223867
|
payload: LoadSessionRequest,
|
|
223696
223868
|
success: LoadSessionResponse,
|
|
223697
223869
|
error: Error$1
|
|
223698
223870
|
});
|
|
223699
|
-
const ListSessionsRpc = make$
|
|
223871
|
+
const ListSessionsRpc = make$29(AGENT_METHODS.session_list, {
|
|
223700
223872
|
payload: ListSessionsRequest,
|
|
223701
223873
|
success: ListSessionsResponse,
|
|
223702
223874
|
error: Error$1
|
|
223703
223875
|
});
|
|
223704
|
-
const ForkSessionRpc = make$
|
|
223876
|
+
const ForkSessionRpc = make$29(AGENT_METHODS.session_fork, {
|
|
223705
223877
|
payload: ForkSessionRequest,
|
|
223706
223878
|
success: ForkSessionResponse,
|
|
223707
223879
|
error: Error$1
|
|
223708
223880
|
});
|
|
223709
|
-
const ResumeSessionRpc = make$
|
|
223881
|
+
const ResumeSessionRpc = make$29(AGENT_METHODS.session_resume, {
|
|
223710
223882
|
payload: ResumeSessionRequest,
|
|
223711
223883
|
success: ResumeSessionResponse,
|
|
223712
223884
|
error: Error$1
|
|
223713
223885
|
});
|
|
223714
|
-
const CloseSessionRpc = make$
|
|
223886
|
+
const CloseSessionRpc = make$29(AGENT_METHODS.session_close, {
|
|
223715
223887
|
payload: CloseSessionRequest,
|
|
223716
223888
|
success: CloseSessionResponse,
|
|
223717
223889
|
error: Error$1
|
|
223718
223890
|
});
|
|
223719
|
-
const PromptRpc = make$
|
|
223891
|
+
const PromptRpc = make$29(AGENT_METHODS.session_prompt, {
|
|
223720
223892
|
payload: PromptRequest,
|
|
223721
223893
|
success: PromptResponse,
|
|
223722
223894
|
error: Error$1
|
|
223723
223895
|
});
|
|
223724
|
-
const SetSessionModelRpc = make$
|
|
223896
|
+
const SetSessionModelRpc = make$29(AGENT_METHODS.session_set_model, {
|
|
223725
223897
|
payload: SetSessionModelRequest,
|
|
223726
223898
|
success: SetSessionModelResponse,
|
|
223727
223899
|
error: Error$1
|
|
223728
223900
|
});
|
|
223729
|
-
const SetSessionConfigOptionRpc = make$
|
|
223901
|
+
const SetSessionConfigOptionRpc = make$29(AGENT_METHODS.session_set_config_option, {
|
|
223730
223902
|
payload: SetSessionConfigOptionRequest,
|
|
223731
223903
|
success: SetSessionConfigOptionResponse,
|
|
223732
223904
|
error: Error$1
|
|
223733
223905
|
});
|
|
223734
|
-
const ReadTextFileRpc = make$
|
|
223906
|
+
const ReadTextFileRpc = make$29(CLIENT_METHODS.fs_read_text_file, {
|
|
223735
223907
|
payload: ReadTextFileRequest,
|
|
223736
223908
|
success: ReadTextFileResponse,
|
|
223737
223909
|
error: Error$1
|
|
223738
223910
|
});
|
|
223739
|
-
const WriteTextFileRpc = make$
|
|
223911
|
+
const WriteTextFileRpc = make$29(CLIENT_METHODS.fs_write_text_file, {
|
|
223740
223912
|
payload: WriteTextFileRequest,
|
|
223741
223913
|
success: WriteTextFileResponse,
|
|
223742
223914
|
error: Error$1
|
|
223743
223915
|
});
|
|
223744
|
-
const RequestPermissionRpc = make$
|
|
223916
|
+
const RequestPermissionRpc = make$29(CLIENT_METHODS.session_request_permission, {
|
|
223745
223917
|
payload: RequestPermissionRequest,
|
|
223746
223918
|
success: RequestPermissionResponse,
|
|
223747
223919
|
error: Error$1
|
|
223748
223920
|
});
|
|
223749
|
-
const ElicitationRpc = make$
|
|
223921
|
+
const ElicitationRpc = make$29(CLIENT_METHODS.session_elicitation, {
|
|
223750
223922
|
payload: ElicitationRequest,
|
|
223751
223923
|
success: ElicitationResponse,
|
|
223752
223924
|
error: Error$1
|
|
223753
223925
|
});
|
|
223754
|
-
const CreateTerminalRpc = make$
|
|
223926
|
+
const CreateTerminalRpc = make$29(CLIENT_METHODS.terminal_create, {
|
|
223755
223927
|
payload: CreateTerminalRequest,
|
|
223756
223928
|
success: CreateTerminalResponse,
|
|
223757
223929
|
error: Error$1
|
|
223758
223930
|
});
|
|
223759
|
-
const TerminalOutputRpc = make$
|
|
223931
|
+
const TerminalOutputRpc = make$29(CLIENT_METHODS.terminal_output, {
|
|
223760
223932
|
payload: TerminalOutputRequest,
|
|
223761
223933
|
success: TerminalOutputResponse,
|
|
223762
223934
|
error: Error$1
|
|
223763
223935
|
});
|
|
223764
|
-
const ReleaseTerminalRpc = make$
|
|
223936
|
+
const ReleaseTerminalRpc = make$29(CLIENT_METHODS.terminal_release, {
|
|
223765
223937
|
payload: ReleaseTerminalRequest,
|
|
223766
223938
|
success: ReleaseTerminalResponse,
|
|
223767
223939
|
error: Error$1
|
|
223768
223940
|
});
|
|
223769
|
-
const WaitForTerminalExitRpc = make$
|
|
223941
|
+
const WaitForTerminalExitRpc = make$29(CLIENT_METHODS.terminal_wait_for_exit, {
|
|
223770
223942
|
payload: WaitForTerminalExitRequest,
|
|
223771
223943
|
success: WaitForTerminalExitResponse,
|
|
223772
223944
|
error: Error$1
|
|
223773
223945
|
});
|
|
223774
|
-
const KillTerminalRpc = make$
|
|
223946
|
+
const KillTerminalRpc = make$29(CLIENT_METHODS.terminal_kill, {
|
|
223775
223947
|
payload: KillTerminalRequest,
|
|
223776
223948
|
success: KillTerminalResponse,
|
|
223777
223949
|
error: Error$1
|
|
223778
223950
|
});
|
|
223779
|
-
const AgentRpcs = make$
|
|
223780
|
-
const ClientRpcs = make$
|
|
223951
|
+
const AgentRpcs = make$28(InitializeRpc, AuthenticateRpc, LogoutRpc, NewSessionRpc, LoadSessionRpc, ListSessionsRpc, ForkSessionRpc, ResumeSessionRpc, CloseSessionRpc, PromptRpc, SetSessionModelRpc, SetSessionConfigOptionRpc);
|
|
223952
|
+
const ClientRpcs = make$28(ReadTextFileRpc, WriteTextFileRpc, RequestPermissionRpc, ElicitationRpc, CreateTerminalRpc, TerminalOutputRpc, ReleaseTerminalRpc, WaitForTerminalExitRpc, KillTerminalRpc);
|
|
223781
223953
|
//#endregion
|
|
223782
223954
|
//#region ../../packages/effect-acp/src/_internal/shared.ts
|
|
223783
223955
|
const isError = require_Schema$1.is(Error$1);
|
|
@@ -223840,7 +224012,7 @@ function runNotificationHandlers(registration, notification) {
|
|
|
223840
224012
|
return require_Schema$1.forEach(registration.handlers, (handler) => handler(notification).pipe(require_Schema$1.catch_(() => require_Schema$1.void_)), { discard: true });
|
|
223841
224013
|
}
|
|
223842
224014
|
var AcpClient = class extends require_Schema$1.Service()("effect-acp/AcpClient") {};
|
|
223843
|
-
const make$
|
|
224015
|
+
const make$11 = require_Schema$1.fn("effect-acp/AcpClient.make")(function* (stdio, options = {}, terminationError) {
|
|
223844
224016
|
const coreHandlers = {};
|
|
223845
224017
|
const notificationHandlers = {
|
|
223846
224018
|
sessionUpdate: {
|
|
@@ -223908,9 +224080,9 @@ const make$12 = require_Schema$1.fn("effect-acp/AcpClient.make")(function* (stdi
|
|
|
223908
224080
|
[CLIENT_METHODS.terminal_kill]: (payload) => runHandler(coreHandlers.terminalKill, payload, CLIENT_METHODS.terminal_kill).pipe(require_Schema$1.map((result) => result ?? {})),
|
|
223909
224081
|
[CLIENT_METHODS.terminal_release]: (payload) => runHandler(coreHandlers.terminalRelease, payload, CLIENT_METHODS.terminal_release).pipe(require_Schema$1.map((result) => result ?? {}))
|
|
223910
224082
|
}));
|
|
223911
|
-
yield* make$
|
|
224083
|
+
yield* make$23(ClientRpcs).pipe(require_Schema$1.provideService(Protocol, transport.serverProtocol), require_Schema$1.provide(clientHandlerLayer), require_Schema$1.forkScoped);
|
|
223912
224084
|
let nextRpcRequestId = 1n << 32n;
|
|
223913
|
-
const rpc = yield* make$
|
|
224085
|
+
const rpc = yield* make$24(AgentRpcs, { generateRequestId: () => nextRpcRequestId++ }).pipe(require_Schema$1.provideService(Protocol$1, transport.clientProtocol));
|
|
223914
224086
|
return AcpClient.of({
|
|
223915
224087
|
raw: {
|
|
223916
224088
|
notifications: transport.incoming,
|
|
@@ -223997,7 +224169,7 @@ const make$12 = require_Schema$1.fn("effect-acp/AcpClient.make")(function* (stdi
|
|
|
223997
224169
|
const layerChildProcess = (handle, options = {}) => {
|
|
223998
224170
|
const stdio = makeChildStdio(handle);
|
|
223999
224171
|
const terminationError = makeTerminationError(handle);
|
|
224000
|
-
return require_Schema$1.effect(AcpClient, make$
|
|
224172
|
+
return require_Schema$1.effect(AcpClient, make$11(stdio, options, terminationError));
|
|
224001
224173
|
};
|
|
224002
224174
|
//#endregion
|
|
224003
224175
|
//#region src/provider/acp/AcpSessionRuntime.ts
|
|
@@ -225112,7 +225284,7 @@ function makeCursorAdapter(cursorSettings, options) {
|
|
|
225112
225284
|
const nativeEventLogger = options?.nativeEventLogger ?? (options?.nativeEventLogPath !== void 0 ? yield* makeEventNdjsonLogger(options.nativeEventLogPath, { stream: "native" }) : void 0);
|
|
225113
225285
|
const managedNativeEventLogger = options?.nativeEventLogger === void 0 ? nativeEventLogger : void 0;
|
|
225114
225286
|
const sessions = /* @__PURE__ */ new Map();
|
|
225115
|
-
const threadLocksRef = yield* make$
|
|
225287
|
+
const threadLocksRef = yield* make$31(/* @__PURE__ */ new Map());
|
|
225116
225288
|
const runtimeEventPubSub = yield* require_Path.unbounded$1();
|
|
225117
225289
|
const nowIso = require_Schema$1.map(require_Schema$1.now, require_Schema$1.formatIso);
|
|
225118
225290
|
const nextEventId = require_Schema$1.map(nextUUIDv4, (id) => EventId.make(id));
|
|
@@ -234827,7 +234999,7 @@ var CheckpointStore = class extends require_Schema$1.Service()("forge/checkpoint
|
|
|
234827
234999
|
//#endregion
|
|
234828
235000
|
//#region src/checkpointing/Layers/CheckpointDiffQuery.ts
|
|
234829
235001
|
const isTurnDiffResult = require_Schema$1.is(OrchestrationGetTurnDiffResult);
|
|
234830
|
-
const make$
|
|
235002
|
+
const make$10 = require_Schema$1.gen(function* () {
|
|
234831
235003
|
const projectionSnapshotQuery = yield* ProjectionSnapshotQuery;
|
|
234832
235004
|
const checkpointStore = yield* CheckpointStore;
|
|
234833
235005
|
const getTurnDiff = require_Schema$1.fn("getTurnDiff")(function* (input) {
|
|
@@ -234919,7 +235091,7 @@ const make$11 = require_Schema$1.gen(function* () {
|
|
|
234919
235091
|
getFullThreadDiff
|
|
234920
235092
|
};
|
|
234921
235093
|
});
|
|
234922
|
-
const CheckpointDiffQueryLive = require_Schema$1.effect(CheckpointDiffQuery, make$
|
|
235094
|
+
const CheckpointDiffQueryLive = require_Schema$1.effect(CheckpointDiffQuery, make$10);
|
|
234923
235095
|
//#endregion
|
|
234924
235096
|
//#region src/checkpointing/Layers/CheckpointStore.ts
|
|
234925
235097
|
/**
|
|
@@ -237214,7 +237386,7 @@ const GitStatusBroadcasterLive = require_Schema$1.effect(GitStatusBroadcaster, r
|
|
|
237214
237386
|
const changesPubSub = yield* require_Schema$1.acquireRelease(require_Path.unbounded$1(), (pubsub) => require_Path.shutdown$1(pubsub));
|
|
237215
237387
|
const broadcasterScope = yield* require_Schema$1.acquireRelease(require_Schema$1.make$3(), (scope) => require_Schema$1.close(scope, require_Schema$1.void_$1));
|
|
237216
237388
|
const cacheRef = yield* require_HttpServer.make$3(/* @__PURE__ */ new Map());
|
|
237217
|
-
const pollersRef = yield* make$
|
|
237389
|
+
const pollersRef = yield* make$31(/* @__PURE__ */ new Map());
|
|
237218
237390
|
const getCachedStatus = require_Schema$1.fn("getCachedStatus")(function* (cwd) {
|
|
237219
237391
|
return yield* require_HttpServer.get$1(cacheRef).pipe(require_Schema$1.map((cache) => cache.get(cwd) ?? null));
|
|
237220
237392
|
});
|
|
@@ -238786,7 +238958,7 @@ const TextGenerationUsageLive = require_Schema$1.effect(TextGenerationUsage, mak
|
|
|
238786
238958
|
//#region ../../packages/shared/src/KeyedCoalescingWorker.ts
|
|
238787
238959
|
const makeKeyedCoalescingWorker = (options) => require_Schema$1.gen(function* () {
|
|
238788
238960
|
const queue = yield* require_Schema$1.acquireRelease(unbounded(), shutdown);
|
|
238789
|
-
const stateRef = yield* make$
|
|
238961
|
+
const stateRef = yield* make$30({
|
|
238790
238962
|
latestByKey: /* @__PURE__ */ new Map(),
|
|
238791
238963
|
queuedKeys: /* @__PURE__ */ new Set(),
|
|
238792
238964
|
activeKeys: /* @__PURE__ */ new Set()
|
|
@@ -239347,11 +239519,11 @@ const makeTerminalManagerWithOptions = require_Schema$1.fn("makeTerminalManagerW
|
|
|
239347
239519
|
const processKillGraceMs = options.processKillGraceMs ?? DEFAULT_PROCESS_KILL_GRACE_MS;
|
|
239348
239520
|
const maxRetainedInactiveSessions = options.maxRetainedInactiveSessions ?? DEFAULT_MAX_RETAINED_INACTIVE_SESSIONS;
|
|
239349
239521
|
yield* fileSystem.makeDirectory(logsDir, { recursive: true }).pipe(require_Schema$1.orDie);
|
|
239350
|
-
const managerStateRef = yield* make$
|
|
239522
|
+
const managerStateRef = yield* make$31({
|
|
239351
239523
|
sessions: /* @__PURE__ */ new Map(),
|
|
239352
239524
|
killFibers: /* @__PURE__ */ new Map()
|
|
239353
239525
|
});
|
|
239354
|
-
const threadLocksRef = yield* make$
|
|
239526
|
+
const threadLocksRef = yield* make$31(/* @__PURE__ */ new Map());
|
|
239355
239527
|
const terminalEventListeners = /* @__PURE__ */ new Set();
|
|
239356
239528
|
const transitionReceipts = /* @__PURE__ */ new Map();
|
|
239357
239529
|
const workerScope = yield* require_Schema$1.make$3("sequential");
|
|
@@ -242265,6 +242437,18 @@ var SpriteTaskHoldManager = class {
|
|
|
242265
242437
|
return [...this.#holds.keys()];
|
|
242266
242438
|
}
|
|
242267
242439
|
/**
|
|
242440
|
+
* Every hold key currently associated with one thread: what `releaseThread`
|
|
242441
|
+
* releases. Read-only and synchronous, so a caller can snapshot what is
|
|
242442
|
+
* live right now and decide later, from that snapshot, what it is still
|
|
242443
|
+
* safe to release -- rather than asking this manager what is live AFTER
|
|
242444
|
+
* some delay of its own, by which point a fresh acquire may have replaced
|
|
242445
|
+
* the very hold the caller meant to release (SpriteTaskHoldReactor's
|
|
242446
|
+
* session.exited handling does exactly this, forge#3602).
|
|
242447
|
+
*/
|
|
242448
|
+
activeTurnIdsForThread(threadId) {
|
|
242449
|
+
return [...this.#holds.entries()].filter(([, hold]) => hold.threadId === threadId).map(([turnId]) => turnId);
|
|
242450
|
+
}
|
|
242451
|
+
/**
|
|
242268
242452
|
* `maxRefreshes` bounds a hold that has no terminal event of its own, such as a launch
|
|
242269
242453
|
* whose turn may never start. When the budget is spent the hold releases itself.
|
|
242270
242454
|
*
|
|
@@ -242540,7 +242724,7 @@ var SpriteTaskHoldManager = class {
|
|
|
242540
242724
|
* from silently dropping the holds of the other turns running beside it.
|
|
242541
242725
|
*/
|
|
242542
242726
|
async releaseThread(threadId) {
|
|
242543
|
-
const turnIds =
|
|
242727
|
+
const turnIds = this.activeTurnIdsForThread(threadId);
|
|
242544
242728
|
await Promise.all(turnIds.map((turnId) => this.release(turnId)));
|
|
242545
242729
|
}
|
|
242546
242730
|
/**
|
|
@@ -290342,7 +290526,7 @@ async function applyWorkerRecoveryPlan(recovery, input) {
|
|
|
290342
290526
|
if (recovery.kind === "recover") await input.onRecover(recovery);
|
|
290343
290527
|
return recovery.commandToken;
|
|
290344
290528
|
}
|
|
290345
|
-
const make$
|
|
290529
|
+
const make$9 = require_Schema$1.gen(function* () {
|
|
290346
290530
|
const orchestration = yield* OrchestrationEngineService;
|
|
290347
290531
|
const projectionSnapshotQuery = yield* ProjectionSnapshotQuery;
|
|
290348
290532
|
const projectionTurns = yield* ProjectionTurnRepository;
|
|
@@ -290639,7 +290823,7 @@ const make$10 = require_Schema$1.gen(function* () {
|
|
|
290639
290823
|
reconcile
|
|
290640
290824
|
});
|
|
290641
290825
|
});
|
|
290642
|
-
const ApprovedWorkerPlanReactorLive = require_Schema$1.effect(ApprovedWorkerPlanReactor, make$
|
|
290826
|
+
const ApprovedWorkerPlanReactorLive = require_Schema$1.effect(ApprovedWorkerPlanReactor, make$9);
|
|
290643
290827
|
//#endregion
|
|
290644
290828
|
//#region src/orchestration/Services/RuntimeReceiptBus.ts
|
|
290645
290829
|
/**
|
|
@@ -292229,7 +292413,7 @@ function shouldApplyProviderTurnCompleted(activeTurnId, eventTurnId) {
|
|
|
292229
292413
|
if (activeTurnId !== null && eventTurnId === void 0) return false;
|
|
292230
292414
|
return activeTurnId === null || eventTurnId === void 0 || sameId$1(activeTurnId, eventTurnId);
|
|
292231
292415
|
}
|
|
292232
|
-
const make$
|
|
292416
|
+
const make$8 = require_Schema$1.fn("make")(function* () {
|
|
292233
292417
|
const orchestrationEngine = yield* OrchestrationEngineService;
|
|
292234
292418
|
const claudeUsageTelemetry = yield* ClaudeUsageTelemetry;
|
|
292235
292419
|
const claudeUsageScope = yield* require_Schema$1.make$3("parallel");
|
|
@@ -292822,7 +293006,7 @@ const make$9 = require_Schema$1.fn("make")(function* () {
|
|
|
292822
293006
|
drain: worker.drain
|
|
292823
293007
|
};
|
|
292824
293008
|
});
|
|
292825
|
-
const ProviderRuntimeIngestionLive = require_Schema$1.effect(ProviderRuntimeIngestionService, make$
|
|
293009
|
+
const ProviderRuntimeIngestionLive = require_Schema$1.effect(ProviderRuntimeIngestionService, make$8()).pipe(require_Schema$1.provide$1(ProjectionTurnRepositoryLive));
|
|
292826
293010
|
//#endregion
|
|
292827
293011
|
//#region src/usage/Layers/ClaudeUsageTelemetry.ts
|
|
292828
293012
|
/**
|
|
@@ -292874,7 +293058,7 @@ const ClaudeUsageTelemetryLive = require_Schema$1.effect(ClaudeUsageTelemetry, r
|
|
|
292874
293058
|
*/
|
|
292875
293059
|
const makeDrainableWorker = (process) => require_Schema$1.gen(function* () {
|
|
292876
293060
|
const queue = yield* require_Schema$1.acquireRelease(unbounded(), shutdown);
|
|
292877
|
-
const outstanding = yield* make$
|
|
293061
|
+
const outstanding = yield* make$30(0);
|
|
292878
293062
|
yield* take(queue).pipe(require_Schema$1.tap((a) => require_Schema$1.ensuring(process(a), update$1(outstanding, (n) => n - 1))), require_Schema$1.forever, require_Schema$1.forkScoped);
|
|
292879
293063
|
const drain = get$1(outstanding).pipe(require_Schema$1.tap((n) => n > 0 ? require_Schema$1.txRetry : require_Schema$1.void_), require_Schema$1.tx);
|
|
292880
293064
|
const enqueue = (element) => offer(queue, element).pipe(require_Schema$1.tap(() => update$1(outstanding, (n) => n + 1)), require_Schema$1.tx);
|
|
@@ -293025,52 +293209,6 @@ function applyThreadGoalPreamble(goal, input) {
|
|
|
293025
293209
|
return trimmedInput.length > 0 ? `${preamble}\n\n${trimmedInput}` : preamble;
|
|
293026
293210
|
}
|
|
293027
293211
|
//#endregion
|
|
293028
|
-
//#region src/orchestration/providerRetryableFailure.ts
|
|
293029
|
-
/**
|
|
293030
|
-
* Classifies a provider turn-start failure as a retryable rate-limit or
|
|
293031
|
-
* transient-availability failure (429/503), a terminal failure that names why
|
|
293032
|
-
* it will never clear on its own, or unrecognized (null).
|
|
293033
|
-
*
|
|
293034
|
-
* CMMD-Center/forge#3558: a 429 from CMMD's provider egress used to leave no
|
|
293035
|
-
* trace at all, because nothing in the turn-start path recognized it as a
|
|
293036
|
-
* distinct, retryable failure. `ProviderCommandReactor` uses this to decide
|
|
293037
|
-
* whether to retry a turn start with backoff, and to name the provider,
|
|
293038
|
-
* status and Retry-After in the `provider.turn.start.failed` activity CMMD's
|
|
293039
|
-
* watchdog reads once retries are exhausted.
|
|
293040
|
-
*
|
|
293041
|
-
* Reuses `isProviderRateOrQuotaError` (the same predicate the public-copy
|
|
293042
|
-
* sanitizer uses to recognize a rate-limit message) rather than restating its
|
|
293043
|
-
* word list here.
|
|
293044
|
-
*/
|
|
293045
|
-
const SERVICE_UNAVAILABLE_PATTERN = /\b(503|service\s+unavailable)\b/i;
|
|
293046
|
-
const RATE_LIMITED_PAST_TENSE_PATTERN = /\brate[\s-]?limit(?:ed|ing)?\b/i;
|
|
293047
|
-
const QUOTA_OR_USAGE_LIMIT_PATTERN = /\b(usage[ _-]limit|usage_limit_reached|quota|insufficient_quota)\b/i;
|
|
293048
|
-
const EXPLICIT_429_PATTERN = /\b429\b/;
|
|
293049
|
-
const RETRY_AFTER_SECONDS_PATTERN = /retry-after[^0-9]{0,10}(\d+)|(?:try again|retry)\s+in\s+(\d+)\s*(?:s\b|sec(?:onds?)?\b)?/i;
|
|
293050
|
-
function parseRetryAfterSeconds(detail) {
|
|
293051
|
-
const match = detail.match(RETRY_AFTER_SECONDS_PATTERN);
|
|
293052
|
-
if (!match) return null;
|
|
293053
|
-
const raw = match[1] ?? match[2];
|
|
293054
|
-
const seconds = raw ? Number(raw) : NaN;
|
|
293055
|
-
return Number.isFinite(seconds) ? seconds : null;
|
|
293056
|
-
}
|
|
293057
|
-
function classifyRetryableProviderFailure(detail) {
|
|
293058
|
-
if (!detail || detail.trim().length === 0) return null;
|
|
293059
|
-
if (QUOTA_OR_USAGE_LIMIT_PATTERN.test(detail) && !EXPLICIT_429_PATTERN.test(detail)) return {
|
|
293060
|
-
kind: "terminal",
|
|
293061
|
-
reason: "quota",
|
|
293062
|
-
message: detail
|
|
293063
|
-
};
|
|
293064
|
-
const isRateLimited = isProviderRateOrQuotaError(detail) || RATE_LIMITED_PAST_TENSE_PATTERN.test(detail);
|
|
293065
|
-
const isUnavailable = SERVICE_UNAVAILABLE_PATTERN.test(detail);
|
|
293066
|
-
if (!isRateLimited && !isUnavailable) return null;
|
|
293067
|
-
return {
|
|
293068
|
-
kind: "retryable",
|
|
293069
|
-
status: isRateLimited ? 429 : 503,
|
|
293070
|
-
retryAfterSeconds: parseRetryAfterSeconds(detail)
|
|
293071
|
-
};
|
|
293072
|
-
}
|
|
293073
|
-
//#endregion
|
|
293074
293212
|
//#region src/orchestration/Layers/ProviderCommandReactor.ts
|
|
293075
293213
|
function toNonEmptyProviderInput(value) {
|
|
293076
293214
|
const normalized = value?.trim();
|
|
@@ -293444,7 +293582,7 @@ function buildGeneratedWorktreeBranchName(raw) {
|
|
|
293444
293582
|
const branchFragment = (normalized.startsWith(`forge/`) ? normalized.slice(`${WORKTREE_BRANCH_PREFIX}/`.length) : normalized).replace(/[^a-z0-9/_-]+/g, "-").replace(/\/+/g, "/").replace(/-+/g, "-").replace(/^[./_-]+|[./_-]+$/g, "").slice(0, 64).replace(/[./_-]+$/g, "");
|
|
293445
293583
|
return `${WORKTREE_BRANCH_PREFIX}/${branchFragment.length > 0 ? branchFragment : "update"}`;
|
|
293446
293584
|
}
|
|
293447
|
-
const make$
|
|
293585
|
+
const make$7 = require_Schema$1.gen(function* () {
|
|
293448
293586
|
const orchestrationEngine = yield* OrchestrationEngineService;
|
|
293449
293587
|
const providerService = yield* ProviderService;
|
|
293450
293588
|
const git = yield* GitCore;
|
|
@@ -294324,7 +294462,7 @@ const make$8 = require_Schema$1.gen(function* () {
|
|
|
294324
294462
|
})
|
|
294325
294463
|
};
|
|
294326
294464
|
});
|
|
294327
|
-
const ProviderCommandReactorLive = require_Schema$1.effect(ProviderCommandReactor, make$
|
|
294465
|
+
const ProviderCommandReactorLive = require_Schema$1.effect(ProviderCommandReactor, make$7);
|
|
294328
294466
|
function withProviderTurnStartTimeout(operation, onTimeout, timeout = require_Schema$1.seconds(45)) {
|
|
294329
294467
|
return operation.pipe(require_Schema$1.timeout(timeout), require_Schema$1.catchTag("TimeoutError", () => onTimeout));
|
|
294330
294468
|
}
|
|
@@ -295061,7 +295199,7 @@ function findSessionWithCwd(session) {
|
|
|
295061
295199
|
cwd: session.cwd
|
|
295062
295200
|
}) : require_Schema$1.none();
|
|
295063
295201
|
}
|
|
295064
|
-
const make$
|
|
295202
|
+
const make$6 = require_Schema$1.gen(function* () {
|
|
295065
295203
|
const orchestrationEngine = yield* OrchestrationEngineService;
|
|
295066
295204
|
const providerService = yield* ProviderService;
|
|
295067
295205
|
const checkpointStore = yield* CheckpointStore;
|
|
@@ -295248,12 +295386,62 @@ const make$7 = require_Schema$1.gen(function* () {
|
|
|
295248
295386
|
createdAt: input.createdAt
|
|
295249
295387
|
});
|
|
295250
295388
|
});
|
|
295389
|
+
/**
|
|
295390
|
+
* The one durable, deterministic-id activity that records how a turn ended
|
|
295391
|
+
* (CMMD-Center/forge#3562 piece A, CMMD-Center/CMMD#5822): `completed`,
|
|
295392
|
+
* `interrupted` (an abort or a provider cancellation), or `failed` with the
|
|
295393
|
+
* provider's own error message. Recorded here, ahead of every
|
|
295394
|
+
* checkpoint-specific early return below, so it fires for every turn
|
|
295395
|
+
* regardless of whether this workspace can capture a git checkpoint at
|
|
295396
|
+
* all -- unlike a checkpoint, this never depends on `resolveCheckpointCwd`.
|
|
295397
|
+
*
|
|
295398
|
+
* The activity id is derived from the turn id, never `crypto.randomUUID()`,
|
|
295399
|
+
* so a redelivered `turn.completed` for the same turn replaces the same
|
|
295400
|
+
* row rather than adding a second one. The guard below additionally
|
|
295401
|
+
* refuses to touch a turn that already has one: first write wins, so a
|
|
295402
|
+
* later, different signal for the same turn can never overwrite an
|
|
295403
|
+
* outcome CMMD may already have acknowledged.
|
|
295404
|
+
*
|
|
295405
|
+
* Deriving the wire `turn_status` event from a new activity recorded at
|
|
295406
|
+
* the moment the turn actually ends -- not from `thread.latestTurn` or
|
|
295407
|
+
* `thread.checkpoints`, both of which already hold outcomes for turns that
|
|
295408
|
+
* settled before this shipped -- is deliberate: those would insert a brand
|
|
295409
|
+
* new event into history CMMD already acknowledged for every existing
|
|
295410
|
+
* thread, which `RuntimeThreadHistoryConflict` exists specifically to
|
|
295411
|
+
* reject (CMMD-Center/forge#3497). A turn that settled before this shipped
|
|
295412
|
+
* gets no terminal event; only a turn that ends after it does.
|
|
295413
|
+
*/
|
|
295414
|
+
const recordTurnTerminalStatus = require_Schema$1.fn("recordTurnTerminalStatus")(function* (event, thread, turnId) {
|
|
295415
|
+
const activityId = turnTerminalStatusActivityId(turnId);
|
|
295416
|
+
if (thread.activities.some((activity) => activity.id === activityId)) return;
|
|
295417
|
+
const outcome = turnTerminalOutcomeFromRuntimeState(event.payload.state);
|
|
295418
|
+
const recordedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
295419
|
+
yield* orchestrationEngine.dispatch({
|
|
295420
|
+
type: "thread.activity.append",
|
|
295421
|
+
commandId: serverCommandId$1("turn-terminal-status"),
|
|
295422
|
+
threadId: event.threadId,
|
|
295423
|
+
activity: {
|
|
295424
|
+
id: EventId.make(activityId),
|
|
295425
|
+
tone: outcome === "failed" ? "error" : "info",
|
|
295426
|
+
kind: TURN_TERMINAL_STATUS_ACTIVITY_KIND,
|
|
295427
|
+
summary: `Turn ${outcome}`,
|
|
295428
|
+
payload: {
|
|
295429
|
+
outcome,
|
|
295430
|
+
...outcome === "failed" && event.payload.errorMessage ? { errorMessage: event.payload.errorMessage } : {}
|
|
295431
|
+
},
|
|
295432
|
+
turnId,
|
|
295433
|
+
createdAt: recordedAt
|
|
295434
|
+
},
|
|
295435
|
+
createdAt: recordedAt
|
|
295436
|
+
});
|
|
295437
|
+
});
|
|
295251
295438
|
const captureCheckpointFromTurnCompletion = require_Schema$1.fn("captureCheckpointFromTurnCompletion")(function* (event) {
|
|
295252
295439
|
const turnId = toTurnId(event.turnId);
|
|
295253
295440
|
if (!turnId) return;
|
|
295254
295441
|
const readModel = yield* orchestrationEngine.getReadModel();
|
|
295255
295442
|
const thread = readModel.threads.find((entry) => entry.id === event.threadId);
|
|
295256
295443
|
if (!thread) return;
|
|
295444
|
+
yield* recordTurnTerminalStatus(event, thread, turnId);
|
|
295257
295445
|
if (thread.session?.activeTurnId && !sameId(thread.session.activeTurnId, turnId)) return;
|
|
295258
295446
|
if (thread.checkpoints.some((checkpoint) => checkpoint.turnId === turnId && checkpoint.status !== "missing")) return;
|
|
295259
295447
|
const checkpointCwd = yield* resolveCheckpointCwd({
|
|
@@ -295552,7 +295740,10 @@ const make$7 = require_Schema$1.gen(function* () {
|
|
|
295552
295740
|
drain: worker.drain
|
|
295553
295741
|
};
|
|
295554
295742
|
});
|
|
295555
|
-
const CheckpointReactorLive = require_Schema$1.effect(CheckpointReactor, make$
|
|
295743
|
+
const CheckpointReactorLive = require_Schema$1.effect(CheckpointReactor, make$6);
|
|
295744
|
+
//#endregion
|
|
295745
|
+
//#region src/runtimeReplication/Services/RuntimeReplicationThreadFlush.ts
|
|
295746
|
+
var RuntimeReplicationThreadFlush = class extends require_Schema$1.Service()("forge/runtimeReplication/Services/RuntimeReplicationThreadFlush") {};
|
|
295556
295747
|
//#endregion
|
|
295557
295748
|
//#region src/orchestration/Layers/SpriteTaskHoldReactor.ts
|
|
295558
295749
|
/**
|
|
@@ -295569,6 +295760,48 @@ const CheckpointReactorLive = require_Schema$1.effect(CheckpointReactor, make$7)
|
|
|
295569
295760
|
* `turn.started` / `turn.completed` through `ProviderService.streamEvents`.
|
|
295570
295761
|
*/
|
|
295571
295762
|
/**
|
|
295763
|
+
* Bound for how long a terminal turn event (`turn.completed` / `turn.aborted`)
|
|
295764
|
+
* waits on that thread's pending replication before releasing the sprite's
|
|
295765
|
+
* turn hold anyway (forge#3600). The sprite freezes about a second after the
|
|
295766
|
+
* hold goes, so this is also roughly how much longer a finished turn's sprite
|
|
295767
|
+
* stays billed.
|
|
295768
|
+
*
|
|
295769
|
+
* Justified from the numbers already in this codebase, not a guess: the
|
|
295770
|
+
* outbox drain loop claims and posts on a 2 s tick
|
|
295771
|
+
* (`Schedule.spaced("2 seconds")` in RuntimeReplication.ts), each CMMD publish
|
|
295772
|
+
* attempt has its own 10 s deadline (`RUNTIME_REPLICATION_TIMEOUT_MS` in
|
|
295773
|
+
* RuntimeReplicationClient.ts), and `claim()` orders a thread's inventory row
|
|
295774
|
+
* ahead of its thread-events row, so one tick can mean two requests before the
|
|
295775
|
+
* thread's own batch goes out. 15 s covers one drain tick plus one full
|
|
295776
|
+
* publish attempt with headroom for that second request, while still keeping
|
|
295777
|
+
* a completed turn's sprite from staying billed anywhere near CMMD's own
|
|
295778
|
+
* stalled-turn sweep window (production: about 15 minutes, per forge#3600).
|
|
295779
|
+
*/
|
|
295780
|
+
const REPLICATION_FLUSH_TIMEOUT_MS = 15e3;
|
|
295781
|
+
/**
|
|
295782
|
+
* How often the flush re-checks the thread's outbox row while waiting. Short
|
|
295783
|
+
* enough that the wait tracks CMMD's actual ack latency (typically well under
|
|
295784
|
+
* a second) rather than the bound, long enough that a 15 s wait costs at most
|
|
295785
|
+
* about 60 reads against the outbox table.
|
|
295786
|
+
*/
|
|
295787
|
+
const REPLICATION_FLUSH_POLL_INTERVAL_MS = 250;
|
|
295788
|
+
/**
|
|
295789
|
+
* A single extra wait before trusting a flush's very first "nothing pending"
|
|
295790
|
+
* read (forge#3600 review follow-up). SpriteTaskHoldReactor and
|
|
295791
|
+
* RuntimeReplication's own domain-event-driven enqueue are independent
|
|
295792
|
+
* subscribers of the same ProviderService.streamEvents broadcast: this
|
|
295793
|
+
* reactor can see turn.completed and read the outbox before the OTHER
|
|
295794
|
+
* subscriber has finished projecting the turn's final events into a row. In
|
|
295795
|
+
* both production runs behind forge#3600, the final assistant_message and
|
|
295796
|
+
* turn_usage writes landed about a second apart from each other (00:43:15Z
|
|
295797
|
+
* and 00:43:16Z), so an immediate "nothing pending" read cannot be trusted:
|
|
295798
|
+
* that is exactly the race that stranded both turns. One settle wait,
|
|
295799
|
+
* re-checked once, closes it without turning every genuinely idle turn's
|
|
295800
|
+
* release into a long poll -- a thread that already has nothing to replicate
|
|
295801
|
+
* pays this once, never the full flushTimeoutMs bound.
|
|
295802
|
+
*/
|
|
295803
|
+
const REPLICATION_FLUSH_SETTLE_MS = 1e3;
|
|
295804
|
+
/**
|
|
295572
295805
|
* A launch hold refreshes every 60 s, so this budget is about ten minutes. A launch whose turn
|
|
295573
295806
|
* never starts, because the provider refused it or the process died first, has no event to
|
|
295574
295807
|
* release it. The budget is what stops that hold from keeping the sprite billing.
|
|
@@ -295586,8 +295819,69 @@ const TURN_START_HOLD_MAX_REFRESHES = 10;
|
|
|
295586
295819
|
/** The hold id for `holdTurnStart` / `releaseTurnStart`. Distinct from `launchHoldId` on purpose:
|
|
295587
295820
|
* see the shape's doc comment on `holdTurnStart`. */
|
|
295588
295821
|
const turnStartHoldId = (key) => `turn-start-${key}`;
|
|
295589
|
-
const
|
|
295822
|
+
const makeSpriteTaskHoldReactor = (overrides = {}) => require_Schema$1.gen(function* () {
|
|
295590
295823
|
const providerService = yield* ProviderService;
|
|
295824
|
+
const replicationOutbox = yield* RuntimeReplicationThreadFlush;
|
|
295825
|
+
const replicationRuntimeId = resolveRuntimeReplicationRuntimeId(yield* ServerConfig);
|
|
295826
|
+
const flushTimeoutMs = overrides.replicationFlushTimeoutMs ?? REPLICATION_FLUSH_TIMEOUT_MS;
|
|
295827
|
+
const flushPollIntervalMs = overrides.replicationFlushPollIntervalMs ?? REPLICATION_FLUSH_POLL_INTERVAL_MS;
|
|
295828
|
+
const flushSettleMs = overrides.replicationFlushSettleMs ?? REPLICATION_FLUSH_SETTLE_MS;
|
|
295829
|
+
/**
|
|
295830
|
+
* Waits for CMMD to acknowledge this thread's outstanding replication -- or
|
|
295831
|
+
* for nothing to have been pending in the first place -- before the caller
|
|
295832
|
+
* releases the turn hold that keeps the sprite awake for the outbox drain
|
|
295833
|
+
* loop to run (forge#3600). Bounded so a wedged publish cannot hold a
|
|
295834
|
+
* finished turn's sprite open indefinitely: the bound firing releases
|
|
295835
|
+
* anyway and logs a warning with however much was still outstanding.
|
|
295836
|
+
*
|
|
295837
|
+
* Never fails: a defect from the outbox read (a SQL error, say) is caught
|
|
295838
|
+
* and treated the same as a timeout -- release the hold rather than let a
|
|
295839
|
+
* replication-read bug strand the sprite awake, or worse, crash the worker
|
|
295840
|
+
* that also has to release every OTHER turn's hold.
|
|
295841
|
+
*/
|
|
295842
|
+
const flushThreadReplication = (threadId) => {
|
|
295843
|
+
if (replicationRuntimeId === void 0) return require_Schema$1.void_;
|
|
295844
|
+
const runtimeId = replicationRuntimeId;
|
|
295845
|
+
const streamKey = `thread:${threadId}`;
|
|
295846
|
+
const startedAt = Date.now();
|
|
295847
|
+
const poll = (phase) => replicationOutbox.readPendingCount({
|
|
295848
|
+
runtimeId,
|
|
295849
|
+
streamKey
|
|
295850
|
+
}).pipe(require_Schema$1.flatMap((pending) => {
|
|
295851
|
+
if (pending === 0) {
|
|
295852
|
+
if (phase === "initial") return require_Schema$1.sleep(flushSettleMs).pipe(require_Schema$1.andThen(require_Schema$1.suspend$1(() => poll("settle-recheck"))));
|
|
295853
|
+
return require_Schema$1.succeed({
|
|
295854
|
+
outcome: phase === "settle-recheck" ? "nothing_pending" : "delivered",
|
|
295855
|
+
pending,
|
|
295856
|
+
settled: phase === "settle-recheck"
|
|
295857
|
+
});
|
|
295858
|
+
}
|
|
295859
|
+
if (Date.now() - startedAt >= flushTimeoutMs) return require_Schema$1.succeed({
|
|
295860
|
+
outcome: "timed_out",
|
|
295861
|
+
pending,
|
|
295862
|
+
settled: false
|
|
295863
|
+
});
|
|
295864
|
+
return require_Schema$1.sleep(flushPollIntervalMs).pipe(require_Schema$1.andThen(require_Schema$1.suspend$1(() => poll("steady"))));
|
|
295865
|
+
}));
|
|
295866
|
+
return poll("initial").pipe(require_Schema$1.flatMap(({ outcome, pending, settled }) => {
|
|
295867
|
+
const elapsedMs = Date.now() - startedAt;
|
|
295868
|
+
const logOutcome = require_Schema$1.logInfo("sprite task hold replication flush", {
|
|
295869
|
+
threadId,
|
|
295870
|
+
outcome,
|
|
295871
|
+
pending,
|
|
295872
|
+
elapsedMs,
|
|
295873
|
+
...settled ? { settledMs: flushSettleMs } : {}
|
|
295874
|
+
});
|
|
295875
|
+
return outcome === "timed_out" ? logOutcome.pipe(require_Schema$1.andThen(require_Schema$1.logWarning("sprite task hold replication flush timed out; releasing the turn hold anyway", {
|
|
295876
|
+
threadId,
|
|
295877
|
+
pending,
|
|
295878
|
+
elapsedMs
|
|
295879
|
+
}))) : logOutcome;
|
|
295880
|
+
}), require_Schema$1.catchCause((cause) => require_Schema$1.logError("sprite task hold replication flush failed; releasing the turn hold anyway", {
|
|
295881
|
+
threadId,
|
|
295882
|
+
cause: require_Schema$1.pretty(cause)
|
|
295883
|
+
})));
|
|
295884
|
+
};
|
|
295591
295885
|
const manager = makeSpriteTaskHoldManager(process.env, (message, cause) => {
|
|
295592
295886
|
require_Schema$1.runFork(require_Schema$1.logWarning(message, { cause: cause instanceof Error ? cause.message : cause }));
|
|
295593
295887
|
}, (event) => {
|
|
@@ -295616,61 +295910,112 @@ const make$6 = require_Schema$1.gen(function* () {
|
|
|
295616
295910
|
const launchCallers = /* @__PURE__ */ new Map();
|
|
295617
295911
|
const launchGeneration = /* @__PURE__ */ new Map();
|
|
295618
295912
|
const turnLaunchGeneration = /* @__PURE__ */ new Map();
|
|
295913
|
+
const turnHoldGeneration = /* @__PURE__ */ new Map();
|
|
295914
|
+
let nextTurnHoldGeneration = 0;
|
|
295619
295915
|
/**
|
|
295620
|
-
*
|
|
295621
|
-
*
|
|
295622
|
-
*
|
|
295623
|
-
*
|
|
295624
|
-
*
|
|
295625
|
-
*
|
|
295626
|
-
*
|
|
295627
|
-
* release it here when no such newer launch has started since this turn's
|
|
295628
|
-
* own turn.started was processed (CodeRabbit review, forge#3592). A no-op
|
|
295629
|
-
* when this turn's own generation is stale, or when the hold was already
|
|
295630
|
-
* released.
|
|
295916
|
+
* Release a launch hold left over from a turn hand-off that never
|
|
295917
|
+
* confirmed, once the turn it was covering has reached a terminal state
|
|
295918
|
+
* one way or another. `capturedGeneration` must be read from
|
|
295919
|
+
* `turnLaunchGeneration` by the caller before this runs -- see that map's
|
|
295920
|
+
* own doc comment for why the read cannot happen in here. A no-op when
|
|
295921
|
+
* nothing was captured, when a newer launch has since superseded it, or
|
|
295922
|
+
* when the hold was already released.
|
|
295631
295923
|
*/
|
|
295632
|
-
const
|
|
295633
|
-
const capturedGeneration = turnLaunchGeneration.get(turnId);
|
|
295634
|
-
turnLaunchGeneration.delete(turnId);
|
|
295924
|
+
const releaseLingeringLaunchHoldIfCurrent = async (threadId, capturedGeneration) => {
|
|
295635
295925
|
if (manager === null || capturedGeneration === void 0) return;
|
|
295636
295926
|
if (launchGeneration.get(threadId) !== capturedGeneration) return;
|
|
295637
295927
|
await manager.release(launchHoldId(threadId));
|
|
295638
295928
|
};
|
|
295929
|
+
/**
|
|
295930
|
+
* Release a completed or aborted turn's hold, once its thread's pending
|
|
295931
|
+
* replication has flushed (forge#3600). Skips the release entirely once
|
|
295932
|
+
* `turnHoldGeneration` has moved past `expectedGeneration`: see that map's
|
|
295933
|
+
* own doc comment for the reused-turnId race this guards against.
|
|
295934
|
+
*/
|
|
295935
|
+
const processTerminalItem = (item) => flushThreadReplication(item.threadId).pipe(require_Schema$1.andThen(require_Schema$1.promise(async () => {
|
|
295936
|
+
if (manager === null) return;
|
|
295937
|
+
if (turnHoldGeneration.get(item.turnId) !== item.expectedGeneration) return;
|
|
295938
|
+
await manager.release(item.turnId);
|
|
295939
|
+
await releaseLingeringLaunchHoldIfCurrent(item.threadId, item.capturedLaunchGeneration);
|
|
295940
|
+
if (turnHoldGeneration.get(item.turnId) === item.expectedGeneration) turnHoldGeneration.delete(item.turnId);
|
|
295941
|
+
})));
|
|
295942
|
+
/**
|
|
295943
|
+
* Release every hold a dead session was covering, once its thread's
|
|
295944
|
+
* pending replication has flushed (#3603 item 1: this used to call
|
|
295945
|
+
* `manager.releaseThread` on the spot, with nothing stopping a provider
|
|
295946
|
+
* process that died right after its own turn from stranding that turn's
|
|
295947
|
+
* final events the same way forge#3600 did for a clean completion).
|
|
295948
|
+
* `turns` and `capturedLaunchGeneration` are snapshotted by the caller at
|
|
295949
|
+
* session.exited time, BEFORE the flush runs: a launch or a turn that
|
|
295950
|
+
* starts on this thread WHILE the flush is running must survive. Reading
|
|
295951
|
+
* "what is live for this thread" only AFTER the flush -- the naive
|
|
295952
|
+
* flush-then-releaseThread shape -- would reopen the exact hand-off gap
|
|
295953
|
+
* forge#3589 already closed once, just moved behind a longer wait.
|
|
295954
|
+
*/
|
|
295955
|
+
const processSessionExited = (item) => flushThreadReplication(item.threadId).pipe(require_Schema$1.andThen(require_Schema$1.promise(async () => {
|
|
295956
|
+
if (manager === null) return;
|
|
295957
|
+
await Promise.all(item.turns.filter((turn) => turnHoldGeneration.get(turn.turnId) === turn.expectedGeneration).map(async (turn) => {
|
|
295958
|
+
await manager.release(turn.turnId);
|
|
295959
|
+
if (turnHoldGeneration.get(turn.turnId) === turn.expectedGeneration) turnHoldGeneration.delete(turn.turnId);
|
|
295960
|
+
}));
|
|
295961
|
+
await releaseLingeringLaunchHoldIfCurrent(item.threadId, item.capturedLaunchGeneration);
|
|
295962
|
+
})));
|
|
295639
295963
|
const start = require_Schema$1.fn("start")(function* () {
|
|
295640
295964
|
if (manager === null) return;
|
|
295965
|
+
const terminalFibers = yield* require_HttpServer.make$4();
|
|
295966
|
+
const onTurnStarted = (turnIdKey, threadId) => {
|
|
295967
|
+
const generation = launchGeneration.get(threadId) ?? 0;
|
|
295968
|
+
turnHoldGeneration.set(turnIdKey, ++nextTurnHoldGeneration);
|
|
295969
|
+
return require_Schema$1.promise(async () => {
|
|
295970
|
+
const outcome = await manager.acquire(turnIdKey, threadId);
|
|
295971
|
+
launchCallers.delete(threadId);
|
|
295972
|
+
turnLaunchGeneration.set(turnIdKey, generation);
|
|
295973
|
+
if (outcome === "succeeded") await manager.release(launchHoldId(threadId));
|
|
295974
|
+
});
|
|
295975
|
+
};
|
|
295976
|
+
/** Shared by turn.completed and turn.aborted: see the dispatch below for why they are distinct wire events but handled identically. */
|
|
295977
|
+
const onTerminalTurnEvent = (turnIdKey, threadIdKey) => {
|
|
295978
|
+
const capturedLaunchGeneration = turnLaunchGeneration.get(turnIdKey);
|
|
295979
|
+
turnLaunchGeneration.delete(turnIdKey);
|
|
295980
|
+
return require_HttpServer.run(terminalFibers, processTerminalItem({
|
|
295981
|
+
turnId: turnIdKey,
|
|
295982
|
+
threadId: threadIdKey,
|
|
295983
|
+
expectedGeneration: turnHoldGeneration.get(turnIdKey) ?? 0,
|
|
295984
|
+
capturedLaunchGeneration
|
|
295985
|
+
})).pipe(require_Schema$1.asVoid);
|
|
295986
|
+
};
|
|
295987
|
+
const onSessionExited = (threadId) => {
|
|
295988
|
+
launchCallers.delete(threadId);
|
|
295989
|
+
const launchKey = launchHoldId(threadId);
|
|
295990
|
+
const turns = manager.activeTurnIdsForThread(threadId).filter((turnId) => turnId !== launchKey).map((turnId) => ({
|
|
295991
|
+
turnId,
|
|
295992
|
+
expectedGeneration: turnHoldGeneration.get(turnId) ?? 0
|
|
295993
|
+
}));
|
|
295994
|
+
for (const turn of turns) turnLaunchGeneration.delete(turn.turnId);
|
|
295995
|
+
const capturedLaunchGeneration = launchGeneration.get(threadId);
|
|
295996
|
+
return require_HttpServer.run(terminalFibers, processSessionExited({
|
|
295997
|
+
threadId,
|
|
295998
|
+
turns,
|
|
295999
|
+
capturedLaunchGeneration
|
|
296000
|
+
})).pipe(require_Schema$1.asVoid);
|
|
296001
|
+
};
|
|
295641
296002
|
yield* require_Schema$1.forkScoped(require_Path.runForEach(providerService.streamEvents, (event) => {
|
|
295642
296003
|
if (event.type === "turn.started") {
|
|
295643
296004
|
const turnId = event.turnId;
|
|
295644
296005
|
if (turnId === void 0) return require_Schema$1.void_;
|
|
295645
|
-
|
|
295646
|
-
const generation = launchGeneration.get(threadId) ?? 0;
|
|
295647
|
-
return require_Schema$1.promise(async () => {
|
|
295648
|
-
const outcome = await manager.acquire(String(turnId), threadId);
|
|
295649
|
-
launchCallers.delete(threadId);
|
|
295650
|
-
turnLaunchGeneration.set(String(turnId), generation);
|
|
295651
|
-
if (outcome === "succeeded") await manager.release(launchHoldId(threadId));
|
|
295652
|
-
});
|
|
296006
|
+
return onTurnStarted(String(turnId), String(event.threadId));
|
|
295653
296007
|
}
|
|
295654
296008
|
if (event.type === "turn.completed") {
|
|
295655
296009
|
const turnId = event.turnId;
|
|
295656
296010
|
if (turnId === void 0) return require_Schema$1.void_;
|
|
295657
|
-
return
|
|
295658
|
-
await manager.release(String(turnId));
|
|
295659
|
-
await releaseLingeringLaunchHold(String(turnId), String(event.threadId));
|
|
295660
|
-
});
|
|
296011
|
+
return onTerminalTurnEvent(String(turnId), String(event.threadId));
|
|
295661
296012
|
}
|
|
295662
296013
|
if (event.type === "turn.aborted") {
|
|
295663
296014
|
const turnId = event.turnId;
|
|
295664
296015
|
if (turnId === void 0) return require_Schema$1.void_;
|
|
295665
|
-
return
|
|
295666
|
-
await manager.release(String(turnId));
|
|
295667
|
-
await releaseLingeringLaunchHold(String(turnId), String(event.threadId));
|
|
295668
|
-
});
|
|
295669
|
-
}
|
|
295670
|
-
if (event.type === "session.exited") {
|
|
295671
|
-
launchCallers.delete(String(event.threadId));
|
|
295672
|
-
return require_Schema$1.promise(() => manager.releaseThread(String(event.threadId)));
|
|
296016
|
+
return onTerminalTurnEvent(String(turnId), String(event.threadId));
|
|
295673
296017
|
}
|
|
296018
|
+
if (event.type === "session.exited") return onSessionExited(String(event.threadId));
|
|
295674
296019
|
return require_Schema$1.void_;
|
|
295675
296020
|
}));
|
|
295676
296021
|
});
|
|
@@ -295708,7 +296053,7 @@ const make$6 = require_Schema$1.gen(function* () {
|
|
|
295708
296053
|
releaseAll: onManager((taskHolds) => taskHolds.releaseAll())
|
|
295709
296054
|
};
|
|
295710
296055
|
});
|
|
295711
|
-
const SpriteTaskHoldReactorLive = require_Schema$1.effect(SpriteTaskHoldReactor,
|
|
296056
|
+
const SpriteTaskHoldReactorLive = require_Schema$1.effect(SpriteTaskHoldReactor, makeSpriteTaskHoldReactor());
|
|
295712
296057
|
//#endregion
|
|
295713
296058
|
//#region src/orchestration/Layers/PlanTaskCreationReactor.ts
|
|
295714
296059
|
var PlanMaterializationRequestError = class extends require_Schema$1.TaggedError("PlanMaterializationRequestError") {};
|
|
@@ -298988,7 +299333,7 @@ const make$3 = /* @__PURE__ */ require_Schema$1.fnUntraced(function* (options) {
|
|
|
298988
299333
|
excludeLogSpans: options.excludeLogSpans ?? false,
|
|
298989
299334
|
clock: yield* require_Schema$1.Clock
|
|
298990
299335
|
};
|
|
298991
|
-
return make$
|
|
299336
|
+
return make$32((options) => {
|
|
298992
299337
|
exporter.push(makeLogRecord(options, opts));
|
|
298993
299338
|
});
|
|
298994
299339
|
});
|
|
@@ -299885,7 +300230,7 @@ function resolveBuildCommitFromEnv(env) {
|
|
|
299885
300230
|
* environment descriptor down instead of reporting an honest "unknown".
|
|
299886
300231
|
*/
|
|
299887
300232
|
function readBakedBuildCommit() {
|
|
299888
|
-
return "
|
|
300233
|
+
return "c825d8a74e28836b97016dbd8c2abc730841a622";
|
|
299889
300234
|
}
|
|
299890
300235
|
async function resolveServerBuildCommit(input) {
|
|
299891
300236
|
if (isFullCommitSha(input.baked)) return input.baked;
|
|
@@ -315551,6 +315896,36 @@ const RuntimeReplicationOutboxLive = require_Schema$1.effect(RuntimeReplicationO
|
|
|
315551
315896
|
getDiagnostics
|
|
315552
315897
|
});
|
|
315553
315898
|
}));
|
|
315899
|
+
//#endregion
|
|
315900
|
+
//#region src/runtimeReplication/Layers/RuntimeReplicationThreadFlush.ts
|
|
315901
|
+
/**
|
|
315902
|
+
* A thread's outbox row holds its whole unacknowledged batch as one
|
|
315903
|
+
* `{ events: [...] }` payload -- RuntimeReplicationOutbox upserts by
|
|
315904
|
+
* `(runtime_id, stream_key)`, so there is at most one row per thread -- so the
|
|
315905
|
+
* count is that array's length. A row whose payload does not decode that way
|
|
315906
|
+
* (a blocked THREAD_STREAM_LOCAL_HISTORY_CONFLICT placeholder, for instance)
|
|
315907
|
+
* still represents one undelivered publication, so it counts as 1 rather than
|
|
315908
|
+
* 0: a caller bounding a wait on this number must never read a blocked row as
|
|
315909
|
+
* "nothing pending".
|
|
315910
|
+
*/
|
|
315911
|
+
function pendingEventCount(payloadJson) {
|
|
315912
|
+
try {
|
|
315913
|
+
const parsed = JSON.parse(payloadJson);
|
|
315914
|
+
if (Array.isArray(parsed.events)) return parsed.events.length;
|
|
315915
|
+
} catch {}
|
|
315916
|
+
return 1;
|
|
315917
|
+
}
|
|
315918
|
+
const RuntimeReplicationThreadFlushLive = require_Schema$1.effect(RuntimeReplicationThreadFlush, require_Schema$1.gen(function* () {
|
|
315919
|
+
const sql = yield* require_SqlError.SqlClient;
|
|
315920
|
+
const readPendingCount = (input) => sql`
|
|
315921
|
+
SELECT payload_json AS "payloadJson" FROM runtime_replication_outbox
|
|
315922
|
+
WHERE runtime_id = ${input.runtimeId} AND stream_key = ${input.streamKey}
|
|
315923
|
+
`.pipe(require_Schema$1.map((rows) => {
|
|
315924
|
+
const row = rows[0];
|
|
315925
|
+
return row === void 0 ? 0 : pendingEventCount(row.payloadJson);
|
|
315926
|
+
}), require_Schema$1.orDie);
|
|
315927
|
+
return RuntimeReplicationThreadFlush.of({ readPendingCount });
|
|
315928
|
+
}));
|
|
315554
315929
|
/**
|
|
315555
315930
|
* Gates guest-side Active Hour measurement (FOR-32642). Shadow-only: even
|
|
315556
315931
|
* with this on, whether a reported interval is also recorded against the
|
|
@@ -322860,7 +323235,7 @@ const makeUserSlot = require_Schema$1.gen(function* () {
|
|
|
322860
323235
|
};
|
|
322861
323236
|
});
|
|
322862
323237
|
const makeWorkspaceReadinessState = require_Schema$1.gen(function* () {
|
|
322863
|
-
const slotsRef = yield* make$
|
|
323238
|
+
const slotsRef = yield* make$31(/* @__PURE__ */ new Map());
|
|
322864
323239
|
const pruneScope = yield* require_Schema$1.make$3("sequential");
|
|
322865
323240
|
yield* require_Schema$1.addFinalizer(() => require_Schema$1.close(pruneScope, require_Schema$1.void_$1));
|
|
322866
323241
|
/**
|
|
@@ -323931,8 +324306,8 @@ const PtyAdapterLive = require_Schema$1.unwrap(require_Schema$1.gen(function* ()
|
|
|
323931
324306
|
}));
|
|
323932
324307
|
const HttpServerLive = require_Schema$1.unwrap(require_Schema$1.gen(function* () {
|
|
323933
324308
|
const config = yield* ServerConfig;
|
|
323934
|
-
if (typeof Bun !== "undefined") return (yield* require_Schema$1.promise(() => Promise.resolve().then(() => require("./BunHttpServer-
|
|
323935
|
-
const [NodeHttpServer, NodeHttp] = yield* require_Schema$1.all([require_Schema$1.promise(() => Promise.resolve().then(() => require("./NodeHttpServer-
|
|
324309
|
+
if (typeof Bun !== "undefined") return (yield* require_Schema$1.promise(() => Promise.resolve().then(() => require("./BunHttpServer-CtFGbsWr.cjs")))).layer(bunHttpServerOptions(config));
|
|
324310
|
+
const [NodeHttpServer, NodeHttp] = yield* require_Schema$1.all([require_Schema$1.promise(() => Promise.resolve().then(() => require("./NodeHttpServer-DyI6OyMg.cjs"))), require_Schema$1.promise(() => import("node:http"))]);
|
|
323936
324311
|
return NodeHttpServer.layer(NodeHttp.createServer, {
|
|
323937
324312
|
host: config.host,
|
|
323938
324313
|
port: config.port
|
|
@@ -323947,7 +324322,7 @@ const PlatformServicesLive = require_Schema$1.unwrap(require_Schema$1.gen(functi
|
|
|
323947
324322
|
return layer;
|
|
323948
324323
|
}
|
|
323949
324324
|
}));
|
|
323950
|
-
const RuntimeReplicationLayerLive = RuntimeReplicationLive.pipe(require_Schema$1.provideMerge(RuntimeReplicationClientLive), require_Schema$1.provideMerge(RuntimeReplicationOutboxLive), require_Schema$1.provideMerge(ActiveHourMeterLive.pipe(require_Schema$1.provide$1(RuntimeReplicationOutboxLive))));
|
|
324325
|
+
const RuntimeReplicationLayerLive = RuntimeReplicationLive.pipe(require_Schema$1.provideMerge(RuntimeReplicationClientLive), require_Schema$1.provideMerge(RuntimeReplicationOutboxLive), require_Schema$1.provideMerge(RuntimeReplicationThreadFlushLive), require_Schema$1.provideMerge(ActiveHourMeterLive.pipe(require_Schema$1.provide$1(RuntimeReplicationOutboxLive))));
|
|
323951
324326
|
const RuntimeDrainLayerLive = RuntimeDrainReporterLive.pipe(require_Schema$1.provideMerge(RuntimeDrainStateLive));
|
|
323952
324327
|
const RuntimeAwareProviderReactorsLive = require_Schema$1.mergeAll(ProviderRuntimeIngestionLive, ProviderCommandReactorLive).pipe(require_Schema$1.provide$1(RuntimeDrainLayerLive), require_Schema$1.provideMerge(RuntimeDrainStateLive), require_Schema$1.provide$1(ClaudeUsageTelemetryLive));
|
|
323953
324328
|
const PipelineWorkerCoordinatorLayerLive = PipelineWorkerCoordinatorLive.pipe(require_Schema$1.provideMerge(PipelineRunClientLive));
|
|
@@ -324725,7 +325100,7 @@ const tokenOnlyFlag = boolean$2("token-only").pipe(withDescription$2("Print only
|
|
|
324725
325100
|
* it stays least-privilege unless the operator asks otherwise.
|
|
324726
325101
|
*/
|
|
324727
325102
|
const pairingRoleFlag = choice("role", ["owner", "client"]).pipe(withDescription$2("Role for the issued pairing token."), withDefault("client"));
|
|
324728
|
-
const pairingCreateCommand = make$
|
|
325103
|
+
const pairingCreateCommand = make$33("create", {
|
|
324729
325104
|
...authLocationFlags,
|
|
324730
325105
|
ttl: ttlFlag,
|
|
324731
325106
|
role: pairingRoleFlag,
|
|
@@ -324743,24 +325118,24 @@ const pairingCreateCommand = make$34("create", {
|
|
|
324743
325118
|
...require_Schema$1.isSome(flags.baseUrl) ? { baseUrl: flags.baseUrl.value } : {}
|
|
324744
325119
|
}));
|
|
324745
325120
|
}), { quietLogs: flags.json })));
|
|
324746
|
-
const pairingListCommand = make$
|
|
325121
|
+
const pairingListCommand = make$33("list", {
|
|
324747
325122
|
...authLocationFlags,
|
|
324748
325123
|
json: jsonFlag
|
|
324749
325124
|
}).pipe(withDescription$1("List active client pairing tokens without revealing their secrets."), withHandler((flags) => runWithAuthControlPlane(flags, (authControlPlane) => require_Schema$1.gen(function* () {
|
|
324750
325125
|
yield* log$3(formatPairingCredentialList(yield* authControlPlane.listPairingLinks({ role: "client" }), { json: flags.json }));
|
|
324751
325126
|
}), { quietLogs: flags.json })));
|
|
324752
|
-
const pairingRevokeCommand = make$
|
|
325127
|
+
const pairingRevokeCommand = make$33("revoke", {
|
|
324753
325128
|
...authLocationFlags,
|
|
324754
325129
|
id: string$4("id").pipe(withDescription$3("Pairing credential id to revoke."))
|
|
324755
325130
|
}).pipe(withDescription$1("Revoke an active client pairing token."), withHandler((flags) => runWithAuthControlPlane(flags, (authControlPlane) => require_Schema$1.gen(function* () {
|
|
324756
325131
|
yield* log$3((yield* authControlPlane.revokePairingLink(flags.id)) ? `Revoked pairing credential ${flags.id}.\n` : `No active pairing credential found for ${flags.id}.\n`);
|
|
324757
325132
|
}))));
|
|
324758
|
-
const pairingCommand = make$
|
|
325133
|
+
const pairingCommand = make$33("pairing").pipe(withDescription$1("Manage one-time client pairing tokens."), withSubcommands([
|
|
324759
325134
|
pairingCreateCommand,
|
|
324760
325135
|
pairingListCommand,
|
|
324761
325136
|
pairingRevokeCommand
|
|
324762
325137
|
]));
|
|
324763
|
-
const sessionIssueCommand = make$
|
|
325138
|
+
const sessionIssueCommand = make$33("issue", {
|
|
324764
325139
|
...authLocationFlags,
|
|
324765
325140
|
ttl: ttlFlag,
|
|
324766
325141
|
role: sessionRoleFlag,
|
|
@@ -324779,25 +325154,25 @@ const sessionIssueCommand = make$34("issue", {
|
|
|
324779
325154
|
tokenOnly: flags.tokenOnly
|
|
324780
325155
|
}));
|
|
324781
325156
|
}), { quietLogs: flags.json || flags.tokenOnly })));
|
|
324782
|
-
const sessionListCommand = make$
|
|
325157
|
+
const sessionListCommand = make$33("list", {
|
|
324783
325158
|
...authLocationFlags,
|
|
324784
325159
|
json: jsonFlag
|
|
324785
325160
|
}).pipe(withDescription$1("List active sessions without revealing bearer tokens."), withHandler((flags) => runWithAuthControlPlane(flags, (authControlPlane) => require_Schema$1.gen(function* () {
|
|
324786
325161
|
yield* log$3(formatSessionList(yield* authControlPlane.listSessions(), { json: flags.json }));
|
|
324787
325162
|
}), { quietLogs: flags.json })));
|
|
324788
|
-
const sessionRevokeCommand = make$
|
|
325163
|
+
const sessionRevokeCommand = make$33("revoke", {
|
|
324789
325164
|
...authLocationFlags,
|
|
324790
325165
|
sessionId: string$4("session-id").pipe(withDescription$3("Session id to revoke."), withSchema$1(AuthSessionId))
|
|
324791
325166
|
}).pipe(withDescription$1("Revoke an active session."), withHandler((flags) => runWithAuthControlPlane(flags, (authControlPlane) => require_Schema$1.gen(function* () {
|
|
324792
325167
|
yield* log$3((yield* authControlPlane.revokeSession(flags.sessionId)) ? `Revoked session ${flags.sessionId}.\n` : `No active session found for ${flags.sessionId}.\n`);
|
|
324793
325168
|
}))));
|
|
324794
|
-
const sessionCommand = make$
|
|
325169
|
+
const sessionCommand = make$33("session").pipe(withDescription$1("Manage bearer sessions."), withSubcommands([
|
|
324795
325170
|
sessionIssueCommand,
|
|
324796
325171
|
sessionListCommand,
|
|
324797
325172
|
sessionRevokeCommand
|
|
324798
325173
|
]));
|
|
324799
|
-
const authCommand = make$
|
|
324800
|
-
const projectAddCommand = make$
|
|
325174
|
+
const authCommand = make$33("auth").pipe(withDescription$1("Manage the local auth control plane for headless deployments."), withSubcommands([pairingCommand, sessionCommand]));
|
|
325175
|
+
const projectAddCommand = make$33("add", {
|
|
324801
325176
|
...projectLocationFlags,
|
|
324802
325177
|
workspaceRoot: string$4("path").pipe(withDescription$3("Workspace root to add as a project.")),
|
|
324803
325178
|
title: string$3("title").pipe(withDescription$2("Optional project title."), optional$1)
|
|
@@ -324817,7 +325192,7 @@ const projectAddCommand = make$34("add", {
|
|
|
324817
325192
|
});
|
|
324818
325193
|
return `Added project ${projectId} (${title}) at ${workspaceRoot}.`;
|
|
324819
325194
|
}))));
|
|
324820
|
-
const projectRemoveCommand = make$
|
|
325195
|
+
const projectRemoveCommand = make$33("remove", {
|
|
324821
325196
|
...projectLocationFlags,
|
|
324822
325197
|
project: string$4("project").pipe(withDescription$3("Project id or workspace root to remove."))
|
|
324823
325198
|
}).pipe(withDescription$1("Remove a project."), withHandler((flags) => runProjectMutation(flags, require_Schema$1.fn("projectRemoveMutation")(function* ({ snapshot, dispatch }) {
|
|
@@ -324832,7 +325207,7 @@ const projectRemoveCommand = make$34("remove", {
|
|
|
324832
325207
|
});
|
|
324833
325208
|
return `Removed project ${project.id} (${project.title}).`;
|
|
324834
325209
|
}))));
|
|
324835
|
-
const projectRenameCommand = make$
|
|
325210
|
+
const projectRenameCommand = make$33("rename", {
|
|
324836
325211
|
...projectLocationFlags,
|
|
324837
325212
|
project: string$4("project").pipe(withDescription$3("Project id or workspace root to rename.")),
|
|
324838
325213
|
title: string$4("title").pipe(withDescription$3("New project title."))
|
|
@@ -324855,12 +325230,12 @@ const parseCmmdProjectId = (value) => {
|
|
|
324855
325230
|
const projectId = Number(value);
|
|
324856
325231
|
return Number.isSafeInteger(projectId) && projectId > 0 ? require_Schema$1.succeed(projectId) : require_Schema$1.fail(/* @__PURE__ */ new Error(`Invalid CMMD project id '${value}'. Expected a positive integer.`));
|
|
324857
325232
|
};
|
|
324858
|
-
const projectLeadExplainCommand = make$
|
|
325233
|
+
const projectLeadExplainCommand = make$33("explain", {
|
|
324859
325234
|
...projectLocationFlags,
|
|
324860
325235
|
projectId: string$4("project-id").pipe(withDescription$3("Numeric CMMD project id.")),
|
|
324861
325236
|
json: jsonFlag
|
|
324862
325237
|
}).pipe(withDescription$1("Explain canonical Project Lead controller state."), withHandler((flags) => parseCmmdProjectId(flags.projectId).pipe(require_Schema$1.flatMap((projectId) => runProjectLeadQuery(flags, projectId, (explanation) => flags.json ? JSON.stringify(explanation, null, 2) : formatProjectLeadExplanation(projectId, explanation))))));
|
|
324863
|
-
const projectLeadDoctorCommand = make$
|
|
325238
|
+
const projectLeadDoctorCommand = make$33("doctor", {
|
|
324864
325239
|
...projectLocationFlags,
|
|
324865
325240
|
projectId: string$4("project-id").pipe(withDescription$3("Numeric CMMD project id.")),
|
|
324866
325241
|
json: jsonFlag
|
|
@@ -324868,7 +325243,7 @@ const projectLeadDoctorCommand = make$34("doctor", {
|
|
|
324868
325243
|
const report = diagnoseProjectLead(projectId, explanation);
|
|
324869
325244
|
return flags.json ? JSON.stringify(report, null, 2) : formatProjectLeadDoctor(report);
|
|
324870
325245
|
})))));
|
|
324871
|
-
const projectLeadCommand = make$
|
|
325246
|
+
const projectLeadCommand = make$33("lead").pipe(withDescription$1("Inspect the CMMD-owned Project Lead controller."), withSubcommands([projectLeadExplainCommand, projectLeadDoctorCommand]));
|
|
324872
325247
|
const connectStatePathFor = require_Schema$1.fn("connectStatePathFor")(function* (flags) {
|
|
324873
325248
|
const config = yield* resolveCliAuthConfig(flags, yield* LogLevel);
|
|
324874
325249
|
return (yield* require_Path.Path).join(config.stateDir, "connect.json");
|
|
@@ -324881,18 +325256,18 @@ const runConnectCommand = (flags, update) => require_Schema$1.gen(function* () {
|
|
|
324881
325256
|
const state = next ?? current;
|
|
324882
325257
|
yield* log$3(flags.json ? JSON.stringify(state, null, 2) : formatConnectStatus(state));
|
|
324883
325258
|
});
|
|
324884
|
-
const connectStatusCommand = make$
|
|
325259
|
+
const connectStatusCommand = make$33("status", {
|
|
324885
325260
|
...projectLocationFlags,
|
|
324886
325261
|
json: jsonFlag
|
|
324887
325262
|
}).pipe(withDescription$1("Show whether this machine is offered to CMMD over the relay."), withHandler((flags) => runConnectCommand(flags, () => null)));
|
|
324888
|
-
const connectLinkCommand = make$
|
|
325263
|
+
const connectLinkCommand = make$33("link", {
|
|
324889
325264
|
...projectLocationFlags,
|
|
324890
325265
|
json: jsonFlag
|
|
324891
325266
|
}).pipe(withDescription$1("Offer this machine to CMMD over the relay on the next start."), withHandler((flags) => runConnectCommand(flags, (current) => ({
|
|
324892
325267
|
...current,
|
|
324893
325268
|
linked: true
|
|
324894
325269
|
}))));
|
|
324895
|
-
const connectUnlinkCommand = make$
|
|
325270
|
+
const connectUnlinkCommand = make$33("unlink", {
|
|
324896
325271
|
...projectLocationFlags,
|
|
324897
325272
|
json: jsonFlag
|
|
324898
325273
|
}).pipe(withDescription$1("Stop offering this machine, keeping its runtime identity so relinking is the same device."), withHandler((flags) => runConnectCommand(flags, (current) => ({
|
|
@@ -324903,7 +325278,7 @@ const noBrowserLoginFlag = boolean$2("no-browser").pipe(withDescription$2("Print
|
|
|
324903
325278
|
const CONNECT_CLI_CLIENT_ID = "cmmd-forge-web";
|
|
324904
325279
|
const connectSecretsFor = (stateDir) => createFileSecretStorage({ keyPath: node_path.join(stateDir, "connect-secret.key") });
|
|
324905
325280
|
const loginEmailFlag = string$3("email").pipe(withDescription$2("Sign in with this CMMD email and a password prompt instead of the browser flow."), optional$1);
|
|
324906
|
-
const connectLoginCommand = make$
|
|
325281
|
+
const connectLoginCommand = make$33("login", {
|
|
324907
325282
|
...projectLocationFlags,
|
|
324908
325283
|
noBrowser: noBrowserLoginFlag,
|
|
324909
325284
|
email: loginEmailFlag
|
|
@@ -324970,7 +325345,7 @@ const connectLoginCommand = make$34("login", {
|
|
|
324970
325345
|
});
|
|
324971
325346
|
yield* log$3("Signed in to CMMD. Run `cmmd-forge connect link` to offer this machine.");
|
|
324972
325347
|
})));
|
|
324973
|
-
const connectLogoutCommand = make$
|
|
325348
|
+
const connectLogoutCommand = make$33("logout", { ...projectLocationFlags }).pipe(withDescription$1("Sign this machine out of CMMD and stop offering it."), withHandler((flags) => require_Schema$1.gen(function* () {
|
|
324974
325349
|
const config = yield* resolveCliAuthConfig(flags, yield* LogLevel);
|
|
324975
325350
|
const statePath = node_path.join(config.stateDir, "connect.json");
|
|
324976
325351
|
writeConnectState(statePath, {
|
|
@@ -324980,14 +325355,14 @@ const connectLogoutCommand = make$34("logout", { ...projectLocationFlags }).pipe
|
|
|
324980
325355
|
clearConnectCredential(node_path.join(config.stateDir, "connect-credential.json"));
|
|
324981
325356
|
yield* log$3("Signed out of CMMD and stopped offering this machine.");
|
|
324982
325357
|
})));
|
|
324983
|
-
const connectCommand = make$
|
|
325358
|
+
const connectCommand = make$33("connect").pipe(withDescription$1("Offer this machine to CMMD so other surfaces can reach it."), withSubcommands([
|
|
324984
325359
|
connectStatusCommand,
|
|
324985
325360
|
connectLoginCommand,
|
|
324986
325361
|
connectLogoutCommand,
|
|
324987
325362
|
connectLinkCommand,
|
|
324988
325363
|
connectUnlinkCommand
|
|
324989
325364
|
]));
|
|
324990
|
-
const projectCommand = make$
|
|
325365
|
+
const projectCommand = make$33("project").pipe(withDescription$1("Manage projects."), withSubcommands([
|
|
324991
325366
|
projectAddCommand,
|
|
324992
325367
|
projectRemoveCommand,
|
|
324993
325368
|
projectRenameCommand,
|
|
@@ -325002,12 +325377,12 @@ const runServerCommand = (flags, options) => require_Schema$1.gen(function* () {
|
|
|
325002
325377
|
});
|
|
325003
325378
|
return yield* runServer.pipe(require_Schema$1.provideService(ServerConfig, config));
|
|
325004
325379
|
});
|
|
325005
|
-
const startCommand = make$
|
|
325006
|
-
const serveCommand = make$
|
|
325380
|
+
const startCommand = make$33("start", { ...sharedServerCommandFlags }).pipe(withDescription$1("Run the Forge server."), withHandler((flags) => runServerCommand(flags)));
|
|
325381
|
+
const serveCommand = make$33("serve", { ...sharedServerCommandFlags }).pipe(withDescription$1("Run the Forge server without opening a browser and print headless pairing details."), withHandler((flags) => runServerCommand(flags, {
|
|
325007
325382
|
startupPresentation: "headless",
|
|
325008
325383
|
forceAutoBootstrapProjectFromCwd: false
|
|
325009
325384
|
})));
|
|
325010
|
-
const cli = make$
|
|
325385
|
+
const cli = make$33("cmmd-forge", { ...sharedServerCommandFlags }).pipe(withDescription$1("Run the Forge server."), withHandler((flags) => runServerCommand(flags)), withSubcommands([
|
|
325011
325386
|
startCommand,
|
|
325012
325387
|
serveCommand,
|
|
325013
325388
|
authCommand,
|