@p4code/cli 0.1.30 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.mjs +286 -358
- package/dist/client/assets/{DiffPanel-BQYOETku.js → DiffPanel-CHPKiWUK.js} +3 -3
- package/dist/client/assets/{FilePreviewPanel-C0NPGEUW.js → FilePreviewPanel-Ru4fR1C0.js} +4 -4
- package/dist/client/assets/PreviewPanel-DWV8zkTn.js +2 -0
- package/dist/client/assets/arrow-right-C0ADu0QV.js +2 -0
- package/dist/client/assets/{fileCommentAnnotations-Dwzfjo1b.js → fileCommentAnnotations-Dn0cHZc7.js} +2 -2
- package/dist/client/assets/{index-jk7olV-r.js → index-BQ0KXpA-.js} +229 -217
- package/dist/client/assets/terminal-links-CcHzVfT3.js +46 -0
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/PreviewPanel-hidR-ae-.js +0 -2
- package/dist/client/assets/arrow-right-C2f8Nw4z.js +0 -2
- package/dist/client/assets/terminal-links-CSeGUT15.js +0 -46
package/dist/bin.mjs
CHANGED
|
@@ -236,7 +236,7 @@ const make$76 = () => {
|
|
|
236
236
|
const layer$72 = Layer.sync(NetService, make$76);
|
|
237
237
|
//#endregion
|
|
238
238
|
//#region package.json
|
|
239
|
-
var version = "0.1.
|
|
239
|
+
var version = "0.1.32";
|
|
240
240
|
//#endregion
|
|
241
241
|
//#region src/config.ts
|
|
242
242
|
/**
|
|
@@ -7383,20 +7383,24 @@ const RepositoryKeyField = TrimmedNonEmptyString.pipe(Schema$1.annotateEncoded({
|
|
|
7383
7383
|
*/
|
|
7384
7384
|
const OrderKeyField = TrimmedNonEmptyString.pipe(Schema$1.annotateEncoded({ description: "Manual board position key. Lexicographic: smaller sorts higher in the column. Null means no manual position." }));
|
|
7385
7385
|
/**
|
|
7386
|
-
*
|
|
7386
|
+
* Which tracker issue a row *is*, for a row read out of a tracker.
|
|
7387
7387
|
*
|
|
7388
7388
|
* The identifier is the tracker's own, not ours: `MOBILE-12262` reads the same
|
|
7389
7389
|
* in p4code as it does in Linear, in a commit message, and in conversation,
|
|
7390
7390
|
* which is the whole point of carrying it. `url` is what the tracker itself
|
|
7391
7391
|
* reported, never a guess assembled from the identifier - a Linear URL embeds
|
|
7392
7392
|
* the workspace slug, so a constructed one would 404.
|
|
7393
|
+
*
|
|
7394
|
+
* Read-only, and only ever set by the `linear` source. p4code's own board does
|
|
7395
|
+
* not copy tracker issues into rows of its own: a ticket is read where it lives
|
|
7396
|
+
* and shown under the id its tracker gave it, which is why nothing here appears
|
|
7397
|
+
* in a create or update input.
|
|
7393
7398
|
*/
|
|
7394
7399
|
const TaskExternalRef = Schema$1.Struct({
|
|
7395
7400
|
source: Schema$1.Literals(["linear"]),
|
|
7396
7401
|
identifier: TrimmedNonEmptyString,
|
|
7397
7402
|
url: TrimmedNonEmptyString
|
|
7398
7403
|
});
|
|
7399
|
-
const ExternalRefField = TaskExternalRef.pipe(Schema$1.annotateEncoded({ description: "The tracker issue this task mirrors, e.g. a Linear ticket. Null for a task that originated on this board." }));
|
|
7400
7404
|
/**
|
|
7401
7405
|
* The task this one was split out of.
|
|
7402
7406
|
*
|
|
@@ -7454,10 +7458,10 @@ const Task = Schema$1.Struct({
|
|
|
7454
7458
|
*/
|
|
7455
7459
|
threadId: Schema$1.NullOr(ThreadId),
|
|
7456
7460
|
/**
|
|
7457
|
-
* The tracker issue this
|
|
7458
|
-
*
|
|
7459
|
-
*
|
|
7460
|
-
* `null` rather than failing the whole board.
|
|
7461
|
+
* The tracker issue this row is, for a row read from a tracker, and `null`
|
|
7462
|
+
* for every row on p4code's own board. Nullable-with-default because the
|
|
7463
|
+
* board's own store has no such column at all - a row read from SQLite
|
|
7464
|
+
* decodes to `null` rather than failing the whole board.
|
|
7461
7465
|
*/
|
|
7462
7466
|
externalRef: Schema$1.NullOr(TaskExternalRef).pipe(Schema$1.withDecodingDefault(Effect.succeed(null))),
|
|
7463
7467
|
/**
|
|
@@ -7480,7 +7484,6 @@ const TaskCreateInput = Schema$1.Struct({
|
|
|
7480
7484
|
projectId: Schema$1.optional(ProjectIdField),
|
|
7481
7485
|
repositoryKey: Schema$1.optional(RepositoryKeyField),
|
|
7482
7486
|
threadId: Schema$1.optional(ThreadIdField),
|
|
7483
|
-
externalRef: Schema$1.optional(ExternalRefField),
|
|
7484
7487
|
parentTaskId: Schema$1.optional(ParentTaskIdField),
|
|
7485
7488
|
title: TitleField,
|
|
7486
7489
|
body: Schema$1.optional(BodyField),
|
|
@@ -7531,7 +7534,6 @@ const HubTaskPutInput = Schema$1.Struct({
|
|
|
7531
7534
|
projectId: Schema$1.NullOr(ProjectIdField),
|
|
7532
7535
|
repositoryKey: Schema$1.NullOr(RepositoryKeyField),
|
|
7533
7536
|
threadId: Schema$1.NullOr(ThreadIdField),
|
|
7534
|
-
externalRef: Schema$1.NullOr(ExternalRefField),
|
|
7535
7537
|
parentTaskId: Schema$1.NullOr(ParentTaskIdField),
|
|
7536
7538
|
title: TitleField,
|
|
7537
7539
|
body: BodyField,
|
|
@@ -7553,7 +7555,6 @@ const TaskUpdateInput = Schema$1.Struct({
|
|
|
7553
7555
|
projectId: Schema$1.optional(Schema$1.NullOr(ProjectIdField)),
|
|
7554
7556
|
repositoryKey: Schema$1.optional(Schema$1.NullOr(RepositoryKeyField)),
|
|
7555
7557
|
threadId: Schema$1.optional(Schema$1.NullOr(ThreadIdField)),
|
|
7556
|
-
externalRef: Schema$1.optional(Schema$1.NullOr(ExternalRefField)),
|
|
7557
7558
|
parentTaskId: Schema$1.optional(Schema$1.NullOr(ParentTaskIdField)),
|
|
7558
7559
|
title: Schema$1.optional(TitleField),
|
|
7559
7560
|
body: Schema$1.optional(BodyField),
|
|
@@ -7930,8 +7931,9 @@ var ProjectWriteFileError = class extends Schema$1.TaggedErrorClass()("ProjectWr
|
|
|
7930
7931
|
* Reading an issue out of an external tracker.
|
|
7931
7932
|
*
|
|
7932
7933
|
* One call, deliberately: p4code does not sync trackers, it recognizes a ticket
|
|
7933
|
-
* somebody pasted and asks the tracker what it is called.
|
|
7934
|
-
*
|
|
7934
|
+
* somebody pasted and asks the tracker what it is called. Nothing is stored:
|
|
7935
|
+
* the ticket stays in its tracker, under the id the tracker gave it, and the
|
|
7936
|
+
* caller renders the answer.
|
|
7935
7937
|
*
|
|
7936
7938
|
* The tracker is reached through the MCP server the user already registered for
|
|
7937
7939
|
* it, so there is no second place to configure credentials and no p4code-owned
|
|
@@ -7951,7 +7953,7 @@ var ProjectWriteFileError = class extends Schema$1.TaggedErrorClass()("ProjectWr
|
|
|
7951
7953
|
const TicketResolveInput = Schema$1.Struct({ reference: TrimmedNonEmptyString.pipe(Schema$1.annotateEncoded({ description: "The ticket as it was written: an identifier like MOBILE-12241, or a tracker URL. Pass it through verbatim rather than reformatting it." })) });
|
|
7952
7954
|
const TicketResolveResult = Schema$1.Struct({
|
|
7953
7955
|
externalRef: TaskExternalRef,
|
|
7954
|
-
/** The issue title as the tracker reports it
|
|
7956
|
+
/** The issue title as the tracker reports it. */
|
|
7955
7957
|
title: TrimmedNonEmptyString,
|
|
7956
7958
|
/**
|
|
7957
7959
|
* The issue body, when the tracker reports one.
|
|
@@ -9234,8 +9236,6 @@ const WS_METHODS = {
|
|
|
9234
9236
|
tasksUpdate: "tasks.update",
|
|
9235
9237
|
tasksDelete: "tasks.delete",
|
|
9236
9238
|
tasksStartThread: "tasks.startThread",
|
|
9237
|
-
tasksRefreshExternal: "tasks.refreshExternal",
|
|
9238
|
-
ticketsResolve: "tickets.resolve",
|
|
9239
9239
|
hubGetSyncStatus: "hub.getSyncStatus",
|
|
9240
9240
|
hubConnect: "hub.connect",
|
|
9241
9241
|
hubDisconnect: "hub.disconnect",
|
|
@@ -9367,29 +9367,6 @@ const WsTasksStartThreadRpc = Rpc.make(WS_METHODS.tasksStartThread, {
|
|
|
9367
9367
|
])
|
|
9368
9368
|
});
|
|
9369
9369
|
/**
|
|
9370
|
-
* Bring a task that mirrors a tracker issue back in line with the tracker.
|
|
9371
|
-
*
|
|
9372
|
-
* One direction only: the tracker's copy is the original, and the local row is
|
|
9373
|
-
* a cache of it that exists so the board and the task panel can render the work
|
|
9374
|
-
* without a network call in the way. Nothing here writes to the tracker.
|
|
9375
|
-
*
|
|
9376
|
-
* Answers with the whole task rather than an acknowledgement, for the same
|
|
9377
|
-
* reason every other task RPC does - the caller renders the row it asked about
|
|
9378
|
-
* and never has to follow this with a read. A task that mirrors nothing is
|
|
9379
|
-
* returned untouched rather than refused: "refresh this" on a locally filed
|
|
9380
|
-
* task is a no-op, not a mistake.
|
|
9381
|
-
*/
|
|
9382
|
-
const WsTasksRefreshExternalRpc = Rpc.make(WS_METHODS.tasksRefreshExternal, {
|
|
9383
|
-
payload: TaskGetInput,
|
|
9384
|
-
success: TaskResult,
|
|
9385
|
-
error: Schema$1.Union([
|
|
9386
|
-
TaskNotFoundError,
|
|
9387
|
-
TaskStoreError,
|
|
9388
|
-
TicketResolveError,
|
|
9389
|
-
EnvironmentAuthorizationError
|
|
9390
|
-
])
|
|
9391
|
-
});
|
|
9392
|
-
/**
|
|
9393
9370
|
* Hub link and skill sync.
|
|
9394
9371
|
*
|
|
9395
9372
|
* Every one of these answers with the whole status rather than an
|
|
@@ -9593,17 +9570,6 @@ const WsMcpOAuthDisconnectRpc = Rpc.make(WS_METHODS.mcpOAuthDisconnect, {
|
|
|
9593
9570
|
error: Schema$1.Union([McpRegistryError, EnvironmentAuthorizationError])
|
|
9594
9571
|
});
|
|
9595
9572
|
/**
|
|
9596
|
-
* Asks the tracker what a pasted reference is, without writing anything.
|
|
9597
|
-
*
|
|
9598
|
-
* Read-only on purpose: the caller decides whether the answer becomes a task.
|
|
9599
|
-
* A resolve that filed a row would make an accidental paste a board entry.
|
|
9600
|
-
*/
|
|
9601
|
-
const WsTicketsResolveRpc = Rpc.make(WS_METHODS.ticketsResolve, {
|
|
9602
|
-
payload: TicketResolveInput,
|
|
9603
|
-
success: TicketResolveResult,
|
|
9604
|
-
error: Schema$1.Union([TicketResolveError, EnvironmentAuthorizationError])
|
|
9605
|
-
});
|
|
9606
|
-
/**
|
|
9607
9573
|
* The board, then every change to it, for as long as the client stays
|
|
9608
9574
|
* subscribed. The leading snapshot is what makes this sufficient on its own —
|
|
9609
9575
|
* a client does not list first, so there is no window between the two in which
|
|
@@ -9981,7 +9947,7 @@ const WsSubscribeAuthAccessRpc = Rpc.make(WS_METHODS.subscribeAuthAccess, {
|
|
|
9981
9947
|
error: Schema$1.Union([AuthAccessStreamError, EnvironmentAuthorizationError]),
|
|
9982
9948
|
stream: true
|
|
9983
9949
|
});
|
|
9984
|
-
const WsRpcGroup = RpcGroup.make(WsServerProbeRpc, WsServerGetConfigRpc, WsServerRefreshProvidersRpc, WsServerUpdateProviderRpc, WsServerUpdateServerRpc, WsServerUpsertKeybindingRpc, WsServerRemoveKeybindingRpc, WsServerGetSettingsRpc, WsServerUpdateSettingsRpc, WsServerDiscoverSourceControlRpc, WsServerGetProviderUsageRpc, WsServerGetTraceDiagnosticsRpc, WsServerGetProcessDiagnosticsRpc, WsServerGetProcessResourceHistoryRpc, WsServerSignalProcessRpc, WsSourceControlLookupRepositoryRpc, WsSourceControlCloneRepositoryRpc, WsSourceControlPublishRepositoryRpc, WsProjectsListEntriesRpc, WsProjectsReadFileRpc, WsProjectsSearchEntriesRpc, WsProjectsWriteFileRpc, WsShellOpenInEditorRpc, WsFilesystemBrowseRpc, WsAssetsCreateUrlRpc, WsSubscribeVcsStatusRpc, WsVcsPullRpc, WsVcsRefreshStatusRpc, WsGitRunStackedActionRpc, WsGitResolvePullRequestRpc, WsGitPreparePullRequestThreadRpc, WsVcsListRefsRpc, WsVcsCreateWorktreeRpc, WsVcsRemoveWorktreeRpc, WsVcsCreateRefRpc, WsVcsSwitchRefRpc, WsVcsInitRpc, WsReviewGetDiffPreviewRpc, WsTerminalOpenRpc, WsTerminalAttachRpc, WsTerminalWriteRpc, WsTerminalResizeRpc, WsTerminalClearRpc, WsTerminalRestartRpc, WsTerminalCloseRpc, WsSubscribeTerminalEventsRpc, WsSubscribeTerminalMetadataRpc, WsPreviewOpenRpc, WsPreviewNavigateRpc, WsPreviewResizeRpc, WsPreviewRefreshRpc, WsPreviewCloseRpc, WsPreviewListRpc, WsPreviewReportStatusRpc, WsPreviewAutomationConnectRpc, WsPreviewAutomationRespondRpc, WsPreviewAutomationFocusHostRpc, WsSubscribePreviewEventsRpc, WsSubscribeDiscoveredLocalServersRpc, WsSubscribeServerConfigRpc, WsSubscribeServerLifecycleRpc, WsSubscribeAuthAccessRpc, WsTasksListRpc, WsTasksGetRpc, WsTasksCreateRpc, WsTasksUpdateRpc, WsTasksDeleteRpc, WsTasksStartThreadRpc,
|
|
9950
|
+
const WsRpcGroup = RpcGroup.make(WsServerProbeRpc, WsServerGetConfigRpc, WsServerRefreshProvidersRpc, WsServerUpdateProviderRpc, WsServerUpdateServerRpc, WsServerUpsertKeybindingRpc, WsServerRemoveKeybindingRpc, WsServerGetSettingsRpc, WsServerUpdateSettingsRpc, WsServerDiscoverSourceControlRpc, WsServerGetProviderUsageRpc, WsServerGetTraceDiagnosticsRpc, WsServerGetProcessDiagnosticsRpc, WsServerGetProcessResourceHistoryRpc, WsServerSignalProcessRpc, WsSourceControlLookupRepositoryRpc, WsSourceControlCloneRepositoryRpc, WsSourceControlPublishRepositoryRpc, WsProjectsListEntriesRpc, WsProjectsReadFileRpc, WsProjectsSearchEntriesRpc, WsProjectsWriteFileRpc, WsShellOpenInEditorRpc, WsFilesystemBrowseRpc, WsAssetsCreateUrlRpc, WsSubscribeVcsStatusRpc, WsVcsPullRpc, WsVcsRefreshStatusRpc, WsGitRunStackedActionRpc, WsGitResolvePullRequestRpc, WsGitPreparePullRequestThreadRpc, WsVcsListRefsRpc, WsVcsCreateWorktreeRpc, WsVcsRemoveWorktreeRpc, WsVcsCreateRefRpc, WsVcsSwitchRefRpc, WsVcsInitRpc, WsReviewGetDiffPreviewRpc, WsTerminalOpenRpc, WsTerminalAttachRpc, WsTerminalWriteRpc, WsTerminalResizeRpc, WsTerminalClearRpc, WsTerminalRestartRpc, WsTerminalCloseRpc, WsSubscribeTerminalEventsRpc, WsSubscribeTerminalMetadataRpc, WsPreviewOpenRpc, WsPreviewNavigateRpc, WsPreviewResizeRpc, WsPreviewRefreshRpc, WsPreviewCloseRpc, WsPreviewListRpc, WsPreviewReportStatusRpc, WsPreviewAutomationConnectRpc, WsPreviewAutomationRespondRpc, WsPreviewAutomationFocusHostRpc, WsSubscribePreviewEventsRpc, WsSubscribeDiscoveredLocalServersRpc, WsSubscribeServerConfigRpc, WsSubscribeServerLifecycleRpc, WsSubscribeAuthAccessRpc, WsTasksListRpc, WsTasksGetRpc, WsTasksCreateRpc, WsTasksUpdateRpc, WsTasksDeleteRpc, WsTasksStartThreadRpc, WsSubscribeTasksRpc, WsHubGetSyncStatusRpc, WsHubConnectRpc, WsHubDisconnectRpc, WsHubSetSyncModeRpc, WsHubSetShareModeRpc, WsHubMintTokenRpc, WsSkillsSyncRpc, WsSkillsPublishRpc, WsSkillsPublishAllRpc, WsSkillsUnpublishRpc, WsAssetsReadRpc, WsAssetsSaveRpc, WsAssetsDeleteRpc, WsAssetsCreateLocalRpc, WsAssetsRemoveLocalRpc, WsSkillRegistrySearchRpc, WsSkillRegistryFetchRpc, WsMcpListRpc, WsMcpSaveRpc, WsMcpRemoveRpc, WsMcpSetSecretRpc, WsMcpOAuthBeginRpc, WsMcpOAuthDisconnectRpc, WsOrchestrationDispatchCommandRpc, WsOrchestrationGetTurnDiffRpc, WsOrchestrationGetFullThreadDiffRpc, WsOrchestrationGetArchivedShellSnapshotRpc, WsOrchestrationSubscribeShellRpc, WsOrchestrationSubscribeThreadRpc);
|
|
9985
9951
|
//#endregion
|
|
9986
9952
|
//#region ../../packages/shared/src/oauthScope.ts
|
|
9987
9953
|
const OAUTH_SCOPE_TOKEN = /^[\u0021\u0023-\u005b\u005d-\u007e]+$/u;
|
|
@@ -13216,6 +13182,29 @@ var _043_TaskSync_default = Effect.gen(function* () {
|
|
|
13216
13182
|
`;
|
|
13217
13183
|
});
|
|
13218
13184
|
//#endregion
|
|
13185
|
+
//#region src/persistence/Migrations/044_TaskExternalRefRemoved.ts
|
|
13186
|
+
/**
|
|
13187
|
+
* The end of mirroring: p4code's board holds p4code's own rows only.
|
|
13188
|
+
*
|
|
13189
|
+
* Migration 040 added `external_ref_json` so a Linear ticket could be filed
|
|
13190
|
+
* here as a local task that cached the issue. That arrangement gave every
|
|
13191
|
+
* ticket two names - the tracker's and a `P4-n` this board minted beside it -
|
|
13192
|
+
* and put work nobody filed here on the board. A ticket is now read where it
|
|
13193
|
+
* lives, through the Linear board source, and shown under the tracker's own id.
|
|
13194
|
+
*
|
|
13195
|
+
* The rows that were mirrors are deliberately left alone. They are ordinary
|
|
13196
|
+
* tasks once the column is gone, and deleting somebody's board rows to complete
|
|
13197
|
+
* a schema change is not this migration's call to make; the identifier they
|
|
13198
|
+
* mirrored is usually still quoted in their title or body.
|
|
13199
|
+
*
|
|
13200
|
+
* @module Migrations/044_TaskExternalRefRemoved
|
|
13201
|
+
*/
|
|
13202
|
+
var _044_TaskExternalRefRemoved_default = Effect.gen(function* () {
|
|
13203
|
+
const sql = yield* SqlClient.SqlClient;
|
|
13204
|
+
yield* sql`DROP INDEX IF EXISTS idx_tasks_external_ref_identifier`;
|
|
13205
|
+
yield* sql`ALTER TABLE tasks DROP COLUMN external_ref_json`;
|
|
13206
|
+
});
|
|
13207
|
+
//#endregion
|
|
13219
13208
|
//#region src/persistence/Migrations.ts
|
|
13220
13209
|
/**
|
|
13221
13210
|
* MigrationsLive - Migration runner with inline loader
|
|
@@ -13451,6 +13440,11 @@ const migrationEntries = [
|
|
|
13451
13440
|
43,
|
|
13452
13441
|
"TaskSync",
|
|
13453
13442
|
_043_TaskSync_default
|
|
13443
|
+
],
|
|
13444
|
+
[
|
|
13445
|
+
44,
|
|
13446
|
+
"TaskExternalRefRemoved",
|
|
13447
|
+
_044_TaskExternalRefRemoved_default
|
|
13454
13448
|
]
|
|
13455
13449
|
];
|
|
13456
13450
|
const makeMigrationLoader = (throughId) => Migrator.fromRecord(Object.fromEntries(migrationEntries.filter(([id]) => throughId === void 0 || id <= throughId).map(([id, name, migration]) => [`${id}_${name}`, migration])));
|
|
@@ -15058,10 +15052,7 @@ const DeleteTaskInput = Schema$1.Struct({ taskId: TaskId });
|
|
|
15058
15052
|
var TaskRepository = class extends Context.Service()("@p4code/cli/persistence/Services/Tasks/TaskRepository") {};
|
|
15059
15053
|
//#endregion
|
|
15060
15054
|
//#region src/persistence/Layers/Tasks.ts
|
|
15061
|
-
const TaskDbRow$1 = Task.mapFields(Struct.assign({
|
|
15062
|
-
labels: Schema$1.fromJsonString(Schema$1.Array(TaskLabel)),
|
|
15063
|
-
externalRef: Schema$1.NullOr(Schema$1.fromJsonString(TaskExternalRef))
|
|
15064
|
-
}));
|
|
15055
|
+
const TaskDbRow$1 = Task.mapFields(Struct.assign({ labels: Schema$1.fromJsonString(Schema$1.Array(TaskLabel)) }));
|
|
15065
15056
|
/**
|
|
15066
15057
|
* The `list` filter with every field normalized to a bound `null` rather than
|
|
15067
15058
|
* an absent key. Each predicate is then `(:param IS NULL OR column = :param)`,
|
|
@@ -15081,7 +15072,6 @@ const TASK_COLUMNS$1 = `
|
|
|
15081
15072
|
project_id AS "projectId",
|
|
15082
15073
|
repository_key AS "repositoryKey",
|
|
15083
15074
|
thread_id AS "threadId",
|
|
15084
|
-
external_ref_json AS "externalRef",
|
|
15085
15075
|
parent_task_id AS "parentTaskId",
|
|
15086
15076
|
title,
|
|
15087
15077
|
body,
|
|
@@ -15106,7 +15096,6 @@ const makeTaskRepository = Effect.gen(function* () {
|
|
|
15106
15096
|
project_id,
|
|
15107
15097
|
repository_key,
|
|
15108
15098
|
thread_id,
|
|
15109
|
-
external_ref_json,
|
|
15110
15099
|
parent_task_id,
|
|
15111
15100
|
title,
|
|
15112
15101
|
body,
|
|
@@ -15124,7 +15113,6 @@ const makeTaskRepository = Effect.gen(function* () {
|
|
|
15124
15113
|
${row.projectId},
|
|
15125
15114
|
${row.repositoryKey},
|
|
15126
15115
|
${row.threadId},
|
|
15127
|
-
${row.externalRef === null ? null : JSON.stringify(row.externalRef)},
|
|
15128
15116
|
${row.parentTaskId},
|
|
15129
15117
|
${row.title},
|
|
15130
15118
|
${row.body},
|
|
@@ -15142,7 +15130,6 @@ const makeTaskRepository = Effect.gen(function* () {
|
|
|
15142
15130
|
project_id = excluded.project_id,
|
|
15143
15131
|
repository_key = excluded.repository_key,
|
|
15144
15132
|
thread_id = excluded.thread_id,
|
|
15145
|
-
external_ref_json = excluded.external_ref_json,
|
|
15146
15133
|
parent_task_id = excluded.parent_task_id,
|
|
15147
15134
|
title = excluded.title,
|
|
15148
15135
|
body = excluded.body,
|
|
@@ -15242,7 +15229,6 @@ const makeTaskRepository = Effect.gen(function* () {
|
|
|
15242
15229
|
...input.projectId !== void 0 ? { projectId: input.projectId } : {},
|
|
15243
15230
|
...input.repositoryKey !== void 0 ? { repositoryKey: input.repositoryKey } : {},
|
|
15244
15231
|
...input.threadId !== void 0 ? { threadId: input.threadId } : {},
|
|
15245
|
-
...input.externalRef !== void 0 ? { externalRef: input.externalRef } : {},
|
|
15246
15232
|
...input.parentTaskId !== void 0 ? { parentTaskId: input.parentTaskId } : {},
|
|
15247
15233
|
...input.title !== void 0 ? { title: input.title } : {},
|
|
15248
15234
|
...input.body !== void 0 ? { body: input.body } : {},
|
|
@@ -15282,7 +15268,6 @@ const makeTaskRepository = Effect.gen(function* () {
|
|
|
15282
15268
|
...input.patch.projectId !== void 0 ? { projectId: input.patch.projectId } : {},
|
|
15283
15269
|
...input.patch.repositoryKey !== void 0 ? { repositoryKey: input.patch.repositoryKey } : {},
|
|
15284
15270
|
...input.patch.threadId !== void 0 ? { threadId: input.patch.threadId } : {},
|
|
15285
|
-
...input.patch.externalRef !== void 0 ? { externalRef: input.patch.externalRef } : {},
|
|
15286
15271
|
...input.patch.parentTaskId !== void 0 ? { parentTaskId: input.patch.parentTaskId } : {},
|
|
15287
15272
|
...input.patch.title !== void 0 ? { title: input.patch.title } : {},
|
|
15288
15273
|
...input.patch.body !== void 0 ? { body: input.patch.body } : {},
|
|
@@ -15417,7 +15402,7 @@ const createTaskRoute = HttpRouter.add("POST", "/tasks", respondToHubFailures(Ef
|
|
|
15417
15402
|
projectId: input.projectId ?? null,
|
|
15418
15403
|
repositoryKey: input.repositoryKey ?? null,
|
|
15419
15404
|
threadId: input.threadId ?? null,
|
|
15420
|
-
externalRef:
|
|
15405
|
+
externalRef: null,
|
|
15421
15406
|
parentTaskId: input.parentTaskId ?? null,
|
|
15422
15407
|
title: input.title,
|
|
15423
15408
|
body: input.body ?? "",
|
|
@@ -15458,7 +15443,7 @@ const putTaskRoute = HttpRouter.add("PUT", "/tasks/:taskId", respondToHubFailure
|
|
|
15458
15443
|
projectId: input.projectId,
|
|
15459
15444
|
repositoryKey: input.repositoryKey,
|
|
15460
15445
|
threadId: input.threadId,
|
|
15461
|
-
externalRef:
|
|
15446
|
+
externalRef: null,
|
|
15462
15447
|
parentTaskId: input.parentTaskId,
|
|
15463
15448
|
title: input.title,
|
|
15464
15449
|
body: input.body,
|
|
@@ -15808,6 +15793,18 @@ var _007_TaskParentTaskId_default = Effect.gen(function* () {
|
|
|
15808
15793
|
`;
|
|
15809
15794
|
});
|
|
15810
15795
|
//#endregion
|
|
15796
|
+
//#region src/hub/Migrations/008_TaskExternalRefRemoved.ts
|
|
15797
|
+
/**
|
|
15798
|
+
* Drops the mirror column, mirroring the environment server's migration 044.
|
|
15799
|
+
* The hub carried it so a mirrored ticket read the same on a second machine;
|
|
15800
|
+
* with nothing filing mirrors, there is nothing for it to carry.
|
|
15801
|
+
*/
|
|
15802
|
+
var _008_TaskExternalRefRemoved_default = Effect.gen(function* () {
|
|
15803
|
+
const sql = yield* SqlClient.SqlClient;
|
|
15804
|
+
yield* sql`DROP INDEX IF EXISTS idx_tasks_external_ref_identifier`;
|
|
15805
|
+
yield* sql`ALTER TABLE tasks DROP COLUMN external_ref_json`;
|
|
15806
|
+
});
|
|
15807
|
+
//#endregion
|
|
15811
15808
|
//#region src/hub/Migrations.ts
|
|
15812
15809
|
/**
|
|
15813
15810
|
* Hub migrations.
|
|
@@ -15853,6 +15850,11 @@ const hubMigrationEntries = [
|
|
|
15853
15850
|
7,
|
|
15854
15851
|
"TaskParentTaskId",
|
|
15855
15852
|
_007_TaskParentTaskId_default
|
|
15853
|
+
],
|
|
15854
|
+
[
|
|
15855
|
+
8,
|
|
15856
|
+
"TaskExternalRefRemoved",
|
|
15857
|
+
_008_TaskExternalRefRemoved_default
|
|
15856
15858
|
]
|
|
15857
15859
|
];
|
|
15858
15860
|
const hubMigrationLoader = Migrator.fromRecord(Object.fromEntries(hubMigrationEntries.map(([id, name, migration]) => [`${id}_${name}`, migration])));
|
|
@@ -36334,14 +36336,6 @@ const callMcpTool = Effect.fn("McpToolClient.callMcpTool")(function* (input) {
|
|
|
36334
36336
|
text
|
|
36335
36337
|
};
|
|
36336
36338
|
});
|
|
36337
|
-
/**
|
|
36338
|
-
* Linear's own tool for reading one issue.
|
|
36339
|
-
*
|
|
36340
|
-
* Named here rather than at each call site because two of them are now in
|
|
36341
|
-
* different modules - the board's store and the mirror refresh - and a tool
|
|
36342
|
-
* name that drifts between them fails at runtime with a shrug from the server.
|
|
36343
|
-
*/
|
|
36344
|
-
const LINEAR_GET_ISSUE_TOOL$1 = "get_issue";
|
|
36345
36339
|
/** Why a Linear call could not be made, in terms a person can act on. */
|
|
36346
36340
|
var LinearUnavailable = class extends Schema$1.TaggedErrorClass()("LinearUnavailable", {
|
|
36347
36341
|
reason: Schema$1.Literals([
|
|
@@ -36518,6 +36512,9 @@ function parseTicketReference(text) {
|
|
|
36518
36512
|
* in the `linear_task_links` sidecar instead. Everything Linear carries has a
|
|
36519
36513
|
* home here.
|
|
36520
36514
|
*
|
|
36515
|
+
* An issue becomes a card the board renders while it is on screen, and never a
|
|
36516
|
+
* row on p4code's own board: nothing here is a copy that can fall behind.
|
|
36517
|
+
*
|
|
36521
36518
|
* @module persistence/Layers/linearTaskMapping
|
|
36522
36519
|
*/
|
|
36523
36520
|
/**
|
|
@@ -36669,25 +36666,6 @@ const taskFromLinearIssue = (issue, link = EMPTY_LINEAR_TASK_LINK) => {
|
|
|
36669
36666
|
};
|
|
36670
36667
|
};
|
|
36671
36668
|
/**
|
|
36672
|
-
* What a refresh writes onto the local row.
|
|
36673
|
-
*
|
|
36674
|
-
* `undefined` for an issue Linear reported nothing usable for, on the same
|
|
36675
|
-
* reading as {@link taskFromLinearIssue}: a blank title is a caller that asked
|
|
36676
|
-
* for the wrong fields, and blanking the mirror is the worse answer.
|
|
36677
|
-
*/
|
|
36678
|
-
const linearMirrorFields = (issue) => {
|
|
36679
|
-
const task = taskFromLinearIssue(issue);
|
|
36680
|
-
if (task === void 0) return;
|
|
36681
|
-
return {
|
|
36682
|
-
title: task.title,
|
|
36683
|
-
body: task.body,
|
|
36684
|
-
status: task.status,
|
|
36685
|
-
priority: task.priority,
|
|
36686
|
-
assignee: task.assignee,
|
|
36687
|
-
labels: task.labels
|
|
36688
|
-
};
|
|
36689
|
-
};
|
|
36690
|
-
/**
|
|
36691
36669
|
* The fields `list_issues` has to return for a card to be complete.
|
|
36692
36670
|
*
|
|
36693
36671
|
* Named here rather than at the call site because `taskFromLinearIssue` reads
|
|
@@ -37065,7 +37043,6 @@ const makeHubTaskClient = Effect.gen(function* () {
|
|
|
37065
37043
|
projectId: row.projectId,
|
|
37066
37044
|
repositoryKey: row.repositoryKey,
|
|
37067
37045
|
threadId: row.threadId,
|
|
37068
|
-
externalRef: row.externalRef,
|
|
37069
37046
|
parentTaskId: row.parentTaskId,
|
|
37070
37047
|
title: row.title,
|
|
37071
37048
|
body: row.body,
|
|
@@ -37131,17 +37108,13 @@ Layer.effect(HubTaskClient, makeHubTaskClient);
|
|
|
37131
37108
|
*
|
|
37132
37109
|
* @module persistence/Layers/TaskSyncStore
|
|
37133
37110
|
*/
|
|
37134
|
-
const TaskDbRow = Task.mapFields(Struct.assign({
|
|
37135
|
-
labels: Schema$1.fromJsonString(Schema$1.Array(TaskLabel)),
|
|
37136
|
-
externalRef: Schema$1.NullOr(Schema$1.fromJsonString(TaskExternalRef))
|
|
37137
|
-
}));
|
|
37111
|
+
const TaskDbRow = Task.mapFields(Struct.assign({ labels: Schema$1.fromJsonString(Schema$1.Array(TaskLabel)) }));
|
|
37138
37112
|
const TASK_COLUMNS = `
|
|
37139
37113
|
task_id AS "taskId",
|
|
37140
37114
|
readable_id AS "readableId",
|
|
37141
37115
|
project_id AS "projectId",
|
|
37142
37116
|
repository_key AS "repositoryKey",
|
|
37143
37117
|
thread_id AS "threadId",
|
|
37144
|
-
external_ref_json AS "externalRef",
|
|
37145
37118
|
parent_task_id AS "parentTaskId",
|
|
37146
37119
|
title,
|
|
37147
37120
|
body,
|
|
@@ -37520,7 +37493,7 @@ const buildTaskRow = (input, taskId, timestamp, repositoryKey = null) => ({
|
|
|
37520
37493
|
projectId: input.projectId ?? null,
|
|
37521
37494
|
repositoryKey: repositoryKey ?? input.repositoryKey ?? null,
|
|
37522
37495
|
threadId: input.threadId ?? null,
|
|
37523
|
-
externalRef:
|
|
37496
|
+
externalRef: null,
|
|
37524
37497
|
parentTaskId: input.parentTaskId ?? null,
|
|
37525
37498
|
title: input.title,
|
|
37526
37499
|
body: input.body ?? "",
|
|
@@ -38508,106 +38481,6 @@ const make$37 = Effect.gen(function* () {
|
|
|
38508
38481
|
});
|
|
38509
38482
|
const layer$32 = Layer.effect(SkillRegistry, make$37);
|
|
38510
38483
|
//#endregion
|
|
38511
|
-
//#region src/mcp/TicketResolver.ts
|
|
38512
|
-
/**
|
|
38513
|
-
* The registered server name a Linear ticket is resolved through.
|
|
38514
|
-
*
|
|
38515
|
-
* Matched by name rather than by URL: the name is what the user typed in
|
|
38516
|
-
* Settings and what every other surface calls it, and a workspace may reach
|
|
38517
|
-
* Linear through a proxy URL that no pattern here would recognize.
|
|
38518
|
-
*/
|
|
38519
|
-
const LINEAR_SERVER_NAME = "linear";
|
|
38520
|
-
/** Linear's own tool for reading one issue. */
|
|
38521
|
-
const LINEAR_GET_ISSUE_TOOL = "get_issue";
|
|
38522
|
-
var TicketResolver = class extends Context.Service()("@p4code/cli/mcp/TicketResolver") {};
|
|
38523
|
-
const stringField$1 = (record, key) => {
|
|
38524
|
-
const value = record[key];
|
|
38525
|
-
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
38526
|
-
};
|
|
38527
|
-
const asRecord$1 = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
38528
|
-
/**
|
|
38529
|
-
* Find the issue inside whatever the tool returned.
|
|
38530
|
-
*
|
|
38531
|
-
* MCP leaves the shape of a tool result to the tool, so this accepts the three
|
|
38532
|
-
* arrangements in the wild - the structured payload itself, that payload with
|
|
38533
|
-
* the issue nested one level down, or a text block that happens to be JSON -
|
|
38534
|
-
* rather than assuming the one Linear happens to send today.
|
|
38535
|
-
*/
|
|
38536
|
-
const readIssue = (result) => {
|
|
38537
|
-
const structured = asRecord$1(result.structuredContent);
|
|
38538
|
-
if (structured !== void 0) {
|
|
38539
|
-
const nested = asRecord$1(structured["issue"]);
|
|
38540
|
-
if (nested !== void 0) return nested;
|
|
38541
|
-
if (stringField$1(structured, "url") !== void 0) return structured;
|
|
38542
|
-
}
|
|
38543
|
-
try {
|
|
38544
|
-
const parsed = JSON.parse(result.text);
|
|
38545
|
-
const record = asRecord$1(parsed);
|
|
38546
|
-
if (record === void 0) return structured;
|
|
38547
|
-
return asRecord$1(record["issue"]) ?? record;
|
|
38548
|
-
} catch {
|
|
38549
|
-
return structured;
|
|
38550
|
-
}
|
|
38551
|
-
};
|
|
38552
|
-
const make$36 = Effect.gen(function* () {
|
|
38553
|
-
const registry = yield* McpRegistry;
|
|
38554
|
-
const oauth = yield* McpOAuth;
|
|
38555
|
-
const http = yield* HttpClient$1.HttpClient;
|
|
38556
|
-
return { resolve: Effect.fn("TicketResolver.resolve")(function* (reference) {
|
|
38557
|
-
const identifier = parseTicketReference(reference);
|
|
38558
|
-
if (identifier === null) return yield* new TicketResolveError({
|
|
38559
|
-
reason: "not_found",
|
|
38560
|
-
detail: `"${reference}" does not look like a ticket reference.`
|
|
38561
|
-
});
|
|
38562
|
-
const server = (yield* registry.list).find((candidate) => candidate.registration.name.toLowerCase() === LINEAR_SERVER_NAME && candidate.registration.enabled);
|
|
38563
|
-
if (server === void 0 || server.registration.transport === "stdio") return yield* new TicketResolveError({
|
|
38564
|
-
reason: "not_configured",
|
|
38565
|
-
detail: "No Linear MCP server is registered on this machine. Add it in Settings to link tickets."
|
|
38566
|
-
});
|
|
38567
|
-
const registration = server.registration;
|
|
38568
|
-
const token = yield* oauth.accessTokenFor(registration);
|
|
38569
|
-
const headers = {
|
|
38570
|
-
...registration.headers,
|
|
38571
|
-
...Option.isSome(token) ? { authorization: `Bearer ${token.value}` } : {}
|
|
38572
|
-
};
|
|
38573
|
-
if (Option.isNone(token) && Object.keys(registration.headers ?? {}).length === 0) return yield* new TicketResolveError({
|
|
38574
|
-
reason: "not_authorized",
|
|
38575
|
-
detail: "Linear is registered but not signed in on this machine. Sign in from Settings."
|
|
38576
|
-
});
|
|
38577
|
-
const result = yield* callMcpTool({
|
|
38578
|
-
url: registration.url,
|
|
38579
|
-
headers,
|
|
38580
|
-
toolName: LINEAR_GET_ISSUE_TOOL,
|
|
38581
|
-
arguments: { id: identifier }
|
|
38582
|
-
}).pipe(Effect.provideService(HttpClient$1.HttpClient, http), Effect.mapError((error) => error.status === 401 || error.status === 403 ? new TicketResolveError({
|
|
38583
|
-
reason: "not_authorized",
|
|
38584
|
-
detail: "Linear rejected p4code's sign-in. Sign in again from Settings."
|
|
38585
|
-
}) : new TicketResolveError({
|
|
38586
|
-
reason: "unavailable",
|
|
38587
|
-
detail: error.detail
|
|
38588
|
-
})));
|
|
38589
|
-
const issue = readIssue(result);
|
|
38590
|
-
const url = issue === void 0 ? void 0 : stringField$1(issue, "url");
|
|
38591
|
-
const title = issue === void 0 ? void 0 : stringField$1(issue, "title");
|
|
38592
|
-
if (issue === void 0 || url === void 0 || title === void 0) return yield* new TicketResolveError({
|
|
38593
|
-
reason: "not_found",
|
|
38594
|
-
detail: `Linear returned nothing usable for ${identifier}.`
|
|
38595
|
-
});
|
|
38596
|
-
const externalRef = {
|
|
38597
|
-
source: "linear",
|
|
38598
|
-
identifier: stringField$1(issue, "identifier") ?? identifier,
|
|
38599
|
-
url
|
|
38600
|
-
};
|
|
38601
|
-
const description = stringField$1(issue, "description");
|
|
38602
|
-
return {
|
|
38603
|
-
externalRef,
|
|
38604
|
-
title,
|
|
38605
|
-
...description === void 0 ? {} : { description }
|
|
38606
|
-
};
|
|
38607
|
-
}) };
|
|
38608
|
-
});
|
|
38609
|
-
const layer$31 = Layer.effect(TicketResolver, make$36);
|
|
38610
|
-
//#endregion
|
|
38611
38484
|
//#region ../../packages/shared/src/KeyedCoalescingWorker.ts
|
|
38612
38485
|
const makeKeyedCoalescingWorker = (options) => Effect.gen(function* () {
|
|
38613
38486
|
const queue = yield* Effect.acquireRelease(TxQueue.unbounded(), TxQueue.shutdown);
|
|
@@ -38905,7 +38778,7 @@ const serversEqual = (left, right) => {
|
|
|
38905
38778
|
}
|
|
38906
38779
|
return true;
|
|
38907
38780
|
};
|
|
38908
|
-
const make$
|
|
38781
|
+
const make$36 = Effect.gen(function* PortDiscoveryMake() {
|
|
38909
38782
|
const net = yield* NetService;
|
|
38910
38783
|
const processRunner = yield* ProcessRunner;
|
|
38911
38784
|
const hostPlatform = yield* HostProcessPlatform;
|
|
@@ -39056,7 +38929,7 @@ const make$35 = Effect.gen(function* PortDiscoveryMake() {
|
|
|
39056
38929
|
unregisterTerminal
|
|
39057
38930
|
});
|
|
39058
38931
|
}).pipe(Effect.withSpan("PortDiscovery.make"));
|
|
39059
|
-
const layer$
|
|
38932
|
+
const layer$31 = Layer.effect(PortDiscovery, make$36);
|
|
39060
38933
|
//#endregion
|
|
39061
38934
|
//#region src/terminal/Manager.ts
|
|
39062
38935
|
/**
|
|
@@ -39734,7 +39607,7 @@ function normalizedRuntimeEnv(env) {
|
|
|
39734
39607
|
if (entries.length === 0) return null;
|
|
39735
39608
|
return Object.fromEntries(entries.toSorted(([left], [right]) => left.localeCompare(right)));
|
|
39736
39609
|
}
|
|
39737
|
-
const make$
|
|
39610
|
+
const make$35 = Effect.fn("TerminalManager.make")(function* () {
|
|
39738
39611
|
const { terminalLogsDir } = yield* ServerConfig$1;
|
|
39739
39612
|
const ptyAdapter = yield* PtyAdapter;
|
|
39740
39613
|
const portDiscovery = yield* PortDiscovery;
|
|
@@ -40696,7 +40569,7 @@ const makeWithOptions$1 = Effect.fn("TerminalManager.makeWithOptions")(function*
|
|
|
40696
40569
|
subscribeMetadata
|
|
40697
40570
|
});
|
|
40698
40571
|
});
|
|
40699
|
-
const layer$
|
|
40572
|
+
const layer$30 = Layer.effect(TerminalManager, make$35()).pipe(Layer.provide(layer$54));
|
|
40700
40573
|
//#endregion
|
|
40701
40574
|
//#region src/mcp/McpInvocationContext.ts
|
|
40702
40575
|
var McpInvocationContext = class extends Context.Service()("@p4code/cli/mcp/McpInvocationContext") {};
|
|
@@ -40906,7 +40779,7 @@ const classifyResponseError = (context, error) => {
|
|
|
40906
40779
|
});
|
|
40907
40780
|
}
|
|
40908
40781
|
};
|
|
40909
|
-
const make$
|
|
40782
|
+
const make$34 = Effect.gen(function* PreviewAutomationBrokerMake() {
|
|
40910
40783
|
const crypto = yield* Crypto.Crypto;
|
|
40911
40784
|
const state = yield* SynchronizedRef.make({
|
|
40912
40785
|
clients: /* @__PURE__ */ new Map(),
|
|
@@ -41140,7 +41013,7 @@ const make$33 = Effect.gen(function* PreviewAutomationBrokerMake() {
|
|
|
41140
41013
|
invoke
|
|
41141
41014
|
});
|
|
41142
41015
|
}).pipe(Effect.withSpan("PreviewAutomationBroker.make"));
|
|
41143
|
-
const layer$
|
|
41016
|
+
const layer$29 = Layer.effect(PreviewAutomationBroker, make$34);
|
|
41144
41017
|
//#endregion
|
|
41145
41018
|
//#region src/preview/Manager.ts
|
|
41146
41019
|
/**
|
|
@@ -41204,7 +41077,7 @@ const buildIdleSnapshot = (input) => ({
|
|
|
41204
41077
|
viewport: FILL_PREVIEW_VIEWPORT,
|
|
41205
41078
|
updatedAt: input.updatedAt
|
|
41206
41079
|
});
|
|
41207
|
-
const make$
|
|
41080
|
+
const make$33 = Effect.gen(function* PreviewManagerMake() {
|
|
41208
41081
|
const serverEpoch = NodeCrypto.randomUUID();
|
|
41209
41082
|
const stateRef = yield* SynchronizedRef.make(initialState);
|
|
41210
41083
|
const eventsPubSub = yield* PubSub.unbounded();
|
|
@@ -41435,7 +41308,7 @@ const make$32 = Effect.gen(function* PreviewManagerMake() {
|
|
|
41435
41308
|
subscribeEvents: PubSub.subscribe(eventsPubSub)
|
|
41436
41309
|
});
|
|
41437
41310
|
}).pipe(Effect.withSpan("PreviewManager.make"));
|
|
41438
|
-
const layer$
|
|
41311
|
+
const layer$28 = Layer.effect(PreviewManager, make$33);
|
|
41439
41312
|
//#endregion
|
|
41440
41313
|
//#region src/workspace/WorkspaceSearchIndex.ts
|
|
41441
41314
|
const WORKSPACE_INDEX_MAX_ENTRIES = 25e3;
|
|
@@ -41569,7 +41442,7 @@ const waitForScan = (cwd, finder, onFailure) => Effect.try({
|
|
|
41569
41442
|
timeout: WORKSPACE_INDEX_SCAN_TIMEOUT
|
|
41570
41443
|
})
|
|
41571
41444
|
}), Effect.withSpan("WorkspaceSearchIndex.waitForScan"));
|
|
41572
|
-
const make$
|
|
41445
|
+
const make$32 = Effect.fn("WorkspaceSearchIndex.make")(function* (cwd) {
|
|
41573
41446
|
const finder = yield* Effect.acquireRelease(createFinder(cwd), (finder) => Effect.try({
|
|
41574
41447
|
try: () => finder.destroy(),
|
|
41575
41448
|
catch: (cause) => new WorkspaceSearchIndexDestroyFailed({
|
|
@@ -41643,9 +41516,9 @@ const make$31 = Effect.fn("WorkspaceSearchIndex.make")(function* (cwd) {
|
|
|
41643
41516
|
* workspace root. WorkspaceSearchIndexMap owns memoization and idle cleanup;
|
|
41644
41517
|
* using a default cwd here would mix resources from different workspaces.
|
|
41645
41518
|
*/
|
|
41646
|
-
const layer$
|
|
41519
|
+
const layer$27 = (cwd) => Layer.effect(WorkspaceSearchIndex, make$32(cwd));
|
|
41647
41520
|
var WorkspaceSearchIndexMap = class extends LayerMap.Service()("@p4code/cli/workspace/WorkspaceSearchIndexMap", {
|
|
41648
|
-
lookup: layer$
|
|
41521
|
+
lookup: layer$27,
|
|
41649
41522
|
idleTimeToLive: WORKSPACE_INDEX_IDLE_TTL
|
|
41650
41523
|
}) {};
|
|
41651
41524
|
//#endregion
|
|
@@ -41707,7 +41580,7 @@ const resolveBrowseTarget = Effect.fn("WorkspaceEntries.resolveBrowseTarget")(fu
|
|
|
41707
41580
|
if (!input.cwd) return yield* new WorkspaceEntriesCurrentProjectRequiredError({ partialPath: input.partialPath });
|
|
41708
41581
|
return path.resolve(expandHomePath$1(input.cwd, path), input.partialPath);
|
|
41709
41582
|
});
|
|
41710
|
-
const make$
|
|
41583
|
+
const make$31 = Effect.gen(function* () {
|
|
41711
41584
|
const path = yield* Path.Path;
|
|
41712
41585
|
const workspacePaths = yield* WorkspacePaths;
|
|
41713
41586
|
const workspaceSearchIndexes = yield* WorkspaceSearchIndexMap;
|
|
@@ -41781,7 +41654,7 @@ const make$30 = Effect.gen(function* () {
|
|
|
41781
41654
|
search
|
|
41782
41655
|
});
|
|
41783
41656
|
});
|
|
41784
|
-
const layer$
|
|
41657
|
+
const layer$26 = Layer.effect(WorkspaceEntries, make$31).pipe(Layer.provide(WorkspaceSearchIndexMap.layer));
|
|
41785
41658
|
//#endregion
|
|
41786
41659
|
//#region src/workspace/WorkspaceFileSystem.ts
|
|
41787
41660
|
/**
|
|
@@ -41840,7 +41713,7 @@ Schema$1.Union([
|
|
|
41840
41713
|
]);
|
|
41841
41714
|
/** Service tag for workspace file operations. */
|
|
41842
41715
|
var WorkspaceFileSystem = class extends Context.Service()("@p4code/cli/workspace/WorkspaceFileSystem") {};
|
|
41843
|
-
const make$
|
|
41716
|
+
const make$30 = Effect.gen(function* () {
|
|
41844
41717
|
const fileSystem = yield* FileSystem.FileSystem;
|
|
41845
41718
|
const path = yield* Path.Path;
|
|
41846
41719
|
const workspacePaths = yield* WorkspacePaths;
|
|
@@ -41975,7 +41848,7 @@ const make$29 = Effect.gen(function* () {
|
|
|
41975
41848
|
writeFile
|
|
41976
41849
|
});
|
|
41977
41850
|
});
|
|
41978
|
-
const layer$
|
|
41851
|
+
const layer$25 = Layer.effect(WorkspaceFileSystem, make$30);
|
|
41979
41852
|
//#endregion
|
|
41980
41853
|
//#region src/textGeneration/TextGenerationPresets.ts
|
|
41981
41854
|
const conventionalCommitsTextGenerationPolicy = {
|
|
@@ -42039,7 +41912,7 @@ var ProjectSetupScriptProjectNotFoundError = class extends Schema$1.TaggedErrorC
|
|
|
42039
41912
|
};
|
|
42040
41913
|
Schema$1.Union([ProjectSetupScriptOperationError, ProjectSetupScriptProjectNotFoundError]);
|
|
42041
41914
|
var ProjectSetupScriptRunner = class extends Context.Service()("@p4code/cli/project/ProjectSetupScriptRunner") {};
|
|
42042
|
-
const make$
|
|
41915
|
+
const make$29 = Effect.gen(function* () {
|
|
42043
41916
|
const projectionSnapshotQuery = yield* ProjectionSnapshotQuery;
|
|
42044
41917
|
const terminalManager = yield* TerminalManager;
|
|
42045
41918
|
const runForThread = Effect.fn("ProjectSetupScriptRunner.runForThread")(function* (input) {
|
|
@@ -42097,7 +41970,7 @@ const make$28 = Effect.gen(function* () {
|
|
|
42097
41970
|
});
|
|
42098
41971
|
return ProjectSetupScriptRunner.of({ runForThread });
|
|
42099
41972
|
});
|
|
42100
|
-
const layer$
|
|
41973
|
+
const layer$24 = Layer.effect(ProjectSetupScriptRunner, make$29);
|
|
42101
41974
|
//#endregion
|
|
42102
41975
|
//#region src/sourceControl/azureDevOpsPullRequests.ts
|
|
42103
41976
|
const AzureDevOpsPullRequestSchema = Schema$1.Struct({
|
|
@@ -42400,7 +42273,7 @@ function decodeAzureDevOpsJson(raw, schema, operation, cwd) {
|
|
|
42400
42273
|
cause
|
|
42401
42274
|
})));
|
|
42402
42275
|
}
|
|
42403
|
-
const make$
|
|
42276
|
+
const make$28 = Effect.gen(function* () {
|
|
42404
42277
|
const process = yield* VcsProcess;
|
|
42405
42278
|
const execute = (input) => process.run({
|
|
42406
42279
|
operation: "AzureDevOpsCli.execute",
|
|
@@ -42542,7 +42415,7 @@ const make$27 = Effect.gen(function* () {
|
|
|
42542
42415
|
}).pipe(Effect.asVoid)
|
|
42543
42416
|
});
|
|
42544
42417
|
});
|
|
42545
|
-
const layer$
|
|
42418
|
+
const layer$23 = Layer.effect(AzureDevOpsCli, make$28);
|
|
42546
42419
|
//#endregion
|
|
42547
42420
|
//#region src/sourceControl/SourceControlProviderDiscovery.ts
|
|
42548
42421
|
function firstNonEmptyLine(text) {
|
|
@@ -42745,7 +42618,7 @@ function toChangeRequest$3(summary) {
|
|
|
42745
42618
|
isCrossRepository: false
|
|
42746
42619
|
};
|
|
42747
42620
|
}
|
|
42748
|
-
const make$
|
|
42621
|
+
const make$27 = Effect.gen(function* () {
|
|
42749
42622
|
const azure = yield* AzureDevOpsCli;
|
|
42750
42623
|
return SourceControlProvider.of({
|
|
42751
42624
|
kind: "azure-devops",
|
|
@@ -42837,7 +42710,7 @@ const make$26 = Effect.gen(function* () {
|
|
|
42837
42710
|
})))
|
|
42838
42711
|
});
|
|
42839
42712
|
});
|
|
42840
|
-
Layer.effect(SourceControlProvider, make$
|
|
42713
|
+
Layer.effect(SourceControlProvider, make$27);
|
|
42841
42714
|
//#endregion
|
|
42842
42715
|
//#region src/sourceControl/bitbucketPullRequests.ts
|
|
42843
42716
|
const BitbucketRepositoryRefSchema = Schema$1.Struct({
|
|
@@ -43151,7 +43024,7 @@ function responseError(operation, response) {
|
|
|
43151
43024
|
responseBodyLength: body.length
|
|
43152
43025
|
}))));
|
|
43153
43026
|
}
|
|
43154
|
-
const make$
|
|
43027
|
+
const make$26 = Effect.gen(function* () {
|
|
43155
43028
|
const config = yield* BitbucketApiEnvConfig;
|
|
43156
43029
|
const httpClient = yield* HttpClient.HttpClient;
|
|
43157
43030
|
const fileSystem = yield* FileSystem.FileSystem;
|
|
@@ -43315,7 +43188,7 @@ const make$25 = Effect.gen(function* () {
|
|
|
43315
43188
|
})))
|
|
43316
43189
|
});
|
|
43317
43190
|
});
|
|
43318
|
-
const layer$
|
|
43191
|
+
const layer$21 = Layer.effect(BitbucketApi, make$26);
|
|
43319
43192
|
//#endregion
|
|
43320
43193
|
//#region src/sourceControl/BitbucketSourceControlProvider.ts
|
|
43321
43194
|
function toChangeRequest$2(summary) {
|
|
@@ -43333,7 +43206,7 @@ function toChangeRequest$2(summary) {
|
|
|
43333
43206
|
...summary.headRepositoryOwnerLogin !== void 0 ? { headRepositoryOwnerLogin: summary.headRepositoryOwnerLogin } : {}
|
|
43334
43207
|
};
|
|
43335
43208
|
}
|
|
43336
|
-
const make$
|
|
43209
|
+
const make$25 = Effect.gen(function* () {
|
|
43337
43210
|
const bitbucket = yield* BitbucketApi;
|
|
43338
43211
|
return SourceControlProvider.of({
|
|
43339
43212
|
kind: "bitbucket",
|
|
@@ -43424,7 +43297,7 @@ const make$24 = Effect.gen(function* () {
|
|
|
43424
43297
|
})))
|
|
43425
43298
|
});
|
|
43426
43299
|
});
|
|
43427
|
-
Layer.effect(SourceControlProvider, make$
|
|
43300
|
+
Layer.effect(SourceControlProvider, make$25);
|
|
43428
43301
|
const makeDiscovery = Effect.gen(function* () {
|
|
43429
43302
|
return {
|
|
43430
43303
|
type: "api",
|
|
@@ -43653,7 +43526,7 @@ function deriveRepositoryCloneUrlsFromCreateOutput(stdout, repository) {
|
|
|
43653
43526
|
sshUrl: `git@${fallbackHost}:${repository}.git`
|
|
43654
43527
|
};
|
|
43655
43528
|
}
|
|
43656
|
-
const make$
|
|
43529
|
+
const make$24 = Effect.gen(function* () {
|
|
43657
43530
|
const process = yield* VcsProcess;
|
|
43658
43531
|
const execute = (input) => process.run({
|
|
43659
43532
|
operation: "GitHubCli.execute",
|
|
@@ -43769,7 +43642,7 @@ const make$23 = Effect.gen(function* () {
|
|
|
43769
43642
|
}).pipe(Effect.asVoid)
|
|
43770
43643
|
});
|
|
43771
43644
|
});
|
|
43772
|
-
const layer$
|
|
43645
|
+
const layer$19 = Layer.effect(GitHubCli, make$24);
|
|
43773
43646
|
//#endregion
|
|
43774
43647
|
//#region src/sourceControl/gitHubAuthStatus.ts
|
|
43775
43648
|
const GitHubAuthStatusAccountSchema = Schema$1.Struct({
|
|
@@ -43870,7 +43743,7 @@ const discovery$1 = {
|
|
|
43870
43743
|
parseAuth: parseGitHubAuth,
|
|
43871
43744
|
installHint: "Install the GitHub command-line tool (`gh`) via https://cli.github.com/ or your package manager (for example `brew install gh`)."
|
|
43872
43745
|
};
|
|
43873
|
-
const make$
|
|
43746
|
+
const make$23 = Effect.gen(function* () {
|
|
43874
43747
|
const github = yield* GitHubCli;
|
|
43875
43748
|
const listChangeRequests = (input) => {
|
|
43876
43749
|
if (input.state === "open") return github.listOpenPullRequests({
|
|
@@ -43986,7 +43859,7 @@ const make$22 = Effect.gen(function* () {
|
|
|
43986
43859
|
})))
|
|
43987
43860
|
});
|
|
43988
43861
|
});
|
|
43989
|
-
Layer.effect(SourceControlProvider, make$
|
|
43862
|
+
Layer.effect(SourceControlProvider, make$23);
|
|
43990
43863
|
//#endregion
|
|
43991
43864
|
//#region src/sourceControl/gitLabMergeRequests.ts
|
|
43992
43865
|
const GitLabProjectReferenceSchema = Schema$1.Struct({
|
|
@@ -44297,7 +44170,7 @@ function parseRepositoryPath(repository) {
|
|
|
44297
44170
|
projectPath
|
|
44298
44171
|
};
|
|
44299
44172
|
}
|
|
44300
|
-
const make$
|
|
44173
|
+
const make$22 = Effect.gen(function* () {
|
|
44301
44174
|
const process = yield* VcsProcess;
|
|
44302
44175
|
const run = (input, mapError) => process.run({
|
|
44303
44176
|
operation: "GitLabCli.execute",
|
|
@@ -44446,7 +44319,7 @@ const make$21 = Effect.gen(function* () {
|
|
|
44446
44319
|
}).pipe(Effect.asVoid)
|
|
44447
44320
|
});
|
|
44448
44321
|
});
|
|
44449
|
-
const layer$
|
|
44322
|
+
const layer$17 = Layer.effect(GitLabCli, make$22);
|
|
44450
44323
|
//#endregion
|
|
44451
44324
|
//#region src/sourceControl/gitLabAuthStatus.ts
|
|
44452
44325
|
const HOST_LINE_PATTERN = /^(?:[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?|\[[a-f0-9:.]+\])(?::\d+)?$/iu;
|
|
@@ -44543,7 +44416,7 @@ const discovery = {
|
|
|
44543
44416
|
refineUnknownRemote: refineUnknownGitLabRemote,
|
|
44544
44417
|
installHint: "Install the GitLab command-line tool (`glab`) from https://gitlab.com/gitlab-org/cli or your package manager (for example `brew install glab`)."
|
|
44545
44418
|
};
|
|
44546
|
-
const make$
|
|
44419
|
+
const make$21 = Effect.gen(function* () {
|
|
44547
44420
|
const gitlab = yield* GitLabCli;
|
|
44548
44421
|
return SourceControlProvider.of({
|
|
44549
44422
|
kind: "gitlab",
|
|
@@ -44631,7 +44504,7 @@ const make$20 = Effect.gen(function* () {
|
|
|
44631
44504
|
})))
|
|
44632
44505
|
});
|
|
44633
44506
|
});
|
|
44634
|
-
Layer.effect(SourceControlProvider, make$
|
|
44507
|
+
Layer.effect(SourceControlProvider, make$21);
|
|
44635
44508
|
//#endregion
|
|
44636
44509
|
//#region src/sourceControl/SourceControlProviderRegistry.ts
|
|
44637
44510
|
const PROVIDER_DETECTION_CACHE_CAPACITY = 2048;
|
|
@@ -44782,12 +44655,12 @@ const makeWithProviders = Effect.fn("makeSourceControlProviderRegistryWithProvid
|
|
|
44782
44655
|
})), { concurrency: "unbounded" })
|
|
44783
44656
|
});
|
|
44784
44657
|
});
|
|
44785
|
-
const make$
|
|
44786
|
-
const github = yield* make$
|
|
44787
|
-
const gitlab = yield* make$
|
|
44788
|
-
const bitbucket = yield* make$
|
|
44658
|
+
const make$20 = Effect.gen(function* () {
|
|
44659
|
+
const github = yield* make$23;
|
|
44660
|
+
const gitlab = yield* make$21;
|
|
44661
|
+
const bitbucket = yield* make$25;
|
|
44789
44662
|
const bitbucketDiscovery = yield* makeDiscovery;
|
|
44790
|
-
const azureDevOps = yield* make$
|
|
44663
|
+
const azureDevOps = yield* make$27;
|
|
44791
44664
|
return yield* makeWithProviders([
|
|
44792
44665
|
{
|
|
44793
44666
|
kind: "github",
|
|
@@ -44811,7 +44684,7 @@ const make$19 = Effect.gen(function* () {
|
|
|
44811
44684
|
}
|
|
44812
44685
|
]);
|
|
44813
44686
|
});
|
|
44814
|
-
const layer$
|
|
44687
|
+
const layer$15 = Layer.effect(SourceControlProviderRegistry, make$20);
|
|
44815
44688
|
//#endregion
|
|
44816
44689
|
//#region src/sourceControl/PrTemplateDetection.ts
|
|
44817
44690
|
const TEMPLATE_MAX_BYTES = 8e3;
|
|
@@ -45181,7 +45054,7 @@ function toPullRequestHeadRemoteInfo(pr) {
|
|
|
45181
45054
|
...pr.headRepositoryOwnerLogin !== void 0 ? { headRepositoryOwnerLogin: pr.headRepositoryOwnerLogin } : {}
|
|
45182
45055
|
};
|
|
45183
45056
|
}
|
|
45184
|
-
const make$
|
|
45057
|
+
const make$19 = Effect.gen(function* () {
|
|
45185
45058
|
const gitCore = yield* GitVcsDriver;
|
|
45186
45059
|
const sourceControlProviders = yield* SourceControlProviderRegistry;
|
|
45187
45060
|
const textGeneration = yield* TextGeneration;
|
|
@@ -46099,7 +45972,7 @@ const make$18 = Effect.gen(function* () {
|
|
|
46099
45972
|
runStackedAction
|
|
46100
45973
|
});
|
|
46101
45974
|
});
|
|
46102
|
-
const layer$
|
|
45975
|
+
const layer$14 = Layer.effect(GitManager, make$19);
|
|
46103
45976
|
//#endregion
|
|
46104
45977
|
//#region src/git/GitWorkflowService.ts
|
|
46105
45978
|
var GitWorkflowService = class extends Context.Service()("@p4code/cli/git/GitWorkflowService") {};
|
|
@@ -46136,7 +46009,7 @@ function nonRepositoryListRefs() {
|
|
|
46136
46009
|
totalCount: 0
|
|
46137
46010
|
};
|
|
46138
46011
|
}
|
|
46139
|
-
const make$
|
|
46012
|
+
const make$18 = Effect.gen(function* () {
|
|
46140
46013
|
const registry = yield* VcsDriverRegistry;
|
|
46141
46014
|
const git = yield* GitVcsDriver;
|
|
46142
46015
|
const gitManager = yield* GitManager;
|
|
@@ -46222,7 +46095,7 @@ const make$17 = Effect.gen(function* () {
|
|
|
46222
46095
|
renameBranch: (input) => ensureGit("GitWorkflowService.renameBranch", input.cwd).pipe(Effect.andThen(git.renameBranch(input)))
|
|
46223
46096
|
});
|
|
46224
46097
|
});
|
|
46225
|
-
const layer$
|
|
46098
|
+
const layer$13 = Layer.effect(GitWorkflowService, make$18);
|
|
46226
46099
|
//#endregion
|
|
46227
46100
|
//#region src/vcs/VcsStatusBroadcaster.ts
|
|
46228
46101
|
const DEFAULT_VCS_STATUS_REFRESH_INTERVAL = Duration.seconds(30);
|
|
@@ -46294,7 +46167,7 @@ function fingerprintStatusPart(status) {
|
|
|
46294
46167
|
return JSON.stringify(status);
|
|
46295
46168
|
}
|
|
46296
46169
|
const normalizeCwd = (cwd) => Effect.service(FileSystem.FileSystem).pipe(Effect.flatMap((fs) => fs.realPath(cwd)), Effect.orElseSucceed(() => cwd));
|
|
46297
|
-
const make$
|
|
46170
|
+
const make$17 = Effect.gen(function* () {
|
|
46298
46171
|
const workflow = yield* GitWorkflowService;
|
|
46299
46172
|
const fs = yield* FileSystem.FileSystem;
|
|
46300
46173
|
const changesPubSub = yield* Effect.acquireRelease(PubSub.unbounded(), (pubsub) => PubSub.shutdown(pubsub));
|
|
@@ -46518,7 +46391,7 @@ const make$16 = Effect.gen(function* () {
|
|
|
46518
46391
|
streamStatus
|
|
46519
46392
|
});
|
|
46520
46393
|
});
|
|
46521
|
-
const layer$
|
|
46394
|
+
const layer$12 = Layer.effect(VcsStatusBroadcaster, make$17);
|
|
46522
46395
|
//#endregion
|
|
46523
46396
|
//#region src/vcs/VcsProvisioningService.ts
|
|
46524
46397
|
var VcsProvisioningService = class extends Context.Service()("@p4code/cli/vcs/VcsProvisioningService") {};
|
|
@@ -46531,7 +46404,7 @@ function resolveRequestedKind(kind) {
|
|
|
46531
46404
|
}));
|
|
46532
46405
|
return Effect.succeed(kind);
|
|
46533
46406
|
}
|
|
46534
|
-
const make$
|
|
46407
|
+
const make$16 = Effect.gen(function* () {
|
|
46535
46408
|
const registry = yield* VcsDriverRegistry;
|
|
46536
46409
|
const initRepository = Effect.fn("VcsProvisioningService.initRepository")(function* (input) {
|
|
46537
46410
|
const kind = yield* resolveRequestedKind(input.kind);
|
|
@@ -46539,11 +46412,11 @@ const make$15 = Effect.gen(function* () {
|
|
|
46539
46412
|
});
|
|
46540
46413
|
return VcsProvisioningService.of({ initRepository });
|
|
46541
46414
|
});
|
|
46542
|
-
const layer$
|
|
46415
|
+
const layer$11 = Layer.effect(VcsProvisioningService, make$16);
|
|
46543
46416
|
//#endregion
|
|
46544
46417
|
//#region src/review/ReviewService.ts
|
|
46545
46418
|
var ReviewService = class extends Context.Service()("@p4code/cli/review/ReviewService") {};
|
|
46546
|
-
const make$
|
|
46419
|
+
const make$15 = Effect.gen(function* () {
|
|
46547
46420
|
const config = yield* ServerConfig$1;
|
|
46548
46421
|
const fileSystem = yield* FileSystem.FileSystem;
|
|
46549
46422
|
const path = yield* Path.Path;
|
|
@@ -46599,7 +46472,7 @@ const make$14 = Effect.gen(function* () {
|
|
|
46599
46472
|
});
|
|
46600
46473
|
return ReviewService.of({ getDiffPreview });
|
|
46601
46474
|
});
|
|
46602
|
-
const layer$
|
|
46475
|
+
const layer$10 = Layer.effect(ReviewService, make$15);
|
|
46603
46476
|
//#endregion
|
|
46604
46477
|
//#region src/diagnostics/ProcessDiagnostics.ts
|
|
46605
46478
|
const PROCESS_QUERY_TIMEOUT_MS = 1e3;
|
|
@@ -46894,7 +46767,7 @@ function assertDescendantPid(pid) {
|
|
|
46894
46767
|
}));
|
|
46895
46768
|
}));
|
|
46896
46769
|
}
|
|
46897
|
-
const make$
|
|
46770
|
+
const make$14 = Effect.gen(function* () {
|
|
46898
46771
|
const spawner = yield* ChildProcessSpawner$1.ChildProcessSpawner;
|
|
46899
46772
|
const read = Effect.gen(function* () {
|
|
46900
46773
|
const readAt = yield* DateTime.now;
|
|
@@ -46938,7 +46811,7 @@ const make$13 = Effect.gen(function* () {
|
|
|
46938
46811
|
signal
|
|
46939
46812
|
});
|
|
46940
46813
|
});
|
|
46941
|
-
const layer$
|
|
46814
|
+
const layer$9 = Layer.effect(ProcessDiagnostics, make$14);
|
|
46942
46815
|
//#endregion
|
|
46943
46816
|
//#region src/diagnostics/ProcessResourceMonitor.ts
|
|
46944
46817
|
const SAMPLE_INTERVAL_MS = 5e3;
|
|
@@ -47089,7 +46962,7 @@ function aggregateProcessResourceHistory(input) {
|
|
|
47089
46962
|
}) : Option.none()
|
|
47090
46963
|
};
|
|
47091
46964
|
}
|
|
47092
|
-
const make$
|
|
46965
|
+
const make$13 = Effect.gen(function* () {
|
|
47093
46966
|
const spawner = yield* ChildProcessSpawner$1.ChildProcessSpawner;
|
|
47094
46967
|
const state = yield* Ref.make({
|
|
47095
46968
|
samples: [],
|
|
@@ -47138,7 +47011,7 @@ const make$12 = Effect.gen(function* () {
|
|
|
47138
47011
|
});
|
|
47139
47012
|
return ProcessResourceMonitor.of({ readHistory });
|
|
47140
47013
|
});
|
|
47141
|
-
const layer$
|
|
47014
|
+
const layer$8 = Layer.effect(ProcessResourceMonitor, make$13);
|
|
47142
47015
|
//#endregion
|
|
47143
47016
|
//#region src/diagnostics/TraceDiagnostics.ts
|
|
47144
47017
|
var TraceFileReadError = class extends Schema$1.TaggedErrorClass()("TraceFileReadError", {
|
|
@@ -47386,7 +47259,7 @@ function readTraceFile(fileSystem, path) {
|
|
|
47386
47259
|
cause
|
|
47387
47260
|
})) }));
|
|
47388
47261
|
}
|
|
47389
|
-
const make$
|
|
47262
|
+
const make$12 = Effect.gen(function* () {
|
|
47390
47263
|
const fileSystem = yield* FileSystem.FileSystem;
|
|
47391
47264
|
const read = Effect.fn("TraceDiagnostics.read")(function* (options) {
|
|
47392
47265
|
const readAt = options.readAt ?? (yield* DateTime.now);
|
|
@@ -47430,7 +47303,7 @@ const make$11 = Effect.gen(function* () {
|
|
|
47430
47303
|
});
|
|
47431
47304
|
return TraceDiagnostics.of({ read });
|
|
47432
47305
|
});
|
|
47433
|
-
const layer$
|
|
47306
|
+
const layer$7 = Layer.effect(TraceDiagnostics, make$12);
|
|
47434
47307
|
function readTraceDiagnostics(options) {
|
|
47435
47308
|
return Effect.gen(function* () {
|
|
47436
47309
|
return yield* (yield* TraceDiagnostics).read(options);
|
|
@@ -47454,7 +47327,7 @@ const VCS_PROBES = [{
|
|
|
47454
47327
|
installHint: "Install Jujutsu with `brew install jj` or from https://github.com/jj-vcs/jj."
|
|
47455
47328
|
}];
|
|
47456
47329
|
var SourceControlDiscovery = class extends Context.Service()("@p4code/cli/sourceControl/SourceControlDiscovery") {};
|
|
47457
|
-
const make$
|
|
47330
|
+
const make$11 = Effect.gen(function* () {
|
|
47458
47331
|
const config = yield* ServerConfig$1;
|
|
47459
47332
|
const process = yield* VcsProcess;
|
|
47460
47333
|
const sourceControlProviders = yield* SourceControlProviderRegistry;
|
|
@@ -47503,7 +47376,7 @@ const make$10 = Effect.gen(function* () {
|
|
|
47503
47376
|
sourceControlProviders: sourceControlProviders.discover
|
|
47504
47377
|
}) });
|
|
47505
47378
|
});
|
|
47506
|
-
const layer$
|
|
47379
|
+
const layer$6 = Layer.effect(SourceControlDiscovery, make$11);
|
|
47507
47380
|
//#endregion
|
|
47508
47381
|
//#region src/sourceControl/SourceControlRepositoryService.ts
|
|
47509
47382
|
const isSourceControlRepositoryError = Schema$1.is(SourceControlRepositoryError);
|
|
@@ -47536,7 +47409,7 @@ function expandHomePath(input, path) {
|
|
|
47536
47409
|
if (input.startsWith("~/") || input.startsWith("~\\")) return path.join(NodeOS.homedir(), input.slice(2));
|
|
47537
47410
|
return input;
|
|
47538
47411
|
}
|
|
47539
|
-
const make$
|
|
47412
|
+
const make$10 = Effect.gen(function* () {
|
|
47540
47413
|
const config = yield* ServerConfig$1;
|
|
47541
47414
|
const fileSystem = yield* FileSystem.FileSystem;
|
|
47542
47415
|
const git = yield* GitVcsDriver;
|
|
@@ -47675,7 +47548,7 @@ const make$9 = Effect.gen(function* () {
|
|
|
47675
47548
|
publishRepository: (input) => publishRepository(input).pipe(mapRepositoryError("publishRepository", input.provider))
|
|
47676
47549
|
});
|
|
47677
47550
|
});
|
|
47678
|
-
const layer$
|
|
47551
|
+
const layer$5 = Layer.effect(SourceControlRepositoryService, make$10);
|
|
47679
47552
|
//#endregion
|
|
47680
47553
|
//#region src/ws.ts
|
|
47681
47554
|
/** Matches `p4c hub token add`, so a token minted here and one minted there are the same thing. */
|
|
@@ -47797,8 +47670,6 @@ const RPC_REQUIRED_SCOPE = /* @__PURE__ */ new Map([
|
|
|
47797
47670
|
[WS_METHODS.tasksUpdate, AuthOrchestrationOperateScope],
|
|
47798
47671
|
[WS_METHODS.tasksDelete, AuthOrchestrationOperateScope],
|
|
47799
47672
|
[WS_METHODS.tasksStartThread, AuthOrchestrationOperateScope],
|
|
47800
|
-
[WS_METHODS.tasksRefreshExternal, AuthOrchestrationOperateScope],
|
|
47801
|
-
[WS_METHODS.ticketsResolve, AuthOrchestrationReadScope],
|
|
47802
47673
|
[WS_METHODS.subscribeTasks, AuthOrchestrationReadScope],
|
|
47803
47674
|
[WS_METHODS.hubGetSyncStatus, AuthOrchestrationReadScope],
|
|
47804
47675
|
[WS_METHODS.hubConnect, AuthOrchestrationOperateScope],
|
|
@@ -47953,8 +47824,6 @@ const makeWsRpcLayer = (currentSession, previewAutomationBroker) => WsRpcGroup.t
|
|
|
47953
47824
|
const mcpOAuth = yield* McpOAuth;
|
|
47954
47825
|
const claudeMcpFiles = yield* ClaudeMcpFiles;
|
|
47955
47826
|
const skillRegistry = yield* SkillRegistry;
|
|
47956
|
-
const ticketResolver = yield* TicketResolver;
|
|
47957
|
-
const linearClient = yield* LinearMcpClient;
|
|
47958
47827
|
const listMcpServersEverywhere = Effect.gen(function* () {
|
|
47959
47828
|
const servers = [...yield* mcpRegistry.list];
|
|
47960
47829
|
const projectRows = yield* projectionProjects.listAll().pipe(Effect.map((rows) => rows.filter((row) => row.deletedAt === null)), Effect.orElseSucceed(() => []));
|
|
@@ -48510,48 +48379,6 @@ const makeWsRpcLayer = (currentSession, previewAutomationBroker) => WsRpcGroup.t
|
|
|
48510
48379
|
threadId
|
|
48511
48380
|
};
|
|
48512
48381
|
}), { "rpc.aggregate": "tasks" }),
|
|
48513
|
-
/**
|
|
48514
|
-
* Bring a mirror back in line with the tracker issue it mirrors.
|
|
48515
|
-
*
|
|
48516
|
-
* The local row is the cache. Everything Linear owns - title, body,
|
|
48517
|
-
* status, priority, assignee, labels - is overwritten from the issue,
|
|
48518
|
-
* and everything p4code owns - the thread, the project, the readable
|
|
48519
|
-
* id, the board position - is left exactly as it was. Nothing is
|
|
48520
|
-
* written back to Linear, so a refresh can never lose work there.
|
|
48521
|
-
*
|
|
48522
|
-
* Always against the board source, never `linear`: refreshing a row
|
|
48523
|
-
* that *is* the Linear issue would be copying it onto itself.
|
|
48524
|
-
*/
|
|
48525
|
-
[WS_METHODS.tasksRefreshExternal]: ({ taskId }) => observeRpcEffect$1(WS_METHODS.tasksRefreshExternal, Effect.gen(function* () {
|
|
48526
|
-
const tasks = taskRepositories.forSource(DEFAULT_TASK_SOURCE);
|
|
48527
|
-
const found = yield* tasks.getById({ taskId }).pipe(Effect.catch(toTaskStoreError("tasks.refreshExternal")));
|
|
48528
|
-
if (Option.isNone(found)) return yield* new TaskNotFoundError({ taskId });
|
|
48529
|
-
const task = found.value;
|
|
48530
|
-
if (task.externalRef === null) return { task };
|
|
48531
|
-
const payload = yield* linearClient.call(LINEAR_GET_ISSUE_TOOL$1, { id: task.externalRef.identifier }).pipe(Effect.mapError((cause) => new TicketResolveError({
|
|
48532
|
-
reason: cause.reason === "failed" ? "unavailable" : cause.reason,
|
|
48533
|
-
detail: cause.detail
|
|
48534
|
-
})));
|
|
48535
|
-
const issue = readOne(payload);
|
|
48536
|
-
const fields = issue === void 0 ? void 0 : linearMirrorFields(issue);
|
|
48537
|
-
if (fields === void 0) return yield* new TicketResolveError({
|
|
48538
|
-
reason: "not_found",
|
|
48539
|
-
detail: `Linear returned nothing usable for ${task.externalRef.identifier}.`
|
|
48540
|
-
});
|
|
48541
|
-
const patched = yield* tasks.patch({
|
|
48542
|
-
taskId,
|
|
48543
|
-
...fields
|
|
48544
|
-
}, yield* nowIso$5).pipe(Effect.catch(toTaskStoreError("tasks.refreshExternal.patch")));
|
|
48545
|
-
if (Option.isNone(patched)) return yield* new TaskNotFoundError({ taskId });
|
|
48546
|
-
return { task: patched.value };
|
|
48547
|
-
}), { "rpc.aggregate": "tasks" }),
|
|
48548
|
-
/**
|
|
48549
|
-
* What a pasted reference is, straight from the tracker.
|
|
48550
|
-
*
|
|
48551
|
-
* Nothing is written here: the client decides whether the answer
|
|
48552
|
-
* becomes a task, so an accidental paste costs one request and no row.
|
|
48553
|
-
*/
|
|
48554
|
-
[WS_METHODS.ticketsResolve]: ({ reference }) => observeRpcEffect$1(WS_METHODS.ticketsResolve, ticketResolver.resolve(reference), { "rpc.aggregate": "tickets" }),
|
|
48555
48382
|
[WS_METHODS.subscribeTasks]: ({ source }) => observeRpcStreamEffect$1(WS_METHODS.subscribeTasks, Effect.succeed(taskRepositories.forSource(source).streamWithSnapshot.pipe(Stream.catch((cause) => Stream.fromEffect(toTaskStoreError("tasks.subscribe")(cause))))), { "rpc.aggregate": "tasks" }),
|
|
48556
48383
|
[WS_METHODS.hubGetSyncStatus]: (_input) => observeRpcEffect$1(WS_METHODS.hubGetSyncStatus, assetSync.status, { "rpc.aggregate": "hub" }),
|
|
48557
48384
|
[WS_METHODS.hubConnect]: (input) => observeRpcEffect$1(WS_METHODS.hubConnect, hubLink.connect(input).pipe(Effect.mapError((cause) => new HubLinkError({ detail: cause.message })), Effect.andThen(assetSync.status)), { "rpc.aggregate": "hub" }),
|
|
@@ -48819,7 +48646,7 @@ const websocketRpcRouteLayer = Layer.unwrap(Effect.gen(function* () {
|
|
|
48819
48646
|
const serverAuth = yield* EnvironmentAuth;
|
|
48820
48647
|
const sessions = yield* SessionStore;
|
|
48821
48648
|
const session = yield* serverAuth.authenticateWebSocketUpgrade(request).pipe(Effect.catchIf(isServerAuthCredentialError, (error) => failEnvironmentAuthInvalid(serverAuthCredentialReason(error))), Effect.catchIf(isServerAuthInternalError, (error) => failEnvironmentInternal("internal_error", error)));
|
|
48822
|
-
const rpcWebSocketHttpEffect = yield* RpcServer.toHttpEffectWebsocket(WsRpcGroup, { disableTracing: true }).pipe(Effect.provide(makeWsRpcLayer(session, previewAutomationBroker).pipe(Layer.provideMerge(RpcSerialization.layerJson), Layer.provide(layer$34), Layer.provide(Layer.succeed(ServerSelfUpdate, serverSelfUpdate)), Layer.provide(Layer.succeed(TaskRepositoryRegistry, taskRepositories)), Layer.provide(Layer.succeed(ProjectionProjectRepository, projectionProjects)), Layer.provide(Layer.succeed(P4ProjectFileLoader, p4ProjectFileLoader)), Layer.provide(layer$
|
|
48649
|
+
const rpcWebSocketHttpEffect = yield* RpcServer.toHttpEffectWebsocket(WsRpcGroup, { disableTracing: true }).pipe(Effect.provide(makeWsRpcLayer(session, previewAutomationBroker).pipe(Layer.provideMerge(RpcSerialization.layerJson), Layer.provide(layer$34), Layer.provide(Layer.succeed(ServerSelfUpdate, serverSelfUpdate)), Layer.provide(Layer.succeed(TaskRepositoryRegistry, taskRepositories)), Layer.provide(Layer.succeed(ProjectionProjectRepository, projectionProjects)), Layer.provide(Layer.succeed(P4ProjectFileLoader, p4ProjectFileLoader)), Layer.provide(layer$6.pipe(Layer.provide(layer$15.pipe(Layer.provide(Layer.mergeAll(layer$23, layer$21, layer$19, layer$17)), Layer.provideMerge(layer$39), Layer.provide(layer$37.pipe(Layer.provide(layer$38))))), Layer.provide(layer$40))))));
|
|
48823
48650
|
return yield* Effect.acquireUseRelease(sessions.markConnected(session.sessionId), () => rpcWebSocketHttpEffect, () => sessions.markDisconnected(session.sessionId));
|
|
48824
48651
|
}).pipe(Effect.catchTags({
|
|
48825
48652
|
EnvironmentAuthInvalidError: HttpServerRespondable.toResponse,
|
|
@@ -48884,7 +48711,7 @@ function toPersistenceSqlOrDecodeError(sqlOperation, decodeOperation, correlatio
|
|
|
48884
48711
|
cause
|
|
48885
48712
|
});
|
|
48886
48713
|
}
|
|
48887
|
-
const make$
|
|
48714
|
+
const make$9 = Effect.gen(function* () {
|
|
48888
48715
|
const sql = yield* SqlClient.SqlClient;
|
|
48889
48716
|
const upsertRuntimeRow = SqlSchema.void({
|
|
48890
48717
|
Request: ProviderSessionRuntimeDbRowSchema,
|
|
@@ -48987,7 +48814,7 @@ const make$8 = Effect.gen(function* () {
|
|
|
48987
48814
|
deleteByThreadId
|
|
48988
48815
|
};
|
|
48989
48816
|
});
|
|
48990
|
-
const layer$
|
|
48817
|
+
const layer$4 = Layer.effect(ProviderSessionRuntimeRepository, make$9);
|
|
48991
48818
|
//#endregion
|
|
48992
48819
|
//#region src/provider/Errors.ts
|
|
48993
48820
|
/**
|
|
@@ -49682,12 +49509,12 @@ const makeWithOptions = Effect.fn("McpSessionRegistry.make")(function* (options
|
|
|
49682
49509
|
});
|
|
49683
49510
|
});
|
|
49684
49511
|
let activeMcpSessionRegistry;
|
|
49685
|
-
const make$
|
|
49512
|
+
const make$8 = Effect.acquireRelease(makeWithOptions().pipe(Effect.tap((registry) => Effect.sync(() => {
|
|
49686
49513
|
activeMcpSessionRegistry = registry;
|
|
49687
49514
|
}))), (registry) => Effect.sync(() => {
|
|
49688
49515
|
if (activeMcpSessionRegistry === registry) activeMcpSessionRegistry = void 0;
|
|
49689
49516
|
}));
|
|
49690
|
-
const layer$
|
|
49517
|
+
const layer$3 = Layer.effect(McpSessionRegistry, make$8);
|
|
49691
49518
|
const issueActiveMcpCredential = (request) => activeMcpSessionRegistry ? activeMcpSessionRegistry.revokeThread(request.threadId).pipe(Effect.andThen(activeMcpSessionRegistry.issue(request))) : Effect.sync(() => void 0);
|
|
49692
49519
|
/**
|
|
49693
49520
|
* Refreshes the liveness of a thread's MCP credential. Called on every provider
|
|
@@ -73655,7 +73482,7 @@ const makeTerminationError$1 = (handle) => Effect.match(handle.exitCode, {
|
|
|
73655
73482
|
//#endregion
|
|
73656
73483
|
//#region ../../packages/effect-codex-app-server/src/client.ts
|
|
73657
73484
|
var CodexAppServerClient = class extends Context.Service()("effect-codex-app-server/client/CodexAppServerClient") {};
|
|
73658
|
-
const make$
|
|
73485
|
+
const make$7 = Effect.fn("effect-codex-app-server/CodexAppServerClient.make")(function* (stdio, options = {}, terminationError) {
|
|
73659
73486
|
const requestHandlers = /* @__PURE__ */ new Map();
|
|
73660
73487
|
const notificationHandlers = /* @__PURE__ */ new Map();
|
|
73661
73488
|
let unknownRequestHandler;
|
|
@@ -73722,7 +73549,7 @@ const make$6 = Effect.fn("effect-codex-app-server/CodexAppServerClient.make")(fu
|
|
|
73722
73549
|
const layerChildProcess$1 = (handle, options = {}) => Layer.effect(CodexAppServerClient, makeChildProcessClient(handle, options));
|
|
73723
73550
|
const makeChildProcessClient = Effect.fn("effect-codex-app-server/CodexAppServerClient.makeChildProcessClient")(function* (handle, options) {
|
|
73724
73551
|
yield* Stream.runDrain(handle.stderr).pipe(Effect.ignore, Effect.forkScoped);
|
|
73725
|
-
return yield* make$
|
|
73552
|
+
return yield* make$7(makeChildStdio$1(handle), options, makeTerminationError$1(handle));
|
|
73726
73553
|
});
|
|
73727
73554
|
//#endregion
|
|
73728
73555
|
//#region src/provider/Layers/CodexProvider.ts
|
|
@@ -80024,7 +79851,7 @@ const makeTerminationError = (handle) => Effect.match(handle.exitCode, {
|
|
|
80024
79851
|
//#endregion
|
|
80025
79852
|
//#region ../../packages/effect-acp/src/client.ts
|
|
80026
79853
|
var AcpClient = class extends Context.Service()("effect-acp/client/AcpClient") {};
|
|
80027
|
-
const make$
|
|
79854
|
+
const make$6 = Effect.fn("effect-acp/AcpClient.make")(function* (stdio, options = {}, terminationError) {
|
|
80028
79855
|
const coreHandlers = {};
|
|
80029
79856
|
const notificationHandlers = {
|
|
80030
79857
|
sessionUpdate: {
|
|
@@ -80182,11 +80009,11 @@ const make$5 = Effect.fn("effect-acp/AcpClient.make")(function* (stdio, options
|
|
|
80182
80009
|
const layerChildProcess = (handle, options = {}) => {
|
|
80183
80010
|
const stdio = makeChildStdio(handle);
|
|
80184
80011
|
const terminationError = makeTerminationError(handle);
|
|
80185
|
-
return Layer.effect(AcpClient, make$
|
|
80012
|
+
return Layer.effect(AcpClient, make$6(stdio, options, terminationError));
|
|
80186
80013
|
};
|
|
80187
80014
|
//#endregion
|
|
80188
80015
|
//#region ../../packages/shared/src/toolActivity.ts
|
|
80189
|
-
function asRecord(value) {
|
|
80016
|
+
function asRecord$1(value) {
|
|
80190
80017
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
80191
80018
|
}
|
|
80192
80019
|
function asTrimmedString(value) {
|
|
@@ -80216,10 +80043,10 @@ function extractCommandFromTitle$1(title) {
|
|
|
80216
80043
|
return /`([^`]+)`/u.exec(title)?.[1]?.trim() || void 0;
|
|
80217
80044
|
}
|
|
80218
80045
|
function extractToolCommand(data, title) {
|
|
80219
|
-
const item = asRecord(data?.item);
|
|
80220
|
-
const itemInput = asRecord(item?.input);
|
|
80221
|
-
const itemResult = asRecord(item?.result);
|
|
80222
|
-
const rawInput = asRecord(data?.rawInput);
|
|
80046
|
+
const item = asRecord$1(data?.item);
|
|
80047
|
+
const itemInput = asRecord$1(item?.input);
|
|
80048
|
+
const itemResult = asRecord$1(item?.result);
|
|
80049
|
+
const rawInput = asRecord$1(data?.rawInput);
|
|
80223
80050
|
const direct = [
|
|
80224
80051
|
normalizeCommandValue$1(item?.command),
|
|
80225
80052
|
normalizeCommandValue$1(itemInput?.command),
|
|
@@ -80247,7 +80074,7 @@ function collectPaths(value, paths, seen, depth) {
|
|
|
80247
80074
|
}
|
|
80248
80075
|
return;
|
|
80249
80076
|
}
|
|
80250
|
-
const record = asRecord(value);
|
|
80077
|
+
const record = asRecord$1(value);
|
|
80251
80078
|
if (!record) return;
|
|
80252
80079
|
for (const key of [
|
|
80253
80080
|
"path",
|
|
@@ -80306,7 +80133,7 @@ function deriveToolActivityPresentation(input) {
|
|
|
80306
80133
|
const title = asTrimmedString(input.title);
|
|
80307
80134
|
const detail = stripTrailingExitCode(asTrimmedString(input.detail));
|
|
80308
80135
|
const fallbackSummary = asTrimmedString(input.fallbackSummary) ?? "Tool";
|
|
80309
|
-
const data = asRecord(input.data);
|
|
80136
|
+
const data = asRecord$1(input.data);
|
|
80310
80137
|
const command = extractToolCommand(data, title);
|
|
80311
80138
|
const primaryPath = extractPrimaryPath(data);
|
|
80312
80139
|
const action = classifyToolAction({
|
|
@@ -80330,7 +80157,7 @@ function deriveToolActivityPresentation(input) {
|
|
|
80330
80157
|
...primaryPath ? { detail: primaryPath } : {}
|
|
80331
80158
|
};
|
|
80332
80159
|
if (action === "search") {
|
|
80333
|
-
const query = asTrimmedString(asRecord(data?.rawInput)?.query) ?? asTrimmedString(asRecord(data?.rawInput)?.pattern) ?? asTrimmedString(asRecord(data?.rawInput)?.searchTerm);
|
|
80160
|
+
const query = asTrimmedString(asRecord$1(data?.rawInput)?.query) ?? asTrimmedString(asRecord$1(data?.rawInput)?.pattern) ?? asTrimmedString(asRecord$1(data?.rawInput)?.searchTerm);
|
|
80334
80161
|
return {
|
|
80335
80162
|
summary: "Searched files",
|
|
80336
80163
|
...query ? { detail: query } : {}
|
|
@@ -80642,7 +80469,7 @@ function formatConfigOptionValue(value) {
|
|
|
80642
80469
|
const defaultSessionLoadTimeout = Duration.seconds(90);
|
|
80643
80470
|
const defaultSessionLoadReplayIdleGap = Duration.seconds(2);
|
|
80644
80471
|
var AcpSessionRuntime = class extends Context.Service()("@p4code/cli/provider/acp/AcpSessionRuntime") {};
|
|
80645
|
-
const make$
|
|
80472
|
+
const make$5 = (options) => Effect.gen(function* () {
|
|
80646
80473
|
const crypto = yield* Crypto.Crypto;
|
|
80647
80474
|
const spawner = yield* ChildProcessSpawner$1.ChildProcessSpawner;
|
|
80648
80475
|
const runtimeScope = yield* Scope.Scope;
|
|
@@ -80951,7 +80778,7 @@ const make$4 = (options) => Effect.gen(function* () {
|
|
|
80951
80778
|
notify: acp.raw.notify
|
|
80952
80779
|
};
|
|
80953
80780
|
});
|
|
80954
|
-
const layer$
|
|
80781
|
+
const layer$2 = (options) => Layer.effect(AcpSessionRuntime, make$5(options));
|
|
80955
80782
|
function sessionConfigOptionsFromSetup(response) {
|
|
80956
80783
|
return response?.configOptions ?? [];
|
|
80957
80784
|
}
|
|
@@ -81318,7 +81145,7 @@ function buildCursorDiscoveredModelsFromAvailableModelsResponse(response) {
|
|
|
81318
81145
|
}
|
|
81319
81146
|
const makeCursorAcpProbeRuntime = (cursorSettings, environment) => Effect.gen(function* () {
|
|
81320
81147
|
const spawner = yield* ChildProcessSpawner$1.ChildProcessSpawner;
|
|
81321
|
-
const acpContext = yield* Layer.build(layer$
|
|
81148
|
+
const acpContext = yield* Layer.build(layer$2({
|
|
81322
81149
|
spawn: {
|
|
81323
81150
|
command: cursorSettings.binaryPath,
|
|
81324
81151
|
args: [...cursorSettings.apiEndpoint ? ["-e", cursorSettings.apiEndpoint] : [], "acp"],
|
|
@@ -81768,7 +81595,7 @@ function buildCursorAcpSpawnInput(cursorSettings, cwd, environment) {
|
|
|
81768
81595
|
};
|
|
81769
81596
|
}
|
|
81770
81597
|
const makeCursorAcpRuntime = (input) => Effect.gen(function* () {
|
|
81771
|
-
const acpContext = yield* Layer.build(layer$
|
|
81598
|
+
const acpContext = yield* Layer.build(layer$2({
|
|
81772
81599
|
...input,
|
|
81773
81600
|
spawn: buildCursorAcpSpawnInput(input.cursorSettings, input.cwd, input.environment),
|
|
81774
81601
|
authMethodId: "cursor_login",
|
|
@@ -83222,7 +83049,7 @@ function resolveGrokAuthMethodId(environment) {
|
|
|
83222
83049
|
return environment?.[GROK_API_KEY_ENV]?.trim() ? GROK_AUTH_METHOD_API_KEY : GROK_AUTH_METHOD_CACHED_TOKEN;
|
|
83223
83050
|
}
|
|
83224
83051
|
const makeGrokAcpRuntime = (input) => Effect.gen(function* () {
|
|
83225
|
-
const acpContext = yield* Layer.build(layer$
|
|
83052
|
+
const acpContext = yield* Layer.build(layer$2({
|
|
83226
83053
|
...input,
|
|
83227
83054
|
spawn: buildGrokAcpSpawnInput(input.grokSettings, input.cwd, input.environment),
|
|
83228
83055
|
authMethodId: resolveGrokAuthMethodId(input.environment)
|
|
@@ -84667,7 +84494,7 @@ function mapMuseExecRecord(input) {
|
|
|
84667
84494
|
const payload = record.payload;
|
|
84668
84495
|
switch (record.payloadType) {
|
|
84669
84496
|
case "run.model.configured": {
|
|
84670
|
-
const modelId = stringField(payload, "model_id");
|
|
84497
|
+
const modelId = stringField$1(payload, "model_id");
|
|
84671
84498
|
if (modelId) state.modelId = modelId;
|
|
84672
84499
|
return [(stamp) => ({
|
|
84673
84500
|
type: "session.configured",
|
|
@@ -84685,7 +84512,7 @@ function mapMuseExecRecord(input) {
|
|
|
84685
84512
|
raw: rawFrom(record)
|
|
84686
84513
|
})];
|
|
84687
84514
|
case "run.output.delta": {
|
|
84688
|
-
const text = stringField(payload, "text");
|
|
84515
|
+
const text = stringField$1(payload, "text");
|
|
84689
84516
|
if (text === void 0 || text.length === 0) return [];
|
|
84690
84517
|
return appendAssistantText({
|
|
84691
84518
|
text,
|
|
@@ -84696,8 +84523,8 @@ function mapMuseExecRecord(input) {
|
|
|
84696
84523
|
}
|
|
84697
84524
|
case "task.lifecycle.proposed": {
|
|
84698
84525
|
const event = eventField(payload);
|
|
84699
|
-
const taskId = stringField(event, "task_id");
|
|
84700
|
-
const toolName = toolNameFromTaskKind(stringField(event, "task_kind"));
|
|
84526
|
+
const taskId = stringField$1(event, "task_id");
|
|
84527
|
+
const toolName = toolNameFromTaskKind(stringField$1(event, "task_kind"));
|
|
84701
84528
|
if (!taskId || !toolName) return [];
|
|
84702
84529
|
state.toolNameByTaskId.set(taskId, toolName);
|
|
84703
84530
|
return [(stamp) => ({
|
|
@@ -84715,15 +84542,15 @@ function mapMuseExecRecord(input) {
|
|
|
84715
84542
|
}
|
|
84716
84543
|
case "task.lifecycle.side_effect_intent": {
|
|
84717
84544
|
const event = eventField(payload);
|
|
84718
|
-
const taskId = stringField(event, "task_id");
|
|
84719
|
-
const callId = toolCallIdFromIdempotencyKey(stringField(event, "idempotency_key"));
|
|
84545
|
+
const taskId = stringField$1(event, "task_id");
|
|
84546
|
+
const callId = toolCallIdFromIdempotencyKey(stringField$1(event, "idempotency_key"));
|
|
84720
84547
|
if (taskId && callId) state.taskIdByCallId.set(callId, taskId);
|
|
84721
84548
|
return [];
|
|
84722
84549
|
}
|
|
84723
84550
|
case "task.lifecycle.output": {
|
|
84724
84551
|
const event = eventField(payload);
|
|
84725
|
-
const taskId = stringField(event, "task_id");
|
|
84726
|
-
const chunk = stringField(event, "chunk");
|
|
84552
|
+
const taskId = stringField$1(event, "task_id");
|
|
84553
|
+
const chunk = stringField$1(event, "chunk");
|
|
84727
84554
|
if (!taskId || !chunk) return [];
|
|
84728
84555
|
const toolName = state.toolNameByTaskId.get(taskId);
|
|
84729
84556
|
if (!toolName) return [];
|
|
@@ -84741,13 +84568,13 @@ function mapMuseExecRecord(input) {
|
|
|
84741
84568
|
})];
|
|
84742
84569
|
}
|
|
84743
84570
|
case "tool.result": {
|
|
84744
|
-
const callId = stringField(payload, "call_id");
|
|
84571
|
+
const callId = stringField$1(payload, "call_id");
|
|
84745
84572
|
const taskId = callId ? state.taskIdByCallId.get(callId) : void 0;
|
|
84746
84573
|
if (!taskId) return [];
|
|
84747
84574
|
const toolName = state.toolNameByTaskId.get(taskId);
|
|
84748
84575
|
state.settledToolTaskIds.add(taskId);
|
|
84749
|
-
const failed = stringField(recordField(payload, "correlation_facts"), "outcome") === "error";
|
|
84750
|
-
const detail = truncate(stringField(payload, "text"), MAX_TOOL_DETAIL_CHARS);
|
|
84576
|
+
const failed = stringField$1(recordField(payload, "correlation_facts"), "outcome") === "error";
|
|
84577
|
+
const detail = truncate(stringField$1(payload, "text"), MAX_TOOL_DETAIL_CHARS);
|
|
84751
84578
|
const editFacts = recordField(payload, "edit_facts");
|
|
84752
84579
|
return [(stamp) => ({
|
|
84753
84580
|
type: "item.completed",
|
|
@@ -84766,12 +84593,12 @@ function mapMuseExecRecord(input) {
|
|
|
84766
84593
|
}
|
|
84767
84594
|
case "task.lifecycle.failed": {
|
|
84768
84595
|
const event = eventField(payload);
|
|
84769
|
-
const taskId = stringField(event, "task_id");
|
|
84596
|
+
const taskId = stringField$1(event, "task_id");
|
|
84770
84597
|
if (!taskId) return [];
|
|
84771
84598
|
const toolName = state.toolNameByTaskId.get(taskId);
|
|
84772
84599
|
if (!toolName || state.settledToolTaskIds.has(taskId)) return [];
|
|
84773
84600
|
state.settledToolTaskIds.add(taskId);
|
|
84774
|
-
const detail = truncate(stringField(event, "reason"), MAX_TOOL_DETAIL_CHARS);
|
|
84601
|
+
const detail = truncate(stringField$1(event, "reason"), MAX_TOOL_DETAIL_CHARS);
|
|
84775
84602
|
return [(stamp) => ({
|
|
84776
84603
|
type: "item.completed",
|
|
84777
84604
|
...stamp,
|
|
@@ -84803,10 +84630,10 @@ function mapMuseExecRecord(input) {
|
|
|
84803
84630
|
*/
|
|
84804
84631
|
function mapTerminalRecord(input) {
|
|
84805
84632
|
const { record, state, context } = input;
|
|
84806
|
-
const terminalState = turnStateFromTerminal(stringField(record.payload, "terminal") ?? record.payloadType.slice(13));
|
|
84633
|
+
const terminalState = turnStateFromTerminal(stringField$1(record.payload, "terminal") ?? record.payloadType.slice(13));
|
|
84807
84634
|
state.terminal = terminalState;
|
|
84808
84635
|
const drafts = [];
|
|
84809
|
-
const remainder = assistantTextRemainder(state.assistantText, stringField(record.payload, "text"));
|
|
84636
|
+
const remainder = assistantTextRemainder(state.assistantText, stringField$1(record.payload, "text"));
|
|
84810
84637
|
if (remainder) drafts.push(...appendAssistantText({
|
|
84811
84638
|
text: remainder,
|
|
84812
84639
|
state,
|
|
@@ -84823,7 +84650,7 @@ function mapTerminalRecord(input) {
|
|
|
84823
84650
|
status: "completed"
|
|
84824
84651
|
}
|
|
84825
84652
|
}));
|
|
84826
|
-
const reason = stringField(record.payload, "reason");
|
|
84653
|
+
const reason = stringField$1(record.payload, "reason");
|
|
84827
84654
|
drafts.push((stamp) => ({
|
|
84828
84655
|
type: "turn.completed",
|
|
84829
84656
|
...stamp,
|
|
@@ -84939,7 +84766,7 @@ function rawFrom(record) {
|
|
|
84939
84766
|
function isRecord$1(value) {
|
|
84940
84767
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
84941
84768
|
}
|
|
84942
|
-
function stringField(source, key) {
|
|
84769
|
+
function stringField$1(source, key) {
|
|
84943
84770
|
const value = source?.[key];
|
|
84944
84771
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
84945
84772
|
}
|
|
@@ -88332,6 +88159,106 @@ const PreviewStandardToolkitHandlersLive = PreviewStandardToolkit.toLayer(standa
|
|
|
88332
88159
|
const PreviewSnapshotToolkitHandlersLive = PreviewSnapshotToolkit.toLayer({ preview_snapshot });
|
|
88333
88160
|
PreviewToolkit.toLayer(handlers$3);
|
|
88334
88161
|
//#endregion
|
|
88162
|
+
//#region src/mcp/TicketResolver.ts
|
|
88163
|
+
/**
|
|
88164
|
+
* The registered server name a Linear ticket is resolved through.
|
|
88165
|
+
*
|
|
88166
|
+
* Matched by name rather than by URL: the name is what the user typed in
|
|
88167
|
+
* Settings and what every other surface calls it, and a workspace may reach
|
|
88168
|
+
* Linear through a proxy URL that no pattern here would recognize.
|
|
88169
|
+
*/
|
|
88170
|
+
const LINEAR_SERVER_NAME = "linear";
|
|
88171
|
+
/** Linear's own tool for reading one issue. */
|
|
88172
|
+
const LINEAR_GET_ISSUE_TOOL = "get_issue";
|
|
88173
|
+
var TicketResolver = class extends Context.Service()("@p4code/cli/mcp/TicketResolver") {};
|
|
88174
|
+
const stringField = (record, key) => {
|
|
88175
|
+
const value = record[key];
|
|
88176
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
88177
|
+
};
|
|
88178
|
+
const asRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
88179
|
+
/**
|
|
88180
|
+
* Find the issue inside whatever the tool returned.
|
|
88181
|
+
*
|
|
88182
|
+
* MCP leaves the shape of a tool result to the tool, so this accepts the three
|
|
88183
|
+
* arrangements in the wild - the structured payload itself, that payload with
|
|
88184
|
+
* the issue nested one level down, or a text block that happens to be JSON -
|
|
88185
|
+
* rather than assuming the one Linear happens to send today.
|
|
88186
|
+
*/
|
|
88187
|
+
const readIssue = (result) => {
|
|
88188
|
+
const structured = asRecord(result.structuredContent);
|
|
88189
|
+
if (structured !== void 0) {
|
|
88190
|
+
const nested = asRecord(structured["issue"]);
|
|
88191
|
+
if (nested !== void 0) return nested;
|
|
88192
|
+
if (stringField(structured, "url") !== void 0) return structured;
|
|
88193
|
+
}
|
|
88194
|
+
try {
|
|
88195
|
+
const parsed = JSON.parse(result.text);
|
|
88196
|
+
const record = asRecord(parsed);
|
|
88197
|
+
if (record === void 0) return structured;
|
|
88198
|
+
return asRecord(record["issue"]) ?? record;
|
|
88199
|
+
} catch {
|
|
88200
|
+
return structured;
|
|
88201
|
+
}
|
|
88202
|
+
};
|
|
88203
|
+
const make$4 = Effect.gen(function* () {
|
|
88204
|
+
const registry = yield* McpRegistry;
|
|
88205
|
+
const oauth = yield* McpOAuth;
|
|
88206
|
+
const http = yield* HttpClient$1.HttpClient;
|
|
88207
|
+
return { resolve: Effect.fn("TicketResolver.resolve")(function* (reference) {
|
|
88208
|
+
const identifier = parseTicketReference(reference);
|
|
88209
|
+
if (identifier === null) return yield* new TicketResolveError({
|
|
88210
|
+
reason: "not_found",
|
|
88211
|
+
detail: `"${reference}" does not look like a ticket reference.`
|
|
88212
|
+
});
|
|
88213
|
+
const server = (yield* registry.list).find((candidate) => candidate.registration.name.toLowerCase() === LINEAR_SERVER_NAME && candidate.registration.enabled);
|
|
88214
|
+
if (server === void 0 || server.registration.transport === "stdio") return yield* new TicketResolveError({
|
|
88215
|
+
reason: "not_configured",
|
|
88216
|
+
detail: "No Linear MCP server is registered on this machine. Add it in Settings to link tickets."
|
|
88217
|
+
});
|
|
88218
|
+
const registration = server.registration;
|
|
88219
|
+
const token = yield* oauth.accessTokenFor(registration);
|
|
88220
|
+
const headers = {
|
|
88221
|
+
...registration.headers,
|
|
88222
|
+
...Option.isSome(token) ? { authorization: `Bearer ${token.value}` } : {}
|
|
88223
|
+
};
|
|
88224
|
+
if (Option.isNone(token) && Object.keys(registration.headers ?? {}).length === 0) return yield* new TicketResolveError({
|
|
88225
|
+
reason: "not_authorized",
|
|
88226
|
+
detail: "Linear is registered but not signed in on this machine. Sign in from Settings."
|
|
88227
|
+
});
|
|
88228
|
+
const result = yield* callMcpTool({
|
|
88229
|
+
url: registration.url,
|
|
88230
|
+
headers,
|
|
88231
|
+
toolName: LINEAR_GET_ISSUE_TOOL,
|
|
88232
|
+
arguments: { id: identifier }
|
|
88233
|
+
}).pipe(Effect.provideService(HttpClient$1.HttpClient, http), Effect.mapError((error) => error.status === 401 || error.status === 403 ? new TicketResolveError({
|
|
88234
|
+
reason: "not_authorized",
|
|
88235
|
+
detail: "Linear rejected p4code's sign-in. Sign in again from Settings."
|
|
88236
|
+
}) : new TicketResolveError({
|
|
88237
|
+
reason: "unavailable",
|
|
88238
|
+
detail: error.detail
|
|
88239
|
+
})));
|
|
88240
|
+
const issue = readIssue(result);
|
|
88241
|
+
const url = issue === void 0 ? void 0 : stringField(issue, "url");
|
|
88242
|
+
const title = issue === void 0 ? void 0 : stringField(issue, "title");
|
|
88243
|
+
if (issue === void 0 || url === void 0 || title === void 0) return yield* new TicketResolveError({
|
|
88244
|
+
reason: "not_found",
|
|
88245
|
+
detail: `Linear returned nothing usable for ${identifier}.`
|
|
88246
|
+
});
|
|
88247
|
+
const externalRef = {
|
|
88248
|
+
source: "linear",
|
|
88249
|
+
identifier: stringField(issue, "identifier") ?? identifier,
|
|
88250
|
+
url
|
|
88251
|
+
};
|
|
88252
|
+
const description = stringField(issue, "description");
|
|
88253
|
+
return {
|
|
88254
|
+
externalRef,
|
|
88255
|
+
title,
|
|
88256
|
+
...description === void 0 ? {} : { description }
|
|
88257
|
+
};
|
|
88258
|
+
}) };
|
|
88259
|
+
});
|
|
88260
|
+
const layer$1 = Layer.effect(TicketResolver, make$4);
|
|
88261
|
+
//#endregion
|
|
88335
88262
|
//#region src/mcp/toolkits/tasks/tools.ts
|
|
88336
88263
|
const dependencies = [McpInvocationContext, TaskRepository];
|
|
88337
88264
|
/**
|
|
@@ -88420,12 +88347,13 @@ const TaskProposeTool = Tool.make("task_propose", {
|
|
|
88420
88347
|
* to paste the description back in - which is the question they already
|
|
88421
88348
|
* answered by quoting the id.
|
|
88422
88349
|
*
|
|
88423
|
-
* On the task toolkit rather than a toolkit of its own because it is
|
|
88424
|
-
*
|
|
88425
|
-
*
|
|
88350
|
+
* On the task toolkit rather than a toolkit of its own because it is the same
|
|
88351
|
+
* question a board answers - what is this work - and the two share the one
|
|
88352
|
+
* capability a session is granted. It reads and writes nothing: a ticket stays
|
|
88353
|
+
* in its tracker, and p4code files no copy of it.
|
|
88426
88354
|
*/
|
|
88427
88355
|
const TicketResolveTool = Tool.make("ticket_resolve", {
|
|
88428
|
-
description: "Read a tracker ticket by id or URL (e.g. MOBILE-12241, or a linear.app link), returning its identifier, canonical URL, title and description. Use this whenever the user names a ticket rather than asking them to paste it.
|
|
88356
|
+
description: "Read a tracker ticket by id or URL (e.g. MOBILE-12241, or a linear.app link), returning its identifier, canonical URL, title and description. Use this whenever the user names a ticket rather than asking them to paste it. Reading is all it does - the ticket stays in its tracker and no task is filed for it. Fails when no tracker is registered on this machine, which is a thing only the user can fix.",
|
|
88429
88357
|
parameters: TicketResolveInput,
|
|
88430
88358
|
success: TicketResolveResult,
|
|
88431
88359
|
failure: Schema$1.Union([TaskToolUnavailableError, TicketResolveError]),
|
|
@@ -92625,28 +92553,28 @@ const PlatformServicesLive = Layer.unwrap(Effect.gen(function* () {
|
|
|
92625
92553
|
}
|
|
92626
92554
|
}));
|
|
92627
92555
|
const ReactorLayerLive = Layer.empty.pipe(Layer.provideMerge(OrchestrationReactorLive), Layer.provideMerge(ProviderRuntimeIngestionLive), Layer.provideMerge(ProviderCommandReactorLive), Layer.provideMerge(CheckpointReactorLive), Layer.provideMerge(ThreadDeletionReactorLive), Layer.provideMerge(RuntimeReceiptBusLive));
|
|
92628
|
-
const ProviderSessionDirectoryLayerLive = ProviderSessionDirectoryLive.pipe(Layer.provide(layer$
|
|
92556
|
+
const ProviderSessionDirectoryLayerLive = ProviderSessionDirectoryLive.pipe(Layer.provide(layer$4));
|
|
92629
92557
|
const ProviderLayerLive = ProviderServiceLive.pipe(Layer.provide(ProviderAdapterRegistryLive), Layer.provideMerge(ProviderSessionDirectoryLayerLive));
|
|
92630
92558
|
const PersistenceLayerLive = Layer.empty.pipe(Layer.provideMerge(layerConfig));
|
|
92631
92559
|
const VcsDriverRegistryLayerLive = layer$37.pipe(Layer.provide(layer$38));
|
|
92632
|
-
const SourceControlProviderRegistryLayerLive = layer$
|
|
92633
|
-
const GitManagerLayerLive = layer$
|
|
92560
|
+
const SourceControlProviderRegistryLayerLive = layer$15.pipe(Layer.provide(Layer.mergeAll(layer$23, layer$21, layer$19, layer$17)), Layer.provideMerge(layer$39), Layer.provideMerge(VcsDriverRegistryLayerLive));
|
|
92561
|
+
const GitManagerLayerLive = layer$14.pipe(Layer.provideMerge(layer$24), Layer.provideMerge(layer$39), Layer.provideMerge(SourceControlProviderRegistryLayerLive), Layer.provideMerge(layer$33));
|
|
92634
92562
|
const GitLayerLive = Layer.empty.pipe(Layer.provideMerge(GitManagerLayerLive), Layer.provideMerge(layer$39));
|
|
92635
|
-
const GitWorkflowLayerLive = layer$
|
|
92636
|
-
const SourceControlRepositoryServiceLayerLive = layer$
|
|
92637
|
-
const ReviewLayerLive = layer$
|
|
92638
|
-
const VcsLayerLive = Layer.empty.pipe(Layer.provideMerge(layer$38), Layer.provideMerge(VcsDriverRegistryLayerLive), Layer.provideMerge(layer$
|
|
92563
|
+
const GitWorkflowLayerLive = layer$13.pipe(Layer.provideMerge(VcsDriverRegistryLayerLive), Layer.provideMerge(GitLayerLive));
|
|
92564
|
+
const SourceControlRepositoryServiceLayerLive = layer$5.pipe(Layer.provideMerge(layer$39), Layer.provideMerge(SourceControlProviderRegistryLayerLive));
|
|
92565
|
+
const ReviewLayerLive = layer$10.pipe(Layer.provideMerge(layer$39), Layer.provideMerge(VcsDriverRegistryLayerLive));
|
|
92566
|
+
const VcsLayerLive = Layer.empty.pipe(Layer.provideMerge(layer$38), Layer.provideMerge(VcsDriverRegistryLayerLive), Layer.provideMerge(layer$11.pipe(Layer.provide(VcsDriverRegistryLayerLive))), Layer.provideMerge(GitWorkflowLayerLive), Layer.provideMerge(ReviewLayerLive), Layer.provideMerge(SourceControlRepositoryServiceLayerLive), Layer.provideMerge(layer$12.pipe(Layer.provide(GitWorkflowLayerLive))));
|
|
92639
92567
|
const CheckpointingLayerLive = Layer.empty.pipe(Layer.provideMerge(layer$35), Layer.provideMerge(layer$36.pipe(Layer.provide(VcsDriverRegistryLayerLive))));
|
|
92640
|
-
const PortScannerLayerLive = layer$
|
|
92641
|
-
const TerminalLayerLive = layer$
|
|
92642
|
-
const PreviewLayerLive = Layer.empty.pipe(Layer.provideMerge(layer$
|
|
92643
|
-
const WorkspaceEntriesLayerLive = layer$
|
|
92644
|
-
const WorkspaceFileSystemLayerLive = layer$
|
|
92568
|
+
const PortScannerLayerLive = layer$31.pipe(Layer.provide(layer$54));
|
|
92569
|
+
const TerminalLayerLive = layer$30.pipe(Layer.provide(PtyAdapterLive), Layer.provide(PortScannerLayerLive));
|
|
92570
|
+
const PreviewLayerLive = Layer.empty.pipe(Layer.provideMerge(layer$28), Layer.provideMerge(PortScannerLayerLive));
|
|
92571
|
+
const WorkspaceEntriesLayerLive = layer$26.pipe(Layer.provide(layer$44));
|
|
92572
|
+
const WorkspaceFileSystemLayerLive = layer$25.pipe(Layer.provide(layer$44), Layer.provide(WorkspaceEntriesLayerLive));
|
|
92645
92573
|
const WorkspaceLayerLive = Layer.mergeAll(layer$44, WorkspaceEntriesLayerLive, WorkspaceFileSystemLayerLive);
|
|
92646
92574
|
const ProjectFaviconResolverLayerLive = layer$42.pipe(Layer.provide(layer$44), Layer.provide(layer$43));
|
|
92647
92575
|
const AuthLayerLive = layer$64.pipe(Layer.provideMerge(PersistenceLayerLive), Layer.provide(layer$68));
|
|
92648
92576
|
const ProviderRuntimeLayerLive = ProviderSessionReaperLive.pipe(Layer.provideMerge(ProviderLayerLive), Layer.provideMerge(OrchestrationLayerLive));
|
|
92649
|
-
const RuntimeDependenciesLive = ReactorLayerLive.pipe(Layer.provideMerge(CheckpointingLayerLive), Layer.provideMerge(SourceControlProviderRegistryLayerLive), Layer.provideMerge(GitLayerLive), Layer.provideMerge(VcsLayerLive), Layer.provideMerge(ProviderRuntimeLayerLive), Layer.provideMerge(Layer.mergeAll(TerminalLayerLive, PreviewLayerLive)), Layer.provideMerge(PersistenceLayerLive), Layer.provideMerge(layer$52), Layer.provideMerge(ProviderRegistryLive), Layer.provideMerge(ProviderInstanceRegistryHydrationLive), Layer.provideMerge(ProviderEventLoggersLive), Layer.provideMerge(OpenCodeRuntimeLive), Layer.provideMerge(layer$61.pipe(Layer.provide(layer$68))), Layer.provideMerge(WorkspaceLayerLive), Layer.provideMerge(ProjectFaviconResolverLayerLive), Layer.provideMerge(layer$53), Layer.provideMerge(layer$46), Layer.provideMerge(AuthLayerLive), Layer.provideMerge(Layer.mergeAll(layer$
|
|
92577
|
+
const RuntimeDependenciesLive = ReactorLayerLive.pipe(Layer.provideMerge(CheckpointingLayerLive), Layer.provideMerge(SourceControlProviderRegistryLayerLive), Layer.provideMerge(GitLayerLive), Layer.provideMerge(VcsLayerLive), Layer.provideMerge(ProviderRuntimeLayerLive), Layer.provideMerge(Layer.mergeAll(TerminalLayerLive, PreviewLayerLive)), Layer.provideMerge(PersistenceLayerLive), Layer.provideMerge(layer$52), Layer.provideMerge(ProviderRegistryLive), Layer.provideMerge(ProviderInstanceRegistryHydrationLive), Layer.provideMerge(ProviderEventLoggersLive), Layer.provideMerge(OpenCodeRuntimeLive), Layer.provideMerge(layer$61.pipe(Layer.provide(layer$68))), Layer.provideMerge(WorkspaceLayerLive), Layer.provideMerge(ProjectFaviconResolverLayerLive), Layer.provideMerge(layer$53), Layer.provideMerge(layer$46), Layer.provideMerge(AuthLayerLive), Layer.provideMerge(Layer.mergeAll(layer$1, LinearMcpClientLive).pipe(Layer.provideMerge(Layer.mergeAll(layer$58, layer$32).pipe(Layer.provideMerge(layer$59), Layer.provideMerge(layer$60))))), Layer.provideMerge(layer$68)).pipe(Layer.provideMerge(layer$9), Layer.provideMerge(layer$8), Layer.provideMerge(layer$7), Layer.provideMerge(layer$49), Layer.provideMerge(layer$51), Layer.provideMerge(layer$50), Layer.provide(layer$72));
|
|
92650
92578
|
/**
|
|
92651
92579
|
* Hub asset sync.
|
|
92652
92580
|
*
|
|
@@ -92656,7 +92584,7 @@ const RuntimeDependenciesLive = ReactorLayerLive.pipe(Layer.provideMerge(Checkpo
|
|
|
92656
92584
|
*/
|
|
92657
92585
|
const AssetSyncLive = layer$55.pipe(Layer.provideMerge(layer$56), Layer.provideMerge(layer$57));
|
|
92658
92586
|
const RuntimeServicesLive = layer$45.pipe(Layer.provideMerge(AssetSyncLive), Layer.provideMerge(RuntimeDependenciesLive));
|
|
92659
|
-
const makeRoutesLayer = Layer.mergeAll(Layer.mergeAll(HttpApiBuilder.layer(EnvironmentHttpApi).pipe(Layer.provide(authHttpApiLayer), Layer.provide(orchestrationHttpApiLayer), Layer.provide(serverEnvironmentHttpApiLayer), Layer.provide(environmentAuthenticatedAuthLayer)), otlpTracesProxyRouteLayer, assetRouteLayer, mcpOAuthCallbackRouteLayer, staticAndDevRouteLayer, websocketRpcRouteLayer), layer.pipe(Layer.provide(layer$
|
|
92587
|
+
const makeRoutesLayer = Layer.mergeAll(Layer.mergeAll(HttpApiBuilder.layer(EnvironmentHttpApi).pipe(Layer.provide(authHttpApiLayer), Layer.provide(orchestrationHttpApiLayer), Layer.provide(serverEnvironmentHttpApiLayer), Layer.provide(environmentAuthenticatedAuthLayer)), otlpTracesProxyRouteLayer, assetRouteLayer, mcpOAuthCallbackRouteLayer, staticAndDevRouteLayer, websocketRpcRouteLayer), layer.pipe(Layer.provide(layer$3))).pipe(Layer.provide(RoutedTaskRepositoryLive.pipe(Layer.provide(PersistenceLayerLive))), Layer.provide(ProjectionProjectRepositoryLive.pipe(Layer.provide(PersistenceLayerLive))), Layer.provide(layer$43), Layer.provide(layer$29), Layer.provide(layer$47), Layer.provide(browserApiCorsLayer), Layer.provide(httpCompressionLayer));
|
|
92660
92588
|
const makeServerLayer = Layer.unwrap(Effect.gen(function* () {
|
|
92661
92589
|
const config = yield* ServerConfig$1;
|
|
92662
92590
|
yield* fixPath();
|