google-trends-for-agent 0.2.44 → 0.2.46

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.
@@ -4,6 +4,18 @@ export const GTFA_RELEASES_URL = `${GTFA_SOURCE_URL}/releases`;
4
4
  export const GTFA_LATEST_RELEASE_API_URL = 'https://api.github.com/repos/meka-im/google-trends-for-agent/releases/latest';
5
5
  export const GTFA_UPGRADE_COMMAND = 'dsh plugin --profile web add google-trends-for-agent@latest';
6
6
  export const VERSION_STATUS_PATH = '/api/gtfa.version';
7
+ export const PLUGIN_UPGRADE_PATH = '/api/gtfa.plugin-upgrade';
8
+ const SAFE_PROFILE_RE = /^[a-zA-Z0-9._-]{1,64}$/;
9
+ /** Build the profile-specific upgrade command (Desktop profile is Electron-managed, so dsh CLI blocks --profile desktop). */
10
+ export function formatUpgradeCommand(profileName) {
11
+ const clean = typeof profileName === 'string' && SAFE_PROFILE_RE.test(profileName.trim())
12
+ ? profileName.trim()
13
+ : 'web';
14
+ if (clean === 'desktop') {
15
+ return 'pnpm --dir ~/.dsh/profiles/desktop add google-trends-for-agent@latest';
16
+ }
17
+ return `dsh plugin --profile ${clean} add google-trends-for-agent@latest`;
18
+ }
7
19
  const SEMVER_RE = /^v?(\d{1,5})\.(\d{1,5})\.(\d{1,5})(?:-([a-zA-Z0-9.-]{1,40}))?$/;
8
20
  /** Parse a bounded X.Y.Z(-prerelease) version string. */
9
21
  export function parseSemver(raw) {
@@ -127,6 +139,12 @@ export function parseVersionStatus(value) {
127
139
  }
128
140
  const checkError = row.checkError === 'network' || row.checkError === 'rate-limited' || row.checkError === 'http'
129
141
  ? row.checkError : null;
142
+ const profileName = typeof row.profileName === 'string' && SAFE_PROFILE_RE.test(row.profileName.trim())
143
+ ? row.profileName.trim() : null;
144
+ const upgradeCommand = typeof row.upgradeCommand === 'string'
145
+ && (row.upgradeCommand.trim().startsWith('dsh plugin ') || row.upgradeCommand.trim().startsWith('pnpm '))
146
+ ? row.upgradeCommand.trim()
147
+ : profileName ? formatUpgradeCommand(profileName) : null;
130
148
  return {
131
149
  pluginVersion: row.pluginVersion,
132
150
  baselineCatalogRevision: row.baselineCatalogRevision,
@@ -138,5 +156,7 @@ export function parseVersionStatus(value) {
138
156
  actorUpdateAvailable: row.actorUpdateAvailable === true,
139
157
  checkedAt: typeof row.checkedAt === 'string' && Number.isFinite(Date.parse(row.checkedAt)) ? row.checkedAt : null,
140
158
  checkError,
159
+ ...(profileName ? { profileName } : {}),
160
+ ...(upgradeCommand ? { upgradeCommand } : {}),
141
161
  };
142
162
  }
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "google-trends-for-agent",
3
- "version": "0.2.44",
3
+ "version": "0.2.46",
4
4
  "description": "Search-interest signals for AI agents — an unofficial Google Trends client",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -129,7 +129,7 @@
129
129
  "type": "git",
130
130
  "url": "git+https://github.com/meka-im/google-trends-for-agent.git"
131
131
  },
132
- "homepage": "https://github.com/meka-im/google-trends-for-agent",
132
+ "homepage": "https://meka.im/google-trends-for-agent",
133
133
  "bugs": {
134
134
  "url": "https://github.com/meka-im/google-trends-for-agent/issues"
135
135
  },