@doubao-dev/cli 1.0.0-rc.1 → 1.0.0-rc.11

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 (73) hide show
  1. package/README.md +12 -6
  2. package/dist/691.js +96 -0
  3. package/dist/build.js +1 -0
  4. package/dist/categories.js +1 -1
  5. package/dist/command.js +9 -3
  6. package/dist/command~1.js +4 -4
  7. package/dist/command~2.js +1 -1
  8. package/dist/command~3.js +2 -1
  9. package/dist/command~4.js +1 -1
  10. package/dist/command~5.js +6 -5
  11. package/dist/dist.js +1 -1
  12. package/dist/draft.js +2 -2
  13. package/dist/index.d.ts +886 -8
  14. package/dist/index.js +1 -1
  15. package/dist/main.d.ts +886 -8
  16. package/dist/main.js +1 -1
  17. package/dist/mcp-apps-inspector.js +1 -0
  18. package/dist/multipart-parser.js +1 -1
  19. package/dist/open.js +2 -0
  20. package/dist/plugin.js +2 -2
  21. package/dist/preview.js +5 -5
  22. package/dist/progress.js +1 -1
  23. package/dist/ratatui-ui.js +1 -1
  24. package/dist/session.js +1 -1
  25. package/dist/skills/doubao-plugin-cli/SKILL.md +44 -40
  26. package/dist/skills/doubao-plugin-cli/references/cli/development.md +126 -0
  27. package/dist/skills/doubao-plugin-cli/references/cli/project.md +188 -0
  28. package/dist/skills/doubao-plugin-cli/references/cli/release.md +144 -0
  29. package/dist/skills/doubao-plugin-cli/references/examples/todo-example.md +88 -0
  30. package/dist/skills/doubao-plugin-cli/references/examples/workbench-example.md +130 -0
  31. package/dist/skills/doubao-plugin-cli/references/protocols/business-skills.md +49 -0
  32. package/dist/skills/doubao-plugin-cli/references/protocols/cli-connectors.md +56 -0
  33. package/dist/skills/doubao-plugin-cli/references/protocols/managed-agents.md +46 -0
  34. package/dist/skills/doubao-plugin-cli/references/protocols/mcp-apps/integration.md +186 -0
  35. package/dist/skills/doubao-plugin-cli/references/protocols/mcp-apps/runtime.md +318 -0
  36. package/dist/skills/doubao-plugin-cli/references/protocols/mcp-apps/workbench.md +180 -0
  37. package/dist/skills/doubao-plugin-cli/references/protocols/mcp-auth.md +73 -0
  38. package/dist/skills/doubao-plugin-cli/references/protocols/mcp-config.md +145 -0
  39. package/dist/skills/doubao-plugin-cli/references/protocols/mcp-events.md +260 -0
  40. package/dist/skills/doubao-plugin-cli/references/protocols/plugin-json.md +95 -0
  41. package/dist/skills/doubao-plugin-cli/references/protocols/workbench.md +120 -0
  42. package/dist/skills/doubao-plugin-cli/references/upstream/SOURCES.md +24 -0
  43. package/dist/skills/doubao-plugin-cli/references/upstream/mcp-apps.LICENSE +216 -0
  44. package/dist/skills/doubao-plugin-cli/references/upstream/mcp-apps.mdx +1768 -0
  45. package/dist/skills/doubao-plugin-cli/references/upstream/mcp-events.LICENSE +216 -0
  46. package/dist/skills/doubao-plugin-cli/references/upstream/mcp-events.md +1231 -0
  47. package/dist/skills/doubao-plugin-cli/references/upstream/standard-webhooks.LICENSE +201 -0
  48. package/dist/skills/doubao-plugin-cli/references/upstream/standard-webhooks.md +349 -0
  49. package/dist/templates/standard/AGENTS.md +1 -1
  50. package/dist/templates/workbench/README.md.template +9 -0
  51. package/dist/templates/workbench/com.doubao/workbench/manifest.json +10 -0
  52. package/dist/uninstall.js +1 -1
  53. package/dist/versions~1.js +1 -1
  54. package/dist/web/index.html +1 -0
  55. package/dist/web/sandbox-proxy.html +101 -0
  56. package/dist/web/static/css/index.b3102f16b9.css +1 -0
  57. package/dist/web/static/js/155.747f5232dc.js +69 -0
  58. package/dist/web/static/js/async/970.86106314b5.js +1 -0
  59. package/dist/web/static/js/index.c1186260b9.js +4 -0
  60. package/dist/web/static/js/lib-react.00514652bf.js +2 -0
  61. package/dist/web/static/js/lib-react.00514652bf.js.LICENSE.txt +39 -0
  62. package/dist/workbench-search.js +1 -0
  63. package/dist/xdg-open +1267 -0
  64. package/package.json +14 -15
  65. package/dist/21.js +0 -101
  66. package/dist/schema.js +0 -1
  67. package/dist/skills/doubao-plugin-cli/references/cli-connectors.md +0 -29
  68. package/dist/skills/doubao-plugin-cli/references/development.md +0 -29
  69. package/dist/skills/doubao-plugin-cli/references/mcp-apps.md +0 -40
  70. package/dist/skills/doubao-plugin-cli/references/mcp-auth.md +0 -23
  71. package/dist/skills/doubao-plugin-cli/references/project-config.md +0 -139
  72. package/dist/skills/doubao-plugin-cli/references/upload.md +0 -77
  73. /package/dist/{21.js.LICENSE.txt → 691.js.LICENSE.txt} +0 -0
