snipara-companion 3.2.19 → 3.2.20
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/dist/index.d.ts +1534 -1502
- package/dist/index.js +17430 -17161
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2747,1640 +2747,1672 @@ interface CodingLedgerExportCommandOptions extends CodingLedgerBuildOptions {
|
|
|
2747
2747
|
declare function buildCodingIntelligenceLedger(options?: CodingLedgerBuildOptions): CodingIntelligenceLedger;
|
|
2748
2748
|
declare function codingLedgerExportCommand(options: CodingLedgerExportCommandOptions): Promise<void>;
|
|
2749
2749
|
|
|
2750
|
-
declare const
|
|
2751
|
-
type
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
files?: string[];
|
|
2756
|
-
branch?: string;
|
|
2757
|
-
actor?: string;
|
|
2758
|
-
next?: string;
|
|
2759
|
-
attention?: string;
|
|
2760
|
-
risk?: string;
|
|
2761
|
-
now?: Date;
|
|
2762
|
-
}
|
|
2763
|
-
interface TeamSyncWorkRecord {
|
|
2764
|
-
id: string;
|
|
2765
|
-
type: "work";
|
|
2766
|
-
summary: string;
|
|
2767
|
-
files: string[];
|
|
2768
|
-
branch?: string;
|
|
2769
|
-
actor?: string;
|
|
2770
|
-
status: TeamSyncWorkStatus;
|
|
2771
|
-
createdAt: string;
|
|
2772
|
-
updatedAt: string;
|
|
2773
|
-
completedAt?: string;
|
|
2774
|
-
completionReason?: string;
|
|
2775
|
-
archivedAt?: string;
|
|
2776
|
-
archiveReason?: string;
|
|
2777
|
-
}
|
|
2778
|
-
interface TeamSyncHandoffRecord {
|
|
2779
|
-
id: string;
|
|
2780
|
-
type: "handoff";
|
|
2781
|
-
summary: string;
|
|
2782
|
-
files: string[];
|
|
2783
|
-
next?: string;
|
|
2784
|
-
attention?: TeamSyncAttention;
|
|
2785
|
-
actor?: string;
|
|
2786
|
-
createdAt: string;
|
|
2787
|
-
}
|
|
2788
|
-
interface TeamSyncState {
|
|
2789
|
-
schemaVersion: "snipara.team-sync.v1";
|
|
2790
|
-
updatedAt: string;
|
|
2791
|
-
work: TeamSyncWorkRecord[];
|
|
2792
|
-
handoffs: TeamSyncHandoffRecord[];
|
|
2793
|
-
}
|
|
2794
|
-
interface TeamSyncSummary {
|
|
2795
|
-
activeWorkCount: number;
|
|
2796
|
-
staleWorkCount: number;
|
|
2797
|
-
completedWorkCount: number;
|
|
2798
|
-
archivedWorkCount: number;
|
|
2799
|
-
handoffCount: number;
|
|
2800
|
-
files: string[];
|
|
2801
|
-
staleWorkExplanation: TeamSyncStaleWorkExplanation;
|
|
2802
|
-
hygieneActions: TeamSyncHygieneAction[];
|
|
2803
|
-
latestActiveWork?: TeamSyncWorkRecord;
|
|
2804
|
-
latestStaleWork?: TeamSyncWorkRecord;
|
|
2805
|
-
latestCompletedWork?: TeamSyncWorkRecord;
|
|
2806
|
-
latestArchivedWork?: TeamSyncWorkRecord;
|
|
2807
|
-
latestHandoff?: TeamSyncHandoffRecord;
|
|
2808
|
-
}
|
|
2809
|
-
interface TeamSyncStaleWorkExplanation {
|
|
2810
|
-
staleAfterHours: number;
|
|
2811
|
-
autoArchiveAfterDays: number;
|
|
2812
|
-
activeStaleCount: number;
|
|
2813
|
-
autoArchivableCount: number;
|
|
2814
|
-
completedIgnoredCount: number;
|
|
2815
|
-
archivedIgnoredCount: number;
|
|
2816
|
-
latestStaleWorkAgeHours?: number;
|
|
2817
|
-
message: string;
|
|
2818
|
-
}
|
|
2819
|
-
interface TeamSyncHygieneAction {
|
|
2820
|
-
kind: "sweep-preview" | "sweep-archive" | "complete-work" | "handoff";
|
|
2821
|
-
command: string;
|
|
2750
|
+
declare const COLLABORATION_STATE_RELATIVE_PATH: string;
|
|
2751
|
+
type CollaborationGuardActionKind = "safe_to_ack" | "needs_handoff" | "needs_test" | "needs_package_review" | "blocking_conflict" | "guard_unavailable";
|
|
2752
|
+
interface CollaborationGuardActionCard {
|
|
2753
|
+
kind: CollaborationGuardActionKind;
|
|
2754
|
+
title: string;
|
|
2822
2755
|
reason: string;
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
files?: string[];
|
|
2829
|
-
branch?: string;
|
|
2830
|
-
actor?: string;
|
|
2831
|
-
next?: string;
|
|
2832
|
-
attention?: string;
|
|
2833
|
-
risk?: string;
|
|
2834
|
-
adapterPack?: boolean;
|
|
2835
|
-
adapterTarget?: string;
|
|
2836
|
-
context?: string[];
|
|
2837
|
-
proof?: string[];
|
|
2838
|
-
acceptance?: string[];
|
|
2839
|
-
conflictPosture?: string;
|
|
2840
|
-
since?: string;
|
|
2841
|
-
dir?: string;
|
|
2842
|
-
includeSessionContext?: boolean;
|
|
2843
|
-
emitOrchestratorHandoff?: boolean;
|
|
2844
|
-
autoRouteOrchestrator?: boolean;
|
|
2845
|
-
orchestratorPolicySource?: string;
|
|
2846
|
-
output?: string;
|
|
2847
|
-
days?: string;
|
|
2848
|
-
dryRun?: boolean;
|
|
2849
|
-
json?: boolean;
|
|
2756
|
+
severity: "info" | "watch" | "warning" | "critical";
|
|
2757
|
+
safeToAck: boolean;
|
|
2758
|
+
command?: string;
|
|
2759
|
+
conflictCode?: string;
|
|
2760
|
+
resource?: string;
|
|
2850
2761
|
}
|
|
2851
|
-
interface HostedAttempt<T> {
|
|
2762
|
+
interface HostedAttempt$1<T> {
|
|
2852
2763
|
status: "skipped" | "ok" | "error";
|
|
2853
2764
|
data?: T;
|
|
2854
2765
|
error?: string;
|
|
2855
2766
|
}
|
|
2856
|
-
interface
|
|
2857
|
-
|
|
2767
|
+
interface WorkflowCollaborationReceipt {
|
|
2768
|
+
workSessionId?: string;
|
|
2769
|
+
hostedSessionStatus: HostedAttempt$1<CollaborationSessionResponse>["status"];
|
|
2770
|
+
hostedClaimStatus?: HostedAttempt$1<CollaborationLeaseResponse>["status"];
|
|
2771
|
+
hostedReleaseStatus?: HostedAttempt$1<Array<{
|
|
2772
|
+
lease: CollaborationLeaseSummary;
|
|
2773
|
+
}>>["status"];
|
|
2774
|
+
hostedError?: string;
|
|
2775
|
+
files: string[];
|
|
2776
|
+
resourceCount: number;
|
|
2777
|
+
leaseCount: number;
|
|
2858
2778
|
statePath: string;
|
|
2859
|
-
|
|
2860
|
-
thresholdDays: number;
|
|
2861
|
-
thresholdMs: number;
|
|
2862
|
-
archivedCount: number;
|
|
2863
|
-
archivedWork: TeamSyncWorkRecord[];
|
|
2864
|
-
explanation: TeamSyncSweepExplanation;
|
|
2865
|
-
summary: TeamSyncSummary;
|
|
2866
|
-
}
|
|
2867
|
-
interface TeamSyncSweepExplanation {
|
|
2868
|
-
mode: "preview" | "archive";
|
|
2869
|
-
candidateCount: number;
|
|
2870
|
-
archivedCount: number;
|
|
2871
|
-
remainingStaleCount: number;
|
|
2872
|
-
message: string;
|
|
2873
|
-
}
|
|
2874
|
-
type AgenticHandoffAdapterTarget = "codex" | "claude-code" | "cursor" | "orca" | "windsurf" | "custom";
|
|
2875
|
-
type AgenticHandoffConflictPosture = "continue" | "wait" | "split_work" | "review_only" | "handoff";
|
|
2876
|
-
interface AgenticHandoffAdapterPack {
|
|
2877
|
-
version: "snipara.ade_adapter_pack.v1";
|
|
2878
|
-
target: {
|
|
2879
|
-
id: AgenticHandoffAdapterTarget;
|
|
2880
|
-
label: string;
|
|
2881
|
-
profile: string;
|
|
2882
|
-
instruction: string;
|
|
2883
|
-
runtimeControl: "handoff_only";
|
|
2884
|
-
};
|
|
2885
|
-
contextPack: {
|
|
2886
|
-
summary: string;
|
|
2887
|
-
files: string[];
|
|
2888
|
-
contextRefs: string[];
|
|
2889
|
-
workflow?: {
|
|
2890
|
-
goal?: string;
|
|
2891
|
-
status?: string;
|
|
2892
|
-
currentPhaseId?: string;
|
|
2893
|
-
currentPhaseTitle?: string;
|
|
2894
|
-
};
|
|
2895
|
-
resumeCommands: string[];
|
|
2896
|
-
constraints: string[];
|
|
2897
|
-
};
|
|
2898
|
-
conflictPosture: AgenticHandoffConflictPosture;
|
|
2899
|
-
proofGates: string[];
|
|
2900
|
-
acceptanceCriteria: string[];
|
|
2901
|
-
receiptExpectation: {
|
|
2902
|
-
required: boolean;
|
|
2903
|
-
command: string;
|
|
2904
|
-
requiredFields: string[];
|
|
2905
|
-
};
|
|
2906
|
-
prompt: string;
|
|
2907
|
-
caveats: string[];
|
|
2779
|
+
recordedAt: string;
|
|
2908
2780
|
}
|
|
2909
|
-
interface
|
|
2781
|
+
interface CollaborationCommandOptions {
|
|
2910
2782
|
summary?: string;
|
|
2911
|
-
workflowGoal?: string;
|
|
2912
2783
|
files?: string[];
|
|
2784
|
+
resources?: string[];
|
|
2785
|
+
actor?: string;
|
|
2786
|
+
actorId?: string;
|
|
2787
|
+
actorType?: string;
|
|
2788
|
+
sessionId?: string;
|
|
2789
|
+
workSessionId?: string;
|
|
2790
|
+
swarmId?: string;
|
|
2791
|
+
client?: string;
|
|
2792
|
+
repository?: string;
|
|
2793
|
+
branch?: string;
|
|
2794
|
+
worktree?: string;
|
|
2795
|
+
action?: string;
|
|
2796
|
+
profile?: string;
|
|
2797
|
+
mode?: string;
|
|
2913
2798
|
reason?: string;
|
|
2914
|
-
|
|
2799
|
+
ttlSeconds?: string;
|
|
2800
|
+
heartbeatTtlSeconds?: string;
|
|
2801
|
+
intervalSeconds?: string;
|
|
2802
|
+
maxFiles?: string;
|
|
2803
|
+
leaseId?: string;
|
|
2804
|
+
all?: boolean;
|
|
2805
|
+
once?: boolean;
|
|
2806
|
+
autoClaim?: boolean;
|
|
2807
|
+
releaseStale?: boolean;
|
|
2808
|
+
persist?: boolean;
|
|
2809
|
+
enforce?: boolean;
|
|
2810
|
+
ackReviewOnly?: boolean;
|
|
2811
|
+
dir?: string;
|
|
2812
|
+
json?: boolean;
|
|
2813
|
+
verbose?: boolean;
|
|
2814
|
+
}
|
|
2815
|
+
interface CollaborationHooksInstallOptions {
|
|
2816
|
+
dir?: string;
|
|
2915
2817
|
dryRun?: boolean;
|
|
2818
|
+
json?: boolean;
|
|
2916
2819
|
}
|
|
2917
|
-
interface
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2820
|
+
interface CollaborationLocalLeaseRecord {
|
|
2821
|
+
id: string;
|
|
2822
|
+
mode: CollaborationLeaseMode;
|
|
2823
|
+
status: CollaborationLeaseStatus;
|
|
2824
|
+
resources: CollaborationResource[];
|
|
2825
|
+
reason?: string;
|
|
2826
|
+
claimedAt?: string;
|
|
2827
|
+
expiresAt?: string | null;
|
|
2828
|
+
workSessionId?: string;
|
|
2829
|
+
}
|
|
2830
|
+
interface CollaborationLocalState {
|
|
2831
|
+
schemaVersion: "snipara.collaboration.v1";
|
|
2832
|
+
updatedAt: string;
|
|
2833
|
+
workSessionId?: string;
|
|
2834
|
+
sessionId?: string;
|
|
2835
|
+
actorId?: string;
|
|
2836
|
+
actorType?: CollaborationActorType;
|
|
2837
|
+
actorLabel?: string;
|
|
2838
|
+
client?: string;
|
|
2839
|
+
repository?: string;
|
|
2840
|
+
branch?: string;
|
|
2841
|
+
worktree?: string;
|
|
2842
|
+
task?: string;
|
|
2843
|
+
files: string[];
|
|
2844
|
+
resources: CollaborationResource[];
|
|
2845
|
+
leases: CollaborationLocalLeaseRecord[];
|
|
2846
|
+
lastGuard?: {
|
|
2847
|
+
decision: CollaborationGuardDecision;
|
|
2848
|
+
severity: string;
|
|
2849
|
+
checkedAt: string;
|
|
2850
|
+
action: string;
|
|
2851
|
+
resources: CollaborationResource[];
|
|
2852
|
+
conflictCount: number;
|
|
2934
2853
|
};
|
|
2935
|
-
suggestedCommands: string[];
|
|
2936
|
-
adapter?: AgenticHandoffAdapterPack;
|
|
2937
2854
|
}
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
declare function completeTeamSyncStateFromEvidence(rootDir?: string, options?: TeamSyncCompletionEvidenceOptions): TeamSyncWorkRecord[];
|
|
2949
|
-
declare function autoArchiveTeamSyncState(rootDir?: string, now?: Date): TeamSyncSweepResult["archivedWork"];
|
|
2950
|
-
declare function loadTeamSyncState(rootDir?: string): TeamSyncState;
|
|
2951
|
-
declare function saveTeamSyncState(state: TeamSyncState, rootDir?: string): void;
|
|
2952
|
-
declare function getTeamSyncStatePath(rootDir?: string): string;
|
|
2953
|
-
declare function buildAgenticHandoffMarkdown(artifact: AgenticHandoffArtifact): string;
|
|
2954
|
-
declare function teamSyncSweepCommand(options: TeamSyncCommandOptions): Promise<void>;
|
|
2955
|
-
|
|
2956
|
-
type SyncDocumentKind = "DOC" | "BINARY";
|
|
2957
|
-
type WorkflowMode = "lite" | "standard" | "auto" | "full" | "orchestrate";
|
|
2958
|
-
type OnboardFolderMode = "auto" | "business_context" | "code_project" | "mixed";
|
|
2959
|
-
type DetectedOnboardFolderMode = "business_context" | "code_project" | "mixed" | "unknown";
|
|
2960
|
-
type ManagedWorkflowStatus = "active" | "completed" | "blocked";
|
|
2961
|
-
type ManagedWorkflowPhaseStatus = "pending" | "in_progress" | "completed" | "blocked" | "skipped";
|
|
2962
|
-
type ReindexKind = "doc" | "code";
|
|
2963
|
-
type ReindexMode = "incremental" | "full";
|
|
2964
|
-
type ManagedWorkflowPlanSource = "file" | "inline";
|
|
2965
|
-
type TaskCommitOutcome = "completed" | "partial" | "blocked" | "abandoned";
|
|
2966
|
-
type ManagedWorkflowSchemaVersion = "snipara.workflow.v1" | "snipara.workflow.v2";
|
|
2967
|
-
declare const WORKFLOW_STATE_RELATIVE_PATH: string;
|
|
2968
|
-
declare const WORKFLOW_PLANS_RELATIVE_DIR: string;
|
|
2969
|
-
declare const PRODUCER_LOOP_ARTIFACT_VERSION: "snipara.producer_loop_artifact.v0";
|
|
2970
|
-
declare const PRODUCER_LOOP_REPORT_VERSION: "snipara.producer_loop_report.v0";
|
|
2971
|
-
declare const PRODUCER_LOOP_RELATIVE_DIR: string;
|
|
2972
|
-
type ProducerLoopProducerKind = "workflow_phase_commit" | "workflow_final_commit" | "pr_answer_pack_decision_capture";
|
|
2973
|
-
type ProducerLoopSampleReviewStatus = "sample_unreviewed" | "sample_reviewed" | "sample_rejected";
|
|
2974
|
-
interface ProducerLoopArtifactWriteResult {
|
|
2975
|
-
status: "written" | "error";
|
|
2976
|
-
schemaVersion: typeof PRODUCER_LOOP_ARTIFACT_VERSION;
|
|
2977
|
-
artifactId?: string;
|
|
2978
|
-
path?: string;
|
|
2979
|
-
relativePath?: string;
|
|
2980
|
-
artifactHash?: string;
|
|
2981
|
-
ledgerHash?: string;
|
|
2982
|
-
error?: string;
|
|
2983
|
-
caveats: string[];
|
|
2855
|
+
interface ResolvedCollaborationContext {
|
|
2856
|
+
rootDir: string;
|
|
2857
|
+
config: RLMConfig;
|
|
2858
|
+
actor: Required<Pick<CollaborationActorPayload, "actorId" | "actorType" | "actorLabel">> & {
|
|
2859
|
+
sessionId?: string;
|
|
2860
|
+
};
|
|
2861
|
+
client: string;
|
|
2862
|
+
branch?: string;
|
|
2863
|
+
repository?: string;
|
|
2864
|
+
worktree?: string;
|
|
2984
2865
|
}
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2866
|
+
declare function createEmptyCollaborationState(now?: Date): CollaborationLocalState;
|
|
2867
|
+
declare function getCollaborationStatePath(rootDir?: string): string;
|
|
2868
|
+
declare function loadCollaborationState(rootDir?: string): CollaborationLocalState;
|
|
2869
|
+
declare function saveCollaborationState(state: CollaborationLocalState, rootDir?: string): void;
|
|
2870
|
+
declare function buildCollaborationActor(options: Pick<CollaborationCommandOptions, "actor" | "actorId" | "actorType" | "sessionId" | "client">, config: RLMConfig): ResolvedCollaborationContext["actor"];
|
|
2871
|
+
declare function normalizeCollaborationFiles(files: string[] | undefined): string[];
|
|
2872
|
+
declare function parseCollaborationResources(values: string[] | undefined): CollaborationResource[];
|
|
2873
|
+
declare function deriveLocalCollaborationResourcesFromFiles(files: string[] | undefined, rootDir?: string, maxFiles?: number): CollaborationResource[];
|
|
2874
|
+
declare function buildCollaborationHooksInstallPlan(options?: CollaborationHooksInstallOptions): Record<string, unknown>;
|
|
2875
|
+
declare function collaborationIdeStatusCommand(options: CollaborationCommandOptions): Promise<void>;
|
|
2876
|
+
declare function buildCollaborationGuardActionCards(evaluation: CollaborationGuardEvaluation | undefined, context?: {
|
|
2877
|
+
profile?: string;
|
|
2878
|
+
enforced?: boolean;
|
|
2879
|
+
ackReviewOnly?: boolean;
|
|
2880
|
+
reviewOnlyAcknowledged?: boolean;
|
|
2881
|
+
}): CollaborationGuardActionCard[];
|
|
2882
|
+
interface HostedGuardPayload {
|
|
2999
2883
|
files: string[];
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
2884
|
+
resources: CollaborationResource[];
|
|
2885
|
+
fileCount: number;
|
|
2886
|
+
resourceCount: number;
|
|
2887
|
+
filesTruncated: boolean;
|
|
2888
|
+
resourcesTruncated: boolean;
|
|
3005
2889
|
}
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
2890
|
+
declare function buildHostedGuardPayload(files: string[], resources: CollaborationResource[]): HostedGuardPayload;
|
|
2891
|
+
declare function compactHostedGuardResources(resources: CollaborationResource[]): CollaborationResource[];
|
|
2892
|
+
|
|
2893
|
+
type RuntimeEnvironment = Record<string, string | undefined>;
|
|
2894
|
+
type ProviderKeySource = "environment" | "env-file";
|
|
2895
|
+
type OrchestratorRecommendationLevel = "suggest" | "confirm" | "auto";
|
|
2896
|
+
type OrchestratorRecommendationReason = "workflow_mode_orchestrate" | "production_validation_intent" | "proof_gate_intent" | "htask_or_swarm_intent" | "multi_agent_intent" | "parallel_worker_intent" | "changed_files_threshold" | "team_sync_collision" | "policy_auto_route";
|
|
2897
|
+
interface OrchestratorRecommendation {
|
|
2898
|
+
level: OrchestratorRecommendationLevel;
|
|
2899
|
+
reasons: OrchestratorRecommendationReason[];
|
|
2900
|
+
score: number;
|
|
2901
|
+
orchestratorRequired: boolean;
|
|
2902
|
+
policySource?: string;
|
|
2903
|
+
}
|
|
2904
|
+
interface OrchestratorRecommendationOptions {
|
|
2905
|
+
changedFilesCount?: number;
|
|
2906
|
+
hasActiveCollisions?: boolean;
|
|
2907
|
+
policyAutoRoute?: boolean;
|
|
2908
|
+
policySource?: string;
|
|
2909
|
+
adaptiveRoutingDryRun?: boolean;
|
|
2910
|
+
}
|
|
2911
|
+
interface RuntimeDetectionReport {
|
|
2912
|
+
cwd: string;
|
|
2913
|
+
workspaceRoot: string | null;
|
|
2914
|
+
companion: {
|
|
2915
|
+
configured: boolean;
|
|
2916
|
+
configPath: string;
|
|
3012
2917
|
};
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
2918
|
+
runtime: {
|
|
2919
|
+
cliAvailable: boolean;
|
|
2920
|
+
command?: string;
|
|
2921
|
+
legacyCommand?: boolean;
|
|
2922
|
+
version?: string;
|
|
2923
|
+
cliVersion?: string;
|
|
2924
|
+
installedPackageVersion?: string;
|
|
2925
|
+
versionMismatch?: boolean;
|
|
2926
|
+
mcpConfigured: boolean;
|
|
2927
|
+
mcpConfigPaths: string[];
|
|
3018
2928
|
};
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
reasonCodes: {
|
|
3027
|
-
counts: Record<string, number>;
|
|
2929
|
+
orchestrator: {
|
|
2930
|
+
cliAvailable: boolean;
|
|
2931
|
+
command?: string;
|
|
2932
|
+
version?: string;
|
|
2933
|
+
source?: "path" | "workspace_venv";
|
|
2934
|
+
workspacePackageVersion?: string;
|
|
2935
|
+
versionMismatch?: boolean;
|
|
3028
2936
|
};
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
notes: string[];
|
|
2937
|
+
providerKeys: {
|
|
2938
|
+
openai: boolean;
|
|
2939
|
+
anthropic: boolean;
|
|
2940
|
+
any: boolean;
|
|
2941
|
+
sources: {
|
|
2942
|
+
openai?: ProviderKeySource;
|
|
2943
|
+
anthropic?: ProviderKeySource;
|
|
2944
|
+
};
|
|
2945
|
+
envFilesLoaded: string[];
|
|
3039
2946
|
};
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
}
|
|
3043
|
-
type WorkflowPlanPreset = "memory-backend-unification" | "project-intelligence-continuity-layer";
|
|
3044
|
-
interface WorkflowPlanScaffoldDocument {
|
|
3045
|
-
preset: WorkflowPlanPreset;
|
|
3046
|
-
mode: "full";
|
|
3047
|
-
goal: string;
|
|
3048
|
-
steps: Array<{
|
|
3049
|
-
id: string;
|
|
3050
|
-
title: string;
|
|
3051
|
-
query: string;
|
|
3052
|
-
acceptance?: string;
|
|
3053
|
-
files?: string[];
|
|
3054
|
-
gates?: string[];
|
|
3055
|
-
needs_runtime?: boolean;
|
|
3056
|
-
}>;
|
|
3057
|
-
}
|
|
3058
|
-
interface ManagedWorkflowRuntimeCheckpoint {
|
|
3059
|
-
summary: string;
|
|
3060
|
-
capturedAt: string;
|
|
3061
|
-
automationSessionId?: string;
|
|
3062
|
-
hostedEventId?: string;
|
|
3063
|
-
hostedRecordedAt?: string;
|
|
3064
|
-
environment?: string;
|
|
3065
|
-
profile?: string;
|
|
3066
|
-
bootstrapQuery?: string;
|
|
3067
|
-
files?: string[];
|
|
3068
|
-
commands?: string[];
|
|
3069
|
-
artifacts?: string[];
|
|
3070
|
-
contextPackReceipts?: LocalContextPackReceiptPayload[];
|
|
3071
|
-
rehydratableState?: Record<string, unknown>;
|
|
3072
|
-
}
|
|
3073
|
-
interface ManagedWorkflowSandboxRuntimeBinding {
|
|
3074
|
-
phaseId: string;
|
|
3075
|
-
sessionId: string;
|
|
3076
|
-
automationSessionId?: string;
|
|
3077
|
-
boundAt: string;
|
|
3078
|
-
bootstrapQuery: string;
|
|
3079
|
-
environment?: string;
|
|
3080
|
-
profile?: string;
|
|
3081
|
-
artifacts?: string[];
|
|
3082
|
-
lastCheckpoint?: ManagedWorkflowRuntimeCheckpoint;
|
|
3083
|
-
}
|
|
3084
|
-
interface ManagedWorkflowRuntimeState {
|
|
3085
|
-
sandbox?: {
|
|
3086
|
-
provider: "snipara-sandbox";
|
|
3087
|
-
bindings: ManagedWorkflowSandboxRuntimeBinding[];
|
|
2947
|
+
docker: {
|
|
2948
|
+
available: boolean;
|
|
3088
2949
|
};
|
|
3089
2950
|
}
|
|
3090
|
-
|
|
2951
|
+
declare function detectRuntimeEnvironment(cwd?: string, env?: RuntimeEnvironment): RuntimeDetectionReport;
|
|
2952
|
+
declare function shouldSuggestRuntimeForWorkflow(query: string, mode: WorkflowMode): boolean;
|
|
2953
|
+
/**
|
|
2954
|
+
* Recommend whether work should be routed to snipara-orchestrator.
|
|
2955
|
+
*
|
|
2956
|
+
* Scores intent signals from the query and workflow mode (orchestrate mode,
|
|
2957
|
+
* production / proof / htask / multi-agent / parallel patterns) plus contextual
|
|
2958
|
+
* signals (changed-file count, active Team Sync collisions, policy auto-route).
|
|
2959
|
+
* The returned recommendation's level escalates with the accumulated score
|
|
2960
|
+
* (suggest → confirm → auto).
|
|
2961
|
+
*
|
|
2962
|
+
* @returns A recommendation with its reasons, or `null` when no signal fires.
|
|
2963
|
+
*/
|
|
2964
|
+
declare function getOrchestratorRecommendation(query: string, mode: WorkflowMode, options?: OrchestratorRecommendationOptions): OrchestratorRecommendation | null;
|
|
2965
|
+
declare function formatOrchestratorRecommendationReason(reason: OrchestratorRecommendationReason): string;
|
|
2966
|
+
declare function shouldSuggestOrchestratorForWorkflow(query: string, mode: WorkflowMode): boolean;
|
|
2967
|
+
|
|
2968
|
+
declare const ORCHESTRATOR_HANDOFF_RELATIVE_PATH: string;
|
|
2969
|
+
interface OrchestratorHandoffWorkflowPhase {
|
|
3091
2970
|
id: string;
|
|
3092
2971
|
title: string;
|
|
3093
2972
|
query: string;
|
|
3094
|
-
status:
|
|
2973
|
+
status: string;
|
|
3095
2974
|
acceptance?: string;
|
|
3096
|
-
files
|
|
3097
|
-
gates
|
|
3098
|
-
needsRuntime
|
|
3099
|
-
startedAt?: string;
|
|
3100
|
-
completedAt?: string;
|
|
3101
|
-
summary?: string;
|
|
3102
|
-
outcome?: TaskCommitOutcome;
|
|
3103
|
-
}
|
|
3104
|
-
interface ManagedWorkflowState {
|
|
3105
|
-
schemaVersion: ManagedWorkflowSchemaVersion;
|
|
3106
|
-
workflowId: string;
|
|
3107
|
-
goal: string;
|
|
3108
|
-
status: ManagedWorkflowStatus;
|
|
3109
|
-
currentPhaseId?: string;
|
|
3110
|
-
planSource: ManagedWorkflowPlanSource;
|
|
3111
|
-
planFile?: string;
|
|
3112
|
-
createdAt: string;
|
|
3113
|
-
updatedAt: string;
|
|
3114
|
-
phases: ManagedWorkflowPhase[];
|
|
3115
|
-
runtime?: ManagedWorkflowRuntimeState;
|
|
3116
|
-
lastCommit?: {
|
|
3117
|
-
category: string;
|
|
3118
|
-
outcome: TaskCommitOutcome;
|
|
3119
|
-
summary: string;
|
|
3120
|
-
committedAt: string;
|
|
3121
|
-
};
|
|
3122
|
-
}
|
|
3123
|
-
interface AgenticWorkStatus {
|
|
3124
|
-
version: "snipara.agentic_status.v1";
|
|
3125
|
-
generatedAt: string;
|
|
3126
|
-
branch?: string;
|
|
3127
|
-
git: {
|
|
3128
|
-
head?: string;
|
|
3129
|
-
dirtyFileCount: number;
|
|
3130
|
-
statusLines: string[];
|
|
3131
|
-
error?: string;
|
|
3132
|
-
};
|
|
3133
|
-
workflow: {
|
|
3134
|
-
id: string;
|
|
3135
|
-
goal: string;
|
|
3136
|
-
status: ManagedWorkflowStatus;
|
|
3137
|
-
currentPhase?: {
|
|
3138
|
-
id: string;
|
|
3139
|
-
title: string;
|
|
3140
|
-
status: ManagedWorkflowPhaseStatus;
|
|
3141
|
-
};
|
|
3142
|
-
lastPhaseCommit?: {
|
|
3143
|
-
phaseId: string;
|
|
3144
|
-
title: string;
|
|
3145
|
-
summary?: string;
|
|
3146
|
-
outcome?: TaskCommitOutcome;
|
|
3147
|
-
completedAt?: string;
|
|
3148
|
-
};
|
|
3149
|
-
resumeCommand: string;
|
|
3150
|
-
} | null;
|
|
3151
|
-
teamSync: {
|
|
3152
|
-
activeWorkCount: number;
|
|
3153
|
-
staleWorkCount: number;
|
|
3154
|
-
staleWorkExplanation: TeamSyncStaleWorkExplanation;
|
|
3155
|
-
archivedWorkCount: number;
|
|
3156
|
-
handoffCount: number;
|
|
3157
|
-
latestHandoff?: {
|
|
3158
|
-
summary: string;
|
|
3159
|
-
next?: string;
|
|
3160
|
-
attention?: string;
|
|
3161
|
-
createdAt: string;
|
|
3162
|
-
};
|
|
3163
|
-
};
|
|
3164
|
-
risks: string[];
|
|
3165
|
-
openDecisions: {
|
|
3166
|
-
count?: number;
|
|
3167
|
-
note: string;
|
|
3168
|
-
};
|
|
3169
|
-
operationalLoop: {
|
|
3170
|
-
status: "clear" | "attention" | "blocked";
|
|
3171
|
-
decisionRequestCount: number;
|
|
3172
|
-
receiptGapCount: number;
|
|
3173
|
-
nextActions: string[];
|
|
3174
|
-
receiptActions: string[];
|
|
3175
|
-
caveats: string[];
|
|
3176
|
-
};
|
|
3177
|
-
suggestedNextAction: string;
|
|
2975
|
+
files: string[];
|
|
2976
|
+
gates: string[];
|
|
2977
|
+
needsRuntime: boolean;
|
|
3178
2978
|
}
|
|
3179
|
-
interface
|
|
3180
|
-
|
|
3181
|
-
kind: string;
|
|
2979
|
+
interface OrchestratorHandoffRuntimeSandboxPhase {
|
|
2980
|
+
phaseId: string;
|
|
3182
2981
|
title: string;
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
|
|
2982
|
+
bootstrapQuery: string;
|
|
2983
|
+
files: string[];
|
|
2984
|
+
artifacts: string[];
|
|
2985
|
+
contextPacks: string[];
|
|
2986
|
+
sessionId: string | null;
|
|
2987
|
+
environment: string | null;
|
|
2988
|
+
profile: string | null;
|
|
2989
|
+
hasCheckpoint: boolean;
|
|
2990
|
+
checkpointSummary: string | null;
|
|
2991
|
+
checkpointCapturedAt: string | null;
|
|
3186
2992
|
}
|
|
3187
|
-
interface
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
2993
|
+
interface AdaptiveWorkProfile {
|
|
2994
|
+
taskType: string;
|
|
2995
|
+
risk: string;
|
|
2996
|
+
scope: string[];
|
|
2997
|
+
contextBudget: string;
|
|
2998
|
+
reasoningDepth: string;
|
|
2999
|
+
evidenceRequirements?: string[];
|
|
3000
|
+
preferredProfileStrengths?: string[];
|
|
3001
|
+
notes?: string[];
|
|
3192
3002
|
}
|
|
3193
|
-
interface
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3003
|
+
interface AdaptiveModelRequirements {
|
|
3004
|
+
workerRole: string;
|
|
3005
|
+
reasoning: string;
|
|
3006
|
+
plannerRetainsReasoning: boolean;
|
|
3007
|
+
speed: string;
|
|
3008
|
+
cost: string;
|
|
3009
|
+
contextBudget: string;
|
|
3010
|
+
capabilities: string[];
|
|
3011
|
+
forbiddenCapabilities: string[];
|
|
3012
|
+
writeScope: string[];
|
|
3013
|
+
structuredOutputRequired?: boolean;
|
|
3014
|
+
preferredEndpointTypes?: string[];
|
|
3015
|
+
allowedEndpointTypes?: string[];
|
|
3016
|
+
catalogLimit?: number;
|
|
3017
|
+
dailyBudgetCents?: number;
|
|
3018
|
+
monthlyBudgetCents?: number;
|
|
3019
|
+
fallback: "main_agent";
|
|
3199
3020
|
}
|
|
3200
|
-
interface
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
summary?: string;
|
|
3204
|
-
outcome?: TaskCommitOutcome;
|
|
3205
|
-
completedAt?: string;
|
|
3206
|
-
files: string[];
|
|
3207
|
-
filesInUnpushedDiff: string[];
|
|
3021
|
+
interface AdaptiveRoutingCostEstimate {
|
|
3022
|
+
currency: "USD";
|
|
3023
|
+
confidence: "low" | "medium" | "high";
|
|
3208
3024
|
}
|
|
3209
|
-
interface
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
baseSha?: string;
|
|
3221
|
-
headSha?: string;
|
|
3222
|
-
};
|
|
3223
|
-
unpushed: {
|
|
3224
|
-
commitCount: number;
|
|
3225
|
-
commits: WorkflowImpactGateCommit[];
|
|
3226
|
-
changedFiles: string[];
|
|
3227
|
-
codeChangedFiles: string[];
|
|
3228
|
-
nonCodeChangedFiles: string[];
|
|
3229
|
-
};
|
|
3230
|
-
dirtyWorkingTree: {
|
|
3231
|
-
fileCount: number;
|
|
3232
|
-
statusLines: string[];
|
|
3233
|
-
files: string[];
|
|
3234
|
-
includedInLocalImpact: false;
|
|
3235
|
-
};
|
|
3236
|
-
workflow: {
|
|
3237
|
-
id?: string;
|
|
3238
|
-
goal?: string;
|
|
3239
|
-
status?: ManagedWorkflowStatus;
|
|
3240
|
-
completedPhases: WorkflowImpactGatePhase[];
|
|
3241
|
-
changedFilesWithoutPhase: string[];
|
|
3242
|
-
phaseFilesOutsideUnpushedDiff: string[];
|
|
3243
|
-
};
|
|
3244
|
-
localImpact: Record<string, unknown> | null;
|
|
3245
|
-
recommendedActions: string[];
|
|
3246
|
-
caveats: string[];
|
|
3247
|
-
hostedFollowUpCommand?: string;
|
|
3025
|
+
interface AdaptiveRoutingCard {
|
|
3026
|
+
mode: "dry_run";
|
|
3027
|
+
workProfile: AdaptiveWorkProfile;
|
|
3028
|
+
requirements: AdaptiveModelRequirements;
|
|
3029
|
+
recommendedWorkerClass: string;
|
|
3030
|
+
costEstimate: AdaptiveRoutingCostEstimate;
|
|
3031
|
+
humanApprovalRequired: boolean;
|
|
3032
|
+
fallback: "main_agent";
|
|
3033
|
+
rejectedReasons?: Record<string, string[]>;
|
|
3034
|
+
reasons: string[];
|
|
3035
|
+
warnings: string[];
|
|
3248
3036
|
}
|
|
3249
|
-
interface
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3037
|
+
interface AdaptiveRoutingGatewayStatus {
|
|
3038
|
+
source: "hosted_mcp" | "local_orchestrator";
|
|
3039
|
+
success: boolean;
|
|
3040
|
+
resolutionStatus?: string;
|
|
3041
|
+
candidateCount: number;
|
|
3042
|
+
fallback?: string;
|
|
3043
|
+
warnings: string[];
|
|
3255
3044
|
}
|
|
3256
|
-
interface
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3045
|
+
interface AdaptiveRoutingRuntimeCatalog {
|
|
3046
|
+
version?: string;
|
|
3047
|
+
source?: string;
|
|
3048
|
+
provider?: string;
|
|
3049
|
+
baseUrl?: string;
|
|
3050
|
+
models?: string[];
|
|
3051
|
+
apiPaths?: Record<string, unknown>;
|
|
3052
|
+
workerEndpoints?: Record<string, Record<string, unknown>>;
|
|
3053
|
+
workerProfiles?: Record<string, Record<string, unknown>>;
|
|
3054
|
+
candidates: Array<Record<string, unknown>>;
|
|
3263
3055
|
}
|
|
3264
|
-
interface
|
|
3265
|
-
|
|
3266
|
-
|
|
3056
|
+
interface AdaptiveRoutingResolution {
|
|
3057
|
+
status?: string;
|
|
3058
|
+
selected?: Record<string, unknown>;
|
|
3059
|
+
policyDecision?: Record<string, unknown>;
|
|
3060
|
+
evaluatedCount?: number;
|
|
3061
|
+
rejectedCount?: number;
|
|
3062
|
+
fallback?: string;
|
|
3063
|
+
reasons?: string[];
|
|
3064
|
+
warnings?: string[];
|
|
3065
|
+
rejectedReasons?: Record<string, string[]>;
|
|
3267
3066
|
}
|
|
3268
|
-
interface
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
size_bytes: number;
|
|
3276
|
-
content_hash: string;
|
|
3277
|
-
assetClass?: string;
|
|
3278
|
-
usageMode?: string;
|
|
3279
|
-
sourceKind?: string;
|
|
3067
|
+
interface AdaptiveWorkRoutingRecommendation {
|
|
3068
|
+
workProfile: AdaptiveWorkProfile;
|
|
3069
|
+
requirements: AdaptiveModelRequirements;
|
|
3070
|
+
routingCard: AdaptiveRoutingCard;
|
|
3071
|
+
gateway?: AdaptiveRoutingGatewayStatus;
|
|
3072
|
+
runtimeCatalog?: AdaptiveRoutingRuntimeCatalog;
|
|
3073
|
+
resolution?: AdaptiveRoutingResolution;
|
|
3280
3074
|
}
|
|
3281
|
-
interface
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
created: null;
|
|
3295
|
-
updated: null;
|
|
3296
|
-
unchanged: null;
|
|
3297
|
-
missing_from_manifest: null;
|
|
3298
|
-
note: string;
|
|
3299
|
-
documents: SyncDocumentsDryRunItem[];
|
|
3300
|
-
}
|
|
3301
|
-
interface OnboardFolderScannedFile {
|
|
3302
|
-
path: string;
|
|
3303
|
-
size_bytes: number;
|
|
3304
|
-
supported: boolean;
|
|
3305
|
-
kind?: SyncDocumentKind;
|
|
3306
|
-
format?: string;
|
|
3307
|
-
}
|
|
3308
|
-
interface OnboardFolderClassification {
|
|
3309
|
-
mode: DetectedOnboardFolderMode;
|
|
3310
|
-
detected_mode: DetectedOnboardFolderMode;
|
|
3311
|
-
confidence: number;
|
|
3312
|
-
code_score: number;
|
|
3313
|
-
business_score: number;
|
|
3314
|
-
signals: {
|
|
3315
|
-
code: string[];
|
|
3316
|
-
business: string[];
|
|
3317
|
-
};
|
|
3075
|
+
interface AdaptiveWorkRoutingOptions {
|
|
3076
|
+
query: string;
|
|
3077
|
+
mode?: string;
|
|
3078
|
+
changedFiles?: string[];
|
|
3079
|
+
preferredEndpointTypes?: string[];
|
|
3080
|
+
allowedEndpointTypes?: string[];
|
|
3081
|
+
workerRole?: string;
|
|
3082
|
+
plannerRetainsReasoning?: boolean;
|
|
3083
|
+
preferredProfileStrengths?: string[];
|
|
3084
|
+
structuredOutputRequired?: boolean;
|
|
3085
|
+
catalogLimit?: number;
|
|
3086
|
+
dailyBudgetCents?: number;
|
|
3087
|
+
monthlyBudgetCents?: number;
|
|
3318
3088
|
}
|
|
3319
|
-
interface
|
|
3320
|
-
schemaVersion: "snipara.
|
|
3089
|
+
interface OrchestratorHandoffArtifact {
|
|
3090
|
+
schemaVersion: "snipara.orchestrator.handoff.v1";
|
|
3321
3091
|
source: {
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
sourceUri?: string;
|
|
3326
|
-
snapshotAt: string;
|
|
3327
|
-
recursive: boolean;
|
|
3092
|
+
client: "snipara-companion";
|
|
3093
|
+
command: string;
|
|
3094
|
+
generatedAt: string;
|
|
3328
3095
|
};
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
unsupported_business_files: number;
|
|
3096
|
+
workflow: {
|
|
3097
|
+
mode: string;
|
|
3098
|
+
workflowId: string | null;
|
|
3099
|
+
currentPhaseId: string | null;
|
|
3100
|
+
phases: OrchestratorHandoffWorkflowPhase[];
|
|
3335
3101
|
};
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
reindexKind: ReindexKind;
|
|
3342
|
-
reindexMode: ReindexMode;
|
|
3343
|
-
deleteMissing: boolean;
|
|
3344
|
-
metadata: Record<string, unknown>;
|
|
3345
|
-
documents: SyncDocumentInput[];
|
|
3102
|
+
runtime: {
|
|
3103
|
+
sandbox: {
|
|
3104
|
+
provider: "snipara-sandbox";
|
|
3105
|
+
phases: OrchestratorHandoffRuntimeSandboxPhase[];
|
|
3106
|
+
} | null;
|
|
3346
3107
|
};
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
}
|
|
3358
|
-
interface WorkflowTokenBudgetReport {
|
|
3359
|
-
requested_max_tokens: number;
|
|
3360
|
-
allocations: {
|
|
3361
|
-
critical_memory_tokens: number;
|
|
3362
|
-
session_context_tokens: number;
|
|
3363
|
-
context_query_tokens: number;
|
|
3364
|
-
shared_context_tokens: number;
|
|
3365
|
-
plan_tokens: number;
|
|
3108
|
+
routing: {
|
|
3109
|
+
level: OrchestratorRecommendation["level"];
|
|
3110
|
+
reasons: OrchestratorRecommendation["reasons"];
|
|
3111
|
+
policySource: string | null;
|
|
3112
|
+
workProfile?: AdaptiveWorkProfile;
|
|
3113
|
+
requirements?: AdaptiveModelRequirements;
|
|
3114
|
+
routingCard?: AdaptiveRoutingCard;
|
|
3115
|
+
gateway?: AdaptiveRoutingGatewayStatus;
|
|
3116
|
+
runtimeCatalog?: AdaptiveRoutingRuntimeCatalog;
|
|
3117
|
+
resolution?: AdaptiveRoutingResolution;
|
|
3366
3118
|
};
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
max_context_tokens: boolean;
|
|
3119
|
+
task: {
|
|
3120
|
+
title: string;
|
|
3121
|
+
query: string;
|
|
3122
|
+
summary: string;
|
|
3372
3123
|
};
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3124
|
+
repo: {
|
|
3125
|
+
root: string;
|
|
3126
|
+
branch: string | null;
|
|
3127
|
+
headSha: string | null;
|
|
3128
|
+
changedFiles: string[];
|
|
3129
|
+
};
|
|
3130
|
+
coordination: {
|
|
3131
|
+
swarmId: string | null;
|
|
3132
|
+
claimScope: {
|
|
3133
|
+
files: string[];
|
|
3134
|
+
symbols: string[];
|
|
3135
|
+
};
|
|
3136
|
+
htask: {
|
|
3137
|
+
featureTitle: string | null;
|
|
3138
|
+
workstreams: string[];
|
|
3139
|
+
};
|
|
3140
|
+
};
|
|
3141
|
+
validation: {
|
|
3142
|
+
requiresProofGate: boolean;
|
|
3143
|
+
requiresDriftCheck: boolean;
|
|
3144
|
+
liveChecks: string[];
|
|
3145
|
+
requiredEvidence: Array<{
|
|
3146
|
+
type: string;
|
|
3147
|
+
description: string;
|
|
3148
|
+
}>;
|
|
3149
|
+
};
|
|
3150
|
+
memory: {
|
|
3151
|
+
decisionIds: string[];
|
|
3152
|
+
contextRefs: string[];
|
|
3153
|
+
resumeSummary: string | null;
|
|
3383
3154
|
};
|
|
3384
|
-
total_tokens?: number;
|
|
3385
|
-
oldest_memory_age_days?: number;
|
|
3386
3155
|
}
|
|
3387
|
-
interface
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3156
|
+
interface OrchestratorHandoffOptions {
|
|
3157
|
+
sourceCommand: string;
|
|
3158
|
+
recommendation: OrchestratorRecommendation;
|
|
3159
|
+
query: string;
|
|
3160
|
+
summary: string;
|
|
3161
|
+
title?: string;
|
|
3162
|
+
mode?: string;
|
|
3163
|
+
rootDir?: string;
|
|
3164
|
+
changedFiles?: string[];
|
|
3165
|
+
contextRefs?: string[];
|
|
3166
|
+
decisionIds?: string[];
|
|
3167
|
+
resumeSummary?: string;
|
|
3168
|
+
featureTitle?: string;
|
|
3169
|
+
workstreams?: string[];
|
|
3170
|
+
adaptiveRouting?: AdaptiveWorkRoutingRecommendation | null;
|
|
3393
3171
|
}
|
|
3394
|
-
interface
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
generatedAt: string;
|
|
3400
|
-
steps: Array<{
|
|
3401
|
-
id: string;
|
|
3402
|
-
title: string;
|
|
3403
|
-
query: string;
|
|
3404
|
-
acceptance?: string;
|
|
3405
|
-
files?: string[];
|
|
3406
|
-
needs_runtime?: boolean;
|
|
3407
|
-
}>;
|
|
3172
|
+
interface WrittenOrchestratorHandoff {
|
|
3173
|
+
handoff: OrchestratorHandoffArtifact;
|
|
3174
|
+
path: string;
|
|
3175
|
+
relativePath: string;
|
|
3176
|
+
command: string;
|
|
3408
3177
|
}
|
|
3409
|
-
declare function
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3178
|
+
declare function buildOrchestratorHandoff(options: OrchestratorHandoffOptions): OrchestratorHandoffArtifact;
|
|
3179
|
+
declare function buildAdaptiveWorkRoutingRecommendation(options: AdaptiveWorkRoutingOptions): AdaptiveWorkRoutingRecommendation;
|
|
3180
|
+
declare function writeOrchestratorHandoff(options: OrchestratorHandoffOptions): WrittenOrchestratorHandoff;
|
|
3181
|
+
|
|
3182
|
+
interface JournalCheckpointPayload {
|
|
3183
|
+
action: string;
|
|
3184
|
+
summary: string;
|
|
3185
|
+
outcome?: string;
|
|
3186
|
+
workflowId?: string;
|
|
3187
|
+
phaseId?: string;
|
|
3188
|
+
phaseTitle?: string;
|
|
3189
|
+
branch?: string;
|
|
3190
|
+
actor?: string;
|
|
3191
|
+
next?: string;
|
|
3192
|
+
attention?: string;
|
|
3193
|
+
files?: string[];
|
|
3418
3194
|
cwd?: string;
|
|
3419
|
-
}
|
|
3420
|
-
declare function
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3195
|
+
}
|
|
3196
|
+
declare function buildJournalCheckpointEntry(payload: JournalCheckpointPayload): {
|
|
3197
|
+
text: string;
|
|
3198
|
+
tags: string[];
|
|
3199
|
+
};
|
|
3200
|
+
|
|
3201
|
+
declare const TEAM_SYNC_STATE_RELATIVE_PATH: string;
|
|
3202
|
+
type TeamSyncAttention = "note" | "watch" | "review" | "proof";
|
|
3203
|
+
type TeamSyncWorkStatus = "active" | "completed" | "archived";
|
|
3204
|
+
interface TeamSyncRecordInput {
|
|
3205
|
+
summary: string;
|
|
3206
|
+
files?: string[];
|
|
3207
|
+
branch?: string;
|
|
3208
|
+
actor?: string;
|
|
3209
|
+
next?: string;
|
|
3210
|
+
attention?: string;
|
|
3211
|
+
risk?: string;
|
|
3424
3212
|
now?: Date;
|
|
3425
|
-
}
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
}): SessionBootstrapQualityReport;
|
|
3430
|
-
declare function buildGeneratedWorkflowPlanDocument(plan: Record<string, unknown>, fallbackGoal: string): GeneratedWorkflowPlanDocument;
|
|
3431
|
-
declare function normalizeWorkflowPlanInput(input: unknown, fallbackGoal: string): ManagedWorkflowPhase[];
|
|
3432
|
-
declare function buildWorkflowPlanScaffold(preset: WorkflowPlanPreset, options?: {
|
|
3433
|
-
goal?: string;
|
|
3434
|
-
outputPath?: string;
|
|
3435
|
-
cwd?: string;
|
|
3436
|
-
}): WorkflowPlanScaffoldResult;
|
|
3437
|
-
declare function writeProducerLoopArtifact(options: {
|
|
3438
|
-
kind: ProducerLoopProducerKind;
|
|
3439
|
-
command: "workflow phase-commit" | "workflow final-commit";
|
|
3440
|
-
state?: ManagedWorkflowState;
|
|
3441
|
-
phase?: ManagedWorkflowPhase;
|
|
3442
|
-
category: string;
|
|
3443
|
-
outcome: TaskCommitOutcome;
|
|
3213
|
+
}
|
|
3214
|
+
interface TeamSyncWorkRecord {
|
|
3215
|
+
id: string;
|
|
3216
|
+
type: "work";
|
|
3444
3217
|
summary: string;
|
|
3445
|
-
files
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3218
|
+
files: string[];
|
|
3219
|
+
branch?: string;
|
|
3220
|
+
actor?: string;
|
|
3221
|
+
status: TeamSyncWorkStatus;
|
|
3222
|
+
createdAt: string;
|
|
3223
|
+
updatedAt: string;
|
|
3224
|
+
completedAt?: string;
|
|
3225
|
+
completionReason?: string;
|
|
3226
|
+
archivedAt?: string;
|
|
3227
|
+
archiveReason?: string;
|
|
3228
|
+
}
|
|
3229
|
+
interface TeamSyncHandoffRecord {
|
|
3230
|
+
id: string;
|
|
3231
|
+
type: "handoff";
|
|
3456
3232
|
summary: string;
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
* Compares `upstream..HEAD`, separates unpushed code changes from non-code and
|
|
3463
|
-
* dirty working-tree files, runs local code-overlay impact on the committed
|
|
3464
|
-
* code files, and maps the result back to completed workflow phases. Surfaces
|
|
3465
|
-
* reason codes such as `dirty_working_tree_not_included` and phase files that
|
|
3466
|
-
* fall outside the unpushed diff, so a phase is not treated as verified on
|
|
3467
|
-
* stale or partial evidence.
|
|
3468
|
-
*
|
|
3469
|
-
* @returns A `WorkflowImpactGateResult` with changed files, local impact,
|
|
3470
|
-
* matched phases, and reason codes.
|
|
3471
|
-
*/
|
|
3472
|
-
declare function buildWorkflowImpactGate(options?: {
|
|
3473
|
-
cwd?: string;
|
|
3474
|
-
base?: string;
|
|
3475
|
-
maxFiles?: number;
|
|
3476
|
-
}): WorkflowImpactGateResult;
|
|
3477
|
-
declare function collectSyncDocuments(options: {
|
|
3478
|
-
file?: string;
|
|
3479
|
-
dir?: string;
|
|
3480
|
-
prefix?: string;
|
|
3481
|
-
recursive?: boolean;
|
|
3482
|
-
}): SyncDocumentInput[];
|
|
3483
|
-
declare function collectSyncDocumentsInput(options: {
|
|
3484
|
-
file?: string;
|
|
3485
|
-
dir?: string;
|
|
3486
|
-
prefix?: string;
|
|
3487
|
-
recursive?: boolean;
|
|
3488
|
-
}): CollectedSyncDocuments;
|
|
3489
|
-
interface OnboardFolderOptions {
|
|
3490
|
-
dir: string;
|
|
3491
|
-
recursive?: boolean;
|
|
3492
|
-
mode?: OnboardFolderMode;
|
|
3493
|
-
prefix?: string;
|
|
3494
|
-
usageMode?: string;
|
|
3495
|
-
sourceKind?: string;
|
|
3496
|
-
sourceProvider?: string;
|
|
3497
|
-
sourceUri?: string;
|
|
3498
|
-
clientId?: string;
|
|
3499
|
-
snapshotAt?: string;
|
|
3500
|
-
deleteMissing?: boolean;
|
|
3501
|
-
reindex?: boolean;
|
|
3502
|
-
reindexKind?: ReindexKind;
|
|
3503
|
-
reindexMode?: ReindexMode;
|
|
3233
|
+
files: string[];
|
|
3234
|
+
next?: string;
|
|
3235
|
+
attention?: TeamSyncAttention;
|
|
3236
|
+
actor?: string;
|
|
3237
|
+
createdAt: string;
|
|
3504
3238
|
}
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
reindexMode?: ReindexMode;
|
|
3511
|
-
now?: Date;
|
|
3512
|
-
}): SyncDocumentsDryRunSummary;
|
|
3513
|
-
declare function buildAgenticWorkStatus(cwd?: string): AgenticWorkStatus;
|
|
3514
|
-
declare function buildAgenticTimeline(options?: {
|
|
3515
|
-
limit?: number;
|
|
3516
|
-
cwd?: string;
|
|
3517
|
-
}): AgenticTimeline;
|
|
3518
|
-
|
|
3519
|
-
type LocalSourceProvider = "local_folder";
|
|
3520
|
-
type LocalSourceFileKind = "DOC" | "BINARY" | "CODE" | "CONFIG" | "OTHER";
|
|
3521
|
-
type LocalSourceSkippedReason = "ignored" | "too_large" | "read_error";
|
|
3522
|
-
type LocalSourceReindexKind = "doc" | "code";
|
|
3523
|
-
type LocalSourceReindexMode = "incremental" | "full";
|
|
3524
|
-
interface LocalSourceFile {
|
|
3525
|
-
path: string;
|
|
3526
|
-
kind: LocalSourceFileKind;
|
|
3527
|
-
format: string | null;
|
|
3528
|
-
sizeBytes: number;
|
|
3529
|
-
modifiedAt: string;
|
|
3530
|
-
sha256: string;
|
|
3239
|
+
interface TeamSyncState {
|
|
3240
|
+
schemaVersion: "snipara.team-sync.v1";
|
|
3241
|
+
updatedAt: string;
|
|
3242
|
+
work: TeamSyncWorkRecord[];
|
|
3243
|
+
handoffs: TeamSyncHandoffRecord[];
|
|
3531
3244
|
}
|
|
3532
|
-
interface
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3245
|
+
interface TeamSyncSummary {
|
|
3246
|
+
activeWorkCount: number;
|
|
3247
|
+
staleWorkCount: number;
|
|
3248
|
+
completedWorkCount: number;
|
|
3249
|
+
archivedWorkCount: number;
|
|
3250
|
+
handoffCount: number;
|
|
3251
|
+
files: string[];
|
|
3252
|
+
staleWorkExplanation: TeamSyncStaleWorkExplanation;
|
|
3253
|
+
hygieneActions: TeamSyncHygieneAction[];
|
|
3254
|
+
latestActiveWork?: TeamSyncWorkRecord;
|
|
3255
|
+
latestStaleWork?: TeamSyncWorkRecord;
|
|
3256
|
+
latestCompletedWork?: TeamSyncWorkRecord;
|
|
3257
|
+
latestArchivedWork?: TeamSyncWorkRecord;
|
|
3258
|
+
latestHandoff?: TeamSyncHandoffRecord;
|
|
3536
3259
|
}
|
|
3537
|
-
interface
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3260
|
+
interface TeamSyncStaleWorkExplanation {
|
|
3261
|
+
staleAfterHours: number;
|
|
3262
|
+
autoArchiveAfterDays: number;
|
|
3263
|
+
activeStaleCount: number;
|
|
3264
|
+
autoArchivableCount: number;
|
|
3265
|
+
completedIgnoredCount: number;
|
|
3266
|
+
archivedIgnoredCount: number;
|
|
3267
|
+
latestStaleWorkAgeHours?: number;
|
|
3268
|
+
message: string;
|
|
3542
3269
|
}
|
|
3543
|
-
interface
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
revision: string;
|
|
3549
|
-
recursive: boolean;
|
|
3550
|
-
maxFiles: number;
|
|
3551
|
-
maxFileBytes: number;
|
|
3552
|
-
summary: LocalSourceSummary;
|
|
3553
|
-
files: LocalSourceFile[];
|
|
3554
|
-
skipped: {
|
|
3555
|
-
total: number;
|
|
3556
|
-
byReason: Record<LocalSourceSkippedReason, number>;
|
|
3557
|
-
samples: LocalSourceSkippedFile[];
|
|
3558
|
-
};
|
|
3559
|
-
warnings: string[];
|
|
3270
|
+
interface TeamSyncHygieneAction {
|
|
3271
|
+
kind: "sweep-preview" | "sweep-archive" | "complete-work" | "handoff";
|
|
3272
|
+
command: string;
|
|
3273
|
+
reason: string;
|
|
3274
|
+
mutates: boolean;
|
|
3560
3275
|
}
|
|
3561
|
-
interface
|
|
3276
|
+
interface TeamSyncCommandOptions {
|
|
3277
|
+
id?: string;
|
|
3278
|
+
summary?: string;
|
|
3279
|
+
files?: string[];
|
|
3280
|
+
branch?: string;
|
|
3281
|
+
actor?: string;
|
|
3282
|
+
next?: string;
|
|
3283
|
+
attention?: string;
|
|
3284
|
+
risk?: string;
|
|
3285
|
+
adapterPack?: boolean;
|
|
3286
|
+
adapterTarget?: string;
|
|
3287
|
+
context?: string[];
|
|
3288
|
+
proof?: string[];
|
|
3289
|
+
acceptance?: string[];
|
|
3290
|
+
conflictPosture?: string;
|
|
3291
|
+
since?: string;
|
|
3562
3292
|
dir?: string;
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3293
|
+
includeSessionContext?: boolean;
|
|
3294
|
+
emitOrchestratorHandoff?: boolean;
|
|
3295
|
+
autoRouteOrchestrator?: boolean;
|
|
3296
|
+
orchestratorPolicySource?: string;
|
|
3297
|
+
output?: string;
|
|
3298
|
+
days?: string;
|
|
3299
|
+
dryRun?: boolean;
|
|
3300
|
+
json?: boolean;
|
|
3566
3301
|
}
|
|
3567
|
-
interface
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
unchanged: number;
|
|
3302
|
+
interface HostedAttempt<T> {
|
|
3303
|
+
status: "skipped" | "ok" | "error";
|
|
3304
|
+
data?: T;
|
|
3305
|
+
error?: string;
|
|
3572
3306
|
}
|
|
3573
|
-
interface
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3307
|
+
interface TeamSyncSweepResult {
|
|
3308
|
+
action: "sweep";
|
|
3309
|
+
statePath: string;
|
|
3310
|
+
dryRun: boolean;
|
|
3311
|
+
thresholdDays: number;
|
|
3312
|
+
thresholdMs: number;
|
|
3313
|
+
archivedCount: number;
|
|
3314
|
+
archivedWork: TeamSyncWorkRecord[];
|
|
3315
|
+
explanation: TeamSyncSweepExplanation;
|
|
3316
|
+
summary: TeamSyncSummary;
|
|
3579
3317
|
}
|
|
3580
|
-
interface
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
reindexKind?: LocalSourceReindexKind;
|
|
3587
|
-
reindexMode?: LocalSourceReindexMode;
|
|
3588
|
-
includeGraph?: boolean;
|
|
3589
|
-
json?: boolean;
|
|
3318
|
+
interface TeamSyncSweepExplanation {
|
|
3319
|
+
mode: "preview" | "archive";
|
|
3320
|
+
candidateCount: number;
|
|
3321
|
+
archivedCount: number;
|
|
3322
|
+
remainingStaleCount: number;
|
|
3323
|
+
message: string;
|
|
3590
3324
|
}
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3325
|
+
type AgenticHandoffAdapterTarget = "codex" | "claude-code" | "cursor" | "orca" | "windsurf" | "custom";
|
|
3326
|
+
type AgenticHandoffConflictPosture = "continue" | "wait" | "split_work" | "review_only" | "handoff";
|
|
3327
|
+
interface AgenticHandoffAdapterPack {
|
|
3328
|
+
version: "snipara.ade_adapter_pack.v1";
|
|
3329
|
+
target: {
|
|
3330
|
+
id: AgenticHandoffAdapterTarget;
|
|
3331
|
+
label: string;
|
|
3332
|
+
profile: string;
|
|
3333
|
+
instruction: string;
|
|
3334
|
+
runtimeControl: "handoff_only";
|
|
3599
3335
|
};
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3336
|
+
contextPack: {
|
|
3337
|
+
summary: string;
|
|
3338
|
+
files: string[];
|
|
3339
|
+
contextRefs: string[];
|
|
3340
|
+
workflow?: {
|
|
3341
|
+
goal?: string;
|
|
3342
|
+
status?: string;
|
|
3343
|
+
currentPhaseId?: string;
|
|
3344
|
+
currentPhaseTitle?: string;
|
|
3345
|
+
};
|
|
3346
|
+
resumeCommands: string[];
|
|
3347
|
+
constraints: string[];
|
|
3603
3348
|
};
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3349
|
+
conflictPosture: AgenticHandoffConflictPosture;
|
|
3350
|
+
proofGates: string[];
|
|
3351
|
+
acceptanceCriteria: string[];
|
|
3352
|
+
receiptExpectation: {
|
|
3353
|
+
required: boolean;
|
|
3354
|
+
command: string;
|
|
3355
|
+
requiredFields: string[];
|
|
3607
3356
|
};
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
declare function getLocalSourceSnapshotPath(cwd?: string): string;
|
|
3611
|
-
declare function buildLocalSourceSnapshot(options?: LocalSourceSnapshotOptions): LocalSourceSnapshot;
|
|
3612
|
-
declare function writeLocalSourceSnapshot(snapshot: LocalSourceSnapshot): string;
|
|
3613
|
-
declare function readLocalSourceSnapshot(cwd?: string): LocalSourceSnapshot | null;
|
|
3614
|
-
declare function compareLocalSourceSnapshots(previous: LocalSourceSnapshot | null, current: LocalSourceSnapshot): LocalSourceComparison;
|
|
3615
|
-
declare function buildLocalSourceStatus(options?: LocalSourceSnapshotOptions): LocalSourceStatusResult;
|
|
3616
|
-
declare function buildLocalSourceSyncResult(options?: LocalSourceSyncOptions): Promise<LocalSourceSyncResult>;
|
|
3617
|
-
|
|
3618
|
-
interface LocalWorkerDeclaration {
|
|
3619
|
-
id: string;
|
|
3620
|
-
workerRole: string;
|
|
3621
|
-
endpointType: "local";
|
|
3622
|
-
provider: string;
|
|
3623
|
-
baseUrl: string;
|
|
3624
|
-
command?: string;
|
|
3625
|
-
model?: string;
|
|
3626
|
-
preferModel?: string;
|
|
3627
|
-
capabilities: string[];
|
|
3628
|
-
reasoning: "low" | "medium" | "high";
|
|
3629
|
-
writeScope: string[];
|
|
3630
|
-
createdAt: string;
|
|
3631
|
-
updatedAt: string;
|
|
3357
|
+
prompt: string;
|
|
3358
|
+
caveats: string[];
|
|
3632
3359
|
}
|
|
3633
|
-
interface
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3360
|
+
interface TeamSyncCompletionEvidenceOptions {
|
|
3361
|
+
summary?: string;
|
|
3362
|
+
workflowGoal?: string;
|
|
3363
|
+
files?: string[];
|
|
3364
|
+
reason?: string;
|
|
3365
|
+
now?: Date;
|
|
3366
|
+
dryRun?: boolean;
|
|
3638
3367
|
}
|
|
3639
|
-
interface
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3368
|
+
interface AgenticHandoffArtifact {
|
|
3369
|
+
version: "snipara.agentic_handoff.v1";
|
|
3370
|
+
generatedAt: string;
|
|
3371
|
+
command: "snipara-companion handoff";
|
|
3372
|
+
record: TeamSyncHandoffRecord;
|
|
3373
|
+
statePath: string;
|
|
3374
|
+
hosted: {
|
|
3375
|
+
status: HostedAttempt<TeamSyncHandoffResponse>["status"];
|
|
3376
|
+
handoffId?: string;
|
|
3377
|
+
error?: string;
|
|
3378
|
+
};
|
|
3379
|
+
sections: {
|
|
3380
|
+
whatChanged: string[];
|
|
3381
|
+
verified: string[];
|
|
3382
|
+
risky: string[];
|
|
3383
|
+
remains: string[];
|
|
3384
|
+
whereToResume: string[];
|
|
3385
|
+
};
|
|
3386
|
+
suggestedCommands: string[];
|
|
3387
|
+
adapter?: AgenticHandoffAdapterPack;
|
|
3650
3388
|
}
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3389
|
+
declare function buildTeamSyncStartWorkRecord(input: TeamSyncRecordInput): TeamSyncWorkRecord;
|
|
3390
|
+
declare function buildTeamSyncHandoffRecord(input: TeamSyncRecordInput): TeamSyncHandoffRecord;
|
|
3391
|
+
declare function createEmptyTeamSyncState(now?: Date): TeamSyncState;
|
|
3392
|
+
declare function buildTeamSyncSummary(state: TeamSyncState, since?: Date, now?: Date): TeamSyncSummary;
|
|
3393
|
+
declare function archiveInactiveTeamSyncWork(state: TeamSyncState, options?: {
|
|
3394
|
+
now?: Date;
|
|
3395
|
+
thresholdMs?: number;
|
|
3396
|
+
dryRun?: boolean;
|
|
3397
|
+
}): TeamSyncSweepResult["archivedWork"];
|
|
3398
|
+
declare function completeTeamSyncWorkFromEvidence(state: TeamSyncState, options?: TeamSyncCompletionEvidenceOptions): TeamSyncWorkRecord[];
|
|
3399
|
+
declare function completeTeamSyncStateFromEvidence(rootDir?: string, options?: TeamSyncCompletionEvidenceOptions): TeamSyncWorkRecord[];
|
|
3400
|
+
declare function autoArchiveTeamSyncState(rootDir?: string, now?: Date): TeamSyncSweepResult["archivedWork"];
|
|
3401
|
+
declare function loadTeamSyncState(rootDir?: string): TeamSyncState;
|
|
3402
|
+
declare function saveTeamSyncState(state: TeamSyncState, rootDir?: string): void;
|
|
3403
|
+
declare function getTeamSyncStatePath(rootDir?: string): string;
|
|
3404
|
+
declare function buildAgenticHandoffMarkdown(artifact: AgenticHandoffArtifact): string;
|
|
3405
|
+
declare function teamSyncSweepCommand(options: TeamSyncCommandOptions): Promise<void>;
|
|
3406
|
+
|
|
3407
|
+
type SyncDocumentKind = "DOC" | "BINARY";
|
|
3408
|
+
type WorkflowMode = "lite" | "standard" | "auto" | "full" | "orchestrate";
|
|
3409
|
+
type OnboardFolderMode = "auto" | "business_context" | "code_project" | "mixed";
|
|
3410
|
+
type DetectedOnboardFolderMode = "business_context" | "code_project" | "mixed" | "unknown";
|
|
3411
|
+
type ManagedWorkflowStatus = "active" | "completed" | "blocked";
|
|
3412
|
+
type ManagedWorkflowPhaseStatus = "pending" | "in_progress" | "completed" | "blocked" | "skipped";
|
|
3413
|
+
type ReindexKind = "doc" | "code";
|
|
3414
|
+
type ReindexMode = "incremental" | "full";
|
|
3415
|
+
type ManagedWorkflowPlanSource = "file" | "inline";
|
|
3416
|
+
type TaskCommitOutcome = "completed" | "partial" | "blocked" | "abandoned";
|
|
3417
|
+
type ManagedWorkflowSchemaVersion = "snipara.workflow.v1" | "snipara.workflow.v2";
|
|
3418
|
+
declare const WORKFLOW_STATE_RELATIVE_PATH: string;
|
|
3419
|
+
declare const WORKFLOW_PLANS_RELATIVE_DIR: string;
|
|
3420
|
+
declare const PRODUCER_LOOP_ARTIFACT_VERSION: "snipara.producer_loop_artifact.v0";
|
|
3421
|
+
declare const PRODUCER_LOOP_REPORT_VERSION: "snipara.producer_loop_report.v0";
|
|
3422
|
+
declare const PRODUCER_LOOP_RELATIVE_DIR: string;
|
|
3423
|
+
type ProducerLoopProducerKind = "workflow_phase_commit" | "workflow_final_commit" | "pr_answer_pack_decision_capture";
|
|
3424
|
+
type ProducerLoopSampleReviewStatus = "sample_unreviewed" | "sample_reviewed" | "sample_rejected";
|
|
3425
|
+
interface ProducerLoopArtifactWriteResult {
|
|
3426
|
+
status: "written" | "error";
|
|
3427
|
+
schemaVersion: typeof PRODUCER_LOOP_ARTIFACT_VERSION;
|
|
3428
|
+
artifactId?: string;
|
|
3429
|
+
path?: string;
|
|
3430
|
+
relativePath?: string;
|
|
3431
|
+
artifactHash?: string;
|
|
3432
|
+
ledgerHash?: string;
|
|
3433
|
+
error?: string;
|
|
3434
|
+
caveats: string[];
|
|
3666
3435
|
}
|
|
3667
|
-
interface
|
|
3668
|
-
|
|
3436
|
+
interface ProducerLoopArtifactReportSummary {
|
|
3437
|
+
artifactId: string;
|
|
3438
|
+
generatedAt: string;
|
|
3439
|
+
producerKind: ProducerLoopProducerKind;
|
|
3440
|
+
workflowId?: string;
|
|
3441
|
+
phaseId?: string;
|
|
3442
|
+
phaseTitle?: string;
|
|
3443
|
+
outcome?: TaskCommitOutcome;
|
|
3444
|
+
summary?: string;
|
|
3445
|
+
path: string;
|
|
3446
|
+
relativePath: string;
|
|
3447
|
+
artifactHash: string;
|
|
3448
|
+
ledgerHash?: string;
|
|
3449
|
+
reasonCodes: string[];
|
|
3450
|
+
files: string[];
|
|
3451
|
+
calibrationStatus?: string;
|
|
3452
|
+
reviewStatus: ProducerLoopSampleReviewStatus;
|
|
3453
|
+
reviewOutcome?: string;
|
|
3454
|
+
reviewedAt?: string;
|
|
3455
|
+
reviewer?: string;
|
|
3669
3456
|
}
|
|
3670
|
-
interface
|
|
3671
|
-
|
|
3457
|
+
interface ProducerLoopReport {
|
|
3458
|
+
version: typeof PRODUCER_LOOP_REPORT_VERSION;
|
|
3459
|
+
generatedAt: string;
|
|
3460
|
+
source: {
|
|
3461
|
+
directory: string;
|
|
3462
|
+
localOnly: true;
|
|
3463
|
+
};
|
|
3464
|
+
adoption: {
|
|
3465
|
+
status: "missing" | "active";
|
|
3466
|
+
artifactCount: number;
|
|
3467
|
+
producerKinds: ProducerLoopProducerKind[];
|
|
3468
|
+
workflowIds: string[];
|
|
3469
|
+
};
|
|
3470
|
+
artifacts: ProducerLoopArtifactReportSummary[];
|
|
3471
|
+
latestArtifact?: ProducerLoopArtifactReportSummary;
|
|
3472
|
+
invalidArtifacts: Array<{
|
|
3473
|
+
path: string;
|
|
3474
|
+
relativePath: string;
|
|
3475
|
+
error: string;
|
|
3476
|
+
}>;
|
|
3477
|
+
reasonCodes: {
|
|
3478
|
+
counts: Record<string, number>;
|
|
3479
|
+
};
|
|
3480
|
+
calibration: {
|
|
3481
|
+
status: "no_samples" | "insufficient_samples" | "reviewable_sample_set";
|
|
3482
|
+
sampleSize: number;
|
|
3483
|
+
reviewedSampleSize: number;
|
|
3484
|
+
rejectedSampleSize: number;
|
|
3485
|
+
unreviewedSampleSize: number;
|
|
3486
|
+
minReviewSampleSize: number;
|
|
3487
|
+
reviewOutcomes: Record<string, number>;
|
|
3488
|
+
hardGateReady: false;
|
|
3489
|
+
notes: string[];
|
|
3490
|
+
};
|
|
3491
|
+
recommendedActions: string[];
|
|
3492
|
+
caveats: string[];
|
|
3672
3493
|
}
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3494
|
+
type WorkflowPlanPreset = "memory-backend-unification" | "project-intelligence-continuity-layer";
|
|
3495
|
+
interface WorkflowPlanScaffoldDocument {
|
|
3496
|
+
preset: WorkflowPlanPreset;
|
|
3497
|
+
mode: "full";
|
|
3498
|
+
goal: string;
|
|
3499
|
+
steps: Array<{
|
|
3500
|
+
id: string;
|
|
3501
|
+
title: string;
|
|
3502
|
+
query: string;
|
|
3503
|
+
acceptance?: string;
|
|
3504
|
+
files?: string[];
|
|
3505
|
+
gates?: string[];
|
|
3506
|
+
needs_runtime?: boolean;
|
|
3507
|
+
}>;
|
|
3676
3508
|
}
|
|
3677
|
-
interface
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3509
|
+
interface ManagedWorkflowRuntimeCheckpoint {
|
|
3510
|
+
summary: string;
|
|
3511
|
+
capturedAt: string;
|
|
3512
|
+
automationSessionId?: string;
|
|
3513
|
+
hostedEventId?: string;
|
|
3514
|
+
hostedRecordedAt?: string;
|
|
3515
|
+
environment?: string;
|
|
3516
|
+
profile?: string;
|
|
3517
|
+
bootstrapQuery?: string;
|
|
3518
|
+
files?: string[];
|
|
3519
|
+
commands?: string[];
|
|
3520
|
+
artifacts?: string[];
|
|
3521
|
+
contextPackReceipts?: LocalContextPackReceiptPayload[];
|
|
3522
|
+
rehydratableState?: Record<string, unknown>;
|
|
3689
3523
|
}
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
};
|
|
3701
|
-
declare function resolveLocalWorkerRoutingDefaults(options?: {
|
|
3702
|
-
workerId?: string;
|
|
3703
|
-
workerRole?: string;
|
|
3704
|
-
}): LocalWorkerRoutingDefaults | null;
|
|
3705
|
-
declare function readLocalWorkersConfig(): LocalWorkersConfig | null;
|
|
3706
|
-
|
|
3707
|
-
interface ControlledWorkerExecuteOptions {
|
|
3708
|
-
task: string;
|
|
3709
|
-
workerId?: string;
|
|
3710
|
-
workerRole?: string;
|
|
3711
|
-
endpointType?: "local" | "cloud" | "self_hosted" | "unknown";
|
|
3712
|
-
mode?: ControlledWorkerExecutionMode;
|
|
3713
|
-
command?: string;
|
|
3714
|
-
execute?: boolean;
|
|
3715
|
-
approvalReceipt?: string;
|
|
3716
|
-
outcomeReceipt?: string;
|
|
3717
|
-
writeScope?: string[];
|
|
3718
|
-
acceptance?: string[];
|
|
3719
|
-
proof?: string[];
|
|
3720
|
-
output?: string;
|
|
3721
|
-
projectId?: string;
|
|
3722
|
-
unifiedOutput?: string;
|
|
3723
|
-
dir?: string;
|
|
3724
|
-
json?: boolean;
|
|
3524
|
+
interface ManagedWorkflowSandboxRuntimeBinding {
|
|
3525
|
+
phaseId: string;
|
|
3526
|
+
sessionId: string;
|
|
3527
|
+
automationSessionId?: string;
|
|
3528
|
+
boundAt: string;
|
|
3529
|
+
bootstrapQuery: string;
|
|
3530
|
+
environment?: string;
|
|
3531
|
+
profile?: string;
|
|
3532
|
+
artifacts?: string[];
|
|
3533
|
+
lastCheckpoint?: ManagedWorkflowRuntimeCheckpoint;
|
|
3725
3534
|
}
|
|
3726
|
-
interface
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
receipt: ControlledWorkerExecutionReceipt;
|
|
3732
|
-
unifiedReceipt: UnifiedReceiptEnvelope<ControlledWorkerExecutionReceipt> | null;
|
|
3535
|
+
interface ManagedWorkflowRuntimeState {
|
|
3536
|
+
sandbox?: {
|
|
3537
|
+
provider: "snipara-sandbox";
|
|
3538
|
+
bindings: ManagedWorkflowSandboxRuntimeBinding[];
|
|
3539
|
+
};
|
|
3733
3540
|
}
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3541
|
+
type ManagedWorkflowCoordinationMode = "standard" | "full" | "orchestrate";
|
|
3542
|
+
interface ManagedWorkflowCoordinationState {
|
|
3543
|
+
mode: ManagedWorkflowCoordinationMode;
|
|
3544
|
+
autoPublish: boolean;
|
|
3545
|
+
startedAt?: string;
|
|
3546
|
+
lastUpdatedAt?: string;
|
|
3547
|
+
workSessionId?: string;
|
|
3548
|
+
startReceipt?: WorkflowCollaborationReceipt;
|
|
3549
|
+
teamSyncReceipt?: Record<string, unknown>;
|
|
3550
|
+
releaseReceipt?: WorkflowCollaborationReceipt;
|
|
3742
3551
|
}
|
|
3743
|
-
interface
|
|
3552
|
+
interface ManagedWorkflowPhase {
|
|
3744
3553
|
id: string;
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
latestError?: string;
|
|
3554
|
+
title: string;
|
|
3555
|
+
query: string;
|
|
3556
|
+
status: ManagedWorkflowPhaseStatus;
|
|
3557
|
+
acceptance?: string;
|
|
3558
|
+
files?: string[];
|
|
3559
|
+
gates?: string[];
|
|
3560
|
+
needsRuntime?: boolean;
|
|
3561
|
+
startedAt?: string;
|
|
3562
|
+
completedAt?: string;
|
|
3563
|
+
summary?: string;
|
|
3564
|
+
outcome?: TaskCommitOutcome;
|
|
3757
3565
|
}
|
|
3758
|
-
interface
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3566
|
+
interface ManagedWorkflowState {
|
|
3567
|
+
schemaVersion: ManagedWorkflowSchemaVersion;
|
|
3568
|
+
workflowId: string;
|
|
3569
|
+
goal: string;
|
|
3570
|
+
status: ManagedWorkflowStatus;
|
|
3571
|
+
currentPhaseId?: string;
|
|
3572
|
+
planSource: ManagedWorkflowPlanSource;
|
|
3573
|
+
planFile?: string;
|
|
3574
|
+
createdAt: string;
|
|
3575
|
+
updatedAt: string;
|
|
3576
|
+
phases: ManagedWorkflowPhase[];
|
|
3577
|
+
runtime?: ManagedWorkflowRuntimeState;
|
|
3578
|
+
coordination?: ManagedWorkflowCoordinationState;
|
|
3579
|
+
lastCommit?: {
|
|
3580
|
+
category: string;
|
|
3581
|
+
outcome: TaskCommitOutcome;
|
|
3582
|
+
summary: string;
|
|
3583
|
+
committedAt: string;
|
|
3584
|
+
};
|
|
3765
3585
|
}
|
|
3766
|
-
interface
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3586
|
+
interface AgenticWorkStatus {
|
|
3587
|
+
version: "snipara.agentic_status.v1";
|
|
3588
|
+
generatedAt: string;
|
|
3589
|
+
branch?: string;
|
|
3590
|
+
git: {
|
|
3591
|
+
head?: string;
|
|
3592
|
+
dirtyFileCount: number;
|
|
3593
|
+
statusLines: string[];
|
|
3594
|
+
error?: string;
|
|
3595
|
+
};
|
|
3596
|
+
workflow: {
|
|
3597
|
+
id: string;
|
|
3598
|
+
goal: string;
|
|
3599
|
+
status: ManagedWorkflowStatus;
|
|
3600
|
+
currentPhase?: {
|
|
3601
|
+
id: string;
|
|
3602
|
+
title: string;
|
|
3603
|
+
status: ManagedWorkflowPhaseStatus;
|
|
3604
|
+
};
|
|
3605
|
+
lastPhaseCommit?: {
|
|
3606
|
+
phaseId: string;
|
|
3607
|
+
title: string;
|
|
3608
|
+
summary?: string;
|
|
3609
|
+
outcome?: TaskCommitOutcome;
|
|
3610
|
+
completedAt?: string;
|
|
3611
|
+
};
|
|
3612
|
+
resumeCommand: string;
|
|
3613
|
+
} | null;
|
|
3614
|
+
teamSync: {
|
|
3615
|
+
activeWorkCount: number;
|
|
3616
|
+
staleWorkCount: number;
|
|
3617
|
+
staleWorkExplanation: TeamSyncStaleWorkExplanation;
|
|
3618
|
+
archivedWorkCount: number;
|
|
3619
|
+
handoffCount: number;
|
|
3620
|
+
latestHandoff?: {
|
|
3621
|
+
summary: string;
|
|
3622
|
+
next?: string;
|
|
3623
|
+
attention?: string;
|
|
3624
|
+
createdAt: string;
|
|
3625
|
+
};
|
|
3626
|
+
};
|
|
3627
|
+
risks: string[];
|
|
3628
|
+
openDecisions: {
|
|
3629
|
+
count?: number;
|
|
3630
|
+
note: string;
|
|
3631
|
+
};
|
|
3632
|
+
operationalLoop: {
|
|
3633
|
+
status: "clear" | "attention" | "blocked";
|
|
3634
|
+
decisionRequestCount: number;
|
|
3635
|
+
receiptGapCount: number;
|
|
3636
|
+
nextActions: string[];
|
|
3637
|
+
receiptActions: string[];
|
|
3638
|
+
caveats: string[];
|
|
3639
|
+
};
|
|
3640
|
+
suggestedNextAction: string;
|
|
3774
3641
|
}
|
|
3775
|
-
interface
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
maxBytes?: number;
|
|
3783
|
-
destinationPrefix?: string;
|
|
3784
|
-
upload?: boolean;
|
|
3785
|
-
reindex?: boolean;
|
|
3786
|
-
dryRun?: boolean;
|
|
3787
|
-
json?: boolean;
|
|
3642
|
+
interface AgenticTimelineEvent {
|
|
3643
|
+
time: string;
|
|
3644
|
+
kind: string;
|
|
3645
|
+
title: string;
|
|
3646
|
+
detail?: string;
|
|
3647
|
+
source: ActivityEventSource;
|
|
3648
|
+
files?: string[];
|
|
3788
3649
|
}
|
|
3789
|
-
interface
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
allowed: number;
|
|
3795
|
-
pending: number;
|
|
3796
|
-
denied: number;
|
|
3797
|
-
unsupported: number;
|
|
3650
|
+
interface AgenticTimeline {
|
|
3651
|
+
version: "snipara.agentic_timeline.v1";
|
|
3652
|
+
generatedAt: string;
|
|
3653
|
+
events: AgenticTimelineEvent[];
|
|
3654
|
+
limit: number;
|
|
3798
3655
|
}
|
|
3799
|
-
interface
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
dryRun: boolean;
|
|
3806
|
-
snapshots: Array<{
|
|
3807
|
-
id: string;
|
|
3808
|
-
url: string;
|
|
3809
|
-
snapshotPath?: string;
|
|
3810
|
-
destinationPath?: string;
|
|
3811
|
-
status?: number;
|
|
3812
|
-
uploaded?: boolean;
|
|
3813
|
-
error?: string;
|
|
3814
|
-
}>;
|
|
3656
|
+
interface WorkflowImpactGateCommit {
|
|
3657
|
+
sha: string;
|
|
3658
|
+
shortSha: string;
|
|
3659
|
+
subject: string;
|
|
3660
|
+
author?: string;
|
|
3661
|
+
authoredAt?: string;
|
|
3815
3662
|
}
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
pendingRequests: number;
|
|
3825
|
-
resolvedDecisions: number;
|
|
3826
|
-
applyReceipts: number;
|
|
3827
|
-
policyDrafts: number;
|
|
3663
|
+
interface WorkflowImpactGatePhase {
|
|
3664
|
+
id: string;
|
|
3665
|
+
title: string;
|
|
3666
|
+
summary?: string;
|
|
3667
|
+
outcome?: TaskCommitOutcome;
|
|
3668
|
+
completedAt?: string;
|
|
3669
|
+
files: string[];
|
|
3670
|
+
filesInUnpushedDiff: string[];
|
|
3828
3671
|
}
|
|
3829
|
-
interface
|
|
3830
|
-
version:
|
|
3672
|
+
interface WorkflowImpactGateResult {
|
|
3673
|
+
version: "snipara.workflow_impact_gate.v1";
|
|
3831
3674
|
generatedAt: string;
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3675
|
+
gate: {
|
|
3676
|
+
status: "pass" | "attention";
|
|
3677
|
+
reasonCodes: string[];
|
|
3678
|
+
};
|
|
3679
|
+
repo: {
|
|
3680
|
+
root: string;
|
|
3681
|
+
branch?: string;
|
|
3682
|
+
upstream: string;
|
|
3683
|
+
baseSha?: string;
|
|
3684
|
+
headSha?: string;
|
|
3685
|
+
};
|
|
3686
|
+
unpushed: {
|
|
3687
|
+
commitCount: number;
|
|
3688
|
+
commits: WorkflowImpactGateCommit[];
|
|
3689
|
+
changedFiles: string[];
|
|
3690
|
+
codeChangedFiles: string[];
|
|
3691
|
+
nonCodeChangedFiles: string[];
|
|
3692
|
+
};
|
|
3693
|
+
dirtyWorkingTree: {
|
|
3694
|
+
fileCount: number;
|
|
3695
|
+
statusLines: string[];
|
|
3696
|
+
files: string[];
|
|
3697
|
+
includedInLocalImpact: false;
|
|
3698
|
+
};
|
|
3699
|
+
workflow: {
|
|
3700
|
+
id?: string;
|
|
3701
|
+
goal?: string;
|
|
3702
|
+
status?: ManagedWorkflowStatus;
|
|
3703
|
+
completedPhases: WorkflowImpactGatePhase[];
|
|
3704
|
+
changedFilesWithoutPhase: string[];
|
|
3705
|
+
phaseFilesOutsideUnpushedDiff: string[];
|
|
3706
|
+
};
|
|
3707
|
+
localImpact: Record<string, unknown> | null;
|
|
3708
|
+
recommendedActions: string[];
|
|
3836
3709
|
caveats: string[];
|
|
3710
|
+
hostedFollowUpCommand?: string;
|
|
3837
3711
|
}
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
json?: boolean;
|
|
3845
|
-
}): Promise<void>;
|
|
3846
|
-
declare function collectPolicyLedgerSyncArtifacts(cwd?: string): ProjectPolicyLedgerSyncArtifactInput[];
|
|
3847
|
-
|
|
3848
|
-
type CacheStrategy = "exact" | "nearby" | "warm";
|
|
3849
|
-
interface QueryCacheScope {
|
|
3850
|
-
cwd?: string;
|
|
3851
|
-
projectId?: string;
|
|
3852
|
-
sessionId?: string;
|
|
3853
|
-
}
|
|
3854
|
-
interface QueryCacheLookup {
|
|
3855
|
-
query: string;
|
|
3856
|
-
maxTokens: number;
|
|
3857
|
-
}
|
|
3858
|
-
interface QueryCacheHit {
|
|
3859
|
-
strategy: CacheStrategy;
|
|
3860
|
-
result: ContextQueryResult;
|
|
3861
|
-
sourceQuery: string;
|
|
3862
|
-
similarity?: number;
|
|
3712
|
+
interface WorkflowPlanScaffoldResult {
|
|
3713
|
+
preset: WorkflowPlanPreset;
|
|
3714
|
+
goal: string;
|
|
3715
|
+
outputPath: string;
|
|
3716
|
+
relativeOutputPath: string;
|
|
3717
|
+
plan: WorkflowPlanScaffoldDocument;
|
|
3863
3718
|
}
|
|
3864
|
-
interface
|
|
3865
|
-
|
|
3866
|
-
|
|
3719
|
+
interface SyncDocumentsManifestOptions {
|
|
3720
|
+
metadataDefaults: Record<string, unknown>;
|
|
3721
|
+
deleteMissing?: boolean;
|
|
3722
|
+
dryRun?: boolean;
|
|
3723
|
+
reindex?: boolean;
|
|
3724
|
+
reindexKind?: ReindexKind;
|
|
3725
|
+
reindexMode?: ReindexMode;
|
|
3867
3726
|
}
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
private readonly warmTtlMs;
|
|
3872
|
-
private readonly maxEntries;
|
|
3873
|
-
private readonly maxBytes;
|
|
3874
|
-
constructor(scope?: QueryCacheScope);
|
|
3875
|
-
lookup(options: QueryCacheLookup): QueryCacheHit | null;
|
|
3876
|
-
save(options: QueryCacheLookup, result: ContextQueryResult): void;
|
|
3877
|
-
storeWarmSnapshot(result: SessionMemoriesResult): WarmSnapshotResult;
|
|
3878
|
-
clear(): number;
|
|
3879
|
-
private loadIndex;
|
|
3880
|
-
private persistIndex;
|
|
3881
|
-
private pruneIndex;
|
|
3882
|
-
private readEntry;
|
|
3883
|
-
private findNearbyEntry;
|
|
3884
|
-
private lookupWarmSnapshot;
|
|
3727
|
+
interface CollectedSyncDocuments {
|
|
3728
|
+
documents: SyncDocumentInput[];
|
|
3729
|
+
manifestOptions: SyncDocumentsManifestOptions;
|
|
3885
3730
|
}
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
declare const AUTOMATION_MANIFEST_RELATIVE_PATH = ".snipara/automations/manifest.json";
|
|
3889
|
-
type AutomationFileState = "create" | "update" | "unchanged" | "conflict";
|
|
3890
|
-
interface AutomationManifestFile {
|
|
3731
|
+
interface SyncDocumentsDryRunItem {
|
|
3891
3732
|
path: string;
|
|
3892
|
-
|
|
3733
|
+
status: "valid" | "invalid_metadata";
|
|
3734
|
+
recommended_action: "none" | "reupload" | "review_source_metadata";
|
|
3735
|
+
reasons: string[];
|
|
3736
|
+
kind?: SyncDocumentKind;
|
|
3737
|
+
format?: string;
|
|
3738
|
+
size_bytes: number;
|
|
3739
|
+
content_hash: string;
|
|
3740
|
+
assetClass?: string;
|
|
3741
|
+
usageMode?: string;
|
|
3742
|
+
sourceKind?: string;
|
|
3893
3743
|
}
|
|
3894
|
-
interface
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3744
|
+
interface SyncDocumentsDryRunSummary {
|
|
3745
|
+
dry_run: true;
|
|
3746
|
+
remote_diff_available: false;
|
|
3747
|
+
total: number;
|
|
3748
|
+
would_sync: number;
|
|
3749
|
+
invalid_metadata: number;
|
|
3750
|
+
stale: number;
|
|
3751
|
+
needs_reupload: number;
|
|
3752
|
+
needs_metadata_review: number;
|
|
3753
|
+
delete_missing: boolean;
|
|
3754
|
+
reindex_requested: boolean;
|
|
3755
|
+
reindex_kind: ReindexKind;
|
|
3756
|
+
reindex_mode: ReindexMode;
|
|
3757
|
+
created: null;
|
|
3758
|
+
updated: null;
|
|
3759
|
+
unchanged: null;
|
|
3760
|
+
missing_from_manifest: null;
|
|
3761
|
+
note: string;
|
|
3762
|
+
documents: SyncDocumentsDryRunItem[];
|
|
3901
3763
|
}
|
|
3902
|
-
interface
|
|
3764
|
+
interface OnboardFolderScannedFile {
|
|
3903
3765
|
path: string;
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
previousSha256?: string;
|
|
3909
|
-
nextSha256: string;
|
|
3910
|
-
writeContent?: string;
|
|
3911
|
-
}
|
|
3912
|
-
interface AutomationInstallResult {
|
|
3913
|
-
manifest: AutomationManifest;
|
|
3914
|
-
plan: AutomationFilePlan[];
|
|
3915
|
-
written: number;
|
|
3916
|
-
unchanged: number;
|
|
3917
|
-
dryRun: boolean;
|
|
3766
|
+
size_bytes: number;
|
|
3767
|
+
supported: boolean;
|
|
3768
|
+
kind?: SyncDocumentKind;
|
|
3769
|
+
format?: string;
|
|
3918
3770
|
}
|
|
3919
|
-
interface
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3771
|
+
interface OnboardFolderClassification {
|
|
3772
|
+
mode: DetectedOnboardFolderMode;
|
|
3773
|
+
detected_mode: DetectedOnboardFolderMode;
|
|
3774
|
+
confidence: number;
|
|
3775
|
+
code_score: number;
|
|
3776
|
+
business_score: number;
|
|
3777
|
+
signals: {
|
|
3778
|
+
code: string[];
|
|
3779
|
+
business: string[];
|
|
3780
|
+
};
|
|
3928
3781
|
}
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3782
|
+
interface OnboardFolderManifest {
|
|
3783
|
+
schemaVersion: "snipara.onboard-folder.v1";
|
|
3784
|
+
source: {
|
|
3785
|
+
root: string;
|
|
3786
|
+
sourceKind: string;
|
|
3787
|
+
sourceProvider: string;
|
|
3788
|
+
sourceUri?: string;
|
|
3789
|
+
snapshotAt: string;
|
|
3790
|
+
recursive: boolean;
|
|
3791
|
+
};
|
|
3792
|
+
classification: OnboardFolderClassification;
|
|
3793
|
+
summary: {
|
|
3794
|
+
total_files: number;
|
|
3795
|
+
supported_documents: number;
|
|
3796
|
+
ignored_files: number;
|
|
3797
|
+
unsupported_business_files: number;
|
|
3798
|
+
};
|
|
3799
|
+
warnings: string[];
|
|
3800
|
+
ignored: OnboardFolderScannedFile[];
|
|
3801
|
+
sync: {
|
|
3802
|
+
dryRun: boolean;
|
|
3803
|
+
reindex: boolean;
|
|
3804
|
+
reindexKind: ReindexKind;
|
|
3805
|
+
reindexMode: ReindexMode;
|
|
3806
|
+
deleteMissing: boolean;
|
|
3807
|
+
metadata: Record<string, unknown>;
|
|
3808
|
+
documents: SyncDocumentInput[];
|
|
3809
|
+
};
|
|
3810
|
+
dryRun: SyncDocumentsDryRunSummary;
|
|
3932
3811
|
}
|
|
3933
|
-
declare
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3812
|
+
declare function getPlanStepDisplayTitle(step: unknown, index?: number): string;
|
|
3813
|
+
interface PlanQualityReport {
|
|
3814
|
+
valid: boolean;
|
|
3815
|
+
issues: string[];
|
|
3816
|
+
warnings: string[];
|
|
3817
|
+
stepCount: number;
|
|
3818
|
+
actions: string[];
|
|
3819
|
+
planId?: string;
|
|
3937
3820
|
}
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
}
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
declare const COLLABORATION_STATE_RELATIVE_PATH: string;
|
|
3956
|
-
type CollaborationGuardActionKind = "safe_to_ack" | "needs_handoff" | "needs_test" | "needs_package_review" | "blocking_conflict" | "guard_unavailable";
|
|
3957
|
-
interface CollaborationGuardActionCard {
|
|
3958
|
-
kind: CollaborationGuardActionKind;
|
|
3959
|
-
title: string;
|
|
3960
|
-
reason: string;
|
|
3961
|
-
severity: "info" | "watch" | "warning" | "critical";
|
|
3962
|
-
safeToAck: boolean;
|
|
3963
|
-
command?: string;
|
|
3964
|
-
conflictCode?: string;
|
|
3965
|
-
resource?: string;
|
|
3821
|
+
interface WorkflowTokenBudgetReport {
|
|
3822
|
+
requested_max_tokens: number;
|
|
3823
|
+
allocations: {
|
|
3824
|
+
critical_memory_tokens: number;
|
|
3825
|
+
session_context_tokens: number;
|
|
3826
|
+
context_query_tokens: number;
|
|
3827
|
+
shared_context_tokens: number;
|
|
3828
|
+
plan_tokens: number;
|
|
3829
|
+
};
|
|
3830
|
+
estimated_max_tokens: number;
|
|
3831
|
+
include_session_context: boolean;
|
|
3832
|
+
explicit: {
|
|
3833
|
+
max_critical_tokens: boolean;
|
|
3834
|
+
max_context_tokens: boolean;
|
|
3835
|
+
};
|
|
3836
|
+
warnings: string[];
|
|
3966
3837
|
}
|
|
3967
|
-
interface
|
|
3968
|
-
|
|
3838
|
+
interface SessionBootstrapQualityReport {
|
|
3839
|
+
warnings: string[];
|
|
3840
|
+
counts: {
|
|
3841
|
+
critical_memories: number;
|
|
3842
|
+
session_context_memories: number;
|
|
3843
|
+
low_confidence_memories: number;
|
|
3844
|
+
stale_memories: number;
|
|
3845
|
+
test_memories: number;
|
|
3846
|
+
};
|
|
3847
|
+
total_tokens?: number;
|
|
3848
|
+
oldest_memory_age_days?: number;
|
|
3849
|
+
}
|
|
3850
|
+
interface SessionBootstrapBrief {
|
|
3851
|
+
entries: SessionMemoryEntry[];
|
|
3852
|
+
availableCount: number;
|
|
3853
|
+
hiddenCount: number;
|
|
3854
|
+
estimatedTokens: number;
|
|
3855
|
+
budgetTokens: number;
|
|
3856
|
+
}
|
|
3857
|
+
interface GeneratedWorkflowPlanDocument {
|
|
3858
|
+
mode: "full";
|
|
3859
|
+
goal: string;
|
|
3860
|
+
source: "snipara_plan";
|
|
3861
|
+
plan_id?: string;
|
|
3862
|
+
generatedAt: string;
|
|
3863
|
+
steps: Array<{
|
|
3864
|
+
id: string;
|
|
3865
|
+
title: string;
|
|
3866
|
+
query: string;
|
|
3867
|
+
acceptance?: string;
|
|
3868
|
+
files?: string[];
|
|
3869
|
+
needs_runtime?: boolean;
|
|
3870
|
+
}>;
|
|
3871
|
+
}
|
|
3872
|
+
declare function resolveFullWorkflowTokenBudget(options: {
|
|
3873
|
+
maxTokens?: number;
|
|
3874
|
+
includeSessionContext?: boolean;
|
|
3875
|
+
includeSharedContext?: boolean;
|
|
3876
|
+
maxCriticalTokens?: number;
|
|
3877
|
+
maxContextTokens?: number;
|
|
3878
|
+
}): WorkflowTokenBudgetReport;
|
|
3879
|
+
declare function validatePlanResult(plan: unknown, options?: {
|
|
3880
|
+
query?: string;
|
|
3881
|
+
cwd?: string;
|
|
3882
|
+
}): PlanQualityReport;
|
|
3883
|
+
declare function buildSessionBootstrapBrief(result: SessionMemoriesResult, options: {
|
|
3884
|
+
includeSessionContext: boolean;
|
|
3885
|
+
maxTokens?: number;
|
|
3886
|
+
maxEntries?: number;
|
|
3887
|
+
now?: Date;
|
|
3888
|
+
}): SessionBootstrapBrief;
|
|
3889
|
+
declare function buildSessionBootstrapQuality(result: SessionMemoriesResult, options?: {
|
|
3890
|
+
expectedMaxTokens?: number;
|
|
3891
|
+
now?: Date;
|
|
3892
|
+
}): SessionBootstrapQualityReport;
|
|
3893
|
+
declare function buildGeneratedWorkflowPlanDocument(plan: Record<string, unknown>, fallbackGoal: string): GeneratedWorkflowPlanDocument;
|
|
3894
|
+
declare function normalizeWorkflowPlanInput(input: unknown, fallbackGoal: string): ManagedWorkflowPhase[];
|
|
3895
|
+
declare function buildWorkflowPlanScaffold(preset: WorkflowPlanPreset, options?: {
|
|
3896
|
+
goal?: string;
|
|
3897
|
+
outputPath?: string;
|
|
3898
|
+
cwd?: string;
|
|
3899
|
+
}): WorkflowPlanScaffoldResult;
|
|
3900
|
+
declare function writeProducerLoopArtifact(options: {
|
|
3901
|
+
kind: ProducerLoopProducerKind;
|
|
3902
|
+
command: "workflow phase-commit" | "workflow final-commit";
|
|
3903
|
+
state?: ManagedWorkflowState;
|
|
3904
|
+
phase?: ManagedWorkflowPhase;
|
|
3905
|
+
category: string;
|
|
3906
|
+
outcome: TaskCommitOutcome;
|
|
3907
|
+
summary: string;
|
|
3969
3908
|
files?: string[];
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3909
|
+
journalAttempted: boolean;
|
|
3910
|
+
teamSyncCompletionAttempted: boolean;
|
|
3911
|
+
}): ProducerLoopArtifactWriteResult;
|
|
3912
|
+
declare function buildProducerLoopReport(options?: {
|
|
3913
|
+
cwd?: string;
|
|
3914
|
+
minReviewSampleSize?: number;
|
|
3915
|
+
}): ProducerLoopReport;
|
|
3916
|
+
declare function buildWorkflowPhaseCommitSummary(args: {
|
|
3917
|
+
workflowId: string;
|
|
3918
|
+
phase: Pick<ManagedWorkflowPhase, "id" | "title">;
|
|
3919
|
+
summary: string;
|
|
3920
|
+
}): string;
|
|
3921
|
+
declare function resolveAutoWorkflowMode(query: string): Exclude<WorkflowMode, "auto">;
|
|
3922
|
+
/**
|
|
3923
|
+
* Compute the impact gate for committed-but-unpushed workflow phases.
|
|
3924
|
+
*
|
|
3925
|
+
* Compares `upstream..HEAD`, separates unpushed code changes from non-code and
|
|
3926
|
+
* dirty working-tree files, runs local code-overlay impact on the committed
|
|
3927
|
+
* code files, and maps the result back to completed workflow phases. Surfaces
|
|
3928
|
+
* reason codes such as `dirty_working_tree_not_included` and phase files that
|
|
3929
|
+
* fall outside the unpushed diff, so a phase is not treated as verified on
|
|
3930
|
+
* stale or partial evidence.
|
|
3931
|
+
*
|
|
3932
|
+
* @returns A `WorkflowImpactGateResult` with changed files, local impact,
|
|
3933
|
+
* matched phases, and reason codes.
|
|
3934
|
+
*/
|
|
3935
|
+
declare function buildWorkflowImpactGate(options?: {
|
|
3936
|
+
cwd?: string;
|
|
3937
|
+
base?: string;
|
|
3938
|
+
maxFiles?: number;
|
|
3939
|
+
}): WorkflowImpactGateResult;
|
|
3940
|
+
declare function collectSyncDocuments(options: {
|
|
3941
|
+
file?: string;
|
|
3997
3942
|
dir?: string;
|
|
3998
|
-
|
|
3999
|
-
|
|
3943
|
+
prefix?: string;
|
|
3944
|
+
recursive?: boolean;
|
|
3945
|
+
}): SyncDocumentInput[];
|
|
3946
|
+
declare function collectSyncDocumentsInput(options: {
|
|
3947
|
+
file?: string;
|
|
3948
|
+
dir?: string;
|
|
3949
|
+
prefix?: string;
|
|
3950
|
+
recursive?: boolean;
|
|
3951
|
+
}): CollectedSyncDocuments;
|
|
3952
|
+
interface OnboardFolderOptions {
|
|
3953
|
+
dir: string;
|
|
3954
|
+
recursive?: boolean;
|
|
3955
|
+
mode?: OnboardFolderMode;
|
|
3956
|
+
prefix?: string;
|
|
3957
|
+
usageMode?: string;
|
|
3958
|
+
sourceKind?: string;
|
|
3959
|
+
sourceProvider?: string;
|
|
3960
|
+
sourceUri?: string;
|
|
3961
|
+
clientId?: string;
|
|
3962
|
+
snapshotAt?: string;
|
|
3963
|
+
deleteMissing?: boolean;
|
|
3964
|
+
reindex?: boolean;
|
|
3965
|
+
reindexKind?: ReindexKind;
|
|
3966
|
+
reindexMode?: ReindexMode;
|
|
4000
3967
|
}
|
|
4001
|
-
|
|
3968
|
+
declare function buildOnboardFolderManifest(options: OnboardFolderOptions): OnboardFolderManifest;
|
|
3969
|
+
declare function buildSyncDocumentsDryRun(documents: SyncDocumentInput[], options?: {
|
|
3970
|
+
deleteMissing?: boolean;
|
|
3971
|
+
reindex?: boolean;
|
|
3972
|
+
reindexKind?: ReindexKind;
|
|
3973
|
+
reindexMode?: ReindexMode;
|
|
3974
|
+
now?: Date;
|
|
3975
|
+
}): SyncDocumentsDryRunSummary;
|
|
3976
|
+
declare function buildAgenticWorkStatus(cwd?: string): AgenticWorkStatus;
|
|
3977
|
+
declare function buildAgenticTimeline(options?: {
|
|
3978
|
+
limit?: number;
|
|
3979
|
+
cwd?: string;
|
|
3980
|
+
}): AgenticTimeline;
|
|
3981
|
+
|
|
3982
|
+
type LocalSourceProvider = "local_folder";
|
|
3983
|
+
type LocalSourceFileKind = "DOC" | "BINARY" | "CODE" | "CONFIG" | "OTHER";
|
|
3984
|
+
type LocalSourceSkippedReason = "ignored" | "too_large" | "read_error";
|
|
3985
|
+
type LocalSourceReindexKind = "doc" | "code";
|
|
3986
|
+
type LocalSourceReindexMode = "incremental" | "full";
|
|
3987
|
+
interface LocalSourceFile {
|
|
3988
|
+
path: string;
|
|
3989
|
+
kind: LocalSourceFileKind;
|
|
3990
|
+
format: string | null;
|
|
3991
|
+
sizeBytes: number;
|
|
3992
|
+
modifiedAt: string;
|
|
3993
|
+
sha256: string;
|
|
3994
|
+
}
|
|
3995
|
+
interface LocalSourceSkippedFile {
|
|
3996
|
+
path: string;
|
|
3997
|
+
reason: LocalSourceSkippedReason;
|
|
3998
|
+
sizeBytes?: number;
|
|
3999
|
+
}
|
|
4000
|
+
interface LocalSourceSummary {
|
|
4001
|
+
totalFiles: number;
|
|
4002
|
+
totalBytes: number;
|
|
4003
|
+
byKind: Record<LocalSourceFileKind, number>;
|
|
4004
|
+
skipped: number;
|
|
4005
|
+
}
|
|
4006
|
+
interface LocalSourceSnapshot {
|
|
4007
|
+
version: "snipara.local_source_snapshot.v1";
|
|
4008
|
+
generatedAt: string;
|
|
4009
|
+
root: string;
|
|
4010
|
+
provider: LocalSourceProvider;
|
|
4011
|
+
revision: string;
|
|
4012
|
+
recursive: boolean;
|
|
4013
|
+
maxFiles: number;
|
|
4014
|
+
maxFileBytes: number;
|
|
4015
|
+
summary: LocalSourceSummary;
|
|
4016
|
+
files: LocalSourceFile[];
|
|
4017
|
+
skipped: {
|
|
4018
|
+
total: number;
|
|
4019
|
+
byReason: Record<LocalSourceSkippedReason, number>;
|
|
4020
|
+
samples: LocalSourceSkippedFile[];
|
|
4021
|
+
};
|
|
4022
|
+
warnings: string[];
|
|
4023
|
+
}
|
|
4024
|
+
interface LocalSourceSnapshotOptions {
|
|
4002
4025
|
dir?: string;
|
|
4003
|
-
|
|
4026
|
+
recursive?: boolean;
|
|
4027
|
+
maxFiles?: number;
|
|
4028
|
+
maxFileBytes?: number;
|
|
4029
|
+
}
|
|
4030
|
+
interface LocalSourceComparison {
|
|
4031
|
+
added: string[];
|
|
4032
|
+
modified: string[];
|
|
4033
|
+
deleted: string[];
|
|
4034
|
+
unchanged: number;
|
|
4035
|
+
}
|
|
4036
|
+
interface LocalSourceStatusResult {
|
|
4037
|
+
root: string;
|
|
4038
|
+
snapshotPath: string;
|
|
4039
|
+
previous: LocalSourceSnapshot | null;
|
|
4040
|
+
current: LocalSourceSnapshot;
|
|
4041
|
+
comparison: LocalSourceComparison;
|
|
4042
|
+
}
|
|
4043
|
+
interface LocalSourceSyncOptions extends LocalSourceSnapshotOptions {
|
|
4044
|
+
prefix?: string;
|
|
4045
|
+
mode?: OnboardFolderMode;
|
|
4046
|
+
deleteMissing?: boolean;
|
|
4047
|
+
apply?: boolean;
|
|
4048
|
+
reindex?: boolean;
|
|
4049
|
+
reindexKind?: LocalSourceReindexKind;
|
|
4050
|
+
reindexMode?: LocalSourceReindexMode;
|
|
4051
|
+
includeGraph?: boolean;
|
|
4004
4052
|
json?: boolean;
|
|
4005
4053
|
}
|
|
4006
|
-
interface
|
|
4054
|
+
interface LocalSourceSyncResult {
|
|
4055
|
+
root: string;
|
|
4056
|
+
snapshotPath: string;
|
|
4057
|
+
snapshot: LocalSourceSnapshot;
|
|
4058
|
+
comparison: LocalSourceComparison;
|
|
4059
|
+
documents: {
|
|
4060
|
+
onboarding: Pick<OnboardFolderManifest, "source" | "classification" | "summary" | "warnings">;
|
|
4061
|
+
dryRun: OnboardFolderManifest["dryRun"];
|
|
4062
|
+
};
|
|
4063
|
+
codeOverlay: {
|
|
4064
|
+
cachePath: string;
|
|
4065
|
+
summary: LocalCodeOverlaySummary;
|
|
4066
|
+
};
|
|
4067
|
+
apply: null | {
|
|
4068
|
+
sync: Record<string, unknown>;
|
|
4069
|
+
reindex?: Record<string, unknown>;
|
|
4070
|
+
};
|
|
4071
|
+
warnings: string[];
|
|
4072
|
+
}
|
|
4073
|
+
declare function getLocalSourceSnapshotPath(cwd?: string): string;
|
|
4074
|
+
declare function buildLocalSourceSnapshot(options?: LocalSourceSnapshotOptions): LocalSourceSnapshot;
|
|
4075
|
+
declare function writeLocalSourceSnapshot(snapshot: LocalSourceSnapshot): string;
|
|
4076
|
+
declare function readLocalSourceSnapshot(cwd?: string): LocalSourceSnapshot | null;
|
|
4077
|
+
declare function compareLocalSourceSnapshots(previous: LocalSourceSnapshot | null, current: LocalSourceSnapshot): LocalSourceComparison;
|
|
4078
|
+
declare function buildLocalSourceStatus(options?: LocalSourceSnapshotOptions): LocalSourceStatusResult;
|
|
4079
|
+
declare function buildLocalSourceSyncResult(options?: LocalSourceSyncOptions): Promise<LocalSourceSyncResult>;
|
|
4080
|
+
|
|
4081
|
+
interface LocalWorkerDeclaration {
|
|
4007
4082
|
id: string;
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4083
|
+
workerRole: string;
|
|
4084
|
+
endpointType: "local";
|
|
4085
|
+
provider: string;
|
|
4086
|
+
baseUrl: string;
|
|
4087
|
+
command?: string;
|
|
4088
|
+
model?: string;
|
|
4089
|
+
preferModel?: string;
|
|
4090
|
+
capabilities: string[];
|
|
4091
|
+
reasoning: "low" | "medium" | "high";
|
|
4092
|
+
writeScope: string[];
|
|
4093
|
+
createdAt: string;
|
|
4094
|
+
updatedAt: string;
|
|
4014
4095
|
}
|
|
4015
|
-
interface
|
|
4016
|
-
schemaVersion: "snipara.
|
|
4096
|
+
interface LocalWorkersConfig {
|
|
4097
|
+
schemaVersion: "snipara.local_workers.v1";
|
|
4017
4098
|
updatedAt: string;
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
actorId?: string;
|
|
4021
|
-
actorType?: CollaborationActorType;
|
|
4022
|
-
actorLabel?: string;
|
|
4023
|
-
client?: string;
|
|
4024
|
-
repository?: string;
|
|
4025
|
-
branch?: string;
|
|
4026
|
-
worktree?: string;
|
|
4027
|
-
task?: string;
|
|
4028
|
-
files: string[];
|
|
4029
|
-
resources: CollaborationResource[];
|
|
4030
|
-
leases: CollaborationLocalLeaseRecord[];
|
|
4031
|
-
lastGuard?: {
|
|
4032
|
-
decision: CollaborationGuardDecision;
|
|
4033
|
-
severity: string;
|
|
4034
|
-
checkedAt: string;
|
|
4035
|
-
action: string;
|
|
4036
|
-
resources: CollaborationResource[];
|
|
4037
|
-
conflictCount: number;
|
|
4038
|
-
};
|
|
4099
|
+
defaultWorkerId: string;
|
|
4100
|
+
workers: LocalWorkerDeclaration[];
|
|
4039
4101
|
}
|
|
4040
|
-
interface
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4102
|
+
interface LocalWorkerRoutingDefaults {
|
|
4103
|
+
worker: LocalWorkerDeclaration;
|
|
4104
|
+
routeLocalWorkers: true;
|
|
4105
|
+
routingWorkerRole: string;
|
|
4106
|
+
routingLocalBaseUrl: string;
|
|
4107
|
+
routingLocalModel?: string;
|
|
4108
|
+
routingLocalPreferModel?: string;
|
|
4109
|
+
routingLocalProvider: string;
|
|
4110
|
+
routingPreferredEndpoints: string[];
|
|
4111
|
+
routingAllowedEndpoints: string[];
|
|
4112
|
+
plannerRetainsReasoning: true;
|
|
4050
4113
|
}
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
}
|
|
4067
|
-
interface
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4114
|
+
interface LocalWorkerAddOptions {
|
|
4115
|
+
id?: string;
|
|
4116
|
+
role?: string;
|
|
4117
|
+
provider?: string;
|
|
4118
|
+
baseUrl?: string;
|
|
4119
|
+
model?: string;
|
|
4120
|
+
preferModel?: string;
|
|
4121
|
+
capabilities?: string[];
|
|
4122
|
+
writeScope?: string[];
|
|
4123
|
+
contextWindow?: number;
|
|
4124
|
+
reasoning?: "low" | "medium" | "high";
|
|
4125
|
+
default?: boolean;
|
|
4126
|
+
json?: boolean;
|
|
4127
|
+
transport?: "openai_http" | "cli";
|
|
4128
|
+
command?: string;
|
|
4129
|
+
}
|
|
4130
|
+
interface LocalWorkerStatusOptions {
|
|
4131
|
+
json?: boolean;
|
|
4132
|
+
}
|
|
4133
|
+
interface LocalWorkerListOptions {
|
|
4134
|
+
json?: boolean;
|
|
4135
|
+
}
|
|
4136
|
+
interface LocalWorkerRemoveOptions {
|
|
4137
|
+
id: string;
|
|
4138
|
+
json?: boolean;
|
|
4139
|
+
}
|
|
4140
|
+
interface LocalWorkerProbeOptions {
|
|
4141
|
+
baseUrl?: string;
|
|
4142
|
+
provider?: string;
|
|
4143
|
+
model?: string;
|
|
4144
|
+
preferModel?: string;
|
|
4145
|
+
role?: string;
|
|
4146
|
+
workerId?: string;
|
|
4147
|
+
capabilities?: string[];
|
|
4148
|
+
writeScope?: string[];
|
|
4149
|
+
reasoning?: "low" | "medium" | "high";
|
|
4150
|
+
contextWindow?: number;
|
|
4151
|
+
json?: boolean;
|
|
4152
|
+
}
|
|
4153
|
+
declare function workersLocalAddCommand(options: LocalWorkerAddOptions): void;
|
|
4154
|
+
declare function workersLocalStatusCommand(options?: LocalWorkerStatusOptions): void;
|
|
4155
|
+
declare function workersLocalListCommand(options?: LocalWorkerListOptions): void;
|
|
4156
|
+
declare function workersLocalRemoveCommand(options: LocalWorkerRemoveOptions): void;
|
|
4157
|
+
declare function workersLocalProbePrintCommand(options: LocalWorkerProbeOptions): void;
|
|
4158
|
+
declare function addLocalWorker(options: LocalWorkerAddOptions): {
|
|
4159
|
+
worker: LocalWorkerDeclaration;
|
|
4160
|
+
config: LocalWorkersConfig;
|
|
4161
|
+
workerConfigPath: string;
|
|
4162
|
+
policyPath: string;
|
|
4163
|
+
};
|
|
4164
|
+
declare function resolveLocalWorkerRoutingDefaults(options?: {
|
|
4165
|
+
workerId?: string;
|
|
4166
|
+
workerRole?: string;
|
|
4167
|
+
}): LocalWorkerRoutingDefaults | null;
|
|
4168
|
+
declare function readLocalWorkersConfig(): LocalWorkersConfig | null;
|
|
4169
|
+
|
|
4170
|
+
interface ControlledWorkerExecuteOptions {
|
|
4171
|
+
task: string;
|
|
4172
|
+
workerId?: string;
|
|
4173
|
+
workerRole?: string;
|
|
4174
|
+
endpointType?: "local" | "cloud" | "self_hosted" | "unknown";
|
|
4175
|
+
mode?: ControlledWorkerExecutionMode;
|
|
4176
|
+
command?: string;
|
|
4177
|
+
execute?: boolean;
|
|
4178
|
+
approvalReceipt?: string;
|
|
4179
|
+
outcomeReceipt?: string;
|
|
4180
|
+
writeScope?: string[];
|
|
4181
|
+
acceptance?: string[];
|
|
4182
|
+
proof?: string[];
|
|
4183
|
+
output?: string;
|
|
4184
|
+
projectId?: string;
|
|
4185
|
+
unifiedOutput?: string;
|
|
4186
|
+
dir?: string;
|
|
4187
|
+
json?: boolean;
|
|
4074
4188
|
}
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
workflowId?: string;
|
|
4083
|
-
phaseId?: string;
|
|
4084
|
-
phaseTitle?: string;
|
|
4085
|
-
branch?: string;
|
|
4086
|
-
actor?: string;
|
|
4087
|
-
next?: string;
|
|
4088
|
-
attention?: string;
|
|
4089
|
-
files?: string[];
|
|
4090
|
-
cwd?: string;
|
|
4189
|
+
interface ControlledWorkerExecuteResult {
|
|
4190
|
+
executed: boolean;
|
|
4191
|
+
blocked: boolean;
|
|
4192
|
+
receiptPath: string;
|
|
4193
|
+
unifiedReceiptPath: string | null;
|
|
4194
|
+
receipt: ControlledWorkerExecutionReceipt;
|
|
4195
|
+
unifiedReceipt: UnifiedReceiptEnvelope<ControlledWorkerExecutionReceipt> | null;
|
|
4091
4196
|
}
|
|
4092
|
-
declare function
|
|
4093
|
-
text: string;
|
|
4094
|
-
tags: string[];
|
|
4095
|
-
};
|
|
4197
|
+
declare function controlledWorkerExecuteCommand(options: ControlledWorkerExecuteOptions): ControlledWorkerExecuteResult;
|
|
4096
4198
|
|
|
4097
|
-
|
|
4098
|
-
type
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
reasons: OrchestratorRecommendationReason[];
|
|
4104
|
-
score: number;
|
|
4105
|
-
orchestratorRequired: boolean;
|
|
4106
|
-
policySource?: string;
|
|
4199
|
+
declare const MANIFEST_VERSION = "snipara.references.v1";
|
|
4200
|
+
type ReferenceStatus = "allowed" | "pending" | "denied" | "unsupported";
|
|
4201
|
+
interface ReferenceOccurrence {
|
|
4202
|
+
file: string;
|
|
4203
|
+
line: number;
|
|
4204
|
+
label?: string;
|
|
4107
4205
|
}
|
|
4108
|
-
interface
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4206
|
+
interface ReferenceManifestItem {
|
|
4207
|
+
id: string;
|
|
4208
|
+
url: string;
|
|
4209
|
+
normalizedUrl: string;
|
|
4210
|
+
domain: string;
|
|
4211
|
+
status: ReferenceStatus;
|
|
4212
|
+
reason: string;
|
|
4213
|
+
discoveredAt: string;
|
|
4214
|
+
occurrences: ReferenceOccurrence[];
|
|
4215
|
+
latestSnapshotPath?: string;
|
|
4216
|
+
latestFetchStatus?: number;
|
|
4217
|
+
latestFetchAt?: string;
|
|
4218
|
+
latestContentHash?: string;
|
|
4219
|
+
latestError?: string;
|
|
4114
4220
|
}
|
|
4115
|
-
interface
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
runtime: {
|
|
4123
|
-
cliAvailable: boolean;
|
|
4124
|
-
command?: string;
|
|
4125
|
-
legacyCommand?: boolean;
|
|
4126
|
-
version?: string;
|
|
4127
|
-
cliVersion?: string;
|
|
4128
|
-
installedPackageVersion?: string;
|
|
4129
|
-
versionMismatch?: boolean;
|
|
4130
|
-
mcpConfigured: boolean;
|
|
4131
|
-
mcpConfigPaths: string[];
|
|
4132
|
-
};
|
|
4133
|
-
orchestrator: {
|
|
4134
|
-
cliAvailable: boolean;
|
|
4135
|
-
command?: string;
|
|
4136
|
-
version?: string;
|
|
4137
|
-
source?: "path" | "workspace_venv";
|
|
4138
|
-
workspacePackageVersion?: string;
|
|
4139
|
-
versionMismatch?: boolean;
|
|
4140
|
-
};
|
|
4141
|
-
providerKeys: {
|
|
4142
|
-
openai: boolean;
|
|
4143
|
-
anthropic: boolean;
|
|
4144
|
-
any: boolean;
|
|
4145
|
-
sources: {
|
|
4146
|
-
openai?: ProviderKeySource;
|
|
4147
|
-
anthropic?: ProviderKeySource;
|
|
4148
|
-
};
|
|
4149
|
-
envFilesLoaded: string[];
|
|
4150
|
-
};
|
|
4151
|
-
docker: {
|
|
4152
|
-
available: boolean;
|
|
4153
|
-
};
|
|
4221
|
+
interface ReferenceManifest {
|
|
4222
|
+
version: typeof MANIFEST_VERSION;
|
|
4223
|
+
generatedAt: string;
|
|
4224
|
+
root: string;
|
|
4225
|
+
allowDomains: string[];
|
|
4226
|
+
denyDomains: string[];
|
|
4227
|
+
items: ReferenceManifestItem[];
|
|
4154
4228
|
}
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4229
|
+
interface ScanReferencesOptions {
|
|
4230
|
+
root?: string;
|
|
4231
|
+
output?: string;
|
|
4232
|
+
allowDomain?: string[];
|
|
4233
|
+
denyDomain?: string[];
|
|
4234
|
+
extensions?: string[];
|
|
4235
|
+
maxFiles?: number;
|
|
4236
|
+
json?: boolean;
|
|
4237
|
+
}
|
|
4238
|
+
interface IngestReferencesOptions {
|
|
4239
|
+
manifest?: string;
|
|
4240
|
+
outputDir?: string;
|
|
4241
|
+
allowDomain?: string[];
|
|
4242
|
+
ids?: string[];
|
|
4243
|
+
max?: number;
|
|
4244
|
+
timeoutMs?: number;
|
|
4245
|
+
maxBytes?: number;
|
|
4246
|
+
destinationPrefix?: string;
|
|
4247
|
+
upload?: boolean;
|
|
4248
|
+
reindex?: boolean;
|
|
4249
|
+
dryRun?: boolean;
|
|
4250
|
+
json?: boolean;
|
|
4251
|
+
}
|
|
4252
|
+
interface ScanSummary {
|
|
4253
|
+
manifest: ReferenceManifest;
|
|
4254
|
+
outputPath: string;
|
|
4255
|
+
scannedFiles: number;
|
|
4256
|
+
foundUrls: number;
|
|
4257
|
+
allowed: number;
|
|
4258
|
+
pending: number;
|
|
4259
|
+
denied: number;
|
|
4260
|
+
unsupported: number;
|
|
4261
|
+
}
|
|
4262
|
+
interface IngestSummary {
|
|
4263
|
+
manifestPath: string;
|
|
4264
|
+
selected: number;
|
|
4265
|
+
fetched: number;
|
|
4266
|
+
uploaded: number;
|
|
4267
|
+
failed: number;
|
|
4268
|
+
dryRun: boolean;
|
|
4269
|
+
snapshots: Array<{
|
|
4270
|
+
id: string;
|
|
4271
|
+
url: string;
|
|
4272
|
+
snapshotPath?: string;
|
|
4273
|
+
destinationPath?: string;
|
|
4274
|
+
status?: number;
|
|
4275
|
+
uploaded?: boolean;
|
|
4276
|
+
error?: string;
|
|
4277
|
+
}>;
|
|
4278
|
+
}
|
|
4279
|
+
declare function scanReferences(options?: ScanReferencesOptions): ScanSummary;
|
|
4280
|
+
declare function ingestReferences(options?: IngestReferencesOptions): Promise<IngestSummary>;
|
|
4281
|
+
declare function referencesScanCommand(options: ScanReferencesOptions): Promise<void>;
|
|
4282
|
+
declare function referencesIngestCommand(options: IngestReferencesOptions): Promise<void>;
|
|
4171
4283
|
|
|
4172
|
-
declare const
|
|
4173
|
-
interface
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
files: string[];
|
|
4180
|
-
gates: string[];
|
|
4181
|
-
needsRuntime: boolean;
|
|
4284
|
+
declare const POLICY_LEDGER_SYNC_REPORT_VERSION: "snipara.workflow_policy_ledger_sync.v0";
|
|
4285
|
+
interface PolicyLedgerSyncSummary {
|
|
4286
|
+
total: number;
|
|
4287
|
+
pendingRequests: number;
|
|
4288
|
+
resolvedDecisions: number;
|
|
4289
|
+
applyReceipts: number;
|
|
4290
|
+
policyDrafts: number;
|
|
4182
4291
|
}
|
|
4183
|
-
interface
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
artifacts:
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
environment: string | null;
|
|
4192
|
-
profile: string | null;
|
|
4193
|
-
hasCheckpoint: boolean;
|
|
4194
|
-
checkpointSummary: string | null;
|
|
4195
|
-
checkpointCapturedAt: string | null;
|
|
4292
|
+
interface PolicyLedgerSyncReport {
|
|
4293
|
+
version: typeof POLICY_LEDGER_SYNC_REPORT_VERSION;
|
|
4294
|
+
generatedAt: string;
|
|
4295
|
+
dryRun: boolean;
|
|
4296
|
+
summary: PolicyLedgerSyncSummary;
|
|
4297
|
+
artifacts: ProjectPolicyLedgerSyncArtifactInput[];
|
|
4298
|
+
hosted?: Record<string, unknown>;
|
|
4299
|
+
caveats: string[];
|
|
4196
4300
|
}
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4301
|
+
declare function buildPolicyLedgerSyncReport(options?: {
|
|
4302
|
+
cwd?: string;
|
|
4303
|
+
dryRun?: boolean;
|
|
4304
|
+
}): PolicyLedgerSyncReport;
|
|
4305
|
+
declare function workflowSyncPolicyLedgerCommand(options: {
|
|
4306
|
+
dryRun?: boolean;
|
|
4307
|
+
json?: boolean;
|
|
4308
|
+
}): Promise<void>;
|
|
4309
|
+
declare function collectPolicyLedgerSyncArtifacts(cwd?: string): ProjectPolicyLedgerSyncArtifactInput[];
|
|
4310
|
+
|
|
4311
|
+
type CacheStrategy = "exact" | "nearby" | "warm";
|
|
4312
|
+
interface QueryCacheScope {
|
|
4313
|
+
cwd?: string;
|
|
4314
|
+
projectId?: string;
|
|
4315
|
+
sessionId?: string;
|
|
4206
4316
|
}
|
|
4207
|
-
interface
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
plannerRetainsReasoning: boolean;
|
|
4211
|
-
speed: string;
|
|
4212
|
-
cost: string;
|
|
4213
|
-
contextBudget: string;
|
|
4214
|
-
capabilities: string[];
|
|
4215
|
-
forbiddenCapabilities: string[];
|
|
4216
|
-
writeScope: string[];
|
|
4217
|
-
structuredOutputRequired?: boolean;
|
|
4218
|
-
preferredEndpointTypes?: string[];
|
|
4219
|
-
allowedEndpointTypes?: string[];
|
|
4220
|
-
catalogLimit?: number;
|
|
4221
|
-
dailyBudgetCents?: number;
|
|
4222
|
-
monthlyBudgetCents?: number;
|
|
4223
|
-
fallback: "main_agent";
|
|
4317
|
+
interface QueryCacheLookup {
|
|
4318
|
+
query: string;
|
|
4319
|
+
maxTokens: number;
|
|
4224
4320
|
}
|
|
4225
|
-
interface
|
|
4226
|
-
|
|
4227
|
-
|
|
4321
|
+
interface QueryCacheHit {
|
|
4322
|
+
strategy: CacheStrategy;
|
|
4323
|
+
result: ContextQueryResult;
|
|
4324
|
+
sourceQuery: string;
|
|
4325
|
+
similarity?: number;
|
|
4228
4326
|
}
|
|
4229
|
-
interface
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
requirements: AdaptiveModelRequirements;
|
|
4233
|
-
recommendedWorkerClass: string;
|
|
4234
|
-
costEstimate: AdaptiveRoutingCostEstimate;
|
|
4235
|
-
humanApprovalRequired: boolean;
|
|
4236
|
-
fallback: "main_agent";
|
|
4237
|
-
rejectedReasons?: Record<string, string[]>;
|
|
4238
|
-
reasons: string[];
|
|
4239
|
-
warnings: string[];
|
|
4327
|
+
interface WarmSnapshotResult {
|
|
4328
|
+
storedEntries: number;
|
|
4329
|
+
fileName?: string;
|
|
4240
4330
|
}
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4331
|
+
declare class LocalQueryCache {
|
|
4332
|
+
private readonly scope;
|
|
4333
|
+
private readonly ttlMs;
|
|
4334
|
+
private readonly warmTtlMs;
|
|
4335
|
+
private readonly maxEntries;
|
|
4336
|
+
private readonly maxBytes;
|
|
4337
|
+
constructor(scope?: QueryCacheScope);
|
|
4338
|
+
lookup(options: QueryCacheLookup): QueryCacheHit | null;
|
|
4339
|
+
save(options: QueryCacheLookup, result: ContextQueryResult): void;
|
|
4340
|
+
storeWarmSnapshot(result: SessionMemoriesResult): WarmSnapshotResult;
|
|
4341
|
+
clear(): number;
|
|
4342
|
+
private loadIndex;
|
|
4343
|
+
private persistIndex;
|
|
4344
|
+
private pruneIndex;
|
|
4345
|
+
private readEntry;
|
|
4346
|
+
private findNearbyEntry;
|
|
4347
|
+
private lookupWarmSnapshot;
|
|
4248
4348
|
}
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
workerEndpoints?: Record<string, Record<string, unknown>>;
|
|
4257
|
-
workerProfiles?: Record<string, Record<string, unknown>>;
|
|
4258
|
-
candidates: Array<Record<string, unknown>>;
|
|
4349
|
+
declare function createLocalQueryCache(scope?: QueryCacheScope): LocalQueryCache;
|
|
4350
|
+
|
|
4351
|
+
declare const AUTOMATION_MANIFEST_RELATIVE_PATH = ".snipara/automations/manifest.json";
|
|
4352
|
+
type AutomationFileState = "create" | "update" | "unchanged" | "conflict";
|
|
4353
|
+
interface AutomationManifestFile {
|
|
4354
|
+
path: string;
|
|
4355
|
+
sha256: string;
|
|
4259
4356
|
}
|
|
4260
|
-
interface
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
reasons?: string[];
|
|
4268
|
-
warnings?: string[];
|
|
4269
|
-
rejectedReasons?: Record<string, string[]>;
|
|
4357
|
+
interface AutomationManifest {
|
|
4358
|
+
version: number;
|
|
4359
|
+
client: string;
|
|
4360
|
+
projectId?: string;
|
|
4361
|
+
apiUrl?: string;
|
|
4362
|
+
installedAt: string;
|
|
4363
|
+
files: AutomationManifestFile[];
|
|
4270
4364
|
}
|
|
4271
|
-
interface
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4365
|
+
interface AutomationFilePlan {
|
|
4366
|
+
path: string;
|
|
4367
|
+
targetPath: string;
|
|
4368
|
+
state: AutomationFileState;
|
|
4369
|
+
reason: string;
|
|
4370
|
+
currentSha256?: string;
|
|
4371
|
+
previousSha256?: string;
|
|
4372
|
+
nextSha256: string;
|
|
4373
|
+
writeContent?: string;
|
|
4278
4374
|
}
|
|
4279
|
-
interface
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
workerRole?: string;
|
|
4286
|
-
plannerRetainsReasoning?: boolean;
|
|
4287
|
-
preferredProfileStrengths?: string[];
|
|
4288
|
-
structuredOutputRequired?: boolean;
|
|
4289
|
-
catalogLimit?: number;
|
|
4290
|
-
dailyBudgetCents?: number;
|
|
4291
|
-
monthlyBudgetCents?: number;
|
|
4375
|
+
interface AutomationInstallResult {
|
|
4376
|
+
manifest: AutomationManifest;
|
|
4377
|
+
plan: AutomationFilePlan[];
|
|
4378
|
+
written: number;
|
|
4379
|
+
unchanged: number;
|
|
4380
|
+
dryRun: boolean;
|
|
4292
4381
|
}
|
|
4293
|
-
interface
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
workflowId: string | null;
|
|
4303
|
-
currentPhaseId: string | null;
|
|
4304
|
-
phases: OrchestratorHandoffWorkflowPhase[];
|
|
4305
|
-
};
|
|
4306
|
-
runtime: {
|
|
4307
|
-
sandbox: {
|
|
4308
|
-
provider: "snipara-sandbox";
|
|
4309
|
-
phases: OrchestratorHandoffRuntimeSandboxPhase[];
|
|
4310
|
-
} | null;
|
|
4311
|
-
};
|
|
4312
|
-
routing: {
|
|
4313
|
-
level: OrchestratorRecommendation["level"];
|
|
4314
|
-
reasons: OrchestratorRecommendation["reasons"];
|
|
4315
|
-
policySource: string | null;
|
|
4316
|
-
workProfile?: AdaptiveWorkProfile;
|
|
4317
|
-
requirements?: AdaptiveModelRequirements;
|
|
4318
|
-
routingCard?: AdaptiveRoutingCard;
|
|
4319
|
-
gateway?: AdaptiveRoutingGatewayStatus;
|
|
4320
|
-
runtimeCatalog?: AdaptiveRoutingRuntimeCatalog;
|
|
4321
|
-
resolution?: AdaptiveRoutingResolution;
|
|
4322
|
-
};
|
|
4323
|
-
task: {
|
|
4324
|
-
title: string;
|
|
4325
|
-
query: string;
|
|
4326
|
-
summary: string;
|
|
4327
|
-
};
|
|
4328
|
-
repo: {
|
|
4329
|
-
root: string;
|
|
4330
|
-
branch: string | null;
|
|
4331
|
-
headSha: string | null;
|
|
4332
|
-
changedFiles: string[];
|
|
4333
|
-
};
|
|
4334
|
-
coordination: {
|
|
4335
|
-
swarmId: string | null;
|
|
4336
|
-
claimScope: {
|
|
4337
|
-
files: string[];
|
|
4338
|
-
symbols: string[];
|
|
4339
|
-
};
|
|
4340
|
-
htask: {
|
|
4341
|
-
featureTitle: string | null;
|
|
4342
|
-
workstreams: string[];
|
|
4343
|
-
};
|
|
4344
|
-
};
|
|
4345
|
-
validation: {
|
|
4346
|
-
requiresProofGate: boolean;
|
|
4347
|
-
requiresDriftCheck: boolean;
|
|
4348
|
-
liveChecks: string[];
|
|
4349
|
-
requiredEvidence: Array<{
|
|
4350
|
-
type: string;
|
|
4351
|
-
description: string;
|
|
4352
|
-
}>;
|
|
4353
|
-
};
|
|
4354
|
-
memory: {
|
|
4355
|
-
decisionIds: string[];
|
|
4356
|
-
contextRefs: string[];
|
|
4357
|
-
resumeSummary: string | null;
|
|
4358
|
-
};
|
|
4382
|
+
interface AutomationStatusResult {
|
|
4383
|
+
manifest: AutomationManifest | null;
|
|
4384
|
+
files: Array<{
|
|
4385
|
+
path: string;
|
|
4386
|
+
targetPath: string;
|
|
4387
|
+
state: "up-to-date" | "modified" | "missing";
|
|
4388
|
+
expectedSha256: string;
|
|
4389
|
+
currentSha256?: string;
|
|
4390
|
+
}>;
|
|
4359
4391
|
}
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
query: string;
|
|
4364
|
-
summary: string;
|
|
4365
|
-
title?: string;
|
|
4366
|
-
mode?: string;
|
|
4367
|
-
rootDir?: string;
|
|
4368
|
-
changedFiles?: string[];
|
|
4369
|
-
contextRefs?: string[];
|
|
4370
|
-
decisionIds?: string[];
|
|
4371
|
-
resumeSummary?: string;
|
|
4372
|
-
featureTitle?: string;
|
|
4373
|
-
workstreams?: string[];
|
|
4374
|
-
adaptiveRouting?: AdaptiveWorkRoutingRecommendation | null;
|
|
4392
|
+
declare class AutomationInstallConflictError extends Error {
|
|
4393
|
+
conflicts: AutomationFilePlan[];
|
|
4394
|
+
constructor(conflicts: AutomationFilePlan[]);
|
|
4375
4395
|
}
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
command: string;
|
|
4396
|
+
declare class AutomationUnsupportedHookBundleError extends Error {
|
|
4397
|
+
client: string;
|
|
4398
|
+
files: string[];
|
|
4399
|
+
constructor(client: string, files: string[]);
|
|
4381
4400
|
}
|
|
4382
|
-
declare function
|
|
4383
|
-
declare function
|
|
4384
|
-
declare function
|
|
4401
|
+
declare function getAutomationManifestPath(projectDir?: string): string;
|
|
4402
|
+
declare function loadAutomationManifest(projectDir?: string): AutomationManifest | null;
|
|
4403
|
+
declare function buildAutomationInstallPlan(args: {
|
|
4404
|
+
projectDir: string;
|
|
4405
|
+
bundle: AutomationConfigBundle;
|
|
4406
|
+
manifest?: AutomationManifest | null;
|
|
4407
|
+
force?: boolean;
|
|
4408
|
+
}): AutomationFilePlan[];
|
|
4409
|
+
declare function installAutomationBundle(args: {
|
|
4410
|
+
client: string;
|
|
4411
|
+
projectDir?: string;
|
|
4412
|
+
bundle?: AutomationConfigBundle;
|
|
4413
|
+
force?: boolean;
|
|
4414
|
+
dryRun?: boolean;
|
|
4415
|
+
}): Promise<AutomationInstallResult>;
|
|
4416
|
+
declare function getAutomationStatus(projectDir?: string): AutomationStatusResult;
|
|
4385
4417
|
|
|
4386
4418
|
export { AUTOMATION_MANIFEST_RELATIVE_PATH, AutomationInstallConflictError, AutomationUnsupportedHookBundleError, CODING_INTELLIGENCE_LEDGER_VERSION, COLLABORATION_STATE_RELATIVE_PATH, ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES, ENGINEERING_LEAD_EXECUTION_RECEIPT_STATUSES, ENGINEERING_LEAD_POSTURES, ENGINEERING_LEAD_PROOF_VERIFICATION_SOURCES, ENGINEERING_LEAD_PROOF_VERIFICATION_STATUSES, ENGINEERING_LEAD_ROUTING_MODES, ENGINEERING_LEAD_STATUSES, ENGINEERING_LEAD_SUPERVISION_STATUSES, ENGINEERING_LEAD_WORKER_ROLES, ENGINEERING_LEAD_WORK_PACKAGE_STATUSES, ORCHESTRATOR_HANDOFF_RELATIVE_PATH, POLICY_LEDGER_SYNC_REPORT_VERSION, PRODUCER_LOOP_ARTIFACT_VERSION, PRODUCER_LOOP_RELATIVE_DIR, PRODUCER_LOOP_REPORT_VERSION, TEAM_SYNC_STATE_RELATIVE_PATH, WHY_OUTCOME_CAPTURE_VERSION, WORKFLOW_PLANS_RELATIVE_DIR, WORKFLOW_STATE_RELATIVE_PATH, addLocalWorker, agentReadinessAuditCommand, appendActivityEvent, archiveInactiveTeamSyncWork, attachLocalContextPackReceipts, autoArchiveTeamSyncState, buildAdaptiveWorkRoutingRecommendation, buildAgentReadinessAuditReport, buildAgenticHandoffMarkdown, buildAgenticTimeline, buildAgenticWorkStatus, buildAutomationInstallPlan, buildCanonicalEvent, buildCodeHooksInstallPlan, buildCodePromotionResult, buildCodeStatusResult, buildCodeSyncResult, buildCodingIntelligenceLedger, buildCollaborationActor, buildCollaborationGuardActionCards, buildCollaborationHooksInstallPlan, buildCompanionEngineeringLeadPlanReport, buildContextPackStats, buildEvalCaseArtifact, buildGeneratedWorkflowPlanDocument, buildHostedCodeOverlayUploadPayload, buildHostedGuardPayload, buildJournalCheckpointEntry, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalContextPackReceipt, buildLocalContextPackReceipts, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalProjectRealityCheck, buildLocalShortestPathResult, buildLocalSourceSnapshot, buildLocalSourceStatus, buildLocalSourceSyncResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildPolicyLedgerSyncReport, buildProducerLoopReport, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapBrief, buildSessionBootstrapQuality, buildSessionSnapshot, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWhyOutcomeCaptureReport, buildWorkflowImpactGate, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, codingLedgerExportCommand, collaborationIdeStatusCommand, collectAgentReadinessLocalSignals, collectPolicyLedgerSyncArtifacts, collectSyncDocuments, collectSyncDocumentsInput, compactHostedGuardResources, compareLocalSourceSnapshots, completeTeamSyncStateFromEvidence, completeTeamSyncWorkFromEvidence, contextPackCleanCommand, contextPackPackCommand, contextPackRetrieveCommand, contextPackStatsCommand, controlledWorkerExecuteCommand, createClient, createEmptyCollaborationState, createEmptyTeamSyncState, createLocalQueryCache, deriveLocalCollaborationResourcesFromFiles, detectReleaseSurfacesFromFiles, detectRuntimeEnvironment, evalExportCommand, evalRunCommand, evaluateProjectPolicyGates, extractCommandFromToolInput, extractFilesFromToolInput, formatAgentReadinessAuditReport, formatCompanionEngineeringLeadPlanReport, formatOrchestratorRecommendationReason, formatPolicyGateDecision, formatProjectJudgmentCard, formatStuckGuardDecision, getAutomationManifestPath, getAutomationStatus, getCollaborationStatePath, getConfigPath, getContextPackStoragePaths, getLocalCodeOverlayCachePath, getLocalCodePromotionStatePath, getLocalSourceSnapshotPath, getOrchestratorRecommendation, getPlanStepDisplayTitle, getStagedFiles, getStuckGuardInjection, getTeamSyncStatePath, ingestReferences, installAutomationBundle, leadPlanCommand, listProjectsForApiKey, loadAutomationManifest, loadCollaborationState, loadConfig, loadTeamSyncState, memoryAuditCommand, memoryCleanCandidatesCommand, memoryCompactCommand, memoryHealthCommand, memoryLocalCommand, memoryReviewsCommand, normalizeCollaborationFiles, normalizeGuardTag, normalizeWorkflowPlanInput, outcomeCapturePreviewCommand, packContext, parseCollaborationResources, projectIntelligenceBriefCommand, projectIntelligenceRunCommand, readActivityTimeline, readLocalCodeOverlayCache, readLocalCodePromotionState, readLocalSourceSnapshot, readLocalWorkersConfig, readSessionSnapshot, realityCheckCommand, referencesIngestCommand, referencesScanCommand, resolveAutoWorkflowMode, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveLocalWorkerRoutingDefaults, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, workersLocalAddCommand, workersLocalListCommand, workersLocalProbePrintCommand, workersLocalRemoveCommand, workersLocalStatusCommand, workflowSyncPolicyLedgerCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff, writeProducerLoopArtifact, writeSessionSnapshot };
|