@anhlp/alp-paseo 0.0.1-beta.7 → 0.0.1-beta.8

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/README.md CHANGED
@@ -64,13 +64,13 @@ This follows [Paseo's native archive contract](https://github.com/getpaseo/paseo
64
64
 
65
65
  ## Install
66
66
 
67
- This is the beta `0.0.1-beta.3` (until it is on npm, `@beta` installs `0.0.0-beta.2`, which Paseo 0.12 refuses; check with
67
+ This is the beta `0.0.1-beta.8` (npm's `beta` and `latest` tags; check with
68
68
  `npm view @anhlp/alp-paseo dist-tags`); name it when you install (`@beta`, or
69
- exactly `@0.0.1-beta.3`). See the
69
+ exactly `@0.0.1-beta.8`). See the
70
70
  [release notes](https://github.com/phucanh08/alp/blob/main/docs/alp/beta-release-notes.md) and
71
71
  [install, upgrade and removal steps](https://github.com/phucanh08/alp/blob/main/docs/alp/beta-install.md).
72
72
 
73
- Requires Paseo `>=0.11.1 <1.0.0` (the published `0.0.1-beta.3` declares `<0.13.0`, so 0.11.x or 0.12.x), Node.js 22 (22.12 or later) or 24 on Linux or macOS
73
+ Requires Paseo `>=0.11.1 <1.0.0` (from `0.0.1-beta.4`; `0.0.1-beta.3` declared `<0.13.0`), Node.js 22 (22.12 or later) or 24 on Linux or macOS
74
74
  (Windows and Node.js 26 are experimental), and an authenticated native Codex or Claude Code
75
75
  executable on PATH.
76
76
 
@@ -168,7 +168,7 @@ for existing projects, model selection, permissions, and runtime limitations.
168
168
 
169
169
  ## Remote mode (deferred, not in the beta)
170
170
 
171
- Remote mode is **not part of the beta (`0.0.1-beta.3`)**: it needs `@anhlp/alp-gateway`, which is not
171
+ Remote mode is **not part of the beta (`0.0.1-beta.8`)**: it needs `@anhlp/alp-gateway`, which is not
172
172
  published. The text below describes the code in this repository for development only.
173
173
 
174
174
  To use ALP running on another machine, start the daemon process that loads this plugin with
@@ -0,0 +1,41 @@
1
+ import type { PluginAgentCommandContext, PluginClientContext } from '@getpaseo/plugin/client';
2
+ import { agentCompact } from '../shared/compact';
3
+
4
+ /**
5
+ * Compact context for an ALP agent (t-de1a): main writes a checkpoint, then its context is compacted
6
+ * natively or replaced by a fresh conversation seeded with it, now or at the end of its turn. The
7
+ * runtime's own notice in the timeline says when it starts and ends; a refusal is thrown to the host.
8
+ */
9
+ export async function compactAgent({ agent, paseo, rpc }: Pick<PluginAgentCommandContext, 'agent' | 'paseo' | 'rpc'>) {
10
+ if (agent.provider !== 'alp') throw new Error('Compact context is for ALP agents only');
11
+ // The provider knows a session by the id in its persistence handle, which is not the agent's id.
12
+ let persisted: string | undefined;
13
+ try {
14
+ const handle = paseo.agents.ref(agent.id);
15
+ if (!handle.current()) await handle.refresh();
16
+ persisted = handle.current()?.persistence?.sessionId ?? undefined;
17
+ } catch { /* the agent id alone */ }
18
+ const sessions = [...new Set([persisted, agent.id].filter((id): id is string => Boolean(id)))];
19
+ return rpc(agentCompact, { sessions });
20
+ }
21
+
22
+ /** The command-center item and the "/alp-compact" slash command of an ALP agent. */
23
+ export function addCompactCommands(client: PluginClientContext) {
24
+ const removeItem = client.addCommandCenterItem({
25
+ id: 'alp-compact-agent',
26
+ title: 'Compact ALP agent context',
27
+ icon: 'Shrink',
28
+ keywords: ['compact', 'context', 'checkpoint', 'alp'],
29
+ context: 'agent',
30
+ async onSelect(context) { await compactAgent(context); },
31
+ });
32
+ // Not "/compact": Claude Code has its own, which skips ALP's checkpoint.
33
+ const removeSlash = client.addSlashCommand({
34
+ name: 'alp-compact',
35
+ description: 'Compact this ALP agent\'s context after a checkpoint',
36
+ argumentHint: '',
37
+ context: 'agent',
38
+ async onSubmit(context) { await compactAgent(context); },
39
+ });
40
+ return () => { removeItem(); removeSlash(); };
41
+ }
package/index.client.tsx CHANGED
@@ -3,6 +3,7 @@ import { TasksPanel, TasksScreen } from './client/tasks-panel';
3
3
  import { TASKS_SCREEN, addTaskPills, tasksScreen } from './client/task-pills';
4
4
  import { LibrarySettings, ProjectLibraryPanel, TeamsSettings, AgentsSettings, SkillsSettings, HooksSettings, McpSettings } from './client/library';
5
5
  import { UsageScreen } from './client/usage';
6
+ import { addCompactCommands } from './client/compact';
6
7
 
7
8
  /**
8
9
  * ALP's client contributions: the Tasks panel of a workspace's project, the Tasks screen
@@ -38,6 +39,8 @@ export default function contribute(client: PluginClientContext) {
38
39
  context: 'agent',
39
40
  onSubmit({ workspace, args, openScreen }) { openScreen(tasksScreen(workspace.id, workspace.directory || workspace.projectRootPath, args.trim() || undefined)); },
40
41
  });
42
+ // Compact context (t-de1a): a command-center item and "/alp-compact" for an ALP agent.
43
+ const removeCompact = addCompactCommands(client);
41
44
  const removeSettings = client.addSettingsScreen({ id: 'alp-settings', title: 'ALP', icon: 'Bot', Component: LibrarySettings });
42
45
  const removeHostSettings = [
43
46
  { id: 'alp-templates', title: 'Templates', icon: 'Users', Component: TeamsSettings },
@@ -49,5 +52,5 @@ export default function contribute(client: PluginClientContext) {
49
52
  const removeUsage = client.addSettingsScreen({ id: 'alp-usage', title: 'Usage', icon: 'ChartNoAxesCombined', Component: UsageScreen });
50
53
  const removeUsagePanel = client.addWorkspacePanel({ id: 'alp-usage', title: 'Usage', icon: 'ChartNoAxesCombined', context: 'workspace', Component: UsageScreen });
51
54
  const removeProject = client.addWorkspacePanel({ id: 'alp-project', title: 'ALP project', icon: 'Bot', context: 'workspace', Component: ProjectLibraryPanel });
52
- return () => { removePanel(); removeScreen(); removePills(); removeCommand(); removeScreenCommand(); removeSlash(); removeSettings(); removeHostSettings.forEach(remove => remove()); removeProject(); removeUsage(); removeUsagePanel(); };
55
+ return () => { removePanel(); removeScreen(); removePills(); removeCommand(); removeScreenCommand(); removeSlash(); removeCompact(); removeSettings(); removeHostSettings.forEach(remove => remove()); removeProject(); removeUsage(); removeUsagePanel(); };
53
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anhlp/alp-paseo",
3
- "version": "0.0.1-beta.7",
3
+ "version": "0.0.1-beta.8",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "paseo-plugin.json",
@@ -16,12 +16,12 @@
16
16
  "@anthropic-ai/claude-agent-sdk": "0.3.292",
17
17
  "@anthropic-ai/sdk": "0.131.0",
18
18
  "@modelcontextprotocol/sdk": "1.32.1",
19
- "zod": "4.4.3",
20
- "@anhlp/alp-protocol": "0.0.1-beta.7",
21
- "@anhlp/alp-core": "0.0.1-beta.7",
22
- "@anhlp/alp-runtime": "0.0.1-beta.7",
23
- "@anhlp/alp-daemon": "0.0.1-beta.7",
24
- "@anhlp/alp-client": "0.0.1-beta.7",
19
+ "zod": "4.6.7",
20
+ "@anhlp/alp-protocol": "0.0.1-beta.8",
21
+ "@anhlp/alp-core": "0.0.1-beta.8",
22
+ "@anhlp/alp-runtime": "0.0.1-beta.8",
23
+ "@anhlp/alp-daemon": "0.0.1-beta.8",
24
+ "@anhlp/alp-client": "0.0.1-beta.8",
25
25
  "ws": "^8.22.0"
26
26
  },
27
27
  "peerDependencies": {
@@ -922,7 +922,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
922
922
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
923
923
 
924
924
  ================================================================================
925
- zod@4.4.3 (MIT)
925
+ zod@4.6.7 (MIT)
926
926
  ================================================================================
927
927
 
928
928
  MIT License