-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathclient-api.ts
More file actions
86 lines (75 loc) · 3.08 KB
/
Copy pathclient-api.ts
File metadata and controls
86 lines (75 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Public API for programmatic session management.
// Import from "@compoundingtech/pty/client".
// Session management
export {
listSessions, getSession, gc, pruneOrphanLayoutTags, isGone,
validateName, updateTags, setDisplayName, patchMetadataById,
getSessionDir, getSocketPath,
cleanupSocket, cleanupAll,
// Exposed for the same reason as `isReservedTagKey`: downstream tools
// (relay, layout, supervisors) need to answer "is this session exempt
// from reaping?" without re-deriving which tag values count as set.
KEEP_TAG, isKeepRequested, shouldReapAtExit,
type SessionInfo, type SessionMetadata, type MetadataPatch, type MetadataPatchResult,
type PrunedTagResult, type GcResult,
} from "./sessions.ts";
// Session creation
export { spawnDaemon, resolveCommand, waitForSocket, setServerModulePath, type SpawnDaemonOptions } from "./spawn.ts";
// Session interaction (programmatic — no process.exit, no stdin/stdout)
export {
SessionConnection, sendData, peekScreen,
type SessionConnectionOptions, type SendDataOptions, type PeekScreenOptions,
} from "./connection.ts";
// Session interaction (CLI-oriented — uses process.stdin/stdout, may call process.exit)
export {
attach, peek, send, queryStats,
TERMINAL_SANITIZE,
type AttachOptions, type PeekOptions, type SendOptions,
type StatsResult, type ProcessResources,
} from "./client.ts";
// Harness-neutral activity lease. Codex/Claude-specific adapters live outside
// pty and publish only these generic states.
export {
ActivityPublisher, connectActivityPublisher,
type ActivityPublisherOptions, type ActivityPublishOptions,
} from "./activity-client.ts";
export {
ACTIVITY_STATES,
type ActivityState, type ActivityStatus,
} from "./activity.ts";
export {
compareAndSend,
type CompareAndSendOptions,
} from "./guarded-send-client.ts";
export {
MAX_GUARDED_DATA_BYTES,
type GuardedSendCommand, type GuardedSendResponse,
} from "./guarded-send.ts";
// Events
export {
EventType,
EventFollower, readRecentEvents, formatEvent,
emitUserEvent, appendEvent, isUserEvent, validateUserEventType,
type EventRecord, type EventBase,
type BellEvent, type TitleChangeEvent, type NotificationEvent,
type FocusRequestEvent, type CursorVisibleEvent,
type SessionStartEvent, type SessionExitEvent, type SessionExecEvent,
type SessionRespawnEvent,
type UserEvent,
type DisplayNameChangeEvent, type TagsChangeEvent, type MetadataChangeEvent,
type FollowerOptions,
} from "./events.ts";
// Project files
export { readPtyFile, type PtyFile, type PtySessionDef } from "./ptyfile.ts";
// Tag filter helpers (used by --filter-tag; shared with pty-relay)
export { extractFilterTags, matchesAllTags, isReservedTagKey } from "./tags.ts";
// Duration parse/format — used by `pty list --older-than/--newer-than`,
// available here so downstream tools can accept the same grammar.
export { parseDuration, formatDuration } from "./duration.ts";
// Keys
export { resolveKey, parseSeqValue } from "./keys.ts";
// Protocol (advanced)
export {
PacketReader, MessageType, encodeActivity, encodeGuardedData,
type Packet,
} from "./protocol.ts";