@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,143 @@
|
|
|
1
|
+
import type { Diagnostic } from '../schemas/diagnostics.js';
|
|
2
|
+
import type { DiagnosticCode } from '../schemas/errors.js';
|
|
3
|
+
import { type InitChoices, type InitExternalAction, type InitPlan } from '../schemas/init.js';
|
|
4
|
+
import { type MachineConfig } from '../schemas/machine.js';
|
|
5
|
+
import { type WorkspaceConfig, type WorkspaceValidation } from '../schemas/workspace.js';
|
|
6
|
+
import type { MachineConfigInspection, WorkspaceConfigInspection } from '../workspace/config.js';
|
|
7
|
+
import { type WorkspaceDiscovery } from '../workspace/discover.js';
|
|
8
|
+
import { type PlannedFileContent } from '../install/plan.js';
|
|
9
|
+
export type InitFailureStatus = 'needs_input' | 'invalid' | 'conflict' | 'unavailable';
|
|
10
|
+
export interface InitFailure {
|
|
11
|
+
readonly ok: false;
|
|
12
|
+
readonly status: InitFailureStatus;
|
|
13
|
+
readonly code: DiagnosticCode;
|
|
14
|
+
readonly message: string;
|
|
15
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
16
|
+
readonly nextAction: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface InitRootResolution {
|
|
19
|
+
readonly requestedRoot: string;
|
|
20
|
+
readonly root: string;
|
|
21
|
+
readonly registered: boolean;
|
|
22
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
23
|
+
}
|
|
24
|
+
export type InitRootResult = {
|
|
25
|
+
readonly ok: true;
|
|
26
|
+
readonly value: InitRootResolution;
|
|
27
|
+
} | InitFailure;
|
|
28
|
+
export interface InitContext {
|
|
29
|
+
readonly requestedRoot: string;
|
|
30
|
+
readonly root: string;
|
|
31
|
+
readonly registered: boolean;
|
|
32
|
+
/** Directory identity captured before inspection and discovery. */
|
|
33
|
+
readonly rootIdentity: RootIdentity;
|
|
34
|
+
readonly workspaceInspection: WorkspaceConfigInspection;
|
|
35
|
+
readonly machineInspection: MachineConfigInspection;
|
|
36
|
+
readonly discovery: WorkspaceDiscovery;
|
|
37
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
38
|
+
}
|
|
39
|
+
export type InitContextResult = {
|
|
40
|
+
readonly ok: true;
|
|
41
|
+
readonly context: InitContext;
|
|
42
|
+
} | InitFailure;
|
|
43
|
+
export interface InitScopeRepository {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly path: string;
|
|
46
|
+
readonly access: 'read' | 'write';
|
|
47
|
+
readonly external: boolean;
|
|
48
|
+
readonly root: string | null;
|
|
49
|
+
readonly kind: string | null;
|
|
50
|
+
readonly dirty: boolean | null;
|
|
51
|
+
readonly declaredBy: 'existing' | 'planned';
|
|
52
|
+
}
|
|
53
|
+
export interface InitScope {
|
|
54
|
+
readonly workspaceRoot: string;
|
|
55
|
+
readonly workspaceId: string;
|
|
56
|
+
readonly name: string;
|
|
57
|
+
readonly runtimeVersion: string;
|
|
58
|
+
readonly configSource: 'existing' | 'planned';
|
|
59
|
+
readonly repositories: readonly InitScopeRepository[];
|
|
60
|
+
readonly knowledge: WorkspaceConfig['knowledge'];
|
|
61
|
+
readonly code: WorkspaceConfig['code'];
|
|
62
|
+
readonly validation: readonly WorkspaceValidation[];
|
|
63
|
+
readonly excludes: readonly string[];
|
|
64
|
+
readonly hosts: readonly MachineConfig['selectedHosts'][number][];
|
|
65
|
+
readonly boundaries: readonly string[];
|
|
66
|
+
}
|
|
67
|
+
export interface RootIdentity {
|
|
68
|
+
readonly dev: number;
|
|
69
|
+
readonly ino: number;
|
|
70
|
+
}
|
|
71
|
+
export interface InitPlanBundle {
|
|
72
|
+
readonly plan: InitPlan;
|
|
73
|
+
readonly scope: InitScope;
|
|
74
|
+
readonly writes: readonly PlannedFileContent[];
|
|
75
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
76
|
+
/** Filesystem identity of the planned workspace root; not persisted in plan JSON. */
|
|
77
|
+
readonly rootIdentity: RootIdentity;
|
|
78
|
+
}
|
|
79
|
+
export type InitPreparation = {
|
|
80
|
+
readonly ok: true;
|
|
81
|
+
readonly bundle: InitPlanBundle;
|
|
82
|
+
} | InitFailure;
|
|
83
|
+
export type InitApplyStatus = 'applied' | 'external-actions-pending' | 'no-changes' | 'stale' | 'conflict' | 'unsupported' | 'failed';
|
|
84
|
+
export interface InitApplyResult {
|
|
85
|
+
readonly ok: boolean;
|
|
86
|
+
readonly status: InitApplyStatus;
|
|
87
|
+
readonly appliedFiles: readonly string[];
|
|
88
|
+
readonly pendingExternalActions: readonly InitExternalAction[];
|
|
89
|
+
/** Planned files that could not be safely removed after a failed apply. */
|
|
90
|
+
readonly residualPaths: readonly string[];
|
|
91
|
+
readonly diagnostics: readonly Diagnostic[];
|
|
92
|
+
}
|
|
93
|
+
export interface InitApplyOptions {
|
|
94
|
+
/** Fault-injection seam for tests; the CLI never supplies this hook. */
|
|
95
|
+
readonly beforeWrite?: (relativePath: string, index: number) => Promise<void> | void;
|
|
96
|
+
}
|
|
97
|
+
export interface KnowledgeCandidate {
|
|
98
|
+
readonly path: string;
|
|
99
|
+
readonly kind: string;
|
|
100
|
+
readonly origin: string | null;
|
|
101
|
+
readonly repositoryId: string | null;
|
|
102
|
+
}
|
|
103
|
+
export interface RepositoryCandidate {
|
|
104
|
+
readonly key: string;
|
|
105
|
+
readonly id: string | null;
|
|
106
|
+
readonly external: boolean;
|
|
107
|
+
readonly access: 'read' | 'write';
|
|
108
|
+
readonly root: string;
|
|
109
|
+
readonly kind: string;
|
|
110
|
+
readonly dirty: boolean | null;
|
|
111
|
+
readonly configured: boolean;
|
|
112
|
+
}
|
|
113
|
+
export interface PlanInitOptions {
|
|
114
|
+
readonly root: string;
|
|
115
|
+
readonly choices?: InitChoices | null;
|
|
116
|
+
readonly runtimeVersion?: string;
|
|
117
|
+
readonly planId?: string;
|
|
118
|
+
readonly discoveredAt?: string;
|
|
119
|
+
/** Reuse an immediately preceding inspectInitContext result. */
|
|
120
|
+
readonly context?: InitContext;
|
|
121
|
+
}
|
|
122
|
+
/** Resolves the explicit root and refuses to create a hidden nested workspace. */
|
|
123
|
+
export declare function resolveInitRoot(rootPath: string): Promise<InitRootResult>;
|
|
124
|
+
/**
|
|
125
|
+
* Loads the discovery inputs and rejects changed or invalid existing state.
|
|
126
|
+
* This function is read-only.
|
|
127
|
+
*/
|
|
128
|
+
export declare function inspectInitContext(rootPath: string): Promise<InitContextResult>;
|
|
129
|
+
/** Lists discovered repository scope choices for a UI. */
|
|
130
|
+
export declare function listRepositoryCandidates(discovery: WorkspaceDiscovery): readonly RepositoryCandidate[];
|
|
131
|
+
/** Lists knowledge source choices derived only from current discovery. */
|
|
132
|
+
export declare function listKnowledgeCandidates(discovery: WorkspaceDiscovery): readonly KnowledgeCandidate[];
|
|
133
|
+
/**
|
|
134
|
+
* Produces a strict plan and exact in-memory writes. No target file is created
|
|
135
|
+
* or modified by this function.
|
|
136
|
+
*/
|
|
137
|
+
export declare function planWorkspaceInit(options: PlanInitOptions): Promise<InitPreparation>;
|
|
138
|
+
/**
|
|
139
|
+
* Applies only create operations from a plan, after revalidating root,
|
|
140
|
+
* configuration digest, target absence and exact bytes. External actions are
|
|
141
|
+
* reported as pending and never executed here.
|
|
142
|
+
*/
|
|
143
|
+
export declare function applyInitPlan(bundle: InitPlanBundle, options?: InitApplyOptions): Promise<InitApplyResult>;
|