@agimon-ai/po-native 0.0.1-alpha.41 → 0.0.1-alpha.42

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": "@agimon-ai/po-native",
3
- "version": "0.0.1-alpha.41",
3
+ "version": "0.0.1-alpha.42",
4
4
  "description": "Po for iOS and Android",
5
5
  "homepage": "https://agimon.ai",
6
6
  "bugs": {
@@ -29,17 +29,17 @@
29
29
  "access": "public"
30
30
  },
31
31
  "dependencies": {
32
- "@agimon-ai/po-core": "0.0.0-alpha.161",
33
- "@agimon-ai/po-expo-signing": "0.0.1-alpha.41",
34
- "@agimon-ai/po-identity": "0.0.2-alpha.108",
35
- "@agimon-ai/po-native-components": "0.0.0-alpha.161",
36
- "@agimon-ai/po-native-dashboard": "0.0.0-alpha.33",
37
- "@agimon-ai/po-template-advanced": "0.0.0-alpha.161",
38
- "@agimon-ai/po-template-elegant": "0.0.0-alpha.161",
39
- "@agimon-ai/po-voice": "0.0.0-alpha.161",
40
- "@agimon-ai/po-web-components": "0.0.0-alpha.161",
41
- "@agimon-ai/po-web-dashboard": "0.0.0-alpha.161",
42
- "@agimon-ai/po-web-security": "0.0.0-alpha.161",
32
+ "@agimon-ai/po-core": "0.0.0-alpha.162",
33
+ "@agimon-ai/po-expo-signing": "0.0.1-alpha.42",
34
+ "@agimon-ai/po-identity": "0.0.2-alpha.109",
35
+ "@agimon-ai/po-native-components": "0.0.0-alpha.162",
36
+ "@agimon-ai/po-native-dashboard": "0.0.0-alpha.34",
37
+ "@agimon-ai/po-template-advanced": "0.0.0-alpha.162",
38
+ "@agimon-ai/po-template-elegant": "0.0.0-alpha.162",
39
+ "@agimon-ai/po-voice": "0.0.0-alpha.162",
40
+ "@agimon-ai/po-web-components": "0.0.0-alpha.162",
41
+ "@agimon-ai/po-web-dashboard": "0.0.0-alpha.162",
42
+ "@agimon-ai/po-web-security": "0.0.0-alpha.162",
43
43
  "@better-auth/expo": "1.7.12",
44
44
  "@config-plugins/react-native-webrtc": "15.0.2",
45
45
  "@earendil-works/chord": "1.5.1",
@@ -1,12 +1,14 @@
1
- import { PoNativeProvider, Sheet, SheetContent } from '@agimon-ai/po-native-components';
1
+ import { Select, Sheet, SheetContent } from '@agimon-ai/po-native-components';
2
2
  import { useState } from 'react';
3
- import { UnistylesRuntime } from 'react-native-unistyles';
4
3
 
4
+ import { type DesignScheme, PhoneFrame } from '../screens/designFrame';
5
5
  import { CoordinatorNewProfileView, CoordinatorProfileSheetView } from './SessionSheets';
6
6
 
7
+ // Dark and ProfilePicker match the approved targets in tmp/design-evidence/native-create-bot-2026-11-16.
8
+ // Runtime code never imports this file.
7
9
  export const meta = {
8
10
  title: 'Native/Design/Coordinator profile',
9
- component: CoordinatorProfileSheetView,
11
+ component: Preview,
10
12
  tags: ['style-system', 'mockup', 'native'],
11
13
  };
12
14
  export default meta;
@@ -16,15 +18,13 @@ function Preview({
16
18
  scheme = 'light',
17
19
  state = 'ready',
18
20
  }: {
19
- scheme?: 'light' | 'dark';
21
+ scheme?: DesignScheme;
20
22
  state?: 'ready' | 'loading' | 'empty' | 'error' | 'coordinator' | 'coordinator-taken';
21
23
  }) {
22
- UnistylesRuntime.setAdaptiveThemes(false);
23
- UnistylesRuntime.setTheme(scheme);
24
- const [profile, setProfile] = useState<string>();
24
+ const [profile, setProfile] = useState<string | undefined>(state === 'empty' ? undefined : 'ponytail');
25
25
  const [actAsCoordinator, setActAsCoordinator] = useState(state === 'coordinator');
26
26
  return (
27
- <PoNativeProvider>
27
+ <PhoneFrame scheme={scheme}>
28
28
  <Sheet open>
29
29
  <SheetContent>
30
30
  <CoordinatorProfileSheetView
@@ -37,48 +37,76 @@ function Preview({
37
37
  {...(state === 'coordinator-taken' ? { coordinatorBlocked: 'Home already has a coordinator.' } : {})}
38
38
  catalog={{
39
39
  readiness: 'ready',
40
- profiles:
41
- state === 'empty'
42
- ? []
43
- : [
44
- {
45
- name: 'Calm planner',
46
- sourceId: FILE_PROFILE_SOURCE,
47
- },
48
- { name: 'Careful reviewer', sourceId: FILE_PROFILE_SOURCE },
49
- ],
40
+ profiles: state === 'empty' ? [] : PROFILES,
50
41
  }}
51
42
  error={state === 'error' ? 'This computer is unavailable. Your profile choice is kept.' : ''}
52
43
  onReload={() => {}}
53
44
  onNewProfile={() => {}}
54
45
  onCreate={() => {}}
55
- onClose={() => {}}
56
46
  />
57
47
  </SheetContent>
58
48
  </Sheet>
59
- </PoNativeProvider>
49
+ </PhoneFrame>
60
50
  );
61
51
  }
62
52
 
63
- export const Playground = () => <Preview />;
64
- export const Light = () => <Preview />;
65
- export const Dark = () => <Preview scheme="dark" />;
66
- export const Loading = () => <Preview state="loading" />;
67
- export const Empty = () => <Preview state="empty" />;
68
- export const Failure = () => <Preview state="error" />;
69
- export const ActAsCoordinator = () => <Preview state="coordinator" />;
70
- export const CoordinatorTaken = () => <Preview state="coordinator-taken" />;
53
+ export const Playground = { render: () => <Preview /> };
54
+ export const Light = { render: () => <Preview /> };
55
+ export const Dark = { render: () => <Preview scheme="dark" /> };
56
+ export const Loading = { render: () => <Preview state="loading" /> };
57
+ export const Empty = { render: () => <Preview state="empty" /> };
58
+ export const Failure = { render: () => <Preview state="error" /> };
59
+ export const ActAsCoordinator = { render: () => <Preview state="coordinator" /> };
60
+ export const CoordinatorTaken = { render: () => <Preview state="coordinator-taken" /> };
71
61
 
72
- function NewProfilePreview({ scheme = 'light' }: { scheme?: 'light' | 'dark' }) {
73
- UnistylesRuntime.setAdaptiveThemes(false);
74
- UnistylesRuntime.setTheme(scheme);
62
+ const PROFILE_NAMES = [
63
+ 'Ponytail',
64
+ 'Po',
65
+ 'Designer',
66
+ 'Reviewer',
67
+ 'Researcher',
68
+ 'Writer',
69
+ 'Ops',
70
+ 'Tester',
71
+ 'Planner',
72
+ 'Translator',
73
+ 'Analyst',
74
+ ];
75
+ const PROFILES = PROFILE_NAMES.map((name) => ({
76
+ name: name.toLowerCase(),
77
+ identity: { name },
78
+ sourceId: FILE_PROFILE_SOURCE,
79
+ }));
80
+
81
+ function PickerPreview({ scheme = 'dark' }: { scheme?: DesignScheme }) {
82
+ const [profile, setProfile] = useState('ponytail');
83
+ return (
84
+ <PhoneFrame scheme={scheme}>
85
+ <Select
86
+ title="Profile"
87
+ searchPlaceholder="Search profiles"
88
+ avatars
89
+ defaultOpen
90
+ onRefresh={() => {}}
91
+ value={profile}
92
+ onValueChange={setProfile}
93
+ options={PROFILES.map((item) => ({ value: item.name, label: item.identity.name }))}
94
+ />
95
+ </PhoneFrame>
96
+ );
97
+ }
98
+
99
+ export const ProfilePicker = { render: () => <PickerPreview /> };
100
+ export const ProfilePickerLight = { render: () => <PickerPreview scheme="light" /> };
101
+
102
+ function NewProfilePreview({ scheme = 'light' }: { scheme?: DesignScheme }) {
75
103
  const [value, setValue] = useState<Parameters<typeof CoordinatorNewProfileView>[0]['value']>({
76
104
  displayName: 'Calm planner',
77
105
  alias: 'calm-planner',
78
106
  preset: 'focused',
79
107
  });
80
108
  return (
81
- <PoNativeProvider>
109
+ <PhoneFrame scheme={scheme}>
82
110
  <Sheet open>
83
111
  <SheetContent>
84
112
  <CoordinatorNewProfileView
@@ -91,9 +119,9 @@ function NewProfilePreview({ scheme = 'light' }: { scheme?: 'light' | 'dark' })
91
119
  />
92
120
  </SheetContent>
93
121
  </Sheet>
94
- </PoNativeProvider>
122
+ </PhoneFrame>
95
123
  );
96
124
  }
97
125
 
98
- export const NewProfile = () => <NewProfilePreview />;
99
- export const NewProfileDark = () => <NewProfilePreview scheme="dark" />;
126
+ export const NewProfile = { render: () => <NewProfilePreview /> };
127
+ export const NewProfileDark = { render: () => <NewProfilePreview scheme="dark" /> };
@@ -4,10 +4,13 @@ import {
4
4
  Input,
5
5
  Label,
6
6
  ListRow,
7
+ Panel,
8
+ PlusIcon,
7
9
  Select,
8
10
  Sheet,
9
11
  SheetBody,
10
12
  SheetContent,
13
+ SheetDescription,
11
14
  SheetHeader,
12
15
  SheetTitle,
13
16
  Switch,
@@ -16,6 +19,7 @@ import { HOST_SLOTS, workspaceSlotFills } from '@agimon-ai/po-web-dashboard/core
16
19
  import type { PiSessionHistoryItem } from '@agimon-ai/po-web-dashboard/types';
17
20
  import { createElement, useEffect, useState } from 'react';
18
21
  import { Text, View } from 'react-native';
22
+ import { StyleSheet } from 'react-native-unistyles';
19
23
 
20
24
  import {
21
25
  coordinatorProfiles,
@@ -237,7 +241,6 @@ function CoordinatorProfileForm({
237
241
  setError('');
238
242
  }}
239
243
  onCreate={() => void create()}
240
- onClose={onClose}
241
244
  />
242
245
  );
243
246
  }
@@ -272,7 +275,7 @@ export function CoordinatorNewProfileView({
272
275
  <SheetTitle>Create profile</SheetTitle>
273
276
  </SheetHeader>
274
277
  <SheetBody style={styles.body}>
275
- <Text style={styles.root}>Choose a name and how Po works with you.</Text>
278
+ <SheetDescription>Choose a name and how Po works with you.</SheetDescription>
276
279
  <View style={styles.field}>
277
280
  <Label>Name</Label>
278
281
  <Input
@@ -326,7 +329,7 @@ export function CoordinatorNewProfileView({
326
329
  );
327
330
  }
328
331
 
329
- /** Deterministic composition shared by the recovery flow and its unapproved design stories. */
332
+ /** Deterministic composition shared by the recovery flow and its design stories. The header's close dismisses it. */
330
333
  export function CoordinatorProfileSheetView({
331
334
  catalog,
332
335
  loading,
@@ -340,7 +343,6 @@ export function CoordinatorProfileSheetView({
340
343
  onReload,
341
344
  onNewProfile,
342
345
  onCreate,
343
- onClose,
344
346
  }: {
345
347
  catalog?: LaunchProfileCatalog;
346
348
  loading: boolean;
@@ -354,54 +356,66 @@ export function CoordinatorProfileSheetView({
354
356
  onReload: () => void;
355
357
  onNewProfile: () => void;
356
358
  onCreate: () => void;
357
- onClose: () => void;
358
359
  }) {
360
+ const status = loading
361
+ ? 'Loading profiles…'
362
+ : !catalog || catalog.readiness === 'unavailable'
363
+ ? 'Some profiles could not be loaded.'
364
+ : catalog.profiles.length === 0
365
+ ? 'No profiles are available on this computer.'
366
+ : undefined;
359
367
  return (
360
368
  <>
361
369
  <SheetHeader>
362
370
  <SheetTitle>Create bot</SheetTitle>
363
371
  </SheetHeader>
364
372
  <SheetBody style={styles.body}>
365
- <Text style={styles.root}>Choose a profile for the new bot. Your defaults stay unchanged.</Text>
366
- <Select
367
- title="Profile"
368
- placeholder="Choose a profile"
369
- value={profile}
370
- onValueChange={onProfile}
371
- disabled={loading || busy}
372
- options={(catalog?.profiles ?? []).map((item) => ({
373
- value: item.name,
374
- label: item.identity?.name || item.name,
375
- }))}
376
- />
377
- {loading ? (
378
- <Text style={styles.root}>Loading profiles…</Text>
379
- ) : !catalog || catalog.readiness === 'unavailable' ? (
380
- <Text style={styles.root}>Some profiles could not be loaded.</Text>
381
- ) : catalog.profiles.length === 0 ? (
382
- <Text style={styles.root}>No profiles are available on this computer.</Text>
383
- ) : null}
384
- {!loading ? (
385
- <Button variant="ghost" disabled={busy} onPress={onReload}>
386
- Reload profiles
387
- </Button>
388
- ) : null}
389
- <Button variant="outline" disabled={busy} onPress={onNewProfile}>
390
- New profile
391
- </Button>
392
- <ListRow
393
- title="Act as coordinator"
394
- description={coordinatorBlocked || 'Oversees the other sessions here and keeps their logbook.'}
395
- disclosure={false}
396
- trailing={
397
- <Switch
398
- value={actAsCoordinator && !coordinatorBlocked}
399
- onValueChange={onActAsCoordinator}
400
- disabled={busy || Boolean(coordinatorBlocked)}
401
- accessibilityLabel="Act as coordinator"
402
- />
403
- }
404
- />
373
+ <SheetDescription>Choose a profile for the new bot. Your defaults stay unchanged.</SheetDescription>
374
+ <Panel style={sheetStyles.card}>
375
+ <ListRow
376
+ title="Profile"
377
+ {...(status ? { description: status } : {})}
378
+ style={sheetStyles.divider}
379
+ trailing={
380
+ <Select
381
+ title="Profile"
382
+ placeholder="Choose"
383
+ searchPlaceholder="Search profiles"
384
+ avatars
385
+ onRefresh={onReload}
386
+ value={profile}
387
+ onValueChange={onProfile}
388
+ disabled={loading || busy}
389
+ options={(catalog?.profiles ?? []).map((item) => ({
390
+ value: item.name,
391
+ label: item.identity?.name || item.name,
392
+ ...(item.identity?.name && item.identity.name !== item.name ? { detail: item.name } : {}),
393
+ }))}
394
+ />
395
+ }
396
+ />
397
+ <ListRow
398
+ title="New profile"
399
+ leading={<PlusIcon size={18} color="green" />}
400
+ disabled={busy}
401
+ onPress={onNewProfile}
402
+ />
403
+ </Panel>
404
+ <Panel style={sheetStyles.card}>
405
+ <ListRow
406
+ title="Act as coordinator"
407
+ description={coordinatorBlocked || 'Oversees the other sessions here and keeps their logbook.'}
408
+ disclosure={false}
409
+ trailing={
410
+ <Switch
411
+ value={actAsCoordinator && !coordinatorBlocked}
412
+ onValueChange={onActAsCoordinator}
413
+ disabled={busy || Boolean(coordinatorBlocked)}
414
+ accessibilityLabel="Act as coordinator"
415
+ />
416
+ }
417
+ />
418
+ </Panel>
405
419
  {error ? (
406
420
  <Text style={styles.error} accessibilityRole="alert">
407
421
  {error}
@@ -409,6 +423,7 @@ export function CoordinatorProfileSheetView({
409
423
  ) : null}
410
424
  <Button
411
425
  variant="primary"
426
+ size="lg"
412
427
  loading={busy}
413
428
  loadingLabel="Creating"
414
429
  disabled={loading || !profile || !catalog?.profiles.some((item) => item.name === profile)}
@@ -416,14 +431,16 @@ export function CoordinatorProfileSheetView({
416
431
  >
417
432
  Create bot
418
433
  </Button>
419
- <Button variant="ghost" disabled={busy} onPress={onClose}>
420
- Cancel
421
- </Button>
422
434
  </SheetBody>
423
435
  </>
424
436
  );
425
437
  }
426
438
 
439
+ const sheetStyles = StyleSheet.create((theme) => ({
440
+ card: { padding: 0 },
441
+ divider: { borderBottomWidth: StyleSheet.hairlineWidth, borderBottomColor: theme.colors['border-soft'] },
442
+ }));
443
+
427
444
  export interface ResumeSheetProps {
428
445
  source: ResumeSource | null;
429
446
  onClose: () => void;