pi-larva 0.8.11 → 0.8.12

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": "pi-larva",
3
- "version": "0.8.11",
3
+ "version": "0.8.12",
4
4
  "description": "Larva PersonaSpec runtime, persona switching, and async subagent extension for Pi.",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "repository": {
@@ -30,7 +30,7 @@ registerHooks({
30
30
  let runtimePromise;
31
31
  const getRuntime = () => (runtimePromise ??= import('./larva.ts'));
32
32
 
33
- const string = { type: 'string', minLength: 1 };
33
+ const string = { type: 'string', pattern: '\\S' }; // Nonblank after trim, without changing the value.
34
34
  const integer = (minimum, maximum) => ({ type: 'integer', minimum, maximum });
35
35
  const ids = { type: 'array', items: string, minItems: 1, maxItems: 25, uniqueItems: true };
36
36
  const timeout = integer(0, 86400000);
@@ -52,7 +52,7 @@ tools.push({
52
52
  description: 'Search registered Larva personas for composer @-mention completion.',
53
53
  inputSchema: {
54
54
  type: 'object',
55
- properties: { query: { type: 'string' }, preload: { type: 'boolean' }, path: { type: 'array', items: string } },
55
+ properties: { query: { type: 'string' }, preload: { type: 'boolean' }, path: { type: 'array', items: { type: 'string', minLength: 1 } } },
56
56
  required: ['query'],
57
57
  additionalProperties: false,
58
58
  },
@@ -103,7 +103,7 @@ function badInput(message) {
103
103
  }
104
104
  function validValue(value, schema) {
105
105
  if (schema.enum && !schema.enum.includes(value)) return false;
106
- if (schema.type === 'string') return typeof value === 'string' && value.length >= (schema.minLength ?? 0);
106
+ if (schema.type === 'string') return typeof value === 'string' && value.length >= (schema.minLength ?? 0) && (schema.pattern === undefined || new RegExp(schema.pattern).test(value));
107
107
  if (schema.type === 'boolean') return typeof value === 'boolean';
108
108
  if (schema.type === 'integer') return Number.isSafeInteger(value) && value >= schema.minimum && value <= schema.maximum;
109
109
  if (schema.type === 'array') return Array.isArray(value) && value.length >= (schema.minItems ?? 0) && value.length <= (schema.maxItems ?? Infinity) && (!schema.uniqueItems || new Set(value).size === value.length) && value.every(item => validValue(item, schema.items));
@@ -479,7 +479,7 @@ function subagentPanelApp(surface) {
479
479
  const clock = setInterval(tick, 1000);
480
480
  document.addEventListener('visibilitychange', () => { if (!stopped && document.visibilityState !== 'hidden') void poll(); });
481
481
  render();
482
- rpc('ui/initialize', { protocolVersion: '2026-01-26', appInfo: { name: 'Larva Subagents', version: '0.8.11' }, appCapabilities: { availableDisplayModes: surface === 'panel' ? ['fullscreen'] : ['inline', 'fullscreen'] } }).then(result => {
482
+ rpc('ui/initialize', { protocolVersion: '2026-01-26', appInfo: { name: 'Larva Subagents', version: '0.8.12' }, appCapabilities: { availableDisplayModes: surface === 'panel' ? ['fullscreen'] : ['inline', 'fullscreen'] } }).then(result => {
483
483
  if (stopped) return;
484
484
  hostContext(result.hostContext); notify('ui/notifications/initialized', {}); void poll();
485
485
  }).catch(showError);
@@ -528,7 +528,7 @@ async function dispatch(message, framed) {
528
528
  result = {
529
529
  protocolVersion: ['2024-11-05', '2025-03-26', '2025-06-18', '2025-11-25', '2026-07-28'].includes(message.params?.protocolVersion) ? message.params.protocolVersion : '2024-11-05',
530
530
  capabilities: { tools: {}, resources: {} },
531
- serverInfo: { name: 'larva-pi-subagent', title: 'Larva Subagents', version: '0.8.11' },
531
+ serverInfo: { name: 'larva-pi-subagent', title: 'Larva Subagents', version: '0.8.12' },
532
532
  instructions: 'When the user mentions @larva:<persona_id>, @persona:<persona_id>, or a larva://personas/<persona_id> resource (including [@larva:<persona_id>](mcp-resource://...)), delegate the requested task to larva_subagent with persona_id="<persona_id>" and wait_for_completion=true (or false for parallel fan-out). When @Larva Subagents is mentioned without an exact persona_id, call larva_personas first.',
533
533
  };
534
534
  break;