@takara-ai/miru-code 1.10.1 → 1.11.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 +2 -1
- package/docs/self-hosted-sagemaker.md +24 -0
- package/package.json +1 -1
- package/src/credentials.ts +29 -0
package/README.md
CHANGED
|
@@ -48,6 +48,7 @@ Plugin installs don't carry full CLI parity — what each one gives you depends
|
|
|
48
48
|
| `miru` / Caveman / STE skills | ✅ | ✅ | ✅ |
|
|
49
49
|
| Dedicated sub-agent (`miru:miru-code`) | ✅ | — | — |
|
|
50
50
|
| Benchmark mode toggle (`/plugin configure`) | ✅ | — | — |
|
|
51
|
+
| Self-hosted SageMaker embeddings (`/plugin configure`) | ✅ | — | — |
|
|
51
52
|
| Credentials | own plugin-scoped dir | own plugin-scoped dir | n/a |
|
|
52
53
|
|
|
53
54
|
`—` means the IDE's plugin schema has no equivalent mechanism to port these to (not a packaging gap we can close): Codex's and Cursor's plugin manifests have no `agents` or `userConfig` fields, so the dedicated sub-agent and the benchmark toggle are Claude-Code-only.
|
|
@@ -323,7 +324,7 @@ Miru sends **file contents** to the [Takara inference API](https://takara.ai) wh
|
|
|
323
324
|
|
|
324
325
|
If you index proprietary code, make sure that sending snippets to Takara's endpoint fits your security and compliance requirements. `MIRU_WORKSPACE_ROOT` is an opt-in boundary for MCP local `repo` paths only, and restricts indexing to a single workspace directory when set.
|
|
325
326
|
|
|
326
|
-
Enterprise self-hosted embeddings (no Takara egress): see [docs/self-hosted-sagemaker.md](docs/self-hosted-sagemaker.md).
|
|
327
|
+
Enterprise self-hosted embeddings (no Takara egress): see [docs/self-hosted-sagemaker.md](docs/self-hosted-sagemaker.md), including the [Claude Code plugin settings](docs/self-hosted-sagemaker.md#claude-code-plugin).
|
|
327
328
|
|
|
328
329
|
## Benchmark mode
|
|
329
330
|
|
|
@@ -174,6 +174,28 @@ After that, indexing and search embed via SageMaker — no egress to `infer.taka
|
|
|
174
174
|
|
|
175
175
|
If `TAKARA_API_KEY` is still set in your shell or `.env.local`, remove it there too so it cannot conflict later.
|
|
176
176
|
|
|
177
|
+
### Claude Code plugin
|
|
178
|
+
|
|
179
|
+
The plugin has no terminal step. Do steps 1–3 first, then set the plugin settings. Run `/plugin`, open **miru**, and set:
|
|
180
|
+
|
|
181
|
+
| Setting | Value |
|
|
182
|
+
| ------------------------ | ---------------------------------------------------------------------------------------- |
|
|
183
|
+
| `SageMaker endpoint ARN` | The `EndpointArn` output from step 2 |
|
|
184
|
+
| `AWS profile` | The profile from step 3. It must already exist in `~/.aws`; Miru never creates one. |
|
|
185
|
+
|
|
186
|
+
Or from a shell, then restart Claude Code:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
echo '{"sagemaker_endpoint_arn":"arn:aws:sagemaker:<region>:<account-id>:endpoint/<name>","aws_profile":"miru"}' \
|
|
190
|
+
| claude plugin configure miru@miru --values-stdin
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
When the ARN is set, it **takes priority over any stored Takara sign-in** and Miru does not contact `infer.takara.ai`. Nothing is deleted, so clearing the ARN returns you to Takara. Leaving the ARN blank means Takara is used. The profile is only read when an ARN is set.
|
|
194
|
+
|
|
195
|
+
If the profile uses SSO, run `aws sso login --profile <name>` again whenever the token expires.
|
|
196
|
+
|
|
197
|
+
The plugin's `auth` tool only handles Takara sign-in; SageMaker is configured through these settings only.
|
|
198
|
+
|
|
177
199
|
## Switch back to Takara
|
|
178
200
|
|
|
179
201
|
```bash
|
|
@@ -184,6 +206,8 @@ Enter your Takara API key. Setup validates it, saves it, and **deletes any store
|
|
|
184
206
|
|
|
185
207
|
Also unset any `MIRU_SAGEMAKER_*` variables if you set them in the environment or `.env.local`.
|
|
186
208
|
|
|
209
|
+
In the Claude Code plugin, clear the **SageMaker endpoint ARN** setting and restart.
|
|
210
|
+
|
|
187
211
|
## Environment alternatives
|
|
188
212
|
|
|
189
213
|
Prefer `miru setup --sagemaker` so auth is checked automatically. You can also set:
|
package/package.json
CHANGED
package/src/credentials.ts
CHANGED
|
@@ -116,6 +116,32 @@ function clearTakaraEnv(): void {
|
|
|
116
116
|
delete process.env.TAKARA_API_KEY;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
/** A plugin `userConfig` value, or undefined when blank or left as an unsubstituted `${...}`. */
|
|
120
|
+
function pluginConfigValue(name: string): string | undefined {
|
|
121
|
+
const value = process.env[name]?.trim();
|
|
122
|
+
return value && !isUnsubstitutedPlaceholder(value) ? value : undefined;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Plugin settings (`sagemaker_endpoint_arn` / `aws_profile` in plugin.json) arrive as
|
|
127
|
+
* MIRU_PLUGIN_* env vars. When an endpoint is configured there it is an explicit choice, so it
|
|
128
|
+
* wins over any stored credentials; Takara env is dropped because the modes are exclusive.
|
|
129
|
+
*/
|
|
130
|
+
function applyPluginSageMakerConfig(): boolean {
|
|
131
|
+
const arn = pluginConfigValue("MIRU_PLUGIN_SAGEMAKER_ENDPOINT_ARN");
|
|
132
|
+
if (!arn) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
process.env.MIRU_SAGEMAKER_ENDPOINT_ARN = arn;
|
|
136
|
+
const profile = pluginConfigValue("MIRU_PLUGIN_AWS_PROFILE");
|
|
137
|
+
if (profile) {
|
|
138
|
+
process.env.AWS_PROFILE = profile;
|
|
139
|
+
}
|
|
140
|
+
clearTakaraEnv();
|
|
141
|
+
activeStoredToken = null;
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
|
|
119
145
|
function hydrateSageMakerEnv(sagemaker: StoredSageMakerCredentials): void {
|
|
120
146
|
process.env.MIRU_SAGEMAKER_ENDPOINT_ARN = sagemaker.endpoint_arn;
|
|
121
147
|
if (sagemaker.profile && !process.env.AWS_PROFILE) {
|
|
@@ -144,6 +170,9 @@ function markLoadedToken(token: string): void {
|
|
|
144
170
|
/** Hydrate TAKARA_API_KEY / SageMaker env vars from the credentials file when env is unset. */
|
|
145
171
|
export async function loadStoredCredentials(): Promise<boolean> {
|
|
146
172
|
normalizeTakaraApiKeyEnv();
|
|
173
|
+
if (applyPluginSageMakerConfig()) {
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
147
176
|
const stored = await readStoredCredentials();
|
|
148
177
|
if (!stored) {
|
|
149
178
|
return false;
|