@kinotic-ai/spawn 0.1.0 → 0.2.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/index.cjs CHANGED
@@ -110,6 +110,7 @@ class SpawnEngine {
110
110
  let context = { ...globals, ...options?.context };
111
111
  context = await this.resolveMissingProperties(propertySchemas, context, options?.propertyResolver);
112
112
  const files = {};
113
+ const sources = {};
113
114
  for (const tree of [...trees].reverse()) {
114
115
  for (const source of Object.keys(tree).sort()) {
115
116
  const fileName = source.substring(source.lastIndexOf("/") + 1);
@@ -129,9 +130,10 @@ class SpawnEngine {
129
130
  content = await this.engine.parseAndRender(content, context);
130
131
  }
131
132
  files[destination] = content;
133
+ sources[destination] = source;
132
134
  }
133
135
  }
134
- return { files, context };
136
+ return { files, sources, context };
135
137
  }
136
138
  parseConfig(tree) {
137
139
  const raw = tree["spawn.json"];
package/dist/index.d.cts CHANGED
@@ -71,6 +71,13 @@ interface SpawnRenderResult {
71
71
  */
72
72
  files: SpawnTree;
73
73
  /**
74
+ * The originating spawn path for each rendered file, keyed by the same
75
+ * destination path used in {@link files}. Lets a host trace a rendered file
76
+ * back to its template entry to recover source metadata (e.g. the executable
77
+ * bit) that the destination path alone cannot convey.
78
+ */
79
+ sources: Record<string, string>;
80
+ /**
74
81
  * The full context the templates were rendered with: merged globals,
75
82
  * caller-provided values, and any values supplied by the property resolver.
76
83
  */
package/dist/index.d.ts CHANGED
@@ -71,6 +71,13 @@ interface SpawnRenderResult {
71
71
  */
72
72
  files: SpawnTree;
73
73
  /**
74
+ * The originating spawn path for each rendered file, keyed by the same
75
+ * destination path used in {@link files}. Lets a host trace a rendered file
76
+ * back to its template entry to recover source metadata (e.g. the executable
77
+ * bit) that the destination path alone cannot convey.
78
+ */
79
+ sources: Record<string, string>;
80
+ /**
74
81
  * The full context the templates were rendered with: merged globals,
75
82
  * caller-provided values, and any values supplied by the property resolver.
76
83
  */
package/dist/index.js CHANGED
@@ -64,6 +64,7 @@ class SpawnEngine {
64
64
  let context = { ...globals, ...options?.context };
65
65
  context = await this.resolveMissingProperties(propertySchemas, context, options?.propertyResolver);
66
66
  const files = {};
67
+ const sources = {};
67
68
  for (const tree of [...trees].reverse()) {
68
69
  for (const source of Object.keys(tree).sort()) {
69
70
  const fileName = source.substring(source.lastIndexOf("/") + 1);
@@ -83,9 +84,10 @@ class SpawnEngine {
83
84
  content = await this.engine.parseAndRender(content, context);
84
85
  }
85
86
  files[destination] = content;
87
+ sources[destination] = source;
86
88
  }
87
89
  }
88
- return { files, context };
90
+ return { files, sources, context };
89
91
  }
90
92
  parseConfig(tree) {
91
93
  const raw = tree["spawn.json"];