gestalt-mobile 0.74.0 → 0.75.1

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.
@@ -16,7 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
16
16
  <link rel="icon" href="/icons/gestalt-mobile-192.png" />
17
17
  <link rel="apple-touch-icon" href="/icons/gestalt-mobile-180.png" />
18
18
  <title>Gestalt Mobile</title>
19
- <script type="module" crossorigin src="/assets/index-YgsHeAim.js"></script>
19
+ <script type="module" crossorigin src="/assets/index-CBBThxjT.js"></script>
20
20
  <link rel="stylesheet" crossorigin href="/assets/index-B7ZFxnEl.css">
21
21
  </head>
22
22
  <body>
@@ -98,14 +98,13 @@ import { CodexCapabilities } from './platform/codex/codex-capabilities.js';
98
98
  import { CodexPlaywright } from './platform/codex/codex-playwright.js';
99
99
  import { ManagedPlaywright } from './platform/codex/managed-playwright.js';
100
100
  import { isManagedPlaywrightCall } from '../shared/contracts/managed-playwright.js';
101
- import { compileSkillOverride } from './features/skills/model/skill-profile.js';
101
+ import { compileSkillOverride, isMandatoryGestaltSkill, } from './features/skills/model/skill-profile.js';
102
102
  import { SupervisedPlanRegistry } from './features/plans/application/supervised-plan-registry.js';
103
103
  import { planAttachmentSupervision } from './features/plans/application/plan-attachment-supervision.js';
104
104
  import { prepareOrgPlanSupervision } from './features/plans/application/prepare-org-plan-supervision.js';
105
105
  import { startOrgPlanSupervision, OrgPlanSessionNotPublished, } from './features/plans/application/start-org-plan-supervision.js';
106
106
  import { SqliteOrgPlanLaunchStore } from './platform/persistence/sqlite-org-plan-launch-store.js';
107
- import { resolveSessionSkillSelection } from './features/sessions/application/resolve-session-skills.js';
108
- import { prepareOrgPlanSettings } from './features/plans/application/prepare-org-plan-settings.js';
107
+ import { prepareOrgPlanSettings, resolveSupervisorSkillSelection, } from './features/plans/application/prepare-org-plan-settings.js';
109
108
  import { FilesystemPlanStatusSource } from './platform/plans/filesystem-plan-status-source.js';
110
109
  import { FilesystemWorkspacePlanCatalog } from './platform/plans/filesystem-workspace-plan-catalog.js';
111
110
  import { FilesystemOrgPlanContext } from './platform/plans/filesystem-org-plan-context.js';
