@olares/lares-mobile 0.15.35 → 0.15.36

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@olares/lares-mobile",
3
- "version": "0.15.35",
3
+ "version": "0.15.36",
4
4
  "description": "Lares chat component for LarePass",
5
5
  "type": "module",
6
6
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "vue": "^3.2.0"
29
29
  },
30
30
  "dependencies": {
31
- "@olares/lares-core": "0.15.35",
31
+ "@olares/lares-core": "0.15.36",
32
32
  "markdown-it": "^14.3.0"
33
33
  }
34
34
  }
package/src/App.vue CHANGED
@@ -92,6 +92,7 @@
92
92
  @hold-start="onHoldStart"
93
93
  @voice-action="onVoiceAction"
94
94
  @close-model="modelSheet = false"
95
+ @choose-permission="choosePermission"
95
96
  @choose-model="chooseModel"
96
97
  @close-effort="effortSheet = false"
97
98
  @choose-effort="chooseEffort"
@@ -89,7 +89,7 @@ export default {
89
89
  gap: 8px;
90
90
  flex-shrink: 0;
91
91
  min-height: 56px;
92
- padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
92
+ padding: 8px 12px;
93
93
  }
94
94
 
95
95
  .lares-bar__icon-btn {
@@ -459,7 +459,7 @@ export default {
459
459
  flex-direction: column;
460
460
  gap: 6px;
461
461
  flex-shrink: 0;
462
- padding: 8px 16px calc(12px + env(safe-area-inset-bottom, 0px));
462
+ padding: 8px 16px 12px;
463
463
  }
464
464
 
465
465
  .lares-composer--hero {
@@ -146,7 +146,7 @@ export default {
146
146
  .mobile-directory__status,
147
147
  .mobile-directory__error { margin:16px 8px; color:var(--q-ink-3); font-size:15px; text-align:center; }
148
148
  .mobile-directory__error { color:var(--q-orange-default); }
149
- .mobile-directory__footer { display:flex; flex-direction:column; gap:10px; padding:12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top:1px solid var(--q-separator); }
149
+ .mobile-directory__footer { display:flex; flex-direction:column; gap:10px; padding:12px 20px; border-top:1px solid var(--q-separator); }
150
150
  .mobile-directory__path { width:100%; margin:0; overflow:hidden; color:var(--q-ink-3); font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
151
151
  .mobile-directory__tools { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; }
152
152
  .mobile-directory__new-folder { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--q-separator); border-radius:999px; padding:0 12px; min-height:36px; background:transparent; color:var(--q-ink-2); font:inherit; font-size:14px; }
@@ -85,7 +85,7 @@ export default {
85
85
  display: flex;
86
86
  width: 100%;
87
87
  flex-direction: column;
88
- padding: 8px 16px calc(12px + env(safe-area-inset-bottom, 0px));
88
+ padding: 8px 16px 12px;
89
89
  }
90
90
 
91
91
  .mobile-new-session__composer {
@@ -212,6 +212,33 @@
212
212
  @click="$emit('choose-effort', row.id)"
213
213
  />
214
214
  </template>
215
+ <template v-if="state.permissionRows.length">
216
+ <p class="lares-shell__heading">{{ t("permission.title") }}</p>
217
+ <LaresSettingRow
218
+ v-for="row in state.permissionRows"
219
+ :key="row.value"
220
+ :label="row.label"
221
+ :hint="row.hint"
222
+ :checked="row.value === state.permissionCurrent"
223
+ :disabled="state.permissionBusy"
224
+ @click="pickPermission(row.value)"
225
+ />
226
+ <div v-if="accessConfirm" class="lares-shell__access">
227
+ <p>{{ t("access.confirm.description") }}</p>
228
+ <label>
229
+ <input v-model="accessAcknowledged" type="checkbox" />
230
+ <span>{{ t("access.confirm.acknowledge") }}</span>
231
+ </label>
232
+ <div class="lares-shell__access-actions">
233
+ <button type="button" @click="cancelAccess">{{ t("access.confirm.cancel") }}</button>
234
+ <button
235
+ type="button"
236
+ :disabled="!accessAcknowledged || state.permissionBusy"
237
+ @click="confirmAccess"
238
+ >{{ t("access.confirm.enable") }}</button>
239
+ </div>
240
+ </div>
241
+ </template>
215
242
  <template #footer>
216
243
  <button type="button" class="lares-shell__refresh" @click="state.refreshModels()">{{ t('agent.refresh') }}</button>
217
244
  </template>
@@ -280,7 +307,7 @@ export default {
280
307
  "history", "create", "toggle-speak", "close-history", "pick-session", "retry", "open-file",
281
308
  "answer", "answer-approval", "update-draft", "send", "queue-action", "open-model", "open-effort", "files",
282
309
  "voice", "voice-action", "hold-start", "hold-end", "close-model", "choose-model",
283
- "close-effort", "choose-effort", "close-preview",
310
+ "close-effort", "choose-effort", "choose-permission", "close-preview",
284
311
  "open-commands", "open-references", "pick-command", "remove-image",
285
312
  "refresh-workspaces", "browse-workspaces", "browse-directory",
286
313
  "close-directory", "choose-directory", "create-folder", "toggle-hidden",
@@ -289,7 +316,12 @@ export default {
289
316
  "dismiss-speak",
290
317
  ],
291
318
  data() {
292
- return { composerMode: "text" };
319
+ return { composerMode: "text", accessConfirm: false, accessAcknowledged: false };
320
+ },
321
+ watch: {
322
+ "state.modelSheet"(open) {
323
+ if (!open) this.cancelAccess();
324
+ },
293
325
  },
294
326
  computed: {
295
327
  newSessionHero() {
@@ -307,6 +339,25 @@ export default {
307
339
  },
308
340
  },
309
341
  methods: {
342
+ pickPermission(value) {
343
+ if (!value || value === this.state.permissionCurrent || this.state.permissionBusy) return;
344
+ if (value === "danger-full-access") {
345
+ this.accessAcknowledged = false;
346
+ this.accessConfirm = true;
347
+ return;
348
+ }
349
+ this.cancelAccess();
350
+ this.$emit("choose-permission", value);
351
+ },
352
+ cancelAccess() {
353
+ this.accessConfirm = false;
354
+ this.accessAcknowledged = false;
355
+ },
356
+ confirmAccess() {
357
+ if (!this.accessAcknowledged || this.state.permissionBusy) return;
358
+ this.cancelAccess();
359
+ this.$emit("choose-permission", "danger-full-access");
360
+ },
310
361
  forwardAnswer(label, row) {
311
362
  this.$emit("answer", label, row);
312
363
  },
@@ -349,7 +400,7 @@ export default {
349
400
 
350
401
  .lares-mobile-shell__approval {
351
402
  flex: none;
352
- margin: 0 16px calc(12px + env(safe-area-inset-bottom, 0px));
403
+ margin: 0 16px 12px;
353
404
  }
354
405
 
355
406
  .lares-shell__status,
@@ -434,4 +485,60 @@ export default {
434
485
  font-weight: 500;
435
486
  line-height: 18px;
436
487
  }
488
+
489
+ .lares-shell__access {
490
+ display: flex;
491
+ flex-direction: column;
492
+ gap: 12px;
493
+ margin: 8px 16px 16px;
494
+ padding: 12px;
495
+ border-radius: 12px;
496
+ background: var(--q-background-3);
497
+ color: var(--q-ink-2);
498
+ font-size: 14px;
499
+ line-height: 20px;
500
+ }
501
+
502
+ .lares-shell__access p {
503
+ margin: 0;
504
+ }
505
+
506
+ .lares-shell__access label {
507
+ display: flex;
508
+ align-items: flex-start;
509
+ gap: 8px;
510
+ }
511
+
512
+ .lares-shell__access input {
513
+ width: 18px;
514
+ height: 18px;
515
+ flex: none;
516
+ margin: 1px 0 0;
517
+ }
518
+
519
+ .lares-shell__access-actions {
520
+ display: flex;
521
+ justify-content: flex-end;
522
+ gap: 8px;
523
+ }
524
+
525
+ .lares-shell__access-actions button {
526
+ border: 0;
527
+ border-radius: 8px;
528
+ padding: 8px 12px;
529
+ background: transparent;
530
+ color: var(--q-ink-2);
531
+ font: inherit;
532
+ font-size: 14px;
533
+ font-weight: 600;
534
+ }
535
+
536
+ .lares-shell__access-actions button:last-child {
537
+ background: var(--q-blue-alpha);
538
+ color: var(--q-blue-default);
539
+ }
540
+
541
+ .lares-shell__access-actions button:disabled {
542
+ opacity: 0.45;
543
+ }
437
544
  </style>
@@ -6,7 +6,10 @@
6
6
  :disabled="disabled"
7
7
  @click="$emit('click')"
8
8
  >
9
- <span class="lares-set-row__label">{{ label }}</span>
9
+ <span class="lares-set-row__copy">
10
+ <span class="lares-set-row__label">{{ label }}</span>
11
+ <span v-if="hint" class="lares-set-row__hint">{{ hint }}</span>
12
+ </span>
10
13
  <span class="lares-set-row__side">
11
14
  <span v-if="value" class="lares-set-row__value">{{ value }}</span>
12
15
  <svg v-if="chevron" class="lares-set-row__icon" viewBox="0 0 24 24" aria-hidden="true">
@@ -29,6 +32,7 @@ export default {
29
32
  name: "LaresSettingRow",
30
33
  props: {
31
34
  label: { type: String, required: true },
35
+ hint: { type: String, default: "" },
32
36
  value: { type: String, default: "" },
33
37
  chevron: { type: Boolean, default: false },
34
38
  checked: { type: Boolean, default: false },
@@ -73,14 +77,28 @@ export default {
73
77
  background: var(--q-background-hover);
74
78
  }
75
79
 
76
- .lares-set-row__label {
80
+ .lares-set-row__copy {
81
+ display: flex;
77
82
  min-width: 0;
78
83
  flex: 1;
84
+ flex-direction: column;
85
+ gap: 2px;
86
+ }
87
+
88
+ .lares-set-row__label {
89
+ min-width: 0;
79
90
  font-size: 16px;
80
91
  line-height: 22px;
81
92
  word-break: break-word;
82
93
  }
83
94
 
95
+ .lares-set-row__hint {
96
+ color: var(--q-ink-3);
97
+ font-size: 13px;
98
+ line-height: 18px;
99
+ word-break: break-word;
100
+ }
101
+
84
102
  .lares-set-row__side {
85
103
  display: flex;
86
104
  flex-shrink: 0;