@rtc-agent/component 0.1.0

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.
@@ -0,0 +1,29 @@
1
+ ---
2
+ title: "Create and Complete a Task"
3
+ tags: ["crud", "basic"]
4
+ description: "End-to-end flow: create a task, then mark it complete."
5
+ ---
6
+
7
+ # Create and Complete a Task
8
+
9
+ ## Goal
10
+
11
+ Demonstrate the basic task lifecycle: create → update.
12
+
13
+ ## Steps
14
+
15
+ 1. **Create a task** — call `task.create` with a title and priority.
16
+ 2. **List tasks** — call `task.list` to verify the new task appears.
17
+ 3. **Mark complete** — call `task.update` with `completed: true`.
18
+ 4. **Verify** — call `task.list` with filter `completed` to see it.
19
+
20
+ ## Expected Result
21
+
22
+ - A new task exists in the list with `completed: true`.
23
+ - The task's `priority` and `title` match what was passed to `create`.
24
+
25
+ ## Functions Used
26
+
27
+ - `task.create`
28
+ - `task.list`
29
+ - `task.update`
@@ -0,0 +1,32 @@
1
+ ---
2
+ title: "Filter Tasks by Priority"
3
+ tags: ["crud", "query"]
4
+ description: "Create tasks with different priorities, then filter the list."
5
+ ---
6
+
7
+ # Filter Tasks by Priority
8
+
9
+ ## Goal
10
+
11
+ Show how to manage multiple tasks and use the filter parameter.
12
+
13
+ ## Steps
14
+
15
+ 1. **Create three tasks** with priorities `high`, `medium`, `low`.
16
+ 2. **List all tasks** — call `task.list` with no filter.
17
+ 3. **Filter active** — call `task.list` with `filter: "active"`.
18
+ 4. **Complete the high-priority task** — call `task.update`.
19
+ 5. **Filter completed** — call `task.list` with `filter: "completed"`.
20
+ 6. **Delete a task** — call `task.delete`.
21
+
22
+ ## Expected Result
23
+
24
+ - After step 5, only the high-priority task appears in the completed list.
25
+ - After step 6, the deleted task no longer appears in any list.
26
+
27
+ ## Functions Used
28
+
29
+ - `task.create`
30
+ - `task.list`
31
+ - `task.update`
32
+ - `task.delete`
@@ -0,0 +1,14 @@
1
+ {
2
+ "scenarios": [
3
+ {
4
+ "file": "create-and-complete.md",
5
+ "name": "Create and Complete a Task",
6
+ "description": "End-to-end flow: create a task, then mark it complete."
7
+ },
8
+ {
9
+ "file": "filter-by-priority.md",
10
+ "name": "Filter Tasks by Priority",
11
+ "description": "Create tasks with different priorities, then filter the list."
12
+ }
13
+ ]
14
+ }
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@rtc-agent/component",
3
+ "version": "0.1.0",
4
+ "description": "RTC Agent Web Components(基于 Lit)",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md"
17
+ ],
18
+ "dependencies": {
19
+ "@floating-ui/dom": "^1.8.0",
20
+ "@lit-labs/virtualizer": "^2.1.1",
21
+ "@lit/context": "^1.1.6",
22
+ "@primer/octicons": "^19.33.0",
23
+ "dompurify": "^3.4.14",
24
+ "gsap": "^3.15.0",
25
+ "highlight.js": "^11.12.0",
26
+ "interactjs": "^1.10.28",
27
+ "lit": "^3.1.0",
28
+ "marked": "^18.0.11",
29
+ "@rtc-agent/persistence": "0.1.0",
30
+ "@rtc-agent/client": "0.1.0",
31
+ "@rtc-agent/protocol": "0.1.0"
32
+ },
33
+ "devDependencies": {
34
+ "@types/dompurify": "^3.2.0",
35
+ "jsdom": "^30.0.1",
36
+ "typescript": "^5.4.0",
37
+ "vite": "^5.4.0",
38
+ "vite-plugin-node-polyfills": "^0.28.0",
39
+ "vitest": "^2.0.0"
40
+ },
41
+ "scripts": {
42
+ "build": "vite build",
43
+ "dev": "vite",
44
+ "typecheck": "tsc --noEmit",
45
+ "test": "vitest run"
46
+ }
47
+ }