phronesis 1.0.0 → 1.1.0

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.
Files changed (41) hide show
  1. package/package.json +1 -1
  2. package/src/act.js +62 -1
  3. package/src/adapter.js +366 -61
  4. package/src/cli.js +527 -32
  5. package/src/compile.js +141 -10
  6. package/src/doctor.js +63 -2
  7. package/src/hook.js +312 -0
  8. package/src/hooks-refresh.js +1363 -0
  9. package/src/hooks.js +48 -33
  10. package/src/init.js +37 -4
  11. package/src/launcher.js +2105 -0
  12. package/src/layout.js +51 -7
  13. package/src/profile.js +169 -0
  14. package/src/prompts.js +88 -0
  15. package/src/skills-bump.js +88 -20
  16. package/src/skills.js +103 -10
  17. package/templates/codex/INDEX.md +4 -2
  18. package/templates/codex/seed/ai-practice/the-workspace-is-part-of-the-thinking.md +96 -0
  19. package/templates/codex-surface/README.md +15 -16
  20. package/templates/codex-surface/hooks/_resolve.sh +25 -24
  21. package/templates/codex-surface/hooks/recall-guard.sh +5 -30
  22. package/templates/codex-surface/hooks/session-start.sh +5 -18
  23. package/templates/codex-surface/hooks/session-sweep-precompact.sh +5 -20
  24. package/templates/codex-surface/hooks/session-sweep-subagent.sh +5 -23
  25. package/templates/codex-surface/hooks/session-sweep.sh +5 -19
  26. package/templates/launcher/phronesis +95 -0
  27. package/templates/phronesis-hooks/compile-active-context.sh +12 -38
  28. package/templates/phronesis-hooks/recall-guard.sh +12 -103
  29. package/templates/phronesis-hooks/session-start.sh +10 -88
  30. package/templates/phronesis-hooks/session-sweep.sh +16 -139
  31. package/templates/phronesis-hooks/skill-lifecycle.sh +12 -37
  32. package/templates/skills/lint/SKILL.md +7 -2
  33. package/templates/skills/onboard/SKILL.md +47 -9
  34. package/templates/skills/onboard/evals/rubric.md +5 -3
  35. package/templates/skills/prd-draft/SKILL.md +34 -26
  36. package/templates/skills/prd-draft/evals/rubric.md +1 -1
  37. package/vendor/core/src/action-registry.js +6 -3
  38. package/vendor/core/src/actions.js +120 -16
  39. package/vendor/core/src/index.js +3 -0
  40. package/vendor/core/src/lint.js +22 -5
  41. package/vendor/core/src/skill-lifecycle.js +67 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phronesis",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Phronesis CLI + daemon. Ports the pming scaffold forward to the three-layer installation layout.",
package/src/act.js CHANGED
@@ -10,7 +10,7 @@
10
10
  // (--session/--domain/--actor/--surface/--dir). The approval signal (D5) is the
11
11
  // adapter-set env PHRONESIS_APPROVAL_SOURCE — deliberately not a flag and not payload.
12
12
 
13
- import { resolveInvocationIdForAct, runAction } from '@phronesis/core';
13
+ import { resolveInvocationIdForAct, runAction, describeActionSchema } from '@phronesis/core';
14
14
 
15
15
  export async function runAct({ type, json, session, domain, actor, surface, dir, invocationId } = {}) {
16
16
  if (!type) {
@@ -59,3 +59,64 @@ export async function runAct({ type, json, session, domain, actor, surface, dir,
59
59
  return null;
60
60
  }
61
61
  }
62
+
63
+ // `phronesis act <type> --schema` — read-only introspection of a type's EFFECTIVE payload
64
+ // schema (change 0045). Pure parse-and-delegate like runAct: all install/registry access
65
+ // lives behind describeActionSchema in @phronesis/core (validate-actions D7b); this handler
66
+ // only formats the plain-data result and prints it. Unlike `registry status`'s terse
67
+ // one-line summary, this renders the enum `values` too — the whole point is that a caller
68
+ // reads the payload contract instead of probing it with empty payloads.
69
+ function formatField(f) {
70
+ const facets = [f.kind];
71
+ if (f.nonEmpty) facets.push('non-empty');
72
+ if (f.kind === 'enum' && Array.isArray(f.values)) facets.push(`one of: ${f.values.join(' | ')}`);
73
+ return ` ${f.name}${f.required ? ' *' : ''} — ${facets.join(', ')}`;
74
+ }
75
+
76
+ export async function runActSchema({ type, dir } = {}) {
77
+ if (!type) {
78
+ console.error('act --schema: name an action <type> (e.g. log_decision).');
79
+ process.exitCode = 1;
80
+ return null;
81
+ }
82
+
83
+ const result = await describeActionSchema({ dir, cwd: process.cwd(), type });
84
+
85
+ if (result.status === 'error') {
86
+ console.error(result.message);
87
+ process.exitCode = 1;
88
+ return null;
89
+ }
90
+ if (result.status === 'invalid-registry') {
91
+ console.error(
92
+ 'act --schema: the action-type registry is invalid — the action layer is disabled until it is fixed (removing the action_types section restores built-in defaults):',
93
+ );
94
+ for (const e of result.errors) console.error(` - ${e}`);
95
+ process.exitCode = 1;
96
+ return null;
97
+ }
98
+ if (result.status === 'unknown-type') {
99
+ console.error(
100
+ result.isCodeType
101
+ ? `act --schema: "${result.type}" is a known action type but is not registered in this install, so it refuses to run. Registered types: ${result.knownTypes.join(', ')}`
102
+ : `act --schema: unknown action type "${result.type}". Known types: ${result.knownTypes.join(', ')}`,
103
+ );
104
+ process.exitCode = 1;
105
+ return null;
106
+ }
107
+
108
+ const sourceLabel =
109
+ result.source === 'registry' ? '.phronesis/registry.json action_types' : 'built-in defaults';
110
+ const lines = [
111
+ `${result.type} — payload schema (source: ${sourceLabel})`,
112
+ 'Semantic inputs go inside --json; * marks a required field.',
113
+ ];
114
+ if (!result.fields.length) {
115
+ lines.push(' (this action type takes no payload fields)');
116
+ } else {
117
+ for (const f of result.fields) lines.push(formatField(f));
118
+ }
119
+ console.log(lines.join('\n'));
120
+ process.exitCode = 0;
121
+ return { type: result.type, source: result.source, fields: result.fields };
122
+ }