opencode-rehydra-core 0.14.0 → 0.14.2
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.
|
@@ -14,6 +14,20 @@
|
|
|
14
14
|
import type { AnonymizerConfig } from "../../core/anonymizer.js";
|
|
15
15
|
import type { AnonymizationPolicy } from "../../types/index.js";
|
|
16
16
|
import type { RehydraPluginOptions } from "../types.js";
|
|
17
|
+
/**
|
|
18
|
+
* Resolves the canonical OpenCode config directory (`$XDG_CONFIG_HOME/opencode`
|
|
19
|
+
* or `$HOME/.config/opencode`). Returns `undefined` when neither location is
|
|
20
|
+
* usable. Honours `XDG_CONFIG_HOME` on every platform so distros overriding
|
|
21
|
+
* the spec keep working, and falls back to `~/.config/opencode` per the
|
|
22
|
+
* OpenCode XDG spec.
|
|
23
|
+
*/
|
|
24
|
+
export declare function opencodeConfigDirectory(env?: NodeJS.ProcessEnv, homedirFn?: () => string): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Heuristic: returns `true` when `projectDir` is somewhere underneath (or equal
|
|
27
|
+
* to) `opencodeConfigDir`, so the project itself is *not* the OpenCode config
|
|
28
|
+
* directory and the env-file fallback below should kick in.
|
|
29
|
+
*/
|
|
30
|
+
export declare function shouldUseOpencodeConfigDir(projectDir: string, opencodeConfigDir: string): boolean;
|
|
17
31
|
/**
|
|
18
32
|
* Validates and normalizes raw OpenCode plugin options.
|
|
19
33
|
*
|
|
@@ -26,10 +40,19 @@ import type { RehydraPluginOptions } from "../types.js";
|
|
|
26
40
|
*/
|
|
27
41
|
export declare function normalizePluginOptions(raw: unknown, ctxDirectory: string): RehydraPluginOptions;
|
|
28
42
|
/**
|
|
29
|
-
* Resolves the anonymizer configuration
|
|
30
|
-
*
|
|
43
|
+
* Resolves the anonymizer configuration.
|
|
44
|
+
*
|
|
45
|
+
* The base directory for `envFiles` paths is picked in this order:
|
|
46
|
+
* 1. `anonymizer.secrets.envBaseDirectory` if the user configured it.
|
|
47
|
+
* 2. The OpenCode config directory (`~/.config/opencode` on every supported
|
|
48
|
+
* platform) — when the user has not configured their own `anonymizer`
|
|
49
|
+
* block. This means a single `~/.config/opencode/.env` shared across all
|
|
50
|
+
* projects works without per-project paths, while project-local discovery
|
|
51
|
+
* stays opt-in by setting `secrets.envBaseDirectory` explicitly.
|
|
52
|
+
*
|
|
53
|
+
* 3. The project directory (final fallback).
|
|
31
54
|
*/
|
|
32
|
-
export declare function anonymizerConfigFromOptions(options: RehydraPluginOptions, ctxDirectory: string): AnonymizerConfig;
|
|
55
|
+
export declare function anonymizerConfigFromOptions(options: RehydraPluginOptions, ctxDirectory: string, env?: NodeJS.ProcessEnv, homedirFn?: () => string): AnonymizerConfig;
|
|
33
56
|
/**
|
|
34
57
|
* Builds the policy override implied by `disableTypes`.
|
|
35
58
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/opencode-plugin/v2/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/opencode-plugin/v2/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAMjE,OAAO,KAAK,EAAE,mBAAmB,EAA4B,MAAM,sBAAsB,CAAC;AAC1F,OAAO,KAAK,EAAe,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAMrE;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,SAAS,GAAE,MAAM,MAAgB,GAChC,MAAM,GAAG,SAAS,CAUpB;AAUD;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,MAAM,EAClB,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAOT;AA8CD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,EACZ,YAAY,EAAE,MAAM,GACnB,oBAAoB,CAsBtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,oBAAoB,EAC7B,YAAY,EAAE,MAAM,EACpB,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,SAAS,GAAE,MAAM,MAAgB,GAChC,gBAAgB,CAuBlB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAuB1C"}
|
|
@@ -11,10 +11,50 @@
|
|
|
11
11
|
* - {@link policyFromOptions} keeps URL/IP_ADDRESS disabled by default while
|
|
12
12
|
* re-adding the opt-in secret types the anonymizer enables internally.
|
|
13
13
|
*/
|
|
14
|
+
import { homedir } from "node:os";
|
|
15
|
+
import { sep } from "node:path";
|
|
14
16
|
import { PIIType, SECRET_PII_TYPES, createDefaultPolicy, } from "../../types/index.js";
|
|
15
17
|
const DEFAULT_DISABLE_TYPES = ["URL", "IP_ADDRESS"];
|
|
16
18
|
const DEFAULT_ENV_FILES = ["**/.env*"];
|
|
17
19
|
const DEFAULT_MIN_VALUE_LENGTH = 4;
|
|
20
|
+
/**
|
|
21
|
+
* Resolves the canonical OpenCode config directory (`$XDG_CONFIG_HOME/opencode`
|
|
22
|
+
* or `$HOME/.config/opencode`). Returns `undefined` when neither location is
|
|
23
|
+
* usable. Honours `XDG_CONFIG_HOME` on every platform so distros overriding
|
|
24
|
+
* the spec keep working, and falls back to `~/.config/opencode` per the
|
|
25
|
+
* OpenCode XDG spec.
|
|
26
|
+
*/
|
|
27
|
+
export function opencodeConfigDirectory(env = process.env, homedirFn = homedir) {
|
|
28
|
+
const xdg = env.XDG_CONFIG_HOME;
|
|
29
|
+
if (typeof xdg === "string" && xdg.trim().length > 0) {
|
|
30
|
+
return joinPath(xdg, "opencode");
|
|
31
|
+
}
|
|
32
|
+
const home = env.HOME ?? env.USERPROFILE ?? homedirFn();
|
|
33
|
+
if (typeof home === "string" && home.trim().length > 0) {
|
|
34
|
+
return joinPath(home, ".config", "opencode");
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
/** Joins POSIX/Windows path segments without depending on `node:path.join`. */
|
|
39
|
+
function joinPath(...segments) {
|
|
40
|
+
return segments
|
|
41
|
+
.filter((segment) => segment.length > 0)
|
|
42
|
+
.join(sep)
|
|
43
|
+
.replace(new RegExp(`${sep}+`, "g"), sep);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Heuristic: returns `true` when `projectDir` is somewhere underneath (or equal
|
|
47
|
+
* to) `opencodeConfigDir`, so the project itself is *not* the OpenCode config
|
|
48
|
+
* directory and the env-file fallback below should kick in.
|
|
49
|
+
*/
|
|
50
|
+
export function shouldUseOpencodeConfigDir(projectDir, opencodeConfigDir) {
|
|
51
|
+
const normalized = (value) => value.endsWith(sep) ? value : value + sep;
|
|
52
|
+
const a = normalized(projectDir);
|
|
53
|
+
const b = normalized(opencodeConfigDir);
|
|
54
|
+
if (a === b)
|
|
55
|
+
return false;
|
|
56
|
+
return a.startsWith(b);
|
|
57
|
+
}
|
|
18
58
|
function isRecord(value) {
|
|
19
59
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
20
60
|
}
|
|
@@ -44,13 +84,12 @@ function asTagFormat(value) {
|
|
|
44
84
|
const keyword = typeof value.keyword === "string" ? value.keyword : undefined;
|
|
45
85
|
return { open: value.open, close: value.close, keyword };
|
|
46
86
|
}
|
|
47
|
-
function defaultSecretsConfig(options
|
|
87
|
+
function defaultSecretsConfig(options) {
|
|
48
88
|
return {
|
|
49
89
|
enabled: true,
|
|
50
90
|
envFiles: options.envFiles ?? DEFAULT_ENV_FILES,
|
|
51
91
|
redactValues: options.redactValues,
|
|
52
92
|
minValueLength: options.minValueLength ?? DEFAULT_MIN_VALUE_LENGTH,
|
|
53
|
-
envBaseDirectory,
|
|
54
93
|
};
|
|
55
94
|
}
|
|
56
95
|
/**
|
|
@@ -79,25 +118,38 @@ export function normalizePluginOptions(raw, ctxDirectory) {
|
|
|
79
118
|
}
|
|
80
119
|
normalized.anonymizer = isRecord(source.anonymizer)
|
|
81
120
|
? source.anonymizer
|
|
82
|
-
: { secrets: defaultSecretsConfig(normalized
|
|
121
|
+
: { secrets: defaultSecretsConfig(normalized) };
|
|
83
122
|
return normalized;
|
|
84
123
|
}
|
|
85
124
|
/**
|
|
86
|
-
* Resolves the anonymizer configuration
|
|
87
|
-
*
|
|
125
|
+
* Resolves the anonymizer configuration.
|
|
126
|
+
*
|
|
127
|
+
* The base directory for `envFiles` paths is picked in this order:
|
|
128
|
+
* 1. `anonymizer.secrets.envBaseDirectory` if the user configured it.
|
|
129
|
+
* 2. The OpenCode config directory (`~/.config/opencode` on every supported
|
|
130
|
+
* platform) — when the user has not configured their own `anonymizer`
|
|
131
|
+
* block. This means a single `~/.config/opencode/.env` shared across all
|
|
132
|
+
* projects works without per-project paths, while project-local discovery
|
|
133
|
+
* stays opt-in by setting `secrets.envBaseDirectory` explicitly.
|
|
134
|
+
*
|
|
135
|
+
* 3. The project directory (final fallback).
|
|
88
136
|
*/
|
|
89
|
-
export function anonymizerConfigFromOptions(options, ctxDirectory) {
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
137
|
+
export function anonymizerConfigFromOptions(options, ctxDirectory, env = process.env, homedirFn = homedir) {
|
|
138
|
+
const userProvided = options.anonymizer !== undefined;
|
|
139
|
+
const base = userProvided
|
|
140
|
+
? options.anonymizer
|
|
141
|
+
: { secrets: defaultSecretsConfig(options) };
|
|
93
142
|
if (base.secrets === undefined) {
|
|
94
143
|
return base;
|
|
95
144
|
}
|
|
145
|
+
const envBaseDirectory = base.secrets.envBaseDirectory ?? (userProvided
|
|
146
|
+
? ctxDirectory
|
|
147
|
+
: (opencodeConfigDirectory(env, homedirFn) ?? ctxDirectory));
|
|
96
148
|
return {
|
|
97
149
|
...base,
|
|
98
150
|
secrets: {
|
|
99
151
|
...base.secrets,
|
|
100
|
-
envBaseDirectory
|
|
152
|
+
envBaseDirectory,
|
|
101
153
|
},
|
|
102
154
|
};
|
|
103
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/opencode-plugin/v2/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/opencode-plugin/v2/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGhC,OAAO,EACL,OAAO,EACP,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,qBAAqB,GAAkB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AACnE,MAAM,iBAAiB,GAAa,CAAC,UAAU,CAAC,CAAC;AACjD,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAyB,OAAO,CAAC,GAAG,EACpC,YAA0B,OAAO;IAEjC,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC;IAChC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrD,OAAO,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IACnC,CAAC;IACD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,WAAW,IAAI,SAAS,EAAE,CAAC;IACxD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvD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AM,UAAU,IAAI,gBAAgB,EAAE,CAAC;QAC1C,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,IAAe,CAAC;QAChC,iBAAiB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAClC,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,iBAAiB,EAAE,eAAe,EAAE,CAAC;AACnE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-rehydra-core",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"description": "On-device PII anonymization core SDK (opencode-rehydra-core). Ships the OpenCode plugin as opencode-rehydar.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -84,6 +84,10 @@
|
|
|
84
84
|
"test:streaming": "npx tsx scripts/test-streaming.ts",
|
|
85
85
|
"lint": "eslint src --ext .ts",
|
|
86
86
|
"clean": "rm -rf dist",
|
|
87
|
+
"publish:core": "npm run build && npm publish --access public",
|
|
88
|
+
"publish:plugin": "npm run build && cd packages/opencode-plugin && npm publish --access public && cd ../..",
|
|
89
|
+
"publish:all": "npm run build && npm publish --access public && cd packages/opencode-plugin && npm publish --access public && cd ../..",
|
|
90
|
+
"pack:dry-run": "npm pack --dry-run && cd packages/opencode-plugin && npm pack --dry-run && cd ../..",
|
|
87
91
|
"setup:ner": "bash scripts/setup-ner-model.sh --quantize",
|
|
88
92
|
"setup:ner:standard": "bash scripts/setup-ner-model.sh",
|
|
89
93
|
"setup:ner:upload": "bash scripts/setup-ner-model.sh --quantize --upload",
|