@11agents/cli 0.1.41 → 0.1.42

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.
@@ -55,6 +55,82 @@ If device, logged-in account, target video, or measurement window is missing, as
55
55
  11agents mobile add-metrics --record-id pub_123 --platform tiktok --metric views=0 --json --task-id TASK_123
56
56
  ```
57
57
 
58
+ 6. When a project swarm token is available, map collected TikTok data into `swarm.telemetry.v1` instead of returning only a markdown summary:
59
+ - Use `platform: "tiktok_public"`.
60
+ - Account overview rows are `artifact_type: "account_period"`; create one artifact per account/period/date range and put `period`, `period_days`, `date_range`, account id, device id, and evidence paths in payload fields.
61
+ - Single-video rows are `artifact_type: "video"`; create one artifact per video/profile order/post id and put `profile_order`, `posted_time`, caption/title, account id, device id, and evidence paths in artifact or observation payload fields.
62
+ - Put numeric analytics in `observations[].metrics`.
63
+ - Include `dashboard_spec.metric_schema` and set recovered account/video metrics to `aggregation: "snapshot"` so Agent Performance does not sum values that already include a time window.
64
+ - Include `observation_table` widgets with explicit columns for account period rows and video rows so both account-level and single-video fields are visible.
65
+
66
+ ## Swarm Dashboard Contract
67
+
68
+ Use explicit snapshot tables for TikTok metrics:
69
+
70
+ ```json
71
+ {
72
+ "schema_version": "swarm.dashboard.v1",
73
+ "title": "TikTok Data Collection",
74
+ "metric_schema": {
75
+ "post_views": { "label": "Post views", "aggregation": "snapshot" },
76
+ "profile_views": { "label": "Profile views", "aggregation": "snapshot" },
77
+ "views": { "label": "Views", "aggregation": "snapshot" },
78
+ "likes": { "label": "Likes", "aggregation": "snapshot" },
79
+ "comments": { "label": "Comments", "aggregation": "snapshot" },
80
+ "shares": { "label": "Shares", "aggregation": "snapshot" },
81
+ "saves": { "label": "Saves", "aggregation": "snapshot" },
82
+ "avg_watch_seconds": { "label": "Avg watch", "aggregation": "snapshot", "unit": "seconds" },
83
+ "watched_full_rate": { "label": "Watched full", "aggregation": "snapshot", "format": "percent" },
84
+ "new_followers": { "label": "New followers", "aggregation": "snapshot" }
85
+ },
86
+ "widgets": [
87
+ {
88
+ "id": "account_periods",
89
+ "title": "Account Period Snapshots",
90
+ "type": "table",
91
+ "query": {
92
+ "kind": "observation_table",
93
+ "platform": "tiktok_public",
94
+ "artifact_type": "account_period",
95
+ "latest_per_artifact": true,
96
+ "columns": [
97
+ { "key": "period", "label": "Period", "source": "payload" },
98
+ { "key": "date_range", "label": "Date range", "source": "payload" },
99
+ { "key": "post_views", "label": "Post views", "source": "metric" },
100
+ { "key": "profile_views", "label": "Profile views", "source": "metric" },
101
+ { "key": "likes", "label": "Likes", "source": "metric" },
102
+ { "key": "comments", "label": "Comments", "source": "metric" },
103
+ { "key": "shares", "label": "Shares", "source": "metric" }
104
+ ]
105
+ }
106
+ },
107
+ {
108
+ "id": "video_snapshots",
109
+ "title": "Video Snapshots",
110
+ "type": "table",
111
+ "query": {
112
+ "kind": "observation_table",
113
+ "platform": "tiktok_public",
114
+ "artifact_type": "video",
115
+ "latest_per_artifact": true,
116
+ "columns": [
117
+ { "key": "profile_order", "label": "Profile order", "source": "payload" },
118
+ { "key": "posted_time", "label": "Posted time", "source": "payload" },
119
+ { "key": "views", "label": "Views", "source": "metric" },
120
+ { "key": "likes", "label": "Likes", "source": "metric" },
121
+ { "key": "comments", "label": "Comments", "source": "metric" },
122
+ { "key": "shares", "label": "Shares", "source": "metric" },
123
+ { "key": "saves", "label": "Saves", "source": "metric" },
124
+ { "key": "avg_watch_seconds", "label": "Avg watch", "source": "metric" },
125
+ { "key": "watched_full_rate", "label": "Watched full", "source": "metric" },
126
+ { "key": "new_followers", "label": "New followers", "source": "metric" }
127
+ ]
128
+ }
129
+ }
130
+ ]
131
+ }
132
+ ```
133
+
58
134
  ## Output
59
135
 
60
136
  Return metric status, snapshot ids, account/video target, data freshness, screenshot paths when created, run log path, missing access, and `agent_memory_delta` with reusable creative or account learning.
@@ -41,9 +41,85 @@ If records, platform post id/permalink, or analytics access is missing, ask the
41
41
  ```
