paperclip-github-plugin 0.2.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/LICENSE +184 -0
- package/README.md +216 -0
- package/dist/manifest.js +548 -0
- package/dist/ui/index.js +5336 -0
- package/dist/ui/index.js.map +7 -0
- package/dist/worker.js +6544 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
|
13
|
+
owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities
|
|
16
|
+
that control, are controlled by, or are under common control with that entity.
|
|
17
|
+
For the purposes of this definition, "control" means (i) the power, direct or
|
|
18
|
+
indirect, to cause the direction or management of such entity, whether by
|
|
19
|
+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
20
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
21
|
+
|
|
22
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
23
|
+
permissions granted by this License.
|
|
24
|
+
|
|
25
|
+
"Source" form shall mean the preferred form for making modifications, including
|
|
26
|
+
but not limited to software source code, documentation source, and
|
|
27
|
+
configuration files.
|
|
28
|
+
|
|
29
|
+
"Object" form shall mean any form resulting from mechanical transformation or
|
|
30
|
+
translation of a Source form, including but not limited to compiled object
|
|
31
|
+
code, generated documentation, and conversions to other media types.
|
|
32
|
+
|
|
33
|
+
"Work" shall mean the work of authorship, whether in Source or Object form,
|
|
34
|
+
made available under the License, as indicated by a copyright notice that is
|
|
35
|
+
included in or attached to the work (an example is provided in the Appendix
|
|
36
|
+
below).
|
|
37
|
+
|
|
38
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
|
39
|
+
is based on (or derived from) the Work and for which the editorial revisions,
|
|
40
|
+
annotations, elaborations, or other modifications represent, as a whole, an
|
|
41
|
+
original work of authorship. For the purposes of this License, Derivative Works
|
|
42
|
+
shall not include works that remain separable from, or merely link (or bind by
|
|
43
|
+
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
44
|
+
|
|
45
|
+
"Contribution" shall mean any work of authorship, including the original
|
|
46
|
+
version of the Work and any modifications or additions to that Work or
|
|
47
|
+
Derivative Works thereof, that is intentionally submitted to Licensor for
|
|
48
|
+
inclusion in the Work by the copyright owner or by an individual or Legal
|
|
49
|
+
Entity authorized to submit on behalf of the copyright owner. For the purposes
|
|
50
|
+
of this definition, "submitted" means any form of electronic, verbal, or
|
|
51
|
+
written communication sent to the Licensor or its representatives, including
|
|
52
|
+
but not limited to communication on electronic mailing lists, source code
|
|
53
|
+
control systems, and issue tracking systems that are managed by, or on behalf
|
|
54
|
+
of, the Licensor for the purpose of discussing and improving the Work, but
|
|
55
|
+
excluding communication that is conspicuously marked or otherwise designated in
|
|
56
|
+
writing by the copyright owner as "Not a Contribution."
|
|
57
|
+
|
|
58
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
|
59
|
+
of whom a Contribution has been received by Licensor and subsequently
|
|
60
|
+
incorporated within the Work.
|
|
61
|
+
|
|
62
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
63
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
64
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
65
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
66
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
67
|
+
Object form.
|
|
68
|
+
|
|
69
|
+
3. Grant of Patent License. Subject to the terms and conditions of this
|
|
70
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
71
|
+
non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
|
|
72
|
+
section) patent license to make, have made, use, offer to sell, sell, import,
|
|
73
|
+
and otherwise transfer the Work, where such license applies only to those
|
|
74
|
+
patent claims licensable by such Contributor that are necessarily infringed by
|
|
75
|
+
their Contribution(s) alone or by combination of their Contribution(s) with the
|
|
76
|
+
Work to which such Contribution(s) was submitted. If You institute patent
|
|
77
|
+
litigation against any entity (including a cross-claim or counterclaim in a
|
|
78
|
+
lawsuit) alleging that the Work or a Contribution incorporated within the Work
|
|
79
|
+
constitutes direct or contributory patent infringement, then any patent
|
|
80
|
+
licenses granted to You under this License for that Work shall terminate as of
|
|
81
|
+
the date such litigation is filed.
|
|
82
|
+
|
|
83
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
84
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
85
|
+
Source or Object form, provided that You meet the following conditions:
|
|
86
|
+
|
|
87
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy
|
|
88
|
+
of this License; and
|
|
89
|
+
|
|
90
|
+
(b) You must cause any modified files to carry prominent notices stating that
|
|
91
|
+
You changed the files; and
|
|
92
|
+
|
|
93
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
94
|
+
distribute, all copyright, patent, trademark, and attribution notices from the
|
|
95
|
+
Source form of the Work, excluding those notices that do not pertain to any
|
|
96
|
+
part of the Derivative Works; and
|
|
97
|
+
|
|
98
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then
|
|
99
|
+
any Derivative Works that You distribute must include a readable copy of the
|
|
100
|
+
attribution notices contained within such NOTICE file, excluding those notices
|
|
101
|
+
that do not pertain to any part of the Derivative Works, in at least one of the
|
|
102
|
+
following places: within a NOTICE text file distributed as part of the
|
|
103
|
+
Derivative Works; within the Source form or documentation, if provided along
|
|
104
|
+
with the Derivative Works; or, within a display generated by the Derivative
|
|
105
|
+
Works, if and wherever such third-party notices normally appear. The contents
|
|
106
|
+
of the NOTICE file are for informational purposes only and do not modify the
|
|
107
|
+
License. You may add Your own attribution notices within Derivative Works that
|
|
108
|
+
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
|
109
|
+
provided that such additional attribution notices cannot be construed as
|
|
110
|
+
modifying the License.
|
|
111
|
+
|
|
112
|
+
You may add Your own copyright statement to Your modifications and may provide
|
|
113
|
+
additional or different license terms and conditions for use, reproduction, or
|
|
114
|
+
distribution of Your modifications, or for any such Derivative Works as a
|
|
115
|
+
whole, provided Your use, reproduction, and distribution of the Work otherwise
|
|
116
|
+
complies with the conditions stated in this License.
|
|
117
|
+
|
|
118
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
119
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
120
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
121
|
+
additional terms or conditions. Notwithstanding the above, nothing herein shall
|
|
122
|
+
supersede or modify the terms of any separate license agreement you may have
|
|
123
|
+
executed with Licensor regarding such Contributions.
|
|
124
|
+
|
|
125
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
126
|
+
trademarks, service marks, or product names of the Licensor, except as required
|
|
127
|
+
for reasonable and customary use in describing the origin of the Work and
|
|
128
|
+
reproducing the content of the NOTICE file.
|
|
129
|
+
|
|
130
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
131
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
132
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
133
|
+
KIND, either express or implied, including, without limitation, any warranties
|
|
134
|
+
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
135
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
136
|
+
appropriateness of using or redistributing the Work and assume any risks
|
|
137
|
+
associated with Your exercise of permissions under this License.
|
|
138
|
+
|
|
139
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
140
|
+
tort (including negligence), contract, or otherwise, unless required by
|
|
141
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to in
|
|
142
|
+
writing, shall any Contributor be liable to You for damages, including any
|
|
143
|
+
direct, indirect, special, incidental, or consequential damages of any
|
|
144
|
+
character arising as a result of this License or out of the use or inability to
|
|
145
|
+
use the Work (including but not limited to damages for loss of goodwill, work
|
|
146
|
+
stoppage, computer failure or malfunction, or any and all other commercial
|
|
147
|
+
damages or losses), even if such Contributor has been advised of the
|
|
148
|
+
possibility of such damages.
|
|
149
|
+
|
|
150
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
|
151
|
+
Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
152
|
+
acceptance of support, warranty, indemnity, or other liability obligations
|
|
153
|
+
and/or rights consistent with this License. However, in accepting such
|
|
154
|
+
obligations, You may act only on Your own behalf and on Your sole
|
|
155
|
+
responsibility, not on behalf of any other Contributor, and only if You agree
|
|
156
|
+
to indemnify, defend, and hold each Contributor harmless for any liability
|
|
157
|
+
incurred by, or claims asserted against, such Contributor by reason of your
|
|
158
|
+
accepting any such warranty or additional liability.
|
|
159
|
+
|
|
160
|
+
END OF TERMS AND CONDITIONS
|
|
161
|
+
|
|
162
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
163
|
+
|
|
164
|
+
To apply the Apache License to your work, attach the following boilerplate
|
|
165
|
+
notice, with the fields enclosed by brackets "[]" replaced with your own
|
|
166
|
+
identifying information. (Don't include the brackets!) The text should be
|
|
167
|
+
enclosed in the appropriate comment syntax for the file format. We also
|
|
168
|
+
recommend that a file or class name and description of purpose be included on
|
|
169
|
+
the same "printed page" as the copyright notice for easier identification
|
|
170
|
+
within third-party archives.
|
|
171
|
+
|
|
172
|
+
Copyright [yyyy] [name of copyright owner]
|
|
173
|
+
|
|
174
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
175
|
+
you may not use this file except in compliance with the License.
|
|
176
|
+
You may obtain a copy of the License at
|
|
177
|
+
|
|
178
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
179
|
+
|
|
180
|
+
Unless required by applicable law or agreed to in writing, software
|
|
181
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
182
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
183
|
+
See the License for the specific language governing permissions and
|
|
184
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# paperclip-github-plugin
|
|
2
|
+
|
|
3
|
+
GitHub Sync is a Paperclip plugin that connects GitHub repositories to Paperclip projects and keeps GitHub issues synchronized into your Paperclip workspace.
|
|
4
|
+
|
|
5
|
+
It is designed for teams that plan in Paperclip but still receive work through GitHub issues. The plugin gives you a Paperclip-native setup flow, secure GitHub token handling through Paperclip secrets or an optional local worker config file, authenticated-deployment detection with required board-access connection when needed, manual sync controls, automatic background sync, and GitHub context directly on synced Paperclip issues.
|
|
6
|
+
|
|
7
|
+
## What the plugin does
|
|
8
|
+
|
|
9
|
+
- Connects one or more GitHub repositories to Paperclip projects.
|
|
10
|
+
- Imports GitHub issues as top-level Paperclip issues.
|
|
11
|
+
- Keeps already imported issues updated instead of recreating them.
|
|
12
|
+
- Stores the GitHub token as a Paperclip secret reference instead of persisting the raw token in plugin state.
|
|
13
|
+
- Supports an optional worker-local config file at `~/.paperclip/plugins/github-sync/config.json` for a raw `githubToken` fallback when Paperclip-managed secrets are not available.
|
|
14
|
+
- Can store a per-company Paperclip board API token for worker-side REST calls when Paperclip board access requires sign-in.
|
|
15
|
+
- Adds Paperclip UI surfaces for setup, sync status, manual sync actions, issue details, and GitHub link annotations.
|
|
16
|
+
- Exposes agent tools so Paperclip agents can search GitHub for duplicates, read and update issues, open pull requests, inspect CI, work through review threads, and request reviewers without leaving the plugin surface.
|
|
17
|
+
|
|
18
|
+
## User-facing features
|
|
19
|
+
|
|
20
|
+
### Setup and configuration
|
|
21
|
+
|
|
22
|
+
- Hosted settings page inside Paperclip.
|
|
23
|
+
- GitHub token validation before saving.
|
|
24
|
+
- GitHub token saved through Paperclip company secrets; the plugin stores only the secret reference.
|
|
25
|
+
- Optional worker-local config file support at `~/.paperclip/plugins/github-sync/config.json` with a `githubToken` field for global runtime fallback.
|
|
26
|
+
- GitHub token and automatic sync cadence stay shared across the plugin instance, while repository mappings, advanced import defaults, and Paperclip board access are managed per company from the same hosted settings flow.
|
|
27
|
+
- The hosted settings page calls out the current company by name and separates company-scoped setup from shared plugin-wide settings.
|
|
28
|
+
- Automatic detection of authenticated Paperclip deployments through `/api/health`.
|
|
29
|
+
- Paperclip board access connection flow from settings, enforced when the deployment requires authenticated board access for worker-side REST calls.
|
|
30
|
+
- Paperclip board tokens saved through Paperclip company secrets per company; the plugin stores only the secret reference and mirrors that ref into plugin config so workers can resolve it during sync.
|
|
31
|
+
- Support for multiple repository-to-project mappings.
|
|
32
|
+
- When settings are opened inside a company, the repository list only shows that company’s mappings and saving it preserves mappings that belong to other companies.
|
|
33
|
+
- Company-wide advanced settings for imported issues, including a default assignee, a default Paperclip status, and ignored GitHub issue authors.
|
|
34
|
+
- Repository input accepts either `owner/repo` or `https://github.com/owner/repo`.
|
|
35
|
+
- When a company already has Paperclip projects bound to GitHub repository workspaces, the settings page surfaces those existing projects so sync can be enabled without recreating the project.
|
|
36
|
+
- Automatic creation or reuse of the target Paperclip project when a mapping is saved.
|
|
37
|
+
- Automatic binding of the GitHub repository URL to the target Paperclip project workspace.
|
|
38
|
+
- Configurable automatic sync cadence in whole minutes.
|
|
39
|
+
- Project name becomes read-only in the settings UI after the project has been created and linked.
|
|
40
|
+
|
|
41
|
+
### Sync behavior
|
|
42
|
+
|
|
43
|
+
- Manual sync from the settings page, scoped to the current company when settings are opened inside a company.
|
|
44
|
+
- Global toolbar button for syncing from anywhere in Paperclip.
|
|
45
|
+
- Global toolbar and dashboard sync actions target the current company when they are rendered inside one, and fall back to all saved mappings only when no company context is active.
|
|
46
|
+
- Project toolbar button for syncing the repository mapped to a specific Paperclip project.
|
|
47
|
+
- Issue toolbar button for syncing the GitHub issue linked to a specific Paperclip issue.
|
|
48
|
+
- Automatic scheduled sync driven by a job that checks every minute and runs when the saved cadence is due.
|
|
49
|
+
- Background completion for long-running manual or scheduled syncs so the host request can return promptly.
|
|
50
|
+
- Live sync progress and troubleshooting details in the Paperclip UI.
|
|
51
|
+
- Cumulative sync counts and last-run status in plugin state.
|
|
52
|
+
|
|
53
|
+
### Agent tools
|
|
54
|
+
|
|
55
|
+
- Repository-scoped search for issues and pull requests to support deduplication during triage.
|
|
56
|
+
- GitHub issue read, comment-read, comment-write, and metadata update tools for agent implementation work.
|
|
57
|
+
- Pull request creation, read, update, changed-file, CI-check, review-thread, and reviewer-request tools for agent delivery work.
|
|
58
|
+
- Review-thread reply plus resolve and unresolve tools so agents can respond to automated review feedback directly from Paperclip.
|
|
59
|
+
- Comment-posting tools automatically append a footer disclosing that a Paperclip AI agent authored the message and which LLM was used; callers must provide the LLM name when posting those messages.
|
|
60
|
+
|
|
61
|
+
### Issue import and update behavior
|
|
62
|
+
|
|
63
|
+
- Imports one top-level Paperclip issue per GitHub issue.
|
|
64
|
+
- Can ignore GitHub issues from configured usernames such as `renovate`.
|
|
65
|
+
- Preserves the original GitHub issue title without adding a prefix.
|
|
66
|
+
- Uses the normalized GitHub issue body as the Paperclip issue description.
|
|
67
|
+
- Normalizes GitHub HTML that Paperclip descriptions cannot render cleanly, including constructs such as `<br>`, `<hr>`, `<details>`, `<summary>`, and inline images.
|
|
68
|
+
- Re-syncs descriptions so imported Paperclip issues stay aligned with the latest GitHub issue body.
|
|
69
|
+
- Repairs missing or stale descriptions when Paperclip create/update flows return incomplete issue content.
|
|
70
|
+
- Deduplicates repeated sync runs so previously imported GitHub issues are not recreated.
|
|
71
|
+
- Repairs stale or missing import-registry entries by reusing existing imported Paperclip issues when durable GitHub metadata or older source-link metadata is present.
|
|
72
|
+
- Continues tracking previously imported issues, including closed issues, so status and metadata can still be reconciled after the initial import.
|
|
73
|
+
|
|
74
|
+
### Labels and metadata
|
|
75
|
+
|
|
76
|
+
- Maps GitHub labels onto Paperclip issue labels.
|
|
77
|
+
- Prefers exact color matches when multiple Paperclip labels share the same name.
|
|
78
|
+
- Creates missing Paperclip labels through the local Paperclip API when the host URL is known.
|
|
79
|
+
- Re-syncs label changes, including removing labels that were removed on GitHub.
|
|
80
|
+
- Adds a GitHub detail tab on synced Paperclip issues showing:
|
|
81
|
+
- GitHub repository
|
|
82
|
+
- GitHub issue number and link
|
|
83
|
+
- GitHub state and close reason
|
|
84
|
+
- comment count
|
|
85
|
+
- linked pull requests
|
|
86
|
+
- synced labels
|
|
87
|
+
- last synced time
|
|
88
|
+
- Recovers older linked issues into the detail tab when legacy sync metadata exists, and refreshes that metadata on the next sync.
|
|
89
|
+
|
|
90
|
+
### Status synchronization
|
|
91
|
+
|
|
92
|
+
- Open GitHub issue with no linked pull request imports into the configured default Paperclip status, which defaults to `backlog`.
|
|
93
|
+
- Open GitHub issue with unfinished CI on a linked pull request maps to `in_progress`.
|
|
94
|
+
- Open GitHub issue with failing CI or unresolved review threads on a linked pull request maps to `todo`.
|
|
95
|
+
- Open GitHub issue with green CI and all review threads resolved maps to `in_review`.
|
|
96
|
+
- Closed GitHub issue completed as finished work maps to `done`.
|
|
97
|
+
- Closed GitHub issue closed as `not_planned` or `duplicate` maps to `cancelled`.
|
|
98
|
+
- New GitHub comments move an open imported Paperclip issue back to `todo` only when the new comment came from the original issue author or a repository maintainer/admin that the worker can verify through the GitHub API.
|
|
99
|
+
- Existing open issues that are already `backlog` stay in `backlog` until a human changes them in Paperclip.
|
|
100
|
+
- When the plugin changes a Paperclip issue status, it adds a Paperclip comment explaining the transition.
|
|
101
|
+
- When comment annotations are supported by the host, those transition comments also surface GitHub issue and pull request links directly under the comment.
|
|
102
|
+
|
|
103
|
+
### Resilience and safety
|
|
104
|
+
|
|
105
|
+
- Raw GitHub tokens are never persisted in plugin state.
|
|
106
|
+
- Raw GitHub tokens loaded from `~/.paperclip/plugins/github-sync/config.json` stay worker-local and are never returned by public data endpoints.
|
|
107
|
+
- Raw Paperclip board tokens are never persisted in plugin state or plugin config.
|
|
108
|
+
- Scheduled sync skips runs that are not due yet.
|
|
109
|
+
- Incomplete setup is surfaced as configuration guidance instead of silently failing.
|
|
110
|
+
- Authenticated deployments are detected before sync starts, and the plugin blocks sync until the required company board access has been connected.
|
|
111
|
+
- GitHub rate limiting pauses sync until the reported reset time and prevents pointless retries while the pause is active.
|
|
112
|
+
- Direct Paperclip REST label and issue calls attach the saved board token automatically when one has been connected for the mapping company.
|
|
113
|
+
- Sync failures retain repository and issue diagnostics to make troubleshooting easier.
|
|
114
|
+
|
|
115
|
+
## Paperclip surfaces added by this plugin
|
|
116
|
+
|
|
117
|
+
- Dashboard widget with setup/readiness messaging, last sync status, and a link to settings.
|
|
118
|
+
- Settings page for token validation, repository mappings, company-wide advanced defaults, save, and manual sync.
|
|
119
|
+
- Global toolbar action for a full sync.
|
|
120
|
+
- Project toolbar action for targeted project sync.
|
|
121
|
+
- Issue toolbar action for targeted issue sync.
|
|
122
|
+
- Issue detail tab for GitHub metadata.
|
|
123
|
+
- Comment annotation surface for GitHub references attached to sync-generated status transition comments.
|
|
124
|
+
|
|
125
|
+
## Requirements
|
|
126
|
+
|
|
127
|
+
- Node.js 20+
|
|
128
|
+
- `pnpm`
|
|
129
|
+
- A Paperclip host that supports plugin installation
|
|
130
|
+
- A GitHub token with API access to the repositories you want to sync
|
|
131
|
+
|
|
132
|
+
## Install from this repository
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
pnpm install
|
|
136
|
+
pnpm build
|
|
137
|
+
npx paperclip plugin install --local "$PWD"
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
If you are installing into an isolated local Paperclip instance for testing, include the Paperclip CLI flags you normally use for `--data-dir` and `--config`.
|
|
141
|
+
|
|
142
|
+
## Optional external worker config
|
|
143
|
+
|
|
144
|
+
If the Paperclip host cannot provide the GitHub token through environment variables or plugin config, the worker can also read an optional local file:
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"githubToken": "ghp_your_token_here"
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Save it at `~/.paperclip/plugins/github-sync/config.json`.
|
|
153
|
+
|
|
154
|
+
Notes:
|
|
155
|
+
|
|
156
|
+
- This file is read by the worker only.
|
|
157
|
+
- The raw token is not persisted into plugin state or plugin config.
|
|
158
|
+
- A GitHub token secret saved through the Paperclip settings UI still takes precedence over the external file.
|
|
159
|
+
|
|
160
|
+
## First-time setup in Paperclip
|
|
161
|
+
|
|
162
|
+
1. Open Paperclip instance settings and go to the plugin settings for **GitHub Sync** from inside the company you want to configure.
|
|
163
|
+
2. Paste a GitHub token and validate it.
|
|
164
|
+
3. Save the validated token so Paperclip can store it as a secret reference.
|
|
165
|
+
4. If the settings page reports that this Paperclip deployment requires board access, connect **Paperclip board access** from the same settings page and approve the new tab that opens.
|
|
166
|
+
5. Add one or more repository mappings for the current company.
|
|
167
|
+
6. For each mapping, either enable sync for an existing GitHub-linked Paperclip project or enter a GitHub repository and the Paperclip project name that should receive synced issues.
|
|
168
|
+
7. Optionally configure the company-wide advanced defaults for new imports: default assignee, default status, and ignored GitHub usernames.
|
|
169
|
+
8. Choose the automatic sync interval in minutes.
|
|
170
|
+
9. Save the settings.
|
|
171
|
+
10. Repeat inside any other Paperclip companies that should have their own mappings, defaults, or board access.
|
|
172
|
+
11. Run a manual sync to import the first batch of issues.
|
|
173
|
+
|
|
174
|
+
## Expected workflow
|
|
175
|
+
|
|
176
|
+
After setup, the dashboard widget shows whether the integration is ready, syncing, paused, or needs attention. When you open settings or the dashboard inside a company, the repository list and manual sync controls only affect that company. When you open a global instance view with no company context, the sync status and cadence reflect the shared plugin instance.
|
|
177
|
+
|
|
178
|
+
Imported issues stay linked to GitHub and continue to receive description, label, and status updates. GitHub-specific context stays out of the Paperclip issue description and instead appears in the dedicated GitHub detail tab and sync annotations.
|
|
179
|
+
|
|
180
|
+
## Troubleshooting notes
|
|
181
|
+
|
|
182
|
+
- If one company’s mappings disappear after saving another company’s setup, reopen plugin settings inside the affected company and confirm each company’s mappings separately; the settings page now keeps those mapping lists isolated per company.
|
|
183
|
+
- If sync says setup is incomplete, confirm that either a validated token secret has been saved or `~/.paperclip/plugins/github-sync/config.json` contains `githubToken`, at least one repository mapping has a created Paperclip project, and authenticated deployments have connected Paperclip board access for the current company.
|
|
184
|
+
- If token validation fails, confirm the token is still valid and can access the target repositories through the GitHub API.
|
|
185
|
+
- If the dashboard, toolbar, or settings page says board access is required, open plugin settings inside the target company and complete the Paperclip board access approval flow before retrying sync.
|
|
186
|
+
- If sync reports that the Paperclip API returned an authenticated HTML page instead of JSON, the worker is reaching a board URL that requires the browser login session. Connect Paperclip board access from plugin settings for that company, or set `PAPERCLIP_API_URL` for the Paperclip worker to a worker-accessible Paperclip API origin, then rerun sync.
|
|
187
|
+
- If sync says the Paperclip API URL is not trusted, reopen GitHub Sync from the current Paperclip host so the settings UI can refresh the trusted origin in plugin config, or set `PAPERCLIP_API_URL` for the worker.
|
|
188
|
+
- If GitHub rate limiting is hit, the plugin pauses sync until the reset time shown in Paperclip.
|
|
189
|
+
- If a sync takes longer than a quick action window, the plugin continues in the background and updates the UI when it finishes.
|
|
190
|
+
- If older imported issues are missing rich GitHub metadata, run sync once to refresh the link, labels, and pull request details.
|
|
191
|
+
|
|
192
|
+
## Developer scripts
|
|
193
|
+
|
|
194
|
+
- `pnpm typecheck` runs TypeScript without emitting files.
|
|
195
|
+
- `pnpm test` runs the package-level automated tests.
|
|
196
|
+
- `pnpm build` bundles the manifest and worker for Node execution and the hosted UI for browser execution into `dist/`.
|
|
197
|
+
- `pnpm dev` watches the manifest, worker, and UI bundles and rebuilds them into `dist/`.
|
|
198
|
+
- `pnpm dev:ui` starts a local Paperclip plugin UI dev server from `dist/ui` on port `4177`.
|
|
199
|
+
- `pnpm test:e2e` builds the plugin, boots an isolated Paperclip instance, installs the plugin, and verifies the hosted settings page renders.
|
|
200
|
+
- `pnpm verify:manual` builds the plugin, boots a Paperclip instance for manual inspection, seeds a project already mapped to `https://github.com/alvarosanchez/paperclip-github-plugin`, seeds a `CEO` agent on the Codex local adapter with model `gpt-5.4`, and opens the plugin settings page.
|
|
201
|
+
- Set `PAPERCLIP_E2E_CEO_BYPASS_APPROVALS_AND_SANDBOX=true` if you want that seeded `CEO` agent to opt into Codex's bypass flag during manual verification.
|
|
202
|
+
|
|
203
|
+
For fast hosted-UI iteration, run `pnpm dev` in one terminal and `pnpm dev:ui` in another.
|
|
204
|
+
|
|
205
|
+
## Release process
|
|
206
|
+
|
|
207
|
+
- Publishing is driven by `.github/workflows/release.yml`.
|
|
208
|
+
- The npm publish job is triggered by a published GitHub Release.
|
|
209
|
+
- The published version is derived from the GitHub release tag, not from the committed `package.json` version.
|
|
210
|
+
- Tags may be either `1.2.3` or `v1.2.3`; the workflow normalizes both to `1.2.3`.
|
|
211
|
+
- During the release workflow, the package version is stamped from the tag before build and publish, and the built plugin manifest uses that same resolved version.
|
|
212
|
+
- The release workflow is intended for npm trusted publishing through GitHub Actions OIDC, so no long-lived `NPM_TOKEN` secret is required when trusted publishing is configured correctly.
|
|
213
|
+
|
|
214
|
+
## License
|
|
215
|
+
|
|
216
|
+
This repository is licensed under Apache License 2.0. See [LICENSE](LICENSE).
|