attestari 2.9.0 → 2.9.2

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.
Files changed (3) hide show
  1. package/dist/hook.js +10 -6
  2. package/package.json +1 -1
  3. package/LICENSE +0 -21
package/dist/hook.js CHANGED
@@ -1434,10 +1434,14 @@ function scopes(home2, cwd) {
1434
1434
  function quoted(path) {
1435
1435
  return /[\s"]/.test(path) ? `"${path.replace(/"/g, '\\"')}"` : path;
1436
1436
  }
1437
- function hookCommands(node, hook2) {
1437
+ function powershellQuoted(path) {
1438
+ return `'${path.replace(/'/g, "''")}'`;
1439
+ }
1440
+ function hookCommands(node, hook2, platform2 = process.platform) {
1441
+ const program = platform2 === "win32" ? `& ${powershellQuoted(node)} ${powershellQuoted(hook2)}` : `${quoted(node)} ${quoted(hook2)}`;
1438
1442
  return {
1439
- preToolUse: `${quoted(node)} ${quoted(hook2)} codex pre-tool-use`,
1440
- sessionStart: `${quoted(node)} ${quoted(hook2)} codex session-start`
1443
+ preToolUse: `${program} codex pre-tool-use`,
1444
+ sessionStart: `${program} codex session-start`
1441
1445
  };
1442
1446
  }
1443
1447
  var MINE = /attestari.*\bcodex (pre-tool-use|session-start)\b/;
@@ -1453,11 +1457,11 @@ function withHandler(groups, matcher, handler) {
1453
1457
  cleaned[at] = { ...group, hooks: [...group.hooks, handler] };
1454
1458
  return cleaned;
1455
1459
  }
1456
- function install(home2, hookFile = __filename, node = process.execPath) {
1460
+ function install(home2, hookFile = __filename, node = process.execPath, platform2 = process.platform) {
1457
1461
  const copy = (0, import_node_path7.join)(home2, COPY);
1458
1462
  (0, import_node_fs6.mkdirSync)((0, import_node_path7.join)(home2, ".attestari"), { recursive: true });
1459
1463
  (0, import_node_fs6.copyFileSync)(hookFile, copy);
1460
- const commands = hookCommands(node, copy);
1464
+ const commands = hookCommands(node, copy, platform2);
1461
1465
  const file = (0, import_node_path7.join)(home2, ".codex", "hooks.json");
1462
1466
  const read = bytesOf(file);
1463
1467
  const text = read === null ? null : read.toString("utf8");
@@ -1874,7 +1878,7 @@ var import_node_http = require("node:http");
1874
1878
  var import_node_https = require("node:https");
1875
1879
 
1876
1880
  // src/version.ts
1877
- var HOOK_VERSION = "2.9.0";
1881
+ var HOOK_VERSION = "2.9.2";
1878
1882
 
1879
1883
  // src/api.ts
1880
1884
  var timeoutMs = 1e4;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attestari",
3
- "version": "2.9.0",
3
+ "version": "2.9.2",
4
4
  "description": "The Attestari Protect hook: one file, no dependency, run by each agent itself.",
5
5
  "license": "MIT",
6
6
  "bin": {
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 The Elite360 Corporation
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.