opencode-snippets 1.8.0 → 1.8.1

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/README.md CHANGED
@@ -359,7 +359,7 @@ A default config file is created automatically on first run.
359
359
 
360
360
  ```jsonc
361
361
  {
362
- "$schema": "https://raw.githubusercontent.com/JosXa/opencode-snippets/v1.8.0/schema/config.schema.json",
362
+ "$schema": "https://raw.githubusercontent.com/JosXa/opencode-snippets/v1.8.1/schema/config.schema.json",
363
363
  "logging": {
364
364
  "debug": false // Enable debug logging (logs: ~/.config/opencode/logs/snippets/daily/)
365
365
  },
@@ -22,7 +22,7 @@ const DEFAULT_CONFIG = {
22
22
  */
23
23
  const DEFAULT_CONFIG_CONTENT = `{
24
24
  // JSON Schema for editor autocompletion
25
- "$schema": "https://raw.githubusercontent.com/JosXa/opencode-snippets/v1.8.0/schema/config.schema.json",
25
+ "$schema": "https://raw.githubusercontent.com/JosXa/opencode-snippets/v1.8.1/schema/config.schema.json",
26
26
 
27
27
  // Logging settings
28
28
  "logging": {
@@ -9,9 +9,14 @@
9
9
  export type ShellContext = {
10
10
  $: (template: TemplateStringsArray, ...args: unknown[]) => {
11
11
  quiet: () => {
12
- nothrow: () => {
13
- text: () => Promise<string>;
14
- };
12
+ nothrow: () => Promise<{
13
+ stdout: {
14
+ toString: () => string;
15
+ };
16
+ stderr: {
17
+ toString: () => string;
18
+ };
19
+ }>;
15
20
  };
16
21
  };
17
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/shell.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,EAAE,CACD,QAAQ,EAAE,oBAAoB,EAC9B,GAAG,IAAI,EAAE,OAAO,EAAE,KACf;QACH,KAAK,EAAE,MAAM;YAAE,OAAO,EAAE,MAAM;gBAAE,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;aAAE,CAAA;SAAE,CAAC;KACjE,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,YAAY,EACjB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,MAAM,CAAC,CA8BjB"}
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/shell.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,EAAE,CACD,QAAQ,EAAE,oBAAoB,EAC9B,GAAG,IAAI,EAAE,OAAO,EAAE,KACf;QACH,KAAK,EAAE,MAAM;YACX,OAAO,EAAE,MAAM,OAAO,CAAC;gBACrB,MAAM,EAAE;oBAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;iBAAE,CAAC;gBACnC,MAAM,EAAE;oBAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;iBAAE,CAAC;aACpC,CAAC,CAAC;SACJ,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,YAAY,EACjB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,MAAM,CAAC,CA+BjB"}
package/dist/src/shell.js CHANGED
@@ -12,8 +12,9 @@ export async function executeShellCommands(text, ctx, options = {}) {
12
12
  const cmd = match[1];
13
13
  const _placeholder = match[0];
14
14
  try {
15
- const output = await ctx.$ `${{ raw: cmd }}`.quiet().nothrow().text();
16
- const replacement = hideCommand ? output.trim() : `$ ${cmd}\n--> ${output.trim()}`;
15
+ const output = await ctx.$ `${{ raw: cmd }}`.quiet().nothrow();
16
+ const text = `${output.stdout.toString()}${output.stderr.toString()}`.trim();
17
+ const replacement = hideCommand ? text : `$ ${cmd}\n--> ${text}`;
17
18
  result = result.replace(_placeholder, replacement);
18
19
  }
19
20
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAwBrC,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAAY,EACZ,GAAiB,EACjB,UAAwB,EAAE;IAE1B,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,MAAM,WAAW,GAAG,OAAO,CAAC,mBAAmB,IAAI,KAAK,CAAC;IAEzD,gDAAgD;IAChD,QAAQ,CAAC,aAAa,CAAC,SAAS,GAAG,CAAC,CAAC;IAErC,iCAAiC;IACjC,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;IAE3D,2CAA2C;IAC3C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAE9B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,CAAA,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC;YACrE,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,SAAS,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YACnF,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,C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AAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;YAC7E,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,SAAS,IAAI,EAAE,CAAC;YACjE,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,yCAAyC;YACzC,mDAAmD;YACnD,MAAM,CAAC,IAAI,CAAC,gCAAgC,EAAE;gBAC5C,OAAO,EAAE,GAAG;gBACZ,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC9D,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-snippets",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "Hashtag-based snippet expansion plugin for OpenCode - instant inline text shortcuts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -35,7 +35,7 @@ Full config example with all options:
35
35
  ```jsonc
36
36
  {
37
37
  // JSON Schema for editor autocompletion
38
- "$schema": "https://raw.githubusercontent.com/JosXa/opencode-snippets/v1.8.0/schema/config.schema.json",
38
+ "$schema": "https://raw.githubusercontent.com/JosXa/opencode-snippets/v1.8.1/schema/config.schema.json",
39
39
 
40
40
  // Logging settings
41
41
  "logging": {