42
42
 
43
43
  5. Treat X, Facebook, and unsupported platform collectors that return `missing_access` as a valid recovery status. Ask for the relevant API token, analytics export, or manual values, then append with `11agents mobile add-metrics`.
44
- 6. If platform metrics are unavailable, record the missing access and ask for the relevant token/export instead of inventing numbers.
45
- 7. Summarize metrics by platform, account, device, content type, creative pattern, and issue/task id.
46
- 8. Write reusable learning as `agent_memory_delta` for channel agents.
44
+ 6. For TikTok account/video recovery, map the data into `swarm.telemetry.v1` when the project swarm token is available:
45
+ - Use `platform: "tiktok_public"`.
46
+ - Use `artifact_type: "account_period"` for account overview period/date-range rows.
47
+ - Use `artifact_type: "video"` for single-video/profile-order rows.
48
+ - Put period/date range, posted time, profile order, account id, device id, and evidence paths in payload/artifact fields.
49
+ - Put numeric analytics in `observations[].metrics`.
50
+ - In `dashboard_spec.metric_schema`, mark windowed/snapshot metrics as `aggregation: "snapshot"` so Agent Performance does not sum them again.
51
+ - Include `observation_table` widgets for account period snapshots and video snapshots, with explicit columns for every recovered field.
52
+ 7. If platform metrics are unavailable, record the missing access and ask for the relevant token/export instead of inventing numbers.
53
+ 8. Summarize metrics by platform, account, device, content type, creative pattern, and issue/task id.
54
+ 9. Write reusable learning as `agent_memory_delta` for channel agents.
55
+
56
+ ## TikTok Dashboard Contract
57
+
58
+ TikTok recovery should include account-level and video-level tables in `dashboard_spec`:
59
+
60
+ ```json
61
+ {
62
+ "schema_version": "swarm.dashboard.v1",
63
+ "title": "TikTok Data Collection",
64
+ "metric_schema": {
65
+ "post_views": { "label": "Post views", "aggregation": "snapshot" },
66
+ "profile_views": { "label": "Profile views", "aggregation": "snapshot" },
67
+ "views": { "label": "Views", "aggregation": "snapshot" },
68
+ "likes": { "label": "Likes", "aggregation": "snapshot" },
69
+ "comments": { "label": "Comments", "aggregation": "snapshot" },
70
+ "shares": { "label": "Shares", "aggregation": "snapshot" },
71
+ "saves": { "label": "Saves", "aggregation": "snapshot" },
72
+ "avg_watch_seconds": { "label": "Avg watch", "aggregation": "snapshot", "unit": "seconds" },
73
+ "watched_full_rate": { "label": "Watched full", "aggregation": "snapshot", "format": "percent" },
74
+ "new_followers": { "label": "New followers", "aggregation": "snapshot" }
75
+ },
76
+ "widgets": [
77
+ {
78
+ "id": "account_periods",
79
+ "title": "Account Period Snapshots",
80
+ "type": "table",
81
+ "query": {
82
+ "kind": "observation_table",
83
+ "platform": "tiktok_public",
84
+ "artifact_type": "account_period",
85
+ "latest_per_artifact": true,
86
+ "columns": [
87
+ { "key": "period", "label": "Period", "source": "payload" },
88
+ { "key": "date_range", "label": "Date range", "source": "payload" },
89
+ { "key": "post_views", "label": "Post views", "source": "metric" },
90
+ { "key": "profile_views", "label": "Profile views", "source": "metric" },
91
+ { "key": "likes", "label": "Likes", "source": "metric" },
92
+ { "key": "comments", "label": "Comments", "source": "metric" },
93
+ { "key": "shares", "label": "Shares", "source": "metric" }
94
+ ]
95
+ }
96
+ },
97
+ {
98
+ "id": "video_snapshots",
99
+ "title": "Video Snapshots",
100
+ "type": "table",
101
+ "query": {
102
+ "kind": "observation_table",
103
+ "platform": "tiktok_public",
104
+ "artifact_type": "video",
105
+ "latest_per_artifact": true,
106
+ "columns": [
107
+ { "key": "profile_order", "label": "Profile order", "source": "payload" },
108
+ { "key": "posted_time", "label": "Posted time", "source": "payload" },
109
+ { "key": "views", "label": "Views", "source": "metric" },
110
+ { "key": "likes", "label": "Likes", "source": "metric" },
111
+ { "key": "comments", "label": "Comments", "source": "metric" },
112
+ { "key": "shares", "label": "Shares", "source": "metric" },
113
+ { "key": "saves", "label": "Saves", "source": "metric" },
114
+ { "key": "avg_watch_seconds", "label": "Avg watch", "source": "metric" },
115
+ { "key": "watched_full_rate", "label": "Watched full", "source": "metric" },
116
+ { "key": "new_followers", "label": "New followers", "source": "metric" }
117
+ ]
118
+ }
119
+ }
120
+ ]
121
+ }
122
+ ```
47
123
 
