josephrw commited on
Commit
ae03498
Β·
verified Β·
1 Parent(s): 31c3bff

Upload static/index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. static/index.html +42 -0
static/index.html CHANGED
@@ -1163,6 +1163,7 @@
1163
 
1164
  // ─── Microspaces & Terminal ───────────────────────────────
1165
  let _appsCache = [];
 
1166
 
1167
  function switchView(view) {
1168
  $('deployView').style.display = view === 'deploy' ? 'block' : 'none';
@@ -1338,12 +1339,53 @@
1338
  const parts = cmd.split(/\s+/);
1339
  const action = parts[0].toLowerCase();
1340
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1341
  if (action === 'help' || action === 'h') {
1342
  termPrint('Commands:', 'info');
1343
  termPrint(' help Show this message');
1344
  termPrint(' apps List all apps with previews');
1345
  termPrint(' open <id> Open app preview URL');
1346
  termPrint(' launch <id> Launch app in new tab');
 
 
 
 
 
1347
  termPrint(' status Server status');
1348
  termPrint(' clear Clear terminal');
1349
  termPrint(' reload Reload app list');
 
1163
 
1164
  // ─── Microspaces & Terminal ───────────────────────────────
1165
  let _appsCache = [];
1166
+ let _kvStore = {};
1167
 
1168
  function switchView(view) {
1169
  $('deployView').style.display = view === 'deploy' ? 'block' : 'none';
 
1339
  const parts = cmd.split(/\s+/);
1340
  const action = parts[0].toLowerCase();
1341
 
1342
+ // ─── KV Memory (session-only, per-tab) ──────────────────
1343
+ if (action === 'set') {
1344
+ if (parts.length < 3) { termPrint('Usage: set <key> <value>', 'err'); return; }
1345
+ const key = parts[1]; const val = parts.slice(2).join(' ');
1346
+ if (!_kvStore) _kvStore = {};
1347
+ _kvStore[key] = val;
1348
+ termPrint(`Set "${key}" = "${val}"`, 'success');
1349
+ return;
1350
+ }
1351
+ if (action === 'get') {
1352
+ if (parts.length < 2) { termPrint('Usage: get <key>', 'err'); return; }
1353
+ const val = _kvStore?.[parts[1]];
1354
+ if (val === undefined) termPrint(`Key "${parts[1]}" not found.`, 'warn');
1355
+ else termPrint(`${parts[1]} = ${val}`, 'info');
1356
+ return;
1357
+ }
1358
+ if (action === 'del') {
1359
+ if (parts.length < 2) { termPrint('Usage: del <key>', 'err'); return; }
1360
+ if (_kvStore) delete _kvStore[parts[1]];
1361
+ termPrint(`Deleted "${parts[1]}"`, 'success');
1362
+ return;
1363
+ }
1364
+ if (action === 'keys') {
1365
+ const keys = _kvStore ? Object.keys(_kvStore) : [];
1366
+ if (!keys.length) { termPrint('No KV entries.', 'warn'); return; }
1367
+ termPrint('KV Keys:', 'info');
1368
+ keys.forEach(k => termPrint(` ${k} = ${_kvStore[k]}`, 'muted'));
1369
+ termPrint(`${keys.length} entries.`);
1370
+ return;
1371
+ }
1372
+ if (action === 'clear_kv') {
1373
+ _kvStore = {};
1374
+ termPrint('KV memory cleared.', 'success');
1375
+ return;
1376
+ }
1377
+
1378
  if (action === 'help' || action === 'h') {
1379
  termPrint('Commands:', 'info');
1380
  termPrint(' help Show this message');
1381
  termPrint(' apps List all apps with previews');
1382
  termPrint(' open <id> Open app preview URL');
1383
  termPrint(' launch <id> Launch app in new tab');
1384
+ termPrint(' set <k> <v> Store KV pair (session)');
1385
+ termPrint(' get <k> Retrieve KV value');
1386
+ termPrint(' del <k> Delete KV pair');
1387
+ termPrint(' keys List all KV keys');
1388
+ termPrint(' clear_kv Clear KV memory');
1389
  termPrint(' status Server status');
1390
  termPrint(' clear Clear terminal');
1391
  termPrint(' reload Reload app list');