@normahq/acp-repl 0.0.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.
- package/LICENSE +21 -0
- package/README.md +61 -0
- package/acp-repl.js +49 -0
- package/package.json +24 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alexey Samoylov
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# acp-repl
|
|
2
|
+
|
|
3
|
+
`acp-repl` runs an interactive REPL against any stdio ACP server command.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Global install (distributed via npm):
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @normahq/acp-repl@latest
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
One-off run with npx (no global install):
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx @normahq/acp-repl@latest -- <acp-server-cmd> [args...]
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Run
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
acp-repl -- <acp-server-cmd> [args...]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Examples:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
acp-repl -- opencode acp
|
|
29
|
+
acp-repl --model opencode/big-pickle --mode plan -- opencode acp
|
|
30
|
+
acp-repl --debug -- opencode acp
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Flags
|
|
34
|
+
|
|
35
|
+
- `--model <id>`: call ACP `session/set_model` after session creation (unsupported servers are ignored).
|
|
36
|
+
- `--mode <id>`: call ACP `session/set_mode` after session creation (unsupported servers are ignored).
|
|
37
|
+
- `--debug`: enable debug logs.
|
|
38
|
+
|
|
39
|
+
## Interaction
|
|
40
|
+
|
|
41
|
+
- Type prompts and press Enter to run a turn.
|
|
42
|
+
- Type `exit` or `quit` to close the REPL.
|
|
43
|
+
- If ACP permission requests arrive, choose from the numbered options.
|
|
44
|
+
|
|
45
|
+
## Notes
|
|
46
|
+
|
|
47
|
+
- `--` is required. Arguments before `--` are rejected.
|
|
48
|
+
- Default logging is quiet for REPL lifecycle messages; use `--debug` to see them.
|
|
49
|
+
|
|
50
|
+
## Repository
|
|
51
|
+
|
|
52
|
+
- Norma GitHub: <https://github.com/normahq/norma>
|
|
53
|
+
|
|
54
|
+
## Contact
|
|
55
|
+
|
|
56
|
+
- Issues: <https://github.com/normahq/norma/issues>
|
|
57
|
+
- Maintainer: [@metalagman](https://github.com/metalagman)
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
MIT. See the repository [LICENSE](https://github.com/normahq/norma/blob/main/LICENSE).
|
package/acp-repl.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
|
|
5
|
+
const platform = os.platform();
|
|
6
|
+
const arch = os.arch();
|
|
7
|
+
|
|
8
|
+
const platformMap = {
|
|
9
|
+
'darwin': { x64: 'darwin-x64', arm64: 'darwin-arm64' },
|
|
10
|
+
'linux': { x64: 'linux-x64', arm64: 'linux-arm64' },
|
|
11
|
+
'win32': { x64: 'win32-x64' }
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const archMap = { x64: 'x64', arm64: 'arm64', ia32: 'x86' };
|
|
15
|
+
const cpu = archMap[arch] || arch;
|
|
16
|
+
|
|
17
|
+
const osKey = platform === 'win32' ? 'win32' : platform;
|
|
18
|
+
const platformKey = platformMap[osKey]?.[cpu];
|
|
19
|
+
|
|
20
|
+
if (!platformKey) {
|
|
21
|
+
console.error('Unsupported platform: ' + platform + '/' + cpu);
|
|
22
|
+
console.error('Expected package: acp-repl-<os>-<cpu>');
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const platformPkgName = '@normahq/acp-repl-' + platformKey;
|
|
27
|
+
const binaryName = platform === 'win32' ? 'acp-repl.exe' : 'acp-repl';
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
const { execFileSync } = require('child_process');
|
|
31
|
+
const platformPkgJSON = require.resolve(platformPkgName + '/package.json', { paths: [__dirname] });
|
|
32
|
+
const platformPkgDir = path.dirname(platformPkgJSON);
|
|
33
|
+
const binaryPath = path.join(platformPkgDir, 'bin', binaryName);
|
|
34
|
+
process.exit(execFileSync(binaryPath, process.argv.slice(2), { stdio: 'inherit' }));
|
|
35
|
+
} catch (e) {
|
|
36
|
+
if (e.code === 'ENOENT') {
|
|
37
|
+
console.error('Binary not found in package: ' + platformPkgName);
|
|
38
|
+
console.error('Expected platform package: ' + '@normahq/acp-repl-' + platformKey);
|
|
39
|
+
console.error('This may be an unsupported platform or installation issue.');
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
if (e.code === 'MODULE_NOT_FOUND') {
|
|
43
|
+
console.error('Platform package not installed: ' + platformPkgName);
|
|
44
|
+
console.error('Expected platform package: ' + '@normahq/acp-repl-' + platformKey);
|
|
45
|
+
console.error('Try reinstalling the package, and ensure optional dependencies are enabled.');
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
process.exit(e.status || 1);
|
|
49
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bin": {
|
|
3
|
+
"acp-repl": "acp-repl.js"
|
|
4
|
+
},
|
|
5
|
+
"description": "Meta package for acp-repl",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": "\u003e=16"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"acp-repl.js",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
15
|
+
"name": "@normahq/acp-repl",
|
|
16
|
+
"optionalDependencies": {
|
|
17
|
+
"@normahq/acp-repl-darwin-arm64": "0.0.2",
|
|
18
|
+
"@normahq/acp-repl-darwin-x64": "0.0.2",
|
|
19
|
+
"@normahq/acp-repl-linux-arm64": "0.0.2",
|
|
20
|
+
"@normahq/acp-repl-linux-x64": "0.0.2",
|
|
21
|
+
"@normahq/acp-repl-win32-x64": "0.0.2"
|
|
22
|
+
},
|
|
23
|
+
"version": "0.0.2"
|
|
24
|
+
}
|