@masslessai/push-todo 3.10.0 → 3.10.2

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/lib/api.js CHANGED
@@ -49,7 +49,9 @@ async function apiRequest(endpoint, options = {}) {
49
49
  export async function fetchTasks(gitRemote, options = {}) {
50
50
  const params = new URLSearchParams();
51
51
 
52
- if (gitRemote) {
52
+ if (options.actionId) {
53
+ params.set('action_id', options.actionId);
54
+ } else if (gitRemote) {
53
55
  params.set('git_remote', gitRemote);
54
56
  }
55
57
  if (options.actionType) {
package/lib/connect.js CHANGED
@@ -953,8 +953,8 @@ async function registerProjectWithBackend(apiKey, clientType = 'claude-code', ke
953
953
  const CLIENT_TO_ACTION_TYPE = {
954
954
  'claude-code': 'claude-code',
955
955
  'openai-codex': 'openai-codex',
956
- 'openclaw': 'clawdbot',
957
- 'clawdbot': 'clawdbot',
956
+ 'openclaw': 'openclaw',
957
+ 'clawdbot': 'openclaw', // legacy alias
958
958
  };
959
959
 
960
960
  // ============================================================================
@@ -1048,19 +1048,32 @@ function detectCallerAgent(explicitClient) {
1048
1048
  /**
1049
1049
  * Register project in local registry for daemon routing.
1050
1050
  *
1051
- * @param {string} gitRemoteRaw - Raw git remote URL
1051
+ * Supports both git-remote-based and path-based projects.
1052
+ * - Git projects: key is "gitRemote::actionType"
1053
+ * - Non-git projects (e.g., OpenClaw workspace): key is "path:/abs/path::actionType"
1054
+ *
1055
+ * @param {string} gitRemoteRaw - Raw git remote URL (can be null for non-git projects)
1052
1056
  * @param {string} localPath - Absolute local path
1053
1057
  * @param {Object} [actionMeta] - Action metadata from register-project response
1054
1058
  * @returns {boolean}
1055
1059
  */
1056
1060
  function registerProjectLocally(gitRemoteRaw, localPath, actionMeta = {}) {
1057
- if (!gitRemoteRaw) return false;
1061
+ const registry = getRegistry();
1058
1062
 
1059
- const gitRemote = normalizeGitRemote(gitRemoteRaw);
1060
- if (!gitRemote) return false;
1063
+ if (gitRemoteRaw) {
1064
+ const gitRemote = normalizeGitRemote(gitRemoteRaw);
1065
+ if (gitRemote) {
1066
+ return registry.register(gitRemote, localPath, actionMeta);
1067
+ }
1068
+ }
1061
1069
 
1062
- const registry = getRegistry();
1063
- return registry.register(gitRemote, localPath, actionMeta);
1070
+ // Non-git project: use path-based key (e.g., OpenClaw workspace)
1071
+ if (localPath) {
1072
+ const pathKey = `path:${localPath}`;
1073
+ return registry.register(pathKey, localPath, actionMeta);
1074
+ }
1075
+
1076
+ return false;
1064
1077
  }
1065
1078
 
1066
1079
  /**
package/lib/fetch.js CHANGED
@@ -58,13 +58,35 @@ function decryptTaskFields(task) {
58
58
  * @returns {Promise<void>}
59
59
  */
60
60
  export async function listTasks(options = {}) {
61
- // Determine git remote
61
+ // Determine git remote, action type, and action ID for scoping
62
62
  let gitRemote = null;
63
+ let actionType = null;
64
+ let actionId = null;
63
65
  if (!options.allProjects) {
64
66
  gitRemote = getGitRemote();
65
67
  if (!gitRemote && isGitRepo()) {
66
68
  console.error(yellow('Warning: In a git repo but no remote configured.'));
67
69
  }
70
+
71
+ const registry = getRegistry();
72
+ if (gitRemote) {
73
+ // Git project: look up action type from registry
74
+ const project = registry.findProject(gitRemote);
75
+ if (project) {
76
+ actionType = project.actionType;
77
+ }
78
+ } else {
79
+ // Non-git project (e.g., OpenClaw workspace): look up by cwd path
80
+ const pathKey = `path:${process.cwd()}`;
81
+ const project = registry.findProject(pathKey);
82
+ if (project) {
83
+ actionType = project.actionType;
84
+ // For path-based projects, use action_id directly since there's no git_remote
85
+ if (project.actionId) {
86
+ actionId = project.actionId;
87
+ }
88
+ }
89
+ }
68
90
  }
69
91
 
70
92
  // Fetch tasks
@@ -72,7 +94,9 @@ export async function listTasks(options = {}) {
72
94
  backlogOnly: options.backlog,
73
95
  includeBacklog: options.includeBacklog,
74
96
  completedOnly: options.completed,
75
- includeCompleted: options.includeCompleted
97
+ includeCompleted: options.includeCompleted,
98
+ actionType,
99
+ actionId,
76
100
  });
77
101
 
78
102
  // Decrypt if E2EE is available
@@ -103,7 +103,7 @@ class ProjectRegistry {
103
103
  * Format: "gitRemote::actionType" (e.g., "github.com/user/repo::claude-code")
104
104
  *
105
105
  * @param {string} gitRemote - Normalized git remote
106
- * @param {string} actionType - Action type (e.g., "claude-code", "clawdbot")
106
+ * @param {string} actionType - Action type (e.g., "claude-code", "openclaw")
107
107
  * @returns {string}
108
108
  */
109
109
  _makeKey(gitRemote, actionType) {
@@ -116,7 +116,7 @@ class ProjectRegistry {
116
116
  * @param {string} gitRemote - Normalized git remote (e.g., "github.com/user/repo")
117
117
  * @param {string} localPath - Absolute local path
118
118
  * @param {Object} [actionMeta] - Action metadata from register-project response
119
- * @param {string} [actionMeta.actionType] - Action type (e.g., "claude-code", "clawdbot")
119
+ * @param {string} [actionMeta.actionType] - Action type (e.g., "claude-code", "openclaw")
120
120
  * @param {string} [actionMeta.actionId] - Action UUID
121
121
  * @param {string} [actionMeta.actionName] - Action display name
122
122
  * @returns {boolean} True if newly registered, false if updated existing
@@ -345,6 +345,18 @@ class ProjectRegistry {
345
345
  return Object.keys(this._data.projects).length;
346
346
  }
347
347
 
348
+ /**
349
+ * Find a project entry by gitRemote and optional actionType.
350
+ * Public wrapper for _findProject.
351
+ *
352
+ * @param {string} gitRemote
353
+ * @param {string} [actionType]
354
+ * @returns {Object|null} Project entry with {gitRemote, localPath, actionType, ...}
355
+ */
356
+ findProject(gitRemote, actionType) {
357
+ return this._findProject(gitRemote, actionType);
358
+ }
359
+
348
360
  /**
349
361
  * Check if a project is registered.
350
362
  * Checks both composite keys and plain gitRemote.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masslessai/push-todo",
3
- "version": "3.10.0",
3
+ "version": "3.10.2",
4
4
  "description": "Voice tasks from Push iOS app for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {