@elaraai/e3-cloud-claude-plugin 0.0.0-stage → 1.0.90

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.
@@ -0,0 +1,149 @@
1
+ // ../../node_modules/.pnpm/@elaraai+east-plugin@1.0.90_typescript@5.9.3/node_modules/@elaraai/east-plugin/dist/lib/host.js
2
+ import { existsSync } from "node:fs";
3
+ import { fileURLToPath } from "node:url";
4
+ var isCodex = existsSync(fileURLToPath(new URL("../../.codex-plugin/plugin.json", import.meta.url)));
5
+ function hostText(text) {
6
+ return isCodex ? text.replaceAll("mcp__plugin_east_east__", "").replaceAll("/east:", "$east-codex-plugin:").replaceAll("Claude Code", "Codex") : text;
7
+ }
8
+
9
+ // ../../node_modules/.pnpm/@elaraai+east-plugin@1.0.90_typescript@5.9.3/node_modules/@elaraai/east-plugin/dist/lib/hook-io.js
10
+ async function readHookInput() {
11
+ let input = "";
12
+ for await (const chunk of process.stdin) {
13
+ input += chunk;
14
+ }
15
+ return JSON.parse(input);
16
+ }
17
+ function writeHookOutput(hookEventName, additionalContext) {
18
+ const output = {
19
+ hookSpecificOutput: {
20
+ hookEventName,
21
+ additionalContext: hostText(additionalContext)
22
+ }
23
+ };
24
+ process.stdout.write(JSON.stringify(output));
25
+ }
26
+ function writeHookDecision(hookEventName, decision, reason) {
27
+ const output = {
28
+ hookSpecificOutput: {
29
+ hookEventName,
30
+ permissionDecision: decision,
31
+ permissionDecisionReason: hostText(reason)
32
+ }
33
+ };
34
+ process.stdout.write(JSON.stringify(output));
35
+ }
36
+
37
+ // ../../node_modules/.pnpm/@elaraai+east-plugin@1.0.90_typescript@5.9.3/node_modules/@elaraai/east-plugin/dist/lib/transcript.js
38
+ var SEARCH_TOOLS = ["mcp__plugin_east_east__search_east_examples", "mcp__plugin_east_east__get_east_example", "mcp__east__search_east_examples", "mcp__east__get_east_example"];
39
+
40
+ // ../../node_modules/.pnpm/@elaraai+east-plugin@1.0.90_typescript@5.9.3/node_modules/@elaraai/east-plugin/dist/lib/search-guidance.js
41
+ var EAST_GUIDANCE = {
42
+ searchTool: "mcp__plugin_east_east__search_east_examples",
43
+ getTool: "mcp__plugin_east_east__get_east_example",
44
+ corpus: "East",
45
+ scope: "@elaraai"
46
+ };
47
+ function bare(tool) {
48
+ const at = tool.lastIndexOf("__");
49
+ return at < 0 ? tool : tool.slice(at + 2);
50
+ }
51
+ function gateText(g) {
52
+ return [
53
+ `STOP: no ${g.corpus} example search on record in this session, and this is ${g.corpus} code.`,
54
+ `Before writing or changing ${g.corpus} code, search the tested example index \u2014 it is the API reference:`,
55
+ `1. \`${g.searchTool}\` with what you are about to do (language: "python" for east-py, "typescript" otherwise); summaries come back \u2014 id, signature, inputs and result.`,
56
+ `2. \`${g.getTool}\` for the one or two that match, and pattern your code on them.`,
57
+ `Do not read node_modules/${g.scope}/** or *.examples.ts files instead: the index is the same corpus, exact and far cheaper. Every ${g.corpus} skill requires this step.`
58
+ ].join("\n");
59
+ }
60
+ function readText(g) {
61
+ return [
62
+ `Note: the ${g.corpus} example index is the API reference \u2014 \`${g.searchTool}\` (then \`${bare(g.getTool)}\`) returns the same tested programs as the ${g.corpus} packages' examples and type declarations, exact, printed in TypeScript or python, at a fraction of the tokens.`,
63
+ `Reading \`.d.ts\` signatures or sweeping \`*.examples.ts\` files reliably produces broken ${g.corpus} code that still type-checks: the signatures omit the runtime rules. Search instead, and read a specific file only when the search pointed you at it.`
64
+ ].join("\n");
65
+ }
66
+ function corpusReadFor(scope) {
67
+ const escaped = scope.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
68
+ const packagePath = new RegExp(`[/\\\\]node_modules[/\\\\]${escaped}[/\\\\]`);
69
+ const packagePattern = new RegExp(`(^|[/\\\\])node_modules[/\\\\]${escaped}([/\\\\]|$)`);
70
+ const examplesFile = /\.examples\.tsx?$/;
71
+ return (tool, input) => {
72
+ const file = typeof input["file_path"] === "string" ? input["file_path"] : "";
73
+ const dir = typeof input["path"] === "string" ? input["path"] : "";
74
+ const pattern = typeof input["pattern"] === "string" ? input["pattern"] : "";
75
+ return tool === "Read" ? packagePath.test(file) || examplesFile.test(file) : packagePath.test(dir) || packagePattern.test(pattern) || /\.examples\.tsx?/.test(pattern);
76
+ };
77
+ }
78
+ var GATE_TEXT = gateText(EAST_GUIDANCE);
79
+ var READ_TEXT = readText(EAST_GUIDANCE);
80
+ var isExampleCorpusRead = corpusReadFor(EAST_GUIDANCE.scope);
81
+
82
+ // ../../node_modules/.pnpm/@elaraai+east-plugin@1.0.90_typescript@5.9.3/node_modules/@elaraai/east-plugin/dist/lib/search-hooks.js
83
+ function preReadReminder(event, options) {
84
+ return options.isCorpusRead(event.tool_name ?? "", event.tool_input ?? {}) ? { decision: "context", text: options.readText } : null;
85
+ }
86
+ function writeSearchHookReply(hookEventName, reply) {
87
+ if (reply.decision === "deny")
88
+ writeHookDecision(hookEventName, "deny", reply.text);
89
+ else
90
+ writeHookOutput(hookEventName, reply.text);
91
+ }
92
+ async function runPreReadReminder(options) {
93
+ const reply = preReadReminder(await readHookInput(), options);
94
+ if (reply !== null)
95
+ writeSearchHookReply("PreToolUse", reply);
96
+ }
97
+
98
+ // ../e3-cloud-plugin/dist/lib/names.js
99
+ var E3_CLOUD_PLUGIN = "e3-cloud";
100
+ var E3_CLOUD_SERVER = "e3-cloud";
101
+ var E3_CLOUD_SEARCH_TOOL = "search_e3_cloud_examples";
102
+ var E3_CLOUD_GET_TOOL = "get_e3_cloud_example";
103
+ var E3_CLOUD_CORPUS = "e3 cloud";
104
+ var CLAUDE_TOOL_PREFIX = `mcp__plugin_${E3_CLOUD_PLUGIN}_${E3_CLOUD_SERVER}__`;
105
+ var E3_CLOUD_GUIDANCE = {
106
+ searchTool: `${CLAUDE_TOOL_PREFIX}${E3_CLOUD_SEARCH_TOOL}`,
107
+ getTool: `${CLAUDE_TOOL_PREFIX}${E3_CLOUD_GET_TOOL}`,
108
+ corpus: E3_CLOUD_CORPUS,
109
+ scope: "@elaraai"
110
+ };
111
+ var E3_CLOUD_CODE = /@elaraai\/e3-cloud-(?:ui|client)\b/;
112
+ var PACKAGE_PATH = /[/\\]node_modules[/\\]@elaraai[/\\]e3-cloud-(?:ui|cli|client)(?:[/\\]|$)/;
113
+ var PACKAGE_PATTERN = /(?:^|[/\\])node_modules[/\\]@elaraai[/\\]e3-cloud-(?:ui|cli|client)(?:[/\\]|$)/;
114
+ function isE3CloudCorpusRead(tool, input) {
115
+ const text = (key) => typeof input[key] === "string" ? input[key] : "";
116
+ return tool === "Read" ? PACKAGE_PATH.test(text("file_path")) : PACKAGE_PATH.test(text("path")) || PACKAGE_PATTERN.test(text("pattern"));
117
+ }
118
+ var E3_CLOUD_SEARCH_GATE = {
119
+ searchTools: [E3_CLOUD_GUIDANCE.searchTool, E3_CLOUD_GUIDANCE.getTool, ...SEARCH_TOOLS],
120
+ gateText: gateText(E3_CLOUD_GUIDANCE),
121
+ isCorpusCode: (code, python) => !python && E3_CLOUD_CODE.test(code),
122
+ markerPrefix: "e3-cloud-search-seen",
123
+ requireSearchEnv: "E3_CLOUD_REQUIRE_SEARCH"
124
+ };
125
+ var E3_CLOUD_READ_REMINDER = {
126
+ readText: readText(E3_CLOUD_GUIDANCE),
127
+ isCorpusRead: isE3CloudCorpusRead
128
+ };
129
+ var E3_CLOUD_CODEX_SEARCH_GATE = {
130
+ searchTools: E3_CLOUD_SEARCH_GATE.searchTools,
131
+ searchToolName: /__(?:search_e3_cloud_examples|get_e3_cloud_example|search_east_examples|get_east_example)$/,
132
+ gateText: E3_CLOUD_SEARCH_GATE.gateText,
133
+ readText: E3_CLOUD_READ_REMINDER.readText,
134
+ isCorpusRead: isE3CloudCorpusRead,
135
+ shellSweep: /node_modules\/@elaraai\/e3-cloud-(?:ui|cli|client)\b/,
136
+ corpusCode: E3_CLOUD_CODE,
137
+ markerPrefix: "e3-cloud-codex-search-",
138
+ requireSearchEnv: "E3_CLOUD_REQUIRE_SEARCH"
139
+ };
140
+ var E3_CLOUD_SKILL_NAMES = {
141
+ claudeToolPrefix: CLAUDE_TOOL_PREFIX,
142
+ claudeSkillPrefix: `/${E3_CLOUD_PLUGIN}:`,
143
+ codexSkillPrefix: "$e3-cloud-codex-plugin:",
144
+ claudePlugin: "e3-cloud-claude-plugin",
145
+ codexPlugin: "e3-cloud-codex-plugin"
146
+ };
147
+
148
+ // ../e3-cloud-plugin/dist/hooks/pre-read.js
149
+ runPreReadReminder(E3_CLOUD_READ_REMINDER).catch(() => process.exit(0));
@@ -0,0 +1,196 @@
1
+ // ../../node_modules/.pnpm/@elaraai+east-plugin@1.0.90_typescript@5.9.3/node_modules/@elaraai/east-plugin/dist/lib/search-hooks.js
2
+ import { readFile as readFile2 } from "node:fs/promises";
3
+ import { existsSync as existsSync2, writeFileSync } from "node:fs";
4
+ import { tmpdir } from "node:os";
5
+ import { join } from "node:path";
6
+
7
+ // ../../node_modules/.pnpm/@elaraai+east-plugin@1.0.90_typescript@5.9.3/node_modules/@elaraai/east-plugin/dist/lib/host.js
8
+ import { existsSync } from "node:fs";
9
+ import { fileURLToPath } from "node:url";
10
+ var isCodex = existsSync(fileURLToPath(new URL("../../.codex-plugin/plugin.json", import.meta.url)));
11
+ function hostText(text) {
12
+ return isCodex ? text.replaceAll("mcp__plugin_east_east__", "").replaceAll("/east:", "$east-codex-plugin:").replaceAll("Claude Code", "Codex") : text;
13
+ }
14
+
15
+ // ../../node_modules/.pnpm/@elaraai+east-plugin@1.0.90_typescript@5.9.3/node_modules/@elaraai/east-plugin/dist/lib/hook-io.js
16
+ async function readHookInput() {
17
+ let input = "";
18
+ for await (const chunk of process.stdin) {
19
+ input += chunk;
20
+ }
21
+ return JSON.parse(input);
22
+ }
23
+ function writeHookOutput(hookEventName, additionalContext) {
24
+ const output = {
25
+ hookSpecificOutput: {
26
+ hookEventName,
27
+ additionalContext: hostText(additionalContext)
28
+ }
29
+ };
30
+ process.stdout.write(JSON.stringify(output));
31
+ }
32
+ function writeHookDecision(hookEventName, decision, reason) {
33
+ const output = {
34
+ hookSpecificOutput: {
35
+ hookEventName,
36
+ permissionDecision: decision,
37
+ permissionDecisionReason: hostText(reason)
38
+ }
39
+ };
40
+ process.stdout.write(JSON.stringify(output));
41
+ }
42
+
43
+ // ../../node_modules/.pnpm/@elaraai+east-plugin@1.0.90_typescript@5.9.3/node_modules/@elaraai/east-plugin/dist/lib/transcript.js
44
+ import { readFile } from "node:fs/promises";
45
+ var SEARCH_TOOLS = ["mcp__plugin_east_east__search_east_examples", "mcp__plugin_east_east__get_east_example", "mcp__east__search_east_examples", "mcp__east__get_east_example"];
46
+ async function searchedInTranscript(transcriptPath, tools = SEARCH_TOOLS) {
47
+ let raw;
48
+ try {
49
+ raw = await readFile(transcriptPath, "utf-8");
50
+ } catch {
51
+ return false;
52
+ }
53
+ return tools.some((tool) => raw.includes(`"name":"${tool}"`) || raw.includes(`"name": "${tool}"`));
54
+ }
55
+
56
+ // ../../node_modules/.pnpm/@elaraai+east-plugin@1.0.90_typescript@5.9.3/node_modules/@elaraai/east-plugin/dist/lib/search-guidance.js
57
+ var EAST_GUIDANCE = {
58
+ searchTool: "mcp__plugin_east_east__search_east_examples",
59
+ getTool: "mcp__plugin_east_east__get_east_example",
60
+ corpus: "East",
61
+ scope: "@elaraai"
62
+ };
63
+ function bare(tool) {
64
+ const at = tool.lastIndexOf("__");
65
+ return at < 0 ? tool : tool.slice(at + 2);
66
+ }
67
+ function gateText(g) {
68
+ return [
69
+ `STOP: no ${g.corpus} example search on record in this session, and this is ${g.corpus} code.`,
70
+ `Before writing or changing ${g.corpus} code, search the tested example index \u2014 it is the API reference:`,
71
+ `1. \`${g.searchTool}\` with what you are about to do (language: "python" for east-py, "typescript" otherwise); summaries come back \u2014 id, signature, inputs and result.`,
72
+ `2. \`${g.getTool}\` for the one or two that match, and pattern your code on them.`,
73
+ `Do not read node_modules/${g.scope}/** or *.examples.ts files instead: the index is the same corpus, exact and far cheaper. Every ${g.corpus} skill requires this step.`
74
+ ].join("\n");
75
+ }
76
+ function readText(g) {
77
+ return [
78
+ `Note: the ${g.corpus} example index is the API reference \u2014 \`${g.searchTool}\` (then \`${bare(g.getTool)}\`) returns the same tested programs as the ${g.corpus} packages' examples and type declarations, exact, printed in TypeScript or python, at a fraction of the tokens.`,
79
+ `Reading \`.d.ts\` signatures or sweeping \`*.examples.ts\` files reliably produces broken ${g.corpus} code that still type-checks: the signatures omit the runtime rules. Search instead, and read a specific file only when the search pointed you at it.`
80
+ ].join("\n");
81
+ }
82
+ function corpusReadFor(scope) {
83
+ const escaped = scope.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
84
+ const packagePath = new RegExp(`[/\\\\]node_modules[/\\\\]${escaped}[/\\\\]`);
85
+ const packagePattern = new RegExp(`(^|[/\\\\])node_modules[/\\\\]${escaped}([/\\\\]|$)`);
86
+ const examplesFile = /\.examples\.tsx?$/;
87
+ return (tool, input) => {
88
+ const file = typeof input["file_path"] === "string" ? input["file_path"] : "";
89
+ const dir = typeof input["path"] === "string" ? input["path"] : "";
90
+ const pattern = typeof input["pattern"] === "string" ? input["pattern"] : "";
91
+ return tool === "Read" ? packagePath.test(file) || examplesFile.test(file) : packagePath.test(dir) || packagePattern.test(pattern) || /\.examples\.tsx?/.test(pattern);
92
+ };
93
+ }
94
+ var GATE_TEXT = gateText(EAST_GUIDANCE);
95
+ var READ_TEXT = readText(EAST_GUIDANCE);
96
+ var isExampleCorpusRead = corpusReadFor(EAST_GUIDANCE.scope);
97
+
98
+ // ../../node_modules/.pnpm/@elaraai+east-plugin@1.0.90_typescript@5.9.3/node_modules/@elaraai/east-plugin/dist/lib/search-hooks.js
99
+ async function preWriteGate(event, options) {
100
+ const cwd = event.cwd || process.cwd();
101
+ const filePath = event.tool_input?.file_path;
102
+ if (!filePath)
103
+ return null;
104
+ const python = filePath.endsWith(".py");
105
+ if (!python && !filePath.endsWith(".ts") && !filePath.endsWith(".tsx") && !filePath.endsWith(".js"))
106
+ return null;
107
+ let code = "";
108
+ if (event.tool_name === "Write") {
109
+ code = event.tool_input?.content ?? "";
110
+ } else if (event.tool_name === "Edit") {
111
+ try {
112
+ code = await readFile2(filePath, "utf-8");
113
+ } catch {
114
+ code = event.tool_input?.new_string ?? "";
115
+ }
116
+ }
117
+ if (!options.isCorpusCode(code, python))
118
+ return null;
119
+ if (options.isProject !== void 0 && !await options.isProject(cwd, python))
120
+ return null;
121
+ const marker = join(tmpdir(), `${options.markerPrefix}-${event.session_id}`);
122
+ if (existsSync2(marker))
123
+ return null;
124
+ if (event.transcript_path && await searchedInTranscript(event.transcript_path, options.searchTools)) {
125
+ try {
126
+ writeFileSync(marker, options.searchTools.join("\n"));
127
+ } catch {
128
+ }
129
+ return null;
130
+ }
131
+ return { decision: process.env[options.requireSearchEnv] === "deny" ? "deny" : "context", text: options.gateText };
132
+ }
133
+ function writeSearchHookReply(hookEventName, reply) {
134
+ if (reply.decision === "deny")
135
+ writeHookDecision(hookEventName, "deny", reply.text);
136
+ else
137
+ writeHookOutput(hookEventName, reply.text);
138
+ }
139
+ async function runPreWriteGate(options) {
140
+ const reply = await preWriteGate(await readHookInput(), options);
141
+ if (reply !== null)
142
+ writeSearchHookReply("PreToolUse", reply);
143
+ }
144
+
145
+ // ../e3-cloud-plugin/dist/lib/names.js
146
+ var E3_CLOUD_PLUGIN = "e3-cloud";
147
+ var E3_CLOUD_SERVER = "e3-cloud";
148
+ var E3_CLOUD_SEARCH_TOOL = "search_e3_cloud_examples";
149
+ var E3_CLOUD_GET_TOOL = "get_e3_cloud_example";
150
+ var E3_CLOUD_CORPUS = "e3 cloud";
151
+ var CLAUDE_TOOL_PREFIX = `mcp__plugin_${E3_CLOUD_PLUGIN}_${E3_CLOUD_SERVER}__`;
152
+ var E3_CLOUD_GUIDANCE = {
153
+ searchTool: `${CLAUDE_TOOL_PREFIX}${E3_CLOUD_SEARCH_TOOL}`,
154
+ getTool: `${CLAUDE_TOOL_PREFIX}${E3_CLOUD_GET_TOOL}`,
155
+ corpus: E3_CLOUD_CORPUS,
156
+ scope: "@elaraai"
157
+ };
158
+ var E3_CLOUD_CODE = /@elaraai\/e3-cloud-(?:ui|client)\b/;
159
+ var PACKAGE_PATH = /[/\\]node_modules[/\\]@elaraai[/\\]e3-cloud-(?:ui|cli|client)(?:[/\\]|$)/;
160
+ var PACKAGE_PATTERN = /(?:^|[/\\])node_modules[/\\]@elaraai[/\\]e3-cloud-(?:ui|cli|client)(?:[/\\]|$)/;
161
+ function isE3CloudCorpusRead(tool, input) {
162
+ const text = (key) => typeof input[key] === "string" ? input[key] : "";
163
+ return tool === "Read" ? PACKAGE_PATH.test(text("file_path")) : PACKAGE_PATH.test(text("path")) || PACKAGE_PATTERN.test(text("pattern"));
164
+ }
165
+ var E3_CLOUD_SEARCH_GATE = {
166
+ searchTools: [E3_CLOUD_GUIDANCE.searchTool, E3_CLOUD_GUIDANCE.getTool, ...SEARCH_TOOLS],
167
+ gateText: gateText(E3_CLOUD_GUIDANCE),
168
+ isCorpusCode: (code, python) => !python && E3_CLOUD_CODE.test(code),
169
+ markerPrefix: "e3-cloud-search-seen",
170
+ requireSearchEnv: "E3_CLOUD_REQUIRE_SEARCH"
171
+ };
172
+ var E3_CLOUD_READ_REMINDER = {
173
+ readText: readText(E3_CLOUD_GUIDANCE),
174
+ isCorpusRead: isE3CloudCorpusRead
175
+ };
176
+ var E3_CLOUD_CODEX_SEARCH_GATE = {
177
+ searchTools: E3_CLOUD_SEARCH_GATE.searchTools,
178
+ searchToolName: /__(?:search_e3_cloud_examples|get_e3_cloud_example|search_east_examples|get_east_example)$/,
179
+ gateText: E3_CLOUD_SEARCH_GATE.gateText,
180
+ readText: E3_CLOUD_READ_REMINDER.readText,
181
+ isCorpusRead: isE3CloudCorpusRead,
182
+ shellSweep: /node_modules\/@elaraai\/e3-cloud-(?:ui|cli|client)\b/,
183
+ corpusCode: E3_CLOUD_CODE,
184
+ markerPrefix: "e3-cloud-codex-search-",
185
+ requireSearchEnv: "E3_CLOUD_REQUIRE_SEARCH"
186
+ };
187
+ var E3_CLOUD_SKILL_NAMES = {
188
+ claudeToolPrefix: CLAUDE_TOOL_PREFIX,
189
+ claudeSkillPrefix: `/${E3_CLOUD_PLUGIN}:`,
190
+ codexSkillPrefix: "$e3-cloud-codex-plugin:",
191
+ claudePlugin: "e3-cloud-claude-plugin",
192
+ codexPlugin: "e3-cloud-codex-plugin"
193
+ };
194
+
195
+ // ../e3-cloud-plugin/dist/hooks/pre-write.js
196
+ runPreWriteGate(E3_CLOUD_SEARCH_GATE).catch(() => process.exit(0));