@infracraft/pulumi 1.10.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.
- package/dist/agents/hint.cjs +7 -5
- package/dist/agents/hint.cjs.map +1 -1
- package/dist/agents/hint.d.cts +7 -5
- package/dist/agents/hint.d.cts.map +1 -1
- package/dist/agents/hint.d.mts +7 -5
- package/dist/agents/hint.d.mts.map +1 -1
- package/dist/agents/hint.mjs +7 -5
- package/dist/agents/hint.mjs.map +1 -1
- package/dist/agents/index.cjs +4 -0
- package/dist/agents/index.d.cts +2 -0
- package/dist/agents/index.d.mts +2 -0
- package/dist/agents/index.mjs +3 -0
- package/package.json +4 -4
package/dist/agents/hint.cjs
CHANGED
|
@@ -26,15 +26,17 @@ const INFRACRAFT_DEFAULTS = [
|
|
|
26
26
|
* @returns Nothing; emits to the chosen channel as a side effect.
|
|
27
27
|
* @example
|
|
28
28
|
* ```typescript
|
|
29
|
-
*
|
|
29
|
+
* import * as agents from "@infracraft/pulumi/agents";
|
|
30
|
+
*
|
|
31
|
+
* agents.hint({
|
|
30
32
|
* project: [
|
|
31
|
-
* "
|
|
32
|
-
* "
|
|
33
|
+
* "Production is protected — `unprotect <urn>` first for a deliberate change",
|
|
34
|
+
* "Feature env = imports:[staging], zero config; pulumi destroy is safe",
|
|
33
35
|
* ],
|
|
34
36
|
* });
|
|
35
37
|
* ```
|
|
36
38
|
*/
|
|
37
|
-
function
|
|
39
|
+
function hint(options = {}) {
|
|
38
40
|
if (!(options.enabled ?? (!!process.env.CLAUDECODE || !!process.env.AI_AGENT))) return;
|
|
39
41
|
const block = [
|
|
40
42
|
"<infracraft-hint>",
|
|
@@ -47,5 +49,5 @@ function agentHint(options = {}) {
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
//#endregion
|
|
50
|
-
exports.
|
|
52
|
+
exports.hint = hint;
|
|
51
53
|
//# sourceMappingURL=hint.cjs.map
|
package/dist/agents/hint.cjs.map
CHANGED
|
@@ -1 +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 *
|
|
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"}
|
package/dist/agents/hint.d.cts
CHANGED
|
@@ -31,15 +31,17 @@ interface AgentHintOptions {
|
|
|
31
31
|
* @returns Nothing; emits to the chosen channel as a side effect.
|
|
32
32
|
* @example
|
|
33
33
|
* ```typescript
|
|
34
|
-
*
|
|
34
|
+
* import * as agents from "@infracraft/pulumi/agents";
|
|
35
|
+
*
|
|
36
|
+
* agents.hint({
|
|
35
37
|
* project: [
|
|
36
|
-
* "
|
|
37
|
-
* "
|
|
38
|
+
* "Production is protected — `unprotect <urn>` first for a deliberate change",
|
|
39
|
+
* "Feature env = imports:[staging], zero config; pulumi destroy is safe",
|
|
38
40
|
* ],
|
|
39
41
|
* });
|
|
40
42
|
* ```
|
|
41
43
|
*/
|
|
42
|
-
declare function
|
|
44
|
+
declare function hint(options?: AgentHintOptions): void;
|
|
43
45
|
//#endregion
|
|
44
|
-
export { AgentHintOptions,
|
|
46
|
+
export { AgentHintOptions, hint };
|
|
45
47
|
//# sourceMappingURL=hint.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hint.d.cts","names":[],"sources":["../../src/agents/hint.ts"],"mappings":";;;;UAaiB,gBAAA;;EAEhB,OAAA;EAFgC;;;;EAQhC,OAAA;EAQA;;AAAO;
|
|
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"}
|
package/dist/agents/hint.d.mts
CHANGED
|
@@ -31,15 +31,17 @@ interface AgentHintOptions {
|
|
|
31
31
|
* @returns Nothing; emits to the chosen channel as a side effect.
|
|
32
32
|
* @example
|
|
33
33
|
* ```typescript
|
|
34
|
-
*
|
|
34
|
+
* import * as agents from "@infracraft/pulumi/agents";
|
|
35
|
+
*
|
|
36
|
+
* agents.hint({
|
|
35
37
|
* project: [
|
|
36
|
-
* "
|
|
37
|
-
* "
|
|
38
|
+
* "Production is protected — `unprotect <urn>` first for a deliberate change",
|
|
39
|
+
* "Feature env = imports:[staging], zero config; pulumi destroy is safe",
|
|
38
40
|
* ],
|
|
39
41
|
* });
|
|
40
42
|
* ```
|
|
41
43
|
*/
|
|
42
|
-
declare function
|
|
44
|
+
declare function hint(options?: AgentHintOptions): void;
|
|
43
45
|
//#endregion
|
|
44
|
-
export { AgentHintOptions,
|
|
46
|
+
export { AgentHintOptions, hint };
|
|
45
47
|
//# sourceMappingURL=hint.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hint.d.mts","names":[],"sources":["../../src/agents/hint.ts"],"mappings":";;;;UAaiB,gBAAA;;EAEhB,OAAA;EAFgC;;;;EAQhC,OAAA;EAQA;;AAAO;
|
|
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"}
|
package/dist/agents/hint.mjs
CHANGED
|
@@ -24,15 +24,17 @@ const INFRACRAFT_DEFAULTS = [
|
|
|
24
24
|
* @returns Nothing; emits to the chosen channel as a side effect.
|
|
25
25
|
* @example
|
|
26
26
|
* ```typescript
|
|
27
|
-
*
|
|
27
|
+
* import * as agents from "@infracraft/pulumi/agents";
|
|
28
|
+
*
|
|
29
|
+
* agents.hint({
|
|
28
30
|
* project: [
|
|
29
|
-
* "
|
|
30
|
-
* "
|
|
31
|
+
* "Production is protected — `unprotect <urn>` first for a deliberate change",
|
|
32
|
+
* "Feature env = imports:[staging], zero config; pulumi destroy is safe",
|
|
31
33
|
* ],
|
|
32
34
|
* });
|
|
33
35
|
* ```
|
|
34
36
|
*/
|
|
35
|
-
function
|
|
37
|
+
function hint(options = {}) {
|
|
36
38
|
if (!(options.enabled ?? (!!process.env.CLAUDECODE || !!process.env.AI_AGENT))) return;
|
|
37
39
|
const block = [
|
|
38
40
|
"<infracraft-hint>",
|
|
@@ -45,5 +47,5 @@ function agentHint(options = {}) {
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
//#endregion
|
|
48
|
-
export {
|
|
50
|
+
export { hint };
|
|
49
51
|
//# sourceMappingURL=hint.mjs.map
|
package/dist/agents/hint.mjs.map
CHANGED
|
@@ -1 +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 *
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infracraft/pulumi",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"types": "./dist/fly/index.d.mts",
|
|
26
26
|
"default": "./dist/fly/index.mjs"
|
|
27
27
|
},
|
|
28
|
-
"./agents
|
|
29
|
-
"types": "./dist/agents/
|
|
30
|
-
"default": "./dist/agents/
|
|
28
|
+
"./agents": {
|
|
29
|
+
"types": "./dist/agents/index.d.mts",
|
|
30
|
+
"default": "./dist/agents/index.mjs"
|
|
31
31
|
},
|
|
32
32
|
"./hash": {
|
|
33
33
|
"types": "./dist/hash.d.mts",
|