rea-agents 3.0.0 → 3.1.0
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/README.md +14 -16
- package/dist/application/AnalysisContextQueries.js +21 -9
- package/dist/application/ApplicationWorkflowEvidenceResolver.js +19 -11
- package/dist/application/ArtifactInventory/policy.js +17 -0
- package/dist/application/ArtifactInventory/reader.js +1 -4
- package/dist/application/ArtifactInventory/scanCanonical.js +0 -3
- package/dist/application/ArtifactInventory/scanReader.js +7 -7
- package/dist/application/ArtifactInventory/types.js +1 -5
- package/dist/application/BinarySession.js +14 -16
- package/dist/application/BinarySessionRecords.js +31 -5
- package/dist/application/BinarySessionStatus.js +11 -5
- package/dist/application/BrowserEvidence.js +3 -5
- package/dist/application/CapabilityClientRequirements.js +26 -0
- package/dist/application/CapabilityInventory.js +134 -63
- package/dist/application/CrossVersionInventory.js +7 -6
- package/dist/application/ElectronActiveEvidence.js +55 -0
- package/dist/application/ElectronActiveObservationPort.js +1 -0
- package/dist/application/ElectronActiveObservationService.js +81 -0
- package/dist/application/EnhancedTools.js +22 -20
- package/dist/application/EvidenceBundleCommands.js +5 -1
- package/dist/application/EvidenceLedger.js +8 -1
- package/dist/application/JavaScriptReplayPermission.js +1 -1
- package/dist/application/JavaScriptReplayService.js +23 -15
- package/dist/application/ManagedRuntimeCorrelationService.js +9 -5
- package/dist/application/NodeRuntimeCharacterizationService.js +8 -9
- package/dist/application/ProcessCaptureLifecycle.js +5 -0
- package/dist/application/ProcessCli.js +2 -1
- package/dist/application/ProcessHarness.js +8 -3
- package/dist/application/ProcessNormalization.js +2 -1
- package/dist/application/ProjectPermissionStore.js +1 -0
- package/dist/application/ReferenceSourceImport.js +2 -2
- package/dist/application/SetupClientConfiguration.js +6 -1
- package/dist/application/WindowsCapabilities.js +5 -4
- package/dist/artifacts/ArtifactProvider.js +8 -10
- package/dist/artifacts/SafeOutputTree.js +7 -8
- package/dist/browser/CdpCaptureStorageFingerprints.js +10 -7
- package/dist/browser/CdpElectronInspection.js +3 -1
- package/dist/browser/JavaScriptRuntimeScope.js +5 -0
- package/dist/browser/PlaywrightElectronActiveActions.js +324 -0
- package/dist/browser/PlaywrightElectronActiveProvider.js +294 -0
- package/dist/browser/PlaywrightScenarioBrowser.js +4 -4
- package/dist/browser/PlaywrightScenarioSession.js +4 -4
- package/dist/browser/SensitiveTextCapture.js +1 -1
- package/dist/browser/V8InspectorCaptureProjection.js +1 -0
- package/dist/browser/V8InspectorProvider.js +3 -3
- package/dist/catalogIdentity.js +12 -6
- package/dist/cli/managedCommands.js +1 -1
- package/dist/cliApplicationCommands.js +2 -2
- package/dist/cliBrowserAdvancedCommands.js +11 -5
- package/dist/cliBrowserCommands.js +14 -7
- package/dist/cliCommandNames.js +1 -0
- package/dist/cliElectronCommands.js +46 -4
- package/dist/cliJavaScriptRuntimeCommands.js +14 -6
- package/dist/cliObservationOptions.js +4 -0
- package/dist/cliPolicyCommands.js +1 -0
- package/dist/config/browserScenario.js +77 -0
- package/dist/config/electronAutomation.js +35 -0
- package/dist/config/environment.js +6 -0
- package/dist/config/javascriptReplay.js +41 -0
- package/dist/config/managedRuntime.js +25 -0
- package/dist/config/parseConfig.js +56 -200
- package/dist/config/parsers.js +10 -1
- package/dist/config/passiveObservation.js +157 -0
- package/dist/config/processCapture.js +47 -0
- package/dist/contracts/applicationToolContracts.js +2 -5
- package/dist/contracts/applicationWorkflowInputContracts.js +86 -96
- package/dist/contracts/artifactToolContracts.js +27 -34
- package/dist/contracts/browserToolContracts.js +2 -2
- package/dist/contracts/electronToolContracts.js +30 -1
- package/dist/contracts/enhancedInputs.js +13 -29
- package/dist/contracts/functionWorkflowToolContracts.js +2 -3
- package/dist/contracts/managedToolContracts.js +4 -9
- package/dist/contracts/managedWorkflowExamples.js +12 -9
- package/dist/contracts/managedWorkflowToolContracts.js +30 -27
- package/dist/contracts/nativeToolContracts.js +2 -3
- package/dist/contracts/sessionToolSchemas.js +61 -0
- package/dist/contracts/toolContractExamples.js +1 -0
- package/dist/contracts/toolContractHelpers.js +23 -0
- package/dist/contracts/toolContracts.js +5 -77
- package/dist/contracts/toolEffects.js +15 -0
- package/dist/contracts/toolOutputSchemaGroups.js +17 -2
- package/dist/contracts/toolOutputSchemaPrimitives.js +76 -26
- package/dist/contracts/toolSchemaMetadata.js +128 -0
- package/dist/doctorRuntime.js +1 -1
- package/dist/domain/androidApplication.js +2 -0
- package/dist/domain/appleApplication.js +2 -0
- package/dist/domain/binaryTarget.js +7 -5
- package/dist/domain/binaryTargetTypes.js +1 -0
- package/dist/domain/browserCaptureComparison.js +21 -69
- package/dist/domain/browserObservation.js +22 -9
- package/dist/domain/bytecodeProvider.js +33 -35
- package/dist/domain/callPath.js +3 -2
- package/dist/domain/conformanceReplay.js +3 -3
- package/dist/domain/conformanceTrustGate.js +151 -16
- package/dist/domain/customProtocolCapture.js +3 -3
- package/dist/domain/electronActiveObservation.js +277 -0
- package/dist/domain/electronObservation.js +15 -11
- package/dist/domain/electronStaticAnalysisValues.js +4 -1
- package/dist/domain/eventProcessTree.js +82 -79
- package/dist/domain/functionComparisonNormalization.js +15 -8
- package/dist/domain/functionDossierEvidence.js +9 -4
- package/dist/domain/hopperValues.js +68 -71
- package/dist/domain/inputIssueProjection.js +4 -1
- package/dist/domain/investigationWorkspace.js +16 -15
- package/dist/domain/javascriptExportShapeComparisonSchemas.js +2 -2
- package/dist/domain/javascriptReplay.js +79 -63
- package/dist/domain/javascriptRuntimeObservation.js +1 -0
- package/dist/domain/javascriptRuntimeReconciliationActive.js +89 -0
- package/dist/domain/javascriptRuntimeReconciliationGraph.js +11 -10
- package/dist/domain/javascriptRuntimeReconciliationMatching.js +57 -49
- package/dist/domain/javascriptRuntimeReconciliationParsing.js +5 -1
- package/dist/domain/javascriptRuntimeReconciliationResult.js +21 -14
- package/dist/domain/javascriptRuntimeReconciliationSchemas.js +1 -1
- package/dist/domain/knownPageCoverage.js +15 -7
- package/dist/domain/nativeApiBoundary.js +15 -7
- package/dist/domain/nodeRuntimeCharacterization.js +14 -13
- package/dist/domain/processCaptureReactiveValidation.js +8 -3
- package/dist/domain/processCaptureValidation.js +7 -3
- package/dist/domain/processComparison.js +12 -7
- package/dist/domain/processObservation.js +5 -6
- package/dist/domain/processReactiveMatching.js +14 -7
- package/dist/domain/processReactiveTransition.js +9 -3
- package/dist/domain/processScenario.js +6 -3
- package/dist/domain/processTraceComparison.js +3 -2
- package/dist/domain/protocolCapture.js +8 -6
- package/dist/domain/reconstructionReadinessSchemas.js +30 -2
- package/dist/domain/referenceSourceImportParsing.js +2 -2
- package/dist/domain/replayMachineRuntime.js +5 -3
- package/dist/domain/sourceToBundleComparison.js +2 -2
- package/dist/domain/sourceToBundleComparisonSchemas.js +8 -8
- package/dist/domain/sourceToBundleSignals.js +7 -1
- package/dist/domain/staticRuntimeCorrelation.js +7 -5
- package/dist/domain/webBundleAnalysis.js +14 -14
- package/dist/domain/webCaptureDiff.js +15 -12
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +2 -3
- package/dist/generatedMcpToolCatalog.js +1 -1
- package/dist/generatedPackageMetadata.js +1 -1
- package/dist/ghidra/GhidraClient.js +1 -1
- package/dist/ghidra/GhidraClientStartup.js +1 -1
- package/dist/ghidra/GhidraFunctionValues.js +17 -15
- package/dist/ghidra/GhidraInventoryValues.js +57 -47
- package/dist/ghidra/GhidraProvider.js +18 -10
- package/dist/ghidra/GhidraProviderCapabilities.js +5 -1
- package/dist/ghidra/GhidraSocketConnection.js +1 -1
- package/dist/ghidra/protocol.js +19 -42
- package/dist/hopper/BridgeLauncher.js +3 -1
- package/dist/hopper/HopperAnalysisProfile.js +2 -4
- package/dist/hopper/HopperCleanup.js +5 -6
- package/dist/hopper/HopperClient.js +1 -1
- package/dist/hopper/HopperProvider.js +0 -14
- package/dist/hopper/LinuxPrivateDisplayProbe.js +16 -10
- package/dist/main/reload.js +1 -6
- package/dist/main/state.js +0 -14
- package/dist/main/transport.js +30 -37
- package/dist/main.js +17 -15
- package/dist/mcpDoctor.js +2 -24
- package/dist/process/PrivateRuntimeRoot.js +17 -0
- package/dist/process/ProcessOwnership.js +64 -128
- package/dist/process/ProcessOwnershipIdentity.js +13 -0
- package/dist/process/ProcessOwnershipObservation.js +88 -0
- package/dist/process/ProcessOwnershipProcessTree.js +22 -0
- package/dist/process/ProviderDeadline.js +8 -12
- package/dist/process/WindowsAuthority.js +32 -0
- package/dist/reference/ReferenceSourceReader.js +3 -3
- package/dist/reference/ReferenceSourceReaderEntries.js +2 -2
- package/dist/replay/JavaScriptReplayWorker.js +95 -11
- package/dist/replay/JavaScriptReplayWorkerTypes.js +1 -0
- package/dist/replay/LinuxJavaScriptReplayRunner.js +10 -15
- package/dist/replay/ReplayOutcome.js +26 -15
- package/dist/replay/ReplayWorkerProtocol.js +34 -29
- package/dist/server/createServer.js +158 -94
- package/dist/server/mcpClientMetadata.js +32 -0
- package/dist/server/registerApplicationTools/characterization.js +6 -13
- package/dist/server/registerApplicationTools/compareExportShapes.js +2 -7
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +2 -7
- package/dist/server/registerApplicationTools/compareVersions.js +3 -8
- package/dist/server/registerApplicationTools/controlledReplay.js +6 -11
- package/dist/server/registerApplicationTools/coverage.js +13 -19
- package/dist/server/registerApplicationTools/obligationLedger.js +1 -6
- package/dist/server/registerApplicationTools/readiness.js +1 -6
- package/dist/server/registerApplicationTools/traceFeature.js +3 -8
- package/dist/server/registerApplicationTools/traceSemantics.js +1 -6
- package/dist/server/registerArtifactComparisonTool.js +12 -16
- package/dist/server/registerBrowserScenarioTool.js +1 -6
- package/dist/server/registerBrowserTools.js +37 -79
- package/dist/server/registerBundleComparisonTool.js +10 -14
- package/dist/server/registerCloseLifecycleTool.js +6 -14
- package/dist/server/registerElectronTools.js +30 -47
- package/dist/server/registerEnhancedTools.js +114 -122
- package/dist/server/registerEvidenceTools.js +5 -9
- package/dist/server/registerFunctionComparisonTool.js +11 -15
- package/dist/server/registerInvestigationTools.js +41 -57
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +13 -27
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +4 -9
- package/dist/server/registerManagedWorkflowTools/contract.js +2 -3
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +3 -8
- package/dist/server/registerManagedWorkflowTools/planManagedRuntimeCorrelation.js +3 -8
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +8 -13
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +4 -9
- package/dist/server/registerOfficialTools.js +8 -9
- package/dist/server/registerProcessComparisonTool.js +19 -24
- package/dist/server/registerReplayMachineTool.js +4 -10
- package/dist/server/registerSessionRecordTools.js +69 -40
- package/dist/server/registerSessionStatusTool.js +13 -28
- package/dist/server/registerSessionTools.js +36 -52
- package/dist/server/sessionAvailabilityPolicy.js +2 -1
- package/dist/server/sessionToolPolicies.js +1 -5
- package/dist/server/toolRegistrationOptions.js +4 -192
- package/dist/server/toolResult.js +2 -18
- package/package.json +22 -14
- package/scripts/electron-active-hook-boundaries.cjs +394 -0
- package/scripts/electron-active-hook.cjs +501 -0
- package/scripts/rea.mjs +1 -11
- package/skills/reverse-engineer-anything/SKILL.md +2 -2
- package/dist/server/DynamicToolAvailability.js +0 -70
- package/dist/server/LazyToolCatalog.js +0 -134
- package/dist/server/hydrateServerTools.js +0 -191
- package/dist/server/toolInputValidation.js +0 -77
- package/scripts/package-runner-bootstrap.mjs +0 -72
|
@@ -9,21 +9,7 @@ const evidenceIdSchema = z
|
|
|
9
9
|
.string()
|
|
10
10
|
.regex(/^ev_[a-f0-9]{64}$/u)
|
|
11
11
|
.describe("Evidence ID returned earlier in this session");
|
|
12
|
-
const
|
|
13
|
-
const [leftName, left, rightName, right] = fields;
|
|
14
|
-
if ((left === undefined) !== (right === undefined))
|
|
15
|
-
return;
|
|
16
|
-
context.addIssue({
|
|
17
|
-
code: "custom",
|
|
18
|
-
path: [left === undefined ? leftName : rightName],
|
|
19
|
-
message: `Supply exactly one of ${leftName} or ${rightName}`,
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
/** MCP/CLI trace request accepting full Evidence or a ledger reference. */
|
|
23
|
-
export const traceApplicationFeatureRequestSchema = z
|
|
24
|
-
.strictObject({
|
|
25
|
-
application: evidenceSchema.optional(),
|
|
26
|
-
application_evidence_id: evidenceIdSchema.optional(),
|
|
12
|
+
const traceApplicationFeatureFacts = {
|
|
27
13
|
native_observations: traceApplicationFeatureInputSchema.shape.native_observations,
|
|
28
14
|
native_observation_evidence_ids: z
|
|
29
15
|
.array(evidenceIdSchema)
|
|
@@ -32,37 +18,30 @@ export const traceApplicationFeatureRequestSchema = z
|
|
|
32
18
|
seed: traceApplicationFeatureInputSchema.shape.seed,
|
|
33
19
|
direction: traceApplicationFeatureInputSchema.shape.direction,
|
|
34
20
|
limits: traceApplicationFeatureInputSchema.shape.limits,
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
21
|
+
};
|
|
22
|
+
/** MCP/CLI trace request accepting full Evidence or a ledger reference. */
|
|
23
|
+
export const traceApplicationFeatureRequestSchema = z.union([
|
|
24
|
+
z.strictObject({
|
|
25
|
+
...traceApplicationFeatureFacts,
|
|
26
|
+
application: evidenceSchema,
|
|
27
|
+
}),
|
|
28
|
+
z.strictObject({
|
|
29
|
+
...traceApplicationFeatureFacts,
|
|
30
|
+
application_evidence_id: evidenceIdSchema,
|
|
31
|
+
}),
|
|
32
|
+
]);
|
|
44
33
|
/** MCP/CLI semantic trace request accepting full Evidence or a ledger reference. */
|
|
45
|
-
export const traceJavaScriptSemanticsRequestSchema = z
|
|
46
|
-
.strictObject({
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
input.application_evidence_id,
|
|
57
|
-
]);
|
|
58
|
-
});
|
|
59
|
-
/** MCP/CLI comparison request accepting full Evidence or ledger references. */
|
|
60
|
-
export const compareApplicationVersionsRequestSchema = z
|
|
61
|
-
.strictObject({
|
|
62
|
-
left: evidenceSchema.optional(),
|
|
63
|
-
left_evidence_id: evidenceIdSchema.optional(),
|
|
64
|
-
right: evidenceSchema.optional(),
|
|
65
|
-
right_evidence_id: evidenceIdSchema.optional(),
|
|
34
|
+
export const traceJavaScriptSemanticsRequestSchema = z.union([
|
|
35
|
+
z.strictObject({
|
|
36
|
+
application: evidenceSchema,
|
|
37
|
+
query: javaScriptSemanticQueryInputSchema,
|
|
38
|
+
}),
|
|
39
|
+
z.strictObject({
|
|
40
|
+
application_evidence_id: evidenceIdSchema,
|
|
41
|
+
query: javaScriptSemanticQueryInputSchema,
|
|
42
|
+
}),
|
|
43
|
+
]);
|
|
44
|
+
const compareApplicationVersionsFacts = {
|
|
66
45
|
left_native_observations: compareApplicationVersionsInputSchema.shape.left_native_observations,
|
|
67
46
|
left_native_observation_evidence_ids: z
|
|
68
47
|
.array(evidenceIdSchema)
|
|
@@ -75,63 +54,74 @@ export const compareApplicationVersionsRequestSchema = z
|
|
|
75
54
|
.default([]),
|
|
76
55
|
limits: compareApplicationVersionsInputSchema.shape.limits,
|
|
77
56
|
unknown_registry_approved: compareApplicationVersionsInputSchema.shape.unknown_registry_approved,
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
57
|
+
};
|
|
58
|
+
/** MCP/CLI comparison request accepting full Evidence or ledger references. */
|
|
59
|
+
export const compareApplicationVersionsRequestSchema = z.union([
|
|
60
|
+
z.strictObject({
|
|
61
|
+
...compareApplicationVersionsFacts,
|
|
62
|
+
left: evidenceSchema,
|
|
63
|
+
right: evidenceSchema,
|
|
64
|
+
}),
|
|
65
|
+
z.strictObject({
|
|
66
|
+
...compareApplicationVersionsFacts,
|
|
67
|
+
left: evidenceSchema,
|
|
68
|
+
right_evidence_id: evidenceIdSchema,
|
|
69
|
+
}),
|
|
70
|
+
z.strictObject({
|
|
71
|
+
...compareApplicationVersionsFacts,
|
|
72
|
+
left_evidence_id: evidenceIdSchema,
|
|
73
|
+
right: evidenceSchema,
|
|
74
|
+
}),
|
|
75
|
+
z.strictObject({
|
|
76
|
+
...compareApplicationVersionsFacts,
|
|
77
|
+
left_evidence_id: evidenceIdSchema,
|
|
78
|
+
right_evidence_id: evidenceIdSchema,
|
|
79
|
+
}),
|
|
80
|
+
]);
|
|
81
|
+
const compareSourceToBundleFacts = {
|
|
96
82
|
reference: compareSourceToBundleInputSchema.shape.reference,
|
|
97
|
-
application: evidenceSchema.optional(),
|
|
98
|
-
application_evidence_id: evidenceIdSchema.optional(),
|
|
99
83
|
limits: compareSourceToBundleInputSchema.shape.limits,
|
|
100
84
|
unknown_registry_approved: compareSourceToBundleInputSchema.shape.unknown_registry_approved,
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
left_evidence_id: evidenceIdSchema.optional(),
|
|
115
|
-
right: evidenceSchema.optional(),
|
|
116
|
-
right_evidence_id: evidenceIdSchema.optional(),
|
|
85
|
+
};
|
|
86
|
+
/** Historical-source comparison accepting full application Evidence or a ledger reference. */
|
|
87
|
+
export const compareSourceToBundleRequestSchema = z.union([
|
|
88
|
+
z.strictObject({
|
|
89
|
+
...compareSourceToBundleFacts,
|
|
90
|
+
application: evidenceSchema,
|
|
91
|
+
}),
|
|
92
|
+
z.strictObject({
|
|
93
|
+
...compareSourceToBundleFacts,
|
|
94
|
+
application_evidence_id: evidenceIdSchema,
|
|
95
|
+
}),
|
|
96
|
+
]);
|
|
97
|
+
const compareJavaScriptExportShapesFacts = {
|
|
117
98
|
left_module_path: compareJavaScriptExportShapesInputSchema.shape.left_module_path,
|
|
118
99
|
left_export_name: compareJavaScriptExportShapesInputSchema.shape.left_export_name,
|
|
119
100
|
right_module_path: compareJavaScriptExportShapesInputSchema.shape.right_module_path,
|
|
120
101
|
right_export_name: compareJavaScriptExportShapesInputSchema.shape.right_export_name,
|
|
121
102
|
limits: compareJavaScriptExportShapesInputSchema.shape.limits,
|
|
122
103
|
unknown_registry_approved: compareJavaScriptExportShapesInputSchema.shape.unknown_registry_approved,
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
104
|
+
};
|
|
105
|
+
/** MCP/CLI export-shape request accepting full Evidence or ledger references. */
|
|
106
|
+
export const compareJavaScriptExportShapesRequestSchema = z.union([
|
|
107
|
+
z.strictObject({
|
|
108
|
+
...compareJavaScriptExportShapesFacts,
|
|
109
|
+
left: evidenceSchema,
|
|
110
|
+
right: evidenceSchema,
|
|
111
|
+
}),
|
|
112
|
+
z.strictObject({
|
|
113
|
+
...compareJavaScriptExportShapesFacts,
|
|
114
|
+
left: evidenceSchema,
|
|
115
|
+
right_evidence_id: evidenceIdSchema,
|
|
116
|
+
}),
|
|
117
|
+
z.strictObject({
|
|
118
|
+
...compareJavaScriptExportShapesFacts,
|
|
119
|
+
left_evidence_id: evidenceIdSchema,
|
|
120
|
+
right: evidenceSchema,
|
|
121
|
+
}),
|
|
122
|
+
z.strictObject({
|
|
123
|
+
...compareJavaScriptExportShapesFacts,
|
|
124
|
+
left_evidence_id: evidenceIdSchema,
|
|
125
|
+
right_evidence_id: evidenceIdSchema,
|
|
126
|
+
}),
|
|
127
|
+
]);
|
|
@@ -3,6 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
import { artifactOutputSchemas } from "./toolOutputSchemas.js";
|
|
4
4
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
5
5
|
import { toolContractMetadata } from "./toolEffects.js";
|
|
6
|
+
import { requireOutputSchema } from "./toolOutputSchemaPrimitives.js";
|
|
6
7
|
import { artifactInspectionLimitsSchema } from "../domain/artifactInspection.js";
|
|
7
8
|
const pageInput = {
|
|
8
9
|
node_offset: z.number().int().min(0).default(0),
|
|
@@ -30,25 +31,28 @@ const traversalLimitsInput = {
|
|
|
30
31
|
max_depth: z.number().int().min(0).max(100).default(20),
|
|
31
32
|
max_path_bytes: z.number().int().min(1).max(65_535).default(4_096),
|
|
32
33
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const integrityInput = {
|
|
35
|
+
fail: {
|
|
36
|
+
integrity_policy: z.literal("fail").default("fail"),
|
|
37
|
+
integrity_continue_approved: z.literal(false).default(false),
|
|
38
|
+
max_integrity_mismatches: z.number().int().min(1).max(100).default(10),
|
|
39
|
+
},
|
|
40
|
+
continue: {
|
|
41
|
+
integrity_policy: z.literal("record-and-continue"),
|
|
42
|
+
integrity_continue_approved: z.literal(true),
|
|
43
|
+
max_integrity_mismatches: z.number().int().min(1).max(100).default(10),
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
const artifactInventoryFacts = {
|
|
36
47
|
native_mount_approved: z.boolean().default(false),
|
|
37
|
-
integrity_policy: z.enum(["fail", "record-and-continue"]).default("fail"),
|
|
38
|
-
integrity_continue_approved: z.boolean().default(false),
|
|
39
|
-
max_integrity_mismatches: z.number().int().min(1).max(100).default(10),
|
|
40
48
|
...pageInput,
|
|
41
49
|
...traversalLimitsInput,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
path: ["integrity_continue_approved"],
|
|
49
|
-
message: "record-and-continue requires explicit approval",
|
|
50
|
-
});
|
|
51
|
-
});
|
|
50
|
+
};
|
|
51
|
+
/** Exact caller boundary for deterministic artifact inventory. */
|
|
52
|
+
export const artifactInventoryInputSchema = z.union([
|
|
53
|
+
z.object({ ...artifactInventoryFacts, ...integrityInput.fail }),
|
|
54
|
+
z.object({ ...artifactInventoryFacts, ...integrityInput.continue }),
|
|
55
|
+
]);
|
|
52
56
|
/** Exact caller boundary for approved artifact extraction. */
|
|
53
57
|
export const artifactExtractionInputSchema = z.object({
|
|
54
58
|
approved: z.literal(true),
|
|
@@ -66,24 +70,15 @@ export const artifactExtractionInputSchema = z.object({
|
|
|
66
70
|
...traversalLimitsInput,
|
|
67
71
|
});
|
|
68
72
|
/** Bounded provider-neutral inspection using one atomic inventory substep. */
|
|
69
|
-
|
|
70
|
-
.object({
|
|
73
|
+
const artifactInspectionFacts = {
|
|
71
74
|
native_mount_approved: z.boolean().default(false),
|
|
72
|
-
integrity_policy: z.enum(["fail", "record-and-continue"]).default("fail"),
|
|
73
|
-
integrity_continue_approved: z.boolean().default(false),
|
|
74
|
-
max_integrity_mismatches: z.number().int().min(1).max(100).default(10),
|
|
75
75
|
...artifactInspectionLimitsSchema.shape,
|
|
76
76
|
...traversalLimitsInput,
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
code: "custom",
|
|
83
|
-
path: ["integrity_continue_approved"],
|
|
84
|
-
message: "record-and-continue requires explicit approval",
|
|
85
|
-
});
|
|
86
|
-
});
|
|
77
|
+
};
|
|
78
|
+
export const artifactInspectionInputSchema = z.union([
|
|
79
|
+
z.object({ ...artifactInspectionFacts, ...integrityInput.fail }),
|
|
80
|
+
z.object({ ...artifactInspectionFacts, ...integrityInput.continue }),
|
|
81
|
+
]);
|
|
87
82
|
const exampleInputSchema = z.record(z.string(), jsonValueSchema);
|
|
88
83
|
const examples = {
|
|
89
84
|
inventory_artifact: {},
|
|
@@ -95,9 +90,7 @@ const examples = {
|
|
|
95
90
|
},
|
|
96
91
|
};
|
|
97
92
|
const artifact = (name, description, inputSchema) => {
|
|
98
|
-
const outputSchema = artifactOutputSchemas
|
|
99
|
-
if (outputSchema === undefined)
|
|
100
|
-
throw new Error(`Missing artifact output schema for ${name}`);
|
|
93
|
+
const outputSchema = requireOutputSchema(artifactOutputSchemas, name);
|
|
101
94
|
return {
|
|
102
95
|
name,
|
|
103
96
|
...toolContractMetadata(name),
|
|
@@ -2,7 +2,7 @@ import { browserTargetListSchema, inspectWebPageInputSchema, listBrowserTargetsI
|
|
|
2
2
|
import { analyzeWebBundleInputSchema, webBundleAnalysisSchema, } from "../domain/webBundleAnalysis.js";
|
|
3
3
|
import { observeWebSessionInputSchema, webObservationSessionSchema, } from "../domain/browserSession.js";
|
|
4
4
|
import { discoverWebMcpToolsInputSchema, webMcpDiscoverySchema, } from "../domain/webMcpDiscovery.js";
|
|
5
|
-
import {
|
|
5
|
+
import { browserCaptureComparisonInputSchema, browserCaptureComparisonSchema, } from "../domain/browserCaptureComparison.js";
|
|
6
6
|
import { captureWebScreenshotInputSchema, compareWebScreenshotsInputSchema, webScreenshotDiffSchema, webScreenshotSchema, } from "../domain/webScreenshot.js";
|
|
7
7
|
import { toolContractMetadata } from "./toolEffects.js";
|
|
8
8
|
import { evidenceResultOf } from "./toolOutputSchemas.js";
|
|
@@ -248,7 +248,7 @@ export const BROWSER_TOOL_CONTRACTS = [
|
|
|
248
248
|
...toolContractMetadata("compare_web_captures"),
|
|
249
249
|
description: "Compare either passive web captures or step-indexed browser scenarios. Scenario comparison aligns exact step IDs, records deterministic literal normalization, and exposes bounded artifact-level changes plus alignment failures. Missing or truncated evidence never proves equality.",
|
|
250
250
|
kind: "browser-provider",
|
|
251
|
-
inputSchema:
|
|
251
|
+
inputSchema: browserCaptureComparisonInputSchema,
|
|
252
252
|
outputSchema: captureDiffOutputSchema,
|
|
253
253
|
examples: [
|
|
254
254
|
{
|
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { toolContractMetadata } from "./toolEffects.js";
|
|
3
3
|
import { evidenceResultOf } from "./toolOutputSchemas.js";
|
|
4
4
|
import { electronPageInspectionSchema, electronTargetListSchema, inspectElectronPageInputSchema, listElectronTargetsInputSchema, } from "../domain/electronObservation.js";
|
|
5
|
+
import { electronActiveObservationInputSchema, electronActiveObservationResultSchema, } from "../domain/electronActiveObservation.js";
|
|
5
6
|
import { analyzeJavaScriptApplicationInputSchema, javaScriptApplicationAnalysisResultV1Schema, javascriptApplicationAnalysisResultSchema, } from "../domain/javascriptApplicationAnalysis.js";
|
|
6
7
|
import { JAVASCRIPT_APPLICATION_NODE_KINDS } from "../domain/javascriptApplicationGraphSchemas.js";
|
|
7
8
|
import { applicationCoverageSchema } from "../domain/javascriptApplicationEvidenceSchemas.js";
|
|
@@ -78,6 +79,23 @@ const applicationOutputSchema = evidenceResultOf(z.union([
|
|
|
78
79
|
const reconciliationOutputSchema = evidenceResultOf(javascriptRuntimeReconciliationResultSchema);
|
|
79
80
|
const endpoint = "http://127.0.0.1:9223";
|
|
80
81
|
const root = "/Applications/Example.app/Contents/Resources";
|
|
82
|
+
const activeExample = {
|
|
83
|
+
schema_version: 1,
|
|
84
|
+
executable_path: "/Applications/Electron.app/Contents/MacOS/Electron",
|
|
85
|
+
application_path: "/Applications/Example.app/Contents/Resources/main.js",
|
|
86
|
+
application_root: "/Applications/Example.app/Contents/Resources",
|
|
87
|
+
args: [],
|
|
88
|
+
actions: [{ step_id: "exercise-ipc", kind: "click", selector: "#run" }],
|
|
89
|
+
limits: {
|
|
90
|
+
max_duration_ms: 60_000,
|
|
91
|
+
action_timeout_ms: 5_000,
|
|
92
|
+
max_actions: 20,
|
|
93
|
+
max_ipc_events: 2_000,
|
|
94
|
+
max_processes: 32,
|
|
95
|
+
max_windows: 32,
|
|
96
|
+
},
|
|
97
|
+
approved: true,
|
|
98
|
+
};
|
|
81
99
|
/** Root-confined Electron file-page discovery and inspection contracts. */
|
|
82
100
|
export const ELECTRON_TOOL_CONTRACTS = [
|
|
83
101
|
{
|
|
@@ -154,7 +172,7 @@ export const ELECTRON_TOOL_CONTRACTS = [
|
|
|
154
172
|
{
|
|
155
173
|
name: "reconcile_javascript_runtime",
|
|
156
174
|
...toolContractMetadata("reconcile_javascript_runtime"),
|
|
157
|
-
description: "Reconcile verified static JavaScript application graphs with existing passive web or Electron
|
|
175
|
+
description: "Reconcile verified static JavaScript application graphs with existing passive web/Electron CDP, passive V8 Inspector, or provider-owned active Electron Evidence. Active Electron captures contribute an explicitly partial target-only runtime record; they never invent renderer scripts, frames, workers, or execution claims. Exact captured-source digests take priority over caller-declared file/URL mappings; target, frame, script, and worker ambiguity remains explicit, and source-map authority stays separate.",
|
|
158
176
|
kind: "electron-provider",
|
|
159
177
|
inputSchema: reconcileJavaScriptRuntimeInputSchema,
|
|
160
178
|
outputSchema: reconciliationOutputSchema,
|
|
@@ -165,4 +183,15 @@ export const ELECTRON_TOOL_CONTRACTS = [
|
|
|
165
183
|
},
|
|
166
184
|
],
|
|
167
185
|
},
|
|
186
|
+
{
|
|
187
|
+
name: "capture_electron_scenario",
|
|
188
|
+
...toolContractMetadata("capture_electron_scenario"),
|
|
189
|
+
description: "Use this for an explicitly approved, provider-owned Electron run when passive CDP or Inspector observation cannot exercise application behavior. REA owns startup and teardown, accepts bounded click/wait actions plus window-targeted renderer reload/crash and synthetic open-url/second-instance delivery, and returns correlated window/WebContents/process/preload/session/navigation/shell/IPC evidence without retaining payload values. Results identify observed and unavailable event families, coverage status, action targets, and truncation. External shell, navigation, permission, download, popup, updater, and OS-integration effects are blocked and recorded. Use passive Electron tools for observation-only work.",
|
|
190
|
+
kind: "electron-provider",
|
|
191
|
+
inputSchema: electronActiveObservationInputSchema,
|
|
192
|
+
outputSchema: evidenceResultOf(electronActiveObservationResultSchema),
|
|
193
|
+
examples: [
|
|
194
|
+
{ title: "Exercise an owned Electron application", input: activeExample },
|
|
195
|
+
],
|
|
196
|
+
},
|
|
168
197
|
];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
const traceLiteralInputSchema = z.
|
|
2
|
+
const traceLiteralInputSchema = z.strictObject({
|
|
3
3
|
query: z.string().min(1),
|
|
4
4
|
case_sensitive: z.boolean().default(false),
|
|
5
5
|
limit: z.number().int().min(1).max(100).default(20),
|
|
@@ -11,27 +11,27 @@ const traceLiteralInputSchema = z.object({
|
|
|
11
11
|
});
|
|
12
12
|
/** Input schemas shared by MCP registration and enhanced application dispatch. */
|
|
13
13
|
export const enhancedInputSchemas = {
|
|
14
|
-
swift_classes: z.
|
|
15
|
-
get_objc_classes: z.
|
|
16
|
-
get_objc_protocols: z.
|
|
17
|
-
batch_decompile: z.
|
|
14
|
+
swift_classes: z.strictObject({ pattern: z.string().default("") }),
|
|
15
|
+
get_objc_classes: z.strictObject({ pattern: z.string().default("") }),
|
|
16
|
+
get_objc_protocols: z.strictObject({}),
|
|
17
|
+
batch_decompile: z.strictObject({
|
|
18
18
|
addresses: z
|
|
19
19
|
.array(z.string().describe("A provider-normalized procedure address"))
|
|
20
20
|
.max(20)
|
|
21
21
|
.default([]),
|
|
22
22
|
}),
|
|
23
|
-
get_call_graph: z.
|
|
23
|
+
get_call_graph: z.strictObject({
|
|
24
24
|
address: z.string().describe("A provider-normalized procedure address"),
|
|
25
25
|
direction: z.enum(["forward", "backward"]).default("forward"),
|
|
26
26
|
depth: z.number().int().min(1).max(5).default(2),
|
|
27
27
|
}),
|
|
28
|
-
analyze_swift_types: z.
|
|
29
|
-
find_xrefs_to_name: z.
|
|
30
|
-
binary_overview: z.
|
|
28
|
+
analyze_swift_types: z.strictObject({}),
|
|
29
|
+
find_xrefs_to_name: z.strictObject({ name: z.string() }),
|
|
30
|
+
binary_overview: z.strictObject({
|
|
31
31
|
detail: z.enum(["concise", "detailed"]).default("concise"),
|
|
32
32
|
limit: z.number().int().min(1).max(50).default(10),
|
|
33
33
|
}),
|
|
34
|
-
analyze_function: z.
|
|
34
|
+
analyze_function: z.strictObject({
|
|
35
35
|
procedure: z.string().describe("A procedure name or address"),
|
|
36
36
|
include_assembly: z.boolean().default(false),
|
|
37
37
|
limit: z.number().int().min(1).max(500).default(100),
|
|
@@ -40,7 +40,7 @@ export const enhancedInputSchemas = {
|
|
|
40
40
|
pseudocode_offset: z.number().int().min(0).default(0),
|
|
41
41
|
assembly_offset: z.number().int().min(0).default(0),
|
|
42
42
|
collection_offset: z
|
|
43
|
-
.
|
|
43
|
+
.strictObject({
|
|
44
44
|
comments: z.number().int().min(0).default(0),
|
|
45
45
|
callers: z.number().int().min(0).default(0),
|
|
46
46
|
callees: z.number().int().min(0).default(0),
|
|
@@ -61,7 +61,7 @@ export const enhancedInputSchemas = {
|
|
|
61
61
|
basic_blocks: 0,
|
|
62
62
|
}),
|
|
63
63
|
}),
|
|
64
|
-
inspect_native_api: z.
|
|
64
|
+
inspect_native_api: z.strictObject({
|
|
65
65
|
procedure: z.string().describe("A procedure name or address"),
|
|
66
66
|
max_pseudocode_chars: z.number().int().min(1).max(100_000).default(20_000),
|
|
67
67
|
max_instructions: z.number().int().min(1).max(5_000).default(500),
|
|
@@ -72,7 +72,7 @@ export const enhancedInputSchemas = {
|
|
|
72
72
|
}),
|
|
73
73
|
trace_feature: traceLiteralInputSchema,
|
|
74
74
|
find_code_for_string: traceLiteralInputSchema,
|
|
75
|
-
trace_call_path: z.
|
|
75
|
+
trace_call_path: z.strictObject({
|
|
76
76
|
start: z.string().describe("A provider-normalized procedure address"),
|
|
77
77
|
goal: z
|
|
78
78
|
.string()
|
|
@@ -88,19 +88,3 @@ export const enhancedInputSchemas = {
|
|
|
88
88
|
.describe("Explicit approval to record bounded residuals durably"),
|
|
89
89
|
}),
|
|
90
90
|
};
|
|
91
|
-
/** Runtime parser for dispatching only the closed enhanced names. */
|
|
92
|
-
export const enhancedToolNameSchema = z.enum([
|
|
93
|
-
"swift_classes",
|
|
94
|
-
"get_objc_classes",
|
|
95
|
-
"get_objc_protocols",
|
|
96
|
-
"batch_decompile",
|
|
97
|
-
"get_call_graph",
|
|
98
|
-
"analyze_swift_types",
|
|
99
|
-
"find_xrefs_to_name",
|
|
100
|
-
"binary_overview",
|
|
101
|
-
"analyze_function",
|
|
102
|
-
"inspect_native_api",
|
|
103
|
-
"trace_feature",
|
|
104
|
-
"find_code_for_string",
|
|
105
|
-
"trace_call_path",
|
|
106
|
-
]);
|
|
@@ -3,11 +3,10 @@ import { enhancedInputSchemas } from "./enhancedInputs.js";
|
|
|
3
3
|
import { TOOL_EXAMPLE_OVERRIDES } from "./toolContractExamples.js";
|
|
4
4
|
import { toolContractMetadata } from "./toolEffects.js";
|
|
5
5
|
import { enhancedOutputSchemas } from "./toolOutputSchemas.js";
|
|
6
|
+
import { requireOutputSchema } from "./toolOutputSchemaPrimitives.js";
|
|
6
7
|
const functionWorkflow = (name, description) => {
|
|
7
8
|
const inputSchema = enhancedInputSchemas[name];
|
|
8
|
-
const outputSchema = enhancedOutputSchemas
|
|
9
|
-
if (outputSchema === undefined)
|
|
10
|
-
throw new Error(`Missing function workflow output schema for ${name}`);
|
|
9
|
+
const outputSchema = requireOutputSchema(enhancedOutputSchemas, name);
|
|
11
10
|
return {
|
|
12
11
|
name,
|
|
13
12
|
...toolContractMetadata(name),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { managedOutputSchemas } from "./toolOutputSchemas.js";
|
|
3
3
|
import { toolContractMetadata } from "./toolEffects.js";
|
|
4
|
+
import { requireOutputSchema } from "./toolOutputSchemaPrimitives.js";
|
|
4
5
|
/** Exact caller boundary for execution-free PE/CLI triage and identity. */
|
|
5
6
|
export const managedArtifactInputSchema = z.object({
|
|
6
7
|
path: z
|
|
@@ -102,15 +103,9 @@ export const managedNativeBoundaryInputSchema = z.object({
|
|
|
102
103
|
.max(16_777_216)
|
|
103
104
|
.default(1_048_576),
|
|
104
105
|
});
|
|
105
|
-
const outputSchema = managedOutputSchemas
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const memberOutputSchema = managedOutputSchemas.inspect_managed_members;
|
|
109
|
-
if (memberOutputSchema === undefined)
|
|
110
|
-
throw new Error("Missing managed output schema for inspect_managed_members");
|
|
111
|
-
const nativeBoundaryOutputSchema = managedOutputSchemas.inspect_managed_native_boundaries;
|
|
112
|
-
if (nativeBoundaryOutputSchema === undefined)
|
|
113
|
-
throw new Error("Missing managed output schema for inspect_managed_native_boundaries");
|
|
106
|
+
const outputSchema = requireOutputSchema(managedOutputSchemas, "inspect_managed_artifact");
|
|
107
|
+
const memberOutputSchema = requireOutputSchema(managedOutputSchemas, "inspect_managed_members");
|
|
108
|
+
const nativeBoundaryOutputSchema = requireOutputSchema(managedOutputSchemas, "inspect_managed_native_boundaries");
|
|
114
109
|
/** Read-only managed artifact contracts. */
|
|
115
110
|
export const MANAGED_TOOL_CONTRACTS = [
|
|
116
111
|
{
|
|
@@ -45,15 +45,18 @@ const emptyManagedMembers = (sha256, mvid) => ({
|
|
|
45
45
|
coverage: { state: "complete", issues: [] },
|
|
46
46
|
limitations: [],
|
|
47
47
|
});
|
|
48
|
-
const emptyPage = (limit) =>
|
|
49
|
-
items
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
const emptyPage = (limit) => {
|
|
49
|
+
const items = [];
|
|
50
|
+
return {
|
|
51
|
+
items,
|
|
52
|
+
offset: 0,
|
|
53
|
+
limit,
|
|
54
|
+
total: 0,
|
|
55
|
+
returned: 0,
|
|
56
|
+
dropped: 0,
|
|
57
|
+
complete: true,
|
|
58
|
+
};
|
|
59
|
+
};
|
|
57
60
|
const evidence = (result) => createEvidence(undefined, MANAGED_STATIC_EXAMPLE_PROVIDER, {
|
|
58
61
|
operation: "inspect_managed_members",
|
|
59
62
|
parameters: {},
|
|
@@ -7,6 +7,7 @@ import { projectManagedApplicationGraphInputSchema } from "../domain/managedAppl
|
|
|
7
7
|
import { managedWorkflowOutputSchemas } from "./toolOutputSchemas.js";
|
|
8
8
|
import { MANAGED_MEMBER_COMPARISON_EXAMPLE, MANAGED_NATIVE_VERIFICATION_EXAMPLE, MANAGED_APPLICATION_GRAPH_EXAMPLE, MANAGED_RECONSTRUCTION_IMPORT_EXAMPLE, MANAGED_RUNTIME_CORRELATION_EXAMPLE, } from "./managedWorkflowExamples.js";
|
|
9
9
|
import { toolContractMetadata } from "./toolEffects.js";
|
|
10
|
+
import { requireOutputSchema } from "./toolOutputSchemaPrimitives.js";
|
|
10
11
|
const evidenceIdSchema = z.string().regex(/^ev_[a-f0-9]{64}$/u);
|
|
11
12
|
const managedEvidenceIdSchema = evidenceIdSchema.describe("Session-owned inspect_managed_members Evidence ID");
|
|
12
13
|
const managedArtifactEvidenceIdSchema = evidenceIdSchema.describe("Session-owned inspect_managed_artifact Evidence ID");
|
|
@@ -66,46 +67,48 @@ export const managedNativeVerificationReferenceInputSchema = z
|
|
|
66
67
|
ids.add(evidenceId);
|
|
67
68
|
}
|
|
68
69
|
});
|
|
69
|
-
|
|
70
|
-
export const managedApplicationGraphReferenceInputSchema = z
|
|
71
|
-
.strictObject({
|
|
72
|
-
managed_artifact_evidence_id: managedArtifactEvidenceIdSchema.optional(),
|
|
73
|
-
managed_members_evidence_id: managedEvidenceIdSchema.optional(),
|
|
74
|
-
managed_native_boundaries_evidence_id: managedBoundaryEvidenceIdSchema.optional(),
|
|
70
|
+
const managedApplicationGraphReferenceFacts = {
|
|
75
71
|
limits: projectManagedApplicationGraphInputSchema.shape.limits,
|
|
76
|
-
}
|
|
72
|
+
};
|
|
73
|
+
/** MCP references requiring at least one managed Evidence source. */
|
|
74
|
+
export const managedApplicationGraphReferenceInputSchema = z
|
|
75
|
+
.union([
|
|
76
|
+
z.strictObject({
|
|
77
|
+
...managedApplicationGraphReferenceFacts,
|
|
78
|
+
managed_artifact_evidence_id: managedArtifactEvidenceIdSchema,
|
|
79
|
+
managed_members_evidence_id: managedEvidenceIdSchema.optional(),
|
|
80
|
+
managed_native_boundaries_evidence_id: managedBoundaryEvidenceIdSchema.optional(),
|
|
81
|
+
}),
|
|
82
|
+
z.strictObject({
|
|
83
|
+
...managedApplicationGraphReferenceFacts,
|
|
84
|
+
managed_artifact_evidence_id: managedArtifactEvidenceIdSchema.optional(),
|
|
85
|
+
managed_members_evidence_id: managedEvidenceIdSchema,
|
|
86
|
+
managed_native_boundaries_evidence_id: managedBoundaryEvidenceIdSchema.optional(),
|
|
87
|
+
}),
|
|
88
|
+
z.strictObject({
|
|
89
|
+
...managedApplicationGraphReferenceFacts,
|
|
90
|
+
managed_artifact_evidence_id: managedArtifactEvidenceIdSchema.optional(),
|
|
91
|
+
managed_members_evidence_id: managedEvidenceIdSchema.optional(),
|
|
92
|
+
managed_native_boundaries_evidence_id: managedBoundaryEvidenceIdSchema,
|
|
93
|
+
}),
|
|
94
|
+
])
|
|
77
95
|
.superRefine((input, context) => {
|
|
78
96
|
const ids = [
|
|
79
97
|
input.managed_artifact_evidence_id,
|
|
80
98
|
input.managed_members_evidence_id,
|
|
81
99
|
input.managed_native_boundaries_evidence_id,
|
|
82
100
|
].filter((id) => id !== undefined);
|
|
83
|
-
if (ids.length === 0)
|
|
84
|
-
context.addIssue({
|
|
85
|
-
code: "custom",
|
|
86
|
-
message: "At least one managed Evidence ID is required",
|
|
87
|
-
});
|
|
88
101
|
if (new Set(ids).size !== ids.length)
|
|
89
102
|
context.addIssue({
|
|
90
103
|
code: "custom",
|
|
91
104
|
message: "Managed application graph Evidence IDs must be unique",
|
|
92
105
|
});
|
|
93
106
|
});
|
|
94
|
-
const comparisonOutputSchema = managedWorkflowOutputSchemas
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
throw new Error("Missing managed workflow output schema for plan_managed_runtime_correlation");
|
|
100
|
-
const reconstructionOutputSchema = managedWorkflowOutputSchemas.import_managed_reconstruction;
|
|
101
|
-
if (reconstructionOutputSchema === undefined)
|
|
102
|
-
throw new Error("Missing managed workflow output schema for import_managed_reconstruction");
|
|
103
|
-
const nativeVerificationOutputSchema = managedWorkflowOutputSchemas.verify_managed_native_boundaries;
|
|
104
|
-
if (nativeVerificationOutputSchema === undefined)
|
|
105
|
-
throw new Error("Missing managed workflow output schema for verify_managed_native_boundaries");
|
|
106
|
-
const managedApplicationGraphOutputSchema = managedWorkflowOutputSchemas.project_managed_application_graph;
|
|
107
|
-
if (managedApplicationGraphOutputSchema === undefined)
|
|
108
|
-
throw new Error("Missing managed workflow output schema for project_managed_application_graph");
|
|
107
|
+
const comparisonOutputSchema = requireOutputSchema(managedWorkflowOutputSchemas, "compare_managed_members");
|
|
108
|
+
const runtimeOutputSchema = requireOutputSchema(managedWorkflowOutputSchemas, "plan_managed_runtime_correlation");
|
|
109
|
+
const reconstructionOutputSchema = requireOutputSchema(managedWorkflowOutputSchemas, "import_managed_reconstruction");
|
|
110
|
+
const nativeVerificationOutputSchema = requireOutputSchema(managedWorkflowOutputSchemas, "verify_managed_native_boundaries");
|
|
111
|
+
const managedApplicationGraphOutputSchema = requireOutputSchema(managedWorkflowOutputSchemas, "project_managed_application_graph");
|
|
109
112
|
/** Provider-neutral managed-code workflow contracts. */
|
|
110
113
|
export const MANAGED_WORKFLOW_TOOL_CONTRACTS = [
|
|
111
114
|
{
|
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { nativeOutputSchemas } from "./toolOutputSchemas.js";
|
|
3
3
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
4
4
|
import { toolContractMetadata } from "./toolEffects.js";
|
|
5
|
+
import { requireOutputSchema } from "./toolOutputSchemaPrimitives.js";
|
|
5
6
|
const examples = {
|
|
6
7
|
inspect_macho: {},
|
|
7
8
|
inspect_signature: {},
|
|
@@ -10,9 +11,7 @@ const examples = {
|
|
|
10
11
|
demangle_swift: { symbols: ["$s4Test3fooyyF"] },
|
|
11
12
|
};
|
|
12
13
|
const native = (name, description, inputSchema) => {
|
|
13
|
-
const outputSchema = nativeOutputSchemas
|
|
14
|
-
if (outputSchema === undefined)
|
|
15
|
-
throw new Error(`Missing native output schema for ${name}`);
|
|
14
|
+
const outputSchema = requireOutputSchema(nativeOutputSchemas, name);
|
|
16
15
|
return {
|
|
17
16
|
name,
|
|
18
17
|
...toolContractMetadata(name),
|