forkit-connect 0.1.1 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +83 -36
- package/dist/launcher.js +1451 -15
- package/dist/v1/credential-store.js +3 -0
- package/dist/v1/service.d.ts +2 -0
- package/dist/v1/service.js +32 -15
- package/package.json +8 -8
package/dist/cli.js
CHANGED
|
@@ -78,6 +78,7 @@ const PUBLIC_COMMANDS = [
|
|
|
78
78
|
['inbox', 'Review the Smart Registration Inbox'],
|
|
79
79
|
['sync', 'Flush queued drafts and lifecycle metadata'],
|
|
80
80
|
['workspace', 'List, select, or inspect optional governed workspace/project scope'],
|
|
81
|
+
['runtime', 'Review local runtime discovery and runtime health'],
|
|
81
82
|
['register', 'Register ready local models into the current scope'],
|
|
82
83
|
['ignore', 'Ignore one detected local model'],
|
|
83
84
|
['doctor', 'Run local environment diagnostics'],
|
|
@@ -105,11 +106,12 @@ const ADVANCED_COMMAND_GROUPS = [
|
|
|
105
106
|
['notify', 'Notification preview and delivery controls'],
|
|
106
107
|
];
|
|
107
108
|
function usage() {
|
|
108
|
-
console.log('Usage: forkit-connect <init|login|logout|status|changes|start|stop|scan|inbox|sync|workspace|register|ignore|doctor> [options]');
|
|
109
|
+
console.log('Usage: forkit-connect <init|login|logout|status|changes|start|stop|scan|inbox|sync|workspace|runtime|register|ignore|doctor> [options]');
|
|
109
110
|
console.log(' forkit-connect workspace <list|select|create|status> [options]');
|
|
111
|
+
console.log(' forkit-connect runtime <review|status> [options]');
|
|
110
112
|
console.log('Public commands:');
|
|
111
113
|
for (const [command, description] of PUBLIC_COMMANDS) {
|
|
112
|
-
console.log(` ${command.padEnd(
|
|
114
|
+
console.log(` ${command.padEnd(10)} ${description}`);
|
|
113
115
|
}
|
|
114
116
|
console.log('Options:');
|
|
115
117
|
console.log(' --description <text> Optional workspace description used by workspace create');
|
|
@@ -161,6 +163,15 @@ function advancedUsage() {
|
|
|
161
163
|
console.log(' --service-name <name> Service/agent/workflow label used by c2 run-log emit');
|
|
162
164
|
console.log(' --prompt-tokens <n> Prompt tokens used by c2 run-log emit');
|
|
163
165
|
console.log(' --completion-tokens <n> Completion tokens used by c2 run-log emit');
|
|
166
|
+
console.log(' --client-name <name> Optional repo/runtime client label used by c2 run-log emit');
|
|
167
|
+
console.log(' --actor-labels <csv> Actor labels used by c2 run-log emit (for example: Codex,Claude)');
|
|
168
|
+
console.log(' --task-labels <csv> Task or chat labels used by c2 run-log emit');
|
|
169
|
+
console.log(' --folder-labels <csv> Relative folder labels used by c2 run-log emit');
|
|
170
|
+
console.log(' --file-labels <csv> Relative file labels used by c2 run-log emit');
|
|
171
|
+
console.log(' --model-labels <csv> Optional model labels used by c2 run-log emit');
|
|
172
|
+
console.log(' --cpu-percent <n> Scoped CPU percentage used by c2 run-log emit');
|
|
173
|
+
console.log(' --memory-mb <n> Scoped memory usage used by c2 run-log emit');
|
|
174
|
+
console.log(' --vram-mb <n> Device VRAM usage used by c2 run-log emit');
|
|
164
175
|
console.log(' --draft-only Allow draft creation even when governed publish capacity is full');
|
|
165
176
|
}
|
|
166
177
|
function showUsage() {
|
|
@@ -1118,22 +1129,24 @@ function printAgentLedger(summary) {
|
|
|
1118
1129
|
console.log(JSON.stringify(summary, null, 2));
|
|
1119
1130
|
}
|
|
1120
1131
|
function printRuntimeReview(summary) {
|
|
1121
|
-
console.log(
|
|
1132
|
+
console.log('[forkit-connect] Runtime review');
|
|
1133
|
+
console.log(`- runtimes=${summary.total_runtimes}`);
|
|
1122
1134
|
for (const runtime of summary.runtimes) {
|
|
1123
|
-
console.log(`-
|
|
1135
|
+
console.log(`- ${runtime.runtime_name} | ${runtime.status} | linked models=${runtime.linked_models_count} | linked agents=${runtime.linked_agents_count} | health=${runtime.health_status} | next=${runtime.recommended_action}`);
|
|
1124
1136
|
}
|
|
1125
1137
|
}
|
|
1126
1138
|
function printRuntimeStatus(status) {
|
|
1127
|
-
console.log(
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1139
|
+
console.log('[forkit-connect] Runtime status');
|
|
1140
|
+
console.log(`- total=${status.total_runtimes}`);
|
|
1141
|
+
console.log(`- online=${status.online_runtimes}`);
|
|
1142
|
+
console.log(`- offline=${status.offline_runtimes}`);
|
|
1143
|
+
console.log(`- linked=${status.linked_runtimes}`);
|
|
1144
|
+
console.log(`- unlinked=${status.unlinked_runtimes}`);
|
|
1145
|
+
console.log(`- needs attention=${status.unhealthy_runtimes}`);
|
|
1146
|
+
console.log(`- pending runtime sync=${status.c2_pending_count}`);
|
|
1147
|
+
if (status.latest_runtime_lifecycle_event) {
|
|
1148
|
+
console.log(`- latest event=${status.latest_runtime_lifecycle_event}`);
|
|
1149
|
+
}
|
|
1137
1150
|
}
|
|
1138
1151
|
function formatSmartInboxActionValue(action, itemType, connectableModelName) {
|
|
1139
1152
|
switch (action) {
|
|
@@ -1209,18 +1222,14 @@ function printConnectStatusOverview(status) {
|
|
|
1209
1222
|
}
|
|
1210
1223
|
function printPublicStatusOverview(status) {
|
|
1211
1224
|
console.log('[forkit-connect] Status');
|
|
1212
|
-
console.log(`-
|
|
1213
|
-
console.log(`-
|
|
1214
|
-
console.log(`- project=${status.project_id || 'not selected'}`);
|
|
1225
|
+
console.log(`- device=${status.device_paired ? 'paired' : 'approval pending'}`);
|
|
1226
|
+
console.log(`- scope=${status.workspace_id && status.project_id ? `${status.workspace_id} / ${status.project_id}` : 'not selected'}`);
|
|
1215
1227
|
console.log(`- daemon=${status.daemon_status}`);
|
|
1216
|
-
console.log(`-
|
|
1217
|
-
console.log(`-
|
|
1218
|
-
console.log(`-
|
|
1219
|
-
console.log(`-
|
|
1220
|
-
console.log(`-
|
|
1221
|
-
console.log(`- connected=${status.connected_count}`);
|
|
1222
|
-
console.log(`- c2_sync_pending=${status.c2_sync_pending}`);
|
|
1223
|
-
console.log(`- privacy_mode=${status.privacy_mode}`);
|
|
1228
|
+
console.log(`- local inventory=models ${status.models_discovered} · agents ${status.agents_discovered} · runtimes ${status.runtimes_discovered}`);
|
|
1229
|
+
console.log(`- review queue=ready ${status.ready_to_connect_count} · needs review ${status.needs_confirmation_count}`);
|
|
1230
|
+
console.log(`- connected records=${status.connected_count}`);
|
|
1231
|
+
console.log(`- pending runtime sync=${status.c2_sync_pending}`);
|
|
1232
|
+
console.log(`- privacy=${status.privacy_mode}`);
|
|
1224
1233
|
if (status.lifecycle_note) {
|
|
1225
1234
|
console.log(`- note=${status.lifecycle_note}`);
|
|
1226
1235
|
}
|
|
@@ -1229,6 +1238,14 @@ function printPublicStatusOverview(status) {
|
|
|
1229
1238
|
}
|
|
1230
1239
|
}
|
|
1231
1240
|
function printPublicStatusGuidance(status, sessionState) {
|
|
1241
|
+
const accountLabel = sessionState === 'authorized'
|
|
1242
|
+
? 'connected'
|
|
1243
|
+
: sessionState === 'expired'
|
|
1244
|
+
? 'expired'
|
|
1245
|
+
: sessionState === 'unavailable'
|
|
1246
|
+
? 'unverified'
|
|
1247
|
+
: 'login required';
|
|
1248
|
+
console.log(`- account=${accountLabel}`);
|
|
1232
1249
|
if (sessionState === 'missing') {
|
|
1233
1250
|
console.log('- note=Local discovery is working. Sign in next to pair this device with your Forkit.dev account.');
|
|
1234
1251
|
console.log('- next=run forkit-connect login');
|
|
@@ -1525,14 +1542,9 @@ async function run() {
|
|
|
1525
1542
|
return;
|
|
1526
1543
|
}
|
|
1527
1544
|
printPublicStatusOverview(displayOverview);
|
|
1528
|
-
console.log(`-
|
|
1529
|
-
console.log(`- binding_truth=${accountTrusted ? 'account_binding_active' : 'account_login_required'}`);
|
|
1530
|
-
console.log(`- secure_storage_backend=${secureStorage.backend} available=${secureStorage.available} plaintext_fallback=${secureStorage.plaintextFallbackActive}`);
|
|
1545
|
+
console.log(`- secure storage=${secureStorage.backend}`);
|
|
1531
1546
|
if (!secureStorage.available || secureStorage.plaintextFallbackActive) {
|
|
1532
|
-
console.log(`-
|
|
1533
|
-
}
|
|
1534
|
-
if (!accountTrusted && localScopeCached) {
|
|
1535
|
-
console.log('- local_scope_cached=true');
|
|
1547
|
+
console.log(`- secure storage detail=${secureStorage.detail}`);
|
|
1536
1548
|
}
|
|
1537
1549
|
printPublicStatusGuidance(displayOverview, sessionState);
|
|
1538
1550
|
};
|
|
@@ -3596,6 +3608,30 @@ async function run() {
|
|
|
3596
3608
|
await runPublicSync();
|
|
3597
3609
|
return;
|
|
3598
3610
|
}
|
|
3611
|
+
if (command === 'runtime') {
|
|
3612
|
+
const subcommand = args[1] || 'review';
|
|
3613
|
+
if (subcommand === 'review') {
|
|
3614
|
+
const summary = service.getRuntimePassportReview();
|
|
3615
|
+
if (hasFlag('--json')) {
|
|
3616
|
+
printJson(summary);
|
|
3617
|
+
return;
|
|
3618
|
+
}
|
|
3619
|
+
printRuntimeReview(summary);
|
|
3620
|
+
return;
|
|
3621
|
+
}
|
|
3622
|
+
if (subcommand === 'status') {
|
|
3623
|
+
const status = service.getRuntimePassportStatus();
|
|
3624
|
+
if (hasFlag('--json')) {
|
|
3625
|
+
printJson(status);
|
|
3626
|
+
return;
|
|
3627
|
+
}
|
|
3628
|
+
printRuntimeStatus(status);
|
|
3629
|
+
return;
|
|
3630
|
+
}
|
|
3631
|
+
console.error('Usage: forkit-connect runtime <review|status>');
|
|
3632
|
+
process.exitCode = 2;
|
|
3633
|
+
return;
|
|
3634
|
+
}
|
|
3599
3635
|
if (command === 'workspace') {
|
|
3600
3636
|
const subcommand = args[1] || 'status';
|
|
3601
3637
|
try {
|
|
@@ -3703,12 +3739,23 @@ async function run() {
|
|
|
3703
3739
|
return;
|
|
3704
3740
|
}
|
|
3705
3741
|
if (subcommand === 'runtime') {
|
|
3706
|
-
|
|
3707
|
-
|
|
3742
|
+
const runtimeSubcommand = args[2] || 'review';
|
|
3743
|
+
if (runtimeSubcommand === 'review') {
|
|
3744
|
+
const summary = service.getRuntimePassportReview();
|
|
3745
|
+
if (hasFlag('--json')) {
|
|
3746
|
+
printJson(summary);
|
|
3747
|
+
return;
|
|
3748
|
+
}
|
|
3749
|
+
printRuntimeReview(summary);
|
|
3708
3750
|
return;
|
|
3709
3751
|
}
|
|
3710
|
-
if (
|
|
3711
|
-
|
|
3752
|
+
if (runtimeSubcommand === 'status') {
|
|
3753
|
+
const status = service.getRuntimePassportStatus();
|
|
3754
|
+
if (hasFlag('--json')) {
|
|
3755
|
+
printJson(status);
|
|
3756
|
+
return;
|
|
3757
|
+
}
|
|
3758
|
+
printRuntimeStatus(status);
|
|
3712
3759
|
return;
|
|
3713
3760
|
}
|
|
3714
3761
|
console.error('Usage: forkit-connect connect runtime <review|status>');
|