@infracraft/pulumi 1.9.0 → 1.10.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/dist/agents/hint.cjs +51 -0
- package/dist/agents/hint.cjs.map +1 -0
- package/dist/agents/hint.d.cts +45 -0
- package/dist/agents/hint.d.cts.map +1 -0
- package/dist/agents/hint.d.mts +45 -0
- package/dist/agents/hint.d.mts.map +1 -0
- package/dist/agents/hint.mjs +49 -0
- package/dist/agents/hint.mjs.map +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
* agentHint({
|
|
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 agentHint(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_pulumi.log.info(block);
|
|
46
|
+
else process.stderr.write(`${block}\n`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
exports.agentHint = agentHint;
|
|
51
|
+
//# 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 * agentHint({\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 agentHint(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;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,UAAU,UAA4B,CAAC,GAAS;CAI/D,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,45 @@
|
|
|
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
|
+
* agentHint({
|
|
35
|
+
* project: [
|
|
36
|
+
* "production is protected — `unprotect <urn>` first for a deliberate change",
|
|
37
|
+
* "feature env = imports:[staging], zero config; pulumi destroy is safe",
|
|
38
|
+
* ],
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function agentHint(options?: AgentHintOptions): void;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { AgentHintOptions, agentHint };
|
|
45
|
+
//# 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;AAwBR;;;EAxBC,OAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;iBAwBe,SAAA,CAAU,OAA8B,GAArB,gBAAqB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
* agentHint({
|
|
35
|
+
* project: [
|
|
36
|
+
* "production is protected — `unprotect <urn>` first for a deliberate change",
|
|
37
|
+
* "feature env = imports:[staging], zero config; pulumi destroy is safe",
|
|
38
|
+
* ],
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function agentHint(options?: AgentHintOptions): void;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { AgentHintOptions, agentHint };
|
|
45
|
+
//# 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;AAwBR;;;EAxBC,OAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;iBAwBe,SAAA,CAAU,OAA8B,GAArB,gBAAqB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
* agentHint({
|
|
28
|
+
* project: [
|
|
29
|
+
* "production is protected — `unprotect <urn>` first for a deliberate change",
|
|
30
|
+
* "feature env = imports:[staging], zero config; pulumi destroy is safe",
|
|
31
|
+
* ],
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
function agentHint(options = {}) {
|
|
36
|
+
if (!(options.enabled ?? (!!process.env.CLAUDECODE || !!process.env.AI_AGENT))) return;
|
|
37
|
+
const block = [
|
|
38
|
+
"<infracraft-hint>",
|
|
39
|
+
"Reminders for AI agents operating this Pulumi stack:",
|
|
40
|
+
...[...INFRACRAFT_DEFAULTS, ...options.project ?? []].map((line) => `- ${line}`),
|
|
41
|
+
"</infracraft-hint>"
|
|
42
|
+
].join("\n");
|
|
43
|
+
if (options.channel === "pulumi-log") pulumi.log.info(block);
|
|
44
|
+
else process.stderr.write(`${block}\n`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { agentHint };
|
|
49
|
+
//# 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 * agentHint({\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 agentHint(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;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,UAAU,UAA4B,CAAC,GAAS;CAI/D,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infracraft/pulumi",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.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/hint": {
|
|
29
|
+
"types": "./dist/agents/hint.d.mts",
|
|
30
|
+
"default": "./dist/agents/hint.mjs"
|
|
31
|
+
},
|
|
28
32
|
"./hash": {
|
|
29
33
|
"types": "./dist/hash.d.mts",
|
|
30
34
|
"default": "./dist/hash.mjs"
|