@webex/plugin-attachment-actions 3.13.0-next.1 → 3.13.0-next.10
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/.repo-context.json +412 -0
- package/.sdd/manifest.json +388 -0
- package/AGENTS.md +210 -0
- package/dist/attachmentActions.js +1 -1
- package/docs/adr/0001-retain-product-readme.md +99 -0
- package/docs/adr/index.md +25 -0
- package/docs/architecture.md +244 -0
- package/docs/getting-started.md +124 -0
- package/docs/index.md +43 -0
- package/docs/specs/README.md +69 -0
- package/package.json +15 -15
- package/schemas/repo-context.schema.json +796 -0
- package/src/docs/README.md +354 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: ADR
|
|
3
|
+
title: ADR-0001 - Retain the product README
|
|
4
|
+
description: SDD onboarding keeps README.md as product documentation and routes it only as context.
|
|
5
|
+
tags: [adr]
|
|
6
|
+
timestamp: 2026-11-13T02:20:00Z
|
|
7
|
+
status: accepted
|
|
8
|
+
---
|
|
9
|
+
<!-- sdd-generated-metadata
|
|
10
|
+
doc_kind: standing-doc
|
|
11
|
+
generated_from: adr@0.3.0
|
|
12
|
+
generated_by: claude-code
|
|
13
|
+
approved_by: rarajes2@cisco.com
|
|
14
|
+
updated_at: 2026-11-13T02:56:49Z
|
|
15
|
+
validation_status: pass-with-warnings
|
|
16
|
+
-->
|
|
17
|
+
|
|
18
|
+
# ADR-0001 - Retain the product README
|
|
19
|
+
|
|
20
|
+
| Field | Value |
|
|
21
|
+
| ------------- | ----- |
|
|
22
|
+
| Status | Accepted |
|
|
23
|
+
| Decision date | 2026-11-13 |
|
|
24
|
+
| Deciders | rarajes2@cisco.com (bootstrap questionnaire) |
|
|
25
|
+
| Supersedes | N/A |
|
|
26
|
+
| Superseded by | N/A |
|
|
27
|
+
|
|
28
|
+
## Context
|
|
29
|
+
|
|
30
|
+
Onboarding found one existing document, `README.md`. It is the npm page: a one-line description
|
|
31
|
+
("Attachment Actions plugin for the Cisco Webex JS SDK."), install commands, a pointer to the developer
|
|
32
|
+
portal and API docs, and Usage headings. No other intent, design, or AI-authored spec exists in this
|
|
33
|
+
package.
|
|
34
|
+
|
|
35
|
+
The README states almost nothing about behavior, and part of what it states is wrong:
|
|
36
|
+
|
|
37
|
+
| README content | Code |
|
|
38
|
+
| -------------- | ---- |
|
|
39
|
+
| The title heading is `@webex/plugin-messages` | `package.json` names the package `@webex/plugin-attachment-actions` |
|
|
40
|
+
| The Install and Usage sections each appear twice; the second Usage section is empty | — |
|
|
41
|
+
| No example and no method name | `create`, `get`, `listen`, and the `created` event are in `src/attachmentActions.js` |
|
|
42
|
+
| Nothing about scopes | The `listen` JSDoc in `src/attachmentActions.js` requires `spark:all` and `spark:kms` |
|
|
43
|
+
|
|
44
|
+
## Decision
|
|
45
|
+
|
|
46
|
+
Keep `README.md` unchanged. Do not migrate it into the module specification. Record
|
|
47
|
+
`spec_source_policy.mode` as `keep-separate` with `migrated_source_disposition` `retain`, and route
|
|
48
|
+
`README.md` in `spec_sources` as `reference-only` and `context-only`.
|
|
49
|
+
|
|
50
|
+
The canonical behavior is `src/` plus `test/`. The module specification follows code.
|
|
51
|
+
|
|
52
|
+
## Why
|
|
53
|
+
|
|
54
|
+
The README is the npm-facing page. Correcting its heading and filling it in is a product-doc change,
|
|
55
|
+
not a requirement of making the package SDD-ready, and the other onboarded packages in this workspace
|
|
56
|
+
kept their READMEs the same way. It makes no behavioral claim that the module specification would need
|
|
57
|
+
to carry, so nothing is lost by not migrating it.
|
|
58
|
+
|
|
59
|
+
## Alternatives considered
|
|
60
|
+
|
|
61
|
+
| Alternative | Why it was not selected |
|
|
62
|
+
| ----------- | ----------------------- |
|
|
63
|
+
| Migrate the README into `src/docs/README.md` and delete it | It holds no behavior to migrate; deletion was not requested |
|
|
64
|
+
| Reconcile the README with the module specification in place | There is nothing to reconcile beyond the package name; the developer's precedent is `keep-separate` |
|
|
65
|
+
| Rewrite the README during onboarding | Onboarding writes the SDD tree only and does not edit `README.md` |
|
|
66
|
+
|
|
67
|
+
## Consequences
|
|
68
|
+
|
|
69
|
+
**Positive:**
|
|
70
|
+
|
|
71
|
+
- The npm page stays stable for consumers.
|
|
72
|
+
- The module specification is the single behavioral reference.
|
|
73
|
+
|
|
74
|
+
**Negative / tradeoffs:**
|
|
75
|
+
|
|
76
|
+
- Agents must not treat `README.md` as a reference; its title names another package.
|
|
77
|
+
- The wrong heading and the repeated sections remain until a maintainer makes a separate product-doc
|
|
78
|
+
change.
|
|
79
|
+
|
|
80
|
+
## Constraint on future changes
|
|
81
|
+
|
|
82
|
+
Do not delete `README.md` as part of spec maintenance. If its usage text changes, keep the module
|
|
83
|
+
specification aligned with code rather than with the README.
|
|
84
|
+
|
|
85
|
+
## Follow-up
|
|
86
|
+
|
|
87
|
+
- [ ] A maintainer may fix the title heading, remove the repeated sections, and add examples for
|
|
88
|
+
`create`, `get`, and `listen()` in a separate product-doc change.
|
|
89
|
+
|
|
90
|
+
## Revisit when
|
|
91
|
+
|
|
92
|
+
- A maintainer rewrites the README to document the methods or the `created` event.
|
|
93
|
+
|
|
94
|
+
## References
|
|
95
|
+
|
|
96
|
+
- `README.md`
|
|
97
|
+
- `src/index.js`
|
|
98
|
+
- `src/attachmentActions.js`
|
|
99
|
+
- `.sdd/manifest.json` `spec_source_policy`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!-- sdd-generated-metadata
|
|
2
|
+
doc_kind: standing-doc
|
|
3
|
+
generated_from: adr-index@0.3.0
|
|
4
|
+
generated_by: claude-code
|
|
5
|
+
approved_by: rarajes2@cisco.com
|
|
6
|
+
updated_at: 2026-11-13T02:56:49Z
|
|
7
|
+
validation_status: pass-with-warnings
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
# Architectural decision records
|
|
11
|
+
|
|
12
|
+
Numbered, append-only records of structural decisions affecting this package and its documentation.
|
|
13
|
+
Add a concrete ADR (for example, `0042-cache-policy.md`) when a decision is non-obvious, hard to
|
|
14
|
+
reverse, or worth explaining to a future contributor. Do not edit an accepted decision in place when
|
|
15
|
+
its outcome changes; supersede it with a new ADR and link both records.
|
|
16
|
+
|
|
17
|
+
## Index
|
|
18
|
+
|
|
19
|
+
- [ADR-0001 - Retain the product README](0001-retain-product-readme.md) — accepted 2026-11-13
|
|
20
|
+
|
|
21
|
+
Add new entries as ADRs are accepted. Keep this list in numeric order.
|
|
22
|
+
|
|
23
|
+
Each ADR should state its context, decision, alternatives, consequences, and the condition that would
|
|
24
|
+
cause the team to revisit it. Record the deciders, any superseded decision, and the constraint future
|
|
25
|
+
changes must preserve.
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Architecture
|
|
3
|
+
title: '@webex/plugin-attachment-actions architecture'
|
|
4
|
+
description: Package-wide boundaries, resources, interactions, dependencies, and cross-cutting architecture.
|
|
5
|
+
tags: [architecture]
|
|
6
|
+
---
|
|
7
|
+
<!-- sdd-generated-metadata
|
|
8
|
+
doc_kind: standing-doc
|
|
9
|
+
generated_from: architecture@0.3.0
|
|
10
|
+
generated_by: claude-code
|
|
11
|
+
approved_by: rarajes2@cisco.com
|
|
12
|
+
updated_at: 2026-11-13T02:56:49Z
|
|
13
|
+
validation_status: pass-with-warnings
|
|
14
|
+
-->
|
|
15
|
+
|
|
16
|
+
# @webex/plugin-attachment-actions architecture
|
|
17
|
+
|
|
18
|
+
Canonical architecture for this package. Flow behavior lives in the
|
|
19
|
+
[Attachment actions plugin specification](../src/docs/README.md). This page owns package boundaries,
|
|
20
|
+
the plugin registration, the contract index, and how the package meets the rest of the SDK.
|
|
21
|
+
|
|
22
|
+
Related context: [specification registry](specs/README.md) ·
|
|
23
|
+
[package agent instructions](../AGENTS.md)
|
|
24
|
+
|
|
25
|
+
## Applicability
|
|
26
|
+
|
|
27
|
+
| Condition ID | Status | Evidence or reason | Owned section |
|
|
28
|
+
| ------------------------------------ | ---------- | ------------------ | ------------- |
|
|
29
|
+
| `repo.owns_datastore` | N/A | No database, file store, or migration in `src/attachmentActions.js` | Repository data and schema |
|
|
30
|
+
| `repo.holds_client_state` | N/A | `src/attachmentActions.js` caches no record; the stored event envelope is described in the module specification | Client state model |
|
|
31
|
+
| `repo.components_interact` | Applicable | `src/index.js` registers the conversation and Mercury plugins that `src/attachmentActions.js` relies on | Dependency and interaction topology |
|
|
32
|
+
| `repo.domain_data_across_components` | Applicable | Attachment action records and events pass from Hydra and Mercury through `src/attachmentActions.js` to callers | Object and data ownership |
|
|
33
|
+
| `repo.caches_data` | N/A | Nothing is kept after a call settles in `src/attachmentActions.js` | Caching catalog |
|
|
34
|
+
| `repo.observability_convention` | N/A | One error log line and one debug trace in `src/attachmentActions.js`; no metric or trace convention | Observability patterns |
|
|
35
|
+
| `repo.deploys_to_infra` | N/A | Library published to npm (`package.json`). No service runtime | Runtime and infrastructure |
|
|
36
|
+
| `repo.shared_base_libs` | Applicable | Extends WebexPlugin and uses the legacy build and lint stack (`babel.config.js`, `.eslintrc.js`) | Shared and base libraries |
|
|
37
|
+
| `repo.is_monorepo` | N/A | This SDD root is one package. The workspace around it is out of scope | Package map and inter-package dependencies |
|
|
38
|
+
| `repo.multi_platform` | N/A | `src/attachmentActions.js` has no platform branch; `process` declares {browser: true} and is not imported | Platform matrix |
|
|
39
|
+
| `repo.published_package` | Applicable | `package.json` name is @webex/plugin-attachment-actions and deploy:npm publishes it | Release and versioning |
|
|
40
|
+
| `repo.embedded_in_host` | N/A | No host theme or embed API in `src/attachmentActions.js` | Host integration and theming |
|
|
41
|
+
| `repo.exposes_commands_or_artifacts` | Applicable | build:src in `package.json` writes dist | Commands and generated artifacts |
|
|
42
|
+
| `repo.cross_repo_deps_material` | Applicable | Behavior depends on the Webex REST API attachment actions resource and the Mercury socket (`src/attachmentActions.js`) | Cross-repository topology |
|
|
43
|
+
| `repo.security_arch_warranted` | Applicable | `listen()` needs the spark:all and spark:kms scopes, and decrypted card inputs pass through `src/attachmentActions.js` | Security architecture |
|
|
44
|
+
|
|
45
|
+
## Design overview
|
|
46
|
+
|
|
47
|
+
`@webex/plugin-attachment-actions` is a published JavaScript library with one module. Importing it
|
|
48
|
+
registers the internal `conversation` and `mercury` plugins and then `AttachmentActions` as the public
|
|
49
|
+
plugin `attachmentActions`, reached as `webex.attachmentActions`. The `webex` and `webex-node` bundles
|
|
50
|
+
import it to register it.
|
|
51
|
+
|
|
52
|
+
An attachment action is the record of a user pressing an `Action.Submit` button on an adaptive card
|
|
53
|
+
attached to a Webex message, together with the card's input values. The Webex REST API serves these
|
|
54
|
+
records as the `attachment/actions` resource, which the SDK reaches as catalog service `hydra`. The
|
|
55
|
+
plugin answers two questions: "submit or read one" (post and get through Hydra) and "who submitted
|
|
56
|
+
what" (Mercury `cardAction` activities turned into webhook-shaped `created` events after `listen()`).
|
|
57
|
+
|
|
58
|
+
The package serves no routes, caches nothing, and persists nothing.
|
|
59
|
+
|
|
60
|
+
## Resource inventory and responsibilities
|
|
61
|
+
|
|
62
|
+
| Resource | Kind | Responsibility | Owner | Source | Detailed specification |
|
|
63
|
+
| -------- | ---- | -------------- | ----- | ------ | ---------------------- |
|
|
64
|
+
| Attachment actions plugin | package (one module) | Registration; attachment action records; attachment action events | @webex/web-sdk | src | [`src/docs/README.md`](../src/docs/README.md) |
|
|
65
|
+
|
|
66
|
+
## Interaction and execution flows
|
|
67
|
+
|
|
68
|
+
Representative end-to-end flow: a bot sends a card through the messages plugin and listens for the
|
|
69
|
+
submits that people make on it.
|
|
70
|
+
|
|
71
|
+
```mermaid
|
|
72
|
+
flowchart LR
|
|
73
|
+
App[application] -->|create, get| Plugin[webex.attachmentActions]
|
|
74
|
+
App -->|listen, on created| Plugin
|
|
75
|
+
Plugin -->|attachment/actions requests| Hydra[Webex REST API attachment actions]
|
|
76
|
+
Plugin -->|createEventEnvelope| Common[common]
|
|
77
|
+
Common -->|people get me| People[webex.people]
|
|
78
|
+
Plugin -->|connect, event:conversation.activity| Mercury[mercury plugin]
|
|
79
|
+
Convo[conversation plugin] -->|decrypts inbound activities and card inputs| Mercury
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
| From | To | Interaction or transport | Purpose | Failure or compatibility behavior |
|
|
83
|
+
| ---- | -- | ------------------------ | ------- | --------------------------------- |
|
|
84
|
+
| Application | `webex.attachmentActions` | In-process calls; `on` for events | Records, events | Rejections propagate |
|
|
85
|
+
| `AttachmentActions` | Webex REST API | HTTPS through `webex.request`, service `hydra` | Attachment action records | No retry here |
|
|
86
|
+
| `AttachmentActions` | `webex.internal.mercury` | `connect()` and `listenTo` | Attachment action events | A connect failure rejects `listen()` |
|
|
87
|
+
| `webex.internal.conversation` | Mercury activities | Payload transformer registered at import | Decrypted activities and inputs | Not called by this package |
|
|
88
|
+
| `AttachmentActions` | `@webex/common` | Import | Ids, envelope, event vocabulary | A failed identity lookup leaves the envelope `undefined` |
|
|
89
|
+
|
|
90
|
+
## Dependency topology
|
|
91
|
+
|
|
92
|
+
| Dependency | Type | Used by | Purpose | Version, failure, or fallback policy |
|
|
93
|
+
| ---------- | ---- | ------- | ------- | ------------------------------------ |
|
|
94
|
+
| `@webex/webex-core` | Internal | `src/index.js`, `src/attachmentActions.js` | Registration, plugin base, `webex.request`, services | `workspace:*` in `package.json` |
|
|
95
|
+
| `@webex/common` | Internal | `src/attachmentActions.js` | Hydra ids, cluster string, event envelope, `SDK_EVENT` | `workspace:*` |
|
|
96
|
+
| `@webex/internal-plugin-conversation` | Internal | `src/index.js` (import only) | Decrypts socket activities | `workspace:*` |
|
|
97
|
+
| `@webex/internal-plugin-mercury` | Internal | `src/index.js` (import), `src/attachmentActions.js` (calls) | Attachment action events | `workspace:*` |
|
|
98
|
+
| `@webex/plugin-people`, `@webex/plugin-logger`, `@webex/plugin-messages` | Internal peer | Reached at run time through `webex.people` and `webex.logger`; messages only in the integration spec | Current user for the envelope; logging; sending test cards | Peer dependencies; not imported by `src/` |
|
|
99
|
+
| `lodash` | External library | `src/attachmentActions.js` | `cloneDeep` | `^4.17.21` |
|
|
100
|
+
| `debug` | External library | `src/attachmentActions.js` | Trace of each created event | `^4.3.4` |
|
|
101
|
+
| Webex REST API attachment actions resource | External service | `src/attachmentActions.js` | Attachment action records | Resolved through the service catalog |
|
|
102
|
+
|
|
103
|
+
No import cycle exists: none of the internal dependencies imports this package. `@webex/common` reads
|
|
104
|
+
`webex.people` at run time without importing it.
|
|
105
|
+
|
|
106
|
+
## Public and consumer surfaces
|
|
107
|
+
|
|
108
|
+
| Surface | Type | Owner | Consumers | Compatibility policy | Source |
|
|
109
|
+
| ------- | ---- | ----- | --------- | -------------------- | ------ |
|
|
110
|
+
| `attachment-actions-public-sdk` — package @webex/plugin-attachment-actions, `webex.attachmentActions` with `create`, `get`, `listen`, and the `created` event | SDK, published to npm, public | Attachment actions plugin | `webex`, `webex-node` (registration); applications and the workspace socket sample (calls) | No versioning or deprecation rule is declared in the package | `package.json`, `src/index.js`, `src/attachmentActions.js` |
|
|
111
|
+
|
|
112
|
+
The attachment actions requests and the event shape are a protocol this package speaks, described
|
|
113
|
+
under *Protocol and wire format* in the
|
|
114
|
+
[module specification](../src/docs/README.md#protocol-and-wire-format). The other contracts this
|
|
115
|
+
package requires are registered in `.sdd/manifest.json` `contract_catalog`.
|
|
116
|
+
|
|
117
|
+
## Cross-cutting architecture
|
|
118
|
+
|
|
119
|
+
### Security
|
|
120
|
+
|
|
121
|
+
- Trust boundaries, scopes, and identity flow: see [Security architecture](#security-architecture).
|
|
122
|
+
- Sensitive surfaces and data classes: card input values, which hold whatever a user typed into the
|
|
123
|
+
card, and attachment action, message, room, and person ids.
|
|
124
|
+
|
|
125
|
+
### Observability and operations
|
|
126
|
+
|
|
127
|
+
- Logging and correlation: a failed event conversion logs one fixed `webex.logger.error` line with the
|
|
128
|
+
event type and the error message, and no activity content. A `debug('attachmentActions')` trace
|
|
129
|
+
prints each created event in full, card inputs included, when the `DEBUG` environment variable enables
|
|
130
|
+
that namespace. Request tracking comes from the webex-core interceptors.
|
|
131
|
+
- Metrics, traces, and audit signals: none.
|
|
132
|
+
- Ownership and operational entry points: `.github/CODEOWNERS` at the workspace root has no line for
|
|
133
|
+
`packages/@webex/plugin-attachment-actions`, so its default rule assigns the package to
|
|
134
|
+
`@webex/web-sdk`. No dashboards or runbooks are recorded in this package.
|
|
135
|
+
|
|
136
|
+
### Quality attributes
|
|
137
|
+
|
|
138
|
+
- Compatibility: callers rely on the registered name `attachmentActions`, the Hydra attachment action
|
|
139
|
+
object, and the event name `created` with its `data` fields.
|
|
140
|
+
- Latency: an event costs no request; it is triggered as the activity arrives.
|
|
141
|
+
- Test confidence: the package has no unit tests, and no working script runs its integration spec. No
|
|
142
|
+
coverage threshold is enforced.
|
|
143
|
+
|
|
144
|
+
## Dependency and interaction topology
|
|
145
|
+
|
|
146
|
+
```mermaid
|
|
147
|
+
flowchart LR
|
|
148
|
+
Index[src/index.js] -->|import| Convo[internal-plugin-conversation]
|
|
149
|
+
Index -->|import| Mercury[internal-plugin-mercury]
|
|
150
|
+
Index -->|registerPlugin attachmentActions| Core[webex-core]
|
|
151
|
+
Index --> Plugin[src/attachmentActions.js]
|
|
152
|
+
Plugin -->|WebexPlugin, request| Core
|
|
153
|
+
Plugin -->|ids, envelope, SDK_EVENT| Common[common]
|
|
154
|
+
Plugin -->|webex.internal.mercury| Mercury
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
| From | To | Kind | Purpose | Ordering or failure boundary |
|
|
158
|
+
| ---- | -- | ---- | ------- | ---------------------------- |
|
|
159
|
+
| `src/index.js` | conversation and Mercury plugins | Import at load | Register `webex.internal.conversation` and `webex.internal.mercury` | Before `attachmentActions` is registered |
|
|
160
|
+
| `src/index.js` | webex-core | Call at import | Register `attachmentActions` | First registration wins |
|
|
161
|
+
| `src/attachmentActions.js` | common | Import | Ids, envelope, vocabulary | Conversion errors are caught and logged inside the plugin |
|
|
162
|
+
|
|
163
|
+
## Object and data ownership
|
|
164
|
+
|
|
165
|
+
| Object or state | System of record | May write | May read | Movement or lifecycle |
|
|
166
|
+
| --------------- | ---------------- | --------- | -------- | --------------------- |
|
|
167
|
+
| Attachment action record (`id`, `type`, `messageId`, `inputs`, `personId`, `roomId`, `created`) | Webex REST API | Callers, through `create` | Callers, through `get`, and `created` listeners | Fetched per call; never kept here |
|
|
168
|
+
| Card on the parent message | Webex REST API, through the messages plugin | The application that sent the message | Clients that render it | Not handled by this package |
|
|
169
|
+
| Event envelope | This plugin instance, built by `@webex/common` | `listen()` | `getattachmentActionEvent` | Replaced by each `listen()` |
|
|
170
|
+
|
|
171
|
+
## Shared and base libraries
|
|
172
|
+
|
|
173
|
+
| Library | Inherited responsibility | Consumers | Version floor | Compatibility rule |
|
|
174
|
+
| ------- | ------------------------ | --------- | ------------- | ------------------ |
|
|
175
|
+
| `@webex/webex-core` `WebexPlugin` | `webex`, `request`, `logger`, and the event methods | `AttachmentActions` | `workspace:*` | Keep the registered name `attachmentActions` |
|
|
176
|
+
| `@webex/babel-config-legacy`, `@webex/eslint-config-legacy`, `@webex/jest-config-legacy`, `@webex/legacy-tools` | Build, lint, and test stack through one-line config files | Package tooling | `workspace:*` | Do not fork the config locally |
|
|
177
|
+
|
|
178
|
+
## Release and versioning
|
|
179
|
+
|
|
180
|
+
| Artifact | Publish target | Versioning rule | Deprecation window | Changelog or migration obligation |
|
|
181
|
+
| -------- | -------------- | --------------- | ------------------ | --------------------------------- |
|
|
182
|
+
| @webex/plugin-attachment-actions | npm through `deploy:npm` | None declared in the package | None declared | None declared in the package; the workspace owns changelog generation |
|
|
183
|
+
|
|
184
|
+
## Commands and generated artifacts
|
|
185
|
+
|
|
186
|
+
| Command or artifact | Owner | Inputs | Output or side effect | Compatibility boundary |
|
|
187
|
+
| ------------------- | ----- | ------ | --------------------- | ---------------------- |
|
|
188
|
+
| `yarn workspace @webex/plugin-attachment-actions build:src` | Package scripts | `src` | Writes `dist/` (JavaScript and source maps) through `webex-legacy-tools` | `dist/` is generated and never edited by hand |
|
|
189
|
+
| `yarn workspace @webex/plugin-attachment-actions build` | Package scripts | `src` | Runs `build:src` | Same output |
|
|
190
|
+
| `yarn workspace @webex/plugin-attachment-actions test:style` | Package scripts | `src` | ESLint run | The shared config ignores `docs/**` and `*.md` |
|
|
191
|
+
|
|
192
|
+
## Cross-repository topology
|
|
193
|
+
|
|
194
|
+
| Repository or external system | Relationship | Exchanged contract or artifact | Owner | Sequencing constraint |
|
|
195
|
+
| ----------------------------- | ------------- | ------------------------------ | ----- | --------------------- |
|
|
196
|
+
| `@webex/webex-core` (workspace sibling; module spec consulted) | Consumes | `registerPlugin`, `WebexPlugin`, `request`, services | @webex/web-client, @webex/web-sdk | Registered before the first instance |
|
|
197
|
+
| `@webex/common` (workspace sibling; module spec consulted) | Consumes | Hydra ids, `createEventEnvelope`, `SDK_EVENT` | @webex/web-client, @webex/web-sdk | None |
|
|
198
|
+
| `@webex/internal-plugin-conversation` (workspace sibling; no spec, code consulted) | Consumes | Decryption of inbound activities and card inputs | @webex/web-client, @webex/web-sdk | Registered before Mercury events arrive |
|
|
199
|
+
| `@webex/internal-plugin-mercury` (workspace sibling; module spec consulted, stale on sessions) | Consumes | `connect`, `event:conversation.activity` | @webex/web-client, @webex/web-sdk | Connected before events flow |
|
|
200
|
+
| `webex`, `webex-node` (workspace siblings) | Consumed by | The plugin registration | @webex/web-sdk | None |
|
|
201
|
+
| Webex REST API attachment actions resource | Consumes | Attachment action records | Not recorded in this repository | None |
|
|
202
|
+
|
|
203
|
+
## Security architecture
|
|
204
|
+
|
|
205
|
+
```mermaid
|
|
206
|
+
flowchart LR
|
|
207
|
+
Caller[caller] -->|attachment actions, ids| Plugin[webex.attachmentActions]
|
|
208
|
+
Plugin -->|SDK token| Hydra[Webex REST API]
|
|
209
|
+
Mercury[Mercury socket, spark:all and spark:kms] -->|activities decrypted by conversation| Plugin
|
|
210
|
+
Plugin -->|records, created events| Caller
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
- This package holds no credential and no key. Every request carries the SDK authorization added by
|
|
214
|
+
webex-core; the `listen()` JSDoc states that `listen()` needs the `spark:all` and `spark:kms` scopes
|
|
215
|
+
and that enabling `spark:all` for an application also enables `spark:kms`.
|
|
216
|
+
- Socket activities are encrypted; the conversation plugin, registered by this package's import,
|
|
217
|
+
decrypts them before this package reads them, card inputs included. When the inputs cannot be
|
|
218
|
+
decrypted, the event carries the conversation plugin's failure string in their place (module
|
|
219
|
+
specification, Caller-visible failure modes).
|
|
220
|
+
- Ids go into request paths. The package's logging is described under
|
|
221
|
+
[Observability and operations](#observability-and-operations); the `debug` trace is the one place
|
|
222
|
+
inputs can reach a log.
|
|
223
|
+
- What a caller may submit or read is decided by Hydra for the authorized user; the package passes
|
|
224
|
+
records through and keeps no copy.
|
|
225
|
+
|
|
226
|
+
## Domain language
|
|
227
|
+
|
|
228
|
+
| Term | Repository-specific meaning | Authoritative source |
|
|
229
|
+
| ---- | --------------------------- | -------------------- |
|
|
230
|
+
| Attachment action | The record of an `Action.Submit` press on a card attached to a message, with the card's inputs | `src/attachmentActions.js` |
|
|
231
|
+
| Card | An adaptive card (`application/vnd.microsoft.card.adaptive`) sent as a message attachment | `test/integration/spec/attachmentActions.js` |
|
|
232
|
+
| Inputs | The values of the card's input fields, keyed by input id | `src/attachmentActions.js` |
|
|
233
|
+
| Hydra | The Webex REST API, reached as catalog service `hydra` | `src/attachmentActions.js` |
|
|
234
|
+
| Hydra attachment action id | base64url of `ciscospark://<cluster>/ATTACHMENT_ACTION/<uuid>` | `src/attachmentActions.js` |
|
|
235
|
+
| `cardAction` | The activity verb Mercury delivers for a card submit | `src/attachmentActions.js` |
|
|
236
|
+
| Event envelope | Webhook-shaped wrapper built once by `listen()` and cloned per event | `src/attachmentActions.js` |
|
|
237
|
+
|
|
238
|
+
## References and maintenance
|
|
239
|
+
|
|
240
|
+
- Decisions: [adr/](adr/index.md)
|
|
241
|
+
- Instantiated specifications and routing: [specs/README.md](specs/README.md)
|
|
242
|
+
- Repository rules and patterns: [package agent instructions](../AGENTS.md)
|
|
243
|
+
- Update this document in the same change that alters package boundaries, resource ownership,
|
|
244
|
+
cross-resource interaction, or cross-cutting architecture.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Getting Started
|
|
3
|
+
title: Getting started
|
|
4
|
+
description: Local setup, build, run, and test routing for @webex/plugin-attachment-actions.
|
|
5
|
+
tags: [onboarding]
|
|
6
|
+
---
|
|
7
|
+
<!-- sdd-generated-metadata
|
|
8
|
+
doc_kind: standing-doc
|
|
9
|
+
generated_from: getting-started@0.3.0
|
|
10
|
+
generated_by: claude-code
|
|
11
|
+
approved_by: rarajes2@cisco.com
|
|
12
|
+
updated_at: 2026-11-13T02:56:49Z
|
|
13
|
+
validation_status: pass-with-warnings
|
|
14
|
+
-->
|
|
15
|
+
|
|
16
|
+
# Getting started
|
|
17
|
+
|
|
18
|
+
Onboarding for **@webex/plugin-attachment-actions**, a package inside the `webex-js-sdk` Yarn
|
|
19
|
+
workspace. Run every command from the workspace root. The package scripts run through
|
|
20
|
+
`yarn workspace @webex/plugin-attachment-actions <script>`; `package.json` in
|
|
21
|
+
`packages/@webex/plugin-attachment-actions` defines them.
|
|
22
|
+
|
|
23
|
+
## Prerequisites
|
|
24
|
+
|
|
25
|
+
| Tool or access | Version or requirement |
|
|
26
|
+
| -------------- | ---------------------- |
|
|
27
|
+
| Node.js | Use 22.14: the workspace root `AGENTS.md` requires it and the workspace `.nvmrc` selects `lts/jod` (Node 22). This package's `engines` accepts `>=16`. The workspace root `package.json` `engines.node` reads `18.x`, which conflicts with the other pins; the build and lint pass on 22.14 |
|
|
28
|
+
| Yarn | `yarn@3.4.1` (`packageManager` in the workspace root `package.json`) |
|
|
29
|
+
| Registry or account access | N/A for building and linting |
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
yarn
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The workspace `deploy.yml` workflow installs with the same command.
|
|
38
|
+
|
|
39
|
+
Fresh-checkout workspace setup (building `webex-legacy-tools` and sibling `dist/`) is owned by the workspace root; see
|
|
40
|
+
[Prebuilding](../../../../CONTRIBUTING.md#prebuilding).
|
|
41
|
+
|
|
42
|
+
## Build
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
yarn workspace @webex/plugin-attachment-actions build:src
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`build:src` writes JavaScript and source maps for the two source files to `dist/` through
|
|
49
|
+
`webex-legacy-tools`. `dist/` is ignored by Git. The `build` script runs `yarn build:src`; the package
|
|
50
|
+
emits no type declarations.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
yarn workspace @webex/plugin-attachment-actions build
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Run
|
|
57
|
+
|
|
58
|
+
N/A — this is a library with no start script. Importing `@webex/plugin-attachment-actions` registers
|
|
59
|
+
`webex.attachmentActions`.
|
|
60
|
+
|
|
61
|
+
## Tests
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
yarn workspace @webex/plugin-attachment-actions test:style
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
| Tier | Command | Test location | Framework | External dependencies |
|
|
68
|
+
| ---- | ------- | ------------- | --------- | --------------------- |
|
|
69
|
+
| Unit | N/A — `package.json` defines no `test:unit` script | none | N/A | N/A |
|
|
70
|
+
|
|
71
|
+
`test:style` lints `src/` with eslint through `@webex/eslint-config-legacy`.
|
|
72
|
+
|
|
73
|
+
- Coverage or quality gate: none; the package defines no unit test, no coverage script, and the legacy
|
|
74
|
+
Jest configuration it re-exports sets no threshold
|
|
75
|
+
- Enforcement source: N/A
|
|
76
|
+
- Test environment or QA dependencies: none for lint
|
|
77
|
+
|
|
78
|
+
This package has no unit tests: `package.json` defines no `test:unit` script and there is no
|
|
79
|
+
`test/unit` directory. Add both together when you add the first unit case; sibling legacy packages
|
|
80
|
+
define `test:unit` as `webex-legacy-tools test --unit --runner jest`.
|
|
81
|
+
|
|
82
|
+
`package.json` defines no `test:integration` script, so mocha never runs
|
|
83
|
+
`test/integration/spec/attachmentActions.js`. `yarn workspace @webex/plugin-attachment-actions test:browser:broken` (manifest command
|
|
84
|
+
`browser-test`) runs that spec through karma. On 2026-11-13 under Node 22.14 the karma bundle failed to
|
|
85
|
+
parse `isbot` (an ES module in the workspace `node_modules`), so Chrome and Firefox headless reported a
|
|
86
|
+
bundle error, ran no case, and the command still exited zero. If the spec is run, its two cases need
|
|
87
|
+
two provisioned test users from `@webex/test-helper-test-users` and the live services.
|
|
88
|
+
|
|
89
|
+
That command is not listed in the table above because it verifies nothing today, and its exit code is
|
|
90
|
+
not a test result.
|
|
91
|
+
|
|
92
|
+
Do not run the aggregate `test` script in `package.json`. It runs `test:style`, then exits 1 with
|
|
93
|
+
`Couldn't find a script named "test:unit"` (checked 2026-11-13); it also names `test:integration` and
|
|
94
|
+
`test:browser`, which do not exist. It is deliberately not a manifest command; run the commands above
|
|
95
|
+
instead.
|
|
96
|
+
|
|
97
|
+
## Configuration and secrets
|
|
98
|
+
|
|
99
|
+
- Required configuration: none. The plugin registers no config of its own
|
|
100
|
+
- Environment overrides: none read by `src/` directly; the `debug` package reads `DEBUG`, and
|
|
101
|
+
`DEBUG=attachmentActions` turns on the trace of each created event
|
|
102
|
+
- Secret source: N/A; the package holds no secret
|
|
103
|
+
- Package or artifact access: N/A
|
|
104
|
+
- Required neighboring packages: `@webex/webex-core`, `@webex/common`,
|
|
105
|
+
`@webex/internal-plugin-conversation`, and `@webex/internal-plugin-mercury` resolve through the
|
|
106
|
+
workspace; the host must also register `@webex/plugin-people` and `@webex/plugin-logger`, the peer
|
|
107
|
+
dependencies that `listen()` and the conversion error line reach at run time
|
|
108
|
+
- Platform, simulator, device, or SDK setup: none
|
|
109
|
+
- Never commit credentials or copy production secrets into a local config.
|
|
110
|
+
|
|
111
|
+
## First-run verification
|
|
112
|
+
|
|
113
|
+
1. Run `yarn workspace @webex/plugin-attachment-actions build:src` and check that it reports `Built plugin-attachment-actions: 2 files`.
|
|
114
|
+
2. Run `yarn workspace @webex/plugin-attachment-actions test:style`.
|
|
115
|
+
|
|
116
|
+
Expected result: both commands exit zero. `test:style` reports 0 errors and 2 warnings: the
|
|
117
|
+
`@typescript-eslint/no-var-requires` warning for the `debug` require in `src/attachmentActions.js`, and
|
|
118
|
+
one "File ignored" warning for `src/docs/README.md`.
|
|
119
|
+
|
|
120
|
+
## Next steps
|
|
121
|
+
|
|
122
|
+
- [Package architecture](architecture.md)
|
|
123
|
+
- [Specification registry](specs/README.md)
|
|
124
|
+
- [Documentation index](index.md)
|
package/docs/index.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
okf_version: '0.1'
|
|
3
|
+
---
|
|
4
|
+
<!-- sdd-generated-metadata
|
|
5
|
+
doc_kind: standing-doc
|
|
6
|
+
generated_from: docs-index@0.3.0
|
|
7
|
+
generated_by: claude-code
|
|
8
|
+
approved_by: rarajes2@cisco.com
|
|
9
|
+
updated_at: 2026-11-13T02:56:49Z
|
|
10
|
+
validation_status: pass-with-warnings
|
|
11
|
+
-->
|
|
12
|
+
|
|
13
|
+
# @webex/plugin-attachment-actions documentation
|
|
14
|
+
|
|
15
|
+
Doc map for developers and agents working on the Attachment actions plugin.
|
|
16
|
+
|
|
17
|
+
## Start here
|
|
18
|
+
|
|
19
|
+
- [Getting started](getting-started.md)
|
|
20
|
+
- [Package architecture](architecture.md)
|
|
21
|
+
|
|
22
|
+
## Decisions
|
|
23
|
+
|
|
24
|
+
- [adr/](adr/index.md) — architectural decision records
|
|
25
|
+
|
|
26
|
+
## Specifications and contracts
|
|
27
|
+
|
|
28
|
+
- [architecture.md](architecture.md) — canonical package architecture and contract index
|
|
29
|
+
- [specs/README.md](specs/README.md) — manifest-backed module and contract registry
|
|
30
|
+
- [`src/docs/README.md`](../src/docs/README.md) — the Attachment actions plugin specification beside
|
|
31
|
+
its code
|
|
32
|
+
- [adr/](adr/index.md) — concrete architectural decisions; blank ADR templates remain under the
|
|
33
|
+
monorepo root `.sdd/`
|
|
34
|
+
|
|
35
|
+
This package is a library, so there is no service specification and no OpenAPI document. Exact
|
|
36
|
+
contract details live in the native sources linked from the architecture index: `package.json` and
|
|
37
|
+
`src/index.js` for the package and its registration, and `src/attachmentActions.js` for the API.
|
|
38
|
+
|
|
39
|
+
## Related repository resources
|
|
40
|
+
|
|
41
|
+
- [`README.md`](../README.md) — retained npm page; context only, it holds no usage example and its
|
|
42
|
+
heading names the messages plugin, see [ADR-0001](adr/0001-retain-product-readme.md)
|
|
43
|
+
- [`AGENTS.md`](../AGENTS.md) — agent instructions for this package
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Reference
|
|
3
|
+
title: Specification registry
|
|
4
|
+
description: Canonical specification registry and change-routing guide.
|
|
5
|
+
tags: [specifications, registry]
|
|
6
|
+
---
|
|
7
|
+
<!-- sdd-generated-metadata
|
|
8
|
+
doc_kind: standing-doc
|
|
9
|
+
generated_from: spec-index@0.3.0
|
|
10
|
+
generated_by: claude-code
|
|
11
|
+
approved_by: rarajes2@cisco.com
|
|
12
|
+
updated_at: 2026-11-13T02:56:49Z
|
|
13
|
+
validation_status: pass-with-warnings
|
|
14
|
+
-->
|
|
15
|
+
|
|
16
|
+
# Specification registry
|
|
17
|
+
|
|
18
|
+
Use this page to find the canonical package architecture and every instantiated module specification
|
|
19
|
+
plus native contract. Keep technical facts in one owning document and use this page only for
|
|
20
|
+
navigation, ownership, status, and change/test routing.
|
|
21
|
+
|
|
22
|
+
Start with the [package architecture](../architecture.md). No service specification exists because this
|
|
23
|
+
package is a library.
|
|
24
|
+
|
|
25
|
+
## Document roles
|
|
26
|
+
|
|
27
|
+
| Document | Canonical ownership |
|
|
28
|
+
| -------- | ------------------- |
|
|
29
|
+
| [Package architecture](../architecture.md) | Package boundaries, resource inventory, interactions, dependency topology, and cross-cutting architecture |
|
|
30
|
+
| Module specifications | Stable behavior and design at each manifest-routed `<module-path>/docs/README.md` |
|
|
31
|
+
| [ADR](../adr/index.md) | A durable decision, its deciders, rationale, consequences, and supersession lineage |
|
|
32
|
+
|
|
33
|
+
## Instantiated specification registry
|
|
34
|
+
|
|
35
|
+
| Resource | Role | Canonical path | Owner | Status | Last verified |
|
|
36
|
+
| -------- | ---- | -------------- | ----- | ------ | ------------- |
|
|
37
|
+
| Package | Architecture | `docs/architecture.md` | @webex/web-sdk | Draft | 2026-11-13 |
|
|
38
|
+
| Attachment actions plugin | Module | `src/docs/README.md` | @webex/web-sdk | Draft | 2026-11-13 |
|
|
39
|
+
| Retain the product README | ADR | `docs/adr/0001-retain-product-readme.md` | @webex/web-sdk | Accepted | 2026-11-13 |
|
|
40
|
+
|
|
41
|
+
### Module registry
|
|
42
|
+
|
|
43
|
+
| Module | Responsibility | Manifest coverage state | Start here |
|
|
44
|
+
| --- | --- | --- | --- |
|
|
45
|
+
| `src/` | `webex.attachmentActions`: card submit actions posted and read through Hydra; webhook-shaped `created` events from Mercury `cardAction` activities | Partial | `src/docs/README.md` |
|
|
46
|
+
|
|
47
|
+
Generator-side field measurement for the module is complete (100%, assessed 2026-11-13). Independent
|
|
48
|
+
validation on 2026-11-13 passed with warnings (0 Blocking, 2 Important); validator runtime
|
|
49
|
+
01a1d2c4-c928-7fc0-bc29-9bf787bf37bc. The command-role and unit-test follow-ups, a characterization
|
|
50
|
+
baseline, and promotion past Partial remain pending.
|
|
51
|
+
|
|
52
|
+
## Change and verification routing
|
|
53
|
+
|
|
54
|
+
| Change affects | Load and update | Verification route |
|
|
55
|
+
| -------------- | --------------- | ------------------ |
|
|
56
|
+
| Package boundaries or cross-cutting architecture | `docs/architecture.md` and applicable ADRs | `yarn workspace @webex/plugin-attachment-actions build:src` and `test:style`, and the module spec |
|
|
57
|
+
| A stable code, package, or component boundary | `src/docs/README.md` | Build and lint |
|
|
58
|
+
| A public method, request path, event field, or the registration | The owning architecture section, `src/docs/README.md`, and the native definition in `src/attachmentActions.js`, `src/index.js`, or `package.json` | Build and lint; add a `test/unit/spec` case and a `test:unit` script for the changed path, since the package has no unit tests and no script runs the integration spec |
|
|
59
|
+
|
|
60
|
+
## Module and contract registration
|
|
61
|
+
|
|
62
|
+
The module specification is generated at the exact `modules[].canonical_spec` path recorded in
|
|
63
|
+
`.sdd/manifest.json`. Register every module and submodule in the Module registry above in manifest tree
|
|
64
|
+
order.
|
|
65
|
+
|
|
66
|
+
Contracts are registered in `.sdd/manifest.json` `contract_catalog` and indexed in
|
|
67
|
+
[`docs/architecture.md`](../architecture.md#public-and-consumer-surfaces) with a stable ID, publication
|
|
68
|
+
state, native source, and owning module. This page provides navigation and ownership rather than a copied
|
|
69
|
+
contract.
|
package/package.json
CHANGED
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
]
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@webex/common": "3.
|
|
26
|
-
"@webex/internal-plugin-conversation": "3.13.0-next.
|
|
27
|
-
"@webex/internal-plugin-mercury": "3.
|
|
28
|
-
"@webex/webex-core": "3.
|
|
25
|
+
"@webex/common": "3.13.0-next.2",
|
|
26
|
+
"@webex/internal-plugin-conversation": "3.13.0-next.10",
|
|
27
|
+
"@webex/internal-plugin-mercury": "3.13.0-next.6",
|
|
28
|
+
"@webex/webex-core": "3.13.0-next.6",
|
|
29
29
|
"debug": "^4.3.4",
|
|
30
30
|
"lodash": "^4.17.21"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@webex/plugin-logger": "3.
|
|
34
|
-
"@webex/plugin-messages": "3.13.0-next.
|
|
35
|
-
"@webex/plugin-people": "3.
|
|
33
|
+
"@webex/plugin-logger": "3.13.0-next.6",
|
|
34
|
+
"@webex/plugin-messages": "3.13.0-next.10",
|
|
35
|
+
"@webex/plugin-people": "3.13.0-next.6"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "yarn build:src",
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
"@webex/eslint-config-legacy": "0.0.0",
|
|
49
49
|
"@webex/jest-config-legacy": "0.0.0",
|
|
50
50
|
"@webex/legacy-tools": "0.0.0",
|
|
51
|
-
"@webex/plugin-logger": "3.
|
|
52
|
-
"@webex/plugin-messages": "3.13.0-next.
|
|
53
|
-
"@webex/plugin-people": "3.
|
|
54
|
-
"@webex/test-helper-chai": "3.
|
|
55
|
-
"@webex/test-helper-mocha": "3.
|
|
56
|
-
"@webex/test-helper-mock-webex": "3.
|
|
57
|
-
"@webex/test-helper-test-users": "3.
|
|
51
|
+
"@webex/plugin-logger": "3.13.0-next.6",
|
|
52
|
+
"@webex/plugin-messages": "3.13.0-next.10",
|
|
53
|
+
"@webex/plugin-people": "3.13.0-next.6",
|
|
54
|
+
"@webex/test-helper-chai": "3.13.0-next.2",
|
|
55
|
+
"@webex/test-helper-mocha": "3.13.0-next.2",
|
|
56
|
+
"@webex/test-helper-mock-webex": "3.13.0-next.2",
|
|
57
|
+
"@webex/test-helper-test-users": "3.13.0-next.2",
|
|
58
58
|
"eslint": "^8.24.0",
|
|
59
59
|
"prettier": "^2.7.1"
|
|
60
60
|
},
|
|
61
|
-
"version": "3.13.0-next.
|
|
61
|
+
"version": "3.13.0-next.10"
|
|
62
62
|
}
|