@astrosheep/square 0.3.71 → 0.3.73

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 (51) hide show
  1. package/dist/artifact.d.ts +0 -3
  2. package/dist/artifact.js +5 -59
  3. package/dist/catch-decisions.d.ts +7 -1
  4. package/dist/catch-decisions.js +21 -8
  5. package/dist/claude-delivery.d.ts +1 -1
  6. package/dist/claude-delivery.js +7 -3
  7. package/dist/cli/ledger-command.d.ts +12 -0
  8. package/dist/cli/ledger-command.js +68 -0
  9. package/dist/cli/registry.js +2 -0
  10. package/dist/help.js +7 -2
  11. package/dist/host-ledger-file-adapter.d.ts +4 -10
  12. package/dist/host-ledger-file-adapter.js +238 -198
  13. package/dist/host-ledger-migration.d.ts +26 -0
  14. package/dist/host-ledger-migration.js +227 -0
  15. package/dist/host-ledger-sqlite.d.ts +62 -0
  16. package/dist/host-ledger-sqlite.js +341 -0
  17. package/dist/host-ledger.d.ts +13 -4
  18. package/dist/ledger-maintenance.d.ts +30 -0
  19. package/dist/ledger-maintenance.js +110 -0
  20. package/dist/packages/agent-delivery/src/claude.d.ts +2 -11
  21. package/dist/packages/agent-delivery/src/index.d.ts +2 -42
  22. package/dist/packages/agent-delivery/src/opencode.d.ts +2 -11
  23. package/dist/packages/agent-delivery/src/paseo.d.ts +2 -13
  24. package/dist/packages/agent-delivery/src/pi-client.d.ts +2 -9
  25. package/dist/packages/agent-delivery/src/types.d.ts +42 -0
  26. package/dist/participant-host.d.ts +6 -3
  27. package/dist/participant-host.js +44 -38
  28. package/dist/ports.d.ts +7 -1
  29. package/dist/registry.d.ts +2 -0
  30. package/dist/registry.js +1 -1
  31. package/dist/routes.js +1 -10
  32. package/dist/runtime.d.ts +2 -1
  33. package/dist/runtime.js +12 -6
  34. package/dist/sqlite-transaction.d.ts +5 -0
  35. package/dist/sqlite-transaction.js +72 -0
  36. package/dist/square-actions.js +26 -22
  37. package/dist/square-application.js +2 -14
  38. package/dist/square-migration.js +2 -1
  39. package/dist/square-sqlite.d.ts +2 -2
  40. package/dist/square-sqlite.js +15 -4
  41. package/guides/catch-contention-performance.md +157 -0
  42. package/guides/change-waits.md +1 -1
  43. package/guides/host-ledger.md +53 -6
  44. package/guides/indexed-host-ledger-performance.md +39 -0
  45. package/guides/postcommit-simplification-performance.md +36 -0
  46. package/package.json +1 -1
  47. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  48. package/plugins/codex/.codex-plugin/plugin.json +1 -1
  49. package/plugins/paseo/client/square-message.tsx +51 -40
  50. package/plugins/paseo/shared/message.ts +1 -0
  51. package/plugins/pi/square-pi.js +2 -1
@@ -1,7 +1,7 @@
1
1
  import type { PluginTimelineItemProps } from "@getpaseo/plugin/client";
2
2
  import { copyText, Icon, useToast } from "@getpaseo/plugin/client/react-native";
3
3
  import { useMemo, useState } from "react";
4
- import { Platform, Pressable, Text, View } from "react-native";
4
+ import { Platform, Pressable, ScrollView, Text, View } from "react-native";
5
5
  import { squareHeadline, type SquareMessageData } from "../shared/message";
6
6
 
7
7
  function withOpacity(color: string, opacity: number): string {
@@ -16,18 +16,19 @@ export function SquareMessage({ item, theme, layout }: PluginTimelineItemProps<S
16
16
  const [expanded, setExpanded] = useState(false);
17
17
  const toast = useToast();
18
18
  const { text, items } = item.data;
19
- const first = items?.[0];
19
+ const latest = items?.[items.length - 1];
20
+ const preview = latest?.preview?.replace(/\s+/g, " ").trim();
20
21
  const muted = theme.colors.foregroundMuted;
21
22
  const foreground = theme.colors.foreground;
22
- const padding = layout.compact ? 10 : 14;
23
23
  const styles = useMemo(() => ({
24
24
  marker: { color: theme.colors.accent, fontSize: 10, marginTop: 2 },
25
25
  headline: { color: foreground, fontSize: 13, lineHeight: 19, flexShrink: 1 },
26
26
  meta: { color: muted, fontSize: 11, lineHeight: 16, flexShrink: 1 },
27
+ preview: { color: foreground, fontSize: 12, lineHeight: 18, flexShrink: 1 },
27
28
  bodyPanel: {
28
29
  backgroundColor: theme.colors.surface1,
29
30
  borderRadius: 12,
30
- marginTop: 7,
31
+ marginTop: 5,
31
32
  marginLeft: 17,
32
33
  overflow: "hidden" as const,
33
34
  },
@@ -36,53 +37,53 @@ export function SquareMessage({ item, theme, layout }: PluginTimelineItemProps<S
36
37
  fontSize: 12,
37
38
  lineHeight: 21,
38
39
  fontFamily: Platform.OS === "ios" ? "Menlo" : "monospace",
39
- paddingHorizontal: layout.compact ? 12 : 14,
40
- paddingTop: 12,
40
+ paddingHorizontal: layout.compact ? 10 : 12,
41
+ paddingTop: 8,
41
42
  },
42
- }), [expanded, foreground, layout.compact, muted, theme.colors.accent, theme.colors.surface1]);
43
+ }), [foreground, layout.compact, muted, theme.colors.accent, theme.colors.surface1]);
43
44
 
