@framers/agentos 0.9.34 → 0.9.36

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 (81) hide show
  1. package/dist/api/agent.d.ts +2 -0
  2. package/dist/api/agent.d.ts.map +1 -1
  3. package/dist/api/agent.js +12 -2
  4. package/dist/api/agent.js.map +1 -1
  5. package/dist/api/segment.d.ts +14 -0
  6. package/dist/api/segment.d.ts.map +1 -0
  7. package/dist/api/segment.js +42 -0
  8. package/dist/api/segment.js.map +1 -0
  9. package/dist/api/souledAgent.d.ts +18 -0
  10. package/dist/api/souledAgent.d.ts.map +1 -0
  11. package/dist/api/souledAgent.js +98 -0
  12. package/dist/api/souledAgent.js.map +1 -0
  13. package/dist/cognition/memory/io/attachMemoryWiki.d.ts +70 -0
  14. package/dist/cognition/memory/io/attachMemoryWiki.d.ts.map +1 -0
  15. package/dist/cognition/memory/io/attachMemoryWiki.js +65 -0
  16. package/dist/cognition/memory/io/attachMemoryWiki.js.map +1 -0
  17. package/dist/cognition/memory/io/facade/Memory.d.ts +34 -0
  18. package/dist/cognition/memory/io/facade/Memory.d.ts.map +1 -1
  19. package/dist/cognition/memory/io/facade/Memory.js +82 -1
  20. package/dist/cognition/memory/io/facade/Memory.js.map +1 -1
  21. package/dist/cognition/memory/io/tools/ReadMemoryPageTool.d.ts +39 -0
  22. package/dist/cognition/memory/io/tools/ReadMemoryPageTool.d.ts.map +1 -0
  23. package/dist/cognition/memory/io/tools/ReadMemoryPageTool.js +39 -0
  24. package/dist/cognition/memory/io/tools/ReadMemoryPageTool.js.map +1 -0
  25. package/dist/cognition/substrate/memory/wiki/WikiCompiler.d.ts +35 -0
  26. package/dist/cognition/substrate/memory/wiki/WikiCompiler.d.ts.map +1 -0
  27. package/dist/cognition/substrate/memory/wiki/WikiCompiler.js +51 -0
  28. package/dist/cognition/substrate/memory/wiki/WikiCompiler.js.map +1 -0
  29. package/dist/cognition/substrate/memory/wiki/WikiMemoryStore.d.ts +47 -0
  30. package/dist/cognition/substrate/memory/wiki/WikiMemoryStore.d.ts.map +1 -0
  31. package/dist/cognition/substrate/memory/wiki/WikiMemoryStore.js +169 -0
  32. package/dist/cognition/substrate/memory/wiki/WikiMemoryStore.js.map +1 -0
  33. package/dist/cognition/substrate/memory/wiki/index.d.ts +7 -0
  34. package/dist/cognition/substrate/memory/wiki/index.d.ts.map +1 -0
  35. package/dist/cognition/substrate/memory/wiki/index.js +7 -0
  36. package/dist/cognition/substrate/memory/wiki/index.js.map +1 -0
  37. package/dist/cognition/substrate/personas/SoulLoader.d.ts +6 -2
  38. package/dist/cognition/substrate/personas/SoulLoader.d.ts.map +1 -1
  39. package/dist/cognition/substrate/personas/SoulLoader.js +11 -0
  40. package/dist/cognition/substrate/personas/SoulLoader.js.map +1 -1
  41. package/dist/index.d.ts +10 -0
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +7 -0
  44. package/dist/index.js.map +1 -1
  45. package/dist/io/segmentation/SegmentationProviderRegistry.d.ts +12 -0
  46. package/dist/io/segmentation/SegmentationProviderRegistry.d.ts.map +1 -0
  47. package/dist/io/segmentation/SegmentationProviderRegistry.js +39 -0
  48. package/dist/io/segmentation/SegmentationProviderRegistry.js.map +1 -0
  49. package/dist/io/segmentation/consumers/cropRegion.d.ts +16 -0
  50. package/dist/io/segmentation/consumers/cropRegion.d.ts.map +1 -0
  51. package/dist/io/segmentation/consumers/cropRegion.js +41 -0
  52. package/dist/io/segmentation/consumers/cropRegion.js.map +1 -0
  53. package/dist/io/segmentation/consumers/maskToEditMask.d.ts +19 -0
  54. package/dist/io/segmentation/consumers/maskToEditMask.d.ts.map +1 -0
  55. package/dist/io/segmentation/consumers/maskToEditMask.js +32 -0
  56. package/dist/io/segmentation/consumers/maskToEditMask.js.map +1 -0
  57. package/dist/io/segmentation/errors.d.ts +32 -0
  58. package/dist/io/segmentation/errors.d.ts.map +1 -0
  59. package/dist/io/segmentation/errors.js +29 -0
  60. package/dist/io/segmentation/errors.js.map +1 -0
  61. package/dist/io/segmentation/index.d.ts +13 -0
  62. package/dist/io/segmentation/index.d.ts.map +1 -0
  63. package/dist/io/segmentation/index.js +13 -0
  64. package/dist/io/segmentation/index.js.map +1 -0
  65. package/dist/io/segmentation/maskGeometry.d.ts +13 -0
  66. package/dist/io/segmentation/maskGeometry.d.ts.map +1 -0
  67. package/dist/io/segmentation/maskGeometry.js +37 -0
  68. package/dist/io/segmentation/maskGeometry.js.map +1 -0
  69. package/dist/io/segmentation/providers/ReplicateSegmentationProvider.d.ts +29 -0
  70. package/dist/io/segmentation/providers/ReplicateSegmentationProvider.d.ts.map +1 -0
  71. package/dist/io/segmentation/providers/ReplicateSegmentationProvider.js +235 -0
  72. package/dist/io/segmentation/providers/ReplicateSegmentationProvider.js.map +1 -0
  73. package/dist/io/segmentation/resolveMode.d.ts +14 -0
  74. package/dist/io/segmentation/resolveMode.d.ts.map +1 -0
  75. package/dist/io/segmentation/resolveMode.js +28 -0
  76. package/dist/io/segmentation/resolveMode.js.map +1 -0
  77. package/dist/io/segmentation/types.d.ts +134 -0
  78. package/dist/io/segmentation/types.d.ts.map +1 -0
  79. package/dist/io/segmentation/types.js +14 -0
  80. package/dist/io/segmentation/types.js.map +1 -0
  81. package/package.json +1 -1
