@nklisch/pi-enhanced 0.1.3 → 0.1.4
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/CHANGELOG.md +7 -0
- package/node_modules/@nklisch/pi-clearance/README.md +10 -5
- package/node_modules/@nklisch/pi-clearance/docs/ARCHITECTURE.md +8 -5
- package/node_modules/@nklisch/pi-clearance/docs/CONFIGURATION.md +25 -35
- package/node_modules/@nklisch/pi-clearance/docs/DEVELOPER_GUIDE.md +13 -11
- package/node_modules/@nklisch/pi-clearance/docs/PACK_AUTHORING.md +5 -4
- package/node_modules/@nklisch/pi-clearance/docs/PRINCIPLES.md +14 -10
- package/node_modules/@nklisch/pi-clearance/docs/REFERENCE_PATTERNS.md +1 -1
- package/node_modules/@nklisch/pi-clearance/docs/REVIEWER_PROMPTS.md +12 -8
- package/node_modules/@nklisch/pi-clearance/docs/RULE_PACKS.md +1 -1
- package/node_modules/@nklisch/pi-clearance/docs/SPEC.md +7 -6
- package/node_modules/@nklisch/pi-clearance/docs/TUNE.md +2 -2
- package/node_modules/@nklisch/pi-clearance/docs/USER_GUIDE.md +7 -3
- package/node_modules/@nklisch/pi-clearance/docs/VISION.md +3 -3
- package/node_modules/@nklisch/pi-clearance/native/clearance-core.darwin-x64.node +0 -0
- package/node_modules/@nklisch/pi-clearance/native/clearance-core.linux-arm64-gnu.node +0 -0
- package/node_modules/@nklisch/pi-clearance/native/clearance-core.win32-arm64-msvc.node +0 -0
- package/node_modules/@nklisch/pi-clearance/native/clearance-core.win32-x64-msvc.node +0 -0
- package/node_modules/@nklisch/pi-clearance/package.json +9 -5
- package/node_modules/@nklisch/pi-clearance/src/config/config-command-plans.ts +79 -3
- package/node_modules/@nklisch/pi-clearance/src/config/config-command-writer.ts +7 -1
- package/node_modules/@nklisch/pi-clearance/src/config/defaults.ts +42 -0
- package/node_modules/@nklisch/pi-clearance/src/config/gated-tools.ts +7 -0
- package/node_modules/@nklisch/pi-clearance/src/config/loader.ts +7 -1
- package/node_modules/@nklisch/pi-clearance/src/config/pack-enablement-writer.ts +1 -0
- package/node_modules/@nklisch/pi-clearance/src/config/paths.ts +14 -3
- package/node_modules/@nklisch/pi-clearance/src/config/persistence.ts +135 -0
- package/node_modules/@nklisch/pi-clearance/src/config/schema.ts +74 -26
- package/node_modules/@nklisch/pi-clearance/src/contracts/AdversarialCase.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/AdversarialCaseCategory.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/AdversarialCaseExpectation.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/AdversarialCaseResult.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/AdversarialCaseResultOutcome.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/AdversarialCaseSource.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/AdversarialValidationReport.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/AdversarialValidationStatus.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashBlock.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashCommandShape.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashConditionalArm.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashControlConstruct.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashFlag.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashForLoopKeywordSpans.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashIteratorEntry.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashIteratorEntryKind.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashListOperator.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashLoopVariableReference.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashPathFact.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashPathFactContext.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashPathFactProvenance.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashPathFactProvenanceEntry.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashPathFacts.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashPipeline.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashStage.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BashStageProgram.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/BlockOperator.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CapturedOutcome.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CommandFamilyKey.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CommandFamilySummary.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CompileError.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CompositionOperator.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CompoundBodyReason.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CompoundFeatureReason.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CompoundForm.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CompoundIteratorReason.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CorpusEntry.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CorpusExpectedLabel.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CorpusFidelity.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CorpusQueryModel.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CorpusQuerySummary.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CorpusQuerySummarySnapshot.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CorpusRecord.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CorpusSource.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/CountByLabel.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/Decision.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/DecisionEffect.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/DecisionProvenance.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/DecisionSource.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/DiagnosticSeverity.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/EffectivePolicy.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/EmbeddedShellProjection.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/EnvironmentAssignment.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/IteratorSourceKind.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/LoopQuoteKind.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/LoopVariableUnknownReason.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/MatcherExpr.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/MutationShapeKind.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/MutationTrustBoundaryClassification.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/MutationTrustBoundaryKind.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PackCompileResult.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PackWarningLevel.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ParsedEvidence.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ParsedShapeSummary.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PathAccess.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PathFactProjectScope.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PathFactsRequirement.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PathFactsResolvedConfig.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PathNormalization.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PathScope.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PathScopeMatcherExpr.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PathScopeMatcherMode.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PathUnknownReason.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PathUsageKind.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PiBuiltinToolOperation.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PiBuiltinToolPathInput.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PiBuiltinToolShape.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PiBuiltinToolSpec.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PiFileMutationToolName.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PiToolMutationFacts.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PolicyPack.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PolicyPackDocLink.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PolicyPackExample.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PolicyPackMetadata.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PolicyPackWarning.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/PolicyRule.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ProposalNotRunReason.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ProposalNotRunSeverity.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/QuoteKind.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/Redirect.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/RedirectStream.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/RedirectTargetKind.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayCorpus.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayDelta.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayDeltaBlockedSummary.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayDeltaChangedRecord.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayDeltaFamily.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayDeltaImprovement.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayDeltaRegression.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayDeltaStatus.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayDeltaTransitionCount.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayPathFacts.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayReviewerMode.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayReviewerOutcome.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayStatus.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ReplayedDecision.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ShapeDiagnostic.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/SourceFidelity.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/SourceSpan.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/Substitution.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/SubstitutionKind.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ToolCallIdentity.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ToolPathAccess.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ToolPathFact.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ToolPathFactContext.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ToolPathFacts.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ToolPathUsage.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/ToolShape.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/UnknownPathBehavior.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/UnknownToolShape.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/contracts/index.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/index.ts +33 -2
- package/node_modules/@nklisch/pi-clearance/src/native/loader.ts +12 -6
- package/node_modules/@nklisch/pi-clearance/src/replay/reviewer-config-proposals.ts +7 -4
- package/node_modules/@nklisch/pi-clearance/src/runtime/allow-request-message.ts +21 -0
- package/node_modules/@nklisch/pi-clearance/src/runtime/auto-reviewer-read-models.ts +165 -8
- package/node_modules/@nklisch/pi-clearance/src/runtime/command-registry.ts +1 -1
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/allow.ts +26 -2
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/packs.ts +6 -6
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/scope.ts +5 -5
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/settings/actions.ts +11 -0
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/settings/dispatcher.ts +274 -1
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/settings/model-options.ts +52 -0
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/settings/native-ui.ts +54 -67
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/settings/panels/reviewer.ts +19 -3
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/settings/panels/scope.ts +2 -11
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/settings/panels.ts +10 -1
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/settings/read-model.ts +47 -13
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/settings.ts +32 -37
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/status.ts +3 -0
- package/node_modules/@nklisch/pi-clearance/src/runtime/config-commands/types.ts +14 -5
- package/node_modules/@nklisch/pi-clearance/src/runtime/handler.ts +36 -0
- package/node_modules/@nklisch/pi-clearance/src/runtime/mode-prompt.ts +0 -1
- package/node_modules/@nklisch/pi-clearance/src/runtime/model-adapter.ts +5 -1
- package/node_modules/@nklisch/pi-clearance/src/runtime/reviewer-context.ts +73 -10
- package/node_modules/@nklisch/pi-clearance/src/runtime/reviewer-prompts.ts +186 -175
- package/node_modules/@nklisch/pi-clearance/src/runtime/reviewer.ts +26 -6
- package/node_modules/@nklisch/pi-plugins/dist/infrastructure/state/local-lock-filesystem.d.ts +23 -1
- package/node_modules/@nklisch/pi-plugins/dist/infrastructure/state/local-lock-filesystem.js +46 -50
- package/node_modules/@nklisch/pi-plugins/dist/infrastructure/state/local-lock-filesystem.js.map +1 -1
- package/node_modules/@nklisch/pi-plugins/dist/runtime/mcp/pi-mcp-adapter-package.js +2 -2
- package/node_modules/@nklisch/pi-plugins/dist/runtime/mcp/pi-mcp-adapter-package.js.map +1 -1
- package/node_modules/@nklisch/pi-plugins/dist/runtime/mcp/pi-mcp-adapter-runtime.js +2 -2
- package/node_modules/@nklisch/pi-plugins/dist/runtime/mcp/pi-mcp-adapter-runtime.js.map +1 -1
- package/node_modules/@nklisch/pi-plugins/dist/runtime/subagents/pi-subagents-lifecycle.js +1 -1
- package/node_modules/@nklisch/pi-plugins/dist/runtime/subagents/pi-subagents-package.js +2 -2
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/README.md +41 -31
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/dist/public.d.ts +2 -1
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/docs/FORK-MAINTENANCE.md +17 -11
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/docs/VISION.md +14 -7
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/docs/architecture/architecture.md +11 -19
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/docs/comparison-with-upstream.md +58 -53
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/package.json +2 -2
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/config/agent-type-resolution.ts +43 -0
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/config/agent-types.ts +11 -6
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/config/custom-agents.ts +13 -6
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/config/default-agents.ts +0 -52
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/config/thinking-levels.ts +12 -0
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/handlers/interrupt.ts +5 -2
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/handlers/lifecycle.ts +3 -3
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/index.ts +7 -6
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/create-subagent-session.ts +7 -2
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/parent-snapshot.ts +11 -3
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/subagent-manager.ts +26 -56
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/subagent-session.ts +48 -9
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/subagent-state.ts +32 -0
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/lifecycle/subagent.ts +105 -17
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/observation/composite-subagent-observer.ts +4 -0
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/observation/notification.ts +50 -46
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/observation/renderer.ts +1 -1
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/observation/subagent-events-observer.ts +15 -0
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/runtime.ts +2 -0
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/service/service-adapter.ts +35 -6
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/service/service.ts +1 -0
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/session/model-label.ts +19 -0
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/session/prompts.ts +24 -1
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/session/session-config.ts +11 -6
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/settings.ts +70 -3
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/tools/agent-tool.ts +27 -10
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/tools/background-spawner.ts +6 -2
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/tools/foreground-runner.ts +12 -3
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/tools/get-result-report.ts +17 -3
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/tools/get-result-tool.ts +13 -20
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/tools/result-renderer.ts +6 -1
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/tools/spawn-config.ts +16 -16
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/tools/steer-tool.ts +12 -4
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/types.ts +2 -2
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/ui/agent-widget.ts +24 -11
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/ui/display.ts +10 -7
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/ui/glyphs.ts +7 -0
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/ui/session-navigation.ts +34 -25
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/ui/session-navigator.ts +30 -10
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/ui/subagents-settings.ts +58 -13
- package/node_modules/@nklisch/pi-plugins/node_modules/@nklisch/pi-subagents/src/ui/widget-renderer.ts +32 -19
- package/node_modules/@nklisch/pi-plugins/package.json +3 -3
- package/package.json +1 -1
- package/test/verify-bundle.mjs +4 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type QuoteKind = "none" | "single" | "double" | "mixed";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { RedirectStream } from "./RedirectStream.ts";
|
|
4
4
|
import type { RedirectTargetKind } from "./RedirectTargetKind.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type RedirectStream = "stdout" | "stderr" | "stdin" | "fd" | "both";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type RedirectTargetKind = "file" | "fd" | "heredoc" | "herestring";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { CorpusEntry } from "./CorpusEntry.ts";
|
|
4
4
|
import type { CountByLabel } from "./CountByLabel.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { CorpusQuerySummarySnapshot } from "./CorpusQuerySummarySnapshot.ts";
|
|
4
4
|
import type { ProposalNotRunReason } from "./ProposalNotRunReason.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type ReplayDeltaBlockedSummary = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { CorpusFidelity } from "./CorpusFidelity.ts";
|
|
4
4
|
import type { ReplayStatus } from "./ReplayStatus.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { CountByLabel } from "./CountByLabel.ts";
|
|
4
4
|
import type { ReplayDeltaRegression } from "./ReplayDeltaRegression.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type ReplayDeltaImprovement = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type ReplayDeltaRegression = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type ReplayDeltaStatus = "not-run" | "passed" | "regression";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type ReplayDeltaTransitionCount = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { BashPathFacts } from "./BashPathFacts.ts";
|
|
4
4
|
import type { ToolPathFacts } from "./ToolPathFacts.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type ReplayReviewerMode =
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { DecisionEffect } from "./DecisionEffect.ts";
|
|
4
4
|
import type { ReplayReviewerMode } from "./ReplayReviewerMode.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type ReplayStatus = "fast_path" | "review" | "hard_block";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { Decision } from "./Decision.ts";
|
|
4
4
|
import type { DecisionProvenance } from "./DecisionProvenance.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { DiagnosticSeverity } from "./DiagnosticSeverity.ts";
|
|
4
4
|
import type { SourceSpan } from "./SourceSpan.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { CorpusFidelity } from "./CorpusFidelity.ts";
|
|
4
4
|
import type { CorpusSource } from "./CorpusSource.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type SourceSpan = { start: number; end: number };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { SourceSpan } from "./SourceSpan.ts";
|
|
4
4
|
import type { SubstitutionKind } from "./SubstitutionKind.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type SubstitutionKind = "command" | "process" | "arithmetic";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type ToolCallIdentity = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type ToolPathAccess = "read" | "write" | "create";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { PathNormalization } from "./PathNormalization.ts";
|
|
4
4
|
import type { PathScope } from "./PathScope.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { PathFactProjectScope } from "./PathFactProjectScope.ts";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { ToolPathFact } from "./ToolPathFact.ts";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type ToolPathUsage = "argument" | "implicit-cwd";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { BashCommandShape } from "./BashCommandShape.ts";
|
|
4
4
|
import type { PiBuiltinToolShape } from "./PiBuiltinToolShape.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
|
|
4
4
|
export type UnknownPathBehavior = "review" | "deny";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
|
3
3
|
import type { ShapeDiagnostic } from "./ShapeDiagnostic.ts";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// @generated by ts-rs; do not edit. Run `
|
|
1
|
+
// @generated by ts-rs; do not edit. Run `npm run contracts:generate`.
|
|
2
2
|
export * from "./AdversarialCase.ts";
|
|
3
3
|
export * from "./AdversarialCaseCategory.ts";
|
|
4
4
|
export * from "./AdversarialCaseExpectation.ts";
|
|
@@ -5,6 +5,10 @@ import type {
|
|
|
5
5
|
} from "@earendil-works/pi-coding-agent";
|
|
6
6
|
|
|
7
7
|
import { createAuditLogger } from "./audit/logger.ts";
|
|
8
|
+
import {
|
|
9
|
+
CLEARANCE_ALLOW_REQUEST_CUSTOM_TYPE,
|
|
10
|
+
renderClearanceAllowRequest,
|
|
11
|
+
} from "./runtime/allow-request-message.ts";
|
|
8
12
|
import { requireNativeEngine } from "./native/loader.ts";
|
|
9
13
|
import { createPackageRegistrationStore } from "./packs/package-registration.ts";
|
|
10
14
|
import { createDefaultAnalyzerRegistry } from "./parse/registry.ts";
|
|
@@ -60,6 +64,21 @@ const piAutoApprove: ExtensionFactory = (pi: ExtensionAPI) => {
|
|
|
60
64
|
// partially initialized clearance runtime in place.
|
|
61
65
|
const nativeHealth = requireNativeEngine().health();
|
|
62
66
|
const audit = createAuditLogger({ sink: createDefaultAuditSink() });
|
|
67
|
+
const registerMessageRenderer = (
|
|
68
|
+
pi as unknown as {
|
|
69
|
+
registerMessageRenderer?: (
|
|
70
|
+
customType: string,
|
|
71
|
+
renderer: typeof renderClearanceAllowRequest,
|
|
72
|
+
) => void;
|
|
73
|
+
}
|
|
74
|
+
).registerMessageRenderer;
|
|
75
|
+
if (typeof registerMessageRenderer === "function") {
|
|
76
|
+
registerMessageRenderer.call(
|
|
77
|
+
pi,
|
|
78
|
+
CLEARANCE_ALLOW_REQUEST_CUSTOM_TYPE,
|
|
79
|
+
renderClearanceAllowRequest,
|
|
80
|
+
);
|
|
81
|
+
}
|
|
63
82
|
let invalidatePolicyCache: (cwd?: string) => void = () => {
|
|
64
83
|
/* resolver not constructed yet */
|
|
65
84
|
};
|
|
@@ -111,6 +130,7 @@ const piAutoApprove: ExtensionFactory = (pi: ExtensionAPI) => {
|
|
|
111
130
|
audit,
|
|
112
131
|
recentDecisionSource,
|
|
113
132
|
analyzerRegistry,
|
|
133
|
+
toolMetadata: () => toolMetadata(pi),
|
|
114
134
|
});
|
|
115
135
|
registerProposalTools(
|
|
116
136
|
pi,
|
|
@@ -179,13 +199,24 @@ const piAutoApprove: ExtensionFactory = (pi: ExtensionAPI) => {
|
|
|
179
199
|
};
|
|
180
200
|
|
|
181
201
|
function registeredToolNames(pi: ExtensionAPI): readonly string[] {
|
|
202
|
+
return toolMetadata(pi).allToolNames;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function toolMetadata(pi: ExtensionAPI): {
|
|
206
|
+
readonly activeToolNames: readonly string[];
|
|
207
|
+
readonly allToolNames: readonly string[];
|
|
208
|
+
} {
|
|
182
209
|
try {
|
|
183
|
-
|
|
210
|
+
const allToolNames = pi
|
|
184
211
|
.getAllTools()
|
|
185
212
|
.map((tool) => tool.name)
|
|
186
213
|
.filter((name): name is string => typeof name === "string");
|
|
214
|
+
return {
|
|
215
|
+
activeToolNames: pi.getActiveTools(),
|
|
216
|
+
allToolNames,
|
|
217
|
+
};
|
|
187
218
|
} catch {
|
|
188
|
-
return [];
|
|
219
|
+
return { activeToolNames: [], allToolNames: [] };
|
|
189
220
|
}
|
|
190
221
|
}
|
|
191
222
|
|
|
@@ -195,12 +195,18 @@ let cachedStatus: NativeEngineStatus | undefined;
|
|
|
195
195
|
* prebuild files staged by `native:prepare`.
|
|
196
196
|
*/
|
|
197
197
|
export function nativePlatformTriple(): string | undefined {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
198
|
+
// Map the host platform/arch to a napi-rs platform-package suffix. Every
|
|
199
|
+
// common dev platform is covered. The list of *built* prebuilds is the
|
|
200
|
+
// narrower one in `package.json` `napi.targets`; this function returns a
|
|
201
|
+
// suffix for any platform Node can run on so the load path produces a
|
|
202
|
+
// precise "no prebuild for this platform" error rather than a generic
|
|
203
|
+
// "unsupported native platform" when the host is genuinely novel.
|
|
204
|
+
if (process.platform === "linux" && process.arch === "x64") return "linux-x64-gnu";
|
|
205
|
+
if (process.platform === "linux" && process.arch === "arm64") return "linux-arm64-gnu";
|
|
206
|
+
if (process.platform === "darwin" && process.arch === "x64") return "darwin-x64";
|
|
207
|
+
if (process.platform === "darwin" && process.arch === "arm64") return "darwin-arm64";
|
|
208
|
+
if (process.platform === "win32" && process.arch === "x64") return "win32-x64-msvc";
|
|
209
|
+
if (process.platform === "win32" && process.arch === "arm64") return "win32-arm64-msvc";
|
|
204
210
|
return undefined;
|
|
205
211
|
}
|
|
206
212
|
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
ReviewerConfigSchema,
|
|
10
10
|
} from "../config/schema.ts";
|
|
11
11
|
import {
|
|
12
|
+
isShippedReviewerPostureId,
|
|
12
13
|
REVIEWER_BASE_CONTRACT,
|
|
13
14
|
SHIPPED_REVIEWER_POSTURES,
|
|
14
15
|
validatePromptOverride,
|
|
@@ -146,8 +147,10 @@ export type ReviewerModelDrafter = (
|
|
|
146
147
|
) => Promise<ReviewerModelDraftResult | undefined>;
|
|
147
148
|
|
|
148
149
|
/** True iff `postureId` is one of the shipped reviewer posture fragments. */
|
|
149
|
-
export function isShippedReviewerPosture(
|
|
150
|
-
|
|
150
|
+
export function isShippedReviewerPosture(
|
|
151
|
+
postureId: string,
|
|
152
|
+
): postureId is keyof typeof SHIPPED_REVIEWER_POSTURES {
|
|
153
|
+
return isShippedReviewerPostureId(postureId);
|
|
151
154
|
}
|
|
152
155
|
|
|
153
156
|
/**
|
|
@@ -700,9 +703,9 @@ function draftOverrideSet(
|
|
|
700
703
|
const postureFragments =
|
|
701
704
|
SHIPPED_REVIEWER_POSTURES[
|
|
702
705
|
isShippedReviewerPosture(current.promptPosture)
|
|
703
|
-
?
|
|
706
|
+
? current.promptPosture
|
|
704
707
|
: "reviewer.default"
|
|
705
|
-
];
|
|
708
|
+
].fragments;
|
|
706
709
|
const text = [
|
|
707
710
|
REVIEWER_BASE_CONTRACT.text,
|
|
708
711
|
...postureFragments.map((fragment) => fragment.text),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { MessageRenderer } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
3
|
+
|
|
4
|
+
export const CLEARANCE_ALLOW_REQUEST_CUSTOM_TYPE = "clearance.allow-request";
|
|
5
|
+
|
|
6
|
+
export interface ClearanceAllowRequestDetails {
|
|
7
|
+
readonly brief: string;
|
|
8
|
+
readonly form: "free-text" | "recent-command" | "no-recent-command";
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Keep the transcript row compact while the custom message content remains the
|
|
13
|
+
* complete, clearly labelled brief that Pi sends to the model. The renderer is
|
|
14
|
+
* deliberately not the source of model context.
|
|
15
|
+
*/
|
|
16
|
+
export const renderClearanceAllowRequest: MessageRenderer<
|
|
17
|
+
ClearanceAllowRequestDetails
|
|
18
|
+
> = (message) => {
|
|
19
|
+
const form = message.details?.form ?? "request";
|
|
20
|
+
return new Text(`[Pi Clearance] Allow request handed to agent (${form})`);
|
|
21
|
+
};
|
|
@@ -5,6 +5,16 @@ import type {
|
|
|
5
5
|
ResolvedConfig,
|
|
6
6
|
ResolvedReviewerConfig,
|
|
7
7
|
} from "../config/loader.ts";
|
|
8
|
+
import {
|
|
9
|
+
DEFAULT_PROJECT_SCOPE_BEHAVIOR,
|
|
10
|
+
DEFAULT_REVIEWER_CONTEXT_MODE,
|
|
11
|
+
DEFAULT_REVIEWER_ESCALATION,
|
|
12
|
+
DEFAULT_REVIEWER_PROMPT_POSTURE,
|
|
13
|
+
DEFAULT_REVIEWER_RECENT_CONTEXT,
|
|
14
|
+
DEFAULT_REVIEWER_TOKEN_BUDGET,
|
|
15
|
+
DEFAULT_REVIEW_NOTE_DISPLAY,
|
|
16
|
+
DEFAULT_UNKNOWN_TOOL_POSTURE,
|
|
17
|
+
} from "../config/defaults.ts";
|
|
8
18
|
import { shippedPackActivationCondition } from "../packs/activation.ts";
|
|
9
19
|
import type { PackageRegistrationSnapshot } from "../packs/package-registration.ts";
|
|
10
20
|
import {
|
|
@@ -49,6 +59,9 @@ export interface AutoReviewerStatusView {
|
|
|
49
59
|
readonly cwd: string;
|
|
50
60
|
};
|
|
51
61
|
readonly mode: ResolvedPolicy["config"]["mode"];
|
|
62
|
+
readonly gatedTools?: readonly string[];
|
|
63
|
+
/** Concise category labels for non-default user-owned settings. */
|
|
64
|
+
readonly customizations?: readonly string[];
|
|
52
65
|
readonly reviewer: {
|
|
53
66
|
readonly promptPosture: string;
|
|
54
67
|
readonly configuredModel: string | null;
|
|
@@ -63,7 +76,10 @@ export interface AutoReviewerStatusView {
|
|
|
63
76
|
readonly global: number;
|
|
64
77
|
readonly globalProjectConfigured: number;
|
|
65
78
|
readonly projectOverlayConfigured: number;
|
|
79
|
+
readonly repositoryConfigured: number;
|
|
66
80
|
readonly activeProject: number;
|
|
81
|
+
/** Configured or active append count, whichever is more informative. */
|
|
82
|
+
readonly total: number;
|
|
67
83
|
};
|
|
68
84
|
readonly promptOverrideConfigured?: boolean;
|
|
69
85
|
/** Plain-language current reviewer path for gray-area calls. */
|
|
@@ -149,7 +165,6 @@ export function buildAutoReviewerStatusView(input: {
|
|
|
149
165
|
const entries = input.policy.registry.entries;
|
|
150
166
|
const enabled = entries.filter((entry) => entry.availability.enabled).length;
|
|
151
167
|
const reviewer = input.policy.config.reviewer;
|
|
152
|
-
const snapshots = input.policy.config.sourceSnapshots;
|
|
153
168
|
const resolvedReviewerModel = resolveReviewerModel({
|
|
154
169
|
registry: reviewerModelRegistry(input.ctx),
|
|
155
170
|
spec: reviewer.model,
|
|
@@ -158,6 +173,7 @@ export function buildAutoReviewerStatusView(input: {
|
|
|
158
173
|
const modelHighCost =
|
|
159
174
|
resolvedReviewerModel.model !== undefined &&
|
|
160
175
|
isHighCostReviewerModel(resolvedReviewerModel.model.id);
|
|
176
|
+
const promptAppendCounts = reviewerPromptAppendCounts(input.policy.config);
|
|
161
177
|
const reviewerPath = resolveReviewerPath({
|
|
162
178
|
config: input.policy.config,
|
|
163
179
|
hasUI: hasHumanReviewUi(input.ctx),
|
|
@@ -170,6 +186,8 @@ export function buildAutoReviewerStatusView(input: {
|
|
|
170
186
|
cwd: projectCwd(input.ctx, input.policy),
|
|
171
187
|
},
|
|
172
188
|
mode: input.policy.config.mode,
|
|
189
|
+
gatedTools: [...(input.policy.config.gatedTools ?? [])],
|
|
190
|
+
customizations: customizationCategories(input.policy.config),
|
|
173
191
|
reviewer: {
|
|
174
192
|
promptPosture: reviewer.promptPosture,
|
|
175
193
|
configuredModel: reviewer.model,
|
|
@@ -185,13 +203,7 @@ export function buildAutoReviewerStatusView(input: {
|
|
|
185
203
|
contextMode: reviewer.contextMode,
|
|
186
204
|
tokenBudget: { ...reviewer.tokenBudget },
|
|
187
205
|
escalation: { ...reviewer.escalation },
|
|
188
|
-
promptAppends:
|
|
189
|
-
global: reviewer.promptAppends.length,
|
|
190
|
-
globalProjectConfigured:
|
|
191
|
-
snapshots?.global.reviewer.projectPromptAppends.length ?? 0,
|
|
192
|
-
projectOverlayConfigured: snapshots?.project.promptAppends.length ?? 0,
|
|
193
|
-
activeProject: reviewer.projectPromptAppends.length,
|
|
194
|
-
},
|
|
206
|
+
promptAppends: promptAppendCounts,
|
|
195
207
|
promptOverrideConfigured: reviewer.promptOverride !== null,
|
|
196
208
|
path: reviewerPath,
|
|
197
209
|
consequence: reviewerConsequence(reviewerPath),
|
|
@@ -460,6 +472,151 @@ function syntheticPackageRow(
|
|
|
460
472
|
};
|
|
461
473
|
}
|
|
462
474
|
|
|
475
|
+
function customizationCategories(
|
|
476
|
+
config: ResolvedPolicy["config"],
|
|
477
|
+
): readonly string[] {
|
|
478
|
+
const categories: string[] = [];
|
|
479
|
+
const snapshots = config.sourceSnapshots;
|
|
480
|
+
const reviewer = config.reviewer;
|
|
481
|
+
const promptAppendCounts = reviewerPromptAppendCounts(config);
|
|
482
|
+
|
|
483
|
+
if (reviewer.promptOverride !== null) categories.push("prompt override");
|
|
484
|
+
if (promptAppendCounts.total > 0) {
|
|
485
|
+
categories.push(`prompt appends (${promptAppendCounts.total})`);
|
|
486
|
+
}
|
|
487
|
+
if (reviewer.promptPosture !== DEFAULT_REVIEWER_PROMPT_POSTURE) {
|
|
488
|
+
categories.push("posture");
|
|
489
|
+
}
|
|
490
|
+
if (reviewer.model !== null) categories.push("model pin");
|
|
491
|
+
if (config.unknownToolPosture !== DEFAULT_UNKNOWN_TOOL_POSTURE) {
|
|
492
|
+
categories.push("unknown-tool posture");
|
|
493
|
+
}
|
|
494
|
+
const recentContext = reviewer.recentContext;
|
|
495
|
+
if (
|
|
496
|
+
reviewer.contextMode !== DEFAULT_REVIEWER_CONTEXT_MODE ||
|
|
497
|
+
recentContext.decisionLimit !== DEFAULT_REVIEWER_RECENT_CONTEXT.decisionLimit ||
|
|
498
|
+
recentContext.decisionWindow !== DEFAULT_REVIEWER_RECENT_CONTEXT.decisionWindow ||
|
|
499
|
+
(recentContext.conversationTurns ??
|
|
500
|
+
DEFAULT_REVIEWER_RECENT_CONTEXT.conversationTurns) !==
|
|
501
|
+
DEFAULT_REVIEWER_RECENT_CONTEXT.conversationTurns ||
|
|
502
|
+
(recentContext.userTurns ?? DEFAULT_REVIEWER_RECENT_CONTEXT.userTurns) !==
|
|
503
|
+
DEFAULT_REVIEWER_RECENT_CONTEXT.userTurns ||
|
|
504
|
+
recentContext.conversationCharLimit !==
|
|
505
|
+
DEFAULT_REVIEWER_RECENT_CONTEXT.conversationCharLimit
|
|
506
|
+
) {
|
|
507
|
+
categories.push("context");
|
|
508
|
+
}
|
|
509
|
+
if (
|
|
510
|
+
reviewer.tokenBudget.window !== DEFAULT_REVIEWER_TOKEN_BUDGET.window ||
|
|
511
|
+
reviewer.tokenBudget.limit !== DEFAULT_REVIEWER_TOKEN_BUDGET.limit
|
|
512
|
+
) {
|
|
513
|
+
categories.push("budget");
|
|
514
|
+
}
|
|
515
|
+
if (
|
|
516
|
+
reviewer.escalation.enabled !== DEFAULT_REVIEWER_ESCALATION.enabled ||
|
|
517
|
+
reviewer.escalation.denialLimit !==
|
|
518
|
+
DEFAULT_REVIEWER_ESCALATION.denialLimit ||
|
|
519
|
+
reviewer.escalation.window !== DEFAULT_REVIEWER_ESCALATION.window
|
|
520
|
+
) {
|
|
521
|
+
categories.push("escalation");
|
|
522
|
+
}
|
|
523
|
+
const gatedTools = config.gatedTools ?? [];
|
|
524
|
+
if (gatedTools.length > 0) {
|
|
525
|
+
categories.push(`gated tools (${gatedTools.length})`);
|
|
526
|
+
}
|
|
527
|
+
if (scopeIsCustomized(snapshots?.project.projectScope)) {
|
|
528
|
+
categories.push("scope");
|
|
529
|
+
}
|
|
530
|
+
const packCount = customizedPackCount(snapshots);
|
|
531
|
+
if (packCount > 0) categories.push(`packs (${packCount})`);
|
|
532
|
+
if (
|
|
533
|
+
config.display.reviewNote.mode !== DEFAULT_REVIEW_NOTE_DISPLAY.mode ||
|
|
534
|
+
config.display.reviewNote.showModelLabel !==
|
|
535
|
+
DEFAULT_REVIEW_NOTE_DISPLAY.showModelLabel ||
|
|
536
|
+
config.display.reviewNote.accent !== DEFAULT_REVIEW_NOTE_DISPLAY.accent
|
|
537
|
+
) {
|
|
538
|
+
categories.push("display");
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
return categories;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
function reviewerPromptAppendCounts(
|
|
545
|
+
config: ResolvedPolicy["config"],
|
|
546
|
+
): NonNullable<AutoReviewerStatusView["reviewer"]["promptAppends"]> {
|
|
547
|
+
const snapshots = config.sourceSnapshots;
|
|
548
|
+
const global = config.reviewer.promptAppends.length;
|
|
549
|
+
const globalProjectConfigured =
|
|
550
|
+
snapshots?.global.reviewer.projectPromptAppends.length ?? 0;
|
|
551
|
+
const projectOverlayConfigured = snapshots?.project.promptAppends.length ?? 0;
|
|
552
|
+
const repositoryConfigured = snapshots?.repository.promptAppends.length ?? 0;
|
|
553
|
+
const activeProject = config.reviewer.projectPromptAppends.length;
|
|
554
|
+
const configuredTotal =
|
|
555
|
+
global +
|
|
556
|
+
globalProjectConfigured +
|
|
557
|
+
projectOverlayConfigured +
|
|
558
|
+
repositoryConfigured;
|
|
559
|
+
const activeTotal = global + activeProject;
|
|
560
|
+
|
|
561
|
+
return {
|
|
562
|
+
global,
|
|
563
|
+
globalProjectConfigured,
|
|
564
|
+
projectOverlayConfigured,
|
|
565
|
+
repositoryConfigured,
|
|
566
|
+
activeProject,
|
|
567
|
+
total: Math.max(configuredTotal, activeTotal),
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
function scopeIsCustomized(scope: unknown): boolean {
|
|
572
|
+
if (scope === undefined || typeof scope !== "object" || scope === null) {
|
|
573
|
+
return false;
|
|
574
|
+
}
|
|
575
|
+
const value = scope as Record<string, unknown>;
|
|
576
|
+
return (
|
|
577
|
+
[
|
|
578
|
+
"roots",
|
|
579
|
+
"writableDirectories",
|
|
580
|
+
"tempDirectories",
|
|
581
|
+
"deniedDirectories",
|
|
582
|
+
"safeHomeDirectories",
|
|
583
|
+
"agentSupportDirectories",
|
|
584
|
+
].some((key) => Array.isArray(value[key]) && value[key].length > 0) ||
|
|
585
|
+
(value.safeHomeUseDefaults !== undefined &&
|
|
586
|
+
value.safeHomeUseDefaults !==
|
|
587
|
+
DEFAULT_PROJECT_SCOPE_BEHAVIOR.safeHomeUseDefaults) ||
|
|
588
|
+
(value.agentSupportUseDefaults !== undefined &&
|
|
589
|
+
value.agentSupportUseDefaults !==
|
|
590
|
+
DEFAULT_PROJECT_SCOPE_BEHAVIOR.agentSupportUseDefaults) ||
|
|
591
|
+
(value.unknownPathBehavior !== undefined &&
|
|
592
|
+
value.unknownPathBehavior !==
|
|
593
|
+
DEFAULT_PROJECT_SCOPE_BEHAVIOR.unknownPathBehavior) ||
|
|
594
|
+
(value.sensitivePathBehavior !== undefined &&
|
|
595
|
+
value.sensitivePathBehavior !==
|
|
596
|
+
DEFAULT_PROJECT_SCOPE_BEHAVIOR.sensitivePathBehavior) ||
|
|
597
|
+
(value.homePathBehavior !== undefined &&
|
|
598
|
+
value.homePathBehavior !== DEFAULT_PROJECT_SCOPE_BEHAVIOR.homePathBehavior)
|
|
599
|
+
);
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
function customizedPackCount(
|
|
603
|
+
snapshots: ResolvedPolicy["config"]["sourceSnapshots"],
|
|
604
|
+
): number {
|
|
605
|
+
if (snapshots === undefined) return 0;
|
|
606
|
+
const { global, project, repository } = snapshots;
|
|
607
|
+
return [
|
|
608
|
+
global.packs.length,
|
|
609
|
+
project.packs.length,
|
|
610
|
+
repository.packs.length,
|
|
611
|
+
global.packEnablement.enabledPackagePacks.length,
|
|
612
|
+
global.packEnablement.disabledPackagePacks.length,
|
|
613
|
+
global.packEnablement.disabledConfigPacks.length,
|
|
614
|
+
project.packEnablement.enabledPackagePacks.length,
|
|
615
|
+
project.packEnablement.disabledPackagePacks.length,
|
|
616
|
+
project.packEnablement.disabledConfigPacks.length,
|
|
617
|
+
].reduce((total, count) => total + count, 0);
|
|
618
|
+
}
|
|
619
|
+
|
|
463
620
|
function effectCopy(effect: PackEffectSummary): string {
|
|
464
621
|
switch (effect) {
|
|
465
622
|
case "deny-floor":
|
|
@@ -101,7 +101,7 @@ export async function handleClearanceCommand(
|
|
|
101
101
|
): Promise<CommandReport> {
|
|
102
102
|
const tokens = parseCommandArgs(args);
|
|
103
103
|
if (tokens.length === 0) {
|
|
104
|
-
return await
|
|
104
|
+
return await handleSetupCommand([], ctx, pi, deps);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
const command = tokens[0] as string;
|