44
45
  return (
45
46
  <View>
46
- <Pressable
47
- accessibilityRole="button"
48
- accessibilityLabel={first !== undefined ? squareHeadline(first) : "Square context"}
49
- aria-expanded={expanded}
50
- onPress={() => setExpanded(value => !value)}
51
- style={({ pressed }) => ({
52
- flexDirection: "row",
53
- alignItems: "flex-start",
54
- gap: 7,
55
- paddingVertical: 2,
56
- opacity: pressed ? 0.6 : 1,
57
- })}
58
- >
59
- <Text style={styles.marker}>■</Text>
60
- <View style={{
61
- flex: 1,
62
- minWidth: 0,
63
- flexDirection: layout.compact ? "column" : "row",
64
- alignItems: layout.compact ? "flex-start" : "center",
65
- gap: layout.compact ? 2 : 8,
66
- }}>
67
- <Text numberOfLines={layout.compact ? 2 : 1} style={styles.headline}>
68
- {first !== undefined ? squareHeadline(first) : "Square context"}
47
+ <View>
48
+ <View style={{ flexDirection: "row", alignItems: "flex-start", gap: 7, paddingVertical: 2 }}>
49
+ <Text style={styles.marker}>■</Text>
50
+ <Text numberOfLines={1} style={styles.headline}>
51
+ {latest?.square ?? "Square context"}
69
52
  </Text>
70
- {first && <Text numberOfLines={1} style={styles.meta}>
71
- {first.square}{items && items.length > 1 ? ` · +${items.length - 1} more` : ""}
72
- </Text>}
53
+ {items && items.length > 1 && <Text style={styles.meta}>· {items.length} landed</Text>}
54
+ <View style={{ flex: 1 }} />
55
+ {!expanded && <Pressable
56
+ accessibilityRole="button"
57
+ accessibilityLabel={`展开 ${latest !== undefined ? squareHeadline(latest) : "Square context"}`}
58
+ aria-expanded={false}
59
+ onPress={() => setExpanded(true)}
60
+ hitSlop={6}
61
+ style={({ pressed }) => ({ padding: 5, opacity: pressed ? 0.6 : 1 })}
62
+ >
63
+ <Icon name="ChevronDown" size={18} color={muted} />
64
+ </Pressable>}
73
65
  </View>
74
- <View style={{ marginTop: 3 }}><Icon name={expanded ? "ChevronDown" : "ChevronRight"} size={14} color={muted} /></View>
75
- </Pressable>
66
+ {(latest?.actor !== undefined || preview) && <View style={{ marginLeft: 17, marginTop: 2 }}>
67
+ <Text numberOfLines={1} style={styles.preview}>
68
+ <Text style={{ color: theme.colors.accent, fontSize: 10 }}>● </Text>
69
+ {latest?.actor !== undefined && <Text style={styles.meta}>{latest.actor} </Text>}
70
+ {preview}
71
+ </Text>
72
+ </View>}
73
+ </View>
76
74
  {expanded && <View style={styles.bodyPanel}>
77
- <Text selectable style={styles.bodyText}>{text}</Text>
75
+ <ScrollView style={{ maxHeight: layout.compact ? 280 : 400 }} nestedScrollEnabled>
76
+ <Text selectable style={styles.bodyText}>{text}</Text>
77
+ </ScrollView>
78
78
  <View style={{
79
- marginHorizontal: layout.compact ? 12 : 14,
80
- marginTop: 12,
79
+ marginHorizontal: layout.compact ? 10 : 12,
80
+ marginTop: 5,
81
81
  borderTopWidth: 1,
82
82
  borderTopColor: withOpacity(theme.colors.border, 0.55),
83
- paddingVertical: 7,
83
+ paddingVertical: 3,
84
84
  flexDirection: "row",
85
- justifyContent: "flex-end",
85
+ alignItems: "center",
86
+ justifyContent: "space-between",
86
87
  }}>
87
88
  <Pressable
88
89
  accessibilityRole="button"
@@ -99,6 +100,16 @@ export function SquareMessage({ item, theme, layout }: PluginTimelineItemProps<S
99
100
  <Icon name="Copy" size={12} color={muted} />
100
101
  <Text style={{ color: muted, fontSize: 11 }}>Copy content</Text>
101
102
  </Pressable>
103
+ <Pressable
104
+ accessibilityRole="button"
105
+ accessibilityLabel="收起 Square context"
106
+ aria-expanded={true}
107
+ onPress={() => setExpanded(false)}
108
+ hitSlop={6}
109
+ style={({ pressed }) => ({ paddingHorizontal: 5, paddingVertical: 1, opacity: pressed ? 0.6 : 1 })}
110
+ >
111
+ <Icon name="ChevronUp" size={18} color={muted} />
112
+ </Pressable>
102
113
  </View>
103
114
  </View>}
104
115
  </View>
@@ -6,6 +6,7 @@ export const squareCardDetailsSchema = z.object({
6
6
  actor: z.string().optional(),
7
7
  recipient: z.string().optional(),
8
8
  route: z.enum(["mention", "reply", "attention", "bell"]).optional(),
9
+ preview: z.string().optional(),
9
10
  description: z.string(),
10
11
  })).min(1),
11
12
  });
@@ -3,7 +3,7 @@ import path from 'node:path';
3
3
  import { presentPendingAtBoundary, renderPendingAtBoundary } from '../../dist/boundary-presentation.js';
4
4
  import { automaticSessionEnd, automaticSessionStart } from '../../dist/automatic-session.js';
5
5
  import { sessionInbox, observeSessionPending } from '../../dist/inbox.js';
6
- import { renderAttentionDescription } from '../../dist/attention-presentation.js';
6
+ import { previewAttentionBody, renderAttentionDescription } from '../../dist/attention-presentation.js';
7
7
  import { createPiReceiver, sendPiMessage } from '../../dist/packages/agent-delivery/src/pi.js';
8
8
 
9
9
  class PiDeliveryDroppedError extends Error {
@@ -38,6 +38,7 @@ export function pendingCardDetails(pending) {
38
38
  actor: note.actor,
39
39
  recipient: membership.name,
40
40
  route: note.route,
41
+ preview: previewAttentionBody(note.body),
41
42
  description: renderAttentionDescription({ actor: note.actor, recipient: membership.name, route: note.route }),
42
43
  })));
43
44
  return items.length === 0 ? undefined : { items };