@@ -652,6 +651,7 @@ export async function composeRelayApp(options) {
652
651
  return compileSkillOverride({
653
652
  discovered: catalog.skills,
654
653
  explicit: session.effectiveSkillSelection.skills,
654
+ mandatorySkillsOnly: session.effectiveSkillSelection.mandatorySkillsOnly,
655
655
  }).skillsConfig;
656
656
  const project = await skillProfiles.readWorkspaceDefault(session.workspacePath);
657
657
  return compileSkillOverride({
@@ -1409,26 +1409,33 @@ export async function composeRelayApp(options) {
1409
1409
  }, undefined, planStatusSource, acceptPlanUpdate, options.planMeasurementBaseUrl, 30_000, 64, root, (session) => sessionModelConfig.resolve(session), {
1410
1410
  prepare: async (session, rpc, config, deadline) => {
1411
1411
  const catalog = await new CodexSkillCatalog(session.profile, options.launchAppServer ?? launchCodexAppServer, Math.max(1, deadline - Date.now())).list(session.workspacePath);
1412
- const project = await skillProfiles.readWorkspaceDefault(session.workspacePath);
1412
+ const mandatorySkillsOnly = session.effectiveSkillSelection?.mandatorySkillsOnly;
1413
+ const project = mandatorySkillsOnly
1414
+ ? undefined
1415
+ : await skillProfiles.readWorkspaceDefault(session.workspacePath);
1413
1416
  const selected = compileSkillOverride({
1414
1417
  discovered: catalog.skills,
1415
1418
  explicit: session.effectiveSkillSelection?.skills ?? options.explicitSkillProfile?.skills,
1416
1419
  project: project?.skills,
1420
+ mandatorySkillsOnly,
1417
1421
  });
1422
+ const availableSkills = mandatorySkillsOnly
1423
+ ? catalog.skills.filter(({ name }) => isMandatoryGestaltSkill(name))
1424
+ : catalog.skills;
1418
1425
  const state = await capabilities.prepare({
1419
1426
  cwd: session.workspacePath,
1420
1427
  approvalPolicy: session.executionPolicy?.approvalPolicy ?? 'on-request',
1421
1428
  rpc,
1422
1429
  config,
1423
1430
  deadline,
1424
- skills: catalog.skills,
1431
+ skills: availableSkills,
1425
1432
  skillsConfig: selected.skillsConfig,
1426
1433
  start: true,
1427
1434
  startup: !session.threadId,
1428
1435
  });
1429
1436
  return playwright.prepare(state, playwrightAuthority(session), {
1430
1437
  rpc,
1431
- skills: catalog.skills,
1438
+ skills: availableSkills,
1432
1439
  deadline: Date.now() + 5_000,
1433
1440
  current: () => playwrightAuthority(sessions.find(session.id) ?? session),
1434
1441
  });
@@ -2060,7 +2067,6 @@ export async function composeRelayApp(options) {
2060
2067
  profiles: options.profiles,
2061
2068
  skillProfiles,
2062
2069
  skillCatalog,
2063
- defaultSkillProfile: options.explicitSkillProfile,
2064
2070
  }, selectedProfile),
2065
2071
  owner: async (canonicalPath, workspacePath) => {
2066
2072
  const pending = orgPlanLaunches.owner(canonicalPath) ?? orgPlanLaunches.workspaceOwner(workspacePath);
@@ -2119,14 +2125,10 @@ export async function composeRelayApp(options) {
2119
2125
  return false;
2120
2126
  }
2121
2127
  },
2122
- captureSkills: (context) => resolveSessionSkillSelection({
2123
- workspacePath: context.workspace.path,
2124
- provider: 'codex',
2125
- profile: 'default',
2126
- ...(context.settings.skillProfile
2127
- ? { skillProfile: context.settings.skillProfile }
2128
- : {}),
2129
- }, { skillProfiles, skillCatalog, defaultSkillProfile: options.explicitSkillProfile }),
2128
+ captureSkills: (context) => resolveSupervisorSkillSelection(context.workspace.path, context.settings.skillProfile, {
2129
+ skillProfiles,
2130
+ skillCatalog,
2131
+ }),
2130
2132
  sessions: {
2131
2133
  create: async (id, context, selection, publication) => {
2132
2134
  orgPlanStarting.set(id, (orgPlanStarting.get(id) ?? 0) + 1);
@@ -6,6 +6,15 @@
6
6
  import { sessionDefaultsSchema, resolveNewSessionDefaults, } from '../../../../shared/contracts/session-defaults.js';
7
7
  import { readGlobalSkillProfiles } from '../../skills/application/read-global-profiles.js';
8
8
  import { resolveSessionSkillSelection } from '../../sessions/application/resolve-session-skills.js';
9
+ /** Resolve the same supervisor skills during preparation and launch. */
10
+ export function resolveSupervisorSkillSelection(workspacePath, skillProfile, deps) {
11
+ return resolveSessionSkillSelection({
12
+ workspacePath,
13
+ provider: 'codex',
14
+ profile: 'default',
15
+ ...(skillProfile ? { skillProfile } : { mandatorySkillsOnly: true }),
16
+ }, deps);
17
+ }
9
18
  /** Read-only counterpart of the ordinary New session form and skill snapshot. */
10
19
  export async function prepareOrgPlanSettings(workspacePath, deps, skillProfile) {
11
20
  const unavailable = (code, reason) => ({ kind: 'unavailable', code, reason });
@@ -36,15 +45,10 @@ export async function prepareOrgPlanSettings(workspacePath, deps, skillProfile)
36
45
  if (selected && !valid(selected)) {
37
46
  if (skillProfile !== undefined)
38
47
  return unavailable('SKILL_PROFILE_UNAVAILABLE', 'The selected supervisor skill profile disappeared or is invalid. Refresh and choose again.');
39
- warnings.push('The saved skill profile is unavailable. Default is selected; choose a supervisor profile before confirming.');
48
+ warnings.push('The saved skill profile is unavailable. None is selected, so only mandatory Gestalt skills will load.');
40
49
  selected = '';
41
50
  }
42
- const effectiveSkillSelection = await resolveSessionSkillSelection({
43
- workspacePath,
44
- provider: 'codex',
45
- profile: 'default',
46
- ...(selected ? { skillProfile: selected } : {}),
47
- }, deps);
51
+ const effectiveSkillSelection = await resolveSupervisorSkillSelection(workspacePath, selected, deps);
48
52
  if (!effectiveSkillSelection.skills.some((skill) => skill.name === 'gestalt:org-plan' && skill.enabled))
49
53
  return unavailable('GESTALT_CAPABILITIES_UNAVAILABLE', 'The Org-plan skill is unavailable in the ordinary Codex session catalog. Restore Gestalt capabilities and retry.');
50
54
  const { workspaceId: _workspaceId, ...settings } = defaults;
@@ -8,6 +8,15 @@ import { reconcileSkillSelectionSnapshot, } from '../../skills/model/skill-profi
8
8
  import { SkillProfileError } from '../../skills/model/errors.js';
9
9
  /** Same immutable profile/capability snapshot for ordinary starts and read-only preparation. */
10
10
  export async function resolveSessionSkillSelection(input, deps) {
11
+ if (input.mandatorySkillsOnly) {
12
+ const catalog = await deps
13
+ .skillCatalog(input.provider, input.profile)
14
+ .list(input.workspacePath);
15
+ return createEffectiveSkillSelection({
16
+ mandatorySkillsOnly: true,
17
+ skills: catalog.skills.map(({ name, path, enabled }) => ({ name, path, enabled })),
18
+ });
19
+ }
11
20
  const selectedProfile = input.skillProfile
12
21
  ? await deps.skillProfiles.readGlobalProfile(input.skillProfile)
13
22
  : deps.defaultSkillProfile;
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { DomainError } from './errors.js';
7
7
  import { profileCapabilitiesSchema, } from '../../../../shared/contracts/profile-capabilities.js';
8
- import { createSkillSelection, normalizeSkillProfileName, } from '../../skills/model/skill-profile.js';
8
+ import { createSkillSelection, isMandatoryGestaltSkill, normalizeSkillProfileName, } from '../../skills/model/skill-profile.js';
9
9
  import { interactionId, profileName, sessionId, threadId, turnId, workspaceId, workspacePath, } from './value-objects.js';
10
10
  /** A durable thread can be read even when this relay has no live writer. */
11
11
  export function isSessionReadable(session) {
@@ -36,6 +36,14 @@ export function createSessionExecutionPolicy(input) {
36
36
  };
37
37
  }
38
38
  export function createEffectiveSkillSelection(input) {
39
+ if (input.mandatorySkillsOnly) {
40
+ return {
41
+ mandatorySkillsOnly: true,
42
+ skills: createSkillSelection(input.skills
43
+ .filter(({ name }) => isMandatoryGestaltSkill(name))
44
+ .map((skill) => ({ ...skill, enabled: true }))),
45
+ };
46
+ }
39
47
  const warnings = (input.warnings ?? []).filter((warning) => typeof warning === 'string' && warning.length > 0);
40
48
  return {
41
49
  ...(input.capabilities === undefined
@@ -10,6 +10,7 @@ const schema = z.object({
10
10
  provider: z.enum(['codex', 'kimi']),
11
11
  profile: z.string().min(1),
12
12
  skillProfile: z.string().trim().min(1).optional(),
13
+ mandatorySkillsOnly: z.literal(true).optional(),
13
14
  model: z
14
15
  .string()
15
16
  .trim()
@@ -26,5 +27,7 @@ const schema = z.object({
26
27
  /** Parses only settings that are safe to send directly to Codex thread/start. */
27
28
  export function parseStartSessionRequest(input) {
28
29
  const result = schema.safeParse(input);
29
- return result.success ? result.data : null;
30
+ if (!result.success || (result.data.mandatorySkillsOnly && result.data.skillProfile))
31
+ return null;
32
+ return result.data;
30
33
  }
@@ -69,8 +69,11 @@ export const availableSkillSchema = z
69
69
  * executors load declared and other relevant skills on demand.
70
70
  */
71
71
  export function isAlwaysAdvertisedSkill(skill) {
72
- return (isGestaltSkillName(skill.name) &&
73
- (!['gestalt:serena', 'gestalt:playwright'].includes(skill.name) || skill.enabled));
72
+ return isMandatoryGestaltSkill(skill.name) || (isGestaltSkillName(skill.name) && skill.enabled);
73
+ }
74
+ /** Gestalt infrastructure remains available when all optional skills are off. */
75
+ export function isMandatoryGestaltSkill(name) {
76
+ return isGestaltSkillName(name) && !['gestalt:serena', 'gestalt:playwright'].includes(name);
74
77
  }
75
78
  export function isGestaltSkillName(name) {
76
79
  return name.startsWith('gestalt:');
@@ -222,6 +225,16 @@ export function reconcileSkillSelectionSnapshot(discovered, selection) {
222
225
  * It neither writes configuration nor mutates the user Codex installation.
223
226
  */
224
227
  export function compileSkillOverride(input) {
228
+ if (input.mandatorySkillsOnly) {
229
+ return {
230
+ source: 'explicit',
231
+ skillsConfig: input.discovered.map(({ path, name }) => ({
232
+ path,
233
+ enabled: isMandatoryGestaltSkill(name),
234
+ })),
235
+ warnings: [],
236
+ };
237
+ }
225
238
  const effective = selectEffectiveSkillSelection(input);
226
239
  const reconciled = reconcileSkillSelectionSnapshot(input.discovered, effective.selection);
227
240
  return {
@@ -278,7 +278,7 @@ export class KimiSessionRuntime {
278
278
  const selection = effective?.skills ?? [];
279
279
  if (effective?.selectedProfileName)
280
280
  return normalizeSkillProfileName(effective.selectedProfileName);
281
- if (!selection.length)
281
+ if (!selection.length && !effective?.mandatorySkillsOnly)
282
282
  return 'default';
283
283
  const canonical = JSON.stringify([...selection].sort((a, b) => a.path.localeCompare(b.path)));
284
284
  return `sel-${createHash('sha256').update(canonical).digest('hex').slice(0, 12)}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gestalt-mobile",
3
- "version": "0.74.0",
3
+ "version": "0.75.1",
4
4
  "description": "Mobile-first web relay for durable Codex development sessions",
5
5
  "keywords": [
6
6
  "codex",