@executor-js/plugin-file-secrets 1.5.6 → 1.5.7

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.
@@ -7,7 +7,7 @@ import {
7
7
  ProviderItemId,
8
8
  ProviderKey,
9
9
  StorageError
10
- } from "@executor-js/sdk/core";
10
+ } from "@executor-js/sdk";
11
11
  var APP_NAME = "executor";
12
12
  var xdgDataHome = () => {
13
13
  if (process.env.XDG_DATA_HOME?.trim()) return process.env.XDG_DATA_HOME.trim();
@@ -98,4 +98,4 @@ export {
98
98
  xdgDataHome,
99
99
  fileSecretsPlugin
100
100
  };
101
- //# sourceMappingURL=chunk-LHWZ22RD.js.map
101
+ //# sourceMappingURL=chunk-LOLKJR7S.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Effect, Schema } from \"effect\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\nimport {\n definePlugin,\n ProviderItemId,\n ProviderKey,\n StorageError,\n type CredentialProvider,\n} from \"@executor-js/sdk\";\n\n// ---------------------------------------------------------------------------\n// XDG data dir resolution\n// ---------------------------------------------------------------------------\n\nconst APP_NAME = \"executor\";\n\nexport const xdgDataHome = (): string => {\n if (process.env.XDG_DATA_HOME?.trim()) return process.env.XDG_DATA_HOME.trim();\n if (process.platform === \"win32\") {\n return (\n process.env.LOCALAPPDATA ||\n process.env.APPDATA ||\n path.join(process.env.USERPROFILE || \"~\", \"AppData\", \"Local\")\n );\n }\n return path.join(process.env.HOME || \"~\", \".local\", \"share\");\n};\n\nconst authDir = (overrideDir?: string): string => overrideDir ?? path.join(xdgDataHome(), APP_NAME);\n\nconst authFilePath = (overrideDir?: string): string => path.join(authDir(overrideDir), \"auth.json\");\n\n// ---------------------------------------------------------------------------\n// Schema for the auth file\n//\n// v2: the file is a FLAT map of opaque provider item id -> value.\n// { \"github-token\": \"ghp_xxx\" }\n// The v1 per-scope partition (`{ scopeId: { secretId: value } }`) is gone:\n// the connection row owns the (tenant, owner, subject) partition, and the\n// provider only ever sees an opaque `ProviderItemId`.\n// ---------------------------------------------------------------------------\n\nconst FlatAuthFile = Schema.Record(Schema.String, Schema.String);\nconst decodeFlatAuthFile = Schema.decodeUnknownEffect(Schema.fromJsonString(FlatAuthFile));\n\n// ---------------------------------------------------------------------------\n// File I/O with restricted permissions\n//\n// These helpers keep real I/O and decode failures in the Effect error\n// channel as `StorageError`. Missing files are still treated as an empty\n// auth file, but malformed JSON, schema decode failures, and permission\n// errors no longer collapse into \"empty file\".\n// ---------------------------------------------------------------------------\n\nconst isFileNotFoundCause = (cause: unknown): cause is NodeJS.ErrnoException =>\n typeof cause === \"object\" && cause !== null && \"code\" in cause && cause.code === \"ENOENT\";\n\nconst toStorageError =\n (message: string) =>\n (cause: unknown): StorageError =>\n new StorageError({ message, cause });\n\nconst readAll = (filePath: string): Effect.Effect<Record<string, string>, StorageError> => {\n if (!fs.existsSync(filePath)) return Effect.succeed({});\n return Effect.try({\n try: () => fs.readFileSync(filePath, \"utf-8\"),\n catch: toStorageError(\"Failed to read auth file\"),\n }).pipe(\n Effect.catchIf(\n (error: StorageError) => isFileNotFoundCause(error.cause),\n () => Effect.succeed(\"\"),\n ),\n Effect.flatMap((raw: string) =>\n raw === \"\"\n ? Effect.succeed<Record<string, string>>({})\n : decodeFlatAuthFile(raw).pipe(\n Effect.mapError(toStorageError(\"Failed to parse auth file\")),\n ),\n ),\n );\n};\n\nconst writeAll = (\n filePath: string,\n secrets: Record<string, string>,\n): Effect.Effect<void, StorageError> => {\n const dir = path.dirname(filePath);\n const tmp = `${filePath}.tmp`;\n return Effect.gen(function* () {\n if (!fs.existsSync(dir)) {\n yield* Effect.try({\n try: () => fs.mkdirSync(dir, { recursive: true, mode: 0o700 }),\n catch: toStorageError(\"Failed to create auth directory\"),\n });\n }\n yield* Effect.try({\n try: () => fs.writeFileSync(tmp, JSON.stringify(secrets, null, 2), { mode: 0o600 }),\n catch: toStorageError(\"Failed to write temporary auth file\"),\n });\n yield* Effect.try({\n try: () => fs.renameSync(tmp, filePath),\n catch: toStorageError(\"Failed to replace auth file\"),\n });\n });\n};\n\n// ---------------------------------------------------------------------------\n// Plugin config\n// ---------------------------------------------------------------------------\n\nexport interface FileSecretsPluginConfig {\n /** Override the directory for auth.json (default: XDG data dir) */\n readonly directory?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Plugin extension — public API on executor.fileSecrets\n// ---------------------------------------------------------------------------\n\nconst makeFileSecretsExtension = (options: FileSecretsPluginConfig | undefined) => ({\n filePath: resolveFilePath(options),\n});\n\nexport type FileSecretsExtension = ReturnType<typeof makeFileSecretsExtension>;\n\n// ---------------------------------------------------------------------------\n// CredentialProvider — flat opaque-id storage in auth.json.\n//\n// v2: no scope partitioning. Each `ProviderItemId` is a flat top-level key in\n// the file; the connection row that references it owns the (tenant, owner,\n// subject) partition. `delete` returns void; absence is not an error.\n// ---------------------------------------------------------------------------\n\nconst FILE_PROVIDER_KEY = ProviderKey.make(\"file\");\n\nconst makeFileProvider = (filePath: string): CredentialProvider => ({\n key: FILE_PROVIDER_KEY,\n writable: true,\n\n get: (id: ProviderItemId) => readAll(filePath).pipe(Effect.map((data) => data[id] ?? null)),\n\n has: (id: ProviderItemId) => readAll(filePath).pipe(Effect.map((data) => id in data)),\n\n set: (id: ProviderItemId, value: string) =>\n Effect.gen(function* () {\n const data = yield* readAll(filePath);\n data[id] = value;\n yield* writeAll(filePath, data);\n }),\n\n delete: (id: ProviderItemId) =>\n Effect.gen(function* () {\n const data = yield* readAll(filePath);\n if (id in data) {\n delete data[id];\n yield* writeAll(filePath, data);\n }\n }),\n\n list: () =>\n readAll(filePath).pipe(\n Effect.map((data) => Object.keys(data).map((k) => ({ id: ProviderItemId.make(k), name: k }))),\n ),\n});\n\n// ---------------------------------------------------------------------------\n// Plugin definition\n//\n// Compute the file path identically in `extension` (for `filePath`) and\n// `credentialProviders` (for the provider's read/write). Both are called once\n// per createExecutor.\n// ---------------------------------------------------------------------------\n\nconst resolveFilePath = (config: FileSecretsPluginConfig | undefined): string =>\n authFilePath(config?.directory);\n\nexport const fileSecretsPlugin = definePlugin((options?: FileSecretsPluginConfig) => ({\n id: \"fileSecrets\" as const,\n storage: () => ({}),\n\n extension: () => makeFileSecretsExtension(options),\n\n credentialProviders: (): readonly CredentialProvider[] => [\n makeFileProvider(resolveFilePath(options)),\n ],\n}));\n"],"mappings":";AAAA,SAAS,QAAQ,cAAc;AAC/B,YAAY,QAAQ;AACpB,YAAY,UAAU;AAEtB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAMP,IAAM,WAAW;AAEV,IAAM,cAAc,MAAc;AACvC,MAAI,QAAQ,IAAI,eAAe,KAAK,EAAG,QAAO,QAAQ,IAAI,cAAc,KAAK;AAC7E,MAAI,QAAQ,aAAa,SAAS;AAChC,WACE,QAAQ,IAAI,gBACZ,QAAQ,IAAI,WACP,UAAK,QAAQ,IAAI,eAAe,KAAK,WAAW,OAAO;AAAA,EAEhE;AACA,SAAY,UAAK,QAAQ,IAAI,QAAQ,KAAK,UAAU,OAAO;AAC7D;AAEA,IAAM,UAAU,CAAC,gBAAiC,eAAoB,UAAK,YAAY,GAAG,QAAQ;AAElG,IAAM,eAAe,CAAC,gBAAsC,UAAK,QAAQ,WAAW,GAAG,WAAW;AAYlG,IAAM,eAAe,OAAO,OAAO,OAAO,QAAQ,OAAO,MAAM;AAC/D,IAAM,qBAAqB,OAAO,oBAAoB,OAAO,eAAe,YAAY,CAAC;AAWzF,IAAM,sBAAsB,CAAC,UAC3B,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU,SAAS,MAAM,SAAS;AAEnF,IAAM,iBACJ,CAAC,YACD,CAAC,UACC,IAAI,aAAa,EAAE,SAAS,MAAM,CAAC;AAEvC,IAAM,UAAU,CAAC,aAA0E;AACzF,MAAI,CAAI,cAAW,QAAQ,EAAG,QAAO,OAAO,QAAQ,CAAC,CAAC;AACtD,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xdgDataHome
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ declare const makeFileSecretsExtension: (options: FileSecretsPluginConfig | unde
7
7
  filePath: string;
8
8
  };
9
9
  export type FileSecretsExtension = ReturnType<typeof makeFileSecretsExtension>;
10
- export declare const fileSecretsPlugin: import("@executor-js/sdk/core").ConfiguredPlugin<"fileSecrets", {
10
+ export declare const fileSecretsPlugin: import("@executor-js/sdk").ConfiguredPlugin<"fileSecrets", {
11
11
  filePath: string;
12
12
  }, {}, FileSecretsPluginConfig, undefined, import("effect/Layer").Layer<unknown, never, never>, import("effect/unstable/httpapi/HttpApiGroup").Any>;
13
13
  export {};
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  fileSecretsPlugin
3
- } from "./chunk-LHWZ22RD.js";
3
+ } from "./chunk-LOLKJR7S.js";
4
4
 
