papaya-agent-client 0.9.0__tar.gz

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 (67) hide show
  1. papaya_agent_client-0.9.0/.claude-plugin/marketplace.json +21 -0
  2. papaya_agent_client-0.9.0/.github/workflows/release.yml +146 -0
  3. papaya_agent_client-0.9.0/.github/workflows/test.yml +39 -0
  4. papaya_agent_client-0.9.0/.gitignore +53 -0
  5. papaya_agent_client-0.9.0/PKG-INFO +1053 -0
  6. papaya_agent_client-0.9.0/README.md +1034 -0
  7. papaya_agent_client-0.9.0/npm/README.md +48 -0
  8. papaya_agent_client-0.9.0/npm/bin/papaya-agent.js +17 -0
  9. papaya_agent_client-0.9.0/npm/lib/checksum.js +35 -0
  10. papaya_agent_client-0.9.0/npm/lib/cli.js +109 -0
  11. papaya_agent_client-0.9.0/npm/lib/source.js +70 -0
  12. papaya_agent_client-0.9.0/npm/lib/targets.js +81 -0
  13. papaya_agent_client-0.9.0/npm/lib/uv-version.json +4 -0
  14. papaya_agent_client-0.9.0/npm/lib/uv.js +190 -0
  15. papaya_agent_client-0.9.0/npm/package.json +34 -0
  16. papaya_agent_client-0.9.0/npm/test/checksum.test.js +53 -0
  17. papaya_agent_client-0.9.0/npm/test/cli.test.js +224 -0
  18. papaya_agent_client-0.9.0/npm/test/fixtures/make_fixture.py +47 -0
  19. papaya_agent_client-0.9.0/npm/test/fixtures/uv-fixture-target.tar.gz +0 -0
  20. papaya_agent_client-0.9.0/npm/test/fixtures/uv-fixture-target.tar.gz.sha256 +1 -0
  21. papaya_agent_client-0.9.0/npm/test/source.test.js +72 -0
  22. papaya_agent_client-0.9.0/npm/test/targets.test.js +66 -0
  23. papaya_agent_client-0.9.0/npm/test/uv.test.js +196 -0
  24. papaya_agent_client-0.9.0/papaya-agent-client-mcp-detailed-implementation-plan.md +144 -0
  25. papaya_agent_client-0.9.0/papaya-agent-client-workspaces-command-plan.md +98 -0
  26. papaya_agent_client-0.9.0/papaya_agent_client/__init__.py +1 -0
  27. papaya_agent_client-0.9.0/papaya_agent_client/__main__.py +1122 -0
  28. papaya_agent_client-0.9.0/papaya_agent_client/api_client.py +551 -0
  29. papaya_agent_client-0.9.0/papaya_agent_client/auth.py +252 -0
  30. papaya_agent_client-0.9.0/papaya_agent_client/browser_signin.py +340 -0
  31. papaya_agent_client-0.9.0/papaya_agent_client/command_runner.py +448 -0
  32. papaya_agent_client-0.9.0/papaya_agent_client/config.py +130 -0
  33. papaya_agent_client-0.9.0/papaya_agent_client/connect.py +930 -0
  34. papaya_agent_client-0.9.0/papaya_agent_client/context.py +672 -0
  35. papaya_agent_client-0.9.0/papaya_agent_client/guard.py +220 -0
  36. papaya_agent_client-0.9.0/papaya_agent_client/hooks.py +589 -0
  37. papaya_agent_client-0.9.0/papaya_agent_client/listener.py +982 -0
  38. papaya_agent_client-0.9.0/papaya_agent_client/mcp_identity.py +132 -0
  39. papaya_agent_client-0.9.0/papaya_agent_client/mcp_server.py +506 -0
  40. papaya_agent_client-0.9.0/papaya_agent_client/passthrough.py +168 -0
  41. papaya_agent_client-0.9.0/papaya_agent_client/playbook.py +116 -0
  42. papaya_agent_client-0.9.0/papaya_agent_client/plugin/.claude-plugin/marketplace.json +21 -0
  43. papaya_agent_client-0.9.0/papaya_agent_client/plugin/.claude-plugin/plugin.json +20 -0
  44. papaya_agent_client-0.9.0/papaya_agent_client/plugin/.codex-plugin/plugin.json +39 -0
  45. papaya_agent_client-0.9.0/papaya_agent_client/plugin/.cursor-plugin/mcp.json +8 -0
  46. papaya_agent_client-0.9.0/papaya_agent_client/plugin/.cursor-plugin/plugin.json +29 -0
  47. papaya_agent_client-0.9.0/papaya_agent_client/plugin/.mcp.json +8 -0
  48. papaya_agent_client-0.9.0/papaya_agent_client/plugin/PAPAYA.md +115 -0
  49. papaya_agent_client-0.9.0/papaya_agent_client/plugin/hooks/hooks.json +83 -0
  50. papaya_agent_client-0.9.0/papaya_agent_client/plugin/hooks/papaya-guard.sh +26 -0
  51. papaya_agent_client-0.9.0/papaya_agent_client/plugin/hooks/papaya-post-tool.sh +46 -0
  52. papaya_agent_client-0.9.0/papaya_agent_client/plugin/hooks/papaya-precompact.sh +22 -0
  53. papaya_agent_client-0.9.0/papaya_agent_client/plugin/hooks/papaya-prompt.sh +22 -0
  54. papaya_agent_client-0.9.0/papaya_agent_client/plugin/hooks/papaya-session-start.sh +26 -0
  55. papaya_agent_client-0.9.0/papaya_agent_client/plugin/hooks/papaya-stop.sh +32 -0
  56. papaya_agent_client-0.9.0/papaya_agent_client/plugin/skills/papaya-connect/SKILL.md +190 -0
  57. papaya_agent_client-0.9.0/papaya_agent_client/ws_client.py +163 -0
  58. papaya_agent_client-0.9.0/pyproject.toml +49 -0
  59. papaya_agent_client-0.9.0/scripts/papaya-claude-runner.sh +57 -0
  60. papaya_agent_client-0.9.0/scripts/papaya-codex-runner.sh +33 -0
  61. papaya_agent_client-0.9.0/tests/conftest.py +19 -0
  62. papaya_agent_client-0.9.0/tests/test_client_runtime.py +1598 -0
  63. papaya_agent_client-0.9.0/tests/test_connect.py +4162 -0
  64. papaya_agent_client-0.9.0/tests/test_listener.py +2025 -0
  65. papaya_agent_client-0.9.0/tests/test_passthrough.py +306 -0
  66. papaya_agent_client-0.9.0/tests/test_version_pins.py +130 -0
  67. papaya_agent_client-0.9.0/uv.lock +1442 -0
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
3
+ "name": "papaya-agent-client",
4
+ "description": "Papaya connector plugin: MCP setup, auth, and durable agent context for Claude Code.",
5
+ "owner": {
6
+ "name": "Papaya",
7
+ "email": "team@trypapaya.ai"
8
+ },
9
+ "plugins": [
10
+ {
11
+ "name": "papaya",
12
+ "description": "Connect Claude Code to Papaya as one of your workspace agents, with persona, rules, and memories imported at session start.",
13
+ "author": {
14
+ "name": "Papaya"
15
+ },
16
+ "source": "./papaya_agent_client/plugin",
17
+ "category": "productivity",
18
+ "homepage": "https://trypapaya.ai"
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,146 @@
1
+ name: release
2
+
3
+ # Pushing a tag `v<version>` publishes both halves of the client: the Python
4
+ # package `papaya-agent-client` to PyPI, and the npm shim `papaya-agent` that
5
+ # bootstraps it. They always ship together and always carry the same version.
6
+ #
7
+ # There are NO long-lived registry tokens and no repository secrets. Both
8
+ # registries accept trusted publishing: GitHub mints a short-lived OIDC token
9
+ # for this workflow run, the registry checks that the run really came from
10
+ # this repository, this file and the named environment, and the upload is
11
+ # signed with a provenance attestation the registry publishes alongside it.
12
+ #
13
+ # One-time setup on each registry (an owner does this in a browser, once):
14
+ #
15
+ # PyPI https://pypi.org/manage/account/publishing/ -> "Add a new pending
16
+ # publisher": project `papaya-agent-client`, owner `Papaya-HQ`,
17
+ # repository `papaya-agent-client`, workflow `release.yml`,
18
+ # environment `pypi`. A pending publisher lets the FIRST release
19
+ # create the project; afterwards it lives under the project's own
20
+ # Publishing settings.
21
+ #
22
+ # npm The registry only lets an existing package name a trusted
23
+ # publisher, so the FIRST `papaya-agent` release is `npm publish`
24
+ # from a maintainer's own machine (interactive 2FA, no token
25
+ # stored anywhere). Then, on https://www.npmjs.com/package/papaya-agent
26
+ # -> Settings -> Trusted Publisher: GitHub Actions, organization
27
+ # `Papaya-HQ`, repository `papaya-agent-client`, workflow
28
+ # `release.yml`, environment `npm`. Every later tag publishes from
29
+ # here with provenance and no token.
30
+ #
31
+ # Layout follows the registries' own guidance: the publish jobs do nothing but
32
+ # publish, hold only the `id-token: write` permission they need, run inside a
33
+ # named GitHub environment (so the registry can pin to it and a reviewer can be
34
+ # required), and consume artifacts built by a separate job that had no
35
+ # publishing rights at all.
36
+ #
37
+ # The version gate runs first and refuses the whole release unless the tag,
38
+ # pyproject.toml and npm/package.json all name the same version.
39
+
40
+ on:
41
+ push:
42
+ tags: ["v*"]
43
+
44
+ permissions: {}
45
+
46
+ jobs:
47
+ verify:
48
+ name: Version gate and both test suites
49
+ runs-on: ubuntu-latest
50
+ permissions:
51
+ contents: read
52
+ steps:
53
+ - uses: actions/checkout@v4
54
+
55
+ - name: The tag, pyproject.toml and npm/package.json name one version
56
+ run: |
57
+ set -euo pipefail
58
+ tag_version="${GITHUB_REF_NAME#v}"
59
+ pyproject_version="$(python3 -c 'import tomllib, pathlib; print(tomllib.loads(pathlib.Path("pyproject.toml").read_text())["project"]["version"])')"
60
+ npm_version="$(node -p 'require("./npm/package.json").version')"
61
+ echo "tag=${tag_version} pyproject=${pyproject_version} npm=${npm_version}"
62
+ if [ "${tag_version}" != "${pyproject_version}" ] || [ "${tag_version}" != "${npm_version}" ]; then
63
+ echo "::error::version mismatch: tag ${tag_version}, pyproject.toml ${pyproject_version}, npm/package.json ${npm_version}"
64
+ exit 1
65
+ fi
66
+
67
+ - uses: astral-sh/setup-uv@v5
68
+ with:
69
+ python-version: "3.11"
70
+ - run: uv sync
71
+ - run: uv run pytest -q
72
+
73
+ - uses: actions/setup-node@v4
74
+ with:
75
+ node-version: "22"
76
+ - run: node --test test/*.test.js
77
+ working-directory: npm
78
+
79
+ build:
80
+ name: Build the wheel and sdist
81
+ needs: verify
82
+ runs-on: ubuntu-latest
83
+ permissions:
84
+ contents: read
85
+ steps:
86
+ - uses: actions/checkout@v4
87
+ - uses: astral-sh/setup-uv@v5
88
+ with:
89
+ python-version: "3.11"
90
+ - run: uv build
91
+ - uses: actions/upload-artifact@v4
92
+ with:
93
+ name: python-dist
94
+ path: dist/
95
+ if-no-files-found: error
96
+
97
+ publish-pypi:
98
+ name: Publish papaya-agent-client to PyPI
99
+ needs: build
100
+ runs-on: ubuntu-latest
101
+ # The environment is part of the trusted-publisher identity PyPI checks.
102
+ environment:
103
+ name: pypi
104
+ url: https://pypi.org/project/papaya-agent-client/
105
+ permissions:
106
+ # Mint the OIDC token PyPI exchanges for a short-lived upload token.
107
+ id-token: write
108
+ steps:
109
+ - uses: actions/download-artifact@v4
110
+ with:
111
+ name: python-dist
112
+ path: dist/
113
+ # PyPA's own action: trusted publishing by default, and it generates and
114
+ # uploads the PEP 740 provenance attestations for every file.
115
+ - uses: pypa/gh-action-pypi-publish@release/v1
116
+ with:
117
+ packages-dir: dist/
118
+
119
+ publish-npm:
120
+ name: Publish papaya-agent to npm
121
+ needs: verify
122
+ runs-on: ubuntu-latest
123
+ # The environment is part of the trusted-publisher identity npm checks.
124
+ environment:
125
+ name: npm
126
+ url: https://www.npmjs.com/package/papaya-agent
127
+ permissions:
128
+ # Read the checkout; mint the OIDC token npm exchanges for a publish.
129
+ contents: read
130
+ id-token: write
131
+ steps:
132
+ - uses: actions/checkout@v4
133
+ - uses: actions/setup-node@v4
134
+ with:
135
+ node-version: "22"
136
+ registry-url: "https://registry.npmjs.org"
137
+ # Trusted publishing needs npm 11.5.1 or later; the npm bundled with a
138
+ # Node LTS lags, so take the current one.
139
+ - run: npm install -g npm@latest
140
+ - run: npm --version
141
+ # No token anywhere: with a trusted publisher configured, `npm publish`
142
+ # exchanges the runner's OIDC token itself and attaches provenance
143
+ # automatically. `--access public` is only needed on the first publish
144
+ # of an unscoped name, and is harmless afterwards.
145
+ - run: npm publish --access public
146
+ working-directory: npm
@@ -0,0 +1,39 @@
1
+ name: test
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+
8
+ jobs:
9
+ pytest:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ python-version: ["3.11", "3.13"]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: astral-sh/setup-uv@v5
18
+ with:
19
+ python-version: ${{ matrix.python-version }}
20
+ - run: uv sync
21
+ - run: uv run pytest -q
22
+
23
+ # The npm shim has no dependencies and no build step, so `node --test` on a
24
+ # bare checkout is the whole story.
25
+ node:
26
+ runs-on: ubuntu-latest
27
+ strategy:
28
+ fail-fast: false
29
+ matrix:
30
+ node-version: ["18", "22"]
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ - uses: actions/setup-node@v4
34
+ with:
35
+ node-version: ${{ matrix.node-version }}
36
+ # The shell expands the glob, so this is a plain file list on every Node
37
+ # from 18 on; `node --test` only learned to glob itself much later.
38
+ - run: node --test test/*.test.js
39
+ working-directory: npm
@@ -0,0 +1,53 @@
1
+ # Python bytecode and caches
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ .pytest_cache/
6
+ .mypy_cache/
7
+ .ruff_cache/
8
+ .pyre/
9
+ .coverage
10
+ .coverage.*
11
+ coverage.xml
12
+ htmlcov/
13
+
14
+ # Virtual environments
15
+ .venv/
16
+ venv/
17
+ env/
18
+ ENV/
19
+
20
+ # Build and packaging artifacts
21
+ build/
22
+ dist/
23
+ *.egg-info/
24
+ *.egg
25
+ .eggs/
26
+
27
+ # Local environment and secrets
28
+ .env
29
+ .env.*
30
+ !.env.example
31
+ .papaya-agent/
32
+
33
+ # Node (the npm shim under npm/ has no dependencies; these are local artifacts)
34
+ node_modules/
35
+ pnpm-lock.yaml
36
+ package-lock.json
37
+ npm/.uv/
38
+
39
+ # Tool caches
40
+ .cache/
41
+ .uv-cache/
42
+
43
+ # Worker evidence, never part of a change
44
+ .mm-evidence/
45
+
46
+ # Editor, OS, and logs
47
+ .DS_Store
48
+ .idea/
49
+ .vscode/
50
+ *.swp
51
+ *.swo
52
+ *.log
53
+ .gitnexus