@eyeauras/insight-cli 0.0.0-stage → 0.2.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.
Files changed (174) hide show
  1. package/.cli-package-build.json +1 -0
  2. package/LICENSE +21 -0
  3. package/README.md +60 -2
  4. package/SKILL.md +58 -0
  5. package/dist/src/administration-results.d.ts +1 -0
  6. package/dist/src/administration-results.js +84 -0
  7. package/dist/src/administration.d.ts +14 -0
  8. package/dist/src/administration.js +134 -0
  9. package/dist/src/archive-contract.d.ts +6 -0
  10. package/dist/src/archive-contract.js +108 -0
  11. package/dist/src/archive.d.ts +12 -0
  12. package/dist/src/archive.js +116 -0
  13. package/dist/src/arguments.d.ts +14 -0
  14. package/dist/src/arguments.js +62 -0
  15. package/dist/src/artifacts.d.ts +17 -0
  16. package/dist/src/artifacts.js +115 -0
  17. package/dist/src/bin.d.ts +2 -0
  18. package/dist/src/bin.js +4 -0
  19. package/dist/src/cli.d.ts +10 -0
  20. package/dist/src/cli.js +419 -0
  21. package/dist/src/comment-effects.d.ts +3 -0
  22. package/dist/src/comment-effects.js +55 -0
  23. package/dist/src/contexts.d.ts +115 -0
  24. package/dist/src/contexts.js +1078 -0
  25. package/dist/src/coordinator.d.ts +41 -0
  26. package/dist/src/coordinator.js +160 -0
  27. package/dist/src/cross-results.d.ts +14 -0
  28. package/dist/src/cross-results.js +71 -0
  29. package/dist/src/cross.d.ts +3 -0
  30. package/dist/src/cross.js +43 -0
  31. package/dist/src/data-effects.d.ts +3 -0
  32. package/dist/src/data-effects.js +103 -0
  33. package/dist/src/debugger-results.d.ts +4 -0
  34. package/dist/src/debugger-results.js +151 -0
  35. package/dist/src/debugger-supervisor.d.ts +1 -0
  36. package/dist/src/debugger-supervisor.js +136 -0
  37. package/dist/src/debugger.d.ts +21 -0
  38. package/dist/src/debugger.js +267 -0
  39. package/dist/src/documentation-effects.d.ts +5 -0
  40. package/dist/src/documentation-effects.js +56 -0
  41. package/dist/src/extensions.d.ts +64 -0
  42. package/dist/src/extensions.js +289 -0
  43. package/dist/src/function-effects.d.ts +4 -0
  44. package/dist/src/function-effects.js +112 -0
  45. package/dist/src/ghidra.d.ts +50 -0
  46. package/dist/src/ghidra.js +468 -0
  47. package/dist/src/index.d.ts +2 -0
  48. package/dist/src/index.js +1 -0
  49. package/dist/src/initial-model.d.ts +6 -0
  50. package/dist/src/initial-model.js +85 -0
  51. package/dist/src/json.d.ts +2 -0
  52. package/dist/src/json.js +8 -0
  53. package/dist/src/lifecycle.d.ts +49 -0
  54. package/dist/src/lifecycle.js +154 -0
  55. package/dist/src/memory-inputs.d.ts +8 -0
  56. package/dist/src/memory-inputs.js +56 -0
  57. package/dist/src/merge.d.ts +29 -0
  58. package/dist/src/merge.js +66 -0
  59. package/dist/src/model.d.ts +74 -0
  60. package/dist/src/model.js +67 -0
  61. package/dist/src/mutation-effects.d.ts +4 -0
  62. package/dist/src/mutation-effects.js +321 -0
  63. package/dist/src/mutation-inputs.d.ts +2 -0
  64. package/dist/src/mutation-inputs.js +71 -0
  65. package/dist/src/mutations.d.ts +4 -0
  66. package/dist/src/mutations.js +53 -0
  67. package/dist/src/native-inputs.d.ts +28 -0
  68. package/dist/src/native-inputs.js +182 -0
  69. package/dist/src/native-queries.d.ts +2 -0
  70. package/dist/src/native-queries.js +29 -0
  71. package/dist/src/projects.d.ts +31 -0
  72. package/dist/src/projects.js +301 -0
  73. package/dist/src/prototype-cli.d.ts +8 -0
  74. package/dist/src/prototype-cli.js +155 -0
  75. package/dist/src/queries.d.ts +5 -0
  76. package/dist/src/queries.js +84 -0
  77. package/dist/src/query-policy.d.ts +6 -0
  78. package/dist/src/query-policy.js +72 -0
  79. package/dist/src/query-results.d.ts +2 -0
  80. package/dist/src/query-results.js +224 -0
  81. package/dist/src/research.d.ts +184 -0
  82. package/dist/src/research.js +808 -0
  83. package/dist/src/runtime-archives.d.ts +5 -0
  84. package/dist/src/runtime-archives.js +127 -0
  85. package/dist/src/runtime-catalog.d.ts +18 -0
  86. package/dist/src/runtime-catalog.js +27 -0
  87. package/dist/src/runtime-manager.d.ts +101 -0
  88. package/dist/src/runtime-manager.js +444 -0
  89. package/dist/src/runtime-selection.d.ts +13 -0
  90. package/dist/src/runtime-selection.js +25 -0
  91. package/dist/src/saved-materials.d.ts +12 -0
  92. package/dist/src/saved-materials.js +196 -0
  93. package/dist/src/scripts.d.ts +19 -0
  94. package/dist/src/scripts.js +79 -0
  95. package/dist/src/sdk-contracts.d.ts +13 -0
  96. package/dist/src/sdk-contracts.js +37 -0
  97. package/dist/src/sdk-files.d.ts +29 -0
  98. package/dist/src/sdk-files.js +249 -0
  99. package/dist/src/sdk.d.ts +4 -0
  100. package/dist/src/sdk.js +125 -0
  101. package/dist/src/server.d.ts +46 -0
  102. package/dist/src/server.js +460 -0
  103. package/dist/src/store.d.ts +33 -0
  104. package/dist/src/store.js +178 -0
  105. package/dist/src/sync-policy.d.ts +22 -0
  106. package/dist/src/sync-policy.js +123 -0
  107. package/dist/src/transport.d.ts +23 -0
  108. package/dist/src/transport.js +135 -0
  109. package/dist/src/ui-results.d.ts +2 -0
  110. package/dist/src/ui-results.js +80 -0
  111. package/dist/src/ui.d.ts +17 -0
  112. package/dist/src/ui.js +88 -0
  113. package/dist/src/utility.d.ts +14 -0
  114. package/dist/src/utility.js +43 -0
  115. package/dist/src/version-tracking.d.ts +57 -0
  116. package/dist/src/version-tracking.js +200 -0
  117. package/dist/src/workspace.d.ts +199 -0
  118. package/dist/src/workspace.js +564 -0
  119. package/package.json +47 -4
  120. package/references/InsightRepositoryProbe.java +55 -0
  121. package/references/administration.md +34 -0
  122. package/references/archive.md +32 -0
  123. package/references/artifacts.md +47 -0
  124. package/references/debugger.md +40 -0
  125. package/references/extensions-and-sync.md +124 -0
  126. package/references/managed-runtime.md +116 -0
  127. package/references/mutations.json +1424 -0
  128. package/references/native/InsightApplyDocumentation.java +48 -0
  129. package/references/native/InsightArchivePayloads.java +36 -0
  130. package/references/native/InsightBlockTransfer.java +57 -0
  131. package/references/native/InsightEmulation.java +93 -0
  132. package/references/native/InsightExtensions.java +36 -0
  133. package/references/native/InsightFunctionDatabases.java +98 -0
  134. package/references/native/InsightGuiMain.java +32 -0
  135. package/references/native/InsightHeadlessMain.java +10 -0
  136. package/references/native/InsightInitialImport.java +42 -0
  137. package/references/native/InsightInitialJournal.java +48 -0
  138. package/references/native/InsightInitialPublication.java +142 -0
  139. package/references/native/InsightKeytool.java +16 -0
  140. package/references/native/InsightNativeReceipt.java +31 -0
  141. package/references/native/InsightPlugins.java +34 -0
  142. package/references/native/InsightProjectFiles.java +92 -0
  143. package/references/native/InsightPublicationRecovery.java +63 -0
  144. package/references/native/InsightPythonWheels.java +31 -0
  145. package/references/native/InsightResearchQueries.java +188 -0
  146. package/references/native/InsightRuntimeDoctor.java +33 -0
  147. package/references/native/InsightSdkFiles.java +142 -0
  148. package/references/native/InsightSdkScript.java +31 -0
  149. package/references/native/InsightSdkTools.java +338 -0
  150. package/references/native/InsightSdkTypes.java +132 -0
  151. package/references/native/InsightServerAdministration.java +82 -0
  152. package/references/native/InsightServerInit.java +62 -0
  153. package/references/native/InsightServerMain.java +43 -0
  154. package/references/native/InsightServerProbe.java +29 -0
  155. package/references/native/InsightSnapshotFields.java +68 -0
  156. package/references/native/InsightSnapshotInspect.java +189 -0
  157. package/references/native/InsightSnapshotPublisher.java +123 -0
  158. package/references/native/InsightStartDebugger.java +28 -0
  159. package/references/native/InsightStopDebugger.java +20 -0
  160. package/references/native/InsightTraceInspect.java +24 -0
  161. package/references/native/InsightTraceState.java +130 -0
  162. package/references/native/InsightTraceTools.java +114 -0
  163. package/references/native/InsightVersionTracking.java +91 -0
  164. package/references/native-workflows.md +112 -0
  165. package/references/queries.json +1761 -0
  166. package/references/query-semantics.md +96 -0
  167. package/references/recovery.md +53 -0
  168. package/references/research.md +101 -0
  169. package/references/setup.md +49 -0
  170. package/runtime/GhidraMCP-7.0.0.jar +0 -0
  171. package/runtime/GhidraMCP-LICENSE +202 -0
  172. package/runtime/GhidraMCP-NOTICE +10 -0
  173. package/runtime/provenance.json +11 -0
  174. package/skills/insight-re/SKILL.md +108 -0