5
5
  // src/promise.ts
6
6
  var fileSecretsPlugin2 = (config) => fileSecretsPlugin(config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@executor-js/plugin-file-secrets",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "homepage": "https://github.com/RhysSullivan/executor/tree/main/packages/plugins/file-secrets",
5
5
  "bugs": {
6
6
  "url": "https://github.com/RhysSullivan/executor/issues"
@@ -40,7 +40,7 @@
40
40
  "typecheck:slow": "bunx tsc --noEmit -p tsconfig.json"
41
41
  },
42
42
  "dependencies": {
43
- "@executor-js/sdk": "1.5.6"
43
+ "@executor-js/sdk": "1.5.7"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/node": "^24.3.1",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { Effect, Schema } from \"effect\";\nimport * as fs from \"node:fs\";\nimport * as path from \"node:path\";\n\nimport {\n definePlugin,\n ProviderItemId,\n ProviderKey,\n StorageError,\n type CredentialProvider,\n} from \"@executor-js/sdk/core\";\n\n// ---------------------------------------------------------------------------\n// XDG data dir resolution\n// ---------------------------------------------------------------------------\n\nconst APP_NAME = \"executor\";\n\nexport const xdgDataHome = (): string => {\n if (process.env.XDG_DATA_HOME?.trim()) return process.env.XDG_DATA_HOME.trim();\n if (process.platform === \"win32\") {\n return (\n process.env.LOCALAPPDATA ||\n process.env.APPDATA ||\n path.join(process.env.USERPROFILE || \"~\", \"AppData\", \"Local\")\n );\n }\n return path.join(process.env.HOME || \"~\", \".local\", \"share\");\n};\n\nconst authDir = (overrideDir?: string): string => overrideDir ?? path.join(xdgDataHome(), APP_NAME);\n\nconst authFilePath = (overrideDir?: string): string => path.join(authDir(overrideDir), \"auth.json\");\n\n// ---------------------------------------------------------------------------\n// Schema for the auth file\n//\n// v2: the file is a FLAT map of opaque provider item id -> value.\n// { \"github-token\": \"ghp_xxx\" }\n// The v1 per-scope partition (`{ scopeId: { secretId: value } }`) is gone:\n// the connection row owns the (tenant, owner, subject) partition, and the\n// provider only ever sees an opaque `ProviderItemId`.\n// ---------------------------------------------------------------------------\n\nconst FlatAuthFile = Schema.Record(Schema.String, Schema.String);\nconst decodeFlatAuthFile = Schema.decodeUnknownEffect(Schema.fromJsonString(FlatAuthFile));\n\n// ---------------------------------------------------------------------------\n// File I/O with restricted permissions\n//\n// These helpers keep real I/O and decode failures in the Effect error\n// channel as `StorageError`. Missing files are still treated as an empty\n// auth file, but malformed JSON, schema decode failures, and permission\n// errors no longer collapse into \"empty file\".\n// ---------------------------------------------------------------------------\n\nconst isFileNotFoundCause = (cause: unknown): cause is NodeJS.ErrnoException =>\n typeof cause === \"object\" && cause !== null && \"code\" in cause && cause.code === \"ENOENT\";\n\nconst toStorageError =\n (message: string) =>\n (cause: unknown): StorageError =>\n new StorageError({ message, cause });\n\nconst readAll = (filePath: string): Effect.Effect<Record<string, string>, StorageError> => {\n if (!fs.existsSync(filePath)) return Effect.succeed({});\n return Effect.try({\n try: () => fs.readFileSync(filePath, \"utf-8\"),\n catch: toStorageError(\"Failed to read auth file\"),\n }).pipe(\n Effect.catchIf(\n (error: StorageError) => isFileNotFoundCause(error.cause),\n () => Effect.succeed(\"\"),\n ),\n Effect.flatMap((raw: string) =>\n raw === \"\"\n ? Effect.succeed<Record<string, string>>({})\n : decodeFlatAuthFile(raw).pipe(\n Effect.mapError(toStorageError(\"Failed to parse auth file\")),\n ),\n ),\n );\n};\n\nconst writeAll = (\n filePath: string,\n secrets: Record<string, string>,\n): Effect.Effect<void, StorageError> => {\n const dir = path.dirname(filePath);\n const tmp = `${filePath}.tmp`;\n return Effect.gen(function* () {\n if (!fs.existsSync(dir)) {\n yield* Effect.try({\n try: () => fs.mkdirSync(dir, { recursive: true, mode: 0o700 }),\n catch: toStorageError(\"Failed to create auth directory\"),\n });\n }\n yield* Effect.try({\n try: () => fs.writeFileSync(tmp, JSON.stringify(secrets, null, 2), { mode: 0o600 }),\n catch: toStorageError(\"Failed to write temporary auth file\"),\n });\n yield* Effect.try({\n try: () => fs.renameSync(tmp, filePath),\n catch: toStorageError(\"Failed to replace auth file\"),\n });\n });\n};\n\n// ---------------------------------------------------------------------------\n// Plugin config\n// ---------------------------------------------------------------------------\n\nexport interface FileSecretsPluginConfig {\n /** Override the directory for auth.json (default: XDG data dir) */\n readonly directory?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Plugin extension — public API on executor.fileSecrets\n// ---------------------------------------------------------------------------\n\nconst makeFileSecretsExtension = (options: FileSecretsPluginConfig | undefined) => ({\n filePath: resolveFilePath(options),\n});\n\nexport type FileSecretsExtension = ReturnType<typeof makeFileSecretsExtension>;\n\n// ---------------------------------------------------------------------------\n// CredentialProvider — flat opaque-id storage in auth.json.\n//\n// v2: no scope partitioning. Each `ProviderItemId` is a flat top-level key in\n// the file; the connection row that references it owns the (tenant, owner,\n// subject) partition. `delete` returns void; absence is not an error.\n// ---------------------------------------------------------------------------\n\nconst FILE_PROVIDER_KEY = ProviderKey.make(\"file\");\n\nconst makeFileProvider = (filePath: string): CredentialProvider => ({\n key: FILE_PROVIDER_KEY,\n writable: true,\n\n get: (id: ProviderItemId) => readAll(filePath).pipe(Effect.map((data) => data[id] ?? null)),\n\n has: (id: ProviderItemId) => readAll(filePath).pipe(Effect.map((data) => id in data)),\n\n set: (id: ProviderItemId, value: string) =>\n Effect.gen(function* () {\n const data = yield* readAll(filePath);\n data[id] = value;\n yield* writeAll(filePath, data);\n }),\n\n delete: (id: ProviderItemId) =>\n Effect.gen(function* () {\n const data = yield* readAll(filePath);\n if (id in data) {\n delete data[id];\n yield* writeAll(filePath, data);\n }\n }),\n\n list: () =>\n readAll(filePath).pipe(\n Effect.map((data) => Object.keys(data).map((k) => ({ id: ProviderItemId.make(k), name: k }))),\n ),\n});\n\n// ---------------------------------------------------------------------------\n// Plugin definition\n//\n// Compute the file path identically in `extension` (for `filePath`) and\n// `credentialProviders` (for the provider's read/write). Both are called once\n// per createExecutor.\n// ---------------------------------------------------------------------------\n\nconst resolveFilePath = (config: FileSecretsPluginConfig | undefined): string =>\n authFilePath(config?.directory);\n\nexport const fileSecretsPlugin = definePlugin((options?: FileSecretsPluginConfig) => ({\n id: \"fileSecrets\" as const,\n storage: () => ({}),\n\n extension: () => makeFileSecretsExtension(options),\n\n credentialProviders: (): readonly CredentialProvider[] => [\n makeFileProvider(resolveFilePath(options)),\n ],\n}));\n"],"mappings":";AAAA,SAAS,QAAQ,cAAc;AAC/B,YAAY,QAAQ;AACpB,YAAY,UAAU;AAEtB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAMP,IAAM,WAAW;AAEV,IAAM,cAAc,MAAc;AACvC,MAAI,QAAQ,IAAI,eAAe,KAAK,EAAG,QAAO,QAAQ,IAAI,cAAc,KAAK;AAC7E,MAAI,QAAQ,aAAa,SAAS;AAChC,WACE,QAAQ,IAAI,gBACZ,QAAQ,IAAI,WACP,UAAK,QAAQ,IAAI,eAAe,KAAK,WAAW,OAAO;AAAA,EAEhE;AACA,SAAY,UAAK,QAAQ,IAAI,QAAQ,KAAK,UAAU,OAAO;AA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