@phyzess/pappra 0.1.0-beta.1 → 0.1.0-beta.10

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 (49) hide show
  1. package/README.md +30 -11
  2. package/assets/integrations/skills/pappra/SKILL.md +7 -4
  3. package/assets/integrations/skills/pappra/references/hosts.md +21 -11
  4. package/assets/integrations/skills/pappra/references/lifecycle.md +4 -0
  5. package/assets/integrations/skills/pappra/references/operations.md +20 -7
  6. package/dist/app/collaboration.js +6 -13
  7. package/dist/app/doctor.js +2 -2
  8. package/dist/app/init.d.ts +28 -0
  9. package/dist/app/init.js +419 -88
  10. package/dist/cli/commands/docs.d.ts +1 -0
  11. package/dist/cli/commands/docs.js +104 -3
  12. package/dist/cli/commands/host.d.ts +5 -1
  13. package/dist/cli/commands/host.js +80 -6
  14. package/dist/cli/commands/init.d.ts +8 -0
  15. package/dist/cli/commands/init.js +186 -9
  16. package/dist/cli/commands/runtime.d.ts +14 -0
  17. package/dist/cli/commands/runtime.js +263 -0
  18. package/dist/cli/run.js +159 -7
  19. package/dist/hosts/detect.d.ts +1 -0
  20. package/dist/hosts/detect.js +1 -1
  21. package/dist/hosts/integration/bundle-export.d.ts +24 -0
  22. package/dist/hosts/integration/bundle-export.js +128 -0
  23. package/dist/hosts/integration/bundle.d.ts +4 -1
  24. package/dist/hosts/integration/bundle.js +20 -2
  25. package/dist/hosts/integration/pappra-extension-runtime.mjs +24610 -0
  26. package/dist/hosts/integration/pappra-hook.mjs +24728 -0
  27. package/dist/hosts/integration/service.d.ts +8 -0
  28. package/dist/hosts/integration/service.js +71 -31
  29. package/dist/hosts/integration/support.d.ts +23 -0
  30. package/dist/hosts/integration/support.js +25 -0
  31. package/dist/hosts/integration/templates.d.ts +3 -3
  32. package/dist/hosts/integration/templates.js +15 -10
  33. package/dist/hosts/pi/rpc.d.ts +2 -0
  34. package/dist/hosts/pi/rpc.js +39 -1
  35. package/dist/hosts/pilot.d.ts +77 -77
  36. package/dist/index.d.ts +1 -1
  37. package/dist/index.js +1 -1
  38. package/dist/install/runtime.d.ts +1 -1
  39. package/dist/install/runtime.js +117 -10
  40. package/dist/package-info.d.ts +2 -0
  41. package/dist/package-info.js +6 -0
  42. package/dist/schemas/host.js +4 -2
  43. package/dist/schemas/install.d.ts +14 -0
  44. package/dist/schemas/install.js +8 -0
  45. package/package.json +8 -2
  46. package/skills/pappra/SKILL.md +7 -4
  47. package/skills/pappra/references/hosts.md +21 -11
  48. package/skills/pappra/references/lifecycle.md +4 -0
  49. package/skills/pappra/references/operations.md +20 -7
@@ -34,6 +34,13 @@ export declare const runtimeSourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
34
34
  version: z.ZodString;
35
35
  path: z.ZodString;
36
36
  digest: z.ZodString;
37
+ }, z.core.$strict>, z.ZodObject<{
38
+ kind: z.ZodLiteral<"self">;
39
+ packageName: z.ZodString;
40
+ version: z.ZodString;
41
+ packageRoot: z.ZodString;
42
+ tarball: z.ZodString;
43
+ digest: z.ZodString;
37
44
  }, z.core.$strict>], "kind">;
38
45
  export type RuntimeSource = z.infer<typeof runtimeSourceSchema>;
39
46
  export declare const runtimeManifestSchema: z.ZodObject<{
@@ -54,6 +61,13 @@ export declare const runtimeManifestSchema: z.ZodObject<{
54
61
  version: z.ZodString;
55
62
  path: z.ZodString;
56
63
  digest: z.ZodString;
64
+ }, z.core.$strict>, z.ZodObject<{
65
+ kind: z.ZodLiteral<"self">;
66
+ packageName: z.ZodString;
67
+ version: z.ZodString;
68
+ packageRoot: z.ZodString;
69
+ tarball: z.ZodString;
70
+ digest: z.ZodString;
57
71
  }, z.core.$strict>], "kind">;
58
72
  packageDigest: z.ZodString;
