@phyzess/pappra 0.0.0-stage → 0.1.0-beta.2
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/LICENSE +21 -0
- package/README.md +80 -2
- package/THIRD_PARTY_NOTICES.md +16 -0
- package/assets/integrations/skills/pappra/SKILL.md +68 -0
- package/assets/integrations/skills/pappra/references/hosts.md +30 -0
- package/assets/integrations/skills/pappra/references/lifecycle.md +37 -0
- package/assets/integrations/skills/pappra/references/operations.md +14 -0
- package/assets/manifest.json +4 -0
- package/dist/app/collaboration.d.ts +170 -0
- package/dist/app/collaboration.js +1650 -0
- package/dist/app/doctor.d.ts +9 -0
- package/dist/app/doctor.js +1030 -0
- package/dist/app/init.d.ts +143 -0
- package/dist/app/init.js +1111 -0
- package/dist/cli/commands/code.d.ts +16 -0
- package/dist/cli/commands/code.js +127 -0
- package/dist/cli/commands/collaboration.d.ts +13 -0
- package/dist/cli/commands/collaboration.js +186 -0
- package/dist/cli/commands/continuity.d.ts +29 -0
- package/dist/cli/commands/continuity.js +133 -0
- package/dist/cli/commands/docs.d.ts +11 -0
- package/dist/cli/commands/docs.js +133 -0
- package/dist/cli/commands/doctor.d.ts +14 -0
- package/dist/cli/commands/doctor.js +57 -0
- package/dist/cli/commands/host.d.ts +13 -0
- package/dist/cli/commands/host.js +125 -0
- package/dist/cli/commands/init.d.ts +51 -0
- package/dist/cli/commands/init.js +668 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +10 -0
- package/dist/cli/output.d.ts +4 -0
- package/dist/cli/output.js +1 -0
- package/dist/cli/run.d.ts +2 -0
- package/dist/cli/run.js +597 -0
- package/dist/code/budget.d.ts +14 -0
- package/dist/code/budget.js +39 -0
- package/dist/code/exec.d.ts +23 -0
- package/dist/code/exec.js +133 -0
- package/dist/code/identity.d.ts +13 -0
- package/dist/code/identity.js +214 -0
- package/dist/code/index.d.ts +6 -0
- package/dist/code/index.js +3 -0
- package/dist/code/providers/codegraph.d.ts +59 -0
- package/dist/code/providers/codegraph.js +567 -0
- package/dist/code/registration.d.ts +9 -0
- package/dist/code/registration.js +293 -0
- package/dist/code/service.d.ts +53 -0
- package/dist/code/service.js +633 -0
- package/dist/code/text.d.ts +3 -0
- package/dist/code/text.js +202 -0
- package/dist/collab/admission.d.ts +450 -0
- package/dist/collab/admission.js +797 -0
- package/dist/collab/canonical.d.ts +26 -0
- package/dist/collab/canonical.js +136 -0
- package/dist/collab/contracts.d.ts +73 -0
- package/dist/collab/contracts.js +76 -0
- package/dist/collab/envelope.d.ts +52 -0
- package/dist/collab/envelope.js +241 -0
- package/dist/collab/fingerprint.d.ts +7 -0
- package/dist/collab/fingerprint.js +58 -0
- package/dist/collab/handoff.d.ts +350 -0
- package/dist/collab/handoff.js +513 -0
- package/dist/collab/index.d.ts +9 -0
- package/dist/collab/index.js +8 -0
- package/dist/collab/lifecycle.d.ts +449 -0
- package/dist/collab/lifecycle.js +534 -0
- package/dist/collab/messages.d.ts +148 -0
- package/dist/collab/messages.js +583 -0
- package/dist/collab/notify.d.ts +47 -0
- package/dist/collab/notify.js +140 -0
- package/dist/collab/preflight.d.ts +31 -0
- package/dist/collab/preflight.js +271 -0
- package/dist/collab/resources.d.ts +119 -0
- package/dist/collab/resources.js +451 -0
- package/dist/collab/store.d.ts +143 -0
- package/dist/collab/store.js +606 -0
- package/dist/collab/types.d.ts +354 -0
- package/dist/collab/types.js +1 -0
- package/dist/collab/validation.d.ts +10 -0
- package/dist/collab/validation.js +303 -0
- package/dist/continuity/context.d.ts +24 -0
- package/dist/continuity/context.js +179 -0
- package/dist/continuity/index.d.ts +3 -0
- package/dist/continuity/index.js +1 -0
- package/dist/continuity/paths.d.ts +37 -0
- package/dist/continuity/paths.js +258 -0
- package/dist/continuity/service.d.ts +59 -0
- package/dist/continuity/service.js +1258 -0
- package/dist/hosts/claude/native.d.ts +79 -0
- package/dist/hosts/claude/native.js +853 -0
- package/dist/hosts/codex/native.d.ts +345 -0
- package/dist/hosts/codex/native.js +1528 -0
- package/dist/hosts/codex/protocol.d.ts +51 -0
- package/dist/hosts/codex/protocol.js +42 -0
- package/dist/hosts/detect.d.ts +28 -0
- package/dist/hosts/detect.js +73 -0
- package/dist/hosts/index.d.ts +10 -0
- package/dist/hosts/index.js +10 -0
- package/dist/hosts/integration/bundle.d.ts +16 -0
- package/dist/hosts/integration/bundle.js +81 -0
- package/dist/hosts/integration/hook-entry.d.ts +1 -0
- package/dist/hosts/integration/hook-entry.js +68 -0
- package/dist/hosts/integration/hook.d.ts +32 -0
- package/dist/hosts/integration/hook.js +781 -0
- package/dist/hosts/integration/pi-extension-runtime.d.ts +18 -0
- package/dist/hosts/integration/pi-extension-runtime.js +89 -0
- package/dist/hosts/integration/pi-template.d.ts +3 -0
- package/dist/hosts/integration/pi-template.js +5 -0
- package/dist/hosts/integration/service.d.ts +41 -0
- package/dist/hosts/integration/service.js +1381 -0
- package/dist/hosts/integration/support.d.ts +36 -0
- package/dist/hosts/integration/support.js +41 -0
- package/dist/hosts/integration/templates.d.ts +22 -0
- package/dist/hosts/integration/templates.js +70 -0
- package/dist/hosts/pi/protocol.d.ts +22 -0
- package/dist/hosts/pi/protocol.js +28 -0
- package/dist/hosts/pi/query-result.d.ts +22 -0
- package/dist/hosts/pi/query-result.js +710 -0
- package/dist/hosts/pi/rpc.d.ts +937 -0
- package/dist/hosts/pi/rpc.js +1621 -0
- package/dist/hosts/pilot.d.ts +485 -0
- package/dist/hosts/pilot.js +593 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/infra/fs.d.ts +27 -0
- package/dist/infra/fs.js +130 -0
- package/dist/infra/git.d.ts +60 -0
- package/dist/infra/git.js +358 -0
- package/dist/infra/owned-process-group.d.ts +173 -0
- package/dist/infra/owned-process-group.js +571 -0
- package/dist/install/apply.d.ts +65 -0
- package/dist/install/apply.js +663 -0
- package/dist/install/index.d.ts +5 -0
- package/dist/install/index.js +5 -0
- package/dist/install/ownership.d.ts +85 -0
- package/dist/install/ownership.js +430 -0
- package/dist/install/plan.d.ts +39 -0
- package/dist/install/plan.js +97 -0
- package/dist/install/rollback.d.ts +18 -0
- package/dist/install/rollback.js +544 -0
- package/dist/install/runtime.d.ts +76 -0
- package/dist/install/runtime.js +1145 -0
- package/dist/knowledge/catalog.d.ts +47 -0
- package/dist/knowledge/catalog.js +308 -0
- package/dist/knowledge/context.d.ts +28 -0
- package/dist/knowledge/context.js +61 -0
- package/dist/knowledge/index.d.ts +3 -0
- package/dist/knowledge/index.js +1 -0
- package/dist/knowledge/journal.d.ts +16 -0
- package/dist/knowledge/journal.js +109 -0
- package/dist/knowledge/lifecycle.d.ts +8 -0
- package/dist/knowledge/lifecycle.js +1001 -0
- package/dist/knowledge/paths.d.ts +37 -0
- package/dist/knowledge/paths.js +236 -0
- package/dist/knowledge/refs.d.ts +36 -0
- package/dist/knowledge/refs.js +267 -0
- package/dist/knowledge/service.d.ts +21 -0
- package/dist/knowledge/service.js +393 -0
- package/dist/knowledge/types.d.ts +171 -0
- package/dist/knowledge/types.js +1 -0
- package/dist/knowledge/write.d.ts +8 -0
- package/dist/knowledge/write.js +1223 -0
- package/dist/package-info.d.ts +6 -0
- package/dist/package-info.js +19 -0
- package/dist/schemas/code.d.ts +377 -0
- package/dist/schemas/code.js +145 -0
- package/dist/schemas/collaboration.d.ts +115 -0
- package/dist/schemas/collaboration.js +106 -0
- package/dist/schemas/continuity.d.ts +315 -0
- package/dist/schemas/continuity.js +199 -0
- package/dist/schemas/diagnostics.d.ts +28 -0
- package/dist/schemas/diagnostics.js +27 -0
- package/dist/schemas/doctor.d.ts +157 -0
- package/dist/schemas/doctor.js +75 -0
- package/dist/schemas/document.d.ts +644 -0
- package/dist/schemas/document.js +296 -0
- package/dist/schemas/errors.d.ts +177 -0
- package/dist/schemas/errors.js +176 -0
- package/dist/schemas/evidence.d.ts +24 -0
- package/dist/schemas/evidence.js +16 -0
- package/dist/schemas/host.d.ts +436 -0
- package/dist/schemas/host.js +201 -0
- package/dist/schemas/index.d.ts +15 -0
- package/dist/schemas/index.js +15 -0
- package/dist/schemas/init.d.ts +121 -0
- package/dist/schemas/init.js +94 -0
- package/dist/schemas/install.d.ts +213 -0
- package/dist/schemas/install.js +139 -0
- package/dist/schemas/machine.d.ts +43 -0
- package/dist/schemas/machine.js +96 -0
- package/dist/schemas/outcome.d.ts +23 -0
- package/dist/schemas/outcome.js +17 -0
- package/dist/schemas/paths.d.ts +19 -0
- package/dist/schemas/paths.js +63 -0
- package/dist/schemas/workspace.d.ts +120 -0
- package/dist/schemas/workspace.js +201 -0
- package/dist/workspace/config-file.d.ts +36 -0
- package/dist/workspace/config-file.js +237 -0
- package/dist/workspace/config.d.ts +28 -0
- package/dist/workspace/config.js +79 -0
- package/dist/workspace/discover.d.ts +34 -0
- package/dist/workspace/discover.js +195 -0
- package/dist/workspace/documents.d.ts +21 -0
- package/dist/workspace/documents.js +395 -0
- package/dist/workspace/ignore.d.ts +10 -0
- package/dist/workspace/ignore.js +48 -0
- package/dist/workspace/index.d.ts +7 -0
- package/dist/workspace/index.js +3 -0
- package/dist/workspace/repositories.d.ts +24 -0
- package/dist/workspace/repositories.js +411 -0
- package/dist/workspace/resolve.d.ts +24 -0
- package/dist/workspace/resolve.js +268 -0
- package/dist/workspace/types.d.ts +71 -0
- package/dist/workspace/types.js +1 -0
- package/dist/workspace/validation.d.ts +18 -0
- package/dist/workspace/validation.js +197 -0
- package/package.json +105 -4
- package/skills/pappra/SKILL.md +68 -0
- package/skills/pappra/references/hosts.md +30 -0
- package/skills/pappra/references/lifecycle.md +37 -0
- package/skills/pappra/references/operations.md +14 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import type { ChildProcess, SpawnOptions } from 'node:child_process';
|
|
2
|
+
interface StopOptions {
|
|
3
|
+
termMs?: number;
|
|
4
|
+
killMs?: number;
|
|
5
|
+
pollMs?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class OwnedGroupRefusal extends Error {
|
|
8
|
+
readonly code: string;
|
|
9
|
+
readonly detail: string | null;
|
|
10
|
+
constructor(code: string, detail?: string | null);
|
|
11
|
+
}
|
|
12
|
+
/** Members of this exact owned group, or null when the host cannot observe process tables. */
|
|
13
|
+
export declare function observeGroup(handle: unknown): {
|
|
14
|
+
pid: number;
|
|
15
|
+
pgid: number;
|
|
16
|
+
state: string;
|
|
17
|
+
start_identity: string;
|
|
18
|
+
}[] | null;
|
|
19
|
+
/**
|
|
20
|
+
* Spawn one child in its own detached process group and keep the exact incarnation of the
|
|
21
|
+
* group leader in private state. Only the returned frozen token can later stop that group.
|
|
22
|
+
*/
|
|
23
|
+
export declare function spawnOwnedGroup(command: string, args?: string[], options?: SpawnOptions): object;
|
|
24
|
+
/**
|
|
25
|
+
* Genuine-handle-only accessor: returns the ChildProcess created by this exact handle. The
|
|
26
|
+
* handle remains a frozen opaque token, so a caller can never pass an arbitrary pid/pgid as
|
|
27
|
+
* authority for signalling.
|
|
28
|
+
*/
|
|
29
|
+
export declare function ownedChild(handle: unknown): ChildProcess;
|
|
30
|
+
/** Observes only this handle's own group: parent exit is not group exit. */
|
|
31
|
+
export declare function groupState(handle: unknown): {
|
|
32
|
+
observable: boolean;
|
|
33
|
+
pgid: number;
|
|
34
|
+
parent_exited: boolean;
|
|
35
|
+
members: {
|
|
36
|
+
pid: number;
|
|
37
|
+
pgid: number;
|
|
38
|
+
state: string;
|
|
39
|
+
start_identity: string;
|
|
40
|
+
}[];
|
|
41
|
+
live_members: number[];
|
|
42
|
+
group_live: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Bounded TERM then KILL against this handle's own group. Refuses when the group leader was
|
|
46
|
+
* replaced by a different incarnation, and reports `stopped: false` while any member lives.
|
|
47
|
+
*/
|
|
48
|
+
export declare function stopOwnedGroup(handle: unknown, options?: StopOptions): Promise<{
|
|
49
|
+
stopped: boolean;
|
|
50
|
+
already_stopped: boolean;
|
|
51
|
+
term_sent: boolean;
|
|
52
|
+
kill_sent: boolean;
|
|
53
|
+
remaining: {
|
|
54
|
+
pid: number;
|
|
55
|
+
state: string;
|
|
56
|
+
start_identity: string;
|
|
57
|
+
}[];
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* Read-only snapshot of the genuine owned root and the processes that are actually its
|
|
61
|
+
* descendants (tree traversal from the private root pid), keeping exact PID + start identities
|
|
62
|
+
* and the members of every group those processes belong to. The snapshot is a frozen opaque
|
|
63
|
+
* token backed by private state; no caller-supplied PID/PGID ever becomes authority, and the
|
|
64
|
+
* caller's groups are captured before any native interrupt so orphaned groups remain targeted.
|
|
65
|
+
*
|
|
66
|
+
* A group is only captured when its leader is the owned root or a captured descendant AND every
|
|
67
|
+
* current member of that group is itself a proven descendant of the owned root. A group leader
|
|
68
|
+
* alone can never grant authority over an unrelated process that merely joined the group, so a
|
|
69
|
+
* contaminated tree is refused wholesale instead of being stopped.
|
|
70
|
+
*/
|
|
71
|
+
export declare function snapshotOwnedTree(handle: unknown): Readonly<{
|
|
72
|
+
scope: "owned-descendant-tree-snapshot";
|
|
73
|
+
captured_at: string;
|
|
74
|
+
original_pgid: number;
|
|
75
|
+
root: {
|
|
76
|
+
pid: number;
|
|
77
|
+
pgid: number;
|
|
78
|
+
start_identity: string;
|
|
79
|
+
};
|
|
80
|
+
descendants: {
|
|
81
|
+
pid: number;
|
|
82
|
+
ppid: number;
|
|
83
|
+
pgid: number;
|
|
84
|
+
start_identity: string;
|
|
85
|
+
}[];
|
|
86
|
+
groups: {
|
|
87
|
+
pgid: number;
|
|
88
|
+
member_count: number;
|
|
89
|
+
}[];
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* Bounded global TERM then KILL across the snapshotted groups (one shared budget, never
|
|
93
|
+
* multiplied by group count). Only the runtime whose owned group captured the snapshot may stop
|
|
94
|
+
* it. Signalling happens after every current live member of every captured group matches a
|
|
95
|
+
* snapshotted PID + start identity and the same captured PGID, and every still-live captured PID
|
|
96
|
+
* is still in its captured group; an uncaptured joiner, a reused id, a moved captured member or an
|
|
97
|
+
* observation failure refuses unproven and signals nothing. Immediately before escalation the
|
|
98
|
+
* same verdict is recomputed, so a group whose membership or incarnation changed during TERM is
|
|
99
|
+
* never SIGKILLed; a `stopped: true` result requires that same positive verdict on the final
|
|
100
|
+
* observation.
|
|
101
|
+
*/
|
|
102
|
+
export declare function stopSnapshottedTree(snapshot: unknown, options?: StopOptions & {
|
|
103
|
+
handle?: object;
|
|
104
|
+
}): Promise<{
|
|
105
|
+
scope: string;
|
|
106
|
+
original_pgid: number;
|
|
107
|
+
root_pid: number;
|
|
108
|
+
groups: number[];
|
|
109
|
+
targeted_groups: number[];
|
|
110
|
+
stopped: boolean;
|
|
111
|
+
already_stopped: boolean;
|
|
112
|
+
term_sent: boolean;
|
|
113
|
+
kill_sent: boolean;
|
|
114
|
+
group_observed: boolean;
|
|
115
|
+
escalation_refused: string;
|
|
116
|
+
remaining: never[];
|
|
117
|
+
} | {
|
|
118
|
+
scope: string;
|
|
119
|
+
original_pgid: number;
|
|
120
|
+
root_pid: number;
|
|
121
|
+
groups: number[];
|
|
122
|
+
targeted_groups: number[];
|
|
123
|
+
stopped: boolean;
|
|
124
|
+
already_stopped: boolean;
|
|
125
|
+
term_sent: boolean;
|
|
126
|
+
kill_sent: boolean;
|
|
127
|
+
group_observed: boolean;
|
|
128
|
+
escalation_refused: string;
|
|
129
|
+
escalation_detail: string;
|
|
130
|
+
remaining: {
|
|
131
|
+
pid: number;
|
|
132
|
+
pgid: number;
|
|
133
|
+
state: string;
|
|
134
|
+
start_identity: string;
|
|
135
|
+
}[];
|
|
136
|
+
} | {
|
|
137
|
+
scope: string;
|
|
138
|
+
original_pgid: number;
|
|
139
|
+
root_pid: number;
|
|
140
|
+
groups: number[];
|
|
141
|
+
targeted_groups: number[];
|
|
142
|
+
stopped: boolean;
|
|
143
|
+
already_stopped: boolean;
|
|
144
|
+
term_sent: boolean;
|
|
145
|
+
kill_sent: boolean;
|
|
146
|
+
group_observed: boolean;
|
|
147
|
+
final_proof_refused: string;
|
|
148
|
+
final_proof_detail: string;
|
|
149
|
+
remaining: {
|
|
150
|
+
pid: number;
|
|
151
|
+
pgid: number;
|
|
152
|
+
state: string;
|
|
153
|
+
start_identity: string;
|
|
154
|
+
}[];
|
|
155
|
+
} | {
|
|
156
|
+
scope: string;
|
|
157
|
+
original_pgid: number;
|
|
158
|
+
root_pid: number;
|
|
159
|
+
groups: number[];
|
|
160
|
+
targeted_groups: number[];
|
|
161
|
+
stopped: boolean;
|
|
162
|
+
already_stopped: boolean;
|
|
163
|
+
term_sent: boolean;
|
|
164
|
+
kill_sent: boolean;
|
|
165
|
+
remaining: {
|
|
166
|
+
pid: number;
|
|
167
|
+
pgid: number;
|
|
168
|
+
state: string;
|
|
169
|
+
start_identity: string;
|
|
170
|
+
}[];
|
|
171
|
+
group_observed: boolean;
|
|
172
|
+
}>;
|
|
173
|
+
export {};
|