@kansodata/kansodata-glue-plugin 0.1.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 (66) hide show
  1. package/AGENTS.md +30 -0
  2. package/README.md +119 -0
  3. package/dist/client/glueClientFactory.d.ts +3 -0
  4. package/dist/client/glueClientFactory.js +7 -0
  5. package/dist/client/glueClientFactory.js.map +1 -0
  6. package/dist/config/loadConfig.d.ts +7 -0
  7. package/dist/config/loadConfig.js +82 -0
  8. package/dist/config/loadConfig.js.map +1 -0
  9. package/dist/config/schema.d.ts +110 -0
  10. package/dist/config/schema.js +78 -0
  11. package/dist/config/schema.js.map +1 -0
  12. package/dist/domain/contracts.d.ts +65 -0
  13. package/dist/domain/contracts.js +2 -0
  14. package/dist/domain/contracts.js.map +1 -0
  15. package/dist/errors/glueErrors.d.ts +30 -0
  16. package/dist/errors/glueErrors.js +43 -0
  17. package/dist/errors/glueErrors.js.map +1 -0
  18. package/dist/guards/operationGuards.d.ts +4 -0
  19. package/dist/guards/operationGuards.js +28 -0
  20. package/dist/guards/operationGuards.js.map +1 -0
  21. package/dist/index.d.ts +5 -0
  22. package/dist/index.js +4 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/manifest.d.ts +14 -0
  25. package/dist/manifest.js +15 -0
  26. package/dist/manifest.js.map +1 -0
  27. package/dist/openclawEntry.d.ts +8 -0
  28. package/dist/openclawEntry.js +41 -0
  29. package/dist/openclawEntry.js.map +1 -0
  30. package/dist/pluginMetadata.d.ts +5 -0
  31. package/dist/pluginMetadata.js +6 -0
  32. package/dist/pluginMetadata.js.map +1 -0
  33. package/dist/runtime/pluginRuntime.d.ts +22 -0
  34. package/dist/runtime/pluginRuntime.js +47 -0
  35. package/dist/runtime/pluginRuntime.js.map +1 -0
  36. package/dist/services/glueService.d.ts +79 -0
  37. package/dist/services/glueService.js +318 -0
  38. package/dist/services/glueService.js.map +1 -0
  39. package/dist/tools/catalog/catalogTools.d.ts +6 -0
  40. package/dist/tools/catalog/catalogTools.js +108 -0
  41. package/dist/tools/catalog/catalogTools.js.map +1 -0
  42. package/dist/tools/common.d.ts +4 -0
  43. package/dist/tools/common.js +19 -0
  44. package/dist/tools/common.js.map +1 -0
  45. package/dist/tools/registry.d.ts +3 -0
  46. package/dist/tools/registry.js +6 -0
  47. package/dist/tools/registry.js.map +1 -0
  48. package/dist/tools/triggers/triggerTools.d.ts +6 -0
  49. package/dist/tools/triggers/triggerTools.js +157 -0
  50. package/dist/tools/triggers/triggerTools.js.map +1 -0
  51. package/dist/tools/workflows/workflowTools.d.ts +6 -0
  52. package/dist/tools/workflows/workflowTools.js +106 -0
  53. package/dist/tools/workflows/workflowTools.js.map +1 -0
  54. package/dist/utils/sanitize.d.ts +4 -0
  55. package/dist/utils/sanitize.js +34 -0
  56. package/dist/utils/sanitize.js.map +1 -0
  57. package/docs/architecture.md +33 -0
  58. package/docs/roadmap.md +23 -0
  59. package/docs/rollback.md +34 -0
  60. package/docs/threat-model.md +31 -0
  61. package/docs/usage.md +70 -0
  62. package/openclaw.plugin.json +73 -0
  63. package/package.json +57 -0
  64. package/skills/kansodata-glue-operator/SKILL.md +47 -0
  65. package/skills/kansodata-glue-operator/docs/examples.md +44 -0
  66. package/skills/kansodata-glue-operator/docs/scope.md +37 -0
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { createManifest } from "./manifest.js";
2
+ export { createPluginRuntime } from "./runtime/pluginRuntime.js";
3
+ export { loadConfigFromEnv, resolveConfig } from "./config/loadConfig.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { ToolName } from "./domain/contracts.js";
2
+ import { GluePluginOpenClawConfigJsonSchema } from "./config/schema.js";
3
+ export interface OpenClawPluginManifest {
4
+ readonly id: string;
5
+ readonly name: string;
6
+ readonly description: string;
7
+ readonly version: string;
8
+ readonly skills: readonly string[];
9
+ readonly configSchema: typeof GluePluginOpenClawConfigJsonSchema;
10
+ readonly contracts: {
11
+ readonly tools: readonly ToolName[];
12
+ };
13
+ }
14
+ export declare const createManifest: (version: string) => OpenClawPluginManifest;
@@ -0,0 +1,15 @@
1
+ import { GluePluginOpenClawConfigJsonSchema } from "./config/schema.js";
2
+ import { allTools } from "./tools/registry.js";
3
+ import { PLUGIN_DESCRIPTION, PLUGIN_ID, PLUGIN_NAME, SKILL_DIRECTORIES } from "./pluginMetadata.js";
4
+ export const createManifest = (version) => ({
5
+ id: PLUGIN_ID,
6
+ name: PLUGIN_NAME,
7
+ description: PLUGIN_DESCRIPTION,
8
+ version,
9
+ skills: SKILL_DIRECTORIES,
10
+ configSchema: GluePluginOpenClawConfigJsonSchema,
11
+ contracts: {
12
+ tools: allTools.map((tool) => tool.name)
13
+ }
14
+ });
15
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kCAAkC,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAcpG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAe,EAA0B,EAAE,CAAC,CAAC;IAC1E,EAAE,EAAE,SAAS;IACb,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,kBAAkB;IAC/B,OAAO;IACP,MAAM,EAAE,iBAAiB;IACzB,YAAY,EAAE,kCAAkC;IAChD,SAAS,EAAE;QACT,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;KACzC;CACF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ id: string;
3
+ name: string;
4
+ description: string;
5
+ configSchema: import("openclaw/plugin-sdk/plugin-entry").OpenClawPluginConfigSchema;
6
+ register: NonNullable<import("openclaw/plugin-sdk/plugin-entry").OpenClawPluginDefinition["register"]>;
7
+ } & Pick<import("openclaw/plugin-sdk/plugin-entry").OpenClawPluginDefinition, "kind" | "reload" | "nodeHostCommands" | "securityAuditCollectors">;
8
+ export default _default;
@@ -0,0 +1,41 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
3
+ import { GluePluginOpenClawConfigJsonSchema, GluePluginOpenClawConfigSchema } from "./config/schema.js";
4
+ import { createManifest } from "./manifest.js";
5
+ import { createPluginRuntime } from "./runtime/pluginRuntime.js";
6
+ import { allTools } from "./tools/registry.js";
7
+ const manifest = createManifest("0.1.0");
8
+ const toParametersSchema = (schema) => Type.Unsafe({
9
+ type: "object",
10
+ additionalProperties: true,
11
+ ...schema
12
+ });
13
+ export default definePluginEntry({
14
+ id: manifest.id,
15
+ name: manifest.name,
16
+ description: manifest.description,
17
+ configSchema: {
18
+ safeParse: (value) => GluePluginOpenClawConfigSchema.safeParse(value ?? {}),
19
+ parse: (value) => GluePluginOpenClawConfigSchema.parse(value ?? {}),
20
+ jsonSchema: GluePluginOpenClawConfigJsonSchema
21
+ },
22
+ register(api) {
23
+ const runtime = createPluginRuntime({ openClawConfig: api.pluginConfig });
24
+ for (const toolDefinition of allTools) {
25
+ api.registerTool({
26
+ name: toolDefinition.name,
27
+ label: toolDefinition.name,
28
+ description: toolDefinition.description,
29
+ parameters: toParametersSchema(toolDefinition.inputSchema),
30
+ async execute(_toolCallId, params) {
31
+ const result = await runtime.executeTool(toolDefinition.name, params);
32
+ return {
33
+ content: [{ type: "text", text: result.summary }],
34
+ details: result
35
+ };
36
+ }
37
+ });
38
+ }
39
+ }
40
+ });
41
+ //# sourceMappingURL=openclawEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openclawEntry.js","sourceRoot":"","sources":["../src/openclawEntry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EACL,kCAAkC,EAClC,8BAA8B,EAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAEzC,MAAM,kBAAkB,GAAG,CAAC,MAA+B,EAAE,EAAE,CAC7D,IAAI,CAAC,MAAM,CAA0B;IACnC,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,IAAI;IAC1B,GAAG,MAAM;CACV,CAAC,CAAC;AAEL,eAAe,iBAAiB,CAAC;IAC/B,EAAE,EAAE,QAAQ,CAAC,EAAE;IACf,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,WAAW,EAAE,QAAQ,CAAC,WAAW;IACjC,YAAY,EAAE;QACZ,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,8BAA8B,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC;QAC3E,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,8BAA8B,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;QACnE,UAAU,EAAE,kCAAkC;KAC/C;IACD,QAAQ,CAAC,GAAG;QACV,MAAM,OAAO,GAAG,mBAAmB,CAAC,EAAE,cAAc,EAAE,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;QAC1E,KAAK,MAAM,cAAc,IAAI,QAAQ,EAAE,CAAC;YACtC,GAAG,CAAC,YAAY,CAAC;gBACf,IAAI,EAAE,cAAc,CAAC,IAAI;gBACzB,KAAK,EAAE,cAAc,CAAC,IAAI;gBAC1B,WAAW,EAAE,cAAc,CAAC,WAAW;gBACvC,UAAU,EAAE,kBAAkB,CAAC,cAAc,CAAC,WAAW,CAAC;gBAC1D,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM;oBAC/B,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;oBACtE,OAAO;wBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;wBACjD,OAAO,EAAE,MAAM;qBAChB,CAAC;gBACJ,CAAC;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const PLUGIN_ID = "kansodata-glue";
2
+ export declare const PLUGIN_NAME = "@kansodata/kansodata-glue-plugin";
3
+ export declare const PLUGIN_DESCRIPTION = "Controlled AWS Glue workflow/trigger writes and catalog diagnostics for ETL operator agents.";
4
+ export declare const SKILL_DIRECTORIES: readonly ["./skills"];
5
+ export declare const OPENCLAW_EXTENSION_ENTRY = "./dist/openclawEntry.js";
@@ -0,0 +1,6 @@
1
+ export const PLUGIN_ID = "kansodata-glue";
2
+ export const PLUGIN_NAME = "@kansodata/kansodata-glue-plugin";
3
+ export const PLUGIN_DESCRIPTION = "Controlled AWS Glue workflow/trigger writes and catalog diagnostics for ETL operator agents.";
4
+ export const SKILL_DIRECTORIES = ["./skills"];
5
+ export const OPENCLAW_EXTENSION_ENTRY = "./dist/openclawEntry.js";
6
+ //# sourceMappingURL=pluginMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginMetadata.js","sourceRoot":"","sources":["../src/pluginMetadata.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAC1C,MAAM,CAAC,MAAM,WAAW,GAAG,kCAAkC,CAAC;AAC9D,MAAM,CAAC,MAAM,kBAAkB,GAC7B,8FAA8F,CAAC;AACjG,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,UAAU,CAAU,CAAC;AACvD,MAAM,CAAC,MAAM,wBAAwB,GAAG,yBAAyB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { GluePluginConfig } from "../config/schema.js";
2
+ import type { ToolExecutionResult, ToolName } from "../domain/contracts.js";
3
+ import { type GlueService } from "../services/glueService.js";
4
+ import { type OpenClawPluginManifest } from "../manifest.js";
5
+ export interface RuntimeOptions {
6
+ readonly config?: GluePluginConfig;
7
+ readonly openClawConfig?: unknown;
8
+ readonly env?: NodeJS.ProcessEnv;
9
+ readonly glueService?: GlueService;
10
+ readonly version?: string;
11
+ }
12
+ export interface ToolErrorPayload {
13
+ readonly code: string;
14
+ readonly status: number;
15
+ readonly message: string;
16
+ readonly metadata?: Readonly<Record<string, unknown>>;
17
+ }
18
+ export interface OpenClawPluginRuntime {
19
+ readonly manifest: OpenClawPluginManifest;
20
+ executeTool(toolName: ToolName, input: unknown): Promise<ToolExecutionResult>;
21
+ }
22
+ export declare const createPluginRuntime: (options?: RuntimeOptions) => OpenClawPluginRuntime;
@@ -0,0 +1,47 @@
1
+ import { resolveConfig } from "../config/loadConfig.js";
2
+ import { GluePluginError } from "../errors/glueErrors.js";
3
+ import { toSanitizedError } from "../utils/sanitize.js";
4
+ import { createGlueClient } from "../client/glueClientFactory.js";
5
+ import { AwsGlueService } from "../services/glueService.js";
6
+ import { createManifest } from "../manifest.js";
7
+ import { toolRegistry } from "../tools/registry.js";
8
+ const serializeError = (error) => {
9
+ const sanitized = toSanitizedError(error);
10
+ return {
11
+ code: sanitized.code,
12
+ status: sanitized.status,
13
+ message: sanitized.message,
14
+ metadata: sanitized.metadata
15
+ };
16
+ };
17
+ export const createPluginRuntime = (options = {}) => {
18
+ const config = options.config ?? resolveConfig({ openClawConfig: options.openClawConfig, env: options.env });
19
+ const glueService = options.glueService ?? new AwsGlueService(createGlueClient(config), config);
20
+ const manifest = createManifest(options.version ?? "0.1.0");
21
+ return {
22
+ manifest,
23
+ executeTool: async (toolName, input) => {
24
+ const tool = toolRegistry.get(toolName);
25
+ if (!tool) {
26
+ throw new GluePluginError(`Unknown tool: ${toolName}`, {
27
+ code: "INPUT_INVALID",
28
+ status: 400
29
+ });
30
+ }
31
+ try {
32
+ const parsedInput = tool.parseInput(input);
33
+ return await tool.execute({ config, glueService }, parsedInput);
34
+ }
35
+ catch (error) {
36
+ const payload = serializeError(error);
37
+ throw new GluePluginError(payload.message, {
38
+ code: payload.code,
39
+ status: payload.status,
40
+ metadata: payload.metadata,
41
+ cause: error
42
+ });
43
+ }
44
+ }
45
+ };
46
+ };
47
+ //# sourceMappingURL=pluginRuntime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginRuntime.js","sourceRoot":"","sources":["../../src/runtime/pluginRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAoB,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,cAAc,EAA+B,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAsBpD,MAAM,cAAc,GAAG,CAAC,KAAc,EAAoB,EAAE;IAC1D,MAAM,SAAS,GAAG,gBA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AC,CAAC;gBACtC,MAAM,IAAI,eAAe,CAAC,OAAO,CAAC,OAAO,EAAE;oBACzC,IAAI,EAAE,OAAO,CAAC,IAAI;oBAClB,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;oBAC1B,KAAK,EAAE,KAAK;iBACb,CAAC,CAAC;YACL,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,79 @@
1
+ import { type Action, type GlueClient, type Predicate } from "@aws-sdk/client-glue";
2
+ import type { CatalogPartitionSample, CatalogTableView, GlueTriggerView, GlueWorkflowView, PartitioningExplainView } from "../domain/contracts.js";
3
+ import type { GluePluginConfig } from "../config/schema.js";
4
+ export interface CreateWorkflowInput {
5
+ readonly name: string;
6
+ readonly description?: string;
7
+ readonly maxConcurrentRuns?: number;
8
+ readonly defaultRunProperties?: Record<string, string>;
9
+ readonly dryRun?: boolean;
10
+ }
11
+ export interface UpdateWorkflowInput {
12
+ readonly name: string;
13
+ readonly description?: string;
14
+ readonly maxConcurrentRuns?: number;
15
+ readonly defaultRunProperties?: Record<string, string>;
16
+ readonly dryRun?: boolean;
17
+ }
18
+ export interface CreateTriggerInput {
19
+ readonly name: string;
20
+ readonly type: "SCHEDULED" | "CONDITIONAL" | "ON_DEMAND" | "EVENT";
21
+ readonly workflowName?: string;
22
+ readonly schedule?: string;
23
+ readonly description?: string;
24
+ readonly startOnCreation?: boolean;
25
+ readonly actions: readonly Action[];
26
+ readonly predicate?: Predicate;
27
+ readonly dryRun?: boolean;
28
+ }
29
+ export interface UpdateTriggerInput {
30
+ readonly name: string;
31
+ readonly schedule?: string;
32
+ readonly description?: string;
33
+ readonly actions?: readonly Action[];
34
+ readonly predicate?: Predicate;
35
+ readonly dryRun?: boolean;
36
+ }
37
+ export interface ListCatalogTablesInput {
38
+ readonly databaseName: string;
39
+ readonly expression?: string;
40
+ readonly maxResults?: number;
41
+ }
42
+ export interface GetCatalogPartitionsSampleInput {
43
+ readonly databaseName: string;
44
+ readonly tableName: string;
45
+ readonly expression?: string;
46
+ readonly sampleSize: number;
47
+ }
48
+ export interface GlueService {
49
+ listWorkflows(limit?: number): Promise<readonly string[]>;
50
+ getWorkflow(name: string): Promise<GlueWorkflowView>;
51
+ createWorkflow(input: CreateWorkflowInput): Promise<GlueWorkflowView>;
52
+ updateWorkflow(input: UpdateWorkflowInput): Promise<GlueWorkflowView>;
53
+ listTriggers(limit?: number): Promise<readonly string[]>;
54
+ getTrigger(name: string): Promise<GlueTriggerView>;
55
+ createTrigger(input: CreateTriggerInput): Promise<GlueTriggerView>;
56
+ updateTrigger(input: UpdateTriggerInput): Promise<GlueTriggerView>;
57
+ getCatalogTable(databaseName: string, tableName: string): Promise<CatalogTableView>;
58
+ listCatalogTables(input: ListCatalogTablesInput): Promise<readonly CatalogTableView[]>;
59
+ getCatalogPartitionsSample(input: GetCatalogPartitionsSampleInput): Promise<readonly CatalogPartitionSample[]>;
60
+ explainPartitioning(databaseName: string, tableName: string, sampleSize: number): Promise<PartitioningExplainView>;
61
+ }
62
+ export declare class AwsGlueService implements GlueService {
63
+ private readonly client;
64
+ private readonly config;
65
+ constructor(client: GlueClient, config: GluePluginConfig);
66
+ listWorkflows(limit?: number): Promise<readonly string[]>;
67
+ getWorkflow(name: string): Promise<GlueWorkflowView>;
68
+ createWorkflow(input: CreateWorkflowInput): Promise<GlueWorkflowView>;
69
+ updateWorkflow(input: UpdateWorkflowInput): Promise<GlueWorkflowView>;
70
+ listTriggers(limit?: number): Promise<readonly string[]>;
71
+ getTrigger(name: string): Promise<GlueTriggerView>;
72
+ createTrigger(input: CreateTriggerInput): Promise<GlueTriggerView>;
73
+ updateTrigger(input: UpdateTriggerInput): Promise<GlueTriggerView>;
74
+ getCatalogTable(databaseName: string, tableName: string): Promise<CatalogTableView>;
75
+ listCatalogTables(input: ListCatalogTablesInput): Promise<readonly CatalogTableView[]>;
76
+ getCatalogPartitionsSample(input: GetCatalogPartitionsSampleInput): Promise<readonly CatalogPartitionSample[]>;
77
+ explainPartitioning(databaseName: string, tableName: string, sampleSize: number): Promise<PartitioningExplainView>;
78
+ private wrapAwsError;
79
+ }
@@ -0,0 +1,318 @@
1
+ import { CreateTriggerCommand, CreateWorkflowCommand, GetPartitionsCommand, GetTableCommand, GetTablesCommand, GetTriggerCommand, GetWorkflowCommand, ListTriggersCommand, ListWorkflowsCommand, UpdateTriggerCommand, UpdateWorkflowCommand } from "@aws-sdk/client-glue";
2
+ import { MissingAuthorizationError, ResourceNotFoundError, UnsafeOperationError } from "../errors/glueErrors.js";
3
+ import { assertReadBeforeWrite } from "../guards/operationGuards.js";
4
+ import { sanitizeMessage, toSanitizedError } from "../utils/sanitize.js";
5
+ const SECRET_KEY_PATTERN = /(password|token|secret|key|credential|authorization)/i;
6
+ const sanitizeProperties = (source) => {
7
+ if (!source) {
8
+ return {};
9
+ }
10
+ const entries = Object.entries(source).filter(([key]) => !SECRET_KEY_PATTERN.test(key));
11
+ return Object.fromEntries(entries);
12
+ };
13
+ const ensureReadonly = (value) => value;
14
+ const mapWorkflow = (response) => ({
15
+ name: response.Name ?? "unknown",
16
+ description: response.Description,
17
+ maxConcurrentRuns: response.MaxConcurrentRuns,
18
+ defaultRunProperties: ensureReadonly(sanitizeProperties(response.DefaultRunProperties)),
19
+ graphSummary: response.Graph
20
+ ? {
21
+ nodeCount: response.Graph.Nodes?.length ?? 0,
22
+ edgeCount: response.Graph.Edges?.length ?? 0
23
+ }
24
+ : undefined
25
+ });
26
+ const mapTrigger = (trigger) => ({
27
+ name: trigger.Name ?? "unknown",
28
+ type: trigger.Type,
29
+ state: trigger.State,
30
+ workflowName: trigger.WorkflowName,
31
+ schedule: trigger.Schedule,
32
+ description: trigger.Description,
33
+ actionJobNames: trigger.Actions?.map((action) => action.JobName).filter((name) => !!name) ?? [],
34
+ predicateSummary: trigger.Predicate
35
+ ? {
36
+ logical: trigger.Predicate.Logical,
37
+ conditions: trigger.Predicate.Conditions?.length ?? 0
38
+ }
39
+ : undefined
40
+ });
41
+ const mapTable = (table) => ({
42
+ databaseName: table.DatabaseName ?? "unknown",
43
+ tableName: table.Name ?? "unknown",
44
+ owner: table.Owner,
45
+ tableType: table.TableType,
46
+ location: table.StorageDescriptor?.Location,
47
+ parameters: ensureReadonly(sanitizeProperties(table.Parameters)),
48
+ partitionKeys: table.PartitionKeys?.map((key) => key.Name).filter((key) => Boolean(key)) ?? [],
49
+ storageDescriptorColumns: table.StorageDescriptor?.Columns?.map((column) => column.Name).filter((column) => Boolean(column)) ?? []
50
+ });
51
+ const mapPartitionSample = (partition) => ({
52
+ values: partition.Values ?? [],
53
+ location: partition.StorageDescriptor?.Location,
54
+ creationTime: partition.CreationTime?.toISOString()
55
+ });
56
+ export class AwsGlueService {
57
+ client;
58
+ config;
59
+ constructor(client, config) {
60
+ this.client = client;
61
+ this.config = config;
62
+ }
63
+ async listWorkflows(limit = 25) {
64
+ try {
65
+ const response = await this.client.send(new ListWorkflowsCommand({ MaxResults: limit }));
66
+ return response.Workflows ?? [];
67
+ }
68
+ catch (error) {
69
+ throw this.wrapAwsError(error, "Unable to list workflows.");
70
+ }
71
+ }
72
+ async getWorkflow(name) {
73
+ try {
74
+ const response = await this.client.send(new GetWorkflowCommand({
75
+ Name: name,
76
+ IncludeGraph: true
77
+ }));
78
+ if (!response.Workflow) {
79
+ throw new ResourceNotFoundError(`Workflow "${name}" not found.`);
80
+ }
81
+ return mapWorkflow(response.Workflow);
82
+ }
83
+ catch (error) {
84
+ throw this.wrapAwsError(error, `Unable to get workflow "${name}".`);
85
+ }
86
+ }
87
+ async createWorkflow(input) {
88
+ if (input.dryRun ?? this.config.dryRunByDefault) {
89
+ return {
90
+ name: input.name,
91
+ description: input.description,
92
+ maxConcurrentRuns: input.maxConcurrentRuns,
93
+ defaultRunProperties: sanitizeProperties(input.defaultRunProperties),
94
+ graphSummary: { nodeCount: 0, edgeCount: 0 }
95
+ };
96
+ }
97
+ try {
98
+ await this.client.send(new CreateWorkflowCommand({
99
+ Name: input.name,
100
+ Description: input.description,
101
+ MaxConcurrentRuns: input.maxConcurrentRuns,
102
+ DefaultRunProperties: input.defaultRunProperties
103
+ }));
104
+ return this.getWorkflow(input.name);
105
+ }
106
+ catch (error) {
107
+ throw this.wrapAwsError(error, `Unable to create workflow "${input.name}".`);
108
+ }
109
+ }
110
+ async updateWorkflow(input) {
111
+ const current = await this.getWorkflow(input.name);
112
+ assertReadBeforeWrite(current, "workflow", input.name);
113
+ if (input.dryRun ?? this.config.dryRunByDefault) {
114
+ return {
115
+ ...current,
116
+ description: input.description ?? current.description,
117
+ maxConcurrentRuns: input.maxConcurrentRuns ?? current.maxConcurrentRuns,
118
+ defaultRunProperties: {
119
+ ...(current.defaultRunProperties ?? {}),
120
+ ...sanitizeProperties(input.defaultRunProperties)
121
+ }
122
+ };
123
+ }
124
+ try {
125
+ await this.client.send(new UpdateWorkflowCommand({
126
+ Name: input.name,
127
+ Description: input.description,
128
+ MaxConcurrentRuns: input.maxConcurrentRuns,
129
+ DefaultRunProperties: input.defaultRunProperties
130
+ }));
131
+ return this.getWorkflow(input.name);
132
+ }
133
+ catch (error) {
134
+ throw this.wrapAwsError(error, `Unable to update workflow "${input.name}".`);
135
+ }
136
+ }
137
+ async listTriggers(limit = 25) {
138
+ try {
139
+ const response = await this.client.send(new ListTriggersCommand({ MaxResults: limit }));
140
+ return response.TriggerNames ?? [];
141
+ }
142
+ catch (error) {
143
+ throw this.wrapAwsError(error, "Unable to list triggers.");
144
+ }
145
+ }
146
+ async getTrigger(name) {
147
+ try {
148
+ const response = await this.client.send(new GetTriggerCommand({ Name: name }));
149
+ if (!response.Trigger) {
150
+ throw new ResourceNotFoundError(`Trigger "${name}" not found.`);
151
+ }
152
+ return mapTrigger(response.Trigger);
153
+ }
154
+ catch (error) {
155
+ throw this.wrapAwsError(error, `Unable to get trigger "${name}".`);
156
+ }
157
+ }
158
+ async createTrigger(input) {
159
+ if ((input.dryRun ?? this.config.dryRunByDefault) && input.type === "EVENT") {
160
+ throw new UnsafeOperationError("Dry-run for EVENT trigger is blocked due to partial simulation risk.");
161
+ }
162
+ if (input.dryRun ?? this.config.dryRunByDefault) {
163
+ return {
164
+ name: input.name,
165
+ type: input.type,
166
+ workflowName: input.workflowName,
167
+ schedule: input.schedule,
168
+ description: input.description,
169
+ actionJobNames: input.actions.map((action) => action.JobName).filter((value) => Boolean(value)),
170
+ predicateSummary: input.predicate
171
+ ? {
172
+ logical: input.predicate.Logical,
173
+ conditions: input.predicate.Conditions?.length ?? 0
174
+ }
175
+ : undefined
176
+ };
177
+ }
178
+ try {
179
+ await this.client.send(new CreateTriggerCommand({
180
+ Name: input.name,
181
+ WorkflowName: input.workflowName,
182
+ Type: input.type,
183
+ Schedule: input.schedule,
184
+ Description: input.description,
185
+ StartOnCreation: input.startOnCreation,
186
+ Actions: [...input.actions],
187
+ Predicate: input.predicate
188
+ }));
189
+ return this.getTrigger(input.name);
190
+ }
191
+ catch (error) {
192
+ throw this.wrapAwsError(error, `Unable to create trigger "${input.name}".`);
193
+ }
194
+ }
195
+ async updateTrigger(input) {
196
+ const current = await this.getTrigger(input.name);
197
+ assertReadBeforeWrite(current, "trigger", input.name);
198
+ if (input.dryRun ?? this.config.dryRunByDefault) {
199
+ return {
200
+ ...current,
201
+ description: input.description ?? current.description,
202
+ schedule: input.schedule ?? current.schedule,
203
+ actionJobNames: input.actions?.map((action) => action.JobName).filter((name) => Boolean(name)) ??
204
+ current.actionJobNames,
205
+ predicateSummary: input.predicate
206
+ ? {
207
+ logical: input.predicate.Logical,
208
+ conditions: input.predicate.Conditions?.length ?? 0
209
+ }
210
+ : current.predicateSummary
211
+ };
212
+ }
213
+ try {
214
+ await this.client.send(new UpdateTriggerCommand({
215
+ Name: input.name,
216
+ TriggerUpdate: {
217
+ Schedule: input.schedule,
218
+ Description: input.description,
219
+ Actions: input.actions ? [...input.actions] : undefined,
220
+ Predicate: input.predicate
221
+ }
222
+ }));
223
+ return this.getTrigger(input.name);
224
+ }
225
+ catch (error) {
226
+ throw this.wrapAwsError(error, `Unable to update trigger "${input.name}".`);
227
+ }
228
+ }
229
+ async getCatalogTable(databaseName, tableName) {
230
+ try {
231
+ const response = await this.client.send(new GetTableCommand({
232
+ DatabaseName: databaseName,
233
+ Name: tableName
234
+ }));
235
+ if (!response.Table) {
236
+ throw new ResourceNotFoundError(`Catalog table "${databaseName}.${tableName}" not found.`);
237
+ }
238
+ return mapTable(response.Table);
239
+ }
240
+ catch (error) {
241
+ throw this.wrapAwsError(error, `Unable to get catalog table "${databaseName}.${tableName}".`);
242
+ }
243
+ }
244
+ async listCatalogTables(input) {
245
+ try {
246
+ const response = await this.client.send(new GetTablesCommand({
247
+ DatabaseName: input.databaseName,
248
+ Expression: input.expression,
249
+ MaxResults: input.maxResults ?? 25
250
+ }));
251
+ return (response.TableList ?? []).map((table) => mapTable(table));
252
+ }
253
+ catch (error) {
254
+ throw this.wrapAwsError(error, `Unable to list tables for database "${input.databaseName}".`);
255
+ }
256
+ }
257
+ async getCatalogPartitionsSample(input) {
258
+ try {
259
+ const response = await this.client.send(new GetPartitionsCommand({
260
+ DatabaseName: input.databaseName,
261
+ TableName: input.tableName,
262
+ Expression: input.expression,
263
+ MaxResults: input.sampleSize
264
+ }));
265
+ return (response.Partitions ?? []).slice(0, input.sampleSize).map((partition) => mapPartitionSample(partition));
266
+ }
267
+ catch (error) {
268
+ throw this.wrapAwsError(error, `Unable to sample partitions for "${input.databaseName}.${input.tableName}".`);
269
+ }
270
+ }
271
+ async explainPartitioning(databaseName, tableName, sampleSize) {
272
+ const table = await this.getCatalogTable(databaseName, tableName);
273
+ const samples = await this.getCatalogPartitionsSample({
274
+ databaseName,
275
+ tableName,
276
+ sampleSize
277
+ });
278
+ const partitionKeys = table.partitionKeys;
279
+ const sampleValues = samples.map((sample) => sample.values.join("/"));
280
+ const guidance = [];
281
+ if (partitionKeys.length === 0) {
282
+ guidance.push("Table has no partition keys; push_down_predicate is likely ineffective.");
283
+ }
284
+ else {
285
+ guidance.push(`Prefer predicates aligned with partition keys in order: ${partitionKeys.join(", ")}.`);
286
+ }
287
+ if (sampleValues.length > 0) {
288
+ guidance.push("Validate predicate shape against sampled partition values before running from_catalog loaders.");
289
+ }
290
+ else {
291
+ guidance.push("No partition sample available; validate Glue crawler/catalog freshness first.");
292
+ }
293
+ return {
294
+ databaseName,
295
+ tableName,
296
+ partitionKeys,
297
+ sampleCount: samples.length,
298
+ sampleValues,
299
+ guidance
300
+ };
301
+ }
302
+ wrapAwsError(error, message) {
303
+ const sanitized = toSanitizedError(error);
304
+ const code = error?.name;
305
+ if (code === "AccessDeniedException" || code === "UnrecognizedClientException") {
306
+ return new MissingAuthorizationError(message, {
307
+ reason: sanitizeMessage(sanitized.message)
308
+ });
309
+ }
310
+ if (code === "EntityNotFoundException") {
311
+ return new ResourceNotFoundError(message, {
312
+ reason: sanitizeMessage(sanitized.message)
313
+ });
314
+ }
315
+ return sanitized;
316
+ }
317
+ }
318
+ //# sourceMappingURL=glueService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glueService.js","sourceRoot":"","sources":["../../src/services/glueService.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EAGtB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEzE,MAAM,kBAAkB,GAAG,uDAAuD,CAAC;AAEnF,MAAM,kBAAkB,GAAG,CAAC,MAA0C,EAA0B,EAAE;IAChG,IAAI,CAAC,MAAM,E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AAE,CAAC;YAC5B,QAAQ,CAAC,IAAI,CACX,gGAAgG,CACjG,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAI,CAAC,+EAA+E,CAAC,CAAC;QACjG,CAAC;QAED,OAAO;YACL,YAAY;YACZ,SAAS;YACT,aAAa;YACb,WAAW,EAAE,OAAO,CAAC,MAAM;YAC3B,YAAY;YACZ,QAAQ;SACT,CAAC;IACJ,CAAC;IAEO,YAAY,CAAC,KAAc,EAAE,OAAe;QAClD,MAAM,SAAS,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,IAAI,GAAI,KAAuC,EAAE,IAAI,CAAC;QAC5D,IAAI,IAAI,KAAK,uBAAuB,IAAI,IAAI,KAAK,6BAA6B,EAAE,CAAC;YAC/E,OAAO,IAAI,yBAAyB,CAAC,OAAO,EAAE;gBAC5C,MAAM,EAAE,eAAe,CAAC,SAAS,CAAC,OAAO,CAAC;aAC3C,CAAC,CAAC;QACL,CAAC;QACD,IAAI,IAAI,KAAK,yBAAyB,EAAE,CAAC;YACvC,OAAO,IAAI,qBAAqB,CAAC,OAAO,EAAE;gBACxC,MAAM,EAAE,eAAe,CAAC,SAAS,CAAC,OAAO,CAAC;aAC3C,CAAC,CAAC;QACL,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ import type { ToolDefinition } from "../../domain/contracts.js";
2
+ export declare const getCatalogTableTool: ToolDefinition<unknown>;
3
+ export declare const listCatalogTablesTool: ToolDefinition<unknown>;
4
+ export declare const getCatalogPartitionsSampleTool: ToolDefinition<unknown>;
5
+ export declare const explainPartitioningTool: ToolDefinition<unknown>;
6
+ export declare const catalogTools: readonly [ToolDefinition<unknown>, ToolDefinition<unknown>, ToolDefinition<unknown>, ToolDefinition<unknown>];