59
73
  smoke: z.ZodObject<{
@@ -43,6 +43,14 @@ export const runtimeSourceSchema = z.discriminatedUnion('kind', [
43
43
  path: pathSchema,
44
44
  digest: digestSchema,
45
45
  }),
46
+ z.strictObject({
47
+ kind: z.literal('self'),
48
+ packageName: z.string().min(1).max(256),
49
+ version: versionSchema,
50
+ packageRoot: pathSchema,
51
+ tarball: pathSchema,
52
+ digest: digestSchema,
53
+ }),
46
54
  ]);
47
55
  export const runtimeManifestSchema = z.strictObject({
48
56
  schema: z.literal(RUNTIME_MANIFEST_SCHEMA),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phyzess/pappra",
3
- "version": "0.1.0-beta.1",
3
+ "version": "0.1.0-beta.10",
4
4
  "description": "Portable workspace knowledge and continuity for coding agents.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -92,6 +92,7 @@
92
92
  },
93
93
  "devDependencies": {
94
94
  "@types/node": "24.19.1",
95
+ "esbuild": "^0.28.2",
95
96
  "prettier": "3.9.9",
96
97
  "typescript": "7.0.2"
97
98
  },
@@ -103,5 +104,10 @@
103
104
  "type": "git",
104
105
  "url": "https://github.com/phyzess/pappra.git"
105
106
  },
106
- "homepage": "https://github.com/phyzess/pappra"
107
+ "homepage": "https://github.com/phyzess/pappra",
108
+ "pnpm": {
109
+ "onlyBuiltDependencies": [
110
+ "esbuild"
111
+ ]
112
+ }
107
113
  }
@@ -16,13 +16,16 @@ index, or new writer.
16
16
  2. Read `references/hosts.md` when the host surface is Pi, Codex, or Claude.
17
17
  3. Use `pappra checkpoint` / `pappra resume` for handoffs. A stored checkpoint
18
18
  is context, not permission to execute or to trust a previous session.
19
- 4. Use `pappra docs` and `pappra code` only for the workspace selected by the
20
- current root. Never infer a workspace from an unrelated session.
19
+ 4. Use `pappra docs`, `pappra code`, `pappra runtime` and `pappra host` only for
20
+ the workspace selected by the current root. Never infer a workspace from an
21
+ unrelated session. `pappra docs scan --apply` registers discovered documents;
22
+ `pappra runtime install --apply` keeps a durable copy of this package.
21
23
  5. For a new bounded collaboration request, build an explicit
22
24
  `pappra/collaboration-goal/1` from the user's objective and named choices,
23
25
  run `pappra collab prepare --goal <file> --domain-root <dir>`, admit against a fresh capability
24
- card, then use `pappra collab run` with the reviewed controller. Never turn
25
- prose into identity, approval, or capability claims.
26
+ card, then use `pappra collab run` with the reviewed controller. `--controller
27
+ pi-rpc` launches a real owned Pi session and is verified for Pi 1.3.0. Never
28
+ turn prose into identity, approval, or capability claims.
26
29
 
27
30
  ## One-request collaboration
28
31
 
@@ -2,29 +2,39 @@
2
2
 
3
3
  ## Pi
4
4
 
5
- The integration installs a project extension plus a copied `pappra` skill.
6
- Pi extensions run with host permissions. Load only a trusted copy from this
7
- workspace/target; the generated entrypoint imports the fixed Pappra runtime by
8
- absolute file URL and registers lifecycle handlers only.
5
+ The project integration installs an extension plus a copied `pappra` skill; the
6
+ generated entrypoint imports the fixed Pappra runtime by absolute file URL.
7
+ `pappra host bundle --host pi` exports a self-contained package instead: the
8
+ entry imports `./runtime.mjs` next to it, so the package survives a moved
9
+ checkout. Pi 1.3.0 was verified in a real session through the packaged extension
10
+ (`pi install <dir> -l -a` + `pi -p -a`).
9
11
 
10
12
  ## Codex
11
13
 
12
- The integration installs a command-hook entry and merges only Pappra-owned
13
- entries into `hooks.json`. Existing hooks and unrelated keys are preserved.
14
+ Codex 0.163.0 loads command hooks only from its user configuration directory.
15
+ Wire it with `pappra host install --host codex --scope user`, which merges only
16
+ Pappra-owned entries into `$CODEX_HOME/hooks.json` (existing hooks and unrelated
17
+ keys are preserved) and copies the bundled hook there. Project
18
+ `.codex/hooks.json` and plugin-bundle hooks are not loaded at this version.
14
19
  Codex hook definitions are trusted individually; installation is not trust.
