pi-enclave 0.0.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 +161 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +1136 -0
- package/package.json +53 -0
- package/templates/pi-enclave.d/git.toml +7 -0
- package/templates/pi-enclave.d/github.toml +41 -0
- package/templates/pi-enclave.d/jj.toml +11 -0
- package/templates/pi-enclave.toml +22 -0
- package/templates/project.toml +7 -0
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-enclave",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "VM-isolated sandbox for pi with automatic secret protection · from yapp",
|
|
5
|
+
"author": "mgabor3141",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"url": "git+https://github.com/mgabor3141/yapp.git",
|
|
9
|
+
"directory": "packages/enclave"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"pi-package",
|
|
13
|
+
"pi-extension",
|
|
14
|
+
"yapp"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "dist/index.js",
|
|
18
|
+
"types": "dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"templates",
|
|
28
|
+
"README.md"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsup"
|
|
32
|
+
},
|
|
33
|
+
"pi": {
|
|
34
|
+
"extensions": [
|
|
35
|
+
"dist/index.js"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@earendil-works/gondolin": "^0.6.0",
|
|
40
|
+
"graphql": "^16.13.1",
|
|
41
|
+
"smol-toml": "^1.6.0",
|
|
42
|
+
"valibot": "^1.2.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"@mariozechner/pi-coding-agent": "*"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@mariozechner/pi-coding-agent": "^0.57.0",
|
|
49
|
+
"@types/node": "^25.3.5",
|
|
50
|
+
"tsup": "^8.5.1",
|
|
51
|
+
"typescript": "^5.9.3"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# GitHub service policy for pi-enclave
|
|
2
|
+
# Drop-in file: delete this file to disable GitHub integration.
|
|
3
|
+
|
|
4
|
+
packages = ["github-cli"]
|
|
5
|
+
|
|
6
|
+
# Secret: how to get the token, where the proxy injects it
|
|
7
|
+
[secrets.GH_TOKEN]
|
|
8
|
+
command = "gh auth token"
|
|
9
|
+
hosts = ["api.github.com", "github.com", "*.githubusercontent.com"]
|
|
10
|
+
|
|
11
|
+
# Git: how git authenticates over HTTPS
|
|
12
|
+
[[git-credentials]]
|
|
13
|
+
host = "github.com"
|
|
14
|
+
username = "x-access-token"
|
|
15
|
+
secret = "GH_TOKEN"
|
|
16
|
+
|
|
17
|
+
# github.com: git smart HTTP protocol.
|
|
18
|
+
# Fetch/clone use POST /git-upload-pack (read), push uses POST /git-receive-pack (write).
|
|
19
|
+
[hosts."github.com"]
|
|
20
|
+
unmatched = "prompt"
|
|
21
|
+
allow.GET = ["/**"]
|
|
22
|
+
allow.POST = ["/**/git-upload-pack"]
|
|
23
|
+
|
|
24
|
+
# GitHub API: allow reads, prompt for writes.
|
|
25
|
+
# pi-enclave parses GraphQL request bodies and checks actual field
|
|
26
|
+
# names (not the client-controlled operation name).
|
|
27
|
+
[hosts."api.github.com"]
|
|
28
|
+
unmatched = "prompt"
|
|
29
|
+
allow.GET = ["/**"]
|
|
30
|
+
|
|
31
|
+
[hosts."api.github.com".graphql]
|
|
32
|
+
endpoint = "/graphql"
|
|
33
|
+
allow.query = ["*"]
|
|
34
|
+
allow.mutation = [
|
|
35
|
+
"createPullRequest",
|
|
36
|
+
"createIssue",
|
|
37
|
+
"addComment",
|
|
38
|
+
"addPullRequestReview",
|
|
39
|
+
"updatePullRequest",
|
|
40
|
+
"updateIssue",
|
|
41
|
+
]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Jujutsu (jj) support for pi-enclave
|
|
2
|
+
# For jj workspaces, add a mount for the parent .jj directory in your
|
|
3
|
+
# project config:
|
|
4
|
+
#
|
|
5
|
+
# [[mounts]]
|
|
6
|
+
# path = "~/dev/myproject/.jj"
|
|
7
|
+
packages = ["jujutsu"]
|
|
8
|
+
setup = """
|
|
9
|
+
jj config set --user user.name "$USER_NAME"
|
|
10
|
+
jj config set --user user.email "$USER_EMAIL"
|
|
11
|
+
"""
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# pi-enclave global configuration
|
|
2
|
+
# See: https://github.com/mgabor3141/yapp/tree/main/packages/enclave
|
|
3
|
+
|
|
4
|
+
# Default for projects without their own .pi/enclave.toml:
|
|
5
|
+
# enabled = false
|
|
6
|
+
|
|
7
|
+
# Base packages (drop-in files in pi-enclave.d/ add more):
|
|
8
|
+
packages = ["curl", "jq"]
|
|
9
|
+
|
|
10
|
+
# Environment variables available in the VM and setup scripts.
|
|
11
|
+
# Values can be static strings, host commands, or host env vars.
|
|
12
|
+
[env]
|
|
13
|
+
USER_NAME = { command = "git config --global user.name" }
|
|
14
|
+
USER_EMAIL = { command = "git config --global user.email" }
|
|
15
|
+
|
|
16
|
+
# Service policies live in pi-enclave.d/ as drop-in files.
|
|
17
|
+
# See pi-enclave.d/ for examples.
|
|
18
|
+
|
|
19
|
+
# Additional secrets:
|
|
20
|
+
# [secrets.OPENAI_API_KEY]
|
|
21
|
+
# env = "OPENAI_API_KEY"
|
|
22
|
+
# hosts = ["api.openai.com"]
|