@@ -0,0 +1,184 @@
1
+ import type { Artifact } from './artifacts.js';
2
+ import type { GhidraContext, Scope, ScalarChange, Publication, DebuggerState, GhidraLoadSettings } from './workspace.js';
3
+ import { Workspace } from './workspace.js';
4
+ import type { ToolMode } from './contexts.js';
5
+ import type { ScriptPage } from './scripts.js';
6
+ export interface ResearchBackend {
7
+ sdkFile?(operation: string, p: Record<string, unknown>): Promise<Record<string, unknown>>;
8
+ archivePayloads?(scope: Scope, p: Record<string, unknown>): Promise<unknown>;
9
+ debuggerStart?(scope: Scope): Promise<void>;
10
+ debuggerCall?(scope: Scope, operation: string, p?: Record<string, unknown>): Promise<unknown>;
11
+ debuggerSaved?(scope: Scope): Promise<DebuggerState>;
12
+ debuggerSelect?(scope: Scope, trace: string): Promise<void>;
13
+ debuggerStop?(scope: Scope): Promise<void>;
14
+ debuggerLaunch?(scope: Scope, p: Record<string, unknown>, request: string): Promise<unknown>;
15
+ ui?(scope: Scope, operation: string, parameters: Record<string, unknown>): Promise<Record<string, unknown>>;
16
+ project?(operation: string, parameters: Record<string, unknown>): Promise<Record<string, unknown>>;
17
+ projectOutcome?(requestId: string, expected: Record<string, unknown>): Promise<Record<string, unknown> | undefined>;
18
+ administration?(operation: string, parameters: Record<string, unknown>): Promise<Record<string, unknown>>;
19
+ open(scope: Scope, request?: string): Promise<GhidraContext>;
20
+ call(scope: Scope, operation: string, parameters?: Record<string, unknown>): Promise<unknown>;
21
+ saved(scope: Scope): Promise<Artifact>;
22
+ mode(scope: Scope, mode: ToolMode): Promise<void>;
23
+ close(scope: Scope): Promise<void>;
24
+ closed?(scope: Scope): Promise<boolean>;
25
+ dispose(): Promise<void>;
26
+ latest?(target: string): Promise<{
27
+ revision: number;
28
+ snapshot: Artifact;
29
+ }>;
30
+ fields?(snapshot: Artifact, changes: Pick<ScalarChange, 'address' | 'field'>[]): Promise<Record<string, {
31
+ value: string | null;
32
+ dependency: string;
33
+ exists: boolean;
34
+ }>>;
35
+ candidate?(target: string, snapshot: Artifact, changes: ScalarChange[]): Promise<Artifact>;
36
+ publish?(publication: Publication): Promise<{
37
+ state: 'published';
38
+ revision: number;
39
+ } | {
40
+ state: 'conflict';
41
+ applied: 0;
42
+ }>;
43
+ recover?(publication: Publication): Promise<{
44
+ state: 'verified';
45
+ revision: number;
46
+ } | {
47
+ state: 'unknown';
48
+ }>;
49
+ recoverModel?(target: string): Promise<boolean>;
50
+ scripts?(scope: Scope, filter: string, limit: number, offset: number): Promise<ScriptPage>;
51
+ inspect?(snapshot: Artifact, parameters: Record<string, unknown>): Promise<Record<string, unknown>>;
52
+ pair?(selected: Scope, other: Scope, snapshot: Artifact, operation: string, parameters: Record<string, unknown>): Promise<unknown>;
53
+ transfer?(selected: Scope, source: Artifact, dryRun: boolean): Promise<unknown>;
54
+ transferCheck?(selected: Scope, source: Artifact, candidate: Artifact): Promise<unknown>;
55
+ }
56
+ export declare function address(value: unknown): string;
57
+ export declare const publicAddress: (value: unknown) => string;
58
+ export declare function scalarText(value: unknown): string | null;
59
+ export declare function commentKind(value: unknown): "eol" | "pre" | "post" | "plate" | "repeatable";
60
+ export declare function number(value: unknown, maximum: number, minimum?: number): number;
61
+ export declare function scope(options: Record<string, unknown>): Scope;
62
+ /** One ordered working context per tuple, shared by every transport through the Factory owner. */
63
+ export declare class Research {
64
+ readonly workspace: Workspace;
65
+ private readonly backend;
66
+ private readonly tasks;
67
+ constructor(workspace: Workspace, backend: () => Promise<ResearchBackend>, tasks?: Map<string, Promise<unknown>>);
68
+ ordered<T>(selected: Scope, action: () => Promise<T>): Promise<T>;
69
+ boundary<T>(selected: Scope, action: () => Promise<T>): Promise<T>;
70
+ status(selected: Scope): {
71
+ externalRequests: {
72
+ operation: string;
73
+ state: import("./workspace.js").RequestState;
74
+ requestId?: string | undefined;
75
+ }[];
76
+ externalRequestsTruncated: boolean;
77
+ ghidra: {
78
+ syncPolicy: import("./workspace.js").SyncPolicy;
79
+ state: "opening" | "ready" | "stopped" | "needs_recovery";
80
+ baseRevision: string | undefined;
81
+ sharedRevision: string | undefined;
82
+ pendingChanges: number;
83
+ mergeState: string;
84
+ conflicts: {
85
+ address: string;
86
+ field: "function.name" | "comment.eol" | "comment.pre" | "comment.post" | "comment.plate" | "comment.repeatable";
87
+ original: string | null;
88
+ local: string | null;
89
+ shared: string | null;
90
+ }[];
91
+ unresolvedRequests: {
92
+ operation: string;
93
+ state: import("./workspace.js").RequestState;
94
+ requestId?: string | undefined;
95
+ }[];
96
+ };
97
+ session: string;
98
+ target: string;
99
+ };
100
+ open(target: string, session: string | 'new', settings: GhidraLoadSettings, callerId?: string, mode?: ToolMode): Promise<{
101
+ [k: string]: unknown;
102
+ } | {
103
+ session: string;
104
+ target: string;
105
+ state: string;
106
+ baseRevision: string | undefined;
107
+ sharedRevision: string | undefined;
108
+ pendingChanges: number;
109
+ }>;
110
+ read(selected: Scope, operation: string, parameters: Record<string, unknown>): Promise<unknown>;
111
+ scripts(selected: Scope, filter: string, limit: number, offset: number): Promise<ScriptPage>;
112
+ paired<T>(selected: Scope, other: Scope, action: () => Promise<T>): Promise<T>;
113
+ crossRead(selected: Scope, other: Scope, operation: string, parameters: Record<string, unknown>): Promise<unknown>;
114
+ private savedScalars;
115
+ transfer(selected: Scope, source: Scope, dryRun: boolean, callerId?: string): Promise<unknown>;
116
+ strings(selected: Scope, contains: string, limit: number, offset: number): Promise<{
117
+ scan?: unknown;
118
+ totalKnown?: boolean | undefined;
119
+ items: {
120
+ address: string;
121
+ text: string;
122
+ }[];
123
+ offset: number;
124
+ limit: number;
125
+ total: number;
126
+ truncated: boolean;
127
+ session: string;
128
+ target: string;
129
+ }>;
130
+ function(selected: Scope, at: string, decompile?: boolean): Promise<{
131
+ code?: unknown;
132
+ truncated?: boolean | undefined;
133
+ address: string;
134
+ name: unknown;
135
+ signature: string;
136
+ comments: Record<string, string | null>;
137
+ session: string;
138
+ target: string;
139
+ }>;
140
+ xrefs(selected: Scope, at: string, limit: number, offset: number): Promise<{
141
+ items: ({
142
+ from: null;
143
+ to: string;
144
+ kind: string;
145
+ source: string;
146
+ } | {
147
+ function?: {
148
+ address: string;
149
+ name: unknown;
150
+ } | undefined;
151
+ from: string;
152
+ to: string;
153
+ kind: string;
154
+ source?: undefined;
155
+ })[];
156
+ offset: number;
157
+ limit: number;
158
+ total: number;
159
+ truncated: boolean;
160
+ session: string;
161
+ target: string;
162
+ }>;
163
+ comment(selected: Scope, at: string, kind?: ReturnType<typeof commentKind>): Promise<{
164
+ kind: "eol" | "pre" | "post" | "plate" | "repeatable";
165
+ text: string | null | undefined;
166
+ sharedState: string;
167
+ address: string;
168
+ session: string;
169
+ target: string;
170
+ } | {
171
+ comments: Record<string, string | null>;
172
+ address: string;
173
+ session: string;
174
+ target: string;
175
+ }>;
176
+ edit(selected: Scope, at: string, field: ScalarChange['field'], value: string | null, callerId?: string, resolution?: {
177
+ expectedShared: string | null;
178
+ }): Promise<unknown>;
179
+ private sharedOrder;
180
+ private reconcile;
181
+ merge(selected: Scope, callerId?: string): Promise<unknown>;
182
+ refresh(selected: Scope, callerId?: string): Promise<unknown>;
183
+ mutate(selected: Scope, operation: string, parameters: Record<string, unknown>, verify: (backend: ResearchBackend, result: Record<string, unknown>) => Promise<unknown>, callerId?: string, verifySaved?: (backend: ResearchBackend, snapshot: Artifact, result: Record<string, unknown>) => Promise<unknown>): Promise<unknown>;
184
+ }