15
20
  Observed 0.163.0 hook keys do not include a compact event, so compact and
16
21
  automatic checkpoint requests remain unsupported.
17
22
 
18
23
  ## Claude Code
19
24
 
20
- The integration installs a command-hook entry and merges only Pappra-owned
21
- entries into `settings.json`. `SessionStart` and `PostCompact` are distinct;
22
- matchers, trust, timeout, and output behavior remain host/version-specific.
23
- Installing a command is not proof it ran.
25
+ The project integration installs a command-hook entry and merges only
26
+ Pappra-owned entries into `settings.json`; the command uses
27
+ `${CLAUDE_PROJECT_DIR}`. `pappra host bundle --host claude --marketplace` exports
28
+ a plugin whose hook uses `${CLAUDE_PLUGIN_ROOT}`; the marketplace validates with
29
+ `claude plugin validate` and startup was verified in a real session. `SessionStart`
30
+ and `PostCompact` are distinct; matchers, trust, timeout, and output behavior
31
+ remain host/version-specific. Installing a command is not proof it ran.
24
32
 
25
33
  ## Common safety
26
34
 
27
35
  All surfaces use the event's canonical cwd/root, bounded stdin, a one-second
28
36
  local deadline, no transcript reads, no arbitrary configured commands, and no
29
37
  network/model/index/session side effects. Paths with spaces or Unicode are
30
- passed as argv/file URLs, never interpolated into a shell.
38
+ passed as argv/file URLs, never interpolated into a shell. Plugin registration is
39
+ host-specific; never claim a hook is loaded because files were written or a
40
+ validator passed.
@@ -14,6 +14,10 @@ Pappra distinguishes four local lifecycle intents:
14
14
  The matrix is version-specific. A host version outside the observed support
15
15
  range is `unsupported`/`unknown`, not a fallback to name similarity.
16
16
 
17
+ Codex 0.163.0 loads these hook keys only from its user configuration directory
18
+ (`$CODEX_HOME/hooks.json`); project `.codex/hooks.json` and plugin bundles are
19
+ not loaded by that version. Claude Code and Pi wire hooks in project scope.
20
+
17
21
  ## What a hook does
18
22
 
19
23
  A hook validates the host payload, resolves the current workspace from the
@@ -1,13 +1,26 @@
1
1
  # Operations reference
2
2
 
3
- - `pappra init` plans or applies workspace configuration.
3
+ - `pappra init` plans or applies workspace configuration. `--yes` derives
4
+ selections from discovery, `--print-choices` prints that document without
5
+ writing, `--reconfigure` rebuilds an existing valid `workspace.json`, and
6
+ `--no-runtime` leaves the durable runtime action pending.
7
+ - `pappra runtime <install|status|verify|remove>` manages the durable runtime
8
+ copy. `install --apply` defaults to `--from self`; writes require `--apply`.
4
9
  - `pappra doctor` is passive: it does not install hooks, start hosts, or fix
5
- state.
6
- - `pappra checkpoint` writes a task checkpoint; `pappra resume` reads a
7
- stored snapshot and reports whether execution is allowed.
8
- - `pappra docs` manages knowledge documents.
9
- - `pappra code` operates on an explicitly selected repository and keeps
10
- index mutations behind an explicit `--apply`.
10
+ state. `runtime verify` is the active runtime check.
11
+ - `pappra checkpoint` writes a task checkpoint; `pappra resume` reads a stored
12
+ snapshot and reports whether execution is allowed.
13
+ - `pappra docs <list|check|archive|scan>` manages the knowledge catalog.
14
+ `scan --apply` registers documents found under the configured sources.
15
+ - `pappra code` operates on an explicitly selected repository and keeps index
16
+ mutations behind an explicit `--apply`.
17
+ - `pappra host <detect|describe|plan|install|verify|bundle>` wires an optional
18
+ host. Codex 0.163.0 loads hooks only from `$CODEX_HOME/hooks.json`, so use
19
+ `install --host codex --scope user`; `bundle --marketplace` exports a plugin
20
+ directory without registering it, and `install --mode plugin` fails closed.
21
+ - `pappra collab <prepare|run|query>` runs one bounded collaboration request.
22
+ `run` requires `--controller fixture|pi-rpc`; `pi-rpc` launches a real Pi RPC
23
+ session.
11
24
 
12
25
  Preserve user bytes. If an operation reports a conflict or residual path,
13
26
  inspect that path and resolve ownership before retrying. Never delete an