priiisk 0.1.22 → 0.1.23
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/{chunk-DPNPQG2D.js → chunk-7OL53RZ7.js} +35 -17
- package/dist/{chunk-Y2F6VW5R.js → chunk-BZPGK4ZH.js} +10 -10
- package/dist/{chunk-7HDRDMQU.js → chunk-ECYZGNL3.js} +4 -4
- package/dist/{chunk-GBEORC3T.js → chunk-G3ITCVKS.js} +3 -3
- package/dist/{chunk-YNTHXLFG.js → chunk-HOYW7OPN.js} +1 -1
- package/dist/{chunk-2YPHJHIX.js → chunk-HRCEXDLT.js} +2 -2
- package/dist/{chunk-YCWIUVAI.js → chunk-J77LDB4Q.js} +292 -144
- package/dist/{chunk-5W5JRU33.js → chunk-MJZ7FPJI.js} +4 -4
- package/dist/{chunk-U2FODXMR.js → chunk-QDMSPX34.js} +1 -2
- package/dist/{chunk-C7QHKE3K.js → chunk-QO2YENTD.js} +5 -5
- package/dist/priiisk-host.js +314 -157
- package/dist/priiisk.js +2 -2
- package/package.json +13 -13
- /package/dist/{chunk-DPNPQG2D.js.LEGAL.txt → chunk-7OL53RZ7.js.LEGAL.txt} +0 -0
- /package/dist/{chunk-C7QHKE3K.js.LEGAL.txt → chunk-QO2YENTD.js.LEGAL.txt} +0 -0
package/dist/priiisk-host.js
CHANGED
|
@@ -81155,28 +81155,42 @@ var resolveDirectTools = (config3, role, override) => {
|
|
|
81155
81155
|
|
|
81156
81156
|
// packages/config/src/resolvers/equipmentDescription.ts
|
|
81157
81157
|
var names = (values4) => values4.length === 0 ? "none" : values4.join(", ");
|
|
81158
|
-
var
|
|
81159
|
-
|
|
81160
|
-
|
|
81161
|
-
|
|
81162
|
-
|
|
81163
|
-
|
|
81164
|
-
|
|
81165
|
-
|
|
81166
|
-
|
|
81167
|
-
|
|
81168
|
-
[
|
|
81158
|
+
var equipmentDescriptionGroups = (equipment, revision) => [
|
|
81159
|
+
{
|
|
81160
|
+
label: `equipment r${String(revision)}`,
|
|
81161
|
+
values: [
|
|
81162
|
+
equipment.role ?? equipment.preset ?? "worker",
|
|
81163
|
+
equipment.readOnly ? "read-only" : "read/write"
|
|
81164
|
+
]
|
|
81165
|
+
},
|
|
81166
|
+
{
|
|
81167
|
+
label: "model",
|
|
81168
|
+
values: [
|
|
81169
|
+
equipment.model ?? "default",
|
|
81170
|
+
...equipment.thinkingLevel === void 0 ? [] : [`thinking ${equipment.thinkingLevel}`]
|
|
81171
|
+
]
|
|
81172
|
+
},
|
|
81173
|
+
{
|
|
81174
|
+
label: "tools",
|
|
81175
|
+
values: [
|
|
81169
81176
|
.../* @__PURE__ */ new Set([
|
|
81170
81177
|
...equipment.builtinTools,
|
|
81171
81178
|
...equipment.customToolNames.filter((name) => directToolBin(name) === void 0)
|
|
81172
81179
|
])
|
|
81173
81180
|
].sort()
|
|
81174
|
-
|
|
81175
|
-
|
|
81176
|
-
|
|
81177
|
-
|
|
81178
|
-
|
|
81179
|
-
|
|
81181
|
+
},
|
|
81182
|
+
{
|
|
81183
|
+
label: "direct",
|
|
81184
|
+
values: equipment.customToolNames.map((name) => directToolBin(name)).filter((bin) => bin !== void 0).sort()
|
|
81185
|
+
},
|
|
81186
|
+
{
|
|
81187
|
+
label: "mcp",
|
|
81188
|
+
values: equipment.mcp.serverNames.map((serverName) => {
|
|
81189
|
+
const toolNames = equipment.mcp.toolNamesByServer?.[serverName];
|
|
81190
|
+
return toolNames === void 0 ? serverName : `${serverName} (${names(toolNames)})`;
|
|
81191
|
+
})
|
|
81192
|
+
},
|
|
81193
|
+
{ label: "skills", values: [...equipment.skillNames] }
|
|
81180
81194
|
];
|
|
81181
81195
|
|
|
81182
81196
|
// packages/config/src/resolvers/mcpConfigResolver.ts
|
|
@@ -82153,7 +82167,7 @@ var HOST_BOOTSTRAP_ENVIRONMENT_NAMES = [
|
|
|
82153
82167
|
];
|
|
82154
82168
|
|
|
82155
82169
|
// packages/camp-state/src/bootstrap/campHostVersion.ts
|
|
82156
|
-
var PRIIISK_HOST_VERSION = "0.1.
|
|
82170
|
+
var PRIIISK_HOST_VERSION = "0.1.23";
|
|
82157
82171
|
|
|
82158
82172
|
// packages/camp-state/src/bootstrap/campLaunch.ts
|
|
82159
82173
|
var CampBootstrapError = class extends TaggedError("CampBootstrapError") {
|
|
@@ -98092,7 +98106,7 @@ var Client = class extends Protocol2 {
|
|
|
98092
98106
|
};
|
|
98093
98107
|
|
|
98094
98108
|
// packages/mcp-backend/src/connections/clientIdentity.ts
|
|
98095
|
-
var backendVersion = "0.1.
|
|
98109
|
+
var backendVersion = "0.1.23";
|
|
98096
98110
|
|
|
98097
98111
|
// packages/mcp-backend/src/connections/mcpFailure.ts
|
|
98098
98112
|
var McpFailure = class extends TaggedError("McpFailure") {
|
|
@@ -102630,13 +102644,30 @@ var CampUiScreen = {
|
|
|
102630
102644
|
camp: "camp",
|
|
102631
102645
|
worker: "worker"
|
|
102632
102646
|
};
|
|
102647
|
+
var CampUiSidebarTab = { workers: "workers", equipment: "equip" };
|
|
102648
|
+
var CAMP_UI_SIDEBAR_TABS = [
|
|
102649
|
+
CampUiSidebarTab.workers,
|
|
102650
|
+
CampUiSidebarTab.equipment
|
|
102651
|
+
];
|
|
102652
|
+
var nextCampUiSidebarTab = (current2, delta) => {
|
|
102653
|
+
const index = CAMP_UI_SIDEBAR_TABS.indexOf(current2);
|
|
102654
|
+
const size14 = CAMP_UI_SIDEBAR_TABS.length;
|
|
102655
|
+
const next3 = (((index < 0 ? 0 : index) + delta) % size14 + size14) % size14;
|
|
102656
|
+
return CAMP_UI_SIDEBAR_TABS[next3] ?? CampUiSidebarTab.workers;
|
|
102657
|
+
};
|
|
102633
102658
|
var campUiAskBlockId = (askId) => `ask:${askId}`;
|
|
102659
|
+
var campUiOpenedWorkerId = (state) => state.openedWorkerId;
|
|
102634
102660
|
var makeInitialCampUiState = (snapshot, presentationNow = 0) => ({
|
|
102661
|
+
/*
|
|
102662
|
+
* The cursor starts on the first worker, but nobody is opened: a camp that
|
|
102663
|
+
* opened someone by itself answered a question nobody asked and hid what a
|
|
102664
|
+
* fresh camp has to say about itself.
|
|
102665
|
+
*/
|
|
102635
102666
|
...snapshot.workers[0] === void 0 ? {} : { selectedWorkerId: snapshot.workers[0].snapshot.worker.id },
|
|
102636
102667
|
screen: CampUiScreen.camp,
|
|
102637
102668
|
focusedSlotId: "roster",
|
|
102638
102669
|
detailVisible: false,
|
|
102639
|
-
|
|
102670
|
+
sidebarTab: CampUiSidebarTab.workers,
|
|
102640
102671
|
presentationNow,
|
|
102641
102672
|
drafts: /* @__PURE__ */ new Map(),
|
|
102642
102673
|
scrollOffsets: /* @__PURE__ */ new Map(),
|
|
@@ -102661,8 +102692,11 @@ var reconcileCampUiState = (current2, snapshot) => {
|
|
|
102661
102692
|
);
|
|
102662
102693
|
const fallbackIndex = Math.min(Math.max(previousIndex, 0), snapshot.workers.length - 1);
|
|
102663
102694
|
const selectedWorkerId = previousId !== void 0 && workerIds.has(previousId) ? previousId : snapshot.workers[fallbackIndex]?.snapshot.worker.id;
|
|
102695
|
+
const previousOpenedId = current2.state.openedWorkerId;
|
|
102696
|
+
const openedWorkerId = previousOpenedId !== void 0 && workerIds.has(previousOpenedId) ? previousOpenedId : void 0;
|
|
102664
102697
|
const {
|
|
102665
102698
|
selectedWorkerId: _selectedWorkerId,
|
|
102699
|
+
openedWorkerId: _openedWorkerId,
|
|
102666
102700
|
focusedDetailBlockId: previousFocusedBlockId,
|
|
102667
102701
|
...stableState
|
|
102668
102702
|
} = current2.state;
|
|
@@ -102678,6 +102712,7 @@ var reconcileCampUiState = (current2, snapshot) => {
|
|
|
102678
102712
|
return {
|
|
102679
102713
|
...stableState,
|
|
102680
102714
|
...selectedWorkerId === void 0 ? {} : { selectedWorkerId },
|
|
102715
|
+
...openedWorkerId === void 0 ? {} : { openedWorkerId },
|
|
102681
102716
|
...focusedDetailBlockId === void 0 ? {} : { focusedDetailBlockId },
|
|
102682
102717
|
screen: selectedWorkerId === void 0 ? CampUiScreen.camp : current2.state.screen,
|
|
102683
102718
|
focusedSlotId: selectedWorkerId === void 0 ? "roster" : current2.state.focusedSlotId,
|
|
@@ -102733,12 +102768,17 @@ var makeCampUiStore = (initial, presentationNow = 0) => gen2(function* () {
|
|
|
102733
102768
|
...model,
|
|
102734
102769
|
state: {
|
|
102735
102770
|
...model.state,
|
|
102771
|
+
openedWorkerId: workerId,
|
|
102736
102772
|
selectedWorkerId: workerId,
|
|
102737
102773
|
screen: CampUiScreen.worker
|
|
102738
102774
|
}
|
|
102739
102775
|
}
|
|
102740
102776
|
])
|
|
102741
102777
|
),
|
|
102778
|
+
closeWorker: updateState((state) => {
|
|
102779
|
+
const { openedWorkerId: _openedWorkerId, ...rest } = state;
|
|
102780
|
+
return { ...rest, screen: CampUiScreen.camp };
|
|
102781
|
+
}),
|
|
102742
102782
|
activateScreen: (screen) => modifyEffect3(
|
|
102743
102783
|
modelRef,
|
|
102744
102784
|
(model) => screen === CampUiScreen.worker && model.state.selectedWorkerId === void 0 ? fail9(
|
|
@@ -102762,10 +102802,9 @@ var makeCampUiStore = (initial, presentationNow = 0) => gen2(function* () {
|
|
|
102762
102802
|
if (state.detailVisible === detailVisible) return state;
|
|
102763
102803
|
return { ...state, detailVisible };
|
|
102764
102804
|
}),
|
|
102765
|
-
|
|
102766
|
-
|
|
102767
|
-
|
|
102768
|
-
}),
|
|
102805
|
+
setSidebarTab: (sidebarTab) => updateState(
|
|
102806
|
+
(state) => state.sidebarTab === sidebarTab ? state : { ...state, sidebarTab }
|
|
102807
|
+
),
|
|
102769
102808
|
setDetailBlockExpanded: (blockId, expanded) => updateState((state) => ({
|
|
102770
102809
|
...state,
|
|
102771
102810
|
expandedDetailBlockIds: updateCampUiStringSet(
|
|
@@ -102841,6 +102880,8 @@ var emptyCampUiComponent = {
|
|
|
102841
102880
|
var CampUiSlot = {
|
|
102842
102881
|
campHeader: "camp-header",
|
|
102843
102882
|
equipment: "equipment",
|
|
102883
|
+
sidebarTabs: "sidebar-tabs",
|
|
102884
|
+
overview: "overview",
|
|
102844
102885
|
resources: "resources",
|
|
102845
102886
|
roster: "roster",
|
|
102846
102887
|
sessionHeader: "session-header",
|
|
@@ -102989,6 +103030,7 @@ var makeCampUiIntentHandler = (options2) => type2().pipe(
|
|
|
102989
103030
|
);
|
|
102990
103031
|
}),
|
|
102991
103032
|
OpenWorker: ({ workerId }) => options2.controller.openWorker(workerId),
|
|
103033
|
+
CloseWorker: () => options2.controller.closeWorker,
|
|
102992
103034
|
ScrollWorker: ({ workerId, delta }) => suspend4(() => {
|
|
102993
103035
|
const offset = options2.readModel().state.scrollOffsets.get(workerId) ?? 0;
|
|
102994
103036
|
return options2.controller.focusDetailBlock(void 0).pipe(
|
|
@@ -103010,7 +103052,11 @@ var makeCampUiIntentHandler = (options2) => type2().pipe(
|
|
|
103010
103052
|
}),
|
|
103011
103053
|
SelectWorker: ({ workerId }) => options2.controller.selectWorker(workerId),
|
|
103012
103054
|
SetDraft: ({ workerId, draft }) => options2.controller.setDraft(workerId, draft),
|
|
103013
|
-
|
|
103055
|
+
CycleSidebarTab: ({ delta }) => suspend4(
|
|
103056
|
+
() => options2.controller.setSidebarTab(
|
|
103057
|
+
nextCampUiSidebarTab(options2.readModel().state.sidebarTab, delta)
|
|
103058
|
+
)
|
|
103059
|
+
),
|
|
103014
103060
|
SetScrollOffset: ({ workerId, offset }) => options2.controller.setScrollOffset(workerId, offset),
|
|
103015
103061
|
SetTranscriptVisible: ({ visible }) => options2.controller.setDetailVisible(visible),
|
|
103016
103062
|
Steer: ({ workerId, message }) => message.trim() === "" ? _void : options2.backend.steer({ workerId, message }).pipe(
|
|
@@ -103072,10 +103118,10 @@ var findCampUiSpatialFocusTarget = (frame, currentSlotId, focusableSlotIds, dire
|
|
|
103072
103118
|
|
|
103073
103119
|
// packages/host-ui/src/layout/campUiLayoutPolicy.ts
|
|
103074
103120
|
var defaultCampUiLayoutPolicy = {
|
|
103075
|
-
leftMinimumWidth:
|
|
103076
|
-
rightMinimumWidth:
|
|
103077
|
-
leftTrackWidthThreshold:
|
|
103078
|
-
rightTrackWidthThreshold:
|
|
103121
|
+
leftMinimumWidth: 44,
|
|
103122
|
+
rightMinimumWidth: 44,
|
|
103123
|
+
leftTrackWidthThreshold: 90,
|
|
103124
|
+
rightTrackWidthThreshold: 136,
|
|
103079
103125
|
trackGapWidth: 1,
|
|
103080
103126
|
wideMinimumHeight: 18,
|
|
103081
103127
|
campHeaderHeight: 1,
|
|
@@ -103245,7 +103291,7 @@ var makeNarrowFrame = (viewport, state, policy, slots) => {
|
|
|
103245
103291
|
const footerHeight = fixedRows(viewport.height, policy.footerHeight);
|
|
103246
103292
|
const bodyHeight = Math.max(0, viewport.height - footerHeight);
|
|
103247
103293
|
const footerY = bodyHeight;
|
|
103248
|
-
const workerScreen = state.screen === CampUiScreen.worker && state
|
|
103294
|
+
const workerScreen = state.screen === CampUiScreen.worker && campUiOpenedWorkerId(state) !== void 0;
|
|
103249
103295
|
const [campHeight = 0, rosterHeight = 0] = workerScreen ? [] : leftSectionHeights(bodyHeight, slots);
|
|
103250
103296
|
const sessionHeaderHeight = workerScreen ? fixedRows(bodyHeight, policy.sessionHeaderHeight) : 0;
|
|
103251
103297
|
const inputHeight = workerScreen ? composerHeight(bodyHeight - sessionHeaderHeight, viewport.width, policy, slots) : 0;
|
|
@@ -103269,12 +103315,12 @@ var makeNarrowFrame = (viewport, state, policy, slots) => {
|
|
|
103269
103315
|
])
|
|
103270
103316
|
};
|
|
103271
103317
|
};
|
|
103272
|
-
var makeWideFrame = (viewport, policy, slots) => {
|
|
103318
|
+
var makeWideFrame = (viewport, state, policy, slots) => {
|
|
103273
103319
|
const campHeaderHeight = fixedRows(viewport.height, policy.campHeaderHeight);
|
|
103274
103320
|
const footerHeight = fixedRows(viewport.height - campHeaderHeight, policy.footerHeight);
|
|
103275
103321
|
const bodyHeight = Math.max(0, viewport.height - campHeaderHeight - footerHeight);
|
|
103276
103322
|
const footerY = campHeaderHeight + bodyHeight;
|
|
103277
|
-
const [leftWidth = 0, leftGap = 0, centerWidth = 0
|
|
103323
|
+
const [leftWidth = 0, leftGap = 0, centerWidth = 0] = allocateCampUiTrackColumns(viewport.width, [
|
|
103278
103324
|
{
|
|
103279
103325
|
kind: CampUiTrackSizeKind.min,
|
|
103280
103326
|
minimumColumns: policy.leftMinimumWidth,
|
|
@@ -103285,46 +103331,60 @@ var makeWideFrame = (viewport, policy, slots) => {
|
|
|
103285
103331
|
columns: policy.trackGapWidth,
|
|
103286
103332
|
collapseBelow: policy.leftTrackWidthThreshold
|
|
103287
103333
|
},
|
|
103288
|
-
{ kind: CampUiTrackSizeKind.fill, weight: 1 }
|
|
103289
|
-
{
|
|
103290
|
-
kind: CampUiTrackSizeKind.fixed,
|
|
103291
|
-
columns: policy.trackGapWidth,
|
|
103292
|
-
collapseBelow: policy.rightTrackWidthThreshold
|
|
103293
|
-
},
|
|
103294
|
-
{
|
|
103295
|
-
kind: CampUiTrackSizeKind.min,
|
|
103296
|
-
minimumColumns: policy.rightMinimumWidth,
|
|
103297
|
-
collapseBelow: policy.rightTrackWidthThreshold
|
|
103298
|
-
}
|
|
103334
|
+
{ kind: CampUiTrackSizeKind.fill, weight: 1 }
|
|
103299
103335
|
]);
|
|
103300
103336
|
const centerX2 = leftWidth + leftGap;
|
|
103301
|
-
const rightX = centerX2 + centerWidth + rightGap;
|
|
103302
103337
|
const sessionHeaderHeight = fixedRows(bodyHeight, policy.sessionHeaderHeight);
|
|
103303
103338
|
const inputHeight = composerHeight(bodyHeight - sessionHeaderHeight, centerWidth, policy, slots);
|
|
103304
103339
|
const transcriptHeight = bodyHeight - sessionHeaderHeight - inputHeight;
|
|
103305
103340
|
const bodyY = campHeaderHeight;
|
|
103341
|
+
const opened = campUiOpenedWorkerId(state);
|
|
103342
|
+
const sidebarTabsHeight = leftWidth === 0 ? 0 : fixedRows(bodyHeight, 1);
|
|
103306
103343
|
return {
|
|
103307
103344
|
mode: CampUiLayoutMode.wide,
|
|
103308
103345
|
dividers: [],
|
|
103309
103346
|
regions: compact2([
|
|
103310
103347
|
region(CampUiSlot.campHeader, 0, 0, viewport.width, campHeaderHeight),
|
|
103311
|
-
|
|
103312
|
-
|
|
103348
|
+
/*
|
|
103349
|
+
* The tab row sits under the track it belongs to and takes one line; the
|
|
103350
|
+
* active tab is the content above it.
|
|
103351
|
+
*/
|
|
103313
103352
|
region(
|
|
103314
|
-
CampUiSlot.
|
|
103315
|
-
|
|
103316
|
-
bodyY
|
|
103317
|
-
|
|
103318
|
-
|
|
103353
|
+
state.sidebarTab === CampUiSidebarTab.equipment ? CampUiSlot.equipment : CampUiSlot.roster,
|
|
103354
|
+
0,
|
|
103355
|
+
bodyY,
|
|
103356
|
+
leftWidth,
|
|
103357
|
+
Math.max(0, bodyHeight - sidebarTabsHeight)
|
|
103319
103358
|
),
|
|
103320
103359
|
region(
|
|
103321
|
-
CampUiSlot.
|
|
103322
|
-
|
|
103323
|
-
bodyY +
|
|
103324
|
-
|
|
103325
|
-
|
|
103360
|
+
CampUiSlot.sidebarTabs,
|
|
103361
|
+
0,
|
|
103362
|
+
bodyY + Math.max(0, bodyHeight - sidebarTabsHeight),
|
|
103363
|
+
leftWidth,
|
|
103364
|
+
sidebarTabsHeight
|
|
103326
103365
|
),
|
|
103327
|
-
|
|
103366
|
+
/*
|
|
103367
|
+
* With nobody open the middle answers about the camp itself — what it
|
|
103368
|
+
* loaded and what it can reach — instead of showing an empty transcript
|
|
103369
|
+
* above an input that has no addressee.
|
|
103370
|
+
*/
|
|
103371
|
+
...opened === void 0 ? [region(CampUiSlot.overview, centerX2, bodyY, centerWidth, bodyHeight)] : [
|
|
103372
|
+
region(CampUiSlot.sessionHeader, centerX2, bodyY, centerWidth, sessionHeaderHeight),
|
|
103373
|
+
region(
|
|
103374
|
+
CampUiSlot.transcript,
|
|
103375
|
+
centerX2,
|
|
103376
|
+
bodyY + sessionHeaderHeight,
|
|
103377
|
+
centerWidth,
|
|
103378
|
+
transcriptHeight
|
|
103379
|
+
),
|
|
103380
|
+
region(
|
|
103381
|
+
CampUiSlot.composer,
|
|
103382
|
+
centerX2,
|
|
103383
|
+
bodyY + sessionHeaderHeight + transcriptHeight,
|
|
103384
|
+
centerWidth,
|
|
103385
|
+
inputHeight
|
|
103386
|
+
)
|
|
103387
|
+
],
|
|
103328
103388
|
/*
|
|
103329
103389
|
* The bottom line belongs to the conversation, not to the whole width: it
|
|
103330
103390
|
* sits under the input and answers about the work happening there. Under
|
|
@@ -103342,7 +103402,7 @@ var makeDefaultCampUiLayout = (policy = defaultCampUiLayoutPolicy) => ({
|
|
|
103342
103402
|
width: units2(viewport.width),
|
|
103343
103403
|
height: units2(viewport.height)
|
|
103344
103404
|
};
|
|
103345
|
-
return normalized.height >= policy.wideMinimumHeight ? makeWideFrame(normalized, policy, slots) : makeNarrowFrame(normalized, state, policy, slots);
|
|
103405
|
+
return normalized.height >= policy.wideMinimumHeight ? makeWideFrame(normalized, state, policy, slots) : makeNarrowFrame(normalized, state, policy, slots);
|
|
103346
103406
|
}
|
|
103347
103407
|
});
|
|
103348
103408
|
|
|
@@ -103749,7 +103809,7 @@ var makeCampUiComposerComponent = (context8, tui) => {
|
|
|
103749
103809
|
};
|
|
103750
103810
|
};
|
|
103751
103811
|
const selectedEditor = () => {
|
|
103752
|
-
const workerId = context8.readModel().state
|
|
103812
|
+
const workerId = campUiOpenedWorkerId(context8.readModel().state);
|
|
103753
103813
|
if (workerId === void 0) return void 0;
|
|
103754
103814
|
const existing = editors.get(workerId);
|
|
103755
103815
|
if (existing !== void 0) return existing;
|
|
@@ -103759,7 +103819,7 @@ var makeCampUiComposerComponent = (context8, tui) => {
|
|
|
103759
103819
|
};
|
|
103760
103820
|
const renderSelectedEditor = (width) => {
|
|
103761
103821
|
const model = context8.readModel();
|
|
103762
|
-
const workerId = model.state
|
|
103822
|
+
const workerId = campUiOpenedWorkerId(model.state);
|
|
103763
103823
|
const entry = selectedEditor();
|
|
103764
103824
|
if (workerId === void 0 || entry === void 0) return void 0;
|
|
103765
103825
|
const { editor } = entry;
|
|
@@ -104290,7 +104350,7 @@ var makeCampUiDetailComponent = (context8, registry2 = defaultCampUiDetailBlockR
|
|
|
104290
104350
|
visibleRanges = [];
|
|
104291
104351
|
const model = context8.readModel();
|
|
104292
104352
|
const selectTheme = getSelectListTheme8();
|
|
104293
|
-
const workerId = model.state
|
|
104353
|
+
const workerId = campUiOpenedWorkerId(model.state);
|
|
104294
104354
|
if (workerId === void 0) return [selectTheme.description("No worker selected")];
|
|
104295
104355
|
const worker = findCampUiWorker(model.snapshot, workerId);
|
|
104296
104356
|
if (worker === void 0) return [selectTheme.noMatch("Selected worker is unavailable")];
|
|
@@ -104370,7 +104430,7 @@ var makeCampUiDetailComponent = (context8, registry2 = defaultCampUiDetailBlockR
|
|
|
104370
104430
|
const delta = matchesKey2(input, Key3.up) ? -1 : matchesKey2(input, Key3.down) ? 1 : void 0;
|
|
104371
104431
|
if (delta === void 0) return false;
|
|
104372
104432
|
const model = context8.readModel();
|
|
104373
|
-
const workerId = model.state
|
|
104433
|
+
const workerId = campUiOpenedWorkerId(model.state);
|
|
104374
104434
|
if (workerId === void 0) return false;
|
|
104375
104435
|
const focusedBlockId = model.state.focusedDetailBlockId;
|
|
104376
104436
|
const current2 = renderedRanges.findIndex((range3) => range3.id === focusedBlockId);
|
|
@@ -104387,7 +104447,7 @@ var makeCampUiDetailComponent = (context8, registry2 = defaultCampUiDetailBlockR
|
|
|
104387
104447
|
return true;
|
|
104388
104448
|
},
|
|
104389
104449
|
handlePointer: (pointer) => {
|
|
104390
|
-
const workerId = context8.readModel().state
|
|
104450
|
+
const workerId = campUiOpenedWorkerId(context8.readModel().state);
|
|
104391
104451
|
if (workerId === void 0) return [];
|
|
104392
104452
|
if (pointer.action === "wheel") {
|
|
104393
104453
|
return [
|
|
@@ -104520,9 +104580,9 @@ var PULSE_WINDOW_MS = 12e4;
|
|
|
104520
104580
|
var PULSE_CEILING = 4;
|
|
104521
104581
|
var PULSE_SAMPLES_PER_COLUMN = 2;
|
|
104522
104582
|
var rosterWidths = (width) => {
|
|
104523
|
-
const right3 = Math.min(
|
|
104524
|
-
const left3 = Math.min(
|
|
104525
|
-
return { left: left3, pulse: Math.max(0, width - left3 - right3 -
|
|
104583
|
+
const right3 = Math.min(15, Math.max(0, width - 20));
|
|
104584
|
+
const left3 = Math.min(14, Math.max(0, width - right3 - 6));
|
|
104585
|
+
return { left: left3, pulse: Math.max(0, width - left3 - right3 - 3), right: right3 };
|
|
104526
104586
|
};
|
|
104527
104587
|
var rightColumn = (text4, width) => {
|
|
104528
104588
|
const fitted = truncateToWidth4(text4, width);
|
|
@@ -104554,23 +104614,24 @@ var usageText = (entry, width) => {
|
|
|
104554
104614
|
const usage = entry.snapshot.session?.usage;
|
|
104555
104615
|
const context8 = percentText(usage?.context?.percent);
|
|
104556
104616
|
const cache = usage?.latestCacheHitRate === void 0 ? usage === void 0 || usage.tokens.total === 0 ? "n/a" : "n/r" : percentText(usage.latestCacheHitRate);
|
|
104557
|
-
const
|
|
104558
|
-
|
|
104559
|
-
if (visibleWidth3(full) <= width || usage === void 0) return full;
|
|
104560
|
-
const compactCost = `$${usage.cost.toFixed(2).replace(/^0/u, "")}`;
|
|
104561
|
-
return `${context8}${cache}${compactCost}`;
|
|
104617
|
+
const full = `${context8} cache ${cache}`;
|
|
104618
|
+
return visibleWidth3(full) <= width ? full : `${context8} ${cache}`;
|
|
104562
104619
|
};
|
|
104563
104620
|
var stateText = (state, duration5, width) => {
|
|
104564
104621
|
const full = `${state} ${duration5}`;
|
|
104565
104622
|
return visibleWidth3(full) <= width ? full : state;
|
|
104566
104623
|
};
|
|
104567
|
-
var modelText = (entry) => {
|
|
104624
|
+
var modelText = (entry, width) => {
|
|
104568
104625
|
const model = entry.snapshot.session?.usage?.model ?? entry.snapshot.worker.equipment.model;
|
|
104569
|
-
|
|
104570
|
-
return model
|
|
104626
|
+
const thinking = entry.snapshot.session?.thinkingLevel ?? entry.snapshot.worker.equipment.thinkingLevel;
|
|
104627
|
+
if (model === void 0) return thinking === void 0 ? "model unknown" : thinking;
|
|
104628
|
+
const short = model.split("/").at(-1) ?? model;
|
|
104629
|
+
if (thinking === void 0) return short;
|
|
104630
|
+
const full = `${short} ${thinking}`;
|
|
104631
|
+
return visibleWidth3(full) <= width ? full : short;
|
|
104571
104632
|
};
|
|
104572
104633
|
var cardLine = (marker, left3, pulse, right3, widths, width) => fitCampUiLine(
|
|
104573
|
-
`${marker} ${fitCampUiLine(left3, widths.left)}
|
|
104634
|
+
`${marker} ${fitCampUiLine(left3, widths.left)}${fitCampUiLine(pulse, widths.pulse)} ${rightColumn(right3, widths.right)}`,
|
|
104574
104635
|
width
|
|
104575
104636
|
);
|
|
104576
104637
|
var renderExternalControllerCard = (controllerConnected, width) => {
|
|
@@ -104597,10 +104658,10 @@ var renderExternalControllerCard = (controllerConnected, width) => {
|
|
|
104597
104658
|
)
|
|
104598
104659
|
];
|
|
104599
104660
|
};
|
|
104600
|
-
var renderWorkerCard = (entry,
|
|
104661
|
+
var renderWorkerCard = (entry, cursorWorkerId, openedWorkerId, now2, width) => {
|
|
104601
104662
|
const worker = entry.snapshot.worker;
|
|
104602
104663
|
const session = entry.snapshot.session;
|
|
104603
|
-
const level = worker.id
|
|
104664
|
+
const level = worker.id === openedWorkerId ? CampUiLevel.selected : worker.id === cursorWorkerId ? CampUiLevel.focused : CampUiLevel.resting;
|
|
104604
104665
|
const roleColor = campUiRoleColor(worker.equipment.role);
|
|
104605
104666
|
const widths = rosterWidths(width);
|
|
104606
104667
|
const timestamps = (session?.transcript ?? []).flatMap(
|
|
@@ -104623,7 +104684,7 @@ var renderWorkerCard = (entry, selectedWorkerId, detailVisible, now2, width) =>
|
|
|
104623
104684
|
campUiLevelMarkerText(level, roleColor),
|
|
104624
104685
|
campUiText(name, roleColor, level),
|
|
104625
104686
|
campUiPulseText(pulse[0], level, roleColor),
|
|
104626
|
-
neutral(modelText(entry)),
|
|
104687
|
+
neutral(modelText(entry, widths.right)),
|
|
104627
104688
|
widths,
|
|
104628
104689
|
width
|
|
104629
104690
|
),
|
|
@@ -104646,16 +104707,17 @@ var makeCampUiRoster = (context8) => ({
|
|
|
104646
104707
|
return [getSelectListTheme9().description("No workers")];
|
|
104647
104708
|
}
|
|
104648
104709
|
const controller = external ? renderExternalControllerCard(model.snapshot.controllerConnected, viewport.width) : [];
|
|
104649
|
-
const workers = model.snapshot.workers.flatMap((entry) => {
|
|
104710
|
+
const workers = model.snapshot.workers.flatMap((entry, index) => {
|
|
104650
104711
|
const candidateNow = model.state.presentationNow;
|
|
104651
104712
|
const now2 = Number.isFinite(candidateNow) ? candidateNow : entry.snapshot.worker.updatedAt;
|
|
104652
|
-
|
|
104713
|
+
const card = renderWorkerCard(
|
|
104653
104714
|
entry,
|
|
104654
104715
|
model.state.selectedWorkerId,
|
|
104655
|
-
model.state
|
|
104716
|
+
campUiOpenedWorkerId(model.state),
|
|
104656
104717
|
now2,
|
|
104657
104718
|
viewport.width
|
|
104658
104719
|
);
|
|
104720
|
+
return index === 0 ? card : ["", ...card];
|
|
104659
104721
|
});
|
|
104660
104722
|
return [...controller, ...workers];
|
|
104661
104723
|
},
|
|
@@ -104666,7 +104728,8 @@ var makeCampUiRoster = (context8) => ({
|
|
|
104666
104728
|
if (pointer.y < controllerRows) {
|
|
104667
104729
|
return [CampUiIntents.FocusSlot({ slotId: CampUiSlot.roster })];
|
|
104668
104730
|
}
|
|
104669
|
-
const
|
|
104731
|
+
const offset = pointer.y - controllerRows;
|
|
104732
|
+
const workerIndex = offset < 2 ? 0 : Math.floor((offset + 1) / 3);
|
|
104670
104733
|
const workerId = model.snapshot.workers[workerIndex]?.snapshot.worker.id;
|
|
104671
104734
|
if (workerId === void 0) return [];
|
|
104672
104735
|
return [
|
|
@@ -104679,7 +104742,7 @@ var makeCampUiSessionHeader = (context8) => ({
|
|
|
104679
104742
|
render: (viewport) => {
|
|
104680
104743
|
const model = context8.readModel();
|
|
104681
104744
|
const theme = getSelectListTheme9();
|
|
104682
|
-
const workerId = model.state
|
|
104745
|
+
const workerId = campUiOpenedWorkerId(model.state);
|
|
104683
104746
|
if (workerId === void 0) {
|
|
104684
104747
|
return [fitCampUiLine(theme.description("Select a worker"), viewport.width)];
|
|
104685
104748
|
}
|
|
@@ -104705,11 +104768,17 @@ import { wrapTextWithAnsi } from "@earendil-works/pi-tui";
|
|
|
104705
104768
|
var fullEquipmentLines = (equipment, revision, width) => {
|
|
104706
104769
|
if (width <= 0) return [];
|
|
104707
104770
|
const theme = getSelectListTheme10();
|
|
104708
|
-
return
|
|
104709
|
-
|
|
104710
|
-
|
|
104711
|
-
|
|
104712
|
-
|
|
104771
|
+
return equipmentDescriptionGroups(equipment, revision).flatMap((group2) => {
|
|
104772
|
+
const values4 = group2.values.length === 0 ? ["none"] : group2.values;
|
|
104773
|
+
return [
|
|
104774
|
+
fitCampUiLine(theme.description(group2.label), width),
|
|
104775
|
+
...values4.flatMap((value5, index) => {
|
|
104776
|
+
const branch = index === values4.length - 1 ? "\u2514\u2500" : "\u251C\u2500";
|
|
104777
|
+
const body = `${theme.description(branch)} ${value5}`;
|
|
104778
|
+
return wrapTextWithAnsi(body, width).map((wrapped) => fitCampUiLine(wrapped, width));
|
|
104779
|
+
})
|
|
104780
|
+
];
|
|
104781
|
+
});
|
|
104713
104782
|
};
|
|
104714
104783
|
var renderCampUiEquipment = (equipment, revision, width, height) => {
|
|
104715
104784
|
const lines3 = fullEquipmentLines(equipment, revision, width);
|
|
@@ -104726,7 +104795,7 @@ var renderCampUiEquipment = (equipment, revision, width, height) => {
|
|
|
104726
104795
|
var makeCampUiEquipment = (context8) => {
|
|
104727
104796
|
const selectedWorker = () => {
|
|
104728
104797
|
const model = context8.readModel();
|
|
104729
|
-
const workerId = model.state
|
|
104798
|
+
const workerId = campUiOpenedWorkerId(model.state);
|
|
104730
104799
|
return workerId === void 0 ? void 0 : findCampUiWorker(model.snapshot, workerId);
|
|
104731
104800
|
};
|
|
104732
104801
|
const fullLines = (width) => {
|
|
@@ -104738,6 +104807,8 @@ var makeCampUiEquipment = (context8) => {
|
|
|
104738
104807
|
);
|
|
104739
104808
|
};
|
|
104740
104809
|
return {
|
|
104810
|
+
/* A tab of the left track takes focus like the roster does. */
|
|
104811
|
+
focusable: true,
|
|
104741
104812
|
preferredRows: (width) => fullLines(width).length,
|
|
104742
104813
|
render: (viewport) => {
|
|
104743
104814
|
const worker = selectedWorker();
|
|
@@ -104766,20 +104837,17 @@ var diagnosticText = (value5) => {
|
|
|
104766
104837
|
const normalized = value5?.replaceAll(/\s+/gu, " ").trim();
|
|
104767
104838
|
return normalized === "" ? void 0 : normalized;
|
|
104768
104839
|
};
|
|
104769
|
-
var
|
|
104770
|
-
|
|
104771
|
-
|
|
104772
|
-
|
|
104773
|
-
|
|
104774
|
-
|
|
104775
|
-
const
|
|
104776
|
-
|
|
104777
|
-
|
|
104778
|
-
...waiting === 0 ? [] : [`${String(waiting)} waiting`]
|
|
104779
|
-
];
|
|
104780
|
-
return parts2.join(" \xB7 ");
|
|
104840
|
+
var campCostText = (workers) => {
|
|
104841
|
+
const reported = workers.flatMap(
|
|
104842
|
+
(worker) => worker.snapshot.session?.usage === void 0 ? [] : [worker.snapshot.session.usage]
|
|
104843
|
+
);
|
|
104844
|
+
if (workers.length === 0) return "";
|
|
104845
|
+
if (reported.length === 0) return "cost unknown";
|
|
104846
|
+
const total = reported.reduce((sum3, usage) => sum3 + usage.cost, 0);
|
|
104847
|
+
const bound = reported.length < workers.length ? "\u2265" : "";
|
|
104848
|
+
return `${bound}$${total.toFixed(3)}`;
|
|
104781
104849
|
};
|
|
104782
|
-
var
|
|
104850
|
+
var workerCountText = (workers) => workers.length === 0 ? "no workers" : `${String(workers.length)} ${workers.length === 1 ? "worker" : "workers"}`;
|
|
104783
104851
|
var shortenPath = (value5, width) => {
|
|
104784
104852
|
const available = Math.max(0, Math.floor(width));
|
|
104785
104853
|
if (available <= 0) return "";
|
|
@@ -104802,9 +104870,12 @@ var makeCampUiFooter = (context8) => ({
|
|
|
104802
104870
|
const diagnostic = actionError !== void 0 ? `${renderCampUiStatus("action error", CampUiTone.error)} ${theme.description(`\xB7 ${actionError}`)}` : healthMessage !== void 0 ? styleCampUiTone(healthTone, healthMessage) : health.status === CampUiHealthStatus.ready ? "" : renderCampUiStatus(health.status, healthTone);
|
|
104803
104871
|
const branch = snapshot.projectBranch === null ? "" : ` \xB7 ${snapshot.projectBranch}`;
|
|
104804
104872
|
const version2 = `v${snapshot.hostVersion}`;
|
|
104873
|
+
const camp = [workerCountText(snapshot.workers), campCostText(snapshot.workers)].filter(
|
|
104874
|
+
(part) => part !== ""
|
|
104875
|
+
);
|
|
104805
104876
|
const candidates = [
|
|
104806
|
-
{ right: [
|
|
104807
|
-
{ right: [
|
|
104877
|
+
{ right: [...camp, version2, retry5], branch },
|
|
104878
|
+
{ right: [...camp, version2], branch },
|
|
104808
104879
|
{ right: [version2], branch },
|
|
104809
104880
|
{ right: [version2], branch: "" }
|
|
104810
104881
|
];
|
|
@@ -104829,10 +104900,68 @@ var makeCampUiFooter = (context8) => ({
|
|
|
104829
104900
|
}
|
|
104830
104901
|
});
|
|
104831
104902
|
|
|
104903
|
+
// packages/host-ui/src/pi/layout/campUiOverview.ts
|
|
104904
|
+
import { getMarkdownTheme as getMarkdownTheme8, getSelectListTheme as getSelectListTheme12 } from "@earendil-works/pi-coding-agent";
|
|
104905
|
+
var resourceGroup = (label, values4, reported, width) => {
|
|
104906
|
+
const theme = getSelectListTheme12();
|
|
104907
|
+
const body = reported ? values4.length === 0 ? theme.description("none loaded") : values4.join(", ") : theme.description("not reported");
|
|
104908
|
+
return [
|
|
104909
|
+
styleCampUiTone(values4.length > 0 ? CampUiTone.attention : CampUiTone.neutral, `[${label}]`),
|
|
104910
|
+
` ${body}`,
|
|
104911
|
+
""
|
|
104912
|
+
].map((line) => fitCampUiLine(line, width));
|
|
104913
|
+
};
|
|
104914
|
+
var mcpNames = (snapshot) => uniqueCampUiNames(
|
|
104915
|
+
snapshot.workers.flatMap((worker) => worker.snapshot.worker.equipment.mcp.serverNames)
|
|
104916
|
+
);
|
|
104917
|
+
var makeCampUiOverview = (context8) => ({
|
|
104918
|
+
render: (viewport) => {
|
|
104919
|
+
const model = context8.readModel();
|
|
104920
|
+
const snapshot = model.snapshot;
|
|
104921
|
+
const theme = getSelectListTheme12();
|
|
104922
|
+
const dim = getMarkdownTheme8().codeBlockBorder;
|
|
104923
|
+
const inventory = snapshot.resources;
|
|
104924
|
+
const reported = inventory.reportedWorkers > 0;
|
|
104925
|
+
const width = viewport.width;
|
|
104926
|
+
const workers = snapshot.workers.length;
|
|
104927
|
+
const lines3 = [
|
|
104928
|
+
fitCampUiLine(`${theme.selectedText("priiisk")} ${dim(`v${snapshot.hostVersion}`)}`, width),
|
|
104929
|
+
fitCampUiLine(dim("\u2190 workers \xB7 enter open \xB7 esc back here"), width),
|
|
104930
|
+
fitCampUiLine(
|
|
104931
|
+
dim(
|
|
104932
|
+
workers === 0 ? "\u041B\u0430\u0433\u0435\u0440\u044C \u043F\u0443\u0441\u0442. \u041E\u0440\u043A\u0435\u0441\u0442\u0440\u0430\u0442\u043E\u0440 \u043D\u0430\u043D\u0438\u043C\u0430\u0435\u0442 \u0432\u043E\u0440\u043A\u0435\u0440\u043E\u0432 \u0447\u0435\u0440\u0435\u0437 CLI: priiisk hire." : `\u0412 \u043B\u0430\u0433\u0435\u0440\u0435 ${String(workers)} ${workers === 1 ? "\u0432\u043E\u0440\u043A\u0435\u0440" : "\u0432\u043E\u0440\u043A\u0435\u0440\u0430"}. \u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0435\u0433\u043E \u0441\u043B\u0435\u0432\u0430 \u0438 \u043E\u0442\u043A\u0440\u043E\u0439\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C \u0445\u043E\u0434 \u0440\u0430\u0431\u043E\u0442\u044B.`
|
|
104933
|
+
),
|
|
104934
|
+
width
|
|
104935
|
+
),
|
|
104936
|
+
"",
|
|
104937
|
+
...resourceGroup(
|
|
104938
|
+
"Context",
|
|
104939
|
+
uniqueCampUiNames(inventory.contextFiles.map((item) => item.name)),
|
|
104940
|
+
reported,
|
|
104941
|
+
width
|
|
104942
|
+
),
|
|
104943
|
+
...resourceGroup(
|
|
104944
|
+
"Extensions",
|
|
104945
|
+
uniqueCampUiNames(inventory.extensions.map((item) => item.name)),
|
|
104946
|
+
reported,
|
|
104947
|
+
width
|
|
104948
|
+
),
|
|
104949
|
+
...resourceGroup(
|
|
104950
|
+
"Skills",
|
|
104951
|
+
uniqueCampUiNames(inventory.skills.map((item) => item.name)),
|
|
104952
|
+
reported,
|
|
104953
|
+
width
|
|
104954
|
+
),
|
|
104955
|
+
...resourceGroup("MCP", mcpNames(snapshot), snapshot.workers.length > 0, width)
|
|
104956
|
+
];
|
|
104957
|
+
return lines3.slice(0, Math.max(0, viewport.height));
|
|
104958
|
+
}
|
|
104959
|
+
});
|
|
104960
|
+
|
|
104832
104961
|
// packages/host-ui/src/pi/layout/campUiResources.ts
|
|
104833
|
-
import { getSelectListTheme as
|
|
104962
|
+
import { getSelectListTheme as getSelectListTheme13 } from "@earendil-works/pi-coding-agent";
|
|
104834
104963
|
var renderResourceTree = (label, value5, tone, width) => {
|
|
104835
|
-
const theme =
|
|
104964
|
+
const theme = getSelectListTheme13();
|
|
104836
104965
|
const lines3 = [
|
|
104837
104966
|
theme.description(label),
|
|
104838
104967
|
`${theme.description("\u2514\u2500")} ${renderCampUiStatus(value5, tone)}`
|
|
@@ -104855,7 +104984,7 @@ var makeCampUiResources = (context8) => ({
|
|
|
104855
104984
|
const value5 = names2.length === 0 ? "none loaded" : names2.join(", ");
|
|
104856
104985
|
return partial4 ? `${value5} \xB7 partial` : value5;
|
|
104857
104986
|
};
|
|
104858
|
-
const
|
|
104987
|
+
const mcpNames2 = uniqueCampUiNames(equipment.flatMap((item) => item.mcp.serverNames));
|
|
104859
104988
|
const mcpHealth = snapshot.workers.flatMap((worker) => worker.snapshot.mcp);
|
|
104860
104989
|
const healthNames = new Set(mcpHealth.map((item) => item.serverName));
|
|
104861
104990
|
const failedMcp = mcpHealth.some(
|
|
@@ -104865,15 +104994,15 @@ var makeCampUiResources = (context8) => ({
|
|
|
104865
104994
|
(item) => item.status === "connecting" || item.status === "retry-wait"
|
|
104866
104995
|
);
|
|
104867
104996
|
const partialMcp = mcpHealth.some((item) => !item.catalogComplete);
|
|
104868
|
-
const missingMcpHealth =
|
|
104869
|
-
const mcpTone = failedMcp ? CampUiTone.error : pendingMcp || partialMcp || missingMcpHealth ? CampUiTone.attention :
|
|
104997
|
+
const missingMcpHealth = mcpNames2.some((name) => !healthNames.has(name));
|
|
104998
|
+
const mcpTone = failedMcp ? CampUiTone.error : pendingMcp || partialMcp || missingMcpHealth ? CampUiTone.attention : mcpNames2.length > 0 ? CampUiTone.success : CampUiTone.neutral;
|
|
104870
104999
|
const mcpNotes = [
|
|
104871
105000
|
...failedMcp ? ["down"] : [],
|
|
104872
105001
|
...pendingMcp ? ["connecting"] : [],
|
|
104873
105002
|
...partialMcp ? ["catalog partial"] : [],
|
|
104874
105003
|
...missingMcpHealth ? ["health not reported"] : []
|
|
104875
105004
|
];
|
|
104876
|
-
const mcpText = !equipmentReported ? "not reported" :
|
|
105005
|
+
const mcpText = !equipmentReported ? "not reported" : mcpNames2.length === 0 ? "none configured" : `${mcpNames2.join(", ")}${mcpNotes.length === 0 ? "" : ` \xB7 ${mcpNotes.join(", ")}`}`;
|
|
104877
105006
|
const contentWidth = Math.max(1, viewport.width - 2);
|
|
104878
105007
|
const body = [
|
|
104879
105008
|
...renderResourceTree(
|
|
@@ -104900,6 +105029,22 @@ var makeCampUiResources = (context8) => ({
|
|
|
104900
105029
|
}
|
|
104901
105030
|
});
|
|
104902
105031
|
|
|
105032
|
+
// packages/host-ui/src/pi/layout/campUiSidebarTabs.ts
|
|
105033
|
+
import { getMarkdownTheme as getMarkdownTheme9, getSelectListTheme as getSelectListTheme14 } from "@earendil-works/pi-coding-agent";
|
|
105034
|
+
import { visibleWidth as visibleWidth5 } from "@earendil-works/pi-tui";
|
|
105035
|
+
var makeCampUiSidebarTabs = (context8) => ({
|
|
105036
|
+
render: (viewport) => {
|
|
105037
|
+
const model = context8.readModel();
|
|
105038
|
+
const theme = getSelectListTheme14();
|
|
105039
|
+
const dim = getMarkdownTheme9().codeBlockBorder;
|
|
105040
|
+
const row = CAMP_UI_SIDEBAR_TABS.map(
|
|
105041
|
+
(tab) => tab === model.state.sidebarTab ? theme.selectedText(tab) : dim(tab)
|
|
105042
|
+
).join(dim("\xB7"));
|
|
105043
|
+
const padding = Math.max(0, Math.floor((viewport.width - visibleWidth5(row)) / 2));
|
|
105044
|
+
return [fitCampUiLine(`${" ".repeat(padding)}${row}`, viewport.width)];
|
|
105045
|
+
}
|
|
105046
|
+
});
|
|
105047
|
+
|
|
104903
105048
|
// packages/host-ui/src/pi/layout/campUiDefaultSlots.ts
|
|
104904
105049
|
var makeDefaultCampUiContributions = (tui, detailBlocks) => [
|
|
104905
105050
|
{
|
|
@@ -104932,6 +105077,16 @@ var makeDefaultCampUiContributions = (tui, detailBlocks) => [
|
|
|
104932
105077
|
slotId: CampUiSlot.composer,
|
|
104933
105078
|
mount: (context8) => succeed8(makeCampUiComposerComponent(context8, tui))
|
|
104934
105079
|
},
|
|
105080
|
+
{
|
|
105081
|
+
id: "default-overview",
|
|
105082
|
+
slotId: CampUiSlot.overview,
|
|
105083
|
+
mount: (context8) => succeed8(makeCampUiOverview(context8))
|
|
105084
|
+
},
|
|
105085
|
+
{
|
|
105086
|
+
id: "default-sidebar-tabs",
|
|
105087
|
+
slotId: CampUiSlot.sidebarTabs,
|
|
105088
|
+
mount: (context8) => succeed8(makeCampUiSidebarTabs(context8))
|
|
105089
|
+
},
|
|
104935
105090
|
{
|
|
104936
105091
|
id: "default-footer",
|
|
104937
105092
|
slotId: CampUiSlot.footer,
|
|
@@ -104945,17 +105100,17 @@ var makeDefaultCampUiContributions = (tui, detailBlocks) => [
|
|
|
104945
105100
|
];
|
|
104946
105101
|
|
|
104947
105102
|
// packages/host-ui/src/pi/layout/campUiSection.ts
|
|
104948
|
-
import { getMarkdownTheme as
|
|
104949
|
-
import { visibleWidth as
|
|
105103
|
+
import { getMarkdownTheme as getMarkdownTheme10, getSelectListTheme as getSelectListTheme15 } from "@earendil-works/pi-coding-agent";
|
|
105104
|
+
import { visibleWidth as visibleWidth6 } from "@earendil-works/pi-tui";
|
|
104950
105105
|
var renderHeader = (header, width) => {
|
|
104951
|
-
const theme =
|
|
104952
|
-
const selectTheme =
|
|
105106
|
+
const theme = getMarkdownTheme10();
|
|
105107
|
+
const selectTheme = getSelectListTheme15();
|
|
104953
105108
|
const rule2 = header.focused === true ? selectTheme.selectedPrefix : theme.codeBlockBorder;
|
|
104954
105109
|
const title = header.focused === true ? selectTheme.selectedText : theme.heading;
|
|
104955
105110
|
const ruleCharacter = header.focused === true ? "\u2501" : "\u2500";
|
|
104956
105111
|
const detail = header.detail === void 0 ? "" : ` ${selectTheme.description(header.detail)}`;
|
|
104957
105112
|
const label = `${rule2(ruleCharacter.repeat(2))} ${title(header.title)}${detail} `;
|
|
104958
|
-
const ruleWidth = Math.max(0, width -
|
|
105113
|
+
const ruleWidth = Math.max(0, width - visibleWidth6(label));
|
|
104959
105114
|
return fitCampUiLine(`${label}${rule2(ruleCharacter.repeat(ruleWidth))}`, width);
|
|
104960
105115
|
};
|
|
104961
105116
|
var makeCampUiSection = (options2) => {
|
|
@@ -104988,13 +105143,15 @@ var makeCampUiSection = (options2) => {
|
|
|
104988
105143
|
if (options2.centerContent !== true) {
|
|
104989
105144
|
return [renderHeader(options2.header(), viewport.width), ...body];
|
|
104990
105145
|
}
|
|
104991
|
-
const
|
|
104992
|
-
const padding = Math.max(0, Math.floor((available - body.length) / 2));
|
|
105146
|
+
const padding = Math.max(0, Math.floor((viewport.height - body.length - 1) / 2));
|
|
104993
105147
|
return [
|
|
104994
|
-
renderHeader(options2.header(), viewport.width),
|
|
104995
105148
|
...Array.from({ length: padding }, () => ""),
|
|
105149
|
+
renderHeader(options2.header(), viewport.width),
|
|
104996
105150
|
...body,
|
|
104997
|
-
...Array.from(
|
|
105151
|
+
...Array.from(
|
|
105152
|
+
{ length: Math.max(0, viewport.height - padding - body.length - 1) },
|
|
105153
|
+
() => ""
|
|
105154
|
+
)
|
|
104998
105155
|
].slice(0, viewport.height);
|
|
104999
105156
|
},
|
|
105000
105157
|
...inputComponents ? {
|
|
@@ -105049,9 +105206,20 @@ var decorateDefaultCampUiSections = (context8, slots) => {
|
|
|
105049
105206
|
decorated.set(
|
|
105050
105207
|
CampUiSlot.equipment,
|
|
105051
105208
|
makeCampUiSection({
|
|
105052
|
-
|
|
105209
|
+
/*
|
|
105210
|
+
* The worker's name lives in the section header instead of being repeated
|
|
105211
|
+
* inside: one line saying whose grant this is beats the same name printed
|
|
105212
|
+
* twice within a track that is narrow to begin with.
|
|
105213
|
+
*/
|
|
105214
|
+
header: () => {
|
|
105215
|
+
const model = context8.readModel();
|
|
105216
|
+
const workerId = campUiOpenedWorkerId(model.state);
|
|
105217
|
+
const worker = workerId === void 0 ? void 0 : findCampUiWorker(model.snapshot, workerId);
|
|
105218
|
+
const name = worker?.snapshot.worker.alias ?? workerId?.slice(0, 8);
|
|
105219
|
+
return name === void 0 ? { title: "Equipment" } : { title: "Equipment", detail: name };
|
|
105220
|
+
},
|
|
105053
105221
|
centerContent: true,
|
|
105054
|
-
size:
|
|
105222
|
+
size: defaultCampUiLeftSectionSizes.workers,
|
|
105055
105223
|
children: [
|
|
105056
105224
|
{
|
|
105057
105225
|
component: equipment,
|
|
@@ -105087,7 +105255,7 @@ import { initTheme } from "@earendil-works/pi-coding-agent";
|
|
|
105087
105255
|
import { ProcessTerminal, TUI } from "@earendil-works/pi-tui";
|
|
105088
105256
|
|
|
105089
105257
|
// packages/host-ui/src/pi/piCampUiRoot.ts
|
|
105090
|
-
import { getMarkdownTheme as
|
|
105258
|
+
import { getMarkdownTheme as getMarkdownTheme11 } from "@earendil-works/pi-coding-agent";
|
|
105091
105259
|
import { Key as Key4, matchesKey as matchesKey3 } from "@earendil-works/pi-tui";
|
|
105092
105260
|
|
|
105093
105261
|
// packages/host-ui/src/pi/runtime/campUiPointerInput.ts
|
|
@@ -105216,7 +105384,7 @@ var PiCampUiRoot = class {
|
|
|
105216
105384
|
segments.push({
|
|
105217
105385
|
x: divider.x,
|
|
105218
105386
|
width: 1,
|
|
105219
|
-
text:
|
|
105387
|
+
text: getMarkdownTheme11().codeBlockBorder("\u2502")
|
|
105220
105388
|
});
|
|
105221
105389
|
}
|
|
105222
105390
|
}
|
|
@@ -105263,19 +105431,19 @@ var PiCampUiRoot = class {
|
|
|
105263
105431
|
if (focusedSlotId !== model.state.focusedSlotId) {
|
|
105264
105432
|
this.context.emit(CampUiIntents.FocusSlot({ slotId: focusedSlotId }));
|
|
105265
105433
|
}
|
|
105266
|
-
if (model.state.inventoryVisible && matchesKey3(input, Key4.escape)) {
|
|
105267
|
-
this.context.emit(CampUiIntents.SetInventoryVisible({ visible: false }));
|
|
105268
|
-
return;
|
|
105269
|
-
}
|
|
105270
|
-
if (focusedSlotId !== CampUiSlot.composer && input === "i") {
|
|
105271
|
-
this.context.emit(CampUiIntents.SetInventoryVisible({ visible: true }));
|
|
105272
|
-
return;
|
|
105273
|
-
}
|
|
105274
105434
|
if (this.slots.get(focusedSlotId)?.handleInput?.(input) === true) return;
|
|
105275
105435
|
if (matchesKey3(input, Key4.escape)) {
|
|
105276
105436
|
if (focusedSlotId === CampUiSlot.composer) {
|
|
105277
105437
|
this.context.emit(CampUiIntents.FocusSlot({ slotId: CampUiSlot.transcript }));
|
|
105278
|
-
|
|
105438
|
+
return;
|
|
105439
|
+
}
|
|
105440
|
+
if (model.state.openedWorkerId !== void 0) {
|
|
105441
|
+
this.context.emit(CampUiIntents.CloseWorker());
|
|
105442
|
+
this.context.emit(CampUiIntents.FocusDetailBlock({}));
|
|
105443
|
+
this.context.emit(CampUiIntents.FocusSlot({ slotId: CampUiSlot.roster }));
|
|
105444
|
+
return;
|
|
105445
|
+
}
|
|
105446
|
+
if (model.state.screen === CampUiScreen.worker) {
|
|
105279
105447
|
this.context.emit(CampUiIntents.ActivateScreen({ screen: CampUiScreen.camp }));
|
|
105280
105448
|
this.context.emit(CampUiIntents.FocusDetailBlock({}));
|
|
105281
105449
|
this.context.emit(CampUiIntents.FocusSlot({ slotId: CampUiSlot.roster }));
|
|
@@ -105302,6 +105470,16 @@ var PiCampUiRoot = class {
|
|
|
105302
105470
|
);
|
|
105303
105471
|
return;
|
|
105304
105472
|
}
|
|
105473
|
+
if (focusedSlotId === CampUiSlot.roster || focusedSlotId === CampUiSlot.equipment) {
|
|
105474
|
+
if (matchesKey3(input, Key4.left)) {
|
|
105475
|
+
this.context.emit(CampUiIntents.CycleSidebarTab({ delta: 1 }));
|
|
105476
|
+
return;
|
|
105477
|
+
}
|
|
105478
|
+
if (matchesKey3(input, Key4.right)) {
|
|
105479
|
+
this.context.emit(CampUiIntents.FocusSlot({ slotId: CampUiSlot.transcript }));
|
|
105480
|
+
return;
|
|
105481
|
+
}
|
|
105482
|
+
}
|
|
105305
105483
|
if (focusedSlotId === CampUiSlot.roster) {
|
|
105306
105484
|
const delta = matchesKey3(input, Key4.up) ? -1 : matchesKey3(input, Key4.down) ? 1 : void 0;
|
|
105307
105485
|
if (delta !== void 0) {
|
|
@@ -105316,11 +105494,9 @@ var PiCampUiRoot = class {
|
|
|
105316
105494
|
}
|
|
105317
105495
|
if (matchesKey3(input, Key4.enter) && model.state.selectedWorkerId !== void 0) {
|
|
105318
105496
|
this.context.emit(CampUiIntents.OpenWorker({ workerId: model.state.selectedWorkerId }));
|
|
105319
|
-
this.
|
|
105320
|
-
CampUiIntents.FocusSlot({
|
|
105321
|
-
|
|
105322
|
-
})
|
|
105323
|
-
);
|
|
105497
|
+
if (this.mode !== CampUiLayoutMode.wide) {
|
|
105498
|
+
this.context.emit(CampUiIntents.FocusSlot({ slotId: CampUiSlot.transcript }));
|
|
105499
|
+
}
|
|
105324
105500
|
return;
|
|
105325
105501
|
}
|
|
105326
105502
|
}
|
|
@@ -105534,22 +105710,6 @@ var mountPiCampUi = (options2) => gen2(function* () {
|
|
|
105534
105710
|
);
|
|
105535
105711
|
tui.addChild(root);
|
|
105536
105712
|
tui.setFocus(root);
|
|
105537
|
-
const inventory = slots.get(CampUiSlot.overlay);
|
|
105538
|
-
const inventoryOverlay = inventory === void 0 ? void 0 : tui.showOverlay(
|
|
105539
|
-
{
|
|
105540
|
-
render: (width) => [
|
|
105541
|
-
...inventory.render({ width, height: Math.max(0, terminal.rows) })
|
|
105542
|
-
],
|
|
105543
|
-
invalidate: () => inventory.invalidate?.()
|
|
105544
|
-
},
|
|
105545
|
-
{
|
|
105546
|
-
width: "60%",
|
|
105547
|
-
minWidth: 36,
|
|
105548
|
-
margin: 1,
|
|
105549
|
-
visible: () => current2.state.inventoryVisible,
|
|
105550
|
-
nonCapturing: true
|
|
105551
|
-
}
|
|
105552
|
-
);
|
|
105553
105713
|
yield* sync4(() => {
|
|
105554
105714
|
terminal.setTitle(initial.displayName);
|
|
105555
105715
|
terminal.clearScreen();
|
|
@@ -105566,9 +105726,6 @@ var mountPiCampUi = (options2) => gen2(function* () {
|
|
|
105566
105726
|
)
|
|
105567
105727
|
)
|
|
105568
105728
|
);
|
|
105569
|
-
if (inventoryOverlay !== void 0) {
|
|
105570
|
-
yield* addFinalizer3(() => sync4(() => inventoryOverlay.hide()));
|
|
105571
|
-
}
|
|
105572
105729
|
yield* forkScoped2(
|
|
105573
105730
|
gen2(function* () {
|
|
105574
105731
|
for (let attempt = 0; attempt < 25; attempt += 1) {
|
|
@@ -105646,7 +105803,7 @@ var mountPiCampUi = (options2) => gen2(function* () {
|
|
|
105646
105803
|
});
|
|
105647
105804
|
|
|
105648
105805
|
// packages/host-ui/src/pi/run-selector/campRunSelector.ts
|
|
105649
|
-
import { getMarkdownTheme as
|
|
105806
|
+
import { getMarkdownTheme as getMarkdownTheme12, getSelectListTheme as getSelectListTheme16, initTheme as initTheme2 } from "@earendil-works/pi-coding-agent";
|
|
105650
105807
|
import {
|
|
105651
105808
|
Key as Key5,
|
|
105652
105809
|
matchesKey as matchesKey4,
|