48
124
  ## Output
49
125
  Return recovered links/metrics, missing analytics access, record ids covered, data freshness, run log path, notable performance patterns, and follow-up tasks for planning.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@11agents/cli",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "description": "11agents local runtime and telemetry CLI",
5
5
  "type": "module",
6
6
  "bin": {
package/src/schema.js CHANGED
@@ -26,7 +26,9 @@ export function validateTelemetryBatch(input) {
26
26
  }
27
27
  const artifacts = Array.isArray(input.artifacts) ? input.artifacts : []
28
28
  const observations = Array.isArray(input.observations) ? input.observations : []
29
- if (!artifacts.length && !observations.length) return fail('artifacts or observations are required')
29
+ if (!artifacts.length && !observations.length && !isObject(input.dashboard_spec)) {
30
+ return fail('artifacts, observations, or dashboard_spec are required')
31
+ }
30
32
  for (let i = 0; i < artifacts.length; i += 1) {
31
33
  const item = artifacts[i]
32
34
  for (const field of ['platform', 'artifact_type', 'external_id', 'created_at']) {
@@ -48,7 +50,7 @@ export function validateTelemetryBatch(input) {
48
50
  return { ok: true, batch: { ...input, agent_id: agentId.trim() } }
49
51
  }
50
52
 
51
- export function buildTelemetryBatch({ workspace, agent_id, agent_key, node_id, artifacts = [], observations = [] }) {
53
+ export function buildTelemetryBatch({ workspace, agent_id, agent_key, node_id, artifacts = [], observations = [], dashboard_spec = null }) {
52
54
  return {
53
55
  schema_version: TELEMETRY_SCHEMA_VERSION,
54
56
  workspace,
@@ -58,5 +60,6 @@ export function buildTelemetryBatch({ workspace, agent_id, agent_key, node_id, a
58
60
  sent_at: new Date().toISOString(),
59
61
  artifacts,
60
62
  observations,
63
+ ...(dashboard_spec ? { dashboard_spec } : {}),
61
64
  }
62
65
  }