@h1r-ai/croche-react-native 0.5.2 → 0.5.3

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
@@ -1,5 +1,15 @@
1
1
  # @h1r-ai/croche-react-native
2
2
 
3
+ ## App temperature (0.5.3)
4
+
5
+ In `Croche.open({config: ...})`, `config.temperature` is a finite number 0–2.
6
+ Absent uses a tuned default when no layer supplies it; `null` omits it (including an inherited
7
+ value). For example: `config: {instructions: 'Be helpful.', temperature: null}`.
8
+ Structured calls always omit temperature; summary calls keep their existing behavior.
9
+ Remote config documents carrying it require schema 4 and SDK 0.5.3+; older apps
10
+ keep compatible config instead. RN shares the TS project config type; this is not
11
+ a new host option or native bridge field.
12
+
3
13
  Put an AI character or assistant into a React Native app, on iOS and Android, with **no
4
14
  backend of your own**. You write instructions and JavaScript tools. Croche runs the
5
15
  model and tool loop, streams replies, remembers across sessions, keeps per-user
@@ -25,6 +35,9 @@ npm install @h1r-ai/croche @h1r-ai/croche-react-native
25
35
  cd ios && pod install
26
36
  ```
27
37
 
38
+ Install both npm packages together without version suffixes. Commit the project lockfile
39
+ to record their resolved versions.
40
+
28
41
  `@h1r-ai/croche` is a peer dependency: this package shares its types, and the app holds
29
42
  exactly one copy. The React Native package contains the native Core: the iOS xcframework
30
43
  (`ios/vendor`) and the Android libraries for arm64-v8a, armeabi-v7a and x86_64
@@ -6,6 +6,8 @@ import java.io.File
6
6
  data class OpenOptions(
7
7
  val cloudUrl: String? = null,
8
8
  val projectKey: String,
9
+ /** App config temperature: number 0..2; absent uses a tuned default; JsonNull = omit.
10
+ * Structured calls always omit it; remote configs require schema 4 / 0.5.3+. */
9
11
  val config: JsonObject,
10
12
  val user: String? = null,
11
13
  val handlers: Map<String, ToolHandler> = emptyMap(),
@@ -9,6 +9,8 @@ public enum Attestation: String, Sendable { case platform, off }
9
9
  public struct OpenOptions: Sendable {
10
10
  public var cloudUrl: String?
11
11
  public var projectKey: String
12
+ /// App configuration. `temperature`: number 0...2, absent uses a tuned default, `.null` = omit.
13
+ /// Structured calls always omit it. Remote temperature configs require schema 4 / 0.5.3+.
12
14
  public var config: JSON
13
15
  public var user: String?
14
16
  public var handlers: [String: ToolHandler]
@@ -10,15 +10,18 @@
10
10
  <key>HeadersPath</key>
11
11
  <string>Headers</string>
12
12
  <key>LibraryIdentifier</key>
13
- <string>ios-arm64</string>
13
+ <string>ios-arm64_x86_64-simulator</string>
14
14
  <key>LibraryPath</key>
15
15
  <string>libcroche_ffi.a</string>
16
16
  <key>SupportedArchitectures</key>
17
17
  <array>
18
18
  <string>arm64</string>
19
+ <string>x86_64</string>
19
20
  </array>
20
21
  <key>SupportedPlatform</key>
21
22
  <string>ios</string>
23
+ <key>SupportedPlatformVariant</key>
24
+ <string>simulator</string>
22
25
  </dict>
23
26
  <dict>
24
27
  <key>BinaryPath</key>
@@ -26,18 +29,15 @@
26
29
  <key>HeadersPath</key>
27
30
  <string>Headers</string>
28
31
  <key>LibraryIdentifier</key>
29
- <string>ios-arm64_x86_64-simulator</string>
32
+ <string>ios-arm64</string>
30
33
  <key>LibraryPath</key>
31
34
  <string>libcroche_ffi.a</string>
32
35
  <key>SupportedArchitectures</key>
33
36
  <array>
34
37
  <string>arm64</string>
35
- <string>x86_64</string>
36
38
  </array>
37
39
  <key>SupportedPlatform</key>
38
40
  <string>ios</string>
39
- <key>SupportedPlatformVariant</key>
40
- <string>simulator</string>
41
41
  </dict>
42
42
  </array>
43
43
  <key>CFBundlePackageType</key>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h1r-ai/croche-react-native",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -20,11 +20,11 @@
20
20
  "THIRD-PARTY-NOTICES"
21
21
  ],
22
22
  "peerDependencies": {
23
- "@h1r-ai/croche": "0.5.2",
23
+ "@h1r-ai/croche": "0.5.3",
24
24
  "react-native": ">=0.76"
25
25
  },
26
26
  "devDependencies": {
27
- "@h1r-ai/croche": "0.5.2"
27
+ "@h1r-ai/croche": "0.5.3"
28
28
  },
29
29
  "codegenConfig": {
30
30
  "name": "CrocheRuntimeSpec",
package/src/index.ts CHANGED
@@ -134,6 +134,8 @@ export interface ReactNativeRuntimeOptions {
134
134
  maxIterations?: number;
135
135
  maxOutputTokens?: number;
136
136
  maxContextTokens?: number;
137
+ /** Plain agent calls: 0–2, absent uses a tuned default, null = omit. Structured calls always omit it. */
138
+ temperature?: number | null;
137
139
  requestTimeoutMs?: number;
138
140
  /** Overrides the store name Core derives from Cloud, project, installation, user and agent. */
139
141
  storageKey?: string;
@@ -153,7 +155,9 @@ export interface ReactNativeRuntimeOptions {
153
155
  debugKey?: string;
154
156
  /**
155
157
  * Background upkeep after each turn, on a timer, and when the app returns to the foreground
156
- * (default true). False turns all three off: call maintain() yourself.
158
+ * (default true). False turns all three off. With CrocheRuntime.create, call maintain()
159
+ * yourself. With Croche.open, leave it on: that API has no maintain(), so call reports are
160
+ * kept and sent at the next open.
157
161
  */
158
162
  backgroundSync?: boolean;
159
163
  /** How often upkeep checks whether work is due. Default 60000. Foreground returns inside it run upkeep once. */
@@ -180,7 +184,7 @@ export interface MaintenanceResult { ran: boolean; ok?: boolean; preempted?: boo
180
184
  declare const __DEV__: boolean | undefined;
181
185
  /** The founder's condition for debug keys: never silent in a shipped build. */
182
186
  /** The options this SDK declares: a Record over the interface, so adding or removing one without this fails to compile. */
183
- const DECLARED_OPTIONS: Record<keyof ReactNativeRuntimeOptions, true> = { user: true, agentId: true, android: true, attestation: true, backgroundDelivery: true, backgroundSync: true, cloudUrl: true, debugKey: true, heartbeat: true, instructions: true, maintenanceIntervalMs: true, markerGuide: true, toolGuide: true, crocheTools: true, maxContextTokens: true, maxIterations: true, maxOutputTokens: true, memory: true, onUsage: true, projectKey: true, requestTimeoutMs: true, storageKey: true, streaming: true, tools: true, wiki: true };
187
+ const DECLARED_OPTIONS: Record<keyof ReactNativeRuntimeOptions, true> = { user: true, agentId: true, android: true, attestation: true, backgroundDelivery: true, backgroundSync: true, cloudUrl: true, debugKey: true, heartbeat: true, instructions: true, maintenanceIntervalMs: true, markerGuide: true, toolGuide: true, crocheTools: true, maxContextTokens: true, maxIterations: true, maxOutputTokens: true, temperature: true, memory: true, onUsage: true, projectKey: true, requestTimeoutMs: true, storageKey: true, streaming: true, tools: true, wiki: true };
184
188
  const warnedOptions = new Set<string>();
185
189
  function warnUnknownOptions(options: ReactNativeRuntimeOptions) {
186
190
  for (const key of Object.keys(options)) {