@@ -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 [yyyy] [name of copyright owner]
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.
@@ -0,0 +1,349 @@
1
+ <!-- Local snapshot: relative links resolved to pinned upstream URLs; see SOURCES.md. -->
2
+
3
+ <h1>
4
+ <a style="text-decoration: none" href="https://www.standardwebhooks.com">
5
+ <img width="360" src="https://raw.githubusercontent.com/standard-webhooks/standard-webhooks/f72db81617ce7c285e99d7734ff2480303328377/assets/brand.svg" />
6
+ </a>
7
+ </h1>
8
+
9
+ ## Open source tools and guidelines for sending webhooks easily, securely and reliably
10
+
11
+ Version: 1.0.0
12
+
13
+ License: The Apache License, Version 2.0.
14
+
15
+ ## Introduction
16
+
17
+ Webhooks are becoming increasingly popular and are used by many of the world's top companies for sending events to users of their APIs. However, the ecosystem is fragmented, with each webhook provider using different implementations and varying quality. Even high quality implementations vary, making them inherently incompatible. This fragmentation is a pain for the providers and consumers, stifling innovation.
18
+
19
+ For consumers, this means handling webhooks differently for every provider, relearning how to verify webhooks, and encountering gotchas with bespoke implementations. For providers, this means reinventing the wheel, redesigning for issues that have already been solved (security, forward compatibility, etc.).
20
+
21
+ We propose a simple solution: standardize webhooks across the industry. This design document outlines our proposal, a set of strict webhook guidelines based on the existing industry best practices. We call it "Standard Webhooks".
22
+
23
+ We believe "Standard Webhooks" can do for webhooks what JWT did for API authentication. Adopting a common protocol that is consistent and supported by different implementations will solve the above issues, and will enable new tools and innovations in webhook ecosystem.
24
+
25
+ To achieve this, we have created an open source and community-driven set of tools and guidelines for sending webhooks.
26
+
27
+ ## What are Webhooks?
28
+
29
+ Webhooks are a common name for HTTP callbacks, and are a way for services to notify each other of events. Webhooks are part of a service's API, though you can think of them as a sort of a "reverse API". When a client wants to make a request to a service they make an API call, and when the service wants to notify the client of an event the service triggers a webhook ("a user has paid", "task has finished", etc.).
30
+
31
+ Webhooks are server-to-server, in the sense that both the customer and the service in the above description, should be operating HTTP servers, one to receive the API calls and one to receive the webhooks. It's important to note that while webhooks usually co-exist with a traditional API, this is not a requirement, and some services send webhooks without offering a traditional API.
32
+
33
+ ## Design Goals
34
+
35
+ These are the principles and goals guiding the design and development of this specification.
36
+
37
+ - **Secure.** Make it easy for implementations to be secure, and hard to be insecure.
38
+ - **Reliable.** In order for webhooks to be relied upon, they have to be reliable.
39
+ - **Interoperable.** It has to enable interoperability and compatibility across different providers, consumers, and utilities.
40
+ - **Simple.** Simplicity is key, it must not add undue complexity to existing systems.
41
+ - **Backward and forward compatible.** It has to support working in tandem both with existing webhook implementations and future ones.
42
+
43
+ ## Specification
44
+
45
+ The Standard Webhooks specification is a set of conventions to be followed by webhook producers (senders) to provide webhook consumers (receivers) a secure, consistent, and interoperable interface for webhooks. The specification includes both requirements for any compatible implementation and recommendations that are not necessarily required for compatibility, but provide a better experience for the producers, consumers, or both.
46
+
47
+ ### Payload
48
+
49
+ The payload is the core part of every webhook. It is the actual data being sent as part of the webhook, and usually consists of important information about the event and related information.
50
+
51
+ While this specification does not dictate the structure, or impose any requirements, on the shape, format, and content of the payload it does offer recommendations.
52
+
53
+ #### Payload structure
54
+
55
+ - The payload should be passed in the HTTP body.
56
+ - The payload should be [JSON formatted](https://en.wikipedia.org/wiki/JSON) for maximum compatibility, but other content types can be used as well.
57
+ - It's recommended to provide examples of the payload structure for each of the event types, as well as a formal specification of the structure (such as JSON Schema or OpenAPI).
58
+ - Payload structure:
59
+ - `type`: a full-stop delimited type associated with the event. The type indicates the type of the event being sent (e.g "user.created" or "invoice.paid"), indicates the schema of the payload (passed in data), and it should be grouped hierarchically.
60
+ - `timestamp`: the timestamp of when the event occurred (not necessarily the same of when it was delivered), it should be [ISO 8601 formatted](https://en.wikipedia.org/wiki/ISO_8601)
61
+ - `data`: the actual event data associated with the event. It can either be passed as part of the data property, or squashed as part of the top-level object.
62
+ - Additional metadata can be added both as top-level properties or as part of data, depending on personal preference.
63
+
64
+ Example payload:
65
+
66
+ ```json
67
+ {
68
+ "type": "example.event",
69
+ "timestamp": "2022-11-03T20:26:10.344522Z",
70
+ "data": {
71
+ "foo": "bar",
72
+ "fizzbuzz": 2
73
+ }
74
+ }
75
+ ```
76
+
77
+ #### "Thin" vs "full" payloads
78
+
79
+ There are two main approaches to webhook payloads: "thin" and "full" payloads. Full payloads consist of the full information about the event, the status of the related entities, and everything that's changed. A thin payload will only include identifiers to the affected entities, and potentially information about the change itself.
80
+
81
+ Let's consider a fictional address book management service. It's a simple service where you can update and maintain your address book, and it sends webhooks every time data changes.
82
+
83
+ Now, let's assume we just created a new contact, here are the payloads that will be sent:
84
+
85
+ Full payload:
86
+
87
+ ```json
88
+ {
89
+ "type": "contact.created",
90
+ "timestamp": "2022-11-03T20:26:10.344522Z",
91
+ "data": {
92
+ "id": "1f81eb52-5198-4599-803e-771906343485",
93
+ "type": "contact",
94
+ "fullName": "John Smith",
95
+ "address": "800 W NASA Pkwy, Webster, TX 77598, USA",
96
+ "phoneNumber": "(281) 332-2575",
97
+ "birthday": "1980-04-19",
98
+ "occupation": "Engineer, ACME"
99
+ }
100
+ }
101
+ ```
102
+
103
+ Thin payload:
104
+
105
+ ```json
106
+ {
107
+ "type": "contact.created",
108
+ "timestamp": "2022-11-03T20:26:10.344522Z",
109
+ "data": {
110
+ "id": "1f81eb52-5198-4599-803e-771906343485"
111
+ }
112
+ }
113
+ ```
114
+
115
+ Thin and full payloads are not a binary decision, for example, one can decide to take the thin payload approach, but also include the "fullName" field as that one is commonly used and is very useful.
116
+
117
+ There are pros and cons for both, and which to go for depends on the specific requirements. The main advantage of using full payloads is that most of the information is available for the webhook consumer without needing to make additional API calls to get more data. Thin payloads, however, offer better performance (sending and generating less data, often), more flexibility (it's not always trivial to query the database for the full payload data for the webhook from every context in the code), and it's more future proof (you can always make a thin one full, but not the other way around). Another important advantage of thin payloads is that they provide for better control over the flow of data. In many scenarios, it's preferable (if not required) to have an audit log for when certain data is accessed. With full payloads, the data is just sent to every listening endpoint, with thin payloads it's required that people explicitly query the data they need, making it possible to make access auditable and more restricted.
118
+
119
+ #### Payload size
120
+
121
+ While there are no technical limitations to the size of webhook payloads, it's recommended to keep the size of payloads small, usually smaller than 20kb. There are multiple reasons for this, but the main one is that as a webhook producer you are imposing unnecessary load on the webhook consumer. They may not be interested in this specific event, and they are surely not interested in all of the data being sent. By keeping the payload size small, you put the control in the hands of the consumers.
122
+
123
+ If you find yourself needing to send large amounts of data (e.g. images or other assets), consider uploading them somewhere and passing the link in the webhook, or if the data is dynamic, just include the resource or URL they need to query.
124
+
125
+ ### Verifying webhook authenticity
126
+
127
+ Webhooks are just HTTP requests from an unknown source, so verifying the authenticity of webhooks is a requirement for any secure webhook implementation.
128
+
129
+ There are multiple ways to verify the authenticity of webhooks, with some being much better than others. The most common way to verify the authenticity of webhooks is by using HMAC signatures using a pre-shared secret key, with a common alternative being the use of asymmetric signatures (more on that below).
130
+
131
+ As often the case with security, using the correct cryptographic primitives for the signature verification is not sufficient for a secure implementation. This section provides a secure scheme and additional guidelines for ensuring a simple and secure implementation.
132
+
133
+ #### Webhook metadata
134
+
135
+ In addition to the payload itself, webhook implementations often include two important pieces of metadata: the timestamp of the attempt, and a unique identifier associated with the webhook. A secure signature scheme should verify the authenticity of both the payload, and the additional metadata (timestamp and unique identifier).
136
+
137
+ The timestamp of the attempt is the timestamp of when the webhook attempt has been made. The timestamp of the attempt may be different to the timestamp of the event that generated the attempt. One common example of where this happens: failed deliveries. Every time an attempt is retried the timestamp of the attempt is updated, while the timestamp of the original event remains the same. The attempt's timestamp as an important security measure meant to prevent replay attacks.
138
+
139
+ The unique identifier is a unique identifier associated with a specific event triggered, and it remains the same no matter how many times a webhook that has failed is retried. The ID is often used as an idempotency key, which lets a consumer ensure that they only process a specific event once, even if sent multiple times maliciously, in error, or due to networking issues.
140
+
141
+ #### Signature scheme
142
+
143
+ As mentioned above, it's important to sign both the body of the webhook and the associated metadata. To achieve this, the message's: ID, timestamp and body are concatenated (delimited by full-stops) and then signed.
144
+
145
+ The content to be signed is therefore: `msg_id.timestamp.payload`.
146
+
147
+ For example:
148
+
149
+ ```
150
+ msg_2KWPBgLlAfxdpx2AI54pPJ85f4W.1674087231.{
151
+ "type": "contact.created",
152
+ "timestamp": "2022-11-03T20:26:10.344522Z",
153
+ "data": {
154
+ "id": "1f81eb52-5198-4599-803e-771906343485"
155
+ }
156
+ }
157
+ ```
158
+
159
+ Or more likely, with a minified JSON (assuming that's what is sent):
160
+
161
+ ```
162
+ msg_2KWPBgLlAfxdpx2AI54pPJ85f4W.1674087231.{"type":"contact.created","timestamp":"2022-11-03T20:26:10.344522Z","data":{"id":"1f81eb52-5198-4599-803e-771906343485"}}
163
+ ```
164
+
165
+ It's important that both the message id and the timestamp not be user controlled, or at the very least not be allowed to include any `.` to prevent certain attacks.
166
+
167
+ Note: while it's OK (and recommended) to minimize the JSON body when serialized for sending, it's important to make sure that the payload sent is the same as the payload signed. Cryptographic signatures are sensitive to even the smallest changes, and even a stray space can cause the signature to be invalid. This is a very common failure mode as many webhook consumers often accidentally parse the body as json, and then serialize it again, which can cause for failed verification due to minor changes in serialization of JSON (which is not necessarily the same across implementations, or even multiple invocations of the same implementation).
168
+
169
+ This specification allows for both symmetric and asymmetric signatures, and depending on which is used, may require slightly different handling. There are no limitations on their usage, and for example one consumer may use symmetric, and another may use asymmetric, or even the same consumer may change back and forth between them.
170
+
171
+ There are a few differences between symmetric and asymmetric signatures and how they are used:
172
+
173
+ | | Symmetric | Asymmetric |
174
+ | -------------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
175
+ | Signature scheme | `HMAC-SHA256` | `ed25519` |
176
+ | Signing secret | Random. Between 24 bytes (192 bits) and 64 bytes (512 bits) | Standard ed25519 key pair |
177
+ | Secret serialization | base64 encoded, prefixed with \`whsec_\` for easy identification. | base64 encoded, prefixed with \`whsk_\` for the secret key, and \`whpk_\` for the public key for easy identification. |
178
+ | Signature identifier | `v1` | `v1a` |
179
+
180
+
181
+ Comparison:
182
+
183
+ - Symmetric:
184
+ - Fast. HMAC-SHA256 is fast and often hardware accelerated, and much faster than any asymmetric scheme.
185
+ - Simple. Symmetric signatures are much more simple and quick to get started with than asymmetric ones.
186
+ - Ubiquitous: HMAC-SHA256 is widely available on every platform and language.
187
+ - Warning: Treat the signing key as any other cryptographic secret. If you do not control the security of both the producer and consumer, it is recommended you use an asymmetric signature instead.
188
+
189
+ - Asymmetric:
190
+ - Provides an additional layer of security as only the producer needs access to the private key.
191
+ - Consumers can use a publicly available (non-secret) key to verify the signature which leads to much better security.
192
+ - Performance: Asymmetric signatures can be more CPU intensive to produce and verify than symmetric ones.
193
+
194
+ The "secret serialization" row refers to how secrets should be serialized when presented to customers. Having a unique and consistent secret format allows implementations to correctly use the correct scheme without additional configuration, and to ensure keys are used as expected.
195
+
196
+ The "signature identifier" is the version identifier prefixed to signatures when serialized and passed to customers (more on that in the "webhook headers" section). Symmetric signatures are prefixed with `v1` and asymmetric with `v1a`. So for example, a symmetric signature will be v1, followed by a comma (`,`), followed by the base64 encoded signature. For example: `v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4=`.
197
+
198
+ ##### Additional considerations:
199
+
200
+ - Signing keys should be unique per endpoint for symmetric signatures, and unique per endpoint (or potentially customer) for asymmetric signatures. Reusing keys across customers can lead to security issues!
201
+ - Prefer asymmetric signature schemes over symmetric ones. Weigh the performance benefits of symmetric signatures against their security drawbacks.
202
+ - Consider key distribution schemes between consumers and producers early on.
203
+ - Consumers should establish a trust list of public keys and signature schemes. Do not blindly trust signatures produced by untrusted public keys (e.g. by reading the public key from an additional header from the request payload).
204
+
205
+ #### Webhook headers (sending metadata to consumers)
206
+
207
+ As discussed above, the webhook payload should be sent as the body of an HTTP POST request, which means that additional webhook data should be sent as part of the headers.
208
+
209
+ All of the headers should be prefixed with `webhook-` and follow the exact naming as below.
210
+
211
+ The headers are:
212
+
213
+ - `webhook-id`: the unique webhook identifier described in the sections above.
214
+ - `webhook-timestamp`: integer unix timestamp (seconds since epoch).
215
+ - `webhook-signature`: the signature(s) of this webhook.
216
+
217
+ The signature header is a space delimited list of signatures associated with this webhook. The reason it is a list, and not just one signature is to support zero downtime secret rotation. The secret key used for the signature should not be changed under normal circumstances, but it may be required that it does change under some circumstances (e.g. compromise). Supporting zero downtime secret rotation means that webhook operations won't be affected during the secret rotation process.
218
+
219
+ To achieve this, the webhook is signed both using the current key, and using an old key (for a set period of time), and both signatures are sent, space delimited, in the `webhook-signature` header. Webhook consumers can try to verify each signature until one matches. Signing with multiple keys, even compromised ones, doesn't diminish the security of the scheme, as the consumer still requires a valid signature.
220
+
221
+ Example headers:
222
+
223
+ ```
224
+ webhook-id: msg_2KWPBgLlAfxdpx2AI54pPJ85f4W
225
+ webhook-timestamp: 1674087231
226
+ webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4= v1a,hnO3f9T8Ytu9HwrXslvumlUpqtNVqkhqw/enGzPCXe5BdqzCInXqYXFymVJaA7AZdpXwVLPo3mNl8EM+m7TBAg==
227
+ ```
228
+
229
+ #### Verifying signatures
230
+
231
+ Verifying signatures is similar to creating them, though there are a few considerations:
232
+
233
+ - When verifying symmetric signatures, use a constant time comparison function to compare the calculated with the expected signature. Failing to do so can expose consumers to timing-attacks and turn them into signing oracles.
234
+ - When verifying asymmetric signatures, use a battle tested cryptographic library. Keep this dependency up to date.
235
+ - Make sure to verify the `webhook-timestamp` header has a timestamp that is within some allowable tolerance of the current timestamp to prevent replay attacks.
236
+ - Use the `webhook-id` header as an idempotency key to prevent accidentally processing the same webhook more than once (e.g. save the IDs in redis for 5 minutes).
237
+
238
+ ### Operational considerations
239
+
240
+ The previous section covered important considerations relating to the signature scheme, the payload, and the headers. This section is about operational considerations required for a good webhook experience.
241
+
242
+ #### Event types
243
+
244
+ Event types indicate the type of the event being sent in the webhook and the schema of the payload. A payload associated with an event type should always have the same schema. You can think of event types as different URL paths in the case of REST. The same way that REST APIs always expect (and return) a set schema for a specific URL, so should your webhooks.
245
+
246
+ It's recommended that event types be formatted as an hierarchical, and full-stop delimited, list of identifiers, and that the identifiers would be limited to a limited set of characters `[a-zA-Z0-9_]`. This refers to the event type IDs used by the API, but doesn't limit the use of more user-friendly friendly display strings. For example, one could use `user.created` as the event type, and "A user has been created" as the event display string.
247
+
248
+ It is also recommended to let webhook consumers choose which event types they would like to receive for which endpoints, and do the filtering on the producing end. This reduces a lot of unnecessary load on the consumer, receiving events they have no interest in receiving.
249
+
250
+ #### Deliverability and reliability
251
+
252
+ In order for webhook implementations to be trusted and relied upon, they have to do whatever is possible to ensure the timely and reliable delivery of webhooks.
253
+
254
+ Webhook sending may sometimes fail. This can be due to networking issues, bugs in the receiver, or a variety of other issues. It's therefore up to the webhook producer to retry sending the webhook until a successful attempt or until it's determined that delivery may not be possible. Retries are an important part of having reliable webhooks.
255
+
256
+ It's recommended to retry delivery following a retry schedule spanning multiple days, with an exponential backoff. It's recommended to also add some level of random jitter to retries to prevent cases where the failures are due to recurring load caused by the webhook attempts themselves.
257
+
258
+ In some cases, webhook delivery may fail consistently over a long period of time. In that scenario it is important to both: notify the consumers using other channels (e.g. email), and is recommended to disable future delivery to the endpoint.
259
+
260
+ Example retry schedule:
261
+
262
+ | Delay | Time since start |
263
+ | ----------- | ---------------- |
264
+ | Immediately | 00:00:00 |
265
+ | 5 seconds | 00:00:05 |
266
+ | 5 minutes | 00:05:05 |
267
+ | 30 minutes | 00:35:05 |
268
+ | 2 hours | 02:35:05 |
269
+ | 5 hours | 07:35:05 |
270
+ | 10 hours | 17:35:05 |
271
+ | 14 hours | 31:35:05 |
272
+ | 20 hours | 51:35:05 |
273
+ | 24 hours | 75:35:05 |
274
+
275
+ #### Delivery success and failure
276
+
277
+ A webhook delivery is considered successful if it was responded to with a `2xx` status code (status codes 200-299), and it is considered a failure in any other scenario. Example failure scenarios include non-`2xx` response status codes (e.g: 404 and 500), request timeouts (see next section), connection resets, and more.
278
+
279
+ It's important to follow HTTP etiquette when sending webhooks, and respond to HTTP status codes appropriately. Here is the suggested status code handling:
280
+
281
+ - `2xx`: Success.
282
+ - `3xx`: Failure. Following redirects causes unnecessary load on both the sender and the receiver, it's therefore recommended to update the webhook URL instead.
283
+ - `410 Gone`: This is an indication by the server that it's no longer interested in receiving webhooks from this source. Sender should disable the webhook endpoint, and stop sending it messages.
284
+ - `429 Too Many Requests`: This indicates a rate-limit has been met, and it's recommended to throttle additional requests.
285
+ - `502 Bad Gateway` and `504 Gateway Timeout`: Both errors usually indicate that the server is under load, and it's recommended to throttle the requests.
286
+ - The rest of the status codes should be treated as a failure.
287
+
288
+ Additionally, some responses may also include a `retry-after` header (e.g. `503 Service Unavailable`), which should be taken into consideration when scheduling the next attempt.
289
+
290
+ #### Request timeouts
291
+
292
+ In order to ensure the reliable delivery of webhooks, it's important to ensure consumers have enough time to process and acknowledge the processing of requests. A recommended request timeout value for webhooks is somewhere between 15 and 30s.
293
+
294
+ #### Enforcing HTTPS
295
+
296
+ Depending on the content of the webhooks being sent, it may be advisable to ensure that all webhook endpoints are HTTPS. While the signature scheme above covers the authenticity and validity of the payloads (so they can't be tampered with), it doesn't encrypt the data, which means it may be possible to eavesdrop and view the content of the payloads.
297
+
298
+ #### Static source IPs
299
+
300
+ Some webhook consumers have firewalls (or other security mechanisms) in front of their webhook endpoints, and require webhooks to be sent from a predefined list of static IPs that can be allowed to go through the firewall. This is common in many corporate environments, and while not strictly a requirement for webhooks, it's a common consideration.
301
+
302
+ #### Server side request forgery (SSRF)
303
+
304
+ A server-side request forgery (SSRF) attack is when an attacker abuses functionality on the server to read or update internal resources. In the attack, the attacker supplies or modifies a URL which the server will then make a call to. By carefully selecting the URLs, the attacker may be able to read server configuration such as AWS metadata, connect to internal services like HTTP-enabled databases or perform post requests towards internal services which are not intended to be exposed.
305
+
306
+ Webhooks implementations are especially vulnerable to SSRF as they let their consumers (customers) add any URLs they want, which will be called from the internal webhook system.
307
+
308
+ The main way to protect against SSRF is to prevent the webhooks from calling into internal networks and services. To achieve this you'd want to do two things: the first would be to proxy all webhook requests through a special proxy (like[ smokescreen](https://github.com/stripe/smokescreen)) that filters internal IP addresses, and the second would be to put the webhook workers (or proxy) in their own private subnet that can't access internal services.
309
+
310
+ #### Additional References
311
+ - [OWASP API Top 10, API7:2023 Server Side Request Forgery](https://owasp.org/API-Security/editions/2023/en/0xa7-server-side-request-forgery/)
312
+
313
+ ### Additional functionality
314
+
315
+ This section describes additional functionality that is not a core requirement for a webhook implementation but provide significant benefits to webhook producers and consumers.
316
+
317
+ #### Multiple endpoints (fanout)
318
+
319
+ It's common for webhook consumers to want to consume webhooks in multiple locations. For example, they may want to consume a `invoice.paid` event in their user management system (to unlock functionality for the customer), in their CRM (to update the sales team), and their team's communication application (to celebrate with the team). It's therefore recommended to enable customers to add multiple webhook endpoints so that they can receive the same webhook to multiple destinations.
320
+
321
+ #### Visibility into failures and manual retries
322
+
323
+ Webhooks can fail for a variety of reasons, and without good visibility into the failures, consumers can often be left unable to debug a service degradation or outage. This is why it is common for webhook producers to provide a way for their customers to list failed messages, and review the reasons for the failures. Additionally, it's immensely important to give consumers a way to manually replay specific webhooks or failures within a range in order to recover from long outages without missing message delivery.
324
+
325
+ #### Endpoint management API
326
+
327
+ Having an API to add, remove, and list webhook endpoints enables both webhook consumers and third party developers to build automation on top of webhooks. One common use-case, for example, is to have a workflow automation tool automatically add webhook endpoints with specific event types as users add and remove workflow triggers.
328
+
329
+ ## Migrating to Standard Webhooks
330
+
331
+ Standard Webhooks can be supported in tandem with existing legacy webhook implementations and signature schemes with zero interruption to consumer workflow and running integrations.
332
+
333
+ In order to migrate to Standard Webhooks, just follow the signature scheme as outlined above and add the Standard Webhooks headers in addition to any existing headers you may already have. Adding additional headers without removing the existing ones will prevent any disruption to existing service. You can even reuse existing webhook signing secrets between the legacy scheme and Standard Webhooks, so even the secrets can remain the same.
334
+
335
+ The rest of the recommendations and requirements outlined in this document can too be added side by side with existing implementations without interfering.
336
+
337
+ ### Migrating the payload
338
+
339
+ While migrating the payload is optional, and you can get most of the benefits of standard webhooks compatibility even without doing that. However, doing so will enable you to utilize even more of the standard webhooks ecosystem, and is therefore recommended.
340
+
341
+ There are a few strategies for migrating the payloads, each with its own advantages and disadvantages. The first is adding data to existing payloads with the wanted format. This approach is easy and backwards compatible, but it may lead to confusion, and it will also lead to redundancy in data. The second is a slightly better variation, where you still duplicate the data, but only for endpoints created before the switch-over date. The last alternative is to create a new event type for each of the existing ones, and have them conform to the new format.
342
+
343
+ ## Extensions
344
+
345
+ Extensions are optional additions to the specification. Implementations don't need to support them in order to be compatible with Standard Webhooks, but implementations that do support them should follow them exactly as described, so that they remain interoperable.
346
+
347
+ Each extension is described in its own document:
348
+
349
+ - [Webhook endpoint verification](https://github.com/standard-webhooks/standard-webhooks/blob/f72db81617ce7c285e99d7734ff2480303328377/spec/extensions/endpoint-verification.md): lets producers confirm that an endpoint has opted in to receiving webhooks, and that it holds the correct signing secret, before delivering webhooks to it.
@@ -2,4 +2,4 @@
2
2
 
3
3
  先阅读 [CLI 开发 Skill](.agents/skills/doubao-plugin-cli/SKILL.md),按任务选择其中的配置、上传或 MCP Apps 指引。
4
4
 
5
- 链接缺失时运行 `dbx skills`。业务 Skill 放在 `skills/`,开发指引不进入上传包。
5
+ 链接缺失时运行 `dbx skills`。普通插件的业务 Skill 放在 `skills/`。定制工作台的界面、上下文和资源预装配置见[工作台包协议](.agents/skills/doubao-plugin-cli/references/protocols/workbench.md)。开发指引不进入上传包。
@@ -0,0 +1,9 @@
1
+ # __PLUGIN_NAME__
2
+
3
+ 在 `com.doubao/workbench/manifest.json` 配置首页,按需填写 `additionalContext`。接入 MCP 时在项目根目录添加 `mcp.json`。预装已有 Skill 或插件时添加 `com.doubao/workbench/preinstall-resources.json`。
4
+
5
+ ```sh
6
+ dbx dev --workbench
7
+ ```
8
+
9
+ 操作指引见 [开发调试](.agents/skills/doubao-plugin-cli/references/cli/development.md) 和 [版本交付与审核](.agents/skills/doubao-plugin-cli/references/cli/release.md),完整配置见 [合同工作台示例](.agents/skills/doubao-plugin-cli/references/examples/workbench-example.md)。
@@ -0,0 +1,10 @@
1
+ {
2
+ "schemaVersion": "1.0",
3
+ "additionalContext": "",
4
+ "reconfig": {
5
+ "home": {
6
+ "mode": "overlay",
7
+ "welcome": { "title": "欢迎使用我的工作台" }
8
+ }
9
+ }
10
+ }
package/dist/uninstall.js CHANGED
@@ -1 +1 @@
1
- import{log as _,updateUserPlugin as t}from"./21.js";import{withProgress as i}from"./progress.js";import{ensureLogin as n}from"./command~1.js";async function o(o){await n(!1);let{name:a}=o.plugin;await i("从当前用户卸载插件开发包",()=>t({name:a,action:"Uninstall"})),_.success(`插件开发包已卸载:${a}`)}export{o as runUninstall};
1
+ import{log as _,updateUserPlugin as i}from"./691.js";import{withProgress as t}from"./progress.js";import{ensureLogin as n}from"./command~1.js";async function o(a,r=!1){await n(!1);let{name:l}=a.plugin,m=r?"定制工作台":"应用插件";await t(`从当前账号卸载${m}开发包`,()=>i({name:l,action:"Uninstall"},void 0,r)),_.success(`${m}开发包已卸载:${l}`)}export{o as runUninstall};
@@ -1 +1 @@
1
- import{listPluginVersions as e}from"./21.js";async function*i(i){let t,n=i.plugin.id?{ability_id:i.plugin.id}:{name:i.plugin.name},a=new Set;do{let{items:i=[],page:o}=await e({...n,page_size:20,page_token:t}),_=o?.next_page_token;if(_&&a.has(_))throw Error("版本列表返回了重复的分页标记,请稍后重试");_&&a.add(_),yield{items:i},t=_}while(t)}export{i as listProjectVersionPages};
1
+ import{listPluginVersions as e,getApproval as t,projectIdentity as i,resolvePublicationType as n}from"./691.js";async function*a(t,a){let o,r=a?.isWorkbench??t.hasWorkbench;!a&&r&&t.plugin.id&&!t.plugin.publicationType&&await n(t);let l=a?.identity??i(t),p=new Set;do{let{items:t=[],page:i}=await e({...l,page_size:20,page_token:o},void 0,r),n=i?.next_page_token;if(n&&p.has(n))throw Error("版本列表返回了重复的分页标记,请稍后重试");n&&p.add(n),yield{items:t},o=n}while(o)}async function o(e,i){let n=new Set;for await(let{items:o}of a(e))for(let a of o){let o=a.current_approval?.approval_id;if(!o||n.has(o))continue;n.add(o);let{approval:r}=await t(o,{publicationType:i,workbench:e.hasWorkbench});if(!r)throw Error(`服务端未返回审核记录:${o}`);if(null==r.handled_at_ms)return o}}export{o as findPendingApproval,a as listProjectVersionPages};
@@ -0,0 +1 @@
1
+ <!DOCTYPE html><html><head><title>MCP Apps Inspector</title><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.00514652bf.js"></script><script defer src="/static/js/155.747f5232dc.js"></script><script defer src="/static/js/index.c1186260b9.js"></script><link href="/static/css/index.b3102f16b9.css" rel="stylesheet"></head><body><div id="root"></div></body></html>