@@ -0,0 +1,134 @@
1
+ /**
2
+ * @module io/segmentation/types
3
+ *
4
+ * Type definitions for provider-agnostic image segmentation.
5
+ *
6
+ * The segmentation surface takes an image plus exactly one prompt (text,
7
+ * points, box, or automatic "segment everything") and returns one
8
+ * {@link SegmentMask} per detected region. Masks are encoded white=object /
9
+ * black=background so they drop straight into the image-editing `mask` input.
10
+ *
11
+ * @see {@link ISegmentationProvider} for the provider contract.
12
+ */
13
+ /** Identifier for a segmentation backend. */
14
+ export type SegmentationProviderId = 'replicate' | (string & {});
15
+ /** Which kind of prompt drives the segmentation. Exactly one per call. */
16
+ export type SegmentationMode = 'text' | 'points' | 'box' | 'automatic';
17
+ /** A click point for point-prompted segmentation. */
18
+ export interface SegmentationPoint {
19
+ x: number;
20
+ y: number;
21
+ /** Defaults to `'foreground'` during normalization. */
22
+ label?: 'foreground' | 'background';
23
+ }
24
+ /** An axis-aligned box in image pixels (top-left origin). */
25
+ export interface SegmentationBox {
26
+ x: number;
27
+ y: number;
28
+ width: number;
29
+ height: number;
30
+ }
31
+ /** Per-provider passthrough options for the Replicate backend. */
32
+ export interface ReplicateSegmentationOptions {
33
+ /** Override the SAM2 model slug used for geometric prompts. */
34
+ samModelId?: string;
35
+ /** Override the GroundedSAM model slug used for text prompts. */
36
+ groundedSamModelId?: string;
37
+ /** Poll interval in milliseconds (default 1000). */
38
+ pollIntervalMs?: number;
39
+ /** Overall timeout in milliseconds (default 120000). */
40
+ timeoutMs?: number;
41
+ /** Extra fields merged verbatim into the Replicate `input`. */
42
+ input?: Record<string, unknown>;
43
+ }
44
+ /** Namespaced bag of per-provider options. */
45
+ export interface SegmentationProviderOptionBag {
46
+ replicate?: ReplicateSegmentationOptions;
47
+ [providerId: string]: unknown;
48
+ }
49
+ /** Public options accepted by the high-level {@link segment} helper. */
50
+ export interface SegmentOptions {
51
+ /** Source image as raw bytes or a file path. */
52
+ image: Buffer | Uint8Array | string;
53
+ /** Provider id. Defaults to `'replicate'`. */
54
+ provider?: SegmentationProviderId;
55
+ /** Model id override. Provider default is used when omitted. */
56
+ model?: string;
57
+ /** Open-vocabulary text prompt (routes to GroundedSAM). */
58
+ prompt?: string;
59
+ /** Point prompts (foreground/background clicks). */
60
+ points?: SegmentationPoint[];
61
+ /** Bounding-box prompt. */
62
+ box?: SegmentationBox;
63
+ /** "Segment everything" when `true`. */
64
+ automatic?: boolean;
65
+ /** Cap on returned masks (automatic/text can produce many). */
66
+ maxMasks?: number;
67
+ /** Confidence floor; masks scoring below this are dropped. */
68
+ minScore?: number;
69
+ /** Provider-specific passthrough options. */
70
+ providerOptions?: SegmentationProviderOptionBag | Record<string, unknown>;
71
+ /** Caller id for usage tracking. */
72
+ userId?: string;
73
+ }
74
+ /** A single segmented region. */
75
+ export interface SegmentMask {
76
+ /** PNG bytes; white(255)=object, black(0)=background (matches editImage mask). */
77
+ mask: Buffer;
78
+ /** Tight bounding box in source-image pixels, top-left origin. */
79
+ bbox: SegmentationBox;
80
+ /** Model confidence 0–1 (1 when the model reports none). */
81
+ score: number;
82
+ /** Grounding phrase for text prompts; undefined for geometric/automatic. */
83
+ label?: string;
84
+ /** Stable index within the result. */
85
+ index: number;
86
+ }
87
+ /** Aggregated segmentation result. */
88
+ export interface SegmentationResult {
89
+ masks: SegmentMask[];
90
+ /** Source image width in pixels (so bboxes/masks are interpretable). */
91
+ width: number;
92
+ /** Source image height in pixels. */
93
+ height: number;
94
+ providerId: string;
95
+ modelId: string;
96
+ promptMode: SegmentationMode;
97
+ usage?: {
98
+ totalMasks: number;
99
+ totalCostUSD?: number;
100
+ };
101
+ durationMs: number;
102
+ }
103
+ /**
104
+ * Normalized provider-level request produced by the {@link segment} helper
105
+ * from {@link SegmentOptions}. The image is already a `Buffer`, exactly one
106
+ * `mode` is resolved, and point labels are defaulted.
107
+ */
108
+ export interface SegmentationRequest {
109
+ modelId: string;
110
+ image: Buffer;
111
+ mode: SegmentationMode;
112
+ prompt?: string;
113
+ points?: Array<{
114
+ x: number;
115
+ y: number;
116
+ label: 'foreground' | 'background';
117
+ }>;
118
+ box?: SegmentationBox;
119
+ maxMasks?: number;
120
+ minScore?: number;
121
+ providerOptions?: SegmentationProviderOptionBag | Record<string, unknown>;
122
+ }
123
+ /** Contract implemented by every segmentation backend. */
124
+ export interface ISegmentationProvider {
125
+ readonly providerId: string;
126
+ readonly isInitialized: boolean;
127
+ readonly defaultModelId?: string;
128
+ initialize(config: Record<string, unknown>): Promise<void>;
129
+ segment(request: SegmentationRequest): Promise<SegmentationResult>;
130
+ /** Prompt modes this provider supports, for up-front validation. */
131
+ supportedModes(): ReadonlyArray<SegmentationMode>;
132
+ shutdown?(): Promise<void>;
133
+ }
134
+ //# sourceMappingURL=types.d.ts.map
@@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;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAAA;KAAE,CAAC,CAAC;IAC7E,GAAG,CAAC,EAAE,eAAe,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,6BAA6B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3E;AAED,0DAA0D;AAC1D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,OAAO,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACnE,oEAAoE;IACpE,cAAc,IAAI,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAClD,QAAQ,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @module io/segmentation/types
3
+ *
4
+ * Type definitions for provider-agnostic image segmentation.
5
+ *
6
+ * The segmentation surface takes an image plus exactly one prompt (text,
7
+ * points, box, or automatic "segment everything") and returns one
8
+ * {@link SegmentMask} per detected region. Masks are encoded white=object /
9
+ * black=background so they drop straight into the image-editing `mask` input.
10
+ *
11
+ * @see {@link ISegmentationProvider} for the provider contract.
12
+ */
13
+ export {};
14
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/io/segmentation/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@framers/agentos",
3
- "version": "0.9.34",
3
+ "version": "0.9.36",
4
4
  "description": "AgentOS: open-source TypeScript framework for autonomous AI agents. Unified graph orchestration, cognitive memory, runtime tool forging, multi-tier guardrails, voice pipeline, and 11 LLM providers.",
5
5
  "homepage": "https://agentos.sh",
6
6
  "repository": {