costaff-workspace 0.1.0 → 0.1.3

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 CHANGED
@@ -1,90 +1,181 @@
1
1
  # costaff-workspace
2
2
 
3
- Publish documents, decks and workbooks to [CoStaff Workspace](https://workspace.costaffs.app),
4
- and pull their source back out to keep working on them.
3
+ **English** · [繁體中文](README.zh-TW.md)
5
4
 
6
- Built for projects made with [open-doc](https://github.com/simonliu-ai-product/open-doc),
7
- open-slide and open-sheet.
5
+ Turn a document you built on your own machine into a link you can send someone.
6
+
7
+ Works with projects made using [open-doc](https://github.com/simonliu-ai-product/open-doc)
8
+ (documents), open-slide (decks) and open-sheet (workbooks).
9
+
10
+ ---
11
+
12
+ ## 1. Install it
13
+
14
+ You need [Node.js](https://nodejs.org) 20 or newer. Check with `node -v`.
8
15
 
9
16
  ```bash
10
17
  npm i -g costaff-workspace
18
+ ```
19
+
20
+ Confirm it is there:
21
+
22
+ ```bash
23
+ costaff-workspace --help
24
+ ```
25
+
26
+ <details>
27
+ <summary>If the command is not found</summary>
28
+
29
+ Your shell cannot see where npm puts global commands. `npm prefix -g` prints
30
+ that folder; add its `bin` to your `PATH`. With pnpm, run `pnpm setup` once.
31
+ </details>
32
+
33
+ ## 2. Build your project
34
+
35
+ Publishing sends the **built** files, so build first.
11
36
 
37
+ ```bash
12
38
  cd my-doc
39
+ pnpm install
40
+ pnpm build
41
+ ```
42
+
43
+ You should now have a `dist/` folder. If your project builds somewhere else,
44
+ remember the name — you will pass it in step 3.
45
+
46
+ ## 3. Push
47
+
48
+ ```bash
13
49
  costaff-workspace push
14
50
  ```
15
51
 
16
- That is the whole command. In a project folder it works the rest out: the folder
17
- name is the slug, `package.json` says whether this is a document, a deck or a
18
- workbook, `dist/` is the built bundle, and the source travels with it so the file
19
- can be pulled back and edited. Every guess is printed, and a guess it cannot make
20
- stops the push rather than inventing something.
52
+ ### The first time, it asks you to sign in
53
+
54
+ ```
55
+ Sign in to CoStaff Workspace
56
+ open https://workspace.costaffs.app/activate?code=WXYZ-1234
57
+ code WXYZ-1234
58
+ ```
59
+
60
+ Open that address in a browser. **The code is already in the link**, so you only
61
+ have to approve it. The command waits, then carries on by itself.
62
+
63
+ This machine stays signed in. You will not see this again.
64
+
65
+ ### Then it publishes
66
+
67
+ ```
68
+ 4 documents — one bundle each
69
+ getting-started → https://workspace.costaffs.app/dcuk0lmf875ctrgxfppa
70
+ q3-numbers → https://workspace.costaffs.app/8fjq2ldk3nx7yrpv0aet
71
+ team-offsite → https://workspace.costaffs.app/pv0aet8fjq2ldk3nx7yr
72
+ budget-2027 → https://workspace.costaffs.app/3nx7yrpv0aet8fjq2ldk
73
+ ```
74
+
75
+ Those links are the files. Send one to someone and they can read it.
76
+
77
+ ## 4. Manage what you published
78
+
79
+ Go to **<https://workspace.costaffs.app>** to rename files, put them in folders,
80
+ and decide who may read each one.
81
+
82
+ > **A newly pushed file is private.** Only you can open it until you say
83
+ > otherwise in the file manager. Sending someone the link is not enough — you
84
+ > invite them, or you turn the file into a public link, there.
21
85
 
22
- The first push shows a device code to authorise in a browser. That machine stays
23
- signed in afterwards.
86
+ ---
24
87
 
25
- ## Commands
88
+ ## Doing it again
89
+
90
+ **You changed something.** Build and push again. **The link stays the same** —
91
+ whoever you sent it to sees the new version.
92
+
93
+ ```bash
94
+ pnpm build && costaff-workspace push
95
+ ```
96
+
97
+ **You are on a different computer.** Fetch the project back with the token — the
98
+ last part of the link:
26
99
 
27
100
  ```bash
28
- costaff-workspace push # push this folder
29
- costaff-workspace pull <token> [dir] # fetch a published file's source
30
- costaff-workspace login # sign this machine in
31
- costaff-workspace logout # forget this machine's sign-in
101
+ costaff-workspace pull dcuk0lmf875ctrgxfppa my-doc
102
+ cd my-doc
103
+ pnpm install
32
104
  ```
33
105
 
34
- Useful flags on `push`:
106
+ What comes back is a complete project. Edit it, build it, push it, and the same
107
+ link updates.
35
108
 
36
- | Flag | |
109
+ **You want to check before publishing.** This packages everything and reports
110
+ what it would send, without uploading and without needing a network:
111
+
112
+ ```bash
113
+ costaff-workspace push --dry-run
114
+ ```
115
+
116
+ ---
117
+
118
+ ## You usually pass no options at all
119
+
120
+ Run in a project folder, `push` works out the rest and **prints every guess**:
121
+
122
+ ```
123
+ guessed --slug my-report --kind deck --source-dir .
124
+ ```
125
+
126
+ | It guesses | From |
37
127
  | --- | --- |
38
- | `--slug`, `--kind`, `--title` | override a guess |
39
- | `--site-dir <dir>` | the built bundle (default `dist`) |
40
- | `--no-source` | publish the bundle alone — nothing can be pulled back out of it |
41
- | `--dry-run` | package and report, without uploading or needing a network |
42
- | `--endpoint <url>` | a receiver you run yourself |
128
+ | the file's identity (`--slug`) | the folder's name |
129
+ | document, deck or workbook (`--kind`) | what your `package.json` depends on |
130
+ | the built files (`--site-dir`) | `dist` |
131
+ | the title | your `package.json` description, else the slug |
43
132
 
44
- ## A project is a site of many documents
133
+ If a guess is wrong, pass that one option. If it cannot guess at all it stops and
134
+ says so, rather than inventing something.
45
135
 
46
- An open-doc project is not one file — it is a site holding several documents
47
- under `docs/`, and one `open-doc build` puts all of their chunks in a single
48
- `assets/` directory. So `push` builds each document into a bundle of its own and
49
- pushes them one at a time.
136
+ ### Options
50
137
 
51
- That is not tidiness. A share can only withhold the rest of a workspace if the
52
- rest of the workspace is not in the bundle: inside a shared build, anyone holding
53
- a link to one document can fetch the chunks of the others. The cost is real — N
54
- builds instead of one, and assets repeated across them.
138
+ | Option | Use it when |
139
+ | --- | --- |
140
+ | `--title "Q3 report"` | you want a different name in the file manager |
141
+ | `--slug q3-report` | the folder name is not the identity you want |
142
+ | `--kind document\|deck\|workbook` | it guessed the wrong kind |
143
+ | `--site-dir build` | your build output is not in `dist` |
144
+ | `--dry-run` | you want to check before sending |
145
+ | `--no-source` | you want to publish the built files alone |
55
146
 
56
- ## The protocol is public
147
+ `costaff-workspace push --help` lists all of them.
57
148
 
58
- `src/protocol.ts` is a specification, not an implementation detail. Anyone can
59
- run their own receiver and point `--endpoint` at it; `COSTAFF_WORKSPACE_ENDPOINT`
60
- does the same thing for a whole shell.
149
+ ---
61
150
 
62
- Adding a required field is a breaking change for every third-party receiver, so
63
- optional is the default. `source` is optional: a push without it is still valid,
64
- and a receiver that ignores it still serves. `pull` is optional in the discovery
65
- document — a receiver that cannot hand source back omits the field rather than
66
- answering 404 to a command the CLI thought it had.
151
+ ## Worth knowing
67
152
 
68
- ## What travels with the source
153
+ **Your source goes up too, and that is on purpose.** It is what lets `pull` hand
154
+ you a working project back later, on any machine. `node_modules` and dotfiles are
155
+ never collected — **your `.env` does not travel**. `--no-source` opts out, and
156
+ then nothing can be pulled back out of that file afterwards.
69
157
 
70
- `node_modules` and dotfiles are not collected. `.env` is inside that.
158
+ **A project with several documents takes longer than one build.** Each document
159
+ is built into a bundle of its own. It has to be: inside one shared build, anyone
160
+ you send a single document to can reach all the others.
71
161
 
72
- Local dependency specs (`link:`, `file:`, `workspace:`, `portal:`) are replaced
73
- with the version actually installed, because a path on the author's disk exists
74
- on no other machine. A version that cannot be resolved refuses the push — a
75
- published path nobody can resolve buys an install failure that talks about a
76
- missing directory instead of a broken dependency.
162
+ **A file someone shared with you comes back as a copy.** It carries no link, so
163
+ pushing it publishes it under your own account. The original is untouched.
77
164
 
78
- ## What comes back depends on who you are
165
+ ---
79
166
 
80
- The server decides, not the client.
167
+ ## When something goes wrong
81
168
 
82
- | | You get | Pushing it back |
83
- | --- | --- | --- |
84
- | Owner | includes the token | updates the same link |
85
- | Shared with you | no token | publishes at a new link of your own; the original is untouched |
169
+ | It says | What it means, and what to do |
170
+ | --- | --- |
171
+ | `No site at dist build it first.` | There is nothing built to publish. Run your project's build. |
172
+ | `dist has no index.html it is not a publishable site.` | The build ran but produced no page. Check your build settings. |
173
+ | `cannot make a slug out of the folder name` | The folder's name has no letters or digits usable as an identity — a folder named in Chinese, for example. Pass `--slug my-report`. |
174
+ | `Sign in first — run with --login.` | Run `costaff-workspace login`. |
175
+ | `Sign-in code expired.` / `Sign-in timed out.` | The code only lasts a few minutes. Just push again for a new one. |
176
+ | `… is not a CoStaff Workspace endpoint` | The service could not be reached — check your connection, then try again. |
177
+ | `No file at that token.` | Wrong token, or the file is not yours and was not shared with you. |
86
178
 
87
- Two clients each deciding who owns a file would eventually disagree.
88
179
 
89
180
  ## Licence
90
181
 
@@ -0,0 +1,173 @@
1
+ # costaff-workspace
2
+
3
+ [English](README.md) · **繁體中文**
4
+
5
+ 把你在自己電腦上做好的文件,變成一條可以傳給別人的連結。
6
+
7
+ 適用於用 [open-doc](https://github.com/simonliu-ai-product/open-doc)(文件)、
8
+ open-slide(簡報)、open-sheet(試算表)做的專案。
9
+
10
+ ---
11
+
12
+ ## 1. 安裝
13
+
14
+ 需要 [Node.js](https://nodejs.org) 20 以上。用 `node -v` 確認。
15
+
16
+ ```bash
17
+ npm i -g costaff-workspace
18
+ ```
19
+
20
+ 確認裝好了:
21
+
22
+ ```bash
23
+ costaff-workspace --help
24
+ ```
25
+
26
+ <details>
27
+ <summary>如果顯示「找不到指令」</summary>
28
+
29
+ 你的 shell 看不到 npm 放全域指令的地方。`npm prefix -g` 會印出那個資料夾,把它底下的
30
+ `bin` 加進 `PATH`。如果你用 pnpm,跑一次 `pnpm setup` 就好。
31
+ </details>
32
+
33
+ ## 2. 先建置你的專案
34
+
35
+ 發佈送出去的是**建置後的檔案**,所以要先建置。
36
+
37
+ ```bash
38
+ cd my-doc
39
+ pnpm install
40
+ pnpm build
41
+ ```
42
+
43
+ 跑完應該會出現一個 `dist/` 資料夾。如果你的專案輸出到別的地方,記住那個名字,
44
+ 第 3 步會用到。
45
+
46
+ ## 3. 推上去
47
+
48
+ ```bash
49
+ costaff-workspace push
50
+ ```
51
+
52
+ ### 第一次會請你登入
53
+
54
+ ```
55
+ Sign in to CoStaff Workspace
56
+ open https://workspace.costaffs.app/activate?code=WXYZ-1234
57
+ code WXYZ-1234
58
+ ```
59
+
60
+ 用瀏覽器打開那個網址。**驗證碼已經在網址裡**,所以你只要按同意。指令會自己等著,
61
+ 授權完就繼續。
62
+
63
+ 這台機器之後就記住登入了,不會再問。
64
+
65
+ ### 然後它就發佈了
66
+
67
+ ```
68
+ 4 documents — one bundle each
69
+ getting-started → https://workspace.costaffs.app/dcuk0lmf875ctrgxfppa
70
+ q3-numbers → https://workspace.costaffs.app/8fjq2ldk3nx7yrpv0aet
71
+ team-offsite → https://workspace.costaffs.app/pv0aet8fjq2ldk3nx7yr
72
+ budget-2027 → https://workspace.costaffs.app/3nx7yrpv0aet8fjq2ldk
73
+ ```
74
+
75
+ 那些連結就是檔案本身。傳一條給別人,他就能讀。
76
+
77
+ ## 4. 管理你發佈的東西
78
+
79
+ 到 **<https://workspace.costaffs.app>** 改名字、分資料夾,以及決定每一份誰可以看。
80
+
81
+ > **剛推上去的檔案是私人的。** 在檔案管理員裡設定之前,只有你打得開。
82
+ > **光是把連結傳給別人是不夠的**——你要在那裡邀請他,或是把檔案改成公開連結。
83
+
84
+ ---
85
+
86
+ ## 之後要再做的事
87
+
88
+ **你改了內容。** 重新建置再推一次。**連結不會變**——你傳出去的那條會直接看到新版本。
89
+
90
+ ```bash
91
+ pnpm build && costaff-workspace push
92
+ ```
93
+
94
+ **你換了一台電腦。** 用 token(連結的最後一段)把專案取回來:
95
+
96
+ ```bash
97
+ costaff-workspace pull dcuk0lmf875ctrgxfppa my-doc
98
+ cd my-doc
99
+ pnpm install
100
+ ```
101
+
102
+ 拿回來的是一個完整的專案。改完、建置、推上去,同一條連結就更新了。
103
+
104
+ **你想在發佈前先確認。** 這會把東西打包好並回報要送出什麼,但不上傳,也不需要網路:
105
+
106
+ ```bash
107
+ costaff-workspace push --dry-run
108
+ ```
109
+
110
+ ---
111
+
112
+ ## 你通常一個參數都不用打
113
+
114
+ 在專案資料夾裡執行,`push` 會自己推斷,而且**每一個猜測都會印出來**:
115
+
116
+ ```
117
+ guessed --slug my-report --kind deck --source-dir .
118
+ ```
119
+
120
+ | 它會猜 | 依據 |
121
+ | --- | --- |
122
+ | 檔案的身分(`--slug`) | 資料夾的名字 |
123
+ | 是文件、簡報還是試算表(`--kind`) | 你 `package.json` 裡的相依套件 |
124
+ | 建置產物在哪(`--site-dir`) | `dist` |
125
+ | 標題 | `package.json` 的 description,沒有就用 slug |
126
+
127
+ 猜錯就只補那一個參數。**完全猜不出來的時候它會停下來說明,不會憑空編一個。**
128
+
129
+ ### 參數
130
+
131
+ | 參數 | 什麼時候用 |
132
+ | --- | --- |
133
+ | `--title "第三季報告"` | 你想在檔案管理員裡顯示別的名字 |
134
+ | `--slug q3-report` | 資料夾名字不是你要的身分 |
135
+ | `--kind document\|deck\|workbook` | 它猜錯種類了 |
136
+ | `--site-dir build` | 你的建置產物不在 `dist` |
137
+ | `--dry-run` | 想先確認再送出 |
138
+ | `--no-source` | 只想發佈建置後的檔案 |
139
+
140
+ `costaff-workspace push --help` 會列出全部。
141
+
142
+ ---
143
+
144
+ ## 值得知道的幾件事
145
+
146
+ **原始碼也會一起上去,那是刻意的。** 那正是之後 `pull` 能在任何機器上還你一個
147
+ 可以直接跑的專案的原因。`node_modules` 和點開頭的檔案永遠不會被收進去——
148
+ **你的 `.env` 不會跟著走**。`--no-source` 可以不送,但那之後這份檔案就拉不回來了。
149
+
150
+ **多份文件的專案會比單次建置久。** 每一份文件都會被建成獨立的 bundle。這是必要的:
151
+ 在一份共用的建置產物裡,你只傳一份給別人,他就能拿到其他全部。
152
+
153
+ **別人分享給你的檔案,拉回來是一份副本。** 它不帶連結,所以推上去會發佈在你自己的
154
+ 帳號底下,原件不受影響。
155
+
156
+ ---
157
+
158
+ ## 出問題的時候
159
+
160
+ | 它說 | 意思,以及怎麼辦 |
161
+ | --- | --- |
162
+ | `No site at dist — build it first.` | 沒有建置產物可以發佈。先跑專案的建置指令。 |
163
+ | `dist has no index.html — it is not a publishable site.` | 建置有跑,但沒有產出頁面。檢查建置設定。 |
164
+ | `cannot make a slug out of the folder name` | 資料夾名字裡沒有可以當身分的英數字——例如中文資料夾名。加上 `--slug my-report`。 |
165
+ | `Sign in first — run with --login.` | 執行 `costaff-workspace login`。 |
166
+ | `Sign-in code expired.` / `Sign-in timed out.` | 驗證碼只有幾分鐘有效。再推一次就會拿到新的。 |
167
+ | `… is not a CoStaff Workspace endpoint` | 連不上服務 —— 檢查一下網路再試一次。 |
168
+ | `No file at that token.` | token 不對,或這份檔案不是你的、也沒有分享給你。 |
169
+
170
+
171
+ ## 授權
172
+
173
+ MIT
package/dist/cli.js CHANGED
@@ -152,11 +152,15 @@ export async function runPush(argv) {
152
152
  const root = opts.sourceRoot ?? process.cwd();
153
153
  const items = opts.given.slug ? [] : await scanProject(root);
154
154
  if (items.length > 0) {
155
+ /* kindLabel, not label: label is the workspace shell's Chinese wording, and
156
+ every other line this command prints is English. */
155
157
  const by = new Map();
156
- for (const it of items)
157
- by.set(it.surface.label, (by.get(it.surface.label) ?? 0) + 1);
158
- const shape = [...by].map(([label, n]) => `${n} ${label}`).join('、');
159
- process.stdout.write(` ${shape} —— 各自建置成獨立的 bundle\n`);
158
+ for (const it of items) {
159
+ const kind = it.surface.kindLabel.toLowerCase();
160
+ by.set(kind, (by.get(kind) ?? 0) + 1);
161
+ }
162
+ const shape = [...by].map(([kind, n]) => `${n} ${kind}${n === 1 ? '' : 's'}`).join(', ');
163
+ process.stdout.write(` ${shape} — one bundle each\n`);
160
164
  await pushProject({
161
165
  root,
162
166
  endpoint: opts.endpoint,
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEvE,OAAO,EAAoB,IAAI,EAAE,MAAM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+7,7 @@
7
7
  */
8
8
  import fs from 'node:fs/promises';
9
9
  import path from 'node:path';
10
- /**
11
- * 正式站。自架 receiver 的人用 --endpoint 或 COSTAFF_WORKSPACE_ENDPOINT 指過去;
12
- * 協定是公開規格,這裡只是把最常見的那一個變成不必打的那一個。
13
- */
10
+ /** 正式站。--endpoint 和 COSTAFF_WORKSPACE_ENDPOINT 蓋得掉,開發時指向本機用。 */
14
11
  export const DEFAULT_ENDPOINT = 'https://workspace.costaffs.app';
15
12
  /** 伺服器認的 slug:小寫英數與連字號,開頭必須是英數,最長 63。 */
16
13
  const SLUG = /^[a-z0-9][a-z0-9-]{0,62}$/;
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,gCAAgC,CAAC;AAEjE,yCAAyC;AACzC,MAAM,IAAI,GAAG,2BAA2B,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,MAAM,IAAI,GAAG,IAAI;SACd,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;SAC3B,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;SACZ,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACvC,CAAC;AAID,oDAAoD;AACpD,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAY;IAC7C,IAAI,CAAC;QAC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BAAiB,CAAC,QAAyB,EAAE,IAAY;IACvE,MAAM,WAAW,GAAG,QAAQ,EAAE,WAAW,CAAC;IAC1C,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC;IAC5F,OAAO,IAAI,CAAC;AACd,CAAC"}
package/dist/protocol.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * The wire contract between the CLI and a receiver.
3
3
  *
4
- * Anyone may host a receiver `--endpoint` points the CLI at it so this file
5
- * is a public specification, not an implementation detail. Adding a required
6
- * field is a breaking change for every third-party receiver; bump
7
- * `PUSH_PROTOCOL` and keep reading the old shape when that happens.
4
+ * Fields are optional by default. A CLI that is already installed keeps talking
5
+ * to a receiver that has moved on, so adding a required field breaks every copy
6
+ * out there; bump `PUSH_PROTOCOL` and keep reading the old shape when an
7
+ * existing field has to change meaning.
8
8
  */
9
9
  export const PUSH_PROTOCOL = 1;
10
10
  export const DISCOVERY_PATH = '/.well-known/costaff-workspace-push';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "costaff-workspace",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "description": "Publish documents, decks and workbooks to CoStaff Workspace, and pull their source back out",
5
5
  "keywords": [
6
6
  "costaff",
@@ -15,12 +15,12 @@
15
15
  "author": "Simon Liu",
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "git+https://github.com/simonliu-ai-product/costaff-workspace-oss.git",
18
+ "url": "git+https://github.com/costaff-ai/costaff-workspace-oss.git",
19
19
  "directory": "cli"
20
20
  },
21
- "homepage": "https://github.com/simonliu-ai-product/costaff-workspace-oss#readme",
21
+ "homepage": "https://github.com/costaff-ai/costaff-workspace-oss#readme",
22
22
  "bugs": {
23
- "url": "https://github.com/simonliu-ai-product/costaff-workspace-oss/issues"
23
+ "url": "https://github.com/costaff-ai/costaff-workspace-oss/issues"
24
24
  },
25
25
  "engines": {
26
26
  "node": ">=20"
@@ -30,7 +30,8 @@
30
30
  "costaff-workspace": "dist/main.js"
31
31
  },
32
32
  "files": [
33
- "dist"
33
+ "dist",
34
+ "README.zh-TW.md"
34
35
  ],
35
36
  "scripts": {
36
37
  "build": "rm -rf dist && tsc -p tsconfig.build.json",