Skip to content

Commit d06b5e2

Browse files
feat(api): api update
1 parent b8b9fa6 commit d06b5e2

5 files changed

Lines changed: 115 additions & 3 deletions

File tree

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 28
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai/arcade-engine-754b6c8a1879b29dfaad8bb3dd320eb8f8cdf2c168c092c8391f6c3554a9d20d.yml
3-
openapi_spec_hash: 547bfade0680eeba3a140d682f69eddb
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai/arcade-engine-5879911473e1ede46b0df56fe8cd6b9aa69a5f9eae78d0998b38801c3432365d.yml
3+
openapi_spec_hash: 46488d017b718046ce4b90e58b2a82d6
44
config_hash: a976e52aaf30bd31cc387f57cafa9649

‎arcade-java-core/src/main/kotlin/dev/arcade/models/tools/ToolDefinition.kt‎

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ private constructor(
3030
private val toolkit: JsonField<Toolkit>,
3131
private val description: JsonField<String>,
3232
private val formattedSchema: JsonField<FormattedSchema>,
33+
private val indexState: JsonField<String>,
34+
private val lastIndexedAt: JsonField<String>,
3335
private val metadata: JsonField<Metadata>,
3436
private val output: JsonField<Output>,
3537
private val requirements: JsonField<Requirements>,
@@ -53,6 +55,12 @@ private constructor(
5355
@JsonProperty("formatted_schema")
5456
@ExcludeMissing
5557
formattedSchema: JsonField<FormattedSchema> = JsonMissing.of(),
58+
@JsonProperty("index_state")
59+
@ExcludeMissing
60+
indexState: JsonField<String> = JsonMissing.of(),
61+
@JsonProperty("last_indexed_at")
62+
@ExcludeMissing
63+
lastIndexedAt: JsonField<String> = JsonMissing.of(),
5664
@JsonProperty("metadata") @ExcludeMissing metadata: JsonField<Metadata> = JsonMissing.of(),
5765
@JsonProperty("output") @ExcludeMissing output: JsonField<Output> = JsonMissing.of(),
5866
@JsonProperty("requirements")
@@ -66,6 +74,8 @@ private constructor(
6674
toolkit,
6775
description,
6876
formattedSchema,
77+
indexState,
78+
lastIndexedAt,
6979
metadata,
7080
output,
7181
requirements,
@@ -115,6 +125,26 @@ private constructor(
115125
fun formattedSchema(): Optional<FormattedSchema> =
116126
formattedSchema.getOptional("formatted_schema")
117127

128+
/**
129+
* IndexState reports whether this tool is available through tool search yet ("indexed" or
130+
* "pending"). Populated only when tool search is active for the org and Condex is reachable;
131+
* otherwise omitted, so existing callers are unaffected. The handler derives and injects this
132+
* value — see the tool-listing enrichment path.
133+
*
134+
* @throws ArcadeInvalidDataException if the JSON field has an unexpected type (e.g. if the
135+
* server responded with an unexpected value).
136+
*/
137+
fun indexState(): Optional<String> = indexState.getOptional("index_state")
138+
139+
/**
140+
* LastIndexedAt is the tool's last successful index-write time, set only when IndexState is
141+
* "indexed" and Condex reported a timestamp.
142+
*
143+
* @throws ArcadeInvalidDataException if the JSON field has an unexpected type (e.g. if the
144+
* server responded with an unexpected value).
145+
*/
146+
fun lastIndexedAt(): Optional<String> = lastIndexedAt.getOptional("last_indexed_at")
147+
118148
/**
119149
* @throws ArcadeInvalidDataException if the JSON field has an unexpected type (e.g. if the
120150
* server responded with an unexpected value).
@@ -189,6 +219,22 @@ private constructor(
189219
@ExcludeMissing
190220
fun _formattedSchema(): JsonField<FormattedSchema> = formattedSchema
191221

222+
/**
223+
* Returns the raw JSON value of [indexState].
224+
*
225+
* Unlike [indexState], this method doesn't throw if the JSON field has an unexpected type.
226+
*/
227+
@JsonProperty("index_state") @ExcludeMissing fun _indexState(): JsonField<String> = indexState
228+
229+
/**
230+
* Returns the raw JSON value of [lastIndexedAt].
231+
*
232+
* Unlike [lastIndexedAt], this method doesn't throw if the JSON field has an unexpected type.
233+
*/
234+
@JsonProperty("last_indexed_at")
235+
@ExcludeMissing
236+
fun _lastIndexedAt(): JsonField<String> = lastIndexedAt
237+
192238
/**
193239
* Returns the raw JSON value of [metadata].
194240
*
@@ -251,6 +297,8 @@ private constructor(
251297
private var toolkit: JsonField<Toolkit>? = null
252298
private var description: JsonField<String> = JsonMissing.of()
253299
private var formattedSchema: JsonField<FormattedSchema> = JsonMissing.of()
300+
private var indexState: JsonField<String> = JsonMissing.of()
301+
private var lastIndexedAt: JsonField<String> = JsonMissing.of()
254302
private var metadata: JsonField<Metadata> = JsonMissing.of()
255303
private var output: JsonField<Output> = JsonMissing.of()
256304
private var requirements: JsonField<Requirements> = JsonMissing.of()
@@ -265,6 +313,8 @@ private constructor(
265313
toolkit = toolDefinition.toolkit
266314
description = toolDefinition.description
267315
formattedSchema = toolDefinition.formattedSchema
316+
indexState = toolDefinition.indexState
317+
lastIndexedAt = toolDefinition.lastIndexedAt
268318
metadata = toolDefinition.metadata
269319
output = toolDefinition.output
270320
requirements = toolDefinition.requirements
@@ -353,6 +403,40 @@ private constructor(
353403
this.formattedSchema = formattedSchema
354404
}
355405

406+
/**
407+
* IndexState reports whether this tool is available through tool search yet ("indexed" or
408+
* "pending"). Populated only when tool search is active for the org and Condex is
409+
* reachable; otherwise omitted, so existing callers are unaffected. The handler derives and
410+
* injects this value — see the tool-listing enrichment path.
411+
*/
412+
fun indexState(indexState: String) = indexState(JsonField.of(indexState))
413+
414+
/**
415+
* Sets [Builder.indexState] to an arbitrary JSON value.
416+
*
417+
* You should usually call [Builder.indexState] with a well-typed [String] value instead.
418+
* This method is primarily for setting the field to an undocumented or not yet supported
419+
* value.
420+
*/
421+
fun indexState(indexState: JsonField<String>) = apply { this.indexState = indexState }
422+
423+
/**
424+
* LastIndexedAt is the tool's last successful index-write time, set only when IndexState is
425+
* "indexed" and Condex reported a timestamp.
426+
*/
427+
fun lastIndexedAt(lastIndexedAt: String) = lastIndexedAt(JsonField.of(lastIndexedAt))
428+
429+
/**
430+
* Sets [Builder.lastIndexedAt] to an arbitrary JSON value.
431+
*
432+
* You should usually call [Builder.lastIndexedAt] with a well-typed [String] value instead.
433+
* This method is primarily for setting the field to an undocumented or not yet supported
434+
* value.
435+
*/
436+
fun lastIndexedAt(lastIndexedAt: JsonField<String>) = apply {
437+
this.lastIndexedAt = lastIndexedAt
438+
}
439+
356440
fun metadata(metadata: Metadata) = metadata(JsonField.of(metadata))
357441

358442
/**
@@ -431,6 +515,8 @@ private constructor(
431515
checkRequired("toolkit", toolkit),
432516
description,
433517
formattedSchema,
518+
indexState,
519+
lastIndexedAt,
434520
metadata,
435521
output,
436522
requirements,
@@ -460,6 +546,8 @@ private constructor(
460546
toolkit().validate()
461547
description()
462548
formattedSchema().ifPresent { it.validate() }
549+
indexState()
550+
lastIndexedAt()
463551
metadata().ifPresent { it.validate() }
464552
output().ifPresent { it.validate() }
465553
requirements().ifPresent { it.validate() }
@@ -488,6 +576,8 @@ private constructor(
488576
(toolkit.asKnown().getOrNull()?.validity() ?: 0) +
489577
(if (description.asKnown().isPresent) 1 else 0) +
490578
(formattedSchema.asKnown().getOrNull()?.validity() ?: 0) +
579+
(if (indexState.asKnown().isPresent) 1 else 0) +
580+
(if (lastIndexedAt.asKnown().isPresent) 1 else 0) +
491581
(metadata.asKnown().getOrNull()?.validity() ?: 0) +
492582
(output.asKnown().getOrNull()?.validity() ?: 0) +
493583
(requirements.asKnown().getOrNull()?.validity() ?: 0)
@@ -3820,6 +3910,8 @@ private constructor(
38203910
toolkit == other.toolkit &&
38213911
description == other.description &&
38223912
formattedSchema == other.formattedSchema &&
3913+
indexState == other.indexState &&
3914+
lastIndexedAt == other.lastIndexedAt &&
38233915
metadata == other.metadata &&
38243916
output == other.output &&
38253917
requirements == other.requirements &&
@@ -3835,6 +3927,8 @@ private constructor(
38353927
toolkit,
38363928
description,
38373929
formattedSchema,
3930+
indexState,
3931+
lastIndexedAt,
38383932
metadata,
38393933
output,
38403934
requirements,
@@ -3845,5 +3939,5 @@ private constructor(
38453939
override fun hashCode(): Int = hashCode
38463940

38473941
override fun toString() =
3848-
"ToolDefinition{fullyQualifiedName=$fullyQualifiedName, input=$input, name=$name, qualifiedName=$qualifiedName, toolkit=$toolkit, description=$description, formattedSchema=$formattedSchema, metadata=$metadata, output=$output, requirements=$requirements, additionalProperties=$additionalProperties}"
3942+
"ToolDefinition{fullyQualifiedName=$fullyQualifiedName, input=$input, name=$name, qualifiedName=$qualifiedName, toolkit=$toolkit, description=$description, formattedSchema=$formattedSchema, indexState=$indexState, lastIndexedAt=$lastIndexedAt, metadata=$metadata, output=$output, requirements=$requirements, additionalProperties=$additionalProperties}"
38493943
}

‎arcade-java-core/src/test/kotlin/dev/arcade/models/tools/ToolDefinitionTest.kt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ internal class ToolDefinitionTest {
5555
.putAdditionalProperty("foo", JsonValue.from("bar"))
5656
.build()
5757
)
58+
.indexState("index_state")
59+
.lastIndexedAt("last_indexed_at")
5860
.metadata(
5961
ToolDefinition.Metadata.builder()
6062
.behavior(
@@ -173,6 +175,8 @@ internal class ToolDefinitionTest {
173175
.putAdditionalProperty("foo", JsonValue.from("bar"))
174176
.build()
175177
)
178+
assertThat(toolDefinition.indexState()).contains("index_state")
179+
assertThat(toolDefinition.lastIndexedAt()).contains("last_indexed_at")
176180
assertThat(toolDefinition.metadata())
177181
.contains(
178182
ToolDefinition.Metadata.builder()
@@ -295,6 +299,8 @@ internal class ToolDefinitionTest {
295299
.putAdditionalProperty("foo", JsonValue.from("bar"))
296300
.build()
297301
)
302+
.indexState("index_state")
303+
.lastIndexedAt("last_indexed_at")
298304
.metadata(
299305
ToolDefinition.Metadata.builder()
300306
.behavior(

‎arcade-java-core/src/test/kotlin/dev/arcade/models/tools/ToolListPageResponseTest.kt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ internal class ToolListPageResponseTest {
6060
.putAdditionalProperty("foo", JsonValue.from("bar"))
6161
.build()
6262
)
63+
.indexState("index_state")
64+
.lastIndexedAt("last_indexed_at")
6365
.metadata(
6466
ToolDefinition.Metadata.builder()
6567
.behavior(
@@ -187,6 +189,8 @@ internal class ToolListPageResponseTest {
187189
.putAdditionalProperty("foo", JsonValue.from("bar"))
188190
.build()
189191
)
192+
.indexState("index_state")
193+
.lastIndexedAt("last_indexed_at")
190194
.metadata(
191195
ToolDefinition.Metadata.builder()
192196
.behavior(
@@ -317,6 +321,8 @@ internal class ToolListPageResponseTest {
317321
.putAdditionalProperty("foo", JsonValue.from("bar"))
318322
.build()
319323
)
324+
.indexState("index_state")
325+
.lastIndexedAt("last_indexed_at")
320326
.metadata(
321327
ToolDefinition.Metadata.builder()
322328
.behavior(

‎arcade-java-core/src/test/kotlin/dev/arcade/models/workers/WorkerToolsPageResponseTest.kt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ internal class WorkerToolsPageResponseTest {
6262
.putAdditionalProperty("foo", JsonValue.from("bar"))
6363
.build()
6464
)
65+
.indexState("index_state")
66+
.lastIndexedAt("last_indexed_at")
6567
.metadata(
6668
ToolDefinition.Metadata.builder()
6769
.behavior(
@@ -189,6 +191,8 @@ internal class WorkerToolsPageResponseTest {
189191
.putAdditionalProperty("foo", JsonValue.from("bar"))
190192
.build()
191193
)
194+
.indexState("index_state")
195+
.lastIndexedAt("last_indexed_at")
192196
.metadata(
193197
ToolDefinition.Metadata.builder()
194198
.behavior(
@@ -319,6 +323,8 @@ internal class WorkerToolsPageResponseTest {
319323
.putAdditionalProperty("foo", JsonValue.from("bar"))
320324
.build()
321325
)
326+
.indexState("index_state")
327+
.lastIndexedAt("last_indexed_at")
322328
.metadata(
323329
ToolDefinition.Metadata.builder()
324330
.behavior(

0 commit comments

Comments
 (0)