@vibedropio/publisher 0.0.0-stage → 0.21.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 +201 -0
- package/README.md +20 -2
- package/dist/claude/.claude-plugin/marketplace.json +12 -0
- package/dist/claude/plugin/.claude-plugin/plugin.json +8 -0
- package/dist/claude/plugin/README.md +16 -0
- package/dist/claude/plugin/skills/publish-app/SKILL.md +302 -0
- package/dist/claude/plugin/skills/sync-app/SKILL.md +159 -0
- package/dist/publisher.cjs +25492 -0
- package/package.json +32 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
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,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Jeroen Minnaert
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
#
|
|
1
|
+
# publisher
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Publish an app's Git history to the serverless Git publishing backend.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install -g @vibedropio/publisher
|
|
7
|
+
publisher skills install # adds the publisher's skills to Claude Code
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Then ask Claude Code to publish your app. Without Claude Code:
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
publisher login # signs you in through your browser
|
|
14
|
+
publisher init . --name my-app
|
|
15
|
+
publisher sync # after every change: saves it and publishes it; no git needed
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Needs Node.js 22 (22.12 or later) or Node.js 24, and git 2.46 or later on `PATH`. The package is one bundled file, and the
|
|
19
|
+
Claude Code skills beside it, with no runtime dependencies.
|
|
20
|
+
|
|
21
|
+
Apache-2.0 licensed; see `LICENSE`.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vibedrop",
|
|
3
|
+
"owner": { "name": "VibeDrop" },
|
|
4
|
+
"description": "The publisher's Claude Code skills: publish an app and keep it in sync, without git.",
|
|
5
|
+
"plugins": [
|
|
6
|
+
{
|
|
7
|
+
"name": "git-publisher",
|
|
8
|
+
"source": "./plugin",
|
|
9
|
+
"description": "Publish an app folder and keep it updated (\"publish my app\", \"save my changes\", \"get the latest version\")."
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "git-publisher",
|
|
3
|
+
"displayName": "Git Publisher",
|
|
4
|
+
"version": "0.21.1",
|
|
5
|
+
"description": "Publish an app folder to the platform and keep it updated (\"publish my app\", \"update my app\", \"fetch the engineered version\").",
|
|
6
|
+
"author": { "name": "VibeDrop" },
|
|
7
|
+
"keywords": ["git", "publish", "deploy", "serverless"]
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Git Publisher plugin for Claude Code
|
|
2
|
+
|
|
3
|
+
Thin adapter: two skills (`publish-app`, `sync-app`) that drive the `publisher` CLI
|
|
4
|
+
(`@vibedropio/publisher`, `packages/cli`) from PATH. All publication, retry, resume and merge
|
|
5
|
+
logic lives in the shared client library; the skills only orchestrate, and a creator's changes are
|
|
6
|
+
saved and published with `publisher sync`, never with git.
|
|
7
|
+
|
|
8
|
+
It ships inside the npm package, and `publisher skills install` installs it into Claude Code.
|
|
9
|
+
|
|
10
|
+
Runtime requirements in the environment where Claude Code runs: the publisher installed
|
|
11
|
+
(`npm install -g @vibedropio/publisher`, Node.js 22 or 24), Git ≥ 2.46 on PATH, outbound HTTPS to
|
|
12
|
+
the portal's domain (sign-in and publishing at `/publish`) and the S3 bucket host for direct
|
|
13
|
+
uploads/downloads.
|
|
14
|
+
|
|
15
|
+
See `integrations/claude/README.md` for installation, authentication, uninstall and the verified
|
|
16
|
+
environments.
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: publish-app
|
|
3
|
+
description: Publish or update the user's app (a folder) with the publisher. Use when the user says "publish my app", "update my app", "save my changes", "push my changes", "save this version online", or asks to resolve an interrupted publication. Handles first-time setup, every later update, interruption recovery and conflicts by running the `publisher` command; never uses git to commit or push.
|
|
4
|
+
allowed-tools: Bash(publisher *), Bash(mkdir -p *), Bash(npm install -g @vibedropio/publisher*), Bash(git status *), Bash(git diff *), Bash(git log *)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Publish or update the user's app
|
|
8
|
+
|
|
9
|
+
You publish the user's app folder with the `publisher` command. All saving, merging, publishing,
|
|
10
|
+
retry and resume logic lives in it; your job is to run it, read its `--json` output, and tell the
|
|
11
|
+
user what happened in plain language. Never explain S3, packs, commits, sessions or tokens.
|
|
12
|
+
|
|
13
|
+
**When the user asks for the publisher, or for the platform it publishes to, use it at once.** Do not look at other ways to
|
|
14
|
+
host or share the app first.
|
|
15
|
+
|
|
16
|
+
**`publisher sync` is how a change is saved and published. Never run `git add`, `git commit`,
|
|
17
|
+
`git push` or `git stash` in the user's app folder**, and never add a git remote. `sync` records the
|
|
18
|
+
folder's changes itself — and leaves out `.env` files, keys, `node_modules` and anything larger than
|
|
19
|
+
50 MB, which a hand-made commit would not. You may read with `git status`, `git diff` and `git log`
|
|
20
|
+
to describe a change; nothing else.
|
|
21
|
+
|
|
22
|
+
Every command accepts `--json` and prints exactly one JSON object on stdout. Exit codes:
|
|
23
|
+
`0` success · `1` local/usage error · `2` rejected or conflict · `3` outcome not yet known · `4` authentication.
|
|
24
|
+
|
|
25
|
+
## 1. Preflight (run once)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
publisher --version
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If the command is not found, or the version is older than 0.16.0, install it:
|
|
32
|
+
`npm install -g @vibedropio/publisher@latest` (it needs Node.js 22 (22.12 or later) or Node.js 24). In a Claude Cowork task
|
|
33
|
+
this is normal: the sandbox starts empty every time, so install it without asking. On the person's
|
|
34
|
+
own computer, say in one line that you are installing the publisher. If `npm` itself is missing,
|
|
35
|
+
tell them Node.js 22 or 24 must be installed first, and stop.
|
|
36
|
+
|
|
37
|
+
### In a sandbox: keep the sign-in where the next command finds it
|
|
38
|
+
|
|
39
|
+
A sandbox (Claude Cowork, Claude Code on the web, a chat's code tool) can forget every file outside
|
|
40
|
+
its working folder between two commands. A sign-in kept in `/root/.config` is then gone at the
|
|
41
|
+
next command. So in a sandbox, do this from the start:
|
|
42
|
+
|
|
43
|
+
- Put `GIT_PUBLISHER_CREDENTIALS=<working folder>/.publisher/credentials.json` in front of
|
|
44
|
+
**every** `publisher` command. Use the absolute path of the folder the task works in. Never use
|
|
45
|
+
`/root` or `/tmp`, and never a path inside the app folder.
|
|
46
|
+
- Do nothing about `TMPDIR`. The publisher uses `/tmp` when `TMPDIR` names a folder that does not
|
|
47
|
+
exist, and says so in one line.
|
|
48
|
+
|
|
49
|
+
On the person's own computer, use neither: the default place is kept.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
publisher doctor --json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
- `gitOk:false` → tell the user Git 2.43 or later must be installed; stop.
|
|
56
|
+
- Otherwise do exactly what **`next.action`** says. `doctor` works this out for you, and the same
|
|
57
|
+
`next` object rides on `error.details` of any command that cannot resolve a connection — so you
|
|
58
|
+
never have to interpret `credentials`, `endpoint` or `profiles` yourself.
|
|
59
|
+
|
|
60
|
+
| `next.action` | What it means | What to do |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| `"ready"` | Signed in and pointed somewhere. | **Nothing. Go to step 2 and do not mention any of this.** |
|
|
63
|
+
| `"sign-in"` | Not connected to anything yet. | **Ask them nothing** — `next.ask` is `null`. Run `next.command` the way "Signing in" below says. Use `--portal <url>` only if they say they are on a different platform. |
|
|
64
|
+
| `"choose-profile"` | Several places are set up and none is marked usual. | Show `next.profiles` and ask `next.ask`. Then run `next.command` with the name they picked. |
|
|
65
|
+
| `"reauthenticate"` | The place is known; the credential is gone or expired. | Run `next.command` the way "Signing in" below says. `next.ask` is `null` — do **not** ask them for anything; the browser sign-in asks them itself. |
|
|
66
|
+
| `"bind-endpoint"` | A token is set in the environment, but nothing said where it may go. | **Stop** and tell them publishing is blocked by a token set in this shell. `next.command` is `null` on purpose: never set `GIT_PUBLISHER_ENDPOINT` or pass `--endpoint` yourself — that is exactly the choice the check leaves to whoever set the token. |
|
|
67
|
+
|
|
68
|
+
### Signing in
|
|
69
|
+
|
|
70
|
+
`publisher login` waits until the code it prints is approved, and your shell may show nothing until
|
|
71
|
+
a command ends. So sign in with two short commands instead of one that waits:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
publisher login --no-wait --json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
It prints one JSON object with `userCode` and `verificationUri`, and `next.command`. Then:
|
|
78
|
+
|
|
79
|
+
1. **If a tool named `approve_publisher_sign_in` is available** (the connector of the platform, which the
|
|
80
|
+
person connected in Claude's settings), call it with `userCode`. It approves nothing: it answers
|
|
81
|
+
a link with the code in it. Give the person that link, and ask them to check the code and
|
|
82
|
+
approve the sign-in there.
|
|
83
|
+
2. Otherwise give the person `verificationUri` as a link they can click, and `userCode`, and say
|
|
84
|
+
the page will ask them to sign in with their work account.
|
|
85
|
+
3. Run `next.command` — it is `publisher login --continue --json`. It returns `ok: true` within
|
|
86
|
+
seconds of the approval. If it returns `state: "pending"`, the code is not approved yet: wait
|
|
87
|
+
for the person, then run it again. It refuses after ten minutes; then start again.
|
|
88
|
+
4. **Check that the sign-in was kept before you publish**: run `publisher doctor --json` as a NEW
|
|
89
|
+
command. `next.action` must be `"ready"`. If it is not, or a command says the sign-in or the
|
|
90
|
+
waiting sign-in was not kept (its message names the file it looked for), this environment
|
|
91
|
+
forgot the file: keep it in another folder, as the section above says, and sign in again.
|
|
92
|
+
|
|
93
|
+
In a Claude Cowork task this happens again in every new task, because the sandbox forgets the
|
|
94
|
+
sign-in when the task ends. The tool never returns a credential, and you never need one.
|
|
95
|
+
|
|
96
|
+
**Never ask the user for a token, an endpoint, a URL or a credential — in any words.** They are
|
|
97
|
+
publishing an app; they do not know what those are, and you do not need them: `login` discovers
|
|
98
|
+
where publishing lives and signs them in through their browser. `next.ask` is `null` whenever
|
|
99
|
+
nothing needs asking, which is every case except choosing between connections they already
|
|
100
|
+
have; when it is not null it is already phrased for them, so pass it on rather than rewriting it.
|
|
101
|
+
|
|
102
|
+
If they name an environment ("publish to dev"), pass `--profile dev` on each command rather than
|
|
103
|
+
changing their default.
|
|
104
|
+
|
|
105
|
+
## 2. A new app: make it before you write it
|
|
106
|
+
|
|
107
|
+
When the person asks for a NEW app, make it before you write a file. Do step 1 first, then:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
mkdir -p <folder>
|
|
111
|
+
publisher init <folder> --name "<app name>" --json
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
`init` makes the app and links the folder to it. It publishes nothing and starts no checks. While
|
|
115
|
+
you write the app, the platform prepares its hosting, so the first publication goes live in
|
|
116
|
+
seconds, not in a minute. The folder must exist, and it can be empty. Its output names the app
|
|
117
|
+
under `appId`. Then write the app into that folder, and publish it with step 3, without `--name`.
|
|
118
|
+
|
|
119
|
+
If the app is already written and was never published, `init` gains nothing. Run step 3 in the
|
|
120
|
+
app folder and add `--name "<app name>"`: that one `sync` makes the app, and then publishes it.
|
|
121
|
+
|
|
122
|
+
The first `sync` prepares the folder with an explicit file selection: it excludes `.git`,
|
|
123
|
+
`node_modules`, build caches, `.env*`, keys/certificates and files larger than 50 MB, and it
|
|
124
|
+
respects `.gitignore`. Show the user the excluded files it reports so they know what was left out
|
|
125
|
+
(the exclusion rules are a safety net, not a secret scanner).
|
|
126
|
+
|
|
127
|
+
## 3. Every publish, the first one included
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
publisher sync . --message "<a few words on what changed>" --until-change --timeout 100 --json
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
That one command records what changed in the folder, brings in anything published meanwhile (a
|
|
134
|
+
fast-forward or a clean merge — it never rewrites the user's work), and publishes the result. Its
|
|
135
|
+
`timings` say how long each stage took (milliseconds): `discovery`, `authentication`, `link`,
|
|
136
|
+
`prepare`, `upload`, and — once the app is followed — `received`, `checks` and `deployment`. Quote
|
|
137
|
+
them when the person asks why it was slow. Write
|
|
138
|
+
the message in the user's words ("Add a contact page"), not git's.
|
|
139
|
+
|
|
140
|
+
A published app runs with no internet access: **apps can’t load anything from other sites** — no
|
|
141
|
+
CDN scripts, web fonts or remote images — and can’t call other sites for data: connect the data as
|
|
142
|
+
a data source instead. When you write or change an app, keep every file it needs in its folder. The checks refuse an app that does not (see "When the checks find something").
|
|
143
|
+
Keep it small too: each file at most 4 MB, the whole app at most 10 MB, at most 500 files —
|
|
144
|
+
a larger app is refused before it is checked, and the refusal names the file or the limit it broke.
|
|
145
|
+
|
|
146
|
+
An app is one folder in one of three shapes: static files with `index.html` at the root, a
|
|
147
|
+
standard-library Python `app.py`, or a Node.js `server.mjs` beside a `package.json` of exactly
|
|
148
|
+
`{"type":"module","scripts":{"start":"node server.mjs"}}`. It has no build step and no npm or pip
|
|
149
|
+
dependencies. Only .html .js .mjs .py .css .csv .json .svg .txt files are part of the app: any
|
|
150
|
+
other file, such as an image, an icon or a font, is left out, so draw images as SVG and use system
|
|
151
|
+
font stacks.
|
|
152
|
+
|
|
153
|
+
## 4. Telling them how it goes, step by step
|
|
154
|
+
|
|
155
|
+
After a publish, the app goes through four steps: **received**, **checked**, **going live**,
|
|
156
|
+
**live**. It takes a few minutes, and the person sees nothing unless you tell them. So the command
|
|
157
|
+
returns as soon as the next step starts (`--until-change`), and you tell them, then wait for the
|
|
158
|
+
next one:
|
|
159
|
+
|
|
160
|
+
1. Read the result from the LAST line of the output (the lines before it are the steps, as JSON).
|
|
161
|
+
2. If `progress.kind` is `"moving"` or `"timed-out"`, the app is still on its way. Tell the person
|
|
162
|
+
where it is in one short sentence, in their language — `progress.hint` says it ("Now: going
|
|
163
|
+
live.") — then run `progress.next.command` exactly as given, adding `--timeout 100`.
|
|
164
|
+
3. Repeat until `progress.kind` is anything else, for up to about 15 minutes in all. Then tell them
|
|
165
|
+
how it ended (below).
|
|
166
|
+
|
|
167
|
+
Name a step only by its `word` — **received**, **checked**, **going live**, **live** — never by
|
|
168
|
+
its `stage` name, and never a step no line said. Each call starts by printing the steps as they
|
|
169
|
+
stand: tell only what is new.
|
|
170
|
+
|
|
171
|
+
**If a command was cut off while following**, the publication had already succeeded before the
|
|
172
|
+
following began: say it is published, and follow it with `publisher follow <folder> --publication
|
|
173
|
+
<publicationId> --until-change --timeout 100 --json` (the id is in the `sync` output's
|
|
174
|
+
`publication`, or `publisher status`). Do not run `sync` again to find out. `--no-wait` skips the
|
|
175
|
+
following, for when the person asks not to wait.
|
|
176
|
+
|
|
177
|
+
`state` says what happened; `hint` is one sentence you may pass on as it is.
|
|
178
|
+
|
|
179
|
+
- `"published"` → the app was published. Mention what was recorded (`recorded.committed`) and, if
|
|
180
|
+
`recorded.excluded` is not empty, what was left out and why. Then read `progress` (null with
|
|
181
|
+
`--no-wait`) and pass on its `hint`:
|
|
182
|
+
- `kind: "settled"` with `ending` `"live"`: the app is live. `"not-deployed"`: published and
|
|
183
|
+
checked, and this organization does not deploy automatically. `"failed"` with `findings`: it
|
|
184
|
+
did not pass its checks, and `findings` says why — fix them as "When the checks find something"
|
|
185
|
+
below says. `"failed"` without `findings`: it stopped at `failedAt`; the portal says why — do
|
|
186
|
+
not guess the reason. A fault on our side can be tried again: to find out, run `publisher
|
|
187
|
+
question . --json` and follow the `sync-app` skill's section
|
|
188
|
+
"When it did not go live because of a fault on our side".
|
|
189
|
+
`"stopped"`: a newer publication replaced it.
|
|
190
|
+
- `"moving"` or `"timed-out"`: still going; follow it as step 4 says. After about 15 minutes in
|
|
191
|
+
all, stop and point them to the portal (`progress.portal`).
|
|
192
|
+
- `"unauthorized"`: published, but the portal did not accept this sign-in; run `publisher login`
|
|
193
|
+
before the next publish.
|
|
194
|
+
- `"unavailable"`, `"forbidden"` or `"malformed"`: the publish itself succeeded, but this
|
|
195
|
+
terminal cannot show the steps. Tell them to follow it in the portal. Never report a step that
|
|
196
|
+
no `stage` line said.
|
|
197
|
+
- `"up_to_date"` → nothing new to publish; the service already has this version.
|
|
198
|
+
- `"conflict"` → the user's change and a published change touched the same lines of
|
|
199
|
+
`conflicts[]`. **Nothing was published and nothing was lost.** Do not resolve it on your own and
|
|
200
|
+
never publish with `--force`. Follow the `sync-app` skill's conflict section.
|
|
201
|
+
- `"rejected"` with `publication.rejection.code`:
|
|
202
|
+
- `NON_FAST_FORWARD` / `STALE_GENERATION` / `EXPECTED_OLD_MISMATCH`: somebody published in the
|
|
203
|
+
moment between the merge and the publish. Run `publisher sync . --json` once more
|
|
204
|
+
(`publication.next.command` says the same).
|
|
205
|
+
- `REF_FORBIDDEN`: the user may not publish this branch; tell them which branch and stop.
|
|
206
|
+
When it comes as `error.code` with a `hint`, a limit of the organization refused it: tell them
|
|
207
|
+
the reason and whom to ask that the `hint` gives, and stop.
|
|
208
|
+
When `error.details.feature` names a feature, that feature is off for the organization: pass on
|
|
209
|
+
the `hint` as it is, and stop. Nobody in the organization can turn it on, so name nobody to ask.
|
|
210
|
+
- `MISSING_OBJECTS`: the local copy is incomplete (for example a shallow clone). Tell the user to
|
|
211
|
+
publish from a complete copy: `publisher checkout <new folder> --repo <id>`.
|
|
212
|
+
- `LIMIT_EXCEEDED`, `PACK_INVALID`: quote the message; suggest removing very large files from the
|
|
213
|
+
folder if the message mentions size.
|
|
214
|
+
- `REPOSITORY_MOVED`: see "When the app moved" below.
|
|
215
|
+
- `"unknown"` / exit code 3: the publication was sent but its outcome is not known yet. Run
|
|
216
|
+
`publisher status . --json`; it waits for and resolves interrupted publications without creating
|
|
217
|
+
duplicates. Repeat once if it still says `finalizing`.
|
|
218
|
+
- Exit code 4: run `publisher doctor --json` and follow `next.action` (normally `reauthenticate`:
|
|
219
|
+
run `next.command`). Never ask the user for a token.
|
|
220
|
+
|
|
221
|
+
### When the app moved
|
|
222
|
+
|
|
223
|
+
`REPOSITORY_MOVED` means the app moved to another organization (the person's team adopted it).
|
|
224
|
+
This folder can no longer publish; nothing was lost, and it can still be read. It comes as a
|
|
225
|
+
`"rejected"` publication, or as `error.code` when the publish was refused before it started; both
|
|
226
|
+
carry a `hint` and `details.movedTo` (in `publication.rejection.details` or `error.details`).
|
|
227
|
+
Pass the `hint` on, then:
|
|
228
|
+
|
|
229
|
+
1. Tell the person to sign in again and choose the organization the app moved to:
|
|
230
|
+
`publisher login`. Never ask them for a token.
|
|
231
|
+
2. Find the app there: `publisher checkout <new folder> --repo <details.movedTo> --json` when
|
|
232
|
+
`details.movedTo` is set; otherwise `publisher list --json` and pick the app by its name.
|
|
233
|
+
3. Make the change again in the new folder (copy over what this folder had that was not published),
|
|
234
|
+
and publish from there. Do not try to publish this folder again, and never use `--force`.
|
|
235
|
+
|
|
236
|
+
### When the checks find something
|
|
237
|
+
|
|
238
|
+
Before an app goes live the platform opens it in a browser, with no internet access, and checks
|
|
239
|
+
it loads cleanly. When it does not, `progress.findings` lists what it found, each with a `fix`
|
|
240
|
+
sentence, and `progress.next.action` is `"fix"`. Then:
|
|
241
|
+
|
|
242
|
+
1. Tell the person in one sentence that the app did not pass its checks and that you will fix it.
|
|
243
|
+
Their original app is still what is published; nothing broke.
|
|
244
|
+
2. Fix every finding in the app folder, by its `kind`:
|
|
245
|
+
- `external-resource`: the app loads `url` from another site (a CDN script, Google Fonts, an
|
|
246
|
+
image). **Apps can’t load anything from other sites.** Download the file into the app
|
|
247
|
+
folder and point to it with a relative path, if it is at most 4 MB (a charting library
|
|
248
|
+
such as Chart.js, about 200 KB, fits). Otherwise replace it with code of your own: a
|
|
249
|
+
font falls back to a system font stack, a chart is drawn as inline SVG. Never keep the
|
|
250
|
+
external address.
|
|
251
|
+
- `external-request`: the app CALLS `url` on another site for data (`fetch`, an API).
|
|
252
|
+
**Apps can't reach other sites.** Do not copy anything: remove the call, or bring the data
|
|
253
|
+
into the app as a data source (the `data_sources` tool, or `publisher data add`), and read
|
|
254
|
+
it from there.
|
|
255
|
+
- `server-start`: the app's server stopped before it answered `/`. `message` is the error it
|
|
256
|
+
printed and where. Fix that line, and run the server with `PORT` set to try it.
|
|
257
|
+
- `console-error` / `application-error`: fix the code that logs or throws `message`.
|
|
258
|
+
- `failed-request`: the app asks for `path` on its own site and gets `status`; add the file or
|
|
259
|
+
stop requesting it.
|
|
260
|
+
- `missing-request`: the app never loaded its company data from `path`; make it read from there.
|
|
261
|
+
- `missing-text` / `page-load`: the page did not show its results, or did not finish loading
|
|
262
|
+
(for example a `fetch` whose response is never read); make it render without waiting.
|
|
263
|
+
3. Run `progress.next.command` (it is `publisher sync <folder> --until-change --json`) and follow
|
|
264
|
+
the new publication as step 4 says. Fix and publish again at most twice for the same findings;
|
|
265
|
+
if they come back a third time, stop and tell the person what is still found.
|
|
266
|
+
|
|
267
|
+
Never tell the person a finding's `url` or `message` is a secret or their data — the platform has
|
|
268
|
+
already removed both. Do not invent findings that are not in the list.
|
|
269
|
+
|
|
270
|
+
## 5. A folder that starts empty
|
|
271
|
+
|
|
272
|
+
On a new computer, or in a Claude Cowork task (whose sandbox starts empty every time), the app the
|
|
273
|
+
person means is not here yet. Find it, and bring it into a new folder:
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
publisher list --json
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
`apps[]` lists what they published, newest first, each with its `name` and a `checkout` command.
|
|
280
|
+
Ask which one only if the name does not settle it, then run its `checkout` command and work in that
|
|
281
|
+
folder. Never `init` or `sync` an empty new folder in its place: that makes a second app.
|
|
282
|
+
|
|
283
|
+
## If the service cannot be reached
|
|
284
|
+
|
|
285
|
+
In a sandbox (Claude Cowork, Claude Code on the web) a `NETWORK` error, or `CONNECT tunnel failed,
|
|
286
|
+
response 403`, usually means the sandbox's network does not allow the platform. Tell the person that
|
|
287
|
+
their Claude settings must allow the platform's domain and its storage (`*.s3.<region>.amazonaws.com`)
|
|
288
|
+
under Settings → Capabilities, or that their organization's owner must, on a Team or Enterprise plan.
|
|
289
|
+
Do not retry until they say it is done.
|
|
290
|
+
|
|
291
|
+
## 6. Interrupted earlier?
|
|
292
|
+
|
|
293
|
+
If a previous publish was interrupted (network loss, closed session), `publisher status . --json`
|
|
294
|
+
resumes or resolves it. Always run it before starting a new sync when the last result was unknown.
|
|
295
|
+
|
|
296
|
+
## Rules
|
|
297
|
+
|
|
298
|
+
- `publisher sync` is the only way a change is saved and published. Never `git add`, `git commit`,
|
|
299
|
+
`git push`, `git stash`, `git reset`, `git rebase`, and never modify remotes.
|
|
300
|
+
- Never print tokens or signed URLs. The publisher already redacts them.
|
|
301
|
+
- Never publish with `--force` unless the user explicitly asks to overwrite the published history
|
|
302
|
+
and understands the other side's changes will be discarded.
|