@infracraft/pulumi 1.9.0 → 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.
@@ -0,0 +1,53 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_chunk = require('../chunk-BVYJZCqc.cjs');
3
+ let _pulumi_pulumi = require("@pulumi/pulumi");
4
+ _pulumi_pulumi = require_chunk.__toESM(_pulumi_pulumi, 1);
5
+
6
+ //#region src/agents/hint.ts
7
+ /**
8
+ * Generic infracraft reminders, prepended to every hint. These hold for any
9
+ * infracraft stack regardless of the consuming project.
10
+ */
11
+ const INFRACRAFT_DEFAULTS = [
12
+ "Adopt-or-create: re-running is safe — existing resources are adopted, missing ones created",
13
+ "Shared resources (Railway services/projects, Neon projects) have no-op deletes — destroy never removes them",
14
+ "Mark shared/production resources protect:true — pulumi destroy aborts on protected resources"
15
+ ];
16
+ /**
17
+ * Emits a delimited `<infracraft-hint>` block of reminders for AI coding agents
18
+ * operating this Pulumi stack — modeled on Vercel's `AGENTS.md` guidance: a
19
+ * delimited block, an agent-directed intro, then terse directive bullets.
20
+ *
21
+ * No-op for humans (no agent env var) unless `enabled` is forced. Call it once at
22
+ * the top of your Pulumi program; the infracraft defaults are always included and
23
+ * `project` lines are appended.
24
+ *
25
+ * @param options Project reminders, channel, and detection override.
26
+ * @returns Nothing; emits to the chosen channel as a side effect.
27
+ * @example
28
+ * ```typescript
29
+ * import * as agents from "@infracraft/pulumi/agents";
30
+ *
31
+ * agents.hint({
32
+ * project: [
33
+ * "Production is protected — `unprotect <urn>` first for a deliberate change",
34
+ * "Feature env = imports:[staging], zero config; pulumi destroy is safe",
35
+ * ],
36
+ * });
37
+ * ```
38
+ */
39
+ function hint(options = {}) {
40
+ if (!(options.enabled ?? (!!process.env.CLAUDECODE || !!process.env.AI_AGENT))) return;
41
+ const block = [
42
+ "<infracraft-hint>",
43
+ "Reminders for AI agents operating this Pulumi stack:",
44
+ ...[...INFRACRAFT_DEFAULTS, ...options.project ?? []].map((line) => `- ${line}`),
45
+ "</infracraft-hint>"
46
+ ].join("\n");
47
+ if (options.channel === "pulumi-log") _pulumi_pulumi.log.info(block);
48
+ else process.stderr.write(`${block}\n`);
49
+ }
50
+
51
+ //#endregion
52
+ exports.hint = hint;
53
+ //# sourceMappingURL=hint.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hint.cjs","names":[],"sources":["../../src/agents/hint.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\n\n/**\n * Generic infracraft reminders, prepended to every hint. These hold for any\n * infracraft stack regardless of the consuming project.\n */\nconst INFRACRAFT_DEFAULTS = [\n\t\"Adopt-or-create: re-running is safe — existing resources are adopted, missing ones created\",\n\t\"Shared resources (Railway services/projects, Neon projects) have no-op deletes — destroy never removes them\",\n\t\"Mark shared/production resources protect:true — pulumi destroy aborts on protected resources\",\n];\n\n/** Options for {@link agentHint}. */\nexport interface AgentHintOptions {\n\t/** Project-specific reminders appended after the infracraft defaults. */\n\tproject?: string[];\n\n\t/**\n\t * Force the hint on or off. Defaults to auto-detecting an AI coding agent via\n\t * the `CLAUDECODE` / `AI_AGENT` environment variables.\n\t */\n\tenabled?: boolean;\n\n\t/**\n\t * Where to write the hint. `\"stderr\"` (default) prints it prominently the\n\t * instant the program loads, before Pulumi's own output — modeled on how the\n\t * Vercel CLI surfaces agent guidance. `\"pulumi-log\"` routes it through\n\t * `pulumi.log.info` (lands in the Diagnostics section instead).\n\t */\n\tchannel?: \"stderr\" | \"pulumi-log\";\n}\n\n/**\n * Emits a delimited `<infracraft-hint>` block of reminders for AI coding agents\n * operating this Pulumi stack — modeled on Vercel's `AGENTS.md` guidance: a\n * delimited block, an agent-directed intro, then terse directive bullets.\n *\n * No-op for humans (no agent env var) unless `enabled` is forced. Call it once at\n * the top of your Pulumi program; the infracraft defaults are always included and\n * `project` lines are appended.\n *\n * @param options Project reminders, channel, and detection override.\n * @returns Nothing; emits to the chosen channel as a side effect.\n * @example\n * ```typescript\n * import * as agents from \"@infracraft/pulumi/agents\";\n *\n * agents.hint({\n * project: [\n * \"Production is protected — `unprotect <urn>` first for a deliberate change\",\n * \"Feature env = imports:[staging], zero config; pulumi destroy is safe\",\n * ],\n * });\n * ```\n */\nexport function hint(options: AgentHintOptions = {}): void {\n\tconst enabled =\n\t\toptions.enabled ?? (!!process.env.CLAUDECODE || !!process.env.AI_AGENT);\n\n\tif (!enabled) {\n\t\treturn;\n\t}\n\n\tconst lines = [...INFRACRAFT_DEFAULTS, ...(options.project ?? [])];\n\n\tconst block = [\n\t\t\"<infracraft-hint>\",\n\t\t\"Reminders for AI agents operating this Pulumi stack:\",\n\t\t...lines.map((line) => `- ${line}`),\n\t\t\"</infracraft-hint>\",\n\t].join(\"\\n\");\n\n\tif (options.channel === \"pulumi-log\") {\n\t\tpulumi.log.info(block);\n\t} else {\n\t\tprocess.stderr.write(`${block}\\n`);\n\t}\n}\n"],"mappings":";;;;;;;;;;AAMA,MAAM,sBAAsB;CAC3B;CACA;CACA;AACD;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,SAAgB,KAAK,UAA4B,CAAC,GAAS;CAI1D,IAAI,EAFH,QAAQ,YAAY,CAAC,CAAC,QAAQ,IAAI,cAAc,CAAC,CAAC,QAAQ,IAAI,YAG9D;CAKD,MAAM,QAAQ;EACb;EACA;EACA,GAAG,CALW,GAAG,qBAAqB,GAAI,QAAQ,WAAW,CAAC,CAKvD,EAAE,KAAK,SAAS,KAAK,MAAM;EAClC;CACD,EAAE,KAAK,IAAI;CAEX,IAAI,QAAQ,YAAY,cACvB,eAAO,IAAI,KAAK,KAAK;MAErB,QAAQ,OAAO,MAAM,GAAG,MAAM,GAAG;AAEnC"}
@@ -0,0 +1,47 @@
1
+ import { t as __name } from "../chunk-OPjESj5l.cjs";
2
+
3
+ //#region src/agents/hint.d.ts
4
+ /** Options for {@link agentHint}. */
5
+ interface AgentHintOptions {
6
+ /** Project-specific reminders appended after the infracraft defaults. */
7
+ project?: string[];
8
+ /**
9
+ * Force the hint on or off. Defaults to auto-detecting an AI coding agent via
10
+ * the `CLAUDECODE` / `AI_AGENT` environment variables.
11
+ */
12
+ enabled?: boolean;
13
+ /**
14
+ * Where to write the hint. `"stderr"` (default) prints it prominently the
15
+ * instant the program loads, before Pulumi's own output — modeled on how the
16
+ * Vercel CLI surfaces agent guidance. `"pulumi-log"` routes it through
17
+ * `pulumi.log.info` (lands in the Diagnostics section instead).
18
+ */
19
+ channel?: "stderr" | "pulumi-log";
20
+ }
21
+ /**
22
+ * Emits a delimited `<infracraft-hint>` block of reminders for AI coding agents
23
+ * operating this Pulumi stack — modeled on Vercel's `AGENTS.md` guidance: a
24
+ * delimited block, an agent-directed intro, then terse directive bullets.
25
+ *
26
+ * No-op for humans (no agent env var) unless `enabled` is forced. Call it once at
27
+ * the top of your Pulumi program; the infracraft defaults are always included and
28
+ * `project` lines are appended.
29
+ *
30
+ * @param options Project reminders, channel, and detection override.
31
+ * @returns Nothing; emits to the chosen channel as a side effect.
32
+ * @example
33
+ * ```typescript
34
+ * import * as agents from "@infracraft/pulumi/agents";
35
+ *
36
+ * agents.hint({
37
+ * project: [
38
+ * "Production is protected — `unprotect <urn>` first for a deliberate change",
39
+ * "Feature env = imports:[staging], zero config; pulumi destroy is safe",
40
+ * ],
41
+ * });
42
+ * ```
43
+ */
44
+ declare function hint(options?: AgentHintOptions): void;
45
+ //#endregion
46
+ export { AgentHintOptions, hint };
47
+ //# sourceMappingURL=hint.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hint.d.cts","names":[],"sources":["../../src/agents/hint.ts"],"mappings":";;;;UAaiB,gBAAA;;EAEhB,OAAA;EAFgC;;;;EAQhC,OAAA;EAQA;;AAAO;AA0BR;;;EA1BC,OAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;iBA0Be,IAAA,CAAK,OAA8B,GAArB,gBAAqB"}
@@ -0,0 +1,47 @@
1
+ import { t as __name } from "../chunk-OPjESj5l.mjs";
2
+
3
+ //#region src/agents/hint.d.ts
4
+ /** Options for {@link agentHint}. */
5
+ interface AgentHintOptions {
6
+ /** Project-specific reminders appended after the infracraft defaults. */
7
+ project?: string[];
8
+ /**
9
+ * Force the hint on or off. Defaults to auto-detecting an AI coding agent via
10
+ * the `CLAUDECODE` / `AI_AGENT` environment variables.
11
+ */
12
+ enabled?: boolean;
13
+ /**
14
+ * Where to write the hint. `"stderr"` (default) prints it prominently the
15
+ * instant the program loads, before Pulumi's own output — modeled on how the
16
+ * Vercel CLI surfaces agent guidance. `"pulumi-log"` routes it through
17
+ * `pulumi.log.info` (lands in the Diagnostics section instead).
18
+ */
19
+ channel?: "stderr" | "pulumi-log";
20
+ }
21
+ /**
22
+ * Emits a delimited `<infracraft-hint>` block of reminders for AI coding agents
23
+ * operating this Pulumi stack — modeled on Vercel's `AGENTS.md` guidance: a
24
+ * delimited block, an agent-directed intro, then terse directive bullets.
25
+ *
26
+ * No-op for humans (no agent env var) unless `enabled` is forced. Call it once at
27
+ * the top of your Pulumi program; the infracraft defaults are always included and
28
+ * `project` lines are appended.
29
+ *
30
+ * @param options Project reminders, channel, and detection override.
31
+ * @returns Nothing; emits to the chosen channel as a side effect.
32
+ * @example
33
+ * ```typescript
34
+ * import * as agents from "@infracraft/pulumi/agents";
35
+ *
36
+ * agents.hint({
37
+ * project: [
38
+ * "Production is protected — `unprotect <urn>` first for a deliberate change",
39
+ * "Feature env = imports:[staging], zero config; pulumi destroy is safe",
40
+ * ],
41
+ * });
42
+ * ```
43
+ */
44
+ declare function hint(options?: AgentHintOptions): void;
45
+ //#endregion
46
+ export { AgentHintOptions, hint };
47
+ //# sourceMappingURL=hint.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hint.d.mts","names":[],"sources":["../../src/agents/hint.ts"],"mappings":";;;;UAaiB,gBAAA;;EAEhB,OAAA;EAFgC;;;;EAQhC,OAAA;EAQA;;AAAO;AA0BR;;;EA1BC,OAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;iBA0Be,IAAA,CAAK,OAA8B,GAArB,gBAAqB"}
@@ -0,0 +1,51 @@
1
+ import { t as __name } from "../chunk-OPjESj5l.mjs";
2
+ import * as pulumi from "@pulumi/pulumi";
3
+
4
+ //#region src/agents/hint.ts
5
+ /**
6
+ * Generic infracraft reminders, prepended to every hint. These hold for any
7
+ * infracraft stack regardless of the consuming project.
8
+ */
9
+ const INFRACRAFT_DEFAULTS = [
10
+ "Adopt-or-create: re-running is safe — existing resources are adopted, missing ones created",
11
+ "Shared resources (Railway services/projects, Neon projects) have no-op deletes — destroy never removes them",
12
+ "Mark shared/production resources protect:true — pulumi destroy aborts on protected resources"
13
+ ];
14
+ /**
15
+ * Emits a delimited `<infracraft-hint>` block of reminders for AI coding agents
16
+ * operating this Pulumi stack — modeled on Vercel's `AGENTS.md` guidance: a
17
+ * delimited block, an agent-directed intro, then terse directive bullets.
18
+ *
19
+ * No-op for humans (no agent env var) unless `enabled` is forced. Call it once at
20
+ * the top of your Pulumi program; the infracraft defaults are always included and
21
+ * `project` lines are appended.
22
+ *
23
+ * @param options Project reminders, channel, and detection override.
24
+ * @returns Nothing; emits to the chosen channel as a side effect.
25
+ * @example
26
+ * ```typescript
27
+ * import * as agents from "@infracraft/pulumi/agents";
28
+ *
29
+ * agents.hint({
30
+ * project: [
31
+ * "Production is protected — `unprotect <urn>` first for a deliberate change",
32
+ * "Feature env = imports:[staging], zero config; pulumi destroy is safe",
33
+ * ],
34
+ * });
35
+ * ```
36
+ */
37
+ function hint(options = {}) {
38
+ if (!(options.enabled ?? (!!process.env.CLAUDECODE || !!process.env.AI_AGENT))) return;
39
+ const block = [
40
+ "<infracraft-hint>",
41
+ "Reminders for AI agents operating this Pulumi stack:",
42
+ ...[...INFRACRAFT_DEFAULTS, ...options.project ?? []].map((line) => `- ${line}`),
43
+ "</infracraft-hint>"
44
+ ].join("\n");
45
+ if (options.channel === "pulumi-log") pulumi.log.info(block);
46
+ else process.stderr.write(`${block}\n`);
47
+ }
48
+
49
+ //#endregion
50
+ export { hint };
51
+ //# sourceMappingURL=hint.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hint.mjs","names":[],"sources":["../../src/agents/hint.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\n\n/**\n * Generic infracraft reminders, prepended to every hint. These hold for any\n * infracraft stack regardless of the consuming project.\n */\nconst INFRACRAFT_DEFAULTS = [\n\t\"Adopt-or-create: re-running is safe — existing resources are adopted, missing ones created\",\n\t\"Shared resources (Railway services/projects, Neon projects) have no-op deletes — destroy never removes them\",\n\t\"Mark shared/production resources protect:true — pulumi destroy aborts on protected resources\",\n];\n\n/** Options for {@link agentHint}. */\nexport interface AgentHintOptions {\n\t/** Project-specific reminders appended after the infracraft defaults. */\n\tproject?: string[];\n\n\t/**\n\t * Force the hint on or off. Defaults to auto-detecting an AI coding agent via\n\t * the `CLAUDECODE` / `AI_AGENT` environment variables.\n\t */\n\tenabled?: boolean;\n\n\t/**\n\t * Where to write the hint. `\"stderr\"` (default) prints it prominently the\n\t * instant the program loads, before Pulumi's own output — modeled on how the\n\t * Vercel CLI surfaces agent guidance. `\"pulumi-log\"` routes it through\n\t * `pulumi.log.info` (lands in the Diagnostics section instead).\n\t */\n\tchannel?: \"stderr\" | \"pulumi-log\";\n}\n\n/**\n * Emits a delimited `<infracraft-hint>` block of reminders for AI coding agents\n * operating this Pulumi stack — modeled on Vercel's `AGENTS.md` guidance: a\n * delimited block, an agent-directed intro, then terse directive bullets.\n *\n * No-op for humans (no agent env var) unless `enabled` is forced. Call it once at\n * the top of your Pulumi program; the infracraft defaults are always included and\n * `project` lines are appended.\n *\n * @param options Project reminders, channel, and detection override.\n * @returns Nothing; emits to the chosen channel as a side effect.\n * @example\n * ```typescript\n * import * as agents from \"@infracraft/pulumi/agents\";\n *\n * agents.hint({\n * project: [\n * \"Production is protected — `unprotect <urn>` first for a deliberate change\",\n * \"Feature env = imports:[staging], zero config; pulumi destroy is safe\",\n * ],\n * });\n * ```\n */\nexport function hint(options: AgentHintOptions = {}): void {\n\tconst enabled =\n\t\toptions.enabled ?? (!!process.env.CLAUDECODE || !!process.env.AI_AGENT);\n\n\tif (!enabled) {\n\t\treturn;\n\t}\n\n\tconst lines = [...INFRACRAFT_DEFAULTS, ...(options.project ?? [])];\n\n\tconst block = [\n\t\t\"<infracraft-hint>\",\n\t\t\"Reminders for AI agents operating this Pulumi stack:\",\n\t\t...lines.map((line) => `- ${line}`),\n\t\t\"</infracraft-hint>\",\n\t].join(\"\\n\");\n\n\tif (options.channel === \"pulumi-log\") {\n\t\tpulumi.log.info(block);\n\t} else {\n\t\tprocess.stderr.write(`${block}\\n`);\n\t}\n}\n"],"mappings":";;;;;;;;AAMA,MAAM,sBAAsB;CAC3B;CACA;CACA;AACD;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,SAAgB,KAAK,UAA4B,CAAC,GAAS;CAI1D,IAAI,EAFH,QAAQ,YAAY,CAAC,CAAC,QAAQ,IAAI,cAAc,CAAC,CAAC,QAAQ,IAAI,YAG9D;CAKD,MAAM,QAAQ;EACb;EACA;EACA,GAAG,CALW,GAAG,qBAAqB,GAAI,QAAQ,WAAW,CAAC,CAKvD,EAAE,KAAK,SAAS,KAAK,MAAM;EAClC;CACD,EAAE,KAAK,IAAI;CAEX,IAAI,QAAQ,YAAY,cACvB,OAAO,IAAI,KAAK,KAAK;MAErB,QAAQ,OAAO,MAAM,GAAG,MAAM,GAAG;AAEnC"}
@@ -0,0 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_agents_hint = require('./hint.cjs');
3
+
4
+ exports.hint = require_agents_hint.hint;
@@ -0,0 +1,2 @@
1
+ import { AgentHintOptions, hint } from "./hint.cjs";
2
+ export { type AgentHintOptions, hint };
@@ -0,0 +1,2 @@
1
+ import { AgentHintOptions, hint } from "./hint.mjs";
2
+ export { type AgentHintOptions, hint };
@@ -0,0 +1,3 @@
1
+ import { hint } from "./hint.mjs";
2
+
3
+ export { hint };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infracraft/pulumi",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -25,6 +25,10 @@
25
25
  "types": "./dist/fly/index.d.mts",
26
26
  "default": "./dist/fly/index.mjs"
27
27
  },
28
+ "./agents": {
29
+ "types": "./dist/agents/index.d.mts",
30
+ "default": "./dist/agents/index.mjs"
31
+ },
28
32
  "./hash": {
29
33
  "types": "./dist/hash.d.mts",
30
34
  "default": "./dist/hash.mjs"