dashclaw 2.7.0 → 2.9.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.
Files changed (2) hide show
  1. package/dashclaw.js +50 -1
  2. package/package.json +1 -1
package/dashclaw.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * DashClaw SDK v2 (Stable Runtime API)
2
+ * DashClaw SDK v2.8.0 (Stable Runtime API)
3
3
  * Focused governance runtime client for AI agents.
4
4
  */
5
5
 
@@ -594,6 +594,55 @@ class DashClaw {
594
594
  ...state,
595
595
  });
596
596
  }
597
+
598
+ // ---------------------------------------------------------------------------
599
+ // Session Lifecycle
600
+ // ---------------------------------------------------------------------------
601
+
602
+ /**
603
+ * POST /api/sessions — Create a new agent session.
604
+ * @param {string} agentId - Agent identifier (defaults to this.agentId)
605
+ * @param {string} workspace - Workspace path or identifier
606
+ * @param {string|null} [branch=null] - Optional git branch
607
+ */
608
+ async createSession(agentId, workspace, branch = null) {
609
+ return this._request('/api/sessions', 'POST', {
610
+ agent_id: agentId || this.agentId,
611
+ workspace,
612
+ branch,
613
+ });
614
+ }
615
+
616
+ /**
617
+ * GET /api/sessions/:id — Fetch a single session by ID.
618
+ */
619
+ async getSession(sessionId) {
620
+ return this._request(`/api/sessions/${sessionId}`, 'GET');
621
+ }
622
+
623
+ /**
624
+ * PATCH /api/sessions/:id — Update session state.
625
+ * @param {string} sessionId
626
+ * @param {Object} updates - Fields to update (status, green_level, branch_freshness, commits_behind, blocked_reason)
627
+ */
628
+ async updateSession(sessionId, updates) {
629
+ return this._request(`/api/sessions/${sessionId}`, 'PATCH', updates);
630
+ }
631
+
632
+ /**
633
+ * GET /api/sessions — List sessions with optional filters.
634
+ * @param {Object} [filters={}] - Query filters (agent_id, status, limit)
635
+ */
636
+ async listSessions(filters = {}) {
637
+ return this._request('/api/sessions', 'GET', null, filters);
638
+ }
639
+
640
+ /**
641
+ * GET /api/sessions/:id/events — Fetch events for a session.
642
+ */
643
+ async getSessionEvents(sessionId) {
644
+ return this._request(`/api/sessions/${sessionId}/events`, 'GET');
645
+ }
597
646
  }
598
647
 
599
648
  export { DashClaw, ApprovalDeniedError, GuardBlockedError };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dashclaw",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "Minimal governance runtime for AI agents. Intercept, govern, and verify agent actions.",
5
5
  "type": "module",
6
6
